Revert last code drop.
authorPat Downey <patd@symbian.org>
Fri, 04 Jun 2010 10:19:18 +0100
changeset 37 ba76fc04e6c2
parent 36 2eacb6118286
child 42 a822ce7b2002
child 45 6b911d05207e
Revert last code drop.
group/bld.inf
layers.sysdef.xml
phone.pro
phone_plat/3d_ringing_tone_enabler_api/3d_ringing_tone_enabler_api.metaxml
phone_plat/3d_ringing_tone_enabler_api/group/bld.inf
phone_plat/3d_ringing_tone_enabler_api/inc/c3dringingtoneinterface.h
phone_plat/3d_ringing_tone_enabler_api/inc/c3dringingtoneinterface.inl
phone_plat/dialer_keypad_api/dialer_keypad_api.metaxml
phone_plat/dialer_keypad_api/group/bld.inf
phone_plat/dialer_keypad_api/inc/cvideodtmfdialer.h
phone_plat/group/bld.inf
phone_plat/phone_application_commands_api/group/bld.inf
phone_plat/phone_application_commands_api/inc/phoneappcommands.hrh
phone_plat/phone_application_commands_api/inc/xqphoneappcommands.h
phone_plat/phone_application_voip_commands_api/group/bld.inf
phone_plat/phone_application_voip_commands_api/inc/phoneappvoipcommands.hrh
phone_plat/telephony_bubble_extension_api/group/bld.inf
phone_plat/telephony_bubble_extension_api/inc/telbubbleanim.h
phone_plat/telephony_bubble_extension_api/inc/telbubblecallimage.h
phone_plat/telephony_bubble_extension_api/inc/telbubblecustomelement.h
phone_plat/telephony_bubble_extension_api/inc/telbubbleextension.h
phone_plat/telephony_bubble_extension_api/inc/telbubbleextension.inl
phone_plat/telephony_bubble_extension_api/inc/telbubbleextensiondata.h
phone_plat/telephony_bubble_extension_api/inc/telbubbleextensioninterface.h
phone_plat/telephony_bubble_extension_api/inc/telbubbleextensionobserver.h
phone_plat/telephony_bubble_extension_api/inc/telbubbleimage.h
phone_plat/telephony_bubble_extension_api/inc/telbubblelabel.h
phone_plat/telephony_comms_information_api/group/bld.inf
phone_plat/telephony_comms_information_api/inc/telcommsinfopskeys.h
phone_plat/telephony_comms_information_api/telephony_comms_information_api.metaxml
phone_plat/telephony_configuration_api/group/bld.inf
phone_plat/telephony_configuration_api/inc/telconfigcrkeys.h
phone_plat/telephony_configuration_api/telephony_configuration_api.metaxml
phone_plat/telephony_device_mode_api/group/bld.inf
phone_plat/telephony_device_mode_api/inc/CTelDMHandler.h
phone_plat/telephony_device_mode_api/telephony_device_mode_api.metaxml
phone_plat/telephony_information_api/group/bld.inf
phone_plat/telephony_information_api/inc/telephonydomaincrkeys.h
phone_plat/telephony_information_api/inc/telephonydomainpskeys.h
phone_plat/telephony_information_api/inc/telephonydomainpstypes.h
phone_plat/telephony_information_api/inc/telincallvolcntrlcrkeys.h
phone_plat/telephony_information_api/inc/telinformationpskeys.h
phone_plat/telephony_information_api/inc/telinformationpstypes.h
phone_plat/telephony_information_api/telephony_information_api.metaxml
phone_plat/telephony_logging_extension_api/group/bld.inf
phone_plat/telephony_logging_extension_api/inc/telloggingextension.h
phone_plat/telephony_logging_extension_api/inc/telloggingextension.inl
phone_plat/telephony_matching_extension_api/group/bld.inf
phone_plat/telephony_matching_extension_api/inc/telmatchingextension.h
phone_plat/telephony_matching_extension_api/inc/telmatchingextension.inl
phone_plat/telephony_mediator_api/group/bld.inf
phone_plat/telephony_mediator_api/inc/mediatoraudiocommandstotelephonyapi.h
phone_plat/telephony_mediator_api/inc/mediatorcommandstotelephonyapi.h
phone_plat/telephony_mediator_api/inc/mediatoreventsfromtelephonyapi.h
phone_plat/telephony_menu_extension_api/group/bld.inf
phone_plat/telephony_menu_extension_api/inc/telmenuextension.h
phone_plat/telephony_menu_extension_api/inc/telmenuextension.inl
phone_plat/telephony_menu_extension_api/inc/teltouchpaneextension.h
phone_plat/telephony_menu_extension_api/inc/xqteluicommandextension.h
phone_plat/telephony_microphone_mute_status_api/group/bld.inf
phone_plat/telephony_microphone_mute_status_api/inc/telmicmutestatuspskeys.h
phone_plat/telephony_microphone_mute_status_api/telephony_microphone_mute_status_api.metaxml
phone_plat/telephony_remote_party_information_api/group/bld.inf
phone_plat/telephony_remote_party_information_api/inc/telremotepartyinformationpskeys.h
phone_plat/telephony_remote_party_information_api/telephony_remote_party_information_api.metaxml
phone_plat/telephony_video_mailbox_settings_api/group/bld.inf
phone_plat/telephony_video_mailbox_settings_api/inc/telvmbxsettingscrkeys.h
phone_plat/telephony_video_mailbox_settings_api/telephony_video_mailbox_settings_api.metaxml
phone_plat/tsrc/group/bld.inf
phone_plat/video_telephony_control_mediator_api/group/bld.inf
phone_plat/video_telephony_control_mediator_api/inc/videotelcontrolmediatorapi.h
phone_plat/video_telephony_mediator_api/group/bld.inf
phone_plat/video_telephony_mediator_api/inc/videoteltophonecommandsapi.h
phoneapp/Blacklist/group/bld.inf
phoneapp/Blacklist/group/phoneanimdll.mmp
phoneapp/Blacklist/group/phoneanimdll_stub.SIS
phoneapp/Blacklist/group/phoneanimdll_stub.pkg
phoneapp/Blacklist/inc/CPhoneAnimDll.h
phoneapp/Blacklist/inc/CPhoneBlacklistAnim.h
phoneapp/Blacklist/inc/phoneanimdllstd.h
phoneapp/Blacklist/rom/PhoneAnimDll.iby
phoneapp/Blacklist/src/CPhoneAnimDll.cpp
phoneapp/Blacklist/src/CPhoneBlacklistAnim.cpp
phoneapp/group/bld.inf
phoneapp/phonemediatorcenter/bwins/phonemediatorcenteru.def
phoneapp/phonemediatorcenter/eabi/phonemediatorcenteru.def
phoneapp/phonemediatorcenter/group/bld.inf
phoneapp/phonemediatorcenter/group/phonemediatorcenter.mmp
phoneapp/phonemediatorcenter/group/phonemediatorcenter_stub.pkg
phoneapp/phonemediatorcenter/group/phonemediatorcenter_stub.sis
phoneapp/phonemediatorcenter/inc/cphonecontinueemergencycallcommand.h
phoneapp/phonemediatorcenter/inc/cphonedataportmessage.h
phoneapp/phonemediatorcenter/inc/cphonemediatorcommandlistener.h
phoneapp/phonemediatorcenter/inc/cphonemediatorfactory.h
phoneapp/phonemediatorcenter/inc/cphonemediatormessagefactory.h
phoneapp/phonemediatorcenter/inc/cphonemediatorsender.h
phoneapp/phonemediatorcenter/inc/cphonereleasecommand.h
phoneapp/phonemediatorcenter/inc/cphoneswitchtovideoorvoicecommand.h
phoneapp/phonemediatorcenter/inc/cphoneterminateallconnectionscommand.h
phoneapp/phonemediatorcenter/inc/mphonemediatormessage.h
phoneapp/phonemediatorcenter/inc/mphoneshutdowncommand.h
phoneapp/phonemediatorcenter/src/cphonecontinueemergencycallcommand.cpp
phoneapp/phonemediatorcenter/src/cphonedataportmessage.cpp
phoneapp/phonemediatorcenter/src/cphonemediatorcommandlistener.cpp
phoneapp/phonemediatorcenter/src/cphonemediatorfactory.cpp
phoneapp/phonemediatorcenter/src/cphonemediatormessagefactory.cpp
phoneapp/phonemediatorcenter/src/cphonemediatorsender.cpp
phoneapp/phonemediatorcenter/src/cphonereleasecommand.cpp
phoneapp/phonemediatorcenter/src/cphoneswitchtovideoorvoicecommand.cpp
phoneapp/phonemediatorcenter/src/cphoneterminateallconnectionscommand.cpp
phoneapp/phoneringingtoneplayer/bwins/PhoneRingingtonePlayeru.def
phoneapp/phoneringingtoneplayer/eabi/PhoneRingingtonePlayeru.def
phoneapp/phoneringingtoneplayer/group/bld.inf
phoneapp/phoneringingtoneplayer/group/phoneringingtoneplayer.mmp
phoneapp/phoneringingtoneplayer/inc/cphoneaudioplayer.h
phoneapp/phoneringingtoneplayer/inc/cphoneringingtone.h
phoneapp/phoneringingtoneplayer/inc/cphoneringingtonecontroller.h
phoneapp/phoneringingtoneplayer/inc/cphoneringingtoneplayer.h
phoneapp/phoneringingtoneplayer/inc/cphonettsplayer.h
phoneapp/phoneringingtoneplayer/inc/mphoneaudioplayerobserver.h
phoneapp/phoneringingtoneplayer/inc/mphonecoveruiobserver.h
phoneapp/phoneringingtoneplayer/inc/mphoneringingtoneobserver.h
phoneapp/phoneringingtoneplayer/inc/mphonevideoplayer.h
phoneapp/phoneringingtoneplayer/inc/mphonevideoplayerobserver.h
phoneapp/phoneringingtoneplayer/src/cphoneaudioplayer.cpp
phoneapp/phoneringingtoneplayer/src/cphoneringingtone.cpp
phoneapp/phoneringingtoneplayer/src/cphoneringingtonecontroller.cpp
phoneapp/phoneringingtoneplayer/src/cphoneringingtoneplayer.cpp
phoneapp/phoneringingtoneplayer/src/cphonettsplayer.cpp
phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/main.cpp
phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/sample.mp3
phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer.cpp
phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer.h
phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer.pro
phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer_armv5_urel.sis
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/bwins/ut_cphoneringingtonecontrolleru.def
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/group/bld.inf
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/group/ut_cphoneringingtonecontroller.mmp
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/mocks/mock_cphoneringingtoneplayer.cpp
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/mocks/mock_cphonettsplayer.cpp
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/src/ut_cphoneringingtonecontroller.cpp
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/src/ut_cphoneringingtonecontroller.h
phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/src/ut_cphoneringingtonecontroller_dllmain.cpp
phoneapp/phonestringloader/bwins/phonestringloaderu.def
phoneapp/phonestringloader/eabi/phonestringloaderu.def
phoneapp/phonestringloader/phonestringloader.pri
phoneapp/phonestringloader/phonestringloader.pro
phoneapp/phonestringloader/src/stringloader.cpp
phoneapp/phonestringloader/tsrc/runtests.bat
phoneapp/phonestringloader/tsrc/unit.pro
phoneapp/phonestringloader/tsrc/ut_phonestringloader/phoneresourceadapter.h
phoneapp/phonestringloader/tsrc/ut_phonestringloader/unit_tests.cpp
phoneapp/phonestringloader/tsrc/ut_phonestringloader/ut_phonestringloader.pro
phoneapp/phoneui2/inc/hbphonemainwindow.h
phoneapp/phoneui2/inc/phoneuicommandadapter.h
phoneapp/phoneui2/inc/phoneuihousehold.h
phoneapp/phoneui2/inc/phoneuihousehold_p.h
phoneapp/phoneui2/inc/phoneuikeyeventadapter.h
phoneapp/phoneui2/loc/basiccallhandling.loc
phoneapp/phoneui2/loc/callheadertexts.loc
phoneapp/phoneui2/loc/callterminationnote.loc
phoneapp/phoneui2/loc/dialer.loc
phoneapp/phoneui2/loc/dtmfsignalling.loc
phoneapp/phoneui2/loc/incallmenuandsoftkeys.loc
phoneapp/phoneui2/loc/incalloperations.loc
phoneapp/phoneui2/loc/mobileoriginatedcalls.loc
phoneapp/phoneui2/loc/multicallhandling.loc
phoneapp/phoneui2/loc/numberentry.loc
phoneapp/phoneui2/loc/phone.loc
phoneapp/phoneui2/loc/voip.loc
phoneapp/phoneui2/phoneui2.pro
phoneapp/phoneui2/phoneui2.qrc
phoneapp/phoneui2/rom/phoneui.iby
phoneapp/phoneui2/rom/phoneuiresources.iby
phoneapp/phoneui2/src/hbphonemainwindow.cpp
phoneapp/phoneui2/src/main.cpp
phoneapp/phoneui2/src/phoneuicommandadapter.cpp
phoneapp/phoneui2/src/phoneuihousehold.cpp
phoneapp/phoneui2/src/phoneuihousehold_p.cpp
phoneapp/phoneui2/src/phoneuikeyeventadapter.cpp
phoneapp/phoneui2/srcdata/phoneui.hrh
phoneapp/phoneui2/srcdata/phoneui.pan
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_contacts.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_dialer.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_drop_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_end_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_hold_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_join_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mic_mute.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mic_unmute.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mobile.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_private_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_reject_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_replace_call.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_send.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg
phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_swap.svg
phoneapp/phoneui2/tsrc/ut_phonemainwindow/common.pri
phoneapp/phoneui2/tsrc/ut_phonemainwindow/hbglobal_p.h
phoneapp/phoneui2/tsrc/ut_phonemainwindow/phoneuihousehold_stub.cpp
phoneapp/phoneui2/tsrc/ut_phonemainwindow/ut_phonemainwindow.cpp
phoneapp/phoneui2/tsrc/ut_phonemainwindow/ut_phonemainwindow.pro
phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/cphoneuicontroller_stub.cpp
phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/cphoneuicontroller_stub.h
phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/unit_tests.cpp
phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/ut_phoneuicommandadapter.pro
phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/cphoneuicontroller_stub.cpp
phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/cphoneuicontroller_stub.h
phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/unit_tests.cpp
phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/ut_phoneuikeyeventadapter.pro
phoneapp/phoneuicontrol/bwins/phoneuicontrolu.def
phoneapp/phoneuicontrol/eabi/phoneuicontrolu.def
phoneapp/phoneuicontrol/group/bld.inf
phoneapp/phoneuicontrol/group/phoneuicontrol.mmp
phoneapp/phoneuicontrol/group/phoneuicontrol_stub.pkg
phoneapp/phoneuicontrol/group/phoneuicontrol_stub.sis
phoneapp/phoneuicontrol/inc/cphoneaccessorybthandler.h
phoneapp/phoneuicontrol/inc/cphonebtaadisconnecthandler.h
phoneapp/phoneuicontrol/inc/cphonecallheadermanager.h
phoneapp/phoneuicontrol/inc/cphonecbamanager.h
phoneapp/phoneuicontrol/inc/cphonedtmfwaitchartimer.h
phoneapp/phoneuicontrol/inc/cphoneenginehandler.h
phoneapp/phoneuicontrol/inc/cphonekeyeventforwarder.h
phoneapp/phoneuicontrol/inc/cphonenumberentrymanager.h
phoneapp/phoneuicontrol/inc/cphonereconnectquery.h
phoneapp/phoneuicontrol/inc/cphoneremotecontrolhandler.h
phoneapp/phoneuicontrol/inc/cphonestate.h
phoneapp/phoneuicontrol/inc/cphonestatecallsetup.h
phoneapp/phoneuicontrol/inc/cphonestatehandle.h
phoneapp/phoneuicontrol/inc/cphonestateidle.h
phoneapp/phoneuicontrol/inc/cphonestateincall.h
phoneapp/phoneuicontrol/inc/cphonestateincoming.h
phoneapp/phoneuicontrol/inc/cphonestatemachine.h
phoneapp/phoneuicontrol/inc/cphonestatestartup.h
phoneapp/phoneuicontrol/inc/cphonesystemeventhandler.h
phoneapp/phoneuicontrol/inc/cphoneuicontroller.h
phoneapp/phoneuicontrol/inc/cphoneuistatemachinefactorybase.h
phoneapp/phoneuicontrol/inc/mphoneblockedkeys.h
phoneapp/phoneuicontrol/inc/mphonecallheadermanagerutility.h
phoneapp/phoneuicontrol/inc/mphonecustomization.h
phoneapp/phoneuicontrol/inc/mphonedivertif.h
phoneapp/phoneuicontrol/inc/mphoneengineevents.h
phoneapp/phoneuicontrol/inc/mphoneenginemessagesender.h
phoneapp/phoneuicontrol/inc/mphonekeyeventhandler.h
phoneapp/phoneuicontrol/inc/mphonekeyevents.h
phoneapp/phoneuicontrol/inc/mphonelockinfo.h
phoneapp/phoneuicontrol/inc/mphonemenuandcbaevents.h
phoneapp/phoneuicontrol/inc/mphoneneclearedhandler.h
phoneapp/phoneuicontrol/inc/mphonenumberentryevents.h
phoneapp/phoneuicontrol/inc/mphoneremotecontrolevents.h
phoneapp/phoneuicontrol/inc/mphonestate.h
phoneapp/phoneuicontrol/inc/mphonestatemachine.h
phoneapp/phoneuicontrol/inc/mphonesystemeventhandler.h
phoneapp/phoneuicontrol/inc/mphonesystemevents.h
phoneapp/phoneuicontrol/inc/mphoneuistatemachinefactory.h
phoneapp/phoneuicontrol/inc/phonestatedefinitions.h
phoneapp/phoneuicontrol/inc/tphonecallheaderparam.h
phoneapp/phoneuicontrol/src/cphoneaccessorybthandler.cpp
phoneapp/phoneuicontrol/src/cphonebtaadisconnecthandler.cpp
phoneapp/phoneuicontrol/src/cphonecallheadermanager.cpp
phoneapp/phoneuicontrol/src/cphonecbamanager.cpp
phoneapp/phoneuicontrol/src/cphonedtmfwaitchartimer.cpp
phoneapp/phoneuicontrol/src/cphoneenginehandler.cpp
phoneapp/phoneuicontrol/src/cphonekeyeventforwarder.cpp
phoneapp/phoneuicontrol/src/cphonenumberentrymanager.cpp
phoneapp/phoneuicontrol/src/cphonereconnectquery.cpp
phoneapp/phoneuicontrol/src/cphoneremotecontrolhandler.cpp
phoneapp/phoneuicontrol/src/cphonestate.cpp
phoneapp/phoneuicontrol/src/cphonestatecallsetup.cpp
phoneapp/phoneuicontrol/src/cphonestatehandle.cpp
phoneapp/phoneuicontrol/src/cphonestateidle.cpp
phoneapp/phoneuicontrol/src/cphonestateincall.cpp
phoneapp/phoneuicontrol/src/cphonestateincoming.cpp
phoneapp/phoneuicontrol/src/cphonestatemachine.cpp
phoneapp/phoneuicontrol/src/cphonestatestartup.cpp
phoneapp/phoneuicontrol/src/cphonesystemeventhandler.cpp
phoneapp/phoneuicontrol/src/cphoneuicontroller.cpp
phoneapp/phoneuicontrol/src/tphonecallheaderparam.cpp
phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def
phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def
phoneapp/phoneuiqtviewadapter/inc/mphonebuttoncustomization.h
phoneapp/phoneuiqtviewadapter/inc/mphonedialercontroller.h
phoneapp/phoneuiqtviewadapter/inc/mphoneviewblockingdialogobserver.h
phoneapp/phoneuiqtviewadapter/inc/mphoneviewcommandhandle.h
phoneapp/phoneuiqtviewadapter/inc/mphoneviewcustomization.h
phoneapp/phoneuiqtviewadapter/inc/phonebubblewrapper.h
phoneapp/phoneuiqtviewadapter/inc/phonecommandextensionwrapper.h
phoneapp/phoneuiqtviewadapter/inc/phoneindicatorcontroller.h
phoneapp/phoneuiqtviewadapter/inc/phonemessagecontroller.h
phoneapp/phoneuiqtviewadapter/inc/phonenotecontroller.h
phoneapp/phoneuiqtviewadapter/inc/phoneresourceadapter.h
phoneapp/phoneuiqtviewadapter/inc/phoneuicommandcontroller.h
phoneapp/phoneuiqtviewadapter/inc/phoneuiqtbuttonscontroller.h
phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h
phoneapp/phoneuiqtviewadapter/inc/phoneviewcommanddefinitions.h
phoneapp/phoneuiqtviewadapter/inc/telephonyservice.h
phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pri
phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pro
phoneapp/phoneuiqtviewadapter/src/phonebubblewrapper.cpp
phoneapp/phoneuiqtviewadapter/src/phonecommandextensionwrapper.cpp
phoneapp/phoneuiqtviewadapter/src/phoneindicatorcontroller.cpp
phoneapp/phoneuiqtviewadapter/src/phonemessagecontroller.cpp
phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp
phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp
phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp
phoneapp/phoneuiqtviewadapter/src/phoneuiqtbuttonscontroller.cpp
phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp
phoneapp/phoneuiqtviewadapter/src/telephonyservice.cpp
phoneapp/phoneuiqtviewadapter/tsrc/runtests.bat
phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/main.cpp
phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/u_carmodetester.pro
phoneapp/phoneuiqtviewadapter/tsrc/unit.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonebubblewrapper/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonebubblewrapper/ut_phonebubblewrapper.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/menuextension_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/menuextension_stub.h
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/ut_phonecommandextensionwrapper.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/xqpluginloader_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonemessagecontroller/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonemessagecontroller/ut_phonemessagecontroller.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/ut_phonenotecontroller.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/ut_phoneresourceadapter.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/phonecommandextensionwrapper_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/phoneuiqtbuttonscontroller_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/ut_phoneuicommandcontroller.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtbuttonscontroller/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtbuttonscontroller/ut_phoneuiqtbuttonscontroller.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/cphonemediatorfactory_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/cphonemediatorsender_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/cphoneringingtonecontroller_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phonebubblewrapper.h
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phonebubblewrapper_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phonenotecontroller_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phoneuiqtbuttonscontroller_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/ut_phoneuiqtviewadapter.pro
phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/phoneuiqtviewadapter_stub.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/unit_tests.cpp
phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/ut_telephonyservice.pro
phoneapp/phoneuistates/bwins/phoneuistatesu.def
phoneapp/phoneuistates/eabi/phoneuistatesu.def
phoneapp/phoneuistates/group/bld.inf
phoneapp/phoneuistates/group/phoneuistates.mmp
phoneapp/phoneuistates/group/phoneuistates_stub.pkg
phoneapp/phoneuistates/group/phoneuistates_stub.sis
phoneapp/phoneuistates/inc/cphonealerting.h
phoneapp/phoneuistates/inc/cphonecallsetup.h
phoneapp/phoneuistates/inc/cphonecallsetupandwaiting.h
phoneapp/phoneuistates/inc/cphoneconference.h
phoneapp/phoneuistates/inc/cphoneconferenceandcallsetup.h
phoneapp/phoneuistates/inc/cphoneconferenceandsingle.h
phoneapp/phoneuistates/inc/cphoneconferenceandsingleandwaiting.h
phoneapp/phoneuistates/inc/cphoneconferenceandwaiting.h
phoneapp/phoneuistates/inc/cphoneconferenceandwaitingandcallsetup.h
phoneapp/phoneuistates/inc/cphoneemergency.h
phoneapp/phoneuistates/inc/cphoneerrormessageshandler.h
phoneapp/phoneuistates/inc/cphonegeneralgsmmessageshandler.h
phoneapp/phoneuistates/inc/cphonegsmincall.h
phoneapp/phoneuistates/inc/cphoneidle.h
phoneapp/phoneuistates/inc/cphoneincoming.h
phoneapp/phoneuistates/inc/cphoneresourceresolvergsm.h
phoneapp/phoneuistates/inc/cphonesingleandalerting.h
phoneapp/phoneuistates/inc/cphonesingleandcallsetup.h
phoneapp/phoneuistates/inc/cphonesingleandcallsetupandwaiting.h
phoneapp/phoneuistates/inc/cphonesingleandwaiting.h
phoneapp/phoneuistates/inc/cphonesinglecall.h
phoneapp/phoneuistates/inc/cphonestartup.h
phoneapp/phoneuistates/inc/cphonestatemachinegsm.h
phoneapp/phoneuistates/inc/cphonetwosingles.h
phoneapp/phoneuistates/inc/cphonetwosinglesandwaiting.h
phoneapp/phoneuistates/inc/cphoneuistatemachinefactorygsm.h
phoneapp/phoneuistates/inc/phonestatedefinitionsgsm.h
phoneapp/phoneuistates/src/cphonealerting.cpp
phoneapp/phoneuistates/src/cphonecallsetup.cpp
phoneapp/phoneuistates/src/cphonecallsetupandwaiting.cpp
phoneapp/phoneuistates/src/cphoneconference.cpp
phoneapp/phoneuistates/src/cphoneconferenceandcallsetup.cpp
phoneapp/phoneuistates/src/cphoneconferenceandsingle.cpp
phoneapp/phoneuistates/src/cphoneconferenceandsingleandwaiting.cpp
phoneapp/phoneuistates/src/cphoneconferenceandwaiting.cpp
phoneapp/phoneuistates/src/cphoneconferenceandwaitingandcallsetup.cpp
phoneapp/phoneuistates/src/cphoneemergency.cpp
phoneapp/phoneuistates/src/cphoneerrormessageshandler.cpp
phoneapp/phoneuistates/src/cphonegeneralgsmmessageshandler.cpp
phoneapp/phoneuistates/src/cphonegsmincall.cpp
phoneapp/phoneuistates/src/cphoneidle.cpp
phoneapp/phoneuistates/src/cphoneincoming.cpp
phoneapp/phoneuistates/src/cphoneresourceresolvergsm.cpp
phoneapp/phoneuistates/src/cphonesingleandalerting.cpp
phoneapp/phoneuistates/src/cphonesingleandcallsetup.cpp
phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp
phoneapp/phoneuistates/src/cphonesingleandwaiting.cpp
phoneapp/phoneuistates/src/cphonesinglecall.cpp
phoneapp/phoneuistates/src/cphonestartup.cpp
phoneapp/phoneuistates/src/cphonestatemachinegsm.cpp
phoneapp/phoneuistates/src/cphonetwosingles.cpp
phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp
phoneapp/phoneuistates/src/cphoneuistatemachinefactorygsm.cpp
phoneapp/phoneuiutils/bwins/phoneuiutilsu.def
phoneapp/phoneuiutils/eabi/phoneuiutilsu.def
phoneapp/phoneuiutils/group/bld.inf
phoneapp/phoneuiutils/group/phoneuiutils.mmp
phoneapp/phoneuiutils/group/phoneuiutils_stub.pkg
phoneapp/phoneuiutils/group/phoneuiutils_stub.sis
phoneapp/phoneuiutils/inc/cphonecallthememonitor.h
phoneapp/phoneuiutils/inc/cphonecenrepeventhandler.h
phoneapp/phoneuiutils/inc/cphonecenrepproxy.h
phoneapp/phoneuiutils/inc/cphoneclearblacklist.h
phoneapp/phoneuiutils/inc/cphonekeys.h
phoneapp/phoneuiutils/inc/cphonelangsettingmonitor.h
phoneapp/phoneuiutils/inc/cphonelibrarycontainer.h
phoneapp/phoneuiutils/inc/cphonelogger.h
phoneapp/phoneuiutils/inc/cphonemainerrormessageshandler.h
phoneapp/phoneuiutils/inc/cphonemainresourceresolver.h
phoneapp/phoneuiutils/inc/cphonepublishsubscriberao.h
phoneapp/phoneuiutils/inc/cphonepubsubproxy.h
phoneapp/phoneuiutils/inc/cphoneqwertyhandler.h
phoneapp/phoneuiutils/inc/cphoneqwertymodemonitor.h
phoneapp/phoneuiutils/inc/cphonerecoverysystem.h
phoneapp/phoneuiutils/inc/cphoneresourceresolverbase.h
phoneapp/phoneuiutils/inc/cphonestorage.h
phoneapp/phoneuiutils/inc/cphonetimer.h
phoneapp/phoneuiutils/inc/ctelerecoverysystem.h
phoneapp/phoneuiutils/inc/ctelerecoverysystem.inl
phoneapp/phoneuiutils/inc/ctelewaitingidle.h
phoneapp/phoneuiutils/inc/mphonecenrepobserver.h
phoneapp/phoneuiutils/inc/mphoneerrormessageshandler.h
phoneapp/phoneuiutils/inc/mphoneerrormessageshandlerregister.h
phoneapp/phoneuiutils/inc/mphonelangsettingobserver.h
phoneapp/phoneuiutils/inc/mphonepubsubobserver.h
phoneapp/phoneuiutils/inc/mphonequerycommandobserver.h
phoneapp/phoneuiutils/inc/mphoneqwertymodeobserver.h
phoneapp/phoneuiutils/inc/mphoneresourceresolver.h
phoneapp/phoneuiutils/inc/mphoneresourceresolverregister.h
phoneapp/phoneuiutils/inc/mphonestorage.h
phoneapp/phoneuiutils/inc/mphonetimer.h
phoneapp/phoneuiutils/inc/phoneconstants.h
phoneapp/phoneuiutils/inc/phonelogger.h
phoneapp/phoneuiutils/inc/phoneloggerviewcommands.h
phoneapp/phoneuiutils/inc/phonemediatorpackagetypes.h
phoneapp/phoneuiutils/inc/phoneresourceids.h
phoneapp/phoneuiutils/inc/phonerssbase.h
phoneapp/phoneuiutils/inc/phonerssgsm.h
phoneapp/phoneuiutils/inc/phonerssvoip.h
phoneapp/phoneuiutils/inc/phonestatestrings.h
phoneapp/phoneuiutils/inc/phonestatestringsgsm.h
phoneapp/phoneuiutils/inc/rphoneanimclearblacklist.h
phoneapp/phoneuiutils/inc/tcbacommandmapping.h
phoneapp/phoneuiutils/inc/telinternalsingletonuids.h
phoneapp/phoneuiutils/inc/telprivatecrkeys.h
phoneapp/phoneuiutils/inc/tphonecmdparamKeycapture.h
phoneapp/phoneuiutils/inc/tphonecmdparamappinfo.h
phoneapp/phoneuiutils/inc/tphonecmdparamaudioavailability.h
phoneapp/phoneuiutils/inc/tphonecmdparamaudiooutput.h
phoneapp/phoneuiutils/inc/tphonecmdparambitmap.h
phoneapp/phoneuiutils/inc/tphonecmdparamboolean.h
phoneapp/phoneuiutils/inc/tphonecmdparamcallheaderdata.h
phoneapp/phoneuiutils/inc/tphonecmdparamcallstatedata.h
phoneapp/phoneuiutils/inc/tphonecmdparamcustomdialer.h
phoneapp/phoneuiutils/inc/tphonecmdparamdynmenu.h
phoneapp/phoneuiutils/inc/tphonecmdparamemergencycallheaderdata.h
phoneapp/phoneuiutils/inc/tphonecmdparamglobalnote.h
phoneapp/phoneuiutils/inc/tphonecmdparamincallindicatordata.h
phoneapp/phoneuiutils/inc/tphonecmdparaminteger.h
phoneapp/phoneuiutils/inc/tphonecmdparamkeyevent.h
phoneapp/phoneuiutils/inc/tphonecmdparammessageeditor.h
phoneapp/phoneuiutils/inc/tphonecmdparamnote.h
phoneapp/phoneuiutils/inc/tphonecmdparamnumberentryobserver.h
phoneapp/phoneuiutils/inc/tphonecmdparampointer.h
phoneapp/phoneuiutils/inc/tphonecmdparamprogressnote.h
phoneapp/phoneuiutils/inc/tphonecmdparamquery.h
phoneapp/phoneuiutils/inc/tphonecmdparamreconnectquery.h
phoneapp/phoneuiutils/inc/tphonecmdparamringtone.h
phoneapp/phoneuiutils/inc/tphonecmdparamsfidata.h
phoneapp/phoneuiutils/inc/tphonecmdparamsingleitemfetch.h
phoneapp/phoneuiutils/inc/tphonecmdparamspeeddial.h
phoneapp/phoneuiutils/inc/tphonecmdparamstring.h
phoneapp/phoneuiutils/inc/tphonecmdparamtranseffect.h
phoneapp/phoneuiutils/inc/tphonecommandparam.h
phoneapp/phoneuiutils/inc/tphonetouchbuttonconfig.h
phoneapp/phoneuiutils/src/cphoneLogger.cpp
phoneapp/phoneuiutils/src/cphonecallthememonitor.cpp
phoneapp/phoneuiutils/src/cphonecenrepeventhandler.cpp
phoneapp/phoneuiutils/src/cphonecenrepproxy.cpp
phoneapp/phoneuiutils/src/cphoneclearblacklist.cpp
phoneapp/phoneuiutils/src/cphonekeys.cpp
phoneapp/phoneuiutils/src/cphonelangsettingmonitor.cpp
phoneapp/phoneuiutils/src/cphonelibrarycontainer.cpp
phoneapp/phoneuiutils/src/cphonemainerrormessageshandler.cpp
phoneapp/phoneuiutils/src/cphonemainresourceresolver.cpp
phoneapp/phoneuiutils/src/cphonepublishsubscriberao.cpp
phoneapp/phoneuiutils/src/cphonepubsubproxy.cpp
phoneapp/phoneuiutils/src/cphoneqwertyhandler.cpp
phoneapp/phoneuiutils/src/cphoneqwertymodemonitor.cpp
phoneapp/phoneuiutils/src/cphonerecoverysystem.cpp
phoneapp/phoneuiutils/src/cphoneresourceresolverbase.cpp
phoneapp/phoneuiutils/src/cphonestorage.cpp
phoneapp/phoneuiutils/src/cphonetimer.cpp
phoneapp/phoneuiutils/src/ctelerecoverysystem.cpp
phoneapp/phoneuiutils/src/ctelewaitingidle.cpp
phoneapp/phoneuiutils/src/generate.bat
phoneapp/phoneuiutils/src/phoneloggerviewcommands.cpp
phoneapp/phoneuiutils/src/phoneloggerviewcommands.st
phoneapp/phoneuiutils/src/phonestatestrings.cpp
phoneapp/phoneuiutils/src/phonestatestrings.st
phoneapp/phoneuiutils/src/phonestatestringsgsm.cpp
phoneapp/phoneuiutils/src/phonestatestringsgsm.st
phoneapp/phoneuiutils/src/rphoneanimclearblacklist.cpp
phoneapp/phoneuiutils/src/tcbacommandmapping.cpp
phoneapp/phoneuiutils/src/tphonecmdparamappinfo.cpp
phoneapp/phoneuiutils/src/tphonecmdparamaudioavailability.cpp
phoneapp/phoneuiutils/src/tphonecmdparamaudiooutput.cpp
phoneapp/phoneuiutils/src/tphonecmdparambitmap.cpp
phoneapp/phoneuiutils/src/tphonecmdparamboolean.cpp
phoneapp/phoneuiutils/src/tphonecmdparamcallheaderdata.cpp
phoneapp/phoneuiutils/src/tphonecmdparamcallstatedata.cpp
phoneapp/phoneuiutils/src/tphonecmdparamcustomdialer.cpp
phoneapp/phoneuiutils/src/tphonecmdparamdynmenu.cpp
phoneapp/phoneuiutils/src/tphonecmdparamemergencycallheaderdata.cpp
phoneapp/phoneuiutils/src/tphonecmdparamglobalnote.cpp
phoneapp/phoneuiutils/src/tphonecmdparamincallindicatordata.cpp
phoneapp/phoneuiutils/src/tphonecmdparaminteger.cpp
phoneapp/phoneuiutils/src/tphonecmdparamkeycapture.cpp
phoneapp/phoneuiutils/src/tphonecmdparamkeyevent.cpp
phoneapp/phoneuiutils/src/tphonecmdparammessageeditor.cpp
phoneapp/phoneuiutils/src/tphonecmdparamnote.cpp
phoneapp/phoneuiutils/src/tphonecmdparamnumberentryobserver.cpp
phoneapp/phoneuiutils/src/tphonecmdparampointer.cpp
phoneapp/phoneuiutils/src/tphonecmdparamprogressnote.cpp
phoneapp/phoneuiutils/src/tphonecmdparamquery.cpp
phoneapp/phoneuiutils/src/tphonecmdparamreconnectquery.cpp
phoneapp/phoneuiutils/src/tphonecmdparamringtone.cpp
phoneapp/phoneuiutils/src/tphonecmdparamsfidata.cpp
phoneapp/phoneuiutils/src/tphonecmdparamsingleitemfetch.cpp
phoneapp/phoneuiutils/src/tphonecmdparamspeeddial.cpp
phoneapp/phoneuiutils/src/tphonecmdparamstring.cpp
phoneapp/phoneuiutils/src/tphonecmdparamtranseffect.cpp
phoneapp/phoneuiutils/src/tphonecommandparam.cpp
phoneapp/phoneuiutils/src/tphonetouchbuttonconfig.cpp
phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def
phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def
phoneapp/phoneuiview2/inc/phoneaction.h
phoneapp/phoneuiview2/inc/phoneuiqtview.h
phoneapp/phoneuiview2/inc/phoneuiqtviewif.h
phoneapp/phoneuiview2/phoneuiqtview.pri
phoneapp/phoneuiview2/phoneuiview2.pro
phoneapp/phoneuiview2/src/phoneaction.cpp
phoneapp/phoneuiview2/src/phoneuiqtview.cpp
phoneapp/phoneuiview2/tsrc/runtests.bat
phoneapp/phoneuiview2/tsrc/unit.pro
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbtoolbar.cpp
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbtoolbar.h
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbvolumesliderpopup.cpp
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbvolumesliderpopup.h
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.cpp
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.h
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp
phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro
phoneapp/phoneuivoipextension/bwins/phoneuivoipextensionu.def
phoneapp/phoneuivoipextension/eabi/phoneuivoipextensionu.def
phoneapp/phoneuivoipextension/group/bld.inf
phoneapp/phoneuivoipextension/group/phoneuivoipextension.mmp
phoneapp/phoneuivoipextension/group/phoneuivoipextension_stub.pkg
phoneapp/phoneuivoipextension/group/phoneuivoipextension_stub.sis
phoneapp/phoneuivoipextension/inc/cphonecallforwardqueryhandler.h
phoneapp/phoneuivoipextension/inc/cphonecustomizationvoip.h
phoneapp/phoneuivoipextension/inc/cphoneextensionhandler.h
phoneapp/phoneuivoipextension/inc/cphonemenuextensionwrapper.h
phoneapp/phoneuivoipextension/inc/cphonenewcallcmdhandler.h
phoneapp/phoneuivoipextension/inc/cphoneresourceresolvervoip.h
phoneapp/phoneuivoipextension/inc/cphonestatealertingvoip.h
phoneapp/phoneuivoipextension/inc/cphonestatecallsetupvoip.h
phoneapp/phoneuivoipextension/inc/cphonestateidlevoip.h
phoneapp/phoneuivoipextension/inc/cphonestateincomingvoip.h
phoneapp/phoneuivoipextension/inc/cphonestatemachinevoip.h
phoneapp/phoneuivoipextension/inc/cphonestatesinglevoip.h
phoneapp/phoneuivoipextension/inc/cphonestateutilsvoip.h
phoneapp/phoneuivoipextension/inc/cphonetransferdialercontroller.h
phoneapp/phoneuivoipextension/inc/cphoneuistatemachinefactoryvoip.h
phoneapp/phoneuivoipextension/inc/cphoneunattendedtransfercmdhandler.h
phoneapp/phoneuivoipextension/inc/cphonevcchandler.h
phoneapp/phoneuivoipextension/inc/cphoneviewcustomizationvoip.h
phoneapp/phoneuivoipextension/inc/cphonevoiperrormessageshandler.h
phoneapp/phoneuivoipextension/inc/phonestatedefinitionsvoip.h
phoneapp/phoneuivoipextension/inc/tphonecmdparamselector.h
phoneapp/phoneuivoipextension/inc/tphonecommandparamvoip.h
phoneapp/phoneuivoipextension/inc/tphonetouchpanewrapper.h
phoneapp/phoneuivoipextension/src/cphonecallforwardqueryhandler.cpp
phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp
phoneapp/phoneuivoipextension/src/cphoneextensionhandler.cpp
phoneapp/phoneuivoipextension/src/cphonemenuextensionwrapper.cpp
phoneapp/phoneuivoipextension/src/cphonenewcallcmdhandler.cpp
phoneapp/phoneuivoipextension/src/cphoneresourceresolvervoip.cpp
phoneapp/phoneuivoipextension/src/cphonestatealertingvoip.cpp
phoneapp/phoneuivoipextension/src/cphonestatecallsetupvoip.cpp
phoneapp/phoneuivoipextension/src/cphonestateidlevoip.cpp
phoneapp/phoneuivoipextension/src/cphonestateincomingvoip.cpp
phoneapp/phoneuivoipextension/src/cphonestatemachinevoip.cpp
phoneapp/phoneuivoipextension/src/cphonestatesinglevoip.cpp
phoneapp/phoneuivoipextension/src/cphonestateutilsvoip.cpp
phoneapp/phoneuivoipextension/src/cphonetransferdialercontroller.cpp
phoneapp/phoneuivoipextension/src/cphoneuistatemachinefactoryvoip.cpp
phoneapp/phoneuivoipextension/src/cphoneunattendedtransfercmdhandler.cpp
phoneapp/phoneuivoipextension/src/cphonevcchandler.cpp
phoneapp/phoneuivoipextension/src/cphoneviewcustomizationvoip.cpp
phoneapp/phoneuivoipextension/src/cphonevoiperrormessageshandler.cpp
phoneapp/phoneuivoipextension/src/tphonecmdparamselector.cpp
phoneapp/phoneuivoipextension/src/tphonetouchpanewrapper.cpp
phoneapp/phoneuivoipextension/srcdata/phoneuivoip.rss
phoneapp/silenceactionplugin/data/silence.rul
phoneapp/silenceactionplugin/data/silenceactionplugin.pkg
phoneapp/silenceactionplugin/data/silenceactionplugin.rss
phoneapp/silenceactionplugin/data/silenceactionplugin_stub.SIS
phoneapp/silenceactionplugin/data/silenceactionplugin_stub.pkg
phoneapp/silenceactionplugin/group/bld.inf
phoneapp/silenceactionplugin/group/silenceactionplugin.mmp
phoneapp/silenceactionplugin/inc/logger.h
phoneapp/silenceactionplugin/inc/msilenceactionobserver.h
phoneapp/silenceactionplugin/inc/silenceaction.h
phoneapp/silenceactionplugin/inc/silenceactionplugin.h
phoneapp/silenceactionplugin/inc/silenceactionpluginconst.hrh
phoneapp/silenceactionplugin/rom/silenceactionplugin.iby
phoneapp/silenceactionplugin/src/main.cpp
phoneapp/silenceactionplugin/src/silenceaction.cpp
phoneapp/silenceactionplugin/src/silenceactionplugin.cpp
phoneengine/audiohandling/bwins/audiohandlingu.def
phoneengine/audiohandling/data/audiohandling_stub.pkg
phoneengine/audiohandling/data/audiohandling_stub.sis
phoneengine/audiohandling/data/defaultbeep.rss
phoneengine/audiohandling/eabi/audiohandlingu.def
phoneengine/audiohandling/group/audiohandling.mmp
phoneengine/audiohandling/group/bld.inf
phoneengine/audiohandling/inc/audiodataproxy.h
phoneengine/audiohandling/inc/cpeaudiodata.h
phoneengine/audiohandling/inc/cpeaudiodtmftoneplayer.h
phoneengine/audiohandling/inc/cpeaudioeffect.h
phoneengine/audiohandling/inc/cpeaudiofactory.h
phoneengine/audiohandling/inc/cpeaudioinbandtoneplayer.h
phoneengine/audiohandling/inc/cpeaudioroutingmonitor.h
phoneengine/audiohandling/inc/cpeaudiotoneutility.h
phoneengine/audiohandling/inc/cpeaudiotoneutilityimpl.h
phoneengine/audiohandling/inc/cpecallaudioroutinghandler.h
phoneengine/audiohandling/inc/cpegsmaudiodata.h
phoneengine/audiohandling/inc/cperingingtonedefinition.h
phoneengine/audiohandling/inc/defaultbeep.rh
phoneengine/audiohandling/inc/mpeaudiodata.h
phoneengine/audiohandling/src/cpeaudiodata.cpp
phoneengine/audiohandling/src/cpeaudiodtmftoneplayer.cpp
phoneengine/audiohandling/src/cpeaudioeffect.cpp
phoneengine/audiohandling/src/cpeaudiofactory.cpp
phoneengine/audiohandling/src/cpeaudioinbandtoneplayer.cpp
phoneengine/audiohandling/src/cpeaudioroutingmonitor.cpp
phoneengine/audiohandling/src/cpeaudiotoneutilityimpl.cpp
phoneengine/audiohandling/src/cpecallaudioroutinghandler.cpp
phoneengine/audiohandling/src/cpegsmaudiodata.cpp
phoneengine/audiohandling/src/peaudiohandlingpanic.cpp
phoneengine/callhandling/bwins/callhandlingu.def
phoneengine/callhandling/data/callhandling_stub.pkg
phoneengine/callhandling/data/callhandling_stub.sis
phoneengine/callhandling/eabi/callhandlingu.def
phoneengine/callhandling/group/bld.inf
phoneengine/callhandling/group/callhandling.mmp
phoneengine/callhandling/inc/cpecall.h
phoneengine/callhandling/inc/cpecallarrayowner.h
phoneengine/callhandling/inc/cpecallhandling.h
phoneengine/callhandling/inc/cpecceobserver.h
phoneengine/callhandling/inc/cpeconferencecall.h
phoneengine/callhandling/inc/cpedtmfhandling.h
phoneengine/callhandling/inc/cpegprstermination.h
phoneengine/callhandling/inc/cpesinglecall.h
phoneengine/callhandling/inc/cpesinglecallobserver.h
phoneengine/callhandling/inc/cpesupplementaryservicesmonitor.h
phoneengine/callhandling/inc/cpesystemcallstate.h
phoneengine/callhandling/inc/cpevideocallhandling.h
phoneengine/callhandling/inc/mpecall.h
phoneengine/callhandling/inc/mpecallhandling.h
phoneengine/callhandling/inc/mpecallinitialiser.h
phoneengine/callhandling/inc/mpecallowner.h
phoneengine/callhandling/inc/mpemessagesender.h
phoneengine/callhandling/src/cpecall.cpp
phoneengine/callhandling/src/cpecallarrayowner.cpp
phoneengine/callhandling/src/cpecallhandling.cpp
phoneengine/callhandling/src/cpecceobserver.cpp
phoneengine/callhandling/src/cpeconferencecall.cpp
phoneengine/callhandling/src/cpedtmfhandling.cpp
phoneengine/callhandling/src/cpegprstermination.cpp
phoneengine/callhandling/src/cpesinglecall.cpp
phoneengine/callhandling/src/cpesinglecallobserver.cpp
phoneengine/callhandling/src/cpesupplementaryservicesmonitor.cpp
phoneengine/callhandling/src/cpesystemcallstate.cpp
phoneengine/callhandling/src/cpevideocallhandling.cpp
phoneengine/callhandling/src/pecallhandlingpanic.cpp
phoneengine/contacthandling2/bwins/contacthandlingu.def
phoneengine/contacthandling2/data/contacthandling_stub.pkg
phoneengine/contacthandling2/data/contacthandling_stub.sis
phoneengine/contacthandling2/eabi/contacthandlingu.def
phoneengine/contacthandling2/group/bld.inf
phoneengine/contacthandling2/group/contacthandling.mmp
phoneengine/contacthandling2/inc/cpecontacthandling.h
phoneengine/contacthandling2/inc/cpecontacthandlingdummy.h
phoneengine/contacthandling2/inc/cpecontacthandlingproxy.h
phoneengine/contacthandling2/inc/cpecontactmatch.h
phoneengine/contacthandling2/inc/mpecontacthandling.h
phoneengine/contacthandling2/src/cpecontacthandling.cpp
phoneengine/contacthandling2/src/cpecontacthandlingdummy.cpp
phoneengine/contacthandling2/src/cpecontacthandlingproxy.cpp
phoneengine/contacthandling2/src/cpecontactmatch.cpp
phoneengine/contacthandling2/src/pecontacthandlingpanic.cpp
phoneengine/contacthandling2/tsrc/run_auto_tests.bat
phoneengine/engineinfo/bwins/engineinfou.def
phoneengine/engineinfo/eabi/engineinfou.def
phoneengine/engineinfo/group/bld.inf
phoneengine/engineinfo/group/engineinfo.mmp
phoneengine/engineinfo/inc/cpecallinfo.h
phoneengine/engineinfo/inc/cpeclientinformation.h
phoneengine/engineinfo/inc/cpeclientinformationimpl.h
phoneengine/engineinfo/inc/cpeengineinfo.h
phoneengine/engineinfo/inc/cpeengineinfoimpl.h
phoneengine/engineinfo/inc/cperemoteinfo.h
phoneengine/engineinfo/inc/mpeclientinformation.h
phoneengine/engineinfo/inc/mpedatastore.h
phoneengine/engineinfo/inc/mpeengineinfo.h
phoneengine/engineinfo/src/cpecallinfo.cpp
phoneengine/engineinfo/src/cpeclientinformation.cpp
phoneengine/engineinfo/src/cpeclientinformationimpl.cpp
phoneengine/engineinfo/src/cpeengineinfo.cpp
phoneengine/engineinfo/src/cpeengineinfoimpl.cpp
phoneengine/engineinfo/src/cperemoteinfo.cpp
phoneengine/engineinfo/src/panic.cpp
phoneengine/group/bld.inf
phoneengine/loghandling/bwins/loghandlingu.def
phoneengine/loghandling/data/loghandling_stub.pkg
phoneengine/loghandling/data/loghandling_stub.sis
phoneengine/loghandling/eabi/loghandlingu.def
phoneengine/loghandling/group/bld.inf
phoneengine/loghandling/group/loghandling.mmp
phoneengine/loghandling/inc/cpelogevent.h
phoneengine/loghandling/inc/cpelogextensionwrapper.h
phoneengine/loghandling/inc/cpelogexternaldata.h
phoneengine/loghandling/inc/cpeloghandling.h
phoneengine/loghandling/inc/cpeloghandlingcommand.h
phoneengine/loghandling/inc/cpeloghandlingdummy.h
phoneengine/loghandling/inc/cpeloghandlingproxy.h
phoneengine/loghandling/inc/cpeloginfo.h
phoneengine/loghandling/inc/mpeloghandling.h
phoneengine/loghandling/src/cpelogevent.cpp
phoneengine/loghandling/src/cpelogextensionwrapper.cpp
phoneengine/loghandling/src/cpelogexternaldata.cpp
phoneengine/loghandling/src/cpeloghandling.cpp
phoneengine/loghandling/src/cpeloghandlingcommand.cpp
phoneengine/loghandling/src/cpeloghandlingdummy.cpp
phoneengine/loghandling/src/cpeloghandlingproxy.cpp
phoneengine/loghandling/src/cpeloginfo.cpp
phoneengine/loghandling/src/peloghandlingpanic.cpp
phoneengine/loghandling/tsrc/mocks/mock_centralrepository.cpp
phoneengine/loghandling/tsrc/mocks/mock_cpeloghandling.cpp
phoneengine/loghandling/tsrc/mocks/mock_cpeloghandlingcommand.cpp
phoneengine/loghandling/tsrc/mocks/mock_cpeloginfo.cpp
phoneengine/loghandling/tsrc/run_auto_tests.bat
phoneengine/loghandling/tsrc/ut_cpelogevent/bwins/ut_cpelogeventu.def
phoneengine/loghandling/tsrc/ut_cpelogevent/group/bld.inf
phoneengine/loghandling/tsrc/ut_cpelogevent/group/ut_cpelogevent.mmp
phoneengine/loghandling/tsrc/ut_cpelogevent/src/testdefs.h
phoneengine/loghandling/tsrc/ut_cpelogevent/src/ut_cpelogevent.cpp
phoneengine/loghandling/tsrc/ut_cpelogevent/src/ut_cpelogevent.h
phoneengine/loghandling/tsrc/ut_cpelogevent/src/ut_cpelogevent_dllmain.cpp
phoneengine/loghandling/tsrc/ut_cpelogexternaldata/bwins/ut_cpelogexternaldatau.def
phoneengine/loghandling/tsrc/ut_cpelogexternaldata/group/bld.inf
phoneengine/loghandling/tsrc/ut_cpelogexternaldata/group/ut_cpelogexternaldata.mmp
phoneengine/loghandling/tsrc/ut_cpelogexternaldata/src/ut_cpelogexternaldata.cpp
phoneengine/loghandling/tsrc/ut_cpelogexternaldata/src/ut_cpelogexternaldata.h
phoneengine/loghandling/tsrc/ut_cpelogexternaldata/src/ut_cpelogexternaldata_dllmain.cpp
phoneengine/loghandling/tsrc/ut_cpeloginfo/bwins/ut_cpeloginfou.def
phoneengine/loghandling/tsrc/ut_cpeloginfo/group/bld.inf
phoneengine/loghandling/tsrc/ut_cpeloginfo/group/ut_cpeloginfo.mmp
phoneengine/loghandling/tsrc/ut_cpeloginfo/src/testdefs.h
phoneengine/loghandling/tsrc/ut_cpeloginfo/src/ut_cpeloginfo.cpp
phoneengine/loghandling/tsrc/ut_cpeloginfo/src/ut_cpeloginfo.h
phoneengine/loghandling/tsrc/ut_cpeloginfo/src/ut_cpeloginfo_dllmain.cpp
phoneengine/networkhandlingstarter/inc/cnetworklistener.h
phoneengine/networkhandlingstarter/inc/mnetworklistenerobserver.h
phoneengine/networkhandlingstarter/inc/networkhandlingstarter.h
phoneengine/networkhandlingstarter/inc/networkhandlingstarter_p.h
phoneengine/networkhandlingstarter/inc/networkhandlingstarterlogging.h
phoneengine/networkhandlingstarter/networkhandlingstarter.pro
phoneengine/networkhandlingstarter/rom/networkhandlingstarter.iby
phoneengine/networkhandlingstarter/service_conf.xml
phoneengine/networkhandlingstarter/src/cnetworklistener.cpp
phoneengine/networkhandlingstarter/src/main.cpp
phoneengine/networkhandlingstarter/src/networkhandlingstarter.cpp
phoneengine/networkhandlingstarter/src/networkhandlingstarter_p.cpp
phoneengine/networkhandlingstarter/tsrc/common/qtestmains60.h
phoneengine/networkhandlingstarter/tsrc/mocks/mock_centralrepository.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnetworklistener.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnwsession.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_cppluginlauncher.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbaction.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbdevicemessagebox.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbinstance.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbmainwindow.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_mnetworklistenerobserver.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter_p.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_qabstractscrollarea.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_qframe.cpp
phoneengine/networkhandlingstarter/tsrc/mocks/mock_qgraphicsview.cpp
phoneengine/networkhandlingstarter/tsrc/run_auto_tests_qt.bat
phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/inc/ut_cnetworklistener.h
phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/src/ut_cnetworklistener.cpp
phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/ut_cnetworklistener.pro
phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/inc/ut_networkhandlingstarter.h
phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/src/ut_networkhandlingstarter.cpp
phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/ut_networkhandlingstarter.pro
phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/inc/ut_networkhandlingstarter_p.h
phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/src/ut_networkhandlingstarter_p.cpp
phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/ut_networkhandlingstarter_p.pro
phoneengine/parserrecognizer/bwins/parserrecognizeru.def
phoneengine/parserrecognizer/eabi/parserrecognizeru.def
phoneengine/parserrecognizer/inc/parserrecognizer.h
phoneengine/parserrecognizer/parserrecognizer.pri
phoneengine/parserrecognizer/parserrecognizer.pro
phoneengine/parserrecognizer/src/parserrecognizer.cpp
phoneengine/parserrecognizer/tsrc/README.txt
phoneengine/parserrecognizer/tsrc/runtests.bat
phoneengine/parserrecognizer/tsrc/unit.pro
phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/README.txt
phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/unit_tests.cpp
phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/ut_parserrecognizer.pro
phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/xqservicerequest.h
phoneengine/phonecntfinder2/api_headers.pri
phoneengine/phonecntfinder2/bwins/phonecntfinderu.def
phoneengine/phonecntfinder2/eabi/phonecntfinderu.def
phoneengine/phonecntfinder2/inc/cphcntcontactid.h
phoneengine/phonecntfinder2/inc/cphcntcontactidimpl2.h
phoneengine/phonecntfinder2/inc/cphcntfactoryimpl2.h
phoneengine/phonecntfinder2/inc/cphcntmatch2.h
phoneengine/phonecntfinder2/inc/cphcntmatcher.h
phoneengine/phonecntfinder2/inc/cphcntmatcherimpl2.h
phoneengine/phonecntfinder2/inc/cphcntpbkcontactid.h
phoneengine/phonecntfinder2/inc/cphonecntfactory.h
phoneengine/phonecntfinder2/inc/mphcntmatch.h
phoneengine/phonecntfinder2/inc/phcntpanic.h
phoneengine/phonecntfinder2/inc/phcnttrace.h
phoneengine/phonecntfinder2/inc/qcontactfields.h
phoneengine/phonecntfinder2/phonecntfinder.pkg
phoneengine/phonecntfinder2/phonecntfinder2.pro
phoneengine/phonecntfinder2/rom/phonecntfinder.iby
phoneengine/phonecntfinder2/src/cphcntcontactidimpl2.cpp
phoneengine/phonecntfinder2/src/cphcntfactoryimpl2.cpp
phoneengine/phonecntfinder2/src/cphcntmatch2.cpp
phoneengine/phonecntfinder2/src/cphcntmatcherimpl2.cpp
phoneengine/phonecntfinder2/src/phcntpanic.cpp
phoneengine/phonecntfinder2/tsrc/common.pri
phoneengine/phonecntfinder2/tsrc/mocks/qcontact.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontact_stub.cpp
phoneengine/phonecntfinder2/tsrc/mocks/qcontactdetail.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontactdetail_stub.cpp
phoneengine/phonecntfinder2/tsrc/mocks/qcontactdetailfilter.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontactfilter.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontactmanager.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontactmanager_moc.cpp
phoneengine/phonecntfinder2/tsrc/mocks/qcontactmanager_moc.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontactname.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontactphonenumber.h
phoneengine/phonecntfinder2/tsrc/mocks/qcontactsortorder.h
phoneengine/phonecntfinder2/tsrc/runtests.bat
phoneengine/phonecntfinder2/tsrc/u_cphcntcontactidimpl2/testcphcntcontactidimpl2.pro
phoneengine/phonecntfinder2/tsrc/u_cphcntcontactidimpl2/u_cphcntcontactidimpl2.cpp
phoneengine/phonecntfinder2/tsrc/u_cphcntfactoryimpl2/testfactoryimpl2.pro
phoneengine/phonecntfinder2/tsrc/u_cphcntfactoryimpl2/u_cphcntfactoryimpl2.cpp
phoneengine/phonecntfinder2/tsrc/u_cphcntmatch2/testmatch2.pro
phoneengine/phonecntfinder2/tsrc/u_cphcntmatch2/u_cphcntmatch2.cpp
phoneengine/phonecntfinder2/tsrc/u_cphcntmatcherimpl2/testmatcherimpl2.pro
phoneengine/phonecntfinder2/tsrc/u_cphcntmatcherimpl2/u_cphcntmatcherimpl2.cpp
phoneengine/phonemodel/api_headers.pri
phoneengine/phonemodel/bwins/phoneengineu.def
phoneengine/phonemodel/cenrep/keys_s60telephony.xls
phoneengine/phonemodel/conf/s60telephony.confml
phoneengine/phonemodel/conf/s60telephony_101F87E3.crml
phoneengine/phonemodel/conf/s60telephony_102828B1.crml
phoneengine/phonemodel/conf/s60telephony_102828B2.crml
phoneengine/phonemodel/conf/s60telephony_102828B8.crml
phoneengine/phonemodel/conf/s60telephony_102828F8.crml
phoneengine/phonemodel/conf/s60telephony_102830B6.crml
phoneengine/phonemodel/conf/s60telephony_2001B2E6.crml
phoneengine/phonemodel/conf/s60telephony_japan.confml
phoneengine/phonemodel/data/phonemodel_stub.pkg
phoneengine/phonemodel/data/phonemodel_stub.sis
phoneengine/phonemodel/eabi/phoneengineu.def
phoneengine/phonemodel/inc/cpeaccessorymodemonitor.h
phoneengine/phonemodel/inc/cpeactivestarter.h
phoneengine/phonemodel/inc/cpeaudiooutputpreferencemonitor.h
phoneengine/phonemodel/inc/cpecalldurationdisplaysettingmonitor.h
phoneengine/phonemodel/inc/cpecenrepmonitor.h
phoneengine/phonemodel/inc/cpeclientcallrequestmonitor.h
phoneengine/phonemodel/inc/cpeclientcommandhandlermonitor.h
phoneengine/phonemodel/inc/cpeclientemergencycallmonitor.h
phoneengine/phonemodel/inc/cpeclientservices.h
phoneengine/phonemodel/inc/cpedevicemodehandler.h
phoneengine/phonemodel/inc/cpeexternaldatahandler.h
phoneengine/phonemodel/inc/cpeidlestatusmonitor.h
phoneengine/phonemodel/inc/cpemanualcallcontrolhandler.h
phoneengine/phonemodel/inc/cpemessagehandler.h
phoneengine/phonemodel/inc/cpemessagehandler.inl
phoneengine/phonemodel/inc/cpenetworkregistrationstatusmonitor.h
phoneengine/phonemodel/inc/cpeparseremergencynumberhandler.h
phoneengine/phonemodel/inc/cpeparsermanufacturerhandler.h
phoneengine/phonemodel/inc/cpeparsermischandler.h
phoneengine/phonemodel/inc/cpeparserphonenumberhandler.h
phoneengine/phonemodel/inc/cpeparsersimcontrolhandler.h
phoneengine/phonemodel/inc/cpeparsersscallhandler.h
phoneengine/phonemodel/inc/cpeparsersshandler.h
phoneengine/phonemodel/inc/cpeparservoipnumberhandler.h
phoneengine/phonemodel/inc/cpepcnparserprocedurehandler.h
phoneengine/phonemodel/inc/cpephonemodel.h
phoneengine/phonemodel/inc/cpephonemodelif.h
phoneengine/phonemodel/inc/cpeprofilesettingmonitor.h
phoneengine/phonemodel/inc/cpepubsubmonitor.h
phoneengine/phonemodel/inc/cperemotepartyinfomediator.h
phoneengine/phonemodel/inc/cperemotepartyinfoproxy.h
phoneengine/phonemodel/inc/cpesettingscommand.h
phoneengine/phonemodel/inc/cpesimstatemonitor.h
phoneengine/phonemodel/inc/cpetimer.h
phoneengine/phonemodel/inc/mpeactivestarter.h
phoneengine/phonemodel/inc/mpecallcontrolif.h
phoneengine/phonemodel/inc/mpecallsettersif.h
phoneengine/phonemodel/inc/mpeclientcallrequestmonitor.h
phoneengine/phonemodel/inc/mpeexternaldatahandler.h
phoneengine/phonemodel/inc/mpekeysequencerecognitionif.h
phoneengine/phonemodel/inc/mpemediator.h
phoneengine/phonemodel/inc/mpephonemodelinternal.h
phoneengine/phonemodel/inc/mphonedevicemodeobserver.h
phoneengine/phonemodel/inc/penetworkhandler.h
phoneengine/phonemodel/inc/pepanic.pan
phoneengine/phonemodel/inc/pevirtualengine.h
phoneengine/phonemodel/inc/qtphonelog.h
phoneengine/phonemodel/inc/talogger.h
phoneengine/phonemodel/inc/telephonyvariant.hrh
phoneengine/phonemodel/inc/telinternalcrkeys.h
phoneengine/phonemodel/inc/telinternalpskeys.h
phoneengine/phonemodel/inc/telinternalpstypes.h
phoneengine/phonemodel/inc/tperemotepartyinfomediatorupdater.h
phoneengine/phonemodel/phonemodel.pro
phoneengine/phonemodel/rom/phonengengine.iby
phoneengine/phonemodel/src/cpeaccessorymodemonitor.cpp
phoneengine/phonemodel/src/cpeactivestarter.cpp
phoneengine/phonemodel/src/cpeaudiooutputpreferencemonitor.cpp
phoneengine/phonemodel/src/cpecalldurationdisplaysettingmonitor.cpp
phoneengine/phonemodel/src/cpecenrepmonitor.cpp
phoneengine/phonemodel/src/cpeclientcallrequestmonitor.cpp
phoneengine/phonemodel/src/cpeclientcommandhandlermonitor.cpp
phoneengine/phonemodel/src/cpeclientemergencycallmonitor.cpp
phoneengine/phonemodel/src/cpeclientservices.cpp
phoneengine/phonemodel/src/cpedevicemodehandler.cpp
phoneengine/phonemodel/src/cpeexternaldatahandler.cpp
phoneengine/phonemodel/src/cpeidlestatusmonitor.cpp
phoneengine/phonemodel/src/cpemanualcallcontrolhandler.cpp
phoneengine/phonemodel/src/cpemessagehandler.cpp
phoneengine/phonemodel/src/cpenetworkregistrationstatusmonitor.cpp
phoneengine/phonemodel/src/cpeparseremergencynumberhandler.cpp
phoneengine/phonemodel/src/cpeparsermanufacturerhandler.cpp
phoneengine/phonemodel/src/cpeparsermischandler.cpp
phoneengine/phonemodel/src/cpeparserphonenumberhandler.cpp
phoneengine/phonemodel/src/cpeparsersimcontrolhandler.cpp
phoneengine/phonemodel/src/cpeparsersscallhandler.cpp
phoneengine/phonemodel/src/cpeparsersshandler.cpp
phoneengine/phonemodel/src/cpeparservoipnumberhandler.cpp
phoneengine/phonemodel/src/cpepcnparserprocedurehandler.cpp
phoneengine/phonemodel/src/cpephonemodel.cpp
phoneengine/phonemodel/src/cpephonemodelif.cpp
phoneengine/phonemodel/src/cpeprofilesettingmonitor.cpp
phoneengine/phonemodel/src/cpepubsubmonitor.cpp
phoneengine/phonemodel/src/cperemotepartyinfomediator.cpp
phoneengine/phonemodel/src/cperemotepartyinfoproxy.cpp
phoneengine/phonemodel/src/cpesettingscommand.cpp
phoneengine/phonemodel/src/cpesimstatemonitor.cpp
phoneengine/phonemodel/src/cpetimer.cpp
phoneengine/phonemodel/src/penetworkhandler.cpp
phoneengine/phonemodel/src/pepanic.cpp
phoneengine/phonemodel/src/phoneengineproxy.cpp
phoneengine/phonemodel/src/tperemotepartyinfomediatorupdater.cpp
phoneengine/phonemodel/tsrc/ut_penetworkhandler/unit_tests.cpp
phoneengine/phonemodel/tsrc/ut_penetworkhandler/ut_penetworkhandler.pro
phoneengine/phoneservices/bwins/phoneservicesu.def
phoneengine/phoneservices/eabi/phoneservicesu.def
phoneengine/phoneservices/inc/dialservice.h
phoneengine/phoneservices/inc/dialservicedepricated.h
phoneengine/phoneservices/inc/dtmfservice.h
phoneengine/phoneservices/inc/dtmfservicedepricated.h
phoneengine/phoneservices/inc/keysequencerecognitionservice.h
phoneengine/phoneservices/inc/keysequencerecognitionservicedepricated.h
phoneengine/phoneservices/inc/phoneservices.h
phoneengine/phoneservices/phoneservices.pri
phoneengine/phoneservices/phoneservices.pro
phoneengine/phoneservices/src/dialservice.cpp
phoneengine/phoneservices/src/dialservicedepricated.cpp
phoneengine/phoneservices/src/dtmfservice.cpp
phoneengine/phoneservices/src/dtmfservicedepricated.cpp
phoneengine/phoneservices/src/keysequencerecognitionservice.cpp
phoneengine/phoneservices/src/keysequencerecognitionservicedepricated.cpp
phoneengine/phoneservices/src/phoneservices.cpp
phoneengine/phoneservices/tsrc/runtests.bat
phoneengine/phoneservices/tsrc/unit.pro
phoneengine/phoneservices/tsrc/ut_dialservice/unit_tests.cpp
phoneengine/phoneservices/tsrc/ut_dialservice/ut_dialservice.pro
phoneengine/phoneservices/tsrc/ut_dtmfservice/unit_tests.cpp
phoneengine/phoneservices/tsrc/ut_dtmfservice/ut_dtmfservice.pro
phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/unit_tests.cpp
phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/ut_keysequencerecognitionservice.pro
phoneengine/phoneservices/tsrc/ut_phoneservices/unit_tests.cpp
phoneengine/phoneservices/tsrc/ut_phoneservices/ut_phoneservices.pro
phoneengine/servicehandling/bwins/peservicehandlingu.def
phoneengine/servicehandling/data/servicehandling_stub.pkg
phoneengine/servicehandling/data/servicehandling_stub.sis
phoneengine/servicehandling/eabi/peservicehandlingu.def
phoneengine/servicehandling/group/bld.inf
phoneengine/servicehandling/group/peservicehandling.mmp
phoneengine/servicehandling/inc/cpeservicehandling.h
phoneengine/servicehandling/inc/mpeservicehandling.h
phoneengine/servicehandling/src/cpeservicehandling.cpp
phoneplugins/csplugin/data/102828e3.rss
phoneplugins/csplugin/data/csplugin_stub.pkg
phoneplugins/csplugin/data/csplugin_stub.sis
phoneplugins/csplugin/group/bld.inf
phoneplugins/csplugin/group/csplugin.mmp
phoneplugins/csplugin/group/csplugin_UID_.cpp
phoneplugins/csplugin/inc/cspaudiohandler.h
phoneplugins/csplugin/inc/cspcall.h
phoneplugins/csplugin/inc/cspcalladdedhandler.h
phoneplugins/csplugin/inc/cspcallarray.h
phoneplugins/csplugin/inc/cspcallcommandhandler.h
phoneplugins/csplugin/inc/cspcallinfomonitor.h
phoneplugins/csplugin/inc/cspcipheringstatusmonitor.h
phoneplugins/csplugin/inc/cspclientvideocall.h
phoneplugins/csplugin/inc/cspclientvoicecall.h
phoneplugins/csplugin/inc/cspconferencecall.h
phoneplugins/csplugin/inc/cspconsts.h
phoneplugins/csplugin/inc/cspdtmfprovider.h
phoneplugins/csplugin/inc/cspetelcallcapsmonitor.h
phoneplugins/csplugin/inc/cspetelcalleventmonitor.h
phoneplugins/csplugin/inc/cspetelcallrequester.h
phoneplugins/csplugin/inc/cspetelcallstatusmonitor.h
phoneplugins/csplugin/inc/cspetelcallwaitingrequester.h
phoneplugins/csplugin/inc/cspetelconferencecallrequester.h
phoneplugins/csplugin/inc/cspetelconferencecapsmonitor.h
phoneplugins/csplugin/inc/cspetelconferenceeventmonitor.h
phoneplugins/csplugin/inc/cspetelconferencestatusmonitor.h
phoneplugins/csplugin/inc/cspeteldtmfmonitor.h
phoneplugins/csplugin/inc/cspeteldtmfstopmonitor.h
phoneplugins/csplugin/inc/cspetelincomingcallmonitor.h
phoneplugins/csplugin/inc/cspetellinestatusmonitor.h
phoneplugins/csplugin/inc/cspetelvideocallcapsmonitor.h
phoneplugins/csplugin/inc/cspforwardprovider.h
phoneplugins/csplugin/inc/csplogger.h
phoneplugins/csplugin/inc/csppanic.pan
phoneplugins/csplugin/inc/csppubsublistener.h
phoneplugins/csplugin/inc/cspremotealertingtonelistener.h
phoneplugins/csplugin/inc/csprovider.h
phoneplugins/csplugin/inc/cspservicesettingshandler.h
phoneplugins/csplugin/inc/cspsssettingshandler.h
phoneplugins/csplugin/inc/cspsupplementaryservicesmonitor.h
phoneplugins/csplugin/inc/csptimer.h
phoneplugins/csplugin/inc/csptransferprovider.h
phoneplugins/csplugin/inc/cspuuimessagesender.h
phoneplugins/csplugin/inc/cspuuimonitor.h
phoneplugins/csplugin/inc/cspvideocall.h
phoneplugins/csplugin/inc/cspvideocallconnectionhandler.h
phoneplugins/csplugin/inc/cspvoicecall.h
phoneplugins/csplugin/inc/mcspaudiostreamobserver.h
phoneplugins/csplugin/inc/mcspcalladdedobserver.h
phoneplugins/csplugin/inc/mcspcallcommandhandling.h
phoneplugins/csplugin/inc/mcspcallerrorobserver.h
phoneplugins/csplugin/inc/mcspcallinformation.h
phoneplugins/csplugin/inc/mcspcallobserver.h
phoneplugins/csplugin/inc/mcspcenrepobserver.h
phoneplugins/csplugin/inc/mcspcommoninfo.h
phoneplugins/csplugin/inc/mcspconferencestatusobserver.h
phoneplugins/csplugin/inc/mcspdevsoundobserver.h
phoneplugins/csplugin/inc/mcspincomingcallobserver.h
phoneplugins/csplugin/inc/mcsplinestatusobserver.h
phoneplugins/csplugin/inc/mcsppubsubobserver.h
phoneplugins/csplugin/inc/mcspremotealertingtoneobserver.h
phoneplugins/csplugin/inc/mcspsecuritysettingobserver.h
phoneplugins/csplugin/inc/mcsptimerobserver.h
phoneplugins/csplugin/inc/mcspuusmessageobserver.h
phoneplugins/csplugin/inc/rcsplinecontainer.h
phoneplugins/csplugin/inc/tcspskypeidparser.h
phoneplugins/csplugin/inc/tmshandler.h
phoneplugins/csplugin/rom/csplugin.iby
phoneplugins/csplugin/src/cspaudiohandler.cpp
phoneplugins/csplugin/src/cspcall.cpp
phoneplugins/csplugin/src/cspcalladdedhandler.cpp
phoneplugins/csplugin/src/cspcallarray.cpp
phoneplugins/csplugin/src/cspcallcommandhandler.cpp
phoneplugins/csplugin/src/cspcallinfomonitor.cpp
phoneplugins/csplugin/src/cspcipheringstatusmonitor.cpp
phoneplugins/csplugin/src/cspclientvideocall.cpp
phoneplugins/csplugin/src/cspclientvoicecall.cpp
phoneplugins/csplugin/src/cspconferencecall.cpp
phoneplugins/csplugin/src/cspdtmfprovider.cpp
phoneplugins/csplugin/src/cspetelcallcapsmonitor.cpp
phoneplugins/csplugin/src/cspetelcalleventmonitor.cpp
phoneplugins/csplugin/src/cspetelcallrequester.cpp
phoneplugins/csplugin/src/cspetelcallstatusmonitor.cpp
phoneplugins/csplugin/src/cspetelcallwaitingrequester.cpp
phoneplugins/csplugin/src/cspetelconferencecallrequester.cpp
phoneplugins/csplugin/src/cspetelconferencecapsmonitor.cpp
phoneplugins/csplugin/src/cspetelconferenceeventmonitor.cpp
phoneplugins/csplugin/src/cspetelconferencestatusmonitor.cpp
phoneplugins/csplugin/src/cspeteldtmfmonitor.cpp
phoneplugins/csplugin/src/cspeteldtmfstopmonitor.cpp
phoneplugins/csplugin/src/cspetelincomingcallmonitor.cpp
phoneplugins/csplugin/src/cspetellinestatusmonitor.cpp
phoneplugins/csplugin/src/cspetelvideocallcapsmonitor.cpp
phoneplugins/csplugin/src/cspforwardprovider.cpp
phoneplugins/csplugin/src/csppanic.cpp
phoneplugins/csplugin/src/cspproxy.cpp
phoneplugins/csplugin/src/csppubsublistener.cpp
phoneplugins/csplugin/src/cspremotealertingtonelistener.cpp
phoneplugins/csplugin/src/csprovider.cpp
phoneplugins/csplugin/src/cspservicesettingshandler.cpp
phoneplugins/csplugin/src/cspsssettingshandler.cpp
phoneplugins/csplugin/src/cspsupplementaryservicesmonitor.cpp
phoneplugins/csplugin/src/csptimer.cpp
phoneplugins/csplugin/src/csptransferprovider.cpp
phoneplugins/csplugin/src/cspuuimessagesender.cpp
phoneplugins/csplugin/src/cspuuimonitor.cpp
phoneplugins/csplugin/src/cspvideocall.cpp
phoneplugins/csplugin/src/cspvideocallconnectionhandler.cpp
phoneplugins/csplugin/src/cspvoicecall.cpp
phoneplugins/csplugin/src/rcsplinecontainer.cpp
phoneplugins/csplugin/src/tcspskypeidparser.cpp
phoneplugins/csplugin/src/tmshandler.cpp
phoneplugins/group/bld.inf
phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pri
phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro
phoneplugins/hsdialerwidgetplugin/hsdialerwidgetpluging.qrc
phoneplugins/hsdialerwidgetplugin/inc/hsdialerwidget.h
phoneplugins/hsdialerwidgetplugin/inc/hsdialerwidgetplugin.h
phoneplugins/hsdialerwidgetplugin/resource/hsdialerwidgetplugin.manifest
phoneplugins/hsdialerwidgetplugin/resource/hsdialerwidgetplugin.s60xml
phoneplugins/hsdialerwidgetplugin/resource/hsdialerwidgetplugin.xml
phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_c.png
phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_l.png
phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_r.png
phoneplugins/hsdialerwidgetplugin/resource/qtg_graf_hs_dialer.svg
phoneplugins/hsdialerwidgetplugin/resource/qtg_graf_hs_dialer_pressed.svg
phoneplugins/hsdialerwidgetplugin/rom/hsdialerwidgetplugin.iby
phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp
phoneplugins/hsdialerwidgetplugin/src/hsdialerwidgetplugin.cpp
phoneplugins/infowidgetplugin/infowidgetplugin.pro
phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetlogging.h
phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetprovider.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidget.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlinehandler.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetnetworkhandler.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetpreferences.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandler.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandlerprivate.h
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine_s.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlinehandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetnetworkhandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences_s.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetsathandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetsathandlerprivate.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pri
phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pro
phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.qrc
phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider_hw.pkg
phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider_installs_win32.pri
phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.docml
phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.png
phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.manifest
phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.s60xml
phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.xml
phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_prop_network_2g.svg
phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_prop_pb_call.svg
phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_prop_pb_sim.svg
phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_stat_zone_home_uni.svg
phoneplugins/infowidgetplugin/infowidgetprovider/rom/infowidgetprovider.iby
phoneplugins/infowidgetplugin/infowidgetprovider/rom/infowidgetprovider_resources.iby
phoneplugins/infowidgetplugin/infowidgetprovider/src/infowidgetprovider.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/common/qtestmains60.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_RSatSession.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbcolorscheme.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbdocumentloader.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbframedrawer.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hblabel.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbmarqueeitem.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyle.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyleoptionlabel.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbwidget.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetengine.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetnetworkhandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetpreferences.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandlerprivate.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_networkhandlingproxy.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslayout.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslinearlayout.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qserviceinterfacedescriptor.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qserviceplugininterface.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_rsatservice.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingskey.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingsmanager.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/inc/ut_infowidget.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/src/ut_infowidget.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/ut_infowidget.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/inc/ut_infowidgetengine.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/ut_infowidgetengine.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/inc/ut_infowidgetlinehandler.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/src/ut_infowidgetlinehandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/ut_infowidgetlinehandler.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/ut_infowidgetnetworkhandler.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/inc/ut_infowidgetpreferences.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/src/ut_infowidgetpreferences.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/ut_infowidgetpreferences.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/inc/ut_infowidgetprovider.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/src/ut_infowidgetprovider.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/ut_infowidgetprovider.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/inc/ut_infowidgetsathandler.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/src/ut_infowidgetsathandler.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/ut_infowidgetsathandler.pro
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/inc/ut_infowidgetsathandlerprivate.h
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/run_auto_tests_qt.bat
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/src/ut_infowidgetsathandlerprivate.cpp
phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/ut_infowidgetsathandlerprivate.pro
phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.cpp
phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.pro
phoneplugins/infowidgetplugin/infowidgetproviderinstaller/rom/infowidgetproviderinstaller.iby
phoneplugins/phoneindicatorplugin/inc/api_headers.pri
phoneplugins/phoneindicatorplugin/inc/phoneindicatorinterface.h
phoneplugins/phoneindicatorplugin/inc/phoneindicatorplugin.h
phoneplugins/phoneindicatorplugin/inc/phoneindicators.h
phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pri
phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pro
phoneplugins/phoneindicatorplugin/rom/phoneindicatorplugin.iby
phoneplugins/phoneindicatorplugin/src/phoneindicatorinterface.cpp
phoneplugins/phoneindicatorplugin/src/phoneindicatorplugin.cpp
phonesettings/cpphonesettingsplugins/barringplugin/barringplugin.pro
phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugin.h
phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h
phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugin.cpp
phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/run_auto_tests_qt.bat
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/qtestmains60.h
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.pro
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/qtestmains60.h
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/ut_cpbarringplugin.cpp
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/ut_cpbarringplugin.h
phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/ut_cpbarringplugin.pro
phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def
phonesettings/cpphonesettingsplugins/callsplugin/callsplugin.pro
phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugin.cpp
phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugin.h
phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp
phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.h
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/run_auto_tests_qt.bat
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/qtestmains60.h
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/ut_callsplugin.cpp
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/ut_callsplugin.h
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/ut_callsplugin.pro
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/qtestmains60.h
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.h
phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.pro
phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pri
phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pro
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60_p.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/run_auto_tests_qt.bat
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/qtestmains60.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.pro
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/qtestmains60.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/qtestmains60ui.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_networkpluginform.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_networkpluginform.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/qtestmains60ui.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.cpp
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.h
phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.pro
phonesettings/cpphonesettingsplugins/cpphonesettingsplugins.pro
phonesettings/cpphonesettingsplugins/cpplugincommon.pri
phonesettings/cpphonesettingsplugins/cptelephonyutils/cptelephonyutils.pro
phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonelocalisation.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpplugincommon.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cppluginlogging.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cptelephonyutilsdefs.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonelocalisation.cpp
phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp
phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon.cpp
phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon_s.cpp
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/run_auto_tests_qt.bat
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/qtestmains60.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.cpp
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.pro
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/qtestmains60ui.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.pro
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/qtestmains60.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.cpp
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.h
phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.pro
phonesettings/cpphonesettingsplugins/divertplugin/divertplugin.pro
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.cpp
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.h
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.cpp
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.h
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.cpp
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.h
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectionitem.cpp
phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectionitem.h
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/run_auto_tests_qt.bat
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/qtestmains60ui.h
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.cpp
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.h
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.pro
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/qtestmains60ui.h
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.cpp
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.h
phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.pro
phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def
phonesettings/cpphonesettingsplugins/rom/cpphonesettingsplugins.iby
phonesettings/cpphonesettingsplugins/rom/cpphonesettingsplugins_resources.iby
phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp
phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.h
phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp
phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.h
phonesettings/cpphonesettingsplugins/telephonyplugin/telephonyplugin.pro
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/run_auto_tests_qt.bat
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/qtestmains60ui.h
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/ut_cptelephonyplugin.cpp
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/ut_cptelephonyplugin.h
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/ut_cptelephonyplugin.pro
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/qtestmains60ui.h
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/ut_cptelephonypluginview.cpp
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/ut_cptelephonypluginview.h
phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/ut_cptelephonypluginview.pro
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cellulardatasettings.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cmmanager.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugin.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbasesettingview.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpcallsplugin.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpcallsplugingroup.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpdivertselectionitem.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpitemdatahelper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkplugin.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonelocalisation.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpplugincommon.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cppluginloader.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpsettingformentryitemdata.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpsettingformitemdata.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cptelephonypluginview.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbabstractitemview.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbaction.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbcheckbox.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbdataform.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbdialog.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbicon.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblabel.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistview.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistwidget.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistwidgetitem.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbpopup.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbscrollarea.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbview.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbwidget.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbwidgetbase.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallbarringwrapper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcalldivertingwrapper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcalldivertingwrapper_p.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallwaitingwrapper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallwaitingwrapper_p.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcliwrapper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcliwrapper_p.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetnetworkwrapper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetnetworkwrapper_p.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetwrapper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qaction.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qobject.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qtranslator.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_sssettingswrapper.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_xqsettingskey.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_xqsettingsmanager.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_xqsysinfo.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/qtestmains60.h
phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.cpp
phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.h
phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.pro
phoneuis/TelephonyDeviceMode/bwins/TelephonyDeviceModeU.DEF
phoneuis/TelephonyDeviceMode/eabi/telephonydevicemodeu.def
phoneuis/TelephonyDeviceMode/group/TelephonyDeviceMode.mmp
phoneuis/TelephonyDeviceMode/group/bld.inf
phoneuis/TelephonyDeviceMode/group/telephonydevicemode.pkg
phoneuis/TelephonyDeviceMode/group/telephonydevicemode_stub.SIS
phoneuis/TelephonyDeviceMode/group/telephonydevicemode_stub.pkg
phoneuis/TelephonyDeviceMode/inc/CTelDMAudioAccessoryListener.h
phoneuis/TelephonyDeviceMode/inc/CTelDMCallStateListener.h
phoneuis/TelephonyDeviceMode/inc/CTelDMCommandHandler.h
phoneuis/TelephonyDeviceMode/inc/CTelDMDebug.h
phoneuis/TelephonyDeviceMode/inc/CTelDMGripHandler.h
phoneuis/TelephonyDeviceMode/inc/CTelDMHandlerImpl.h
phoneuis/TelephonyDeviceMode/inc/MTelDMAccessory.h
phoneuis/TelephonyDeviceMode/inc/MTelDMCallStateObserver.h
phoneuis/TelephonyDeviceMode/rom/telephonydevicemode.iby
phoneuis/TelephonyDeviceMode/src/CTelDMAudioAccessoryListener.cpp
phoneuis/TelephonyDeviceMode/src/CTelDMCallStateListener.cpp
phoneuis/TelephonyDeviceMode/src/CTelDMCommandHandler.cpp
phoneuis/TelephonyDeviceMode/src/CTelDMGripHandler.cpp
phoneuis/TelephonyDeviceMode/src/CTelDMHandlerImpl.cpp
phoneuis/bubblemanager2/bubblecore/bubblecore.pro
phoneuis/bubblemanager2/bubblecore/bubblecore.qrc
phoneuis/bubblemanager2/bubblecore/bwins/bubblecoreu.def
phoneuis/bubblemanager2/bubblecore/eabi/bubblecoreu.def
phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_appear.fxml
phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_disappear.fxml
phoneuis/bubblemanager2/bubblecore/resources/bubble_icon_anim.axml
phoneuis/bubblemanager2/bubblecore/src/bubblebutton.cpp
phoneuis/bubblemanager2/bubblecore/src/bubblebutton.h
phoneuis/bubblemanager2/bubblecore/src/bubblecollapsedhandler.cpp
phoneuis/bubblemanager2/bubblecore/src/bubblecollapsedhandler.h
phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.h
phoneuis/bubblemanager2/bubblecore/src/bubbleconferenceheader.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleconferenceheader.h
phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.cpp
phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.h
phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri
phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.h
phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.h
phoneuis/bubblemanager2/bubblecore/src/bubblehandler.cpp
phoneuis/bubblemanager2/bubblecore/src/bubblehandler.h
phoneuis/bubblemanager2/bubblecore/src/bubbleheader.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleheader.h
phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.h
phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.h
phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.h
phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p_stub.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h
phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.h
phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistmodel.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistmodel.h
phoneuis/bubblemanager2/bubblecore/src/bubbleutils.cpp
phoneuis/bubblemanager2/bubblecore/src/bubbleutils.h
phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp
phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_b.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_bl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_br.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_c.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_l.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_r.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_t.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tr.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_b.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_bl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_br.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_c.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_l.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_r.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_t.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tr.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_b.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_bl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_br.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_c.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_l.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_r.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_t.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tr.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_b.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_bl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_br.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_c.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_l.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_r.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_t.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tl.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tr.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_active_call.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_avatar.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_end_call.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_waiting_call.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg
phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg
phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_1.docml
phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_2.docml
phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_3.docml
phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_4.docml
phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_5.docml
phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.css
phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.widgetml
phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.css
phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.widgetml
phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.css
phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.widgetml
phoneuis/bubblemanager2/bubblemanager2.pro
phoneuis/bubblemanager2/inc/api_headers.pri
phoneuis/bubblemanager2/inc/bubblemanager2.h
phoneuis/bubblemanager2/inc/bubblemanagerif.h
phoneuis/bubblemanager2/rom/bubblemanager.iby
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletest2.pro
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletest2.qrc
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester.cpp
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester.h
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbledata.cpp
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbledata.h
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbletester.pro
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbletester.qrc
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/main.cpp
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/mainwindow.cpp
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/mainwindow.h
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/mainwindow.ui
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/testdata.xml
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletestview.cpp
phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletestview.h
phoneuis/bubblemanager2/tsrc/bubbletest2/main.cpp
phoneuis/bubblemanager2/tsrc/bubbletest2/resources/contactpic.jpg
phoneuis/bubblemanager2/tsrc/bubbletest2/resources/contactpic2.jpg
phoneuis/bubblemanager2/tsrc/bubbletest2/resources/contactpic3.png
phoneuis/bubblemanager2/tsrc/bubbletest2/sis/bubbletest2.pkg
phoneuis/bubblemanager2/tsrc/bubbletest2/sis/sisTool.pl
phoneuis/bubblemanager2/tsrc/unit/checkcoverage.cmd
phoneuis/bubblemanager2/tsrc/unit/mt_bubblemanager2/mt_bubblemanager2.cpp
phoneuis/bubblemanager2/tsrc/unit/mt_bubblemanager2/mt_bubblemanager2.pro
phoneuis/bubblemanager2/tsrc/unit/runall.cmd
phoneuis/bubblemanager2/tsrc/unit/runtest.cmd
phoneuis/bubblemanager2/tsrc/unit/runtest_w32.cmd
phoneuis/bubblemanager2/tsrc/unit/shared/bubbletest.h
phoneuis/bubblemanager2/tsrc/unit/unit.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleconferenceheader/ut_bubbleconferenceheader.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleconferenceheader/ut_bubbleconferenceheader.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_appear.fxml
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_disappear.fxml
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.qrc
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheader/ut_bubbleheader.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheader/ut_bubbleheader.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.css
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.widgetml
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.qrc
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic1.png
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic2.jpg
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.qrc
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/data/pixmap.png
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/data/pixmap_wide.png
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/data/vector.svg
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.qrc
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubblepartlistmodel/ut_bubblepartlistmodel.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubblepartlistmodel/ut_bubblepartlistmodel.pro
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.cpp
phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.pro
phoneuis/group/bld.inf
phoneuis/ussdeditor/inc/tflogger.h
phoneuis/ussdeditor/inc/ussdcomms.h
phoneuis/ussdeditor/inc/ussdeditorquery.h
phoneuis/ussdeditor/rom/ussdeditor.iby
phoneuis/ussdeditor/rom/ussdeditor.pkg
phoneuis/ussdeditor/rom/ussdeditor_stub.pkg
phoneuis/ussdeditor/rom/ussdeditor_stub.sis
phoneuis/ussdeditor/rom/ussdeditorresources.iby
phoneuis/ussdeditor/src/main.cpp
phoneuis/ussdeditor/src/ussdcomms.cpp
phoneuis/ussdeditor/src/ussdeditorquery.cpp
phoneuis/ussdeditor/ussdeditor.pro
sysdef_1_5_1.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony ADO bld file
+*
+*/
+
+
+#include "../phoneapp/group/bld.inf"
+#include "../phoneengine/group/bld.inf"
+#include "../phoneuis/group/bld.inf"
+#include "../phone_plat/group/bld.inf"
+#include "../phoneplugins/group/bld.inf"
+
+
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Fri Jun 04 10:19:18 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/phone" >
+]>
+
+<SystemDefinition name="phone" schema="1.5.1">
+  <systemModel>
+    <layer name="app_layer">
+      <module name="phone">
+        <unit name="phone" unitID="tedo.phone" bldFile="&layer_real_source_path;" mrp="" proFile="phone.pro" />
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone.pro	Fri Jun 04 10:19:18 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: Project file for building Phone components
+#
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+
+symbian: {
+:BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"group/bld.inf\""
+SUBDIRS += phoneengine/phonecntfinder2
+SUBDIRS += phoneengine/phoneservices
+SUBDIRS += phoneengine/parserrecognizer
+SUBDIRS += phoneengine/phonemodel
+SUBDIRS += phoneengine/networkhandlingstarter
+SUBDIRS += phoneuis/bubblemanager2
+SUBDIRS += phoneplugins/phoneindicatorplugin
+SUBDIRS += phoneapp/phoneuiview2
+SUBDIRS += phoneapp/phoneuiqtviewadapter
+SUBDIRS += phoneapp/phonestringloader
+SUBDIRS += phoneapp/phoneui2
+SUBDIRS += phonesettings/cpphonesettingsplugins
+#SUBDIRS += phoneplugins/hsdialerwidgetplugin
+SUBDIRS += phoneplugins/infowidgetplugin
+SUBDIRS += phoneuis/ussdeditor
+}
+          
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/3d_ringing_tone_enabler_api/3d_ringing_tone_enabler_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="9e50e0267cca1ea02eba5c7ca11d2345" dataversion="1.0">
+  <name>3D Ringing tone enabler API</name>
+  <description>An Ecom interface for 3D ringing tone implementation..</description>
+  <type>c++</type>
+  <subsystem>phoneapp</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/3d_ringing_tone_enabler_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                3D Ringing tone enabler API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/c3dringingtoneinterface.h     APP_LAYER_PLATFORM_EXPORT_PATH(c3dringingtoneinterface.h)
+../inc/c3dringingtoneinterface.inl     APP_LAYER_PLATFORM_EXPORT_PATH(c3dringingtoneinterface.inl)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/3d_ringing_tone_enabler_api/inc/c3dringingtoneinterface.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2005,2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Provides abstract ECOM interface for 3D ringing tone 
+*
+*/
+
+
+
+#ifndef C3DRINGINGTONEINTERFACE_H
+#define C3DRINGINGTONEINTERFACE_H
+
+// INCLUDES
+#include    <e32base.h>
+
+// CONSTANTS
+const TInt32 K3DRingingToneInterfaceUid = 0x1020299A;
+
+
+enum T3DRingingToneInterfaceAttr
+    {
+    E3DRTIAttrProfileId = 0,
+    E3DRTIAttr3DEffect = 1,
+    E3DRTIAttr3DEcho = 2,
+    E3DRTIAttr3DRingingTone = 3
+    };
+
+enum T3DRingingToneInterfacePlayerAttr
+    {
+    E3DRTIAttrAudioPlayerUtility = 10,
+    E3DRTIAttrAudioToneUtility = 11,
+    E3DRTIAttrDrmPlayerUtility = 12,
+    E3DRTIAttrVideoPlayerUtility = 13
+    };
+
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Abstract ECOM interface for playing 3D ringing tones.
+*
+*  @since 3.0
+*/
+class C3DRingingToneInterface : public CBase
+    {
+    public:
+            
+        /**
+        * Two-phased constructor.
+        *
+        * @param aImplementationUid  For selection when there are more than one
+        *                            implementations. Not used yet, for future.
+        */
+        inline static C3DRingingToneInterface* NewL( TUid aImplementationUid );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~C3DRingingToneInterface();
+        
+        /**
+        * Set 3D ringing tone interface attribute with specific 
+        * integer value.
+        * @param aAttributeKey An enum of T3DRingingToneInterfaceAttr.
+        * @param aValue Attribute integer value.
+        * @return KErrNone, attribute set, no errors
+        *         KErrArgument, attribute not set, argument error
+        *         Some system wide Symbian error, attribute not set
+        */
+        virtual TInt SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, 
+                              TInt aValue ) = 0;
+
+        /**
+        * Set 3D ringing tone interface attribute with specific 
+        * string value.
+        * @param aAttributeKey An enum of T3DRingingToneInterfaceAttr.
+        * @param aValue Attribute string value.
+        * @return KErrNone, attribute set, no errors
+        *         KErrArgument, attribute not set, argument error
+        *         Some system wide Symbian error, attribute not set
+        */
+        virtual TInt SetAttr( T3DRingingToneInterfaceAttr aAttributeKey, 
+                              const TDesC& aValue ) = 0;
+
+        /**
+        * Set 3D ringing tone interface attribute value any of type.
+        * @param aAttributeKey This can be for example one of the 
+        * player utility classes (see T3DRingingToneInterfacePlayerAttr).
+        * This method is left extendable.
+        * @param aValue Attribute value can be any.
+        * @return KErrNone, attribute set, no errors
+        *         KErrArgument, attribute not set, argument error
+        *         Some system wide Symbian error, attribute not set
+        */
+        virtual TInt SetAttr( TInt aAttributeKey, TAny* aValue ) = 0;
+
+        /**
+        * Start playing 3D ringing tone.
+        * Method can leave with specific Symbian system wide error code.
+        * @param None.
+        * @return None.
+        */        
+        virtual void PlayL() = 0;
+        
+        /**
+        * Stop playing 3D ringing tone.
+        * @param None.        
+        * @return None.
+        */        
+        virtual void Stop() = 0;
+            
+    private:    // Data
+        
+        // Uid required by ECOM.
+        TUid iDtor_ID_Key;
+    };
+
+
+#include    <c3dringingtoneinterface.inl>
+
+#endif      // C3DRINGINGTONEINTERFACE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/3d_ringing_tone_enabler_api/inc/c3dringingtoneinterface.inl	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2005,2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inline functions for C3DRingingToneInterface class
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <ecom/ecom.h>
+
+// CONSTANTS
+_LIT8( KCoUtlResolverData, "default" );
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+ 
+// -----------------------------------------------------------------------------
+// C3DRingingToneInterface::NewL
+// ECom is used to create instance.
+// -----------------------------------------------------------------------------
+//
+inline C3DRingingToneInterface* C3DRingingToneInterface::NewL( TUid /*aImplementationUid*/ )
+    {
+    
+    const TUid K3DRingingToneInterfaceDefinitionUid = 
+        { K3DRingingToneInterfaceUid };
+
+    TEComResolverParams params;
+    params.SetDataType( KCoUtlResolverData );
+    params.SetWildcardMatch( EFalse );
+ 
+    RImplInfoPtrArray pluginArray;
+    //List all plugins which implement C3DRingingToneInterface
+    REComSession::ListImplementationsL( K3DRingingToneInterfaceDefinitionUid, pluginArray );
+
+    if( pluginArray.Count() )
+        {
+        TAny* ptr = 
+            REComSession::CreateImplementationL(
+                K3DRingingToneInterfaceDefinitionUid,
+                _FOFF( C3DRingingToneInterface, iDtor_ID_Key ), 
+                NULL,
+                params );
+ 
+        pluginArray.ResetAndDestroy(); 
+        return reinterpret_cast< C3DRingingToneInterface* >( ptr );
+        }
+    else
+        {
+        return NULL;
+        }   
+    }
+
+
+// -----------------------------------------------------------------------------
+// C3DRingingToneInterface::~C3DRingingToneInterface
+// ECom is used to delete instance..
+// REComSession::FinalClose() in the application which loads this plugin
+// -----------------------------------------------------------------------------
+
+inline C3DRingingToneInterface::~C3DRingingToneInterface()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+        
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/dialer_keypad_api/dialer_keypad_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+<?xml version="1.0" ?>
+<api id="56033367735ce0710ede9aa28d24a5f1" dataversion="1.0">
+<name>Dialer Keypad API</name>
+<description>CVideoDTMFDialer class provides dialer keypad functionalities.
+
+In Video Telephony dialer offers touch keypad for enter as DTMFs 
+and client's CCoeControl is used to show video and keypad. 
+Video DTMF dialer does not implement menu or command buttons, 
+only keypad which presses are forwarded to host application as key events.</description>
+<type>c++</type>
+<subsystem>phoneuis</subsystem>
+<libs><lib name="dialer.lib"/>
+</libs>
+<release category="domain" sinceversion="5.0"/>
+<attributes>
+<htmldocprovided>no</htmldocprovided>
+<adaptation>yes</adaptation>
+</attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/dialer_keypad_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Dialer keypad API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/cvideodtmfdialer.h     APP_LAYER_PLATFORM_EXPORT_PATH(cvideodtmfdialer.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/dialer_keypad_api/inc/cvideodtmfdialer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CVideoDTMFDialer class provides dialer keypad 
+*                functionalities
+*
+*/
+
+
+
+#ifndef CVIDEODTMFDIALER_H
+#define CVIDEODTMFDIALER_H
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <coemain.h>
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CDialerKeyPadContainer;
+class CDialerVideoContainer;
+class CEikonEnv;
+
+// CLASS DECLARATION
+
+/**
+*  CVideoDTMFDialer class.
+*
+*  @lib dialer.lib
+*  @since Series60_5.0
+*
+*  Description:
+*
+*   In Video Telephony dialer offers touch keypad for enter as DTMFs 
+*   and client's CCoeControl is used to show video and keypad. 
+*   Video DTMF dialer does not implement menu or command buttons, 
+*   only keypad which presses are forwarded to host application as key events.  
+*
+*   From host application dialer requires:
+*   - View/container as CCoeControl
+*   - App UI HandleCommand, DynInitMenuBar/Pane and CBA handling 
+*   - HandleKeyEventL to handle numbers/characters from touch pane input.
+*
+* 
+*  Usage:
+
+    // Create 'video window'.
+    CCoeControl* videoControl = new( ELeave ) CEikLabel;
+    videoControl->SetBufferReserveLengthL( 10 );
+    videoControl->SetTextL( _L("Video Here") ) ;
+
+    // Create dialer.
+    CVideoDTMFDialer* videoDialer = CVideoDTMFDialer::NewL( *this, *videoControl, aDialerArea );
+    // Delete dialer
+    delete dialer;
+    
+*
+*/
+NONSHARABLE_CLASS(CVideoDTMFDialer) : public CCoeControl
+    {
+    public:  // Constructors and destructor
+    
+        /**
+        * Two phase constructor
+        * @param aContainer Parent container
+        * @param aVideoWindow Control viewing video
+        * @param aRect Area to use for dialer
+        * @return New instance or Dialer
+        */
+        IMPORT_C static CVideoDTMFDialer* NewL( const CCoeControl& aContainer, 
+            CCoeControl& aVideoWindow,
+            const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CVideoDTMFDialer();
+
+    private:  // Functions from CCoeControl
+        
+        /**
+        * @see CCoeControl
+        */
+        void SizeChanged();
+        
+        /**
+        * @see CCoeControl
+        */
+        void PositionChanged();
+
+        /**
+        * @see CCoeControl
+        */
+        TInt CountComponentControls() const;
+        
+        /**
+        * @see CCoeControl
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+        
+        /**
+        * @see CCoeControl
+        */
+        void Draw( const TRect& aRect ) const;
+
+        /**
+        * @see CCoeControl
+        */
+        void HandleResourceChange( TInt aType );
+        
+        /**
+        * @see CCoeControl
+        */
+        void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+        
+    private:
+
+        /**
+        * Constructor
+        */
+        CVideoDTMFDialer( );
+
+        /**
+        * 2nd phase constructor.
+        * @param aContainer Parent container
+        * @param aVideoWindow Control containing the video
+        * @param aRect area to use for dialer
+        */
+        void ConstructL( const CCoeControl& aContainer , 
+            CCoeControl& aVideoWindow,
+            const TRect& aRect );
+        
+        /**
+        * Load resource file.
+        */
+        void LoadResourceL();
+        
+        /**
+        * Unload resource file.
+        */
+        void UnLoadResources();
+ 
+        /**
+        * @see CCoeControl::ComponentControl()
+        * @param aIndex control index
+        */
+        CCoeControl* ComponentControlForVideoMode( const TInt aIndex ) const;
+        
+    private:    // Data
+           
+        // Keypad container  - owned
+        CDialerKeyPadContainer* iKeypadArea;
+        
+        // Video container - owned
+        CDialerVideoContainer* iVideoWindow;
+        
+        // Parent container
+        const CCoeControl* iParentControl;
+
+        // Reference to CEikonEnv
+        CEikonEnv& iEikEnv;
+        
+        // Resource 
+        TInt iResourceOffset;
+        
+        // For future use.        
+        TBool* iReserved1;
+        TBool* iReserved2;
+    };
+
+#endif      // CVIDEODTMFDIALER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Includes all the Domain API specific bld.inf files, which 
+*                export files.
+*
+*/
+
+#include "../3d_ringing_tone_enabler_api/group/bld.inf"
+#include "../telephony_comms_information_api/group/bld.inf"
+#include "../telephony_information_api/group/bld.inf"
+#include "../telephony_device_mode_api/group/bld.inf"
+
+#include "../telephony_remote_party_information_api/group/bld.inf"
+#include "../telephony_video_mailbox_settings_api/group/bld.inf"
+
+//#include "../telephony_configuration_api/group/bld.inf"
+//#include "../dialer_keypad_api/group/bld.inf"
+//#include "../telephony_bubble_extension_api/group/bld.inf"
+
+#include "../telephony_menu_extension_api/group/bld.inf"
+#include "../telephony_microphone_mute_status_api/group/bld.inf"
+#include "../telephony_logging_extension_api/group/bld.inf"
+#include "../telephony_matching_extension_api/group/bld.inf"
+#include "../phone_application_commands_api/group/bld.inf"
+#include "../phone_application_voip_commands_api/group/bld.inf"
+#include "../telephony_mediator_api/group/bld.inf"
+#include "../video_telephony_mediator_api/group/bld.inf"
+#include "../video_telephony_control_mediator_api/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/phone_application_commands_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Phone Applications Commands
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/phoneappcommands.hrh     APP_LAYER_PLATFORM_EXPORT_PATH(phoneappcommands.hrh)
+../inc/xqphoneappcommands.h     APP_LAYER_PLATFORM_EXPORT_PATH(xqphoneappcommands.h)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/phone_application_commands_api/inc/phoneappcommands.hrh	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains declarations for commands of PhoneAppS60.
+*     The file can be included in C++ or resource file.
+*     
+*
+*/
+
+
+#ifndef PHONEAPPCOMMANDS_HRH
+#define PHONEAPPCOMMANDS_HRH
+
+
+#include    <bldvariant.hrh>
+
+//  CONSTANTS
+
+#define KPhoneCmdBase 6000
+enum 
+    {
+    // commands for all
+    EPhoneCmdDoNothing = KPhoneCmdBase,
+    EPhoneCmdCancel,
+    EPhoneCmdOptions,
+    EPhoneCmdOkOptions,
+    EPhoneCmdBack,
+    EPhoneCmdEnd,
+    EPhoneCmdEndAll,
+    EPhoneCmdIhfToggle,
+    EPhoneCmdNameDialer,
+    EPhoneLongMSKAnswer,
+    EPhoneLongSendActivateHandsfree,
+    EPhoneActivateForegroundReq, // doesn't leave
+    EPhoneCancelForegroundReq, // doesn't leave
+    EPhoneCmdToForeground, // doesn't leave
+    EPhoneCmdOk,
+    EPhoneCmdYes,
+    EPhoneCmdNo,
+    EPhoneCmdExit,
+    EPhoneCmdRedialQuit,
+    EPhoneCmdYesAlsLineChange,
+    EPhoneCmdNoAlsLineChange,
+    EPhoneCmdYesBtDisconnectQuery,
+    EPhoneCmdNoBtDisconnectQuery,
+
+    // commands for idle state.
+    EPhoneSoftkeyLeft,
+    EPhoneSoftkeyRight,
+    EPhoneIdleActivateNumberAcq,
+    EPhoneTogglEPhoneLines,
+    // for ShortcutManager
+    EPhoneSelectionKey,    // OK key
+    EPhoneScrollkeyLeft,
+    EPhoneScrollkeyUp,
+    EPhoneScrollkeyRight,
+    EPhoneScrollkeyDown,
+
+    // commands for number acquisition.
+    EPhoneNumberAcqCmdPbkOperation,
+    EPhoneNumberAcqCmdSave,
+    EPhoneNumberAcqCmdAddToName,
+    EPhoneNumberAcqCmdCall,
+    EPhoneNumberAcqCmdVideoCall,
+    EPhoneNumberAcqCmdSpeedDial,
+    EPhoneNumberAcqCmdSendCommand,
+    EPhoneNumberAcqCmdSendMessage,
+    EPhoneNumberAcqCmdHashCheck,  // NOT IN MENU.
+    EPhoneNumberAcqSecurityDialer, // NOT IN MENU.
+
+    // CDMA specific
+    EPhoneNumberAcqCmdAddToContacts,
+    EPhoneNumberAcqCmdInsertPause,
+    EPhoneNumberAcqCmdInsertTimedPause,
+    EPhoneNumberAcqCmdInsertHardPause,
+    // commands for call coming in
+    EPhoneCallComingCmdReject,
+    EPhoneCallComingCmdAnswer,
+    EPhoneCallComingCmdAnswerHandPortable,
+    EPhoneCallComingCmdAnswerHandPortableVideo,
+    EPhoneCallComingCmdSilent,
+    EPhoneCallComingCmdOptions,
+    EPhoneCallComingCmdAnswerWithHandsfree,
+    EPhoneCallComingLongMSKAnswer,
+    EPhoneCallComingCmdProcessSend, // NOT IN MENU
+    //        Soft Reject
+    EPhoneCallComingCmdSoftReject,
+    // CDMA specific
+    EPhoneCallComingCmdIgnore,
+    EPhoneCallComingCmdHelp,
+
+    // commands for call setup
+    EPhoneCallSetupCmdEnd,
+    // commands for incall
+    EPhoneInCallCmdSwap,
+    EPhoneInCallCmdAnswer,
+    EPhoneInCallCmdAnswerHandPortable,
+    EPhoneInCallCmdReject,
+    EPhoneInCallCmdHold,
+    EPhoneInCallCmdUnhold,
+    EPhoneInCallCmdEndThisActiveCall,
+    EPhoneInCallCmdEndThisHeldCall,
+    EPhoneInCallCmdEndThisOutgoingCall,
+    EPhoneInCallCmdEndAllCalls,
+    EPhoneInCallCmdHandset,
+    EPhoneInCallCmdBtHandsfree,
+    EPhoneInCallCmdActivateIhf,
+    EPhoneInCallCmdDeactivateIhf,
+    EPhoneInCallCmdMute,
+    EPhoneInCallCmdUnmute,
+    EPhoneInCallCmdNewCall,
+    EPhoneInCallCmdCreateConference,
+    EPhoneInCallCmdConferenceMenu,
+    EPhoneInCallCmdPrivateSelection,
+    EPhoneInCallCmdJoin,
+    EPhoneInCallCmdDropSelection,
+    EPhoneInCallCmdTransfer,
+    EPhoneInCallCmdReplace,
+    EPhoneInCallCmdDtmfListQuery,
+    EPhoneInCallCmdDtmfManualQuery,
+    EPhoneInCallCmdCancelSendingDtmfString,
+    EPhoneInCallCmdContinueSendingDtmfString,
+    EPhoneInCallCmdVoiceMode,
+    EPhoneInCallCmdSendToCallerMenu,    
+    EPhoneInCallCmdSendNew,
+    EPhoneInCallCmdSendFile,
+    EPhoneInCallCmdProcessSend, // NOT IN MENU!
+    EPhoneInCallCmdDrop,
+    EPhoneInCallCmdPrivate,
+    EPhoneInCallCmdCbaJoin, // NOT IN MENU!
+    EPhoneInCallCmdDialer,
+    EPhoneInCallCmdContacts,
+
+    // Enable video
+    EPhoneInCallCmdEnableVideo,
+    // Disable video
+    EPhoneInCallCmdDisableVideo,
+    // Use primary camera
+    EPhoneInCallCmdPrimaryCamera,
+    // Use secondary camera
+    EPhoneInCallCmdSecondaryCamera,
+    EPhoneInCallCmdActivatEPhonebook, // NOT IN MENU!
+
+    EPhoneInCallCmdConferenceHold, // JMK
+    EPhoneInCallCmdConferenceUnhold, // JMK
+    EPhoneInCallCmdNewCallFind,
+    EPhoneInCallCmdNewCallCall,
+    EPhoneInCallCmdGoToIdle,
+    EPhoneInCallCmdParticipants,
+    
+    // CDMA specific
+    EPhoneInCallCmdMulticall3WayCall,
+    EPhoneInCallCmdMulticallIgnore,
+    EPhoneInCallCmdFlash,
+    EPhoneInCallCmdHelp,
+    EPhoneInCallCmdEmergencyActivateIhf,
+    EPhoneInCallCmdEmergencyDeactivateIhf,
+    EPhoneInCallCmdEmergencyHandset,
+    EPhoneInCallPhoneInfo,
+    // CDMA Emergency specific
+    EPhoneEmergencyCmdYes,
+    EPhoneEmergencyCmdNo,
+    EPhoneEmergencyCmdExit,    //6121
+    // Settings GUI (commands useful to many GUI's)
+    EPhoneCmdSettingsUiOptions,
+    EPhoneCmdSettingsUiBack,
+    EPhoneCmdSettingsUiOpen,
+    EPhoneCmdSettingsUiExit,
+    // Settings GUI - Data Parameters GUI (commands specific to DataParameters)
+    EPhoneCmdDataParametersRestoreSettings,
+    EPhoneCmdRelease,   
+    // DTMF specific
+    EPhoneCmdDtmfSearch,
+    EPhoneCmdDtmfOk,
+    EPhoneCmdDtmfSpeedDialOk,
+    EPhoneInCallCmdDtmfListViewSearch,    
+    // other commands
+    EPhoneCmdWaitNoteOk,
+    EPhoneCmdVideoCallMemoryLowNoteDismissed,
+    EPhoneCmdSecurityInd, // NOT to leave
+    EPhoneInCallCmdSwitchToVideo,
+    EPhoneInCallCmdSwitchToVoice,
+    EPhoneCmdYesSwitchToVideo,
+    EPhoneCmdNoSwitchToVideo,
+    EPhoneCmdYesSwitchToVoice,
+    EPhoneCmdNoSwitchToVoice,    
+    EPhoneMediatorSetPhoneNumber,
+    EPhoneCmdCoverUiShowMultimediaRingingTone,
+    EPhoneInCallCmdLockKeypad,
+    EPhoneInCallCmdLockScreen,
+    EPhoneCmdYesVideoFailedNoMemorySwitchToVoice,
+    EPhoneCmdNoVideoFailedNoMemorySwitchToVoice,
+    EPhoneInCallCmdSetVolumeLevel,
+    
+    //Dialer commands
+    EPhoneDialerCmdLog,
+    EPhoneDialerCmdContacts,
+    EPhoneDialerCmdClear,  
+    EPhoneDialerCallHandling,
+    EPhoneDialerCmdTouchInput,
+    EPhoneDialerCmdSpeedDial,
+    EPhoneDialerCmdEditText,
+    EPhoneDialerCallSettings,   
+    EPhoneDtmfDialerCancel, 
+    EPhoneDtmfDialerExit,
+    EPhoneIsDTMFDialerVisible,
+    EPhoneDialerCmdHelp,
+    EPhoneDialerCmdHelpDtmf,
+    EPhoneIsCustomizedDialerVisible,
+
+    EPhoneCmdVideoCallOutOfMemory,
+
+// <-- QT PHONE START -->
+    EPhoneCmdUpdateUiControls,
+// <-- QT PHONE END -->
+   
+    EPhoneCmdLast
+    };
+    
+    
+// Command range for custom menu commands.
+// Custom commands can be used for menu extensions.
+#define KPhoneCustomCmdBase 8000
+#define KPhoneCustomCmdLast 8500
+
+enum
+    {
+    EPhoneCmdCustomFirst = KPhoneCustomCmdBase,
+    EPhoneCmdCustomLast = KPhoneCustomCmdLast
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/phone_application_commands_api/inc/xqphoneappcommands.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* 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: 
+*     This file contains declarations for call commands of Phone Application.
+*     
+*
+*/
+
+
+#ifndef XQPHONEAPPCOMMANDS_H
+#define XQPHONEAPPCOMMANDS_H
+
+//  MENU COMMANDS
+enum PhoneMenuCommands
+    {
+    // Commands for incall menu
+    PhoneInCallCmdEndAllCalls,
+    PhoneInCallCmdTransfer,
+    PhoneInCallCmdSendMessage,
+    PhoneInCallShareVideo,
+    PhoneInCallCmdSwitchToVideo,
+    PhoneInCallCmdHandoverToWlan,
+    PhoneInCallCmdHandoverToGsm,
+    
+    PhoneMenuCmdLast 
+    };
+
+//  PUSH BUTTON COMMANDS
+enum PhonePushButtonCommands
+    {
+    // Push button commands for incall
+    PhoneInCallCmdJoinToConference = PhoneMenuCmdLast,
+    PhoneInCallCmdCreateConference,
+    PhoneInCallCmdAnswer,
+    PhoneInCallCmdReject,
+    PhoneInCallCmdHold,
+    PhoneInCallCmdUnhold,
+    PhoneInCallCmdEndActive,
+    PhoneInCallCmdEndOutgoingCall,
+    PhoneInCallCmdReplace,
+    PhoneInCallCmdSwap,
+    
+    PhonePushButtonCmdLast
+    };
+    
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/phone_application_voip_commands_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Phone Applications Voip Commands
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/phoneappvoipcommands.hrh     APP_LAYER_PLATFORM_EXPORT_PATH(phoneappvoipcommands.hrh)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/phone_application_voip_commands_api/inc/phoneappvoipcommands.hrh	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains declarations for voip commands of PhoneAppS60.
+*     Defined commands are used in menu options and soft keys.
+*     
+*
+*/
+
+
+#ifndef PHONEAPPVOIPCOMMANDS_HRH
+#define PHONEAPPVOIPCOMMANDS_HRH
+
+
+#include    <bldvariant.hrh>
+#include    <phoneappcommands.hrh>
+
+//  CONSTANTS
+/**
+ * Enumeration for VoIP specific menu and soft key
+ * commands.
+ */
+enum 
+    {
+    // First VoIP command.
+    // Not used in menu nor soft key.
+    EPhoneCmdVoipStart = EPhoneCmdLast, 
+    
+    // Command id for Internet call option.
+    EPhoneNumberAcqCmdInternetCall,
+    
+    // Command id for toggling alpha mode in number entry.
+    EPhoneNumberAcqCmdToggleNeAlphaMode,
+    
+    // Command id for toggling numeric mode in number entry.
+    EPhoneNumberAcqCmdToggleNeNumericMode,
+    
+    // Command id for Unattended trasfer option. 
+    EPhoneInCallCmdUnattendedTransfer,
+
+    /** Command id for unattended transfer acceptance. */
+    EPhoneCmdAcceptUnattendedTransfer,
+    /** Command id for unattended transfer rejectance. */
+    EPhoneCmdRejectUnattendedTransfer,
+
+    /** Command id for ok in transfer to address query */
+    EPhoneCmdTransferDialerOk,
+    /** Command id for cancel in transfer to address query */
+    EPhoneCmdTransferDialerExit,
+    /** Command id for find from contacts in transfer dialer */
+    EPhoneCmdTransferDialerSearch,
+    /** Command id for succesfull contact fetch in transfer dialer */
+    EPhoneCmdTransferDialerContactFetch,
+    /** Command id for new Internet call option */
+    EPhoneInCallCmdNewInternetCall,
+    /** Command id for ok in new call query */
+    EPhoneCmdNewInternetCallOk,
+    /** Command id for find from contacts in new call query */
+    EPhoneCmdNewInternetCallSearch,
+    /** Command id for succesfull contact fetch in new call query */
+    EPhoneCmdNewInternetCallContactFetch,
+    EPhoneCmdCancelServiceEnabling,
+    EPhoneCmdServiceEnablingTimedOut,
+    EPhoneCmdHandoverToWlan,
+    EPhoneCmdHandoverToGsm,
+    // Last VoIP command, not used in menu nor soft key.
+    // Add new VoIP commands before this.  
+    EPhoneCmdVoIPLast
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to
+:                bubble extension API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/telbubbleanim.h              APP_LAYER_PLATFORM_EXPORT_PATH(telbubbleanim.h)
+../inc/telbubblecustomelement.h     APP_LAYER_PLATFORM_EXPORT_PATH(telbubblecustomelement.h)
+../inc/telbubbleimage.h             APP_LAYER_PLATFORM_EXPORT_PATH(telbubbleimage.h)
+../inc/telbubblelabel.h             APP_LAYER_PLATFORM_EXPORT_PATH(telbubblelabel.h)
+../inc/telbubblecallimage.h         APP_LAYER_PLATFORM_EXPORT_PATH(telbubblecallimage.h)
+
+../inc/telbubbleextension.h     APP_LAYER_PLATFORM_EXPORT_PATH(telbubbleextension.h)
+../inc/telbubbleextension.inl     APP_LAYER_PLATFORM_EXPORT_PATH(telbubbleextension.inl)
+../inc/telbubbleextensionobserver.h     APP_LAYER_PLATFORM_EXPORT_PATH(telbubbleextensionobserver.h)
+../inc/telbubbleextensioninterface.h     APP_LAYER_PLATFORM_EXPORT_PATH(telbubbleextensioninterface.h)
+../inc/telbubbleextensiondata.h     APP_LAYER_PLATFORM_EXPORT_PATH(telbubbleextensiondata.h)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubbleanim.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extension control for window server animation.
+*
+*/
+
+
+
+#ifndef TELBUBBLEANIM_H
+#define TELBUBBLEANIM_H
+
+#include <coecntrl.h>
+
+class CAknBitmapAnimation;
+class CBitmapAnimClientData;
+class CEikImage;
+
+/**
+ *  Extension control for window server animation.
+ *
+ *
+ *  @lib BMCustomization.lib
+ *  @since S60 v5.0
+ */
+class CTelBubbleAnim : public CCoeControl
+    {
+public:
+    /**
+    * Two phased constructor.
+    * @param aFrameInterval Sets time between showed frames.
+    *                       Frames are played in cycle mode.
+    */
+    IMPORT_C static CTelBubbleAnim* NewL( TInt aFrameInterval );
+    
+    /** destructor */
+    IMPORT_C virtual ~CTelBubbleAnim();
+
+public:
+    /** Starts animation - this is called from BubbleManager */
+    IMPORT_C void StartAnimationL();
+    
+    /** Stop animation */
+    IMPORT_C void StopAnimation();
+    
+    /**
+     * Adds frame to animation.
+     * @param aFrame Frame to be added. Parameter is deleted before 
+     *               returning. Ownership of bitmaps transferred.
+     */
+    IMPORT_C void AddFrameToAnimationLD( CEikImage* aFrame ) const;
+
+    /**
+     * Adds frame to animation.
+     * @param aFrame Frame to be added. 
+     *               Ownership of bitmaps not transferred.
+     */
+    IMPORT_C void AddFrameToAnimationL( CEikImage& aFrame ) const;
+    
+    /**
+     * Resets animation. Also frame array is reseted.
+     */
+    IMPORT_C void Reset() const;
+
+protected: // from CCoeControl
+
+    /** returns 0 for animation */
+    IMPORT_C virtual TInt CountComponentControls() const;
+
+    /** set container window */
+    IMPORT_C virtual void SetContainerWindowL( 
+        const CCoeControl& aContainer );
+    
+    /** sets new size for animation */
+    IMPORT_C virtual void SizeChanged();
+
+    /** starts animation */
+    IMPORT_C virtual void Draw( const TRect& aRect ) const;
+    
+    /** handles animation visibility */
+    IMPORT_C virtual void MakeVisible( TBool aVisible );
+    
+protected:
+    IMPORT_C virtual void ConstructL( TInt aFrameInterval );
+    IMPORT_C CTelBubbleAnim();
+    
+protected:
+    CAknBitmapAnimation* iAnimation; // owned
+    };
+
+#endif // TELBUBBLEANIM_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubblecallimage.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extension control for displaying call image.
+*
+*/
+
+
+#ifndef TELBUBBLECALLIMAGE_H
+#define TELBUBBLECALLIMAGE_H
+
+#include <coecntrl.h>
+
+class CFbsBitmap;
+
+/**
+ *  Extension control for displaying call image.
+ *
+ *
+ *  @lib BMCustomization.lib
+ *  @since S60 v5.0
+ */
+class CTelBubbleCallImage : public CCoeControl
+    {
+public:
+    /** Two phase constructor */
+    IMPORT_C static CTelBubbleCallImage* NewL();
+
+    /** destructor */
+    IMPORT_C virtual ~CTelBubbleCallImage();
+
+public:
+    /**
+     * Set call image. The bitmaps are set by Phone application,
+     * when it has created bitmaps from the call image.
+     * @param aImage Call image bitmap.
+     * @param aImageOwnership ETrue, if ownership is transferred.
+     * @param aMask  Mask bitmap when exists.
+     * @param aMaskOwnership  ETrue, if ownership is transferred.  
+     */
+    IMPORT_C void SetImage( CFbsBitmap* aImage, 
+                            TBool aImageOwnership = EFalse,
+                            CFbsBitmap* aMask = NULL,
+                            TBool aMaskOwnership = EFalse );
+    
+    /**
+     * Set image placing area. This is set by Phone application.
+     * @param aRect 
+     */
+    IMPORT_C void SetImagePlacingArea( TRect& aRect );
+    
+protected:    
+    /**
+     * Called when image is changed.
+     */
+    IMPORT_C virtual void ImageChanged();
+
+    /**
+     * Returns pointer to image bitmap.
+     */
+    IMPORT_C const CFbsBitmap* Image() const;
+
+    /**
+     * Returns pointer to mask bitmap.
+     */
+    IMPORT_C const CFbsBitmap* Mask() const;
+    
+    /**
+     * Returns ETrue if image covers this control entirely.
+     */
+    IMPORT_C TBool IsFullScreenImage() const;
+    
+    /**
+     * Returns offset centering image to this control.
+     * For non fullscreen images this offset is relative
+     * to image placing area.
+     */
+    IMPORT_C const TPoint& Offset() const;
+    
+    /**
+     * Returns source rect centering image to this control.
+     * For non-fullscreen images this offset is relative
+     * to image placing area.
+     */
+    IMPORT_C const TRect& SourceRect() const;
+    
+    /**
+     * Returns image placing area. Can be used to position
+     * non-fullscreen sized images. 
+     * @return Image placing area.
+     */
+    IMPORT_C const TRect& ImagePlacingArea() const;
+    
+protected: // from CCoeControl
+    IMPORT_C virtual void Draw( const TRect& /*aRect*/ ) const;
+    IMPORT_C virtual void SizeChanged();
+
+protected:
+    IMPORT_C virtual void ConstructL();
+    IMPORT_C CTelBubbleCallImage();
+    
+private:
+    TRect iSourceRect;
+    TPoint iOffset;
+    TRect iImagePlacingArea;
+    CFbsBitmap *iImage;
+    CFbsBitmap *iMask;
+    TBool iImageOwnership;
+    TBool iMaskOwnership;
+    };
+
+#endif // TELBUBBLECALLIMAGE_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubblecustomelement.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Wraps extension control and binds it to UI element. 
+*
+*/
+
+
+#ifndef TELBUBBLECUSTOMELEMENT_H
+#define TELBUBBLECUSTOMELEMENT_H
+
+#include <e32base.h>
+
+class CTelBubbleAnim;
+class CTelBubbleLabel;
+class CTelBubbleImage;
+class CCoeControl;
+class CTelBubbleCallImage;
+
+/**
+ *  Wraps extension control and binds it to UI element. 
+ *
+ *
+ *  @lib BMCustomization.lib
+ *  @since S60 v5.0
+ * 
+ * 
+ *  Usage:
+ * 
+ *    // Display custom icon in big call indicator position
+ *    CTelBubbleImage* image = CTelBubbleImage::NewL();
+ *    image->SetPicture( bitmap, mask );             
+ *    CTelBubbleCustomElement* element =
+ *         CTelBubbleCustomElement::NewL( 
+ *              image, 
+ *              CTelBubbleCustomElement::EBigCallIndicator );
+ * 
+ */
+NONSHARABLE_CLASS( CTelBubbleCustomElement ) : public CBase
+    {
+public:
+    // Customized UI element
+    enum TElementType
+        {
+        // Handset icon in initializing call states
+        EBigCallIndicator = 0,
+        // Number type icon ( ie. internet or video call )
+        ENumberTypeIcon,
+        // Handset icon
+        ESmallCallIndicator,
+        // Icon in call bubble (placeholder)
+        EBrandImage,
+        // Contact or default picture in main pane
+        ECallImage,
+        // Keep this last
+        ECustomElementCount
+        };
+        
+    // Custom control type
+    enum TControlType
+        {
+        // CTelBubbleImage based control
+        EBubbleImage,
+        // CTelBubbleAnim based control
+        EBubbleAnimation,
+        // CCoeControl based control
+        EBubbleControl,
+        // CTelBubbleLabel based control
+        EBubbleLabel,
+        // CTelBubbleCallImage based control
+        EBubbleCallImage
+        };
+    
+public:
+    /**
+    * Two phase constructor
+    * @param aControl Sets owned control, ownership is transferred
+    * @param aElement Sets place where control is shown
+    * @return New instance
+    */
+    IMPORT_C static CTelBubbleCustomElement* NewL( 
+        CCoeControl* aControl, TElementType aElement );
+    IMPORT_C static CTelBubbleCustomElement* NewL(
+        CTelBubbleAnim* aControl, TElementType aElement );
+    IMPORT_C static CTelBubbleCustomElement* NewL( 
+        CTelBubbleLabel* aControl, TElementType aElement );
+    IMPORT_C static CTelBubbleCustomElement* NewL(
+        CTelBubbleImage* aControl, TElementType aElement );
+    IMPORT_C static CTelBubbleCustomElement* NewL(
+        CTelBubbleCallImage* aControl, TElementType aElement );
+    
+    /** Destructor */
+    IMPORT_C virtual ~CTelBubbleCustomElement();
+    
+public:
+    /**
+     * Returns custom control.
+     */
+    IMPORT_C CCoeControl* Control() const;
+    
+    /**
+     * Returns control type.
+     */
+    IMPORT_C TControlType ControlType() const;
+    
+    /**
+     * Return constomized UI element.
+     */
+    IMPORT_C TElementType ElementType() const;
+    
+private:
+    // C++ constructors
+    CTelBubbleCustomElement( CCoeControl* aControl, 
+                             TElementType aElement );
+    CTelBubbleCustomElement( CTelBubbleAnim* aControl, 
+                             TElementType aElement );
+    CTelBubbleCustomElement( CTelBubbleLabel* aControl, 
+                             TElementType aElement );
+    CTelBubbleCustomElement( CTelBubbleImage* aControl, 
+                             TElementType aElement );
+    CTelBubbleCustomElement( CTelBubbleCallImage* aControl, 
+                             TElementType aElement );
+    
+private:
+    CCoeControl* iControl; // owned
+    TControlType iControlType;
+    TElementType iElementType;
+    };
+
+#endif // TELBUBBLECUSTOMELEMENT_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubbleextension.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for extension plug-in.
+*
+*/
+
+
+#ifndef TELBUBBLEEXTENSION_H
+#define TELBUBBLEEXTENSION_H
+
+// INCLUDES
+#include <e32base.h>
+#include "telbubbleextensioninterface.h"
+
+// CONSTANTS
+// Constants used in ECOM implementation
+const TUid KTelBubbleExtensionInterfaceUid    = { 0x102078F6 };
+
+class MTelBubbleExtensionObserver;
+class MTelBubbleExtensionData;
+
+class CTelBubbleExtension : public CBase,
+                            public MTelBubbleExtensionInterface
+    {
+public:
+    /**
+    * Two phase constructor
+    *
+    * @leave Uses Leave code KErrNotFound if implementation is not found.
+    * @param aImplementationUid Implementation UID of the plugin to be
+    *        created.
+    */
+    static CTelBubbleExtension* NewL(
+        TUid aImplementationUid );
+
+    /** Destructor */
+    virtual inline ~CTelBubbleExtension();
+
+    /**
+     * Initialize plug-in. Called after NewL
+     * @param aBubbles Interface for bubbles
+     */
+    virtual void InitializeL( MTelBubbleExtensionObserver& aBubbles ) = 0;
+
+// from MTelBubbleExtensionInterface
+
+    /**
+     * Notifies that a new customizable bubble is available
+     *
+     * @param aCallData Reference to call data.
+     */
+    virtual void StartCustomizedBubble(
+            MTelBubbleExtensionData& aCallData ) = 0;
+
+    /**
+     * Notifies that a customizable bubble has been removed
+     *
+     * @param aCallData Reference to call data.
+     */
+    virtual void StopCustomizedBubble(
+            MTelBubbleExtensionData& aCallData ) = 0;
+
+    /**
+     * Indicates that currently bubble drawing is started.
+     * Customizing is preferred to be done during this call.
+     */
+    virtual void BubbleUpdating() = 0;
+
+private: // data
+
+    /**
+     * ECOM plugin instance UID.
+     */
+    TUid iDtor_ID_Key;
+    };
+
+#include "telbubbleextension.inl"
+
+#endif // TELBUBBLEEXTENSION_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubbleextension.inl	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inline functions for CTelBubbleExtension.
+*
+*/
+
+
+#include <ecom.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelBubbleExtension::~CTelBubbleExtension()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+// -----------------------------------------------------------------------------
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelBubbleExtension* CTelBubbleExtension::NewL(
+    TUid aImplementationUid )
+    {
+    TAny* ptr( NULL );
+    TInt32 keyOffset = _FOFF( CTelBubbleExtension, iDtor_ID_Key );
+    ptr = REComSession::CreateImplementationL(
+        aImplementationUid,
+        keyOffset );
+
+    CTelBubbleExtension* plugin =
+        reinterpret_cast <CTelBubbleExtension*> (ptr);
+    return plugin;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubbleextensiondata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for call data access.
+*
+*/
+
+
+#ifndef TELBUBBLEEXTENSIONDATA_H
+#define TELBUBBLEEXTENSIONDATA_H
+
+#include <e32base.h>
+
+class MTelBubbleExtensionData
+    {
+public:
+    // Specifies call types    
+    enum TCallType
+        {
+        EUninitialized = 0,
+        ECsVoice = 1,  // Circuit switched voice call
+        ECsVideo = 2, // Multimedia/Video call
+        EPsVoice = 3 // Voice over IP call
+        };
+        
+    // Specifies call states
+    enum TCallState
+        {
+        ENone           = 0, // Default on creation
+        EOnHold         = 1,
+        EDisconnected   = 2,
+        EActive         = 3,
+        EIncoming       = 4,
+        EWaiting        = 5,
+        EAlertToDisconnected = 6,
+        EOutgoing       = 7,
+        EAlerting       = 8,
+        };
+        
+public:
+
+    /**
+     * Bubble ID this call is connected to.
+     * @return Bubble ID.
+     */
+    virtual TInt BubbleId() const = 0;
+
+    /**
+     * Call state information.
+     * @return Call state.
+     */
+    virtual TCallState State() const = 0;
+    
+    /**
+     * Call type information
+     * @return Call type.
+     */
+    virtual TCallType Type() const = 0;
+    
+    /**
+     * Call service id
+     * @return Call service
+     */
+    virtual TUint32 ServiceId() const = 0;
+    
+    /**
+     * Contact Link related to this call.
+     * @return Reference to Contact Link
+     */
+    virtual const TDesC8& ContactLink() const = 0;
+    
+    /**
+     * Remote party number related to this call.
+     * @return Reference to remote party number.
+     */
+    virtual const TDesC& RemotePhoneNumber() const = 0;
+    };
+
+#endif // TELBUBBLEEXTENSIONDATA_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubbleextensioninterface.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bubble extension interface.
+*
+*/
+
+
+#ifndef TELBUBBLEEXTENSIONINTERFACE_H
+#define TELBUBBLEEXTENSIONINTERFACE_H
+
+#include <e32base.h>
+
+class MTelBubbleExtensionData;
+
+class MTelBubbleExtensionInterface
+    {
+public:
+
+    /**
+     * Notifies that a new customizable bubble is available.
+     *
+     * This function is called when a new bubbleheader is created. Plugin
+     * should initiate a new customization instance inside this method and
+     * store the reference to the call data.
+     *
+     * @param aCallData Reference to call data.
+     */
+    virtual void StartCustomizedBubble(
+            MTelBubbleExtensionData& aCallData ) = 0;
+
+    /**
+     * Notifies that a customizable bubble has been removed
+     *
+     * This function is called when a bubbleheader is going to be deleted.
+     * Plugin should detach all customizations related to this call and
+     * delete the local datas related to this call.
+     *
+     * @param aCallData Reference to call data.
+     */
+    virtual void StopCustomizedBubble(
+            MTelBubbleExtensionData& aCallData ) = 0;
+
+    /**
+     * Indicates that currently bubble drawing is started.
+     * Customizing is preferred to be done during this call.
+     *
+     * This function is called when the call bubbles are being updated.
+     * The call datas are updated before this function is called. Plugin should
+     * check whether any of the calls are changed so that change to the
+     * customized element is needed and make the change. Doing the
+     * changes during this method will prevent excess flickering and
+     * redraws and therefore is suggested.
+     */
+    virtual void BubbleUpdating() = 0;
+
+    };
+
+#endif // TELBUBBLEEXTENSIONINTERFACE_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubbleextensionobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Customization interface for plugins to use.
+*
+*/
+
+
+#ifndef TELBUBBLEEXTENSIONOBSERVER_H
+#define TELBUBBLEEXTENSIONOBSERVER_H
+
+#include <e32base.h>
+
+class CTelBubbleCustomElement;
+
+class MTelBubbleExtensionObserver
+    {
+public:
+    /**
+     * Call this before attach, detach and replace operations,
+     * when doing multipe changes outside BubbleUpdating() method. 
+     * UI is not redrawn until calling EndChanges() is called. 
+     */
+    virtual void StartChanges() = 0;
+    
+    /**
+     * Call this when all changes have been done and UI can be
+     * redrawn.
+     */
+    virtual void EndChanges() = 0;
+    
+    /**
+     * Attaches element to bubble. Causes redraw.
+     * @param aBubbleId Bubble id
+     * @param aElement Element to be attached, ownership is not transferred
+     */
+    virtual void AttachElement( 
+            TInt aBubbleId, 
+            CTelBubbleCustomElement* aElement ) = 0;
+    
+    /**
+     * Replaces element in bubble. Causes redraw.
+     * @param aBubbleId Bubble id
+     * @param aOld Element to be detached, ownership is not transferred
+     * @param aNew Element to be attached, ownership is not transferred
+     */
+    virtual void ReplaceElement( 
+            TInt aBubbleId, 
+            CTelBubbleCustomElement* aOld, 
+            CTelBubbleCustomElement* aNew ) = 0;
+    
+    /**
+     * Detaches element in bubble. Causes redraw.
+     * @param aBubbleId Bubble id
+     * @param aElement Element to be detached, ownership is not transferred
+     */
+    virtual void DetachElement( 
+            TInt aBubbleId, 
+            CTelBubbleCustomElement* aElement ) = 0;
+    
+    };
+
+#endif // TELBUBBLEEXTENSIONOBSERVER_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubbleimage.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extension control for displaying an icon (static image).
+*
+*/
+
+
+#ifndef TELBUBBLEIMAGE_H
+#define TELBUBBLEIMAGE_H
+
+#include <eikimage.h>
+
+/**
+ *  Extension control for displaying an icon (static image).
+ *
+ *
+ *  @lib BMCustomization.lib
+ *  @since S60 v5.0
+ */
+class CTelBubbleImage : public CEikImage
+    {
+public:
+    /** Two phase constructor */
+    IMPORT_C static CTelBubbleImage* NewL();
+
+    /** destructor */
+    IMPORT_C virtual ~CTelBubbleImage();
+
+protected: // from CCoeControl
+    IMPORT_C virtual void PositionChanged();
+    IMPORT_C virtual void SizeChanged();
+
+protected:
+    IMPORT_C virtual void ConstructL();
+    IMPORT_C CTelBubbleImage();
+    };
+
+#endif // TELBUBBLEIMAGE_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_bubble_extension_api/inc/telbubblelabel.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extension control for displaying text.
+*
+*/
+
+
+#ifndef TELBUBBLELABEL_H
+#define TELBUBBLELABEL_H
+
+#include <eiklabel.h>
+
+/**
+ *  Extension control for displaying text.
+ *
+ *
+ *  @lib BMCustomization.lib
+ *  @since S60 v5.0
+ */
+class CTelBubbleLabel : public CEikLabel
+    {
+public:
+    };
+
+#endif // TELBUBBLELABEL_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_comms_information_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Comms Information API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telcommsinfopskeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telcommsinfopskeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_comms_information_api/inc/telcommsinfopskeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony Comms Information Publish and Subscribe keys.
+*
+*/
+
+
+#ifndef TELCOMMSINFOPSKEYS_H
+#define TELCOMMSINFOPSKEYS_H
+
+#include <e32std.h>
+
+// CONSTANTS
+
+/******************************************************************************
+* Telephony Comms Information API UID
+*******************************************************************************/
+const TUid KPSUidTelComms = {0x102029A6};
+
+/**
+* Dataport to be used for video calls.
+* Data encoding: <dataport name><delimiter><port number>
+* where <dataport name> = string literal
+*       <delimiter> = double colon
+*       <port number> = integer value
+*
+* @type RProperty::EText
+*/
+const TUint32 KTelCommsDataport = 0x00000001;
+
+#endif      // TELCOMMSINFOPSKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_comms_information_api/telephony_comms_information_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="da62ee2cba55da080d4e74c495a5684a" dataversion="1.0">
+  <name>Telephony Comms Information API</name>
+  <description>Provides used dataport in video call via PubSub.</description>
+  <type>c++</type>
+  <subsystem>phoneengine</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_configuration_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Configuration API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telconfigcrkeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telconfigcrkeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_configuration_api/inc/telconfigcrkeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony configuration central repository keys
+*
+*/
+
+
+#ifndef TELCONFIGCRKEYS_H
+#define TELCONFIGCRKEYS_H
+
+#include <e32std.h>
+
+
+/******************************************************************************
+* Telephony Configuration API
+* Keys under this category are used in defining telephony configuration.
+******************************************************************************/
+const TUid KCRUidTelConfiguration = {0x102828B8};
+
+/**
+* Amount of digits to be used in contact matching.
+* This allows a customer to variate the amount of digits to be matched.
+*/
+const TUint32 KTelMatchDigits                               = 0x00000001;
+
+#endif      // TELCONFIGCRKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_configuration_api/telephony_configuration_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="7ac20948c26bc9958b6731327d42e11a" dataversion="1.0">
+  <name>Telephony Configuration API</name>
+  <description>PubSub key to configure feature behaviour in telephony</description>
+  <type>c++</type>
+  <subsystem>phoneengine</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_device_mode_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Device Mode API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/cteldmhandler.h     APP_LAYER_PLATFORM_EXPORT_PATH(cteldmhandler.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_device_mode_api/inc/CTelDMHandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Class for creating Telephony Device Mode related classes. 
+*
+*/
+
+
+
+#ifndef CTELDMHANDLER_H
+#define CTELDMHANDLER_H
+
+#include    <e32base.h>
+
+// FORWARD DECLARATIONS
+
+class MPhoneDeviceModeObserver;
+class CTelDMGripHandler;
+
+// CLASS DECLARATION
+ 
+
+/**
+*  Main class for creating Telephony Device Mode classes.
+*
+*  @since Series60 3.0
+*/
+class CTelDMHandler : public CBase
+    { 
+    public: // New functions
+
+        /**
+        * Set call event observer
+        * @return void
+        */
+        virtual void SetObserverL( MPhoneDeviceModeObserver* aCallHandler ) = 0;
+       
+    };
+
+/**
+* Creates CTelDMFactory. Position 1 in DLL's lookup table.
+* @return Reference to CTelDMFactory object. Ownership is transferred.
+*/
+IMPORT_C CTelDMHandler* CTelDMHandlerCreateL();
+ 
+ 
+#endif      // CTELDMHANDLER_H  
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_device_mode_api/telephony_device_mode_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="cc72354170c1c516b0ee2944ab5fb262" dataversion="1.0">
+  <name>Telephony Device Mode API</name>
+  <description>An interface for creating Telephony Device Mode component. With this API a client may implement own version of TelephonyDeviceMode.dll compoment and replace the default implementation.</description>
+  <type>c++</type>
+  <subsystem>phoneuis</subsystem>
+  <libs>
+    <lib name="telephonydevicemode.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Information API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telincallvolcntrlcrkeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telincallvolcntrlcrkeys.h)
+../inc/telephonydomainpstypes.h     APP_LAYER_PLATFORM_EXPORT_PATH(telephonydomainpstypes.h)
+../inc/telephonydomainpskeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telephonydomainpskeys.h)
+../inc/telinformationpskeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telinformationpskeys.h)
+../inc/telinformationpstypes.h     APP_LAYER_PLATFORM_EXPORT_PATH(telinformationpstypes.h)
+../inc/telephonydomaincrkeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telephonydomaincrkeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/inc/telephonydomaincrkeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony domain Central Repository keys
+*
+*/
+
+
+#ifndef TELEPHONYDOMAINCRKEYS_H
+#define TELEPHONYDOMAINCRKEYS_H
+
+#include <e32std.h>
+#include <telconfigcrkeys.h>
+#include <telincallvolcntrlcrkeys.h>
+#include <telvmbxsettingscrkeys.h>
+
+#endif      // TELEPHONYDOMAINCRKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/inc/telephonydomainpskeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony Domain Publish and Subscribe keys.
+*
+*/
+
+
+#ifndef TELEPHONYDOMAINPSKEYS_H
+#define TELEPHONYDOMAINPSKEYS_H
+
+#include <e32std.h>
+#include <telmicmutestatuspskeys.h>
+#include <telremotepartyinformationpskeys.h>
+#include <telinformationpskeys.h>
+
+// CONSTANTS
+// None
+
+#endif      // TELEPHONYDOMAINPSKEYS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/inc/telephonydomainpstypes.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Data types passed through Publish and Subscribe
+*
+*/
+
+
+#ifndef TELEPHONYDOMAINPSTYPES_H
+#define TELEPHONYDOMAINPSTYPES_H
+
+// INCLUDES
+#include <telinformationpstypes.h>
+
+
+#endif    // TELEPHONYDOMAINPSTYPES_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/inc/telincallvolcntrlcrkeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony in-call volume control central repository keys
+*
+*/
+
+
+#ifndef TELINCALLVOLCNTRLCRKEYS_H
+#define TELINCALLVOLCNTRLCRKEYS_H
+
+#include <e32std.h>
+
+/******************************************************************************
+* Telephony In-Call Volume Control API
+* This API provides information related to in-call volume.
+******************************************************************************/
+const TUid KCRUidInCallVolume = {0x102828B1}; 
+
+/**
+* Volume for non-IHF (loudspeaker) mode. 
+* Clients must use only integer values between 0 and 10.
+* Change affects to in-call volume.
+* Default value is 4.  
+*/
+const TUint32 KTelIncallEarVolume                           = 0x00000001;
+
+/**
+* Volume for IHF mode. 
+* Clients must use only integer values between 0 and 10.
+* Change affects to in-call volume.
+* Default value is 4.
+*/
+const TUint32 KTelIncallLoudspeakerVolume                   = 0x00000002;
+
+#endif      // TELINCALLVOLCNTRLCRKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/inc/telinformationpskeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony information Publish and Subscribe keys.
+*
+*/
+
+
+#ifndef TELINFORMATIONPSKEYS_H
+#define TELINFORMATIONPSKEYS_H
+
+#include <e32std.h>
+
+// CONSTANTS
+
+/*****************************************************************************
+* Telephony Information API UID
+*****************************************************************************/
+const TUid KPSUidTelInformation = {0x101F8789};
+
+/**
+* Identifier of Phone application.
+* @type RProperty::EInt
+*/
+const TUint32 KTelPhoneUid = 0x00000001; 
+
+/**
+* Operator information display data.
+* @see TTelTitleDisplay in TelephonyDomainPSTypes.h
+* @type RProperty::EByteArray
+*/
+
+const TUint32 KTelDisplayInfo =  0x00000002; 
+
+/*****************************************************************************
+* Telephony Car Mode API
+* This can be used for setting and requesting
+* Car Mode status.
+*****************************************************************************/
+const TUid KPSUidTelCarMode = {0x102029A8};
+
+/**
+* Indicates the car mode setting
+* This key has two special values, see EPSCarModeSetting.
+* 
+* @type RProperty::EInt
+*/          
+const TUint32 KTelCarMode = 0x00000001;
+enum EPSTelCarModeSetting
+    {
+    EPSCarModeOff = 0,
+    EPSCarModeOn    
+    };
+
+#endif      // TELINFORMATIONPSKEYS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/inc/telinformationpstypes.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Data types passed through Publish and Subscribe
+*
+*/
+
+
+#ifndef TELINFORMATIONPSTYPES_H
+#define TELINFORMATIONPSTYPES_H
+
+// INCLUDES
+#include <cntdef.h>
+#include <phclttypes.h>
+
+// CONSTANTS
+
+// DATA TYPES
+
+/**
+* Information to be shown in Phone application title pane.
+* Note: Size of the data must not exceed RProperty::KMaxPropertySize.
+*/
+struct TTelTitleDisplay
+    {
+    /**
+    * Maximum length for display information.
+    */
+    enum { ETagMaxLength = 128 };
+    
+    /**
+    * Display information buffer.
+    */
+    typedef TBuf<ETagMaxLength> TDisplayTag;
+    
+    // Operator information, off-line etc.
+    TDisplayTag iDisplayTag;
+    
+    // Handle to operator logo, or 0 if not valid.
+    TInt iLogoHandle;
+
+    // Handle to operator logo mask bitmap, or 0 if not valid.
+    TInt iLogoMaskHandle;
+
+    // Handle to background image
+    TInt iBackgroundImageHandle;
+
+    // Handle to background mask image
+    TInt iBackgroundImageMaskHandle;
+    
+    // Background redraw counter
+    TUint iBackgroundImageRedrawCounter;
+
+    typedef TPckg<TTelTitleDisplay> TDisplayInfoPckg;
+    };
+
+
+#endif    // TELINFORMATIONPSTYPES_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_information_api/telephony_information_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="383e43832fb41109dce1129ec0c42ca7" dataversion="1.0">
+  <name>Telephony Information API</name>
+  <description>Provides information from telephony.</description>
+  <type>c++</type>
+  <subsystem>phoneengine</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_logging_extension_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Logging extension API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telloggingextension.h     APP_LAYER_PLATFORM_EXPORT_PATH(telloggingextension.h)
+../inc/telloggingextension.inl     APP_LAYER_PLATFORM_EXPORT_PATH(telloggingextension.inl)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_logging_extension_api/inc/telloggingextension.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Defines interface for manipulating telephony call logging
+*                using ECOM plugin.
+*
+*/
+
+
+#ifndef TELLOGGINGEXTENSION_H
+#define TELLOGGINGEXTENSION_H
+
+#include <e32base.h>
+#include <data_caging_path_literals.hrh>
+
+// Constants used in ECOM implementation
+const TUid KTelLoggingExtensionUid    = { 0x2001E2A2 };
+
+
+/**
+ * Plugin interface class for manipulating telephony
+ * call logging.
+ *
+ * @since S60 5.0
+ */
+class CTelLoggingExtension : public CBase
+    {
+public:
+
+    /**
+    * Creates new xSP plugin having the given UID.
+    * @leave Uses Leave code KErrNotFound if implementation is not found.
+    * @param aImplementationUid Implementation UID of the plugin to be
+    *        created.
+    */
+    static CTelLoggingExtension* NewL(
+        TUid aImplementationUid );
+
+    /**
+    * Destructor
+    */
+    virtual inline ~CTelLoggingExtension();
+    
+    /**
+    * Initialize CTelLoggingExtension after it is created with NewL.
+    * @param aServiceId - This id identify what service is currently used in call.
+    * @param aOrigAddress - Original address.
+    */
+    virtual void InitializeL( TUint aServiceId, const TDesC& aOrigAddress ) = 0;
+    
+    /**
+    * Gets phone number to be logged to Logs events phone number field.
+    * Sets aPhoneNumber parameter as empty (KNullDesC) if valid phone number is not available.
+    * Phone number have to be valid for GSM calls.
+    * @param aPhoneNumber - Number to be logged to the log events phone number field.  
+    * @return - Return KErrNone if operation succeed.
+    */
+    virtual TInt GetPhoneNumber( RBuf& aPhoneNumber ) = 0;
+
+    /**
+    * Gets VoIP address to be logged to Logs events VoIP address field.
+    * Sets aVoipAddress parameter as empty (KNullDesC) if valid VoIP address is not available.
+    * @param aVoipAddress - Address to be logged to the log events VoIP address field.  
+    * @return - Return KErrNone if operation succeed.
+    */
+    virtual TInt GetVoipAddress( RBuf& aVoipAddress ) = 0;
+    
+    /**
+    * Gets users own address for Logs application.
+    * Sets aMyAddress parameter as empty (KNullDesC) if valid users own address is not available.
+    * My address option will be visible in Logs when this parameter is available.
+    * @param aMyAddress - Address to be shown by Logs application "Show my address"
+    *                     option.  
+    * @return - Return KErrNone if operation succeed.
+    */
+    virtual TInt GetMyAddress( RBuf& aMyAddress ) = 0;
+    
+    /**
+    * Gets remote party name.
+    * Remote party name (returned by plugin) will be shown on the logs event when contact 
+    * matching not succeed nor call was not made as private/anonymous call (MT call, 
+    * private address/number).
+    * @param aRemotePartyName - Remote party name.
+    * @return - Return KErrNone if operation succeed.
+    */
+    virtual TInt GetRemotePartyName( RBuf& aRemotePartyName ) = 0;
+
+
+private: // data
+
+    /**
+     * ECOM plugin instance UID.
+     */
+     TUid iDtor_ID_Key;
+
+    };
+
+#include "telloggingextension.inl"
+
+#endif // TELLOGGINGEXTENSION_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_logging_extension_api/inc/telloggingextension.inl	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inline functions for CTelLoggingExtension.
+*
+*/
+
+#include <ecom/ecom.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelLoggingExtension::~CTelLoggingExtension()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+// -----------------------------------------------------------------------------
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelLoggingExtension* CTelLoggingExtension::NewL( 
+    TUid aImplementationUid ) 
+    {
+    TAny* ptr;
+    TInt32 keyOffset = _FOFF( CTelLoggingExtension, iDtor_ID_Key );
+    ptr = REComSession::CreateImplementationL(
+        aImplementationUid,
+        keyOffset );
+    
+    CTelLoggingExtension* plugin = 
+        reinterpret_cast <CTelLoggingExtension*> (ptr);
+    return plugin;
+    }    
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_matching_extension_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                matching extension API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telmatchingextension.h     APP_LAYER_PLATFORM_EXPORT_PATH(telmatchingextension.h)
+../inc/telmatchingextension.inl     APP_LAYER_PLATFORM_EXPORT_PATH(telmatchingextension.inl)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_matching_extension_api/inc/telmatchingextension.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Defines interface for manipulating telephony contact matching
+*                using ECOM plugin.
+*
+*/
+
+
+#ifndef TELMATCHINGEXTENSION_H
+#define TELMATCHINGEXTENSION_H
+
+#include <e32base.h>
+#include <badesca.h>
+#include <data_caging_path_literals.hrh>
+
+// Constants used in ECOM implementation
+const TUid KTelMatchingExtensionUid    = { 0x2001E2A4 };
+
+
+/**
+ * Plugin interface class for manipulating telephony
+ * contact matching.
+ *
+ * @since S60 5.0
+ */
+class CTelMatchingExtension : public CBase
+    {
+public:
+
+    /**
+    * Creates new xSP plugin having the given UID.
+    * @leave Uses Leave code KErrNotFound if implementation is not found.
+    * @param aImplementationUid Implementation UID of the plugin to be
+    *        created.
+    */
+    static CTelMatchingExtension* NewL(
+        TUid aImplementationUid );
+
+    /**
+    * Destructor
+    */
+    virtual inline ~CTelMatchingExtension();
+    
+    /**
+    * Initialize CTelMatchingExtension after it is created with NewL.
+    * @param aServiceId - This id identify what service is currently used in call.
+    * @param aOrigAddress - Original address.
+    */
+    virtual void InitializeL( TUint aServiceId, const TDesC& aOrigAddress ) = 0;
+    
+    /**
+    * Returns parsed address to be used in contact matching.
+    * Sets aParsedAddress parameter as empty (KNullDesC) if original number should be used
+    * in contact matching. 
+    * @param aParsedAddress - Address parsed by plugin. This address will be used for matching.
+    * @param aMeaningfulDigits - How many digits (starting from the right) are meaningful for matching.
+    *                            Value of the parameter have to be between 4-20 otherwise the whole
+    *                            of address will be used for matching (e.g. by value 0).
+    *                            If length of the address is less than value of the parameter the whole
+    *                            of address will be used for matching.
+    * @return - Return KErrNone if operation succeed.
+    */
+    virtual TInt GetAddressForMatching( RBuf& aParsedAddress, TInt& aMeaningfulDigits ) = 0;
+
+    /**
+    * Returns contact store uris which are opened and will be used for matching.
+    * @param aStoreUris - Contact store uri array.
+    * @return - Return KErrNone if operation succeed.
+    */
+    virtual TInt GetContactStoreUris( CDesCArray& aStoreUris ) = 0;
+    
+    /**
+    * Returns remote party name (remote party name is shown in the call bubble).
+    * Sets aRemotePartyName parameter as empty (KNullDesC) if remote party name is not available.
+    * Remote party name (aRemotePartyName) will be shown in the call bubble when contact 
+    * matching not succeed.
+    * @param aRemotePartyName - Remote party name.
+    * @return - Return KErrNone if operation succeed.
+    */
+    virtual TInt GetRemotePartyName( RBuf& aRemotePartyName ) = 0;
+
+
+private: // data
+
+    /**
+     * ECOM plugin instance UID.
+     */
+     TUid iDtor_ID_Key;
+
+    };
+
+#include "telmatchingextension.inl"
+
+
+#endif // TELMATCHINGEXTENSION_H
+
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_matching_extension_api/inc/telmatchingextension.inl	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inline functions for CTelMatchingExtension.
+*
+*/
+
+#include <ecom/ecom.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelMatchingExtension::~CTelMatchingExtension()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+// -----------------------------------------------------------------------------
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelMatchingExtension* CTelMatchingExtension::NewL( 
+    TUid aImplementationUid ) 
+    {
+    TAny* ptr;
+    TInt32 keyOffset = _FOFF( CTelMatchingExtension, iDtor_ID_Key );
+    ptr = REComSession::CreateImplementationL(
+        aImplementationUid,
+        keyOffset );
+    
+    CTelMatchingExtension* plugin = 
+        reinterpret_cast <CTelMatchingExtension*> (ptr);
+    return plugin;
+    }    
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_mediator_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Mediator API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/mediatoraudiocommandstotelephonyapi.h   APP_LAYER_PLATFORM_EXPORT_PATH(mediatoraudiocommandstotelephonyapi.h)
+../inc/mediatorcommandstotelephonyapi.h        APP_LAYER_PLATFORM_EXPORT_PATH(mediatorcommandstotelephonyapi.h)
+../inc/mediatoreventsfromtelephonyapi.h        APP_LAYER_PLATFORM_EXPORT_PATH(mediatoreventsfromtelephonyapi.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_mediator_api/inc/mediatoraudiocommandstotelephonyapi.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Audio specific message services sent from 3rd party client to
+*                Phone Application.
+*
+*/
+
+
+#ifndef MEDIATORAUDIOCOMMANDSTOTELEPHONYAPI_H
+#define MEDIATORAUDIOCOMMANDSTOTELEPHONYAPI_H
+
+// INCLUDES
+#include <e32base.h>
+
+/**  The category UID for the messages in this header file. */
+const TUid KCatAudioCommandsToTelephony = { 0x100058BF };
+
+/**  Version number of this API */
+const TInt KAudioCmdToTelephonyVersionMajor( 1 );
+const TInt KAudioCmdToTelephonyVersionMinor( 0 );
+const TInt KAudioCmdToTelephonyVersionBuild( 0 );
+
+/**  Video Telephony related commands to Phone Application. */
+enum TAudioCommandsToTelephony
+    {    
+    /**
+     * Commands Telephony to unmute microphone.
+     * @capability ECapability_None
+     */
+    EAudioCmdUnmute = 0,
+    
+    /**
+     * Commands Telephony to mute microphone.
+     * @capability ECapability_None
+     */
+    EAudioCmdMute
+
+    };
+
+#endif // MEDIATORAUDIOCOMMANDSTOTELEPHONYAPI_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_mediator_api/inc/mediatorcommandstotelephonyapi.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Mediator API for commanding Telephony.
+*
+*/
+
+
+#ifndef MEDIATORCOMMANDSTOTELEPHONYAPI_H
+#define MEDIATORCOMMANDSTOTELEPHONYAPI_H
+
+// INCLUDES
+#include <e32base.h>
+
+/**  The category UID for the messages in this header file. */
+const TUid KCatCommandsToTelephony = { 0x100058B8 };
+
+/**  Version number of this API */
+const TInt KTelephonyCommandsVersionMajor( 1 );
+const TInt KTelephonyCommandsVersionMinor( 0 );
+const TInt KTelephonyCommandsVersionBuild( 0 );
+
+/**  Generic Commands to Phone Application. */
+enum TCommandsToTelephony
+    {
+    /**
+     * Commands Telephony to end currently active phone call.
+     */
+    EPhoneCmdEndActiveCall = 0
+    };
+
+#endif // MEDIATORCOMMANDSTOTELEPHONYAPI_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_mediator_api/inc/mediatoreventsfromtelephonyapi.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Mediator API for events sent from Telephony.
+*
+*/
+
+
+#ifndef MEDIATOREVENTSFROMTELEPHONYAPI_H
+#define MEDIATOREVENTSFROMTELEPHONYAPI_H
+
+// INCLUDES
+#include <e32base.h>
+#include <cntdef.h>
+
+/** Max Length of Remote Phone Number */
+const TInt KMaxPhoneNumberLength = 100;
+
+/**  The category UID for the messages in this header file. */
+const TUid KCatEventsFromTelephony = { 0x100058BA };
+
+/**  Version number of this API */
+const TInt KTelephonyEventsVersionMajor( 1 );
+const TInt KTelephonyEventsVersionMinor( 0 );
+const TInt KTelephonyEventsVersionBuild( 0 );
+
+namespace TelephonyMediator {
+/**
+* Call states
+*/
+enum TCallState
+    {
+    ECallStateUnknown = 0,
+    ECallStateIdle,
+    ECallStateDialling,
+    ECallStateEmergencyDialling,
+    ECallStateRinging,
+    ECallStateConnecting,
+    ECallStateConnected,
+    ECallStateHangingUp,
+    ECallStateHeld,
+    ECallStateAnswering,
+    ECallStateRejecting,
+    ECallStateDisconnecting
+    };
+
+enum TCallType
+    {
+    // Uninitialized or unknown call type
+    ECallTypeUninitialized = 0,
+
+    // Circuit switched voice call
+    ECallTypeCSVoice,
+
+    // Fax call
+    ECallTypeFax,
+
+    // Circuit switched data call with or without high speed HSCSD attribute
+    ECallTypeData,
+    
+    // Circuit switched multimedia call
+    ECallTypeVideo,
+    
+    // Packet switched voice call
+    ECallTypeVoIP
+    };
+
+
+// Call Data Parameter is sent with EPhoneEventCallData
+class TTelephonyCallDataParam
+    {
+    public:
+        TInt iCallId;
+        TBuf<KCntMaxTextFieldLength> iCLIText;
+        TCallState iCallState;
+        TCallType iCallType;
+        TBuf<KMaxPhoneNumberLength> iRemotePhoneNumber;
+    };
+    
+// Mediator package
+typedef TPckgBuf<TTelephonyCallDataParam> TTelephonyCallDataParamPackage;
+
+/**  Generic Events from Phone Application. */
+enum TEventsFromTelephony
+    {
+    /**
+     * This event is sent when Phone Application creates a new call bubble.
+     * TTelephonyCallDataParamPackage is sent in Package Buffer.
+     */
+    EPhoneEventCallData = 0
+    };
+
+} // namespace TelephonyMediator
+
+#endif // MEDIATOREVENTSFROMTELEPHONYAPI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_menu_extension_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony extension plugin API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/telmenuextension.h     APP_LAYER_PLATFORM_EXPORT_PATH(telmenuextension.h)
+../inc/teltouchpaneextension.h     APP_LAYER_PLATFORM_EXPORT_PATH(teltouchpaneextension.h)
+../inc/telmenuextension.inl     APP_LAYER_PLATFORM_EXPORT_PATH(telmenuextension.inl)
+../inc/xqteluicommandextension.h   APP_LAYER_PLATFORM_EXPORT_PATH(xqteluicommandextension.h)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_menu_extension_api/inc/telmenuextension.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Defines interface for manipulating telephony menus using ECOM
+*                plugin.
+*
+*/
+
+
+#ifndef TELMENUEXTENSION_H
+#define TELMENUEXTENSION_H
+
+// INCLUDES
+#include <e32base.h>
+#include <teltouchpaneextension.h>
+
+// CONSTANTS
+// Constants used in ECOM implementation
+const TUid KTelMenuExtensionInterfaceUid    = { 0x2001E2A0 };
+
+// FORWARD DECLARATIONS
+class CEikMenuPane;
+
+/**
+ * Plugin interface class for manipulating telephony
+ * menu items.
+ *
+ * Menu customization *
+ * Plug-in is loaded by using service table value for most active call.
+ *
+ * Command customization *
+ * Plug-in can dimm existing commands or create new command. If default 
+ * implementation doesnt handle command, plug-in is loaded and 
+ * HandleCommandL is called.
+ *
+ * @since S60 5.1
+ */
+class CTelMenuExtension : public CBase
+    {
+public: // Data
+
+    /** 
+     * Specifies call types
+     */    
+    enum TCallType
+        {
+        EUninitialized = 0,
+        ECsVoice = 1,  // Circuit switched voice call
+        ECsFax = 2, // Fax call
+        ECsData = 3, // Circuit switched data call
+        ECsVideo = 4, // Multimedia/Video call
+        EPsVoice = 5 // Voice over IP call
+        };
+        
+    /** 
+     * Specifies call states
+     */
+    enum TCallState
+        {
+        ENone = 0,
+        EDisconnecting = 1, // Call is disconnecting
+        EActive = 2, // Call is active
+        EOnHold = 3, // Call is on hold
+        EIncoming = 4, // Call is ringing
+        EOutgoing = 5 // Call is dialling or connecting
+        };
+        
+    /**
+     * Capsulates call info.
+     */
+    class TCallInfo
+        {
+    public:
+        // Call id, specified by phoneengine
+        // Conference call can be determined by using this integer
+        // Check phoneengine API
+        TInt iCallId;
+        
+        // Service provider settings item Id
+        TUint iServiceId;
+        
+        // Calls state
+        TCallState iCallState;
+        
+        // Calls type
+        TCallType iCallType;
+        };
+
+
+public:
+
+    /**
+     * Create new plugin having the given UID.
+     *
+     * @leave Uses Leave code KErrNotFound if implementation is not found.
+     * @param aImplementationUid Implementation UID of the plugin to be
+     *        created.
+     */
+    static CTelMenuExtension* NewL(
+        TUid aImplementationUid );
+
+    /**
+     * Destructor
+     */
+    virtual inline ~CTelMenuExtension();
+
+        
+    /**
+     * Modifys given menu pane. Removes unsupported options from call menu and 
+     * adds custom menu commands to the menu.
+     *
+     * @param aCallArray - Array holding information of all ongoing calls.
+     * @param aMenuPane - A modifyable menu pane.
+     */
+    virtual void ModifyExtensionsCallMenuL( 
+                    const RArray<CTelMenuExtension::TCallInfo>& aCallArray,
+                    CEikMenuPane& aMenuPane ) = 0;
+
+    /**
+     * Modifys given touch pane buttons. Dimms unsupported buttons from the
+     * pane.
+     *
+     * @param aCallArray - Array holding information of all ongoing calls.
+     * @param aTouchPane - A touch pane interface.
+     */
+    virtual void ModifyExtensionsTouchPaneButtonsL( 
+                    const RArray<CTelMenuExtension::TCallInfo>& aCallArray,
+                    MTelTouchPaneExtension& aTouchPane ) = 0;
+
+    /**
+     * Handles custom menu commands.
+     *
+     * @param aCommand It is the code of the command to be handled.
+     * @return boolean value was the command handled (ETrue) or not (EFalse).
+     */
+    virtual TBool HandleCommandL( TInt aCommand ) = 0;
+
+
+private: // data
+
+    /**
+     * ECOM plugin instance UID.
+     */
+    TUid iDtor_ID_Key;
+    };
+
+#include "telmenuextension.inl"
+
+
+#endif // TELMENUEXTENSION_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_menu_extension_api/inc/telmenuextension.inl	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inline functions for CTelMenuExtension.
+*
+*/
+
+#include <ecom/ecom.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelMenuExtension::~CTelMenuExtension()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+// -----------------------------------------------------------------------------
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+inline CTelMenuExtension* CTelMenuExtension::NewL( 
+    TUid aImplementationUid ) 
+    {
+    TAny* ptr( NULL );
+    TInt32 keyOffset = _FOFF( CTelMenuExtension, iDtor_ID_Key );
+    ptr = REComSession::CreateImplementationL(
+        aImplementationUid,
+        keyOffset );
+    
+    CTelMenuExtension* plugin = 
+        reinterpret_cast <CTelMenuExtension*> (ptr);
+    return plugin;
+    }    
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_menu_extension_api/inc/teltouchpaneextension.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Defines interface for manipulating telephony touch pane 
+*                buttons using ECOM plugin.
+*
+*/
+
+
+#ifndef TELTOUCHPANEEXTENSION_H
+#define TELTOUCHPANEEXTENSION_H
+
+// INCLUDES
+#include <e32base.h>
+
+
+/**
+ * Plugin interface class for manipulating telephony
+ * touch pane items.
+ *
+ * @since S60 5.1
+ */
+class MTelTouchPaneExtension
+    {
+
+public:
+
+    /**
+     * Returns number of buttons in touch pane.
+     *
+     * @since S60 v5.1
+     * @return Button count.
+     */
+    virtual TInt NumberOfButtonsInPane()  const = 0;
+
+    /**
+     * Returns command id assinged to button in given position.
+     * If button is toggling, currently active command is 
+     * returned.
+     *
+     * @since S60 v5.1
+     * @param aButtonIndex Button index starting 0.
+     * @return Command id assigned to given position.
+     */
+    virtual TInt ButtonCommandId( TInt aButtonIndex )  const = 0;
+
+    /**
+     * Sets button dimmed.
+     *
+     * @since S60 v5.1
+     * @param aCommand Command id.
+     * @param aDimmed  ETrue to set dimmed, EFalse to undim.
+     */
+    virtual void SetButtonDimmed( TInt aCommand, TBool aDimmed ) = 0;
+
+    };
+
+
+#endif // TELTOUCHPANEEXTENSION_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_menu_extension_api/inc/xqteluicommandextension.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,133 @@
+/*!
+* 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: Defines interface for manipulating telephony call menus.
+*
+*/
+
+#ifndef XQTELUICOMMANDEXTENSION_H
+#define XQTELUICOMMANDEXTENSION_H
+
+#include <qobject>
+#include <hbaction.h>
+
+
+#ifdef BUILD_DLL
+#define DLL_EXPORT Q_DECL_EXPORT
+#else
+#define DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+/*!
+    XQTelUiCommandExtension
+    Defines interface for manipulating telephony call menus.
+    
+*/
+class DLL_EXPORT XQTelUiCommandExtension 
+{
+    
+public:
+        
+    /*!
+       Specifies call states.
+    */
+    enum CallState
+        {
+        None = 0,
+        Disconnecting = 1, // Call is disconnecting
+        Active = 2, // Call is active
+        OnHold = 3, // Call is on hold
+        Incoming = 4, // Call is ringing
+        Outgoing = 5 // Call is dialling or connecting
+        };
+        
+    /*!
+       Capsulates call info.
+    */
+    class CallInfo
+        {
+    public:
+        
+        // Service provider settings item Id
+        int mServiceId;
+        
+        // Calls state
+        int mCallState;
+        
+        // Is call header expanded
+        bool mIsExpanded;
+
+        };
+    
+    /*!
+        \fn void modifyMenuItemList(QList<int> &menuCmdList)
+        
+        Modifies menu command list. CallInfo contains current call information and 
+        menuCmdList contains current list of menu commands. 
+        Interface can add new commands which should be hanled by telephony
+        call handling or remove commands if list contains unsupported call
+        commands.
+    */
+    virtual void modifyMenuCommandList(const QList<CallInfo> &callInfo,
+                                       QList<int> &menuCmdList) = 0;
+                                       
+    /*!
+        \fn void modifyButtonCommandList(QList<int> &menuCmdList)
+        
+        Modifies push button command list. CallInfo contains current call 
+        information and buttonCmdList contains current list of push 
+        button commands. 
+        Interface can remove commands if list contains unsupported call
+        commands (For example if service doesn't support conference call)
+        or add commads which should be handled by telephony call 
+        handling (maximum amount of push button commands is 2 and list
+        index 0 is used for right button).
+    */
+    virtual void modifyPushButtonCommandList(const QList<CallInfo> &callInfo,
+                                             QList<int> &buttonCmdList) = 0;
+    
+    /*!
+        \fn void addMenuActions(QList<HbAction*> &menuActions)
+        
+        Adds custom actions to the call menu. CallInfo contains current call 
+        information. Interface could add own actions to the menu actions 
+        list and actions will be added to the call menu. 
+        Interface is the responsible for handling action triggers.
+        Ownership of the actions in not transferred.
+    */
+    virtual void addMenuActions(const QList<CallInfo> &callInfo,
+                                QList<HbAction*> &menuActions) = 0;
+    
+    /*!
+        \fn void releaseMenu()
+        
+        Releases menu actions. Method is called when menu is not needed
+        anymore and interface can release own menu actions.
+    */
+    virtual void releaseMenu() = 0;
+    
+    /*!
+        \fn void release()
+        
+        Releases plugin. Method is called when menu extension plugin is 
+        not needed anymore and interface can release all resources and
+        plugin itself.
+    */
+    virtual void release() = 0;
+    
+};
+
+Q_DECLARE_INTERFACE(XQTelUiCommandExtension, "com.nokia.telephony.XQTelUiCommandExtension/1.0" );
+
+#endif // XQTELUICOMMANDEXTENSION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_microphone_mute_status_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Microphone Mute Status API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telmicmutestatuspskeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telmicmutestatuspskeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_microphone_mute_status_api/inc/telmicmutestatuspskeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony Microphone Mute Status Publish and Subscribe keys.
+*
+*/
+
+
+#ifndef TELMICMUTESTATUSPSKEYS_H
+#define TELMICMUTESTATUSPSKEYS_H
+
+#include <e32std.h>
+
+// CONSTANTS
+
+/*****************************************************************************
+* Telephony Microphone Mute Status API
+*****************************************************************************/
+const TUid KPSUidTelMicrophoneMuteStatus = {0x102029A9}; 
+    
+/**
+* Microphone mute state.
+* VoIP is notified through P&S.
+* @type RProperty::EInt
+*/
+const TUint32 KTelMicrophoneMuteState = 0x00000001;
+enum TPSTelMicMuteState
+    {
+    EPSTelMicMuteStateUninitialized = 0,
+    EPSTelMicMuteOn,
+    EPSTelMicMuteOff
+    };
+
+#endif      // TELMICMUTESTATUSPSKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_microphone_mute_status_api/telephony_microphone_mute_status_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="8f48e3b9bc442f8a0b335f0852ff7b5c" dataversion="1.0">
+  <name>Telephony Microphone Mute Status API</name>
+  <description>Provides microphone mute status info via PubSub</description>
+  <type>c++</type>
+  <subsystem>phoneengine</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_remote_party_information_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Remote Party Information API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telremotepartyinformationpskeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telremotepartyinformationpskeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_remote_party_information_api/inc/telremotepartyinformationpskeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony remote party information publish and subscribe keys.
+*
+*/
+
+
+#ifndef TELREMOTEPARTYINFOPSKEYS_H
+#define TELREMOTEPARTYINFOPSKEYS_H
+
+#include <e32std.h>
+
+// CONSTANTS
+
+/*****************************************************************************
+* Telephony Remote Party Information API.
+*****************************************************************************/
+const TUid KPSUidTelRemotePartyInformation = {0x102029A8}; 
+
+/**
+* Telephony updates the key on in-call state.
+* Contains remote party name (from contacts).
+* @type RProperty::EText
+*/
+
+const TUint32 KTelCLIName = 0x00000001; 
+
+/**
+* Telephony updates the key on in-call state.
+* Contains remote party telephone number 
+* @type RProperty::EText
+*/
+const TUint32 KTelCLINumber = 0x00000002; 
+
+#endif      // TELREMOTEPARTYINFOPSKEYS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_remote_party_information_api/telephony_remote_party_information_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="1b3498e8208b93cf531c53247a2f9060" dataversion="1.0">
+  <name>Telephony Remote Party Information API</name>
+  <description>Provides information of remote party in call (name and number)</description>
+  <type>c++</type>
+  <subsystem>phoneengine</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_video_mailbox_settings_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Telephony Video Mailbox Settings API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/telvmbxsettingscrkeys.h     APP_LAYER_PLATFORM_EXPORT_PATH(telvmbxsettingscrkeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_video_mailbox_settings_api/inc/telvmbxsettingscrkeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony video mailbox settings central repository keys
+*
+*/
+
+
+#ifndef TELVMBXSETTINGSCRKEYS_H
+#define TELVMBXSETTINGSCRKEYS_H
+
+#include <e32std.h>
+
+/******************************************************************************
+* Telephony Video Mailbox Settings API
+* This API provides information related to Video MailBox Settings.
+******************************************************************************/
+const TUid KCRUidTelVideoMailbox = {0x102830B6}; 
+
+/**
+* Video mailbox accessed via keypad '1' or '2';
+* Possible values: 1 (= keypad '1'), 2 (= keypad '2') 
+* Default value is 1.
+*/
+const TUint32 KTelVideoMbxKey                               = 0x00000001;
+
+
+#endif      // TELVMBXSETTINGSCRKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/telephony_video_mailbox_settings_api/telephony_video_mailbox_settings_api.metaxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<api id="c739dd698f488482cd00d1b290e9a2e4" dataversion="1.0">
+  <name>Telephony Video Mailbox Settings API</name>
+  <description>Video mailbox settings handling</description>
+  <type>c++</type>
+  <subsystem>phoneapp</subsystem>
+  <libs>
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/tsrc/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Master bld.inf for API testing
+*
+*/
+
+
+PRJ_TESTMMPFILES
+
+ // End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/video_telephony_control_mediator_api/group/bld.inf	Fri Jun 04 10:19:18 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:  File that exports the files belonging to 
+:                Video Telephony Control Mediator API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/videotelcontrolmediatorapi.h     APP_LAYER_PLATFORM_EXPORT_PATH( videotelcontrolmediatorapi.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/video_telephony_control_mediator_api/inc/videotelcontrolmediatorapi.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Video Telephony specific message services sent from Phone
+*                Application to Video Telephony.
+*
+*/
+
+
+#ifndef VIDEOTELCONTROLMEDIATORAPI_H
+#define VIDEOTELCONTROLMEDIATORAPI_H
+
+// INCLUDES
+#include <e32base.h>
+
+/**  The category UID for the messages in this header file. */
+const TUid KCatPhoneToVideotelCommands = { 0x200159A1 };
+
+/**  Version number of this API */
+const TInt KPhoneToVideotelCmdVersionMajor( 1 );
+const TInt KPhoneToVideotelCmdVersionMinor( 0 );
+const TInt KPhoneToVideotelCmdVersionBuild( 0 );
+
+/** package for passing dataport name to Video Telephony */
+typedef TPckgBuf<TName> TDataPortPackage;
+
+/**  Video Telephony related commands. */
+enum TPhoneToVideotelCommands
+    {
+    /**
+     * Commands Video Telephony to enable microphone.
+     */
+    EVtCmdUnmute = 0,
+    
+    /**
+     * Commands Video Telephony to disable microphone.
+     */
+    EVtCmdMute,
+        
+    /**
+     * Commands Video Telephony to use dataport. Command paramemeter is
+     * TDataPortPackage. This should be called when dataport is loaned.
+     * When this is sent, dataport recovery is allowed only after
+     * 1) later issued EVtCmdShutdown response is received.
+     * 2) call is ended by network/peer (i.e. local phone doesn't do hangup)
+     * 3) EPhoneCmdEndActiveCall command is received (see Mediator Commands To 
+     *    Telephony API)
+     *  Otherwise H.245 (VT) signalling may fail if call is released in two
+     *  stage.
+     */
+    EVtCmdUseDataport,
+    
+    EVtCmdReleaseDataport
+    };
+
+#endif // VIDEOTELCONTROLMEDIATORAPI_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/video_telephony_mediator_api/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  File that exports the files belonging to 
+:                Video Telephony Mediator API
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/videoteltophonecommandsapi.h     APP_LAYER_PLATFORM_EXPORT_PATH(videoteltophonecommandsapi.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phone_plat/video_telephony_mediator_api/inc/videoteltophonecommandsapi.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Video Telephony specific message services sent from Video
+*                Telephony to Phone Application.
+*
+*/
+
+
+#ifndef VIDEOTELTOPHONECOMMANDSAPI_H
+#define VIDEOTELTOPHONECOMMANDSAPI_H
+
+// INCLUDES
+#include <e32base.h>
+
+/**  The category UID for the messages in this header file. */
+const TUid KCatVideoTelToPhoneCommands = { 0x100058B6 };
+
+/**  Version number of this API */
+const TInt KVideoTelToPhoneCmdVersionMajor( 1 );
+const TInt KVideoTelToPhoneCmdVersionMinor( 0 );
+const TInt KVideoTelToPhoneCmdVersionBuild( 0 );
+
+/**  Video Telephony related commands to Phone Application. */
+enum TVideoTelToPhoneCommands
+    {
+    /**
+     * Commands Phone to do fallback.
+     * @capability ECapabilityNetworkControl
+     */
+    EVtCmdFallback = 0,
+    
+    /**
+     * Commands Phone to switch back to voice call.
+     * @capability ECapabilityNetworkControl
+     */
+    EVtCmdSwitchToVoice,
+    
+    /**
+     * Commands phone that VT has not enough memory.
+     * @capability ECapabilityNetworkControl
+     */
+    EVtCmdLowMemory
+
+    };
+
+#endif // VIDEOTELTOPHONECOMMANDSAPI_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Blacklist build definition.
+*
+*/
+
+
+#include  <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/phoneanimdllstd.h         |../../../inc/phoneanimdllstd.h
+../group/phoneanimdll_stub.sis    /epoc32/data/z/system/install/phoneanimdll_stub.sis
+
+// IBY files
+../rom/phoneanimdll.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(phoneanimdll.iby)
+
+PRJ_MMPFILES
+../group/phoneanimdll.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/group/phoneanimdll.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is project specification for blacklist window server plug-
+*                in. The plug-in provides service for phone application to clear
+*                blacklist upon next keypress.
+*
+*/
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+
+TARGET          phoneanimdll.dll
+TARGETTYPE      ANI
+UID             0x10003B22 0x100059FE
+
+SOURCEPATH      ../src
+
+USERINCLUDE     ../inc
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCE          cphoneanimdll.cpp
+SOURCE          cphoneblacklistanim.cpp
+
+LIBRARY         euser.lib 
+LIBRARY         etel.lib 
+LIBRARY         etelmm.lib 
+LIBRARY         customapi.lib
+
+
+// End of File
Binary file phoneapp/Blacklist/group/phoneanimdll_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/group/phoneanimdll_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phoneanimdll stub.
+;
+; phoneanimdll_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"phoneanimdll"},(0x100059FE),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\phoneanimdll.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/inc/CPhoneAnimDll.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  It defines factory class for blacklist clearing plug-in.
+*
+*/
+
+
+
+#ifndef CPHONEANIMDLL_H
+#define CPHONEANIMDLL_H
+
+//  INCLUDES
+#include    <e32std.h>             
+#include    <w32adll.h>            
+
+// CLASS DECLARATION
+
+/** 
+* Animation plug-in.
+*
+* @since 2.0 
+*/
+class CPhoneAnimDll 
+    : public CAnimDll
+    {
+    public: // From base classes
+        
+        /** 
+        * From CAnimDll, creates an instance of requested plugin.
+        *
+        * @return instance of animation service.
+        */
+        virtual CAnim* CreateInstanceL( TInt aType );
+
+    };
+
+/** 
+* Creates an instance of CPhoneAnimDll. 
+* Factory function. 
+*
+* @since 1.0
+* @return instance of anim dll.
+*/
+IMPORT_C CAnimDll* CreateCAnimDllL();
+
+#endif // CPHONEANIMDLL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/inc/CPhoneBlacklistAnim.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  It defines window animation service, which provides service
+*                to clear blacklist upon next key event.
+*
+*/
+
+
+
+#ifndef CPHONEBLACKLISTANIM_H
+#define CPHONEBLACKLISTANIM_H
+
+// INCLUDES
+#include    <w32adll.h>        
+#include    <etel.h>           
+#include    <etelmm.h>         
+#include    <rmmcustomapi.h>   
+
+// CLASS DECLARATION
+
+/**
+* It is blacklist window animation class.
+*
+* @since 2.0 
+*/
+class CPhoneBlacklistAnim 
+    : public CWindowAnim
+    {
+    public: // Constructors and destructors
+        
+        /** 
+        * Constructor. 
+        */
+        CPhoneBlacklistAnim();
+        
+        /** 
+        * Destructor.
+        */
+        ~CPhoneBlacklistAnim();
+        
+    public: // From base classes
+
+        /** 
+        * From CWindowAnim, handles commands.
+        * @param aOpcode command.
+        * @param aArgs parameters.
+        * @return error code.
+        */
+        virtual TInt CommandReplyL( 
+            TInt aOpcode, 
+            TAny* aArgs );
+        
+        /** 
+        * From CWindowAnim, handles commands. 
+        * @param aOpcode command.
+        * @param aArgs parameters.
+        */
+        virtual void Command(
+            TInt aOpcode, 
+            TAny* aArgs );
+        
+        /** 
+        * From CWindowAnim, animate.
+        * @param aDateTime NULL or current time.
+        */
+        virtual void Animate(
+            TDateTime* aDateTime );
+        
+        /** 
+        * From CWindowAnim, second phase constructor.
+        * @param aArgs parameters.
+        * @param aHasFocus focus information.
+        */
+        virtual void ConstructL(
+            TAny* aArgs, 
+            TBool aHasFocus );
+
+        /** 
+        * From CWindowAnim, handles redraw request.  
+        */
+        virtual void Redraw();
+
+        /** 
+        * From CWindowAnim, handles focus changes.
+        *
+        * @param new focus state.
+        */
+        virtual void FocusChanged(
+            TBool aState );
+        
+        /** 
+        * From CWindowAnim, handles keyevents. 
+        *
+        * @param aRawEvent event.
+        * @return ETrue if event is consumed.
+        */
+        virtual TBool OfferRawEvent(
+            const TRawEvent& aRawEvent );
+        
+    private:
+        
+        // inner class to clear blacklist.
+        class CClearBlacklist;
+
+        // ETel session.
+        /*****************************************************
+        *    Series 60 Customer / ETel
+        *    Series 60  ETel API
+        *****************************************************/
+        RTelServer iServer;
+        
+        // Mobile phone session.
+        /*****************************************************
+        *    Series 60 Customer / ETel
+        *    Series 60  ETel API
+        *****************************************************/
+        RMobilePhone iPhone;
+
+        // Custom API session.
+        /*****************************************************
+        *    Series 60 Customer / ETel
+        *    Series 60  ETel API
+        *****************************************************/
+        RMmCustomAPI iCustom;
+
+        // If set true then next key event should cause black
+        // list to be cleared.
+        TBool iClearBlacklistOnNextEvent;
+
+        // Owned blacklist clearer.
+        CClearBlacklist* iActive;
+
+    };
+
+#endif // CPHONEBLACKLISTANIM_H
+
+// End Of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/inc/phoneanimdllstd.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  It defines constants shared between this subsystem and 
+*                clients of the subsystem.
+*
+*/
+
+
+
+#ifndef PHONEANIMDLLSTD_H
+#define PHONEANIMDLLSTD_H
+
+// DATA TYPES
+
+/** 
+* Animation services. 
+*
+* EAnimClearBlackList - blacklist clearing.
+*/
+enum TPhoneAnimType
+    {
+    EAnimClearBlackList
+    };
+
+/** 
+* Operations for blacklist clearing.
+*
+* ECancelBlackList - clear blacklist upon next keypress.
+*/
+enum TPhoneAnimOpcode
+    {
+    ECancelBlackList,
+    EClearBlackListNow
+    };
+
+#endif // PHONEANIMDLLSTD_H
+
+// End Of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/rom/PhoneAnimDll.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: IBY file for phoneanimdll component.
+*
+*/
+
+
+#ifndef __PHONEANIMDLL_IBY__
+#define __PHONEANIMDLL_IBY__
+
+file=ABI_DIR\BUILD_DIR\phoneanimdll.dll         SHARED_LIB_DIR\phoneanimdll.dll
+
+data=ZSYSTEM\install\phoneanimdll_stub.sis       System\Install\phoneanimdll_stub.sis
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/src/CPhoneAnimDll.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  It provides implementation for the CPhoneAnimDll class. Only
+*                one animation service is provided, CPhoneBlacklistAnim, to
+*                clear blacklist upon next keypress.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "phoneanimdllstd.h"         
+#include    "cphoneanimdll.h"
+#include    "cphoneblacklistanim.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneAnimDll::CreateInstanceL
+// 
+// Create blacklist clearing plug-in. Only one type provided.
+// ---------------------------------------------------------
+//
+CAnim* CPhoneAnimDll::CreateInstanceL( TInt aType )
+    {
+    switch ( aType )
+        {
+        case EAnimClearBlackList:
+            return new ( ELeave ) CPhoneBlacklistAnim();
+        default:
+            return NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CAnimDll::CreateCAnimDllL
+// 
+// Create plug-in. Factory function.
+// ---------------------------------------------------------
+//
+EXPORT_C CAnimDll* CreateCAnimDllL()
+    {
+    return new ( ELeave ) CPhoneAnimDll();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/Blacklist/src/CPhoneBlacklistAnim.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2002-2004,2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  It provides implementation for the CPhoneBlacklistAnim class. 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32base.h>                     
+#include    <mmtsy_names.h>                 
+#include    "phoneanimdllstd.h"             
+#include    "cphoneblacklistanim.h"
+
+// CONSTANTS
+// Amount of retries to be performed.
+const TInt KPhoneRetryCount = 7;
+
+// Timeout in microseconds
+const TInt KPhoneRetryTimeout = 100000; 
+
+// MODULE DATA STRUCTURES
+/**
+* Active object for clearing nlacklist.
+*
+* @since 2.0
+*/
+class CPhoneBlacklistAnim::CClearBlacklist
+    : public CActive
+    {
+    public: // Constructors and destructors.
+        
+        /**
+        * Constructor.
+        */
+        /*****************************************************
+        *    Series 60 Customer / ETel
+        *    Series 60  ETel API
+        *****************************************************/
+        CClearBlacklist( RMmCustomAPI& aCustom );
+
+        /**
+        * Destructor.
+        */
+        ~CClearBlacklist();
+
+    public: // New functions
+
+        /**
+        * Clear blacklist.
+        */
+        void Clear();
+
+    protected:
+
+        /**
+        * From CActive, handles completion of request.
+        */
+        void RunL();
+
+        /**
+        * From CActive, cancels pending request.
+        */
+        void DoCancel();
+
+    private:
+
+        // Ref to custom API.
+        /*****************************************************
+        *    Series 60 Customer / ETel
+        *    Series 60  ETel API
+        *****************************************************/
+        RMmCustomAPI& iCustom;
+
+    };
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::CPhoneBlacklistAnim
+// ---------------------------------------------------------
+//
+CPhoneBlacklistAnim::CPhoneBlacklistAnim()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::~CPhoneBlacklistAnim
+// ---------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / ETel
+*    Series 60  ETel API
+*****************************************************/
+CPhoneBlacklistAnim::~CPhoneBlacklistAnim()
+    {
+    if ( iFunctions )
+        {
+        iFunctions->GetRawEvents( EFalse );
+        }
+
+    delete iActive;
+
+    iCustom.Close();
+    iPhone.Close();
+    iServer.Close();
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::CommandReplyL
+// 
+// Reply to command. Always returns KErrNone.
+// Defined as pure virtual in baseclass, not actually needed
+// here.
+// ---------------------------------------------------------
+//
+TInt CPhoneBlacklistAnim::CommandReplyL( TInt /*aOpcode*/, TAny* /*aArgs*/ )
+    {
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::Command
+// 
+// Command handling, only one command supported.
+// ---------------------------------------------------------
+//
+void CPhoneBlacklistAnim::Command( TInt aOpcode, TAny* /*aArgs*/ )
+    {
+    switch ( aOpcode )
+        {
+    case ECancelBlackList:
+        iClearBlacklistOnNextEvent = ETrue;
+        break;
+    case EClearBlackListNow:
+        iActive->Clear();
+        break;
+    default:
+        break;
+        }
+    };
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::Animate
+// 
+// Defined as pure virtual in base class, so empty 
+// implementation.
+// ---------------------------------------------------------
+//
+void CPhoneBlacklistAnim::Animate( TDateTime* /*aDateTime*/ )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::ConstructL
+// 
+// Construction.
+// Activates also request to get all key events.
+// ---------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / ETel
+*    Series 60  ETel API
+*****************************************************/
+/*****************************************************
+*    Series 60 Customer / TSY
+*    Needs customer TSY implementation
+*****************************************************/
+void CPhoneBlacklistAnim::ConstructL( TAny* /*aArgs*/, TBool /*aHasFocus*/ )
+    {
+    // Connect to ETel.
+    TInt err = KErrNone; 
+        {
+        for ( TInt a = 0 ; a < KPhoneRetryCount ; a++ )
+            {
+            err = iServer.Connect();
+            
+            if ( err == KErrNone )
+                {
+                break;
+                }
+
+            User::After( KPhoneRetryTimeout );
+            }
+        
+        User::LeaveIfError( err );
+        }
+
+    // Load TSY module.
+    err = iServer.LoadPhoneModule( KMmTsyModuleName );
+    if ( err != KErrAlreadyExists )
+        {
+        // LoadPhoneModule may return also KErrAlreadyExists 
+        // if some other is already loaded the tsy module. 
+        // And that is not an error.
+        User::LeaveIfError( err );
+        }
+
+    // Open phone and custom API.
+    User::LeaveIfError( iPhone.Open( iServer, KMmTsyPhoneName ) );
+    User::LeaveIfError( iCustom.Open( iPhone ) );
+
+    iActive = new ( ELeave ) CClearBlacklist( iCustom );
+
+    iFunctions->GetRawEvents( ETrue );
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::Redraw
+// 
+// Not needed. No UI.
+// Defined as pure virtual in baseclass, not actually needed
+// here.
+// ---------------------------------------------------------
+//
+void CPhoneBlacklistAnim::Redraw()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::FocusChanged
+// 
+// Not needed. No UI.
+// Defined as pure virtual in baseclass, not actually needed
+// here.
+// ---------------------------------------------------------
+//
+void CPhoneBlacklistAnim::FocusChanged( TBool /*aState*/ )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::OfferRawEvent
+// 
+// Handle key event.
+// ---------------------------------------------------------
+//
+TBool CPhoneBlacklistAnim::OfferRawEvent( const TRawEvent& aRawEvent )
+    {
+    if ( aRawEvent.Type() == TRawEvent::EKeyDown || 
+         aRawEvent.Type() == TRawEvent::EButton1Down )
+        {
+        if ( iClearBlacklistOnNextEvent )
+            {
+            iClearBlacklistOnNextEvent = EFalse;
+            iActive->Clear();
+            }
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::CClearBlacklist::CClearBlacklist
+// ---------------------------------------------------------
+//
+CPhoneBlacklistAnim::CClearBlacklist::CClearBlacklist( 
+        RMmCustomAPI& aCustom )
+    : CActive( CActive::EPriorityStandard ),
+      iCustom( aCustom )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::CClearBlacklist::~CClearBlacklist
+// ---------------------------------------------------------
+//
+CPhoneBlacklistAnim::CClearBlacklist::~CClearBlacklist()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::CClearBlacklist::Clear
+// 
+// Clear blacklist asynchronously. 
+// ---------------------------------------------------------
+// 
+/*****************************************************
+*    Series 60 Customer / ETel
+*    Series 60  ETel API
+*****************************************************/
+void CPhoneBlacklistAnim::CClearBlacklist::Clear()
+    {
+    Cancel();
+
+    iCustom.ClearCallBlackList( iStatus );
+    SetActive();
+    }    
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::CClearBlacklist::RunL
+// 
+// This is called when blacklist clearing completes. 
+// Empty implementation, as nothing needs to be done.
+// ---------------------------------------------------------
+// 
+void CPhoneBlacklistAnim::CClearBlacklist::RunL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneBlacklistAnim::CClearBlacklist::DoCancel
+// 
+// Cancels pending request.
+// ---------------------------------------------------------
+// 
+/*****************************************************
+*    Series 60 Customer / ETel
+*    Series 60  ETel API
+*****************************************************/
+void CPhoneBlacklistAnim::CClearBlacklist::DoCancel()
+    {
+    iCustom.CancelAsyncRequest( 
+        ECustomClearCallBlackListIPC );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony / phoneapp
+*
+*/
+
+
+#include "../blacklist/group/bld.inf"
+#include "../phoneuicontrol/group/bld.inf"
+#include "../phoneuistates/group/bld.inf"
+#include "../phoneuiutils/group/bld.inf"
+#include "../silenceactionplugin/group/bld.inf"
+#include "../phonemediatorcenter/group/bld.inf"
+#include "../phoneringingtoneplayer/group/bld.inf"
+#include "../phoneuivoipextension/group/bld.inf"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/bwins/phonemediatorcenteru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+EXPORTS
+	?CommandListener@CPhoneMediatorFactory@@QAEPAVCPhoneMediatorCommandListener@@PAVMPhoneMenuAndCbaEvents@@PAVMPhoneEngineMessageSender@@PAVMPEEngineInfo@@@Z @ 1 NONAME ; class CPhoneMediatorCommandListener * CPhoneMediatorFactory::CommandListener(class MPhoneMenuAndCbaEvents *, class MPhoneEngineMessageSender *, class MPEEngineInfo *)
+	?Instance@CPhoneMediatorFactory@@SAPAV1@XZ @ 2 NONAME ; class CPhoneMediatorFactory * CPhoneMediatorFactory::Instance(void)
+	?Instance@CPhoneMediatorSender@@SAPAV1@XZ @ 3 NONAME ; class CPhoneMediatorSender * CPhoneMediatorSender::Instance(void)
+	?IssueCommand@CPhoneMediatorSender@@QAEHVTUid@@0HVTVersion@@ABVTDesC8@@PAVMPhoneShutdownCommand@@@Z @ 4 NONAME ; int CPhoneMediatorSender::IssueCommand(class TUid, class TUid, int, class TVersion, class TDesC8 const &, class MPhoneShutdownCommand *)
+	?MediatorMessage@CPhoneMediatorFactory@@QAEPAVMPhoneMediatorMessage@@HH@Z @ 5 NONAME ; class MPhoneMediatorMessage * CPhoneMediatorFactory::MediatorMessage(int, int)
+	?NewL@CPhoneReleaseCommand@@SAPAV1@AAVMPhoneEngineMessageSender@@@Z @ 6 NONAME ; class CPhoneReleaseCommand * CPhoneReleaseCommand::NewL(class MPhoneEngineMessageSender &)
+	?NewL@CPhoneSwitchToVideoOrVoiceCommand@@SAPAV1@AAVMPhoneEngineMessageSender@@@Z @ 7 NONAME ; class CPhoneSwitchToVideoOrVoiceCommand * CPhoneSwitchToVideoOrVoiceCommand::NewL(class MPhoneEngineMessageSender &)
+	?NewL@CPhoneTerminateAllConnectionsCommand@@SAPAV1@AAVMPhoneEngineMessageSender@@@Z @ 8 NONAME ; class CPhoneTerminateAllConnectionsCommand * CPhoneTerminateAllConnectionsCommand::NewL(class MPhoneEngineMessageSender &)
+	?SendEvent@CPhoneMediatorSender@@QAEXHAAVTPhoneCommandParam@@@Z @ 9 NONAME ; void CPhoneMediatorSender::SendEvent(int, class TPhoneCommandParam &)
+	?SendEvent@CPhoneMediatorSender@@QBEXHH@Z @ 10 NONAME ; void CPhoneMediatorSender::SendEvent(int, int) const
+	?SendEvent@CPhoneMediatorSender@@QBEXHHAAVTPhoneCommandParam@@@Z @ 11 NONAME ; void CPhoneMediatorSender::SendEvent(int, int, class TPhoneCommandParam &) const
+	?Sender@CPhoneMediatorFactory@@QAEPAVCPhoneMediatorSender@@XZ @ 12 NONAME ; class CPhoneMediatorSender * CPhoneMediatorFactory::Sender(void)
+	?SendEvent@CPhoneMediatorSender@@QBEXH@Z @ 13 NONAME ; void CPhoneMediatorSender::SendEvent(int) const
+	?SendEvent@CPhoneMediatorSender@@QBEXHHPBVTDesC16@@@Z @ 14 NONAME ; void CPhoneMediatorSender::SendEvent(int, int, class TDesC16 const *) const
+	?NewL@CPhoneContinueEmergencyCallCommand@@SAPAV1@AAVMPhoneEngineMessageSender@@@Z @ 15 NONAME ; class CPhoneContinueEmergencyCallCommand * CPhoneContinueEmergencyCallCommand::NewL(class MPhoneEngineMessageSender &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/eabi/phonemediatorcenteru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,35 @@
+EXPORTS
+	_ZN20CPhoneMediatorSender12IssueCommandE4TUidS0_i8TVersionRK6TDesC8P21MPhoneShutdownCommand @ 1 NONAME
+	_ZN20CPhoneMediatorSender8InstanceEv @ 2 NONAME
+	_ZN20CPhoneMediatorSender9SendEventEiR18TPhoneCommandParam @ 3 NONAME
+	_ZN20CPhoneReleaseCommand4NewLER25MPhoneEngineMessageSender @ 4 NONAME
+	_ZN21CPhoneMediatorFactory15CommandListenerEP22MPhoneMenuAndCbaEventsP25MPhoneEngineMessageSenderP13MPEEngineInfo @ 5 NONAME
+	_ZN21CPhoneMediatorFactory15MediatorMessageEii @ 6 NONAME
+	_ZN21CPhoneMediatorFactory6SenderEv @ 7 NONAME
+	_ZN21CPhoneMediatorFactory8InstanceEv @ 8 NONAME
+	_ZN33CPhoneSwitchToVideoOrVoiceCommand4NewLER25MPhoneEngineMessageSender @ 9 NONAME
+	_ZN36CPhoneTerminateAllConnectionsCommand4NewLER25MPhoneEngineMessageSender @ 10 NONAME
+	_ZNK20CPhoneMediatorSender9SendEventEii @ 11 NONAME
+	_ZNK20CPhoneMediatorSender9SendEventEiiR18TPhoneCommandParam @ 12 NONAME
+	_ZTI20CPhoneMediatorSender @ 13 NONAME ; #<TI>#
+	_ZTI20CPhoneReleaseCommand @ 14 NONAME ; #<TI>#
+	_ZTI21CPhoneDataPortMessage @ 15 NONAME ; #<TI>#
+	_ZTI21CPhoneMediatorFactory @ 16 NONAME ; #<TI>#
+	_ZTI28CPhoneMediatorMessageFactory @ 17 NONAME ; #<TI>#
+	_ZTI29CPhoneMediatorCommandListener @ 18 NONAME ; #<TI>#
+	_ZTI33CPhoneSwitchToVideoOrVoiceCommand @ 19 NONAME ; #<TI>#
+	_ZTI36CPhoneTerminateAllConnectionsCommand @ 20 NONAME ; #<TI>#
+	_ZTV20CPhoneMediatorSender @ 21 NONAME ; #<VT>#
+	_ZTV20CPhoneReleaseCommand @ 22 NONAME ; #<VT>#
+	_ZTV21CPhoneDataPortMessage @ 23 NONAME ; #<VT>#
+	_ZTV21CPhoneMediatorFactory @ 24 NONAME ; #<VT>#
+	_ZTV28CPhoneMediatorMessageFactory @ 25 NONAME ; #<VT>#
+	_ZTV29CPhoneMediatorCommandListener @ 26 NONAME ; #<VT>#
+	_ZTV33CPhoneSwitchToVideoOrVoiceCommand @ 27 NONAME ; #<VT>#
+	_ZTV36CPhoneTerminateAllConnectionsCommand @ 28 NONAME ; #<VT>#
+	_ZNK20CPhoneMediatorSender9SendEventEi @ 29 NONAME
+	_ZNK20CPhoneMediatorSender9SendEventEiiPK7TDesC16 @ 30 NONAME
+	_ZN34CPhoneContinueEmergencyCallCommand4NewLER25MPhoneEngineMessageSender @ 31 NONAME
+	_ZTI34CPhoneContinueEmergencyCallCommand @ 32 NONAME ; #<TI>#
+	_ZTV34CPhoneContinueEmergencyCallCommand @ 33 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneMediatorConter bld files
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_EXPORTS
+../group/phonemediatorcenter_stub.sis          /epoc32/data/z/system/install/phonemediatorcenter_stub.sis
+
+PRJ_MMPFILES
+phonemediatorcenter.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/group/phonemediatorcenter.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   This mmp file defines the PhoneMediatorCenter DLL module, which
+*   handles all interaction with Mediator.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Capability assignment.
+// <-- QT PHONE START --> 
+CAPABILITY CAP_GENERAL_DLL
+//CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+// <-- QT PHONE END --> 
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          phonemediatorcenter.dll
+TARGETTYPE      dll
+
+UID             0x1000008d  0x20011381
+
+SOURCEPATH      ../src
+SOURCE          cphonedataportmessage.cpp
+SOURCE          cphonemediatorfactory.cpp
+SOURCE          cphonemediatorcommandlistener.cpp
+SOURCE          cphonemediatormessagefactory.cpp
+SOURCE          cphonemediatorsender.cpp
+SOURCE          cphonereleasecommand.cpp
+SOURCE          cphoneswitchtovideoorvoicecommand.cpp
+SOURCE          cphoneterminateallconnectionscommand.cpp
+SOURCE          cphonecontinueemergencycallcommand.cpp
+
+/* Languages */
+LANG SC
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../phoneuicontrol/inc
+// <-- QT PHONE START --> 
+USERINCLUDE     ../../phoneuiqtviewadapter/inc
+//USERINCLUDE     ../../phoneuiview/inc
+// <-- QT PHONE END --> 
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui2/srcdata // phoneui.pan
+
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+
+LIBRARY         euser.lib
+LIBRARY         phoneuicontrol.lib
+LIBRARY         phoneuiutils.lib
+// <-- QT PHONE START --> 
+//LIBRARY         phoneuiview.lib
+// <-- QT PHONE END --> 
+
+// CCoeStatic
+LIBRARY         cone.lib
+
+// Mediator
+LIBRARY         mediatorclient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/group/phonemediatorcenter_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phonemediatorcenter stub.
+;
+; Languages
+&EN
+
+; Header
+#{"PhoneMediatorCenter"}, (0x20011381), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+;
+;  PhoneMediatorCenter
+;
+"" - "z:\sys\bin\phonemediatorcenter.dll"
Binary file phoneapp/phonemediatorcenter/group/phonemediatorcenter_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphonecontinueemergencycallcommand.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Command for letting Phone Engine continue Emergency call initialization.
+*     This is needed because VT has to release dataport before we can continue
+*     emergency call. Otherwise VT call after emergency call fails as dataport
+*     isn't released.
+*
+*/
+
+
+#ifndef CPHONECONTINUEEMERGENCYCALLCOMMAND_H
+#define CPHONECONTINUEEMERGENCYCALLCOMMAND_H
+
+// INCLUDES
+#include <e32base.h>
+#include "mphoneshutdowncommand.h"
+#include "mphoneenginemessagesender.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+class CPhoneContinueEmergencyCallCommand : public CBase, 
+    public MPhoneShutdownCommand
+    {
+    public:  
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneContinueEmergencyCallCommand();
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneContinueEmergencyCallCommand* NewL( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+        * Executes this Command.
+        */
+        virtual void ExecuteLD();
+        
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneContinueEmergencyCallCommand( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+        
+        
+    private:
+
+        /**
+        * For sending message to Phone Engine.
+        */    
+        MPhoneEngineMessageSender& iEngineMessageSender;
+                     
+    };
+    
+#endif // CPHONECONTINUEEMERGENCYCALLCOMMAND_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphonedataportmessage.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Mediator Message for notifying of used Data Port.
+*
+*/
+
+
+#ifndef CPHONEDATAPORTMESSAGE_H
+#define CPHONEDATAPORTMESSAGE_H
+
+// INCLUDES
+#include <e32base.h>
+#include "mphonemediatormessage.h"
+#include "mpeengineinfo.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+class CPhoneDataPortMessage : public CBase, public MPhoneMediatorMessage
+    {
+    public:  
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneDataPortMessage();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneDataPortMessage* NewL( MPEEngineInfo& aEngineInfo );
+        
+        /**
+        * Executes this Command.
+        */
+        virtual void ExecuteL();
+        
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneDataPortMessage( MPEEngineInfo& aEngineInfo );
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+        
+             
+    private:
+        
+        MPEEngineInfo& iEngineInfo;
+    };
+    
+#endif // CPHONEDATAPORTMESSAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphonemediatorcommandlistener.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Listens Commands via Mediator component.
+*
+*/
+
+
+#ifndef CPHONEMEDIATORCOMMANDLISTENER_H
+#define CPHONEMEDIATORCOMMANDLISTENER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <coemain.h>
+#include <MediatorCommandResponder.h>
+
+// FORWARD DECLARATIONS
+class MPhoneMenuAndCbaEvents;
+class MPhoneEngineMessageSender;
+class MPEEngineInfo;
+
+// CLASS DECLARATION
+
+class CPhoneMediatorCommandListener : public CCoeStatic, 
+                                      public MMediatorCommandObserver
+    {
+    public:  
+
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * instance.
+        * @param None.
+        * @return Pointer to the one and only instance of Phone Mediator 
+        *         Command Listener -object.
+        */
+        static CPhoneMediatorCommandListener* Instance();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneMediatorCommandListener();
+        
+        /**
+        * Initializes command listener singleton for use. Mandotory to call before first use.
+        * @param aMenuAndCbaEventHandler - Interface to receive converted events.
+        * @param aMessageSender - Interface for sending messages
+        * @param aEngineInfo - Interface for setting Phone Engine specific information
+        */
+        void Initialize( 
+            MPhoneMenuAndCbaEvents* aMenuAndCbaEventHandler,
+            MPhoneEngineMessageSender* aMessageSender,
+            MPEEngineInfo* aEngineInfo );
+        
+        /**
+        * A Mediator Service command.
+        *
+        * @since Series 60 3.1     
+        * @param aDomain    The identifier of the domain         
+        * @param aCategory  The identifier of the category.
+        * @param aCommandId The identifier of the command.
+        * @param aVersion   The version information of the command.
+        * @param aData      The parameters of the command.
+        * @return None.
+        */
+        void MediatorCommandL( TUid aDomain,
+                               TUid aCategory, 
+                               TInt aCommandId,
+                               TVersion aVersion, 
+                               const TDesC8& aData );
+
+        /**
+        * Cancel a Mediator Service command.
+        *
+        * @since Series 60 3.1        
+        * @param aDomain    The identifier of the domain      
+        * @param aCategory  The identifier of the category.
+        * @param aCommandId The identifier of the command.        
+        * @return None.
+        */
+        void CancelMediatorCommand( TUid aDomain,
+                                    TUid aCategory, 
+                                    TInt aCommandId );
+
+
+    private:
+
+        /**    
+         * Protected constructor because of Singleton Pattern
+         */    
+        CPhoneMediatorCommandListener();  
+
+        /**
+        * Instantiates this class and returns a pointer to us
+        */
+        static CPhoneMediatorCommandListener* NewL();
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * Registers all Mediator Commands that this class listens to.
+        */
+        void RegisterMediatorCommandsL();
+        
+        /**
+        * Registers Audio Mediator Commands.
+        */
+        void RegisterAudioMediatorCommands();
+
+        /**
+        * Registers Generic Mediator Commands.
+        */
+        void RegisterGenericMediatorCommands();
+        
+        /**
+        * Registers Video Telephony specific Mediator Commands.
+        */
+        void RegisterVideoTelephonyMediatorCommands();
+        
+        /**
+        * Sends Mediator Response for the received Command.
+        * @param aDomain - The identifier of the domain.
+        * @param aCategory - The identifier of the category.
+        * @param aCommandId - The identifier of the command.
+        */
+        void SendResponse( TUid aDomain, TUid aCategory, TInt aCommandId );
+        
+        /**
+        * Handles Video Telephony specific Mediator Commands.
+        * @param aCommandId - The identifier of the command
+        * @param aVersion - Used interface version
+        */
+        void VideoTelephonyCommandL( TInt aCommandId, TVersion aVersion );
+        
+        /**
+        * Handles Audio specific Mediator Commands.
+        * @param aCommandId - The identifier of the command
+        * @param aVersion - Used interface version
+        */
+        void AudioCommandL( TInt aCommandId, TVersion aVersion );
+
+        /**
+        * Handles generic Mediator Commands.
+        * @param aCommandId - The identifier of the command
+        * @param aVersion - Used interface version
+        */
+        void GenericCommandL( TInt aCommandId, TVersion aVersion );
+                                
+        
+    private:
+    
+        // For mapping commands to CBA and Menu selections
+        MPhoneMenuAndCbaEvents* iMenuAndCbaHandler;
+        
+        // For mapping commands to Phone Engine messages
+        MPhoneEngineMessageSender* iMessageSender;
+
+        // For setting needed Phone Engine information
+        MPEEngineInfo* iEngineInfo;
+        
+        CMediatorCommandResponder* iCommandResponder;
+        MediatorService::RCommandList iVideoTelCommands;
+        MediatorService::RCommandList iAudioCommands;
+        MediatorService::RCommandList iGenericCommands;
+    };
+    
+#endif // CPHONEMEDIATORCOMMANDLISTENER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphonemediatorfactory.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Factory for creating different kind of Mediator related objects.
+*     This factory itself is a Singleton.
+*
+*/
+
+
+#ifndef CPHONEMEDIATORFACTORY_H
+#define CPHONEMEDIATORFACTORY_H
+
+// INCLUDES
+#include <e32base.h>
+#include <coemain.h>
+
+// FORWARD DECLARATIONS
+class CPhoneMediatorSender;
+class CPhoneMediatorCommandListener;
+class MPhoneMenuAndCbaEvents;
+class MPhoneEngineMessageSender;
+class MPEEngineInfo;
+class MPhoneMediatorMessage;
+
+// CLASS DECLARATION
+
+class CPhoneMediatorFactory : public CCoeStatic
+    {
+    public:  
+
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * instance.
+        * @param None.
+        * @return Pointer to the one and only instance of Phone Mediator 
+        *         Sender -object.
+        */
+        IMPORT_C static CPhoneMediatorFactory* Instance();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneMediatorFactory();
+        
+        /**
+        * Creates and returns instance of Mediator Sender for sending Mediator
+        * Commands and Events.
+        * @return pointer to CPhoneMediatorSender.
+        */
+        IMPORT_C CPhoneMediatorSender* Sender();
+        
+        /**
+        * Returns instance of Mediator Command Listener.
+        * When called for the very first time parameters are needed to construct
+        * the Singleton object. After that providing parameters aren't needed.
+        */
+        IMPORT_C CPhoneMediatorCommandListener* CommandListener( 
+            MPhoneMenuAndCbaEvents* aMenuAndCbaEventHandler = NULL,
+            MPhoneEngineMessageSender* aMessageSender = NULL,
+            MPEEngineInfo* aEngineInfo = NULL );
+
+        /**
+        * Returns instance of Mediator Message.         
+        * @param aMessage - Message from Phone Engine (EPEMessage).
+        * @param aCallId - Caller id
+        * @return MPhoneMediatorMessage object.
+        */
+        IMPORT_C MPhoneMediatorMessage* MediatorMessage(
+            const TInt aMessage, TInt aCallId );
+        
+
+    private:
+
+        /**
+        * Instantiates this class and returns a pointer to us
+        */
+        static CPhoneMediatorFactory* NewL();
+
+        /**    
+         * Protected constructor because of Singleton Pattern
+         */    
+        CPhoneMediatorFactory();  
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+        
+             
+    private:
+        
+        // Not owned
+        MPhoneMenuAndCbaEvents* iMenuAndCbaEvents;
+        
+        // Not owned
+        MPhoneEngineMessageSender* iMessageSender;
+        
+        // Not owned
+        MPEEngineInfo* iEngineInfo;
+
+    };
+    
+#endif // CPHONEMEDIATORFACTORY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphonemediatormessagefactory.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Factory for creating Mediator Message objects.
+*
+*/
+
+
+#ifndef CPHONEMEDIATORMESSAGEFACTORY_H
+#define CPHONEMEDIATORMESSAGEFACTORY_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MPhoneMediatorMessage;
+class MPEEngineInfo;
+
+// CLASS DECLARATION
+
+class CPhoneMediatorMessageFactory : public CBase
+    {
+    public:  
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneMediatorMessageFactory();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneMediatorMessageFactory* NewL( MPEEngineInfo& aEngineInfo );
+        
+        /**
+        * Creates the concrete Mediator Message object.
+        * @param aMessage - Message from Phone Engine (EPEMessage).
+        * @param aCallId - Caller id
+        * @return MPhoneMediatorMessage object or NULL if no associate object found for
+        *         EPEMessage.
+        */
+        MPhoneMediatorMessage* CreateMessageL( const TInt aMessage, TInt aCallId );
+        
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneMediatorMessageFactory( MPEEngineInfo& aEngineInfo );  
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+        
+             
+    private:
+        
+        // Reference to Engine Info
+        MPEEngineInfo& iEngineInfo;
+
+    };
+    
+#endif // CPHONEMEDIATORMESSAGEFACTORY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphonemediatorsender.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,230 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Sends Events and Commands via Mediator component.
+*
+*/
+
+
+#ifndef CPHONEMEDIATORSENDER_H
+#define CPHONEMEDIATORSENDER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <coemain.h>
+#include <MediatorEventProvider.h>
+#include <MediatorCommandInitiator.h>
+#include <mediatoreventsfromtelephonyapi.h>
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecommandparam.h"
+
+// FORWARD DECLARATIONS
+class CMediatorEventProvider;
+class MPhoneEngineMessageSender;
+class MPhoneShutdownCommand;
+
+using namespace TelephonyMediator;
+
+/**
+* Struct for buffering mediator command.
+* In a case when several commands are sent to Mediator
+* we resend the last used command after receiving a
+* Mediator response.
+*/
+struct TPhoneCommandBuffer
+    {
+    TInt iCommandId;
+    TUid iDomainUid;
+    TUid iCategoryUid;
+    TVersion iVersion;        
+    };
+
+// CLASS DECLARATION
+
+class CPhoneMediatorSender : public CCoeStatic, private MMediatorCommandResponseObserver
+    {
+    public:  
+
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * instance.
+        * @param None.
+        * @return Pointer to the one and only instance of Phone Mediator 
+        *         Sender -object.
+        */
+        IMPORT_C static CPhoneMediatorSender* Instance();
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneMediatorSender();
+                        
+        /**
+         * Sends event to the Mediator.
+         * @param aCommandId - command to be sent as an event
+         */
+        IMPORT_C void SendEvent( const TPhoneViewCommandId aCommandId ) const;
+        
+        /**
+         * Sends event to the Mediator.
+         * @param aCommandId - command to be sent as an event
+         * @param aCallId - command's call id
+         */
+        IMPORT_C void SendEvent( const TPhoneViewCommandId aCommandId, const TInt aCallId ) const;
+        
+        /**
+         * Sends event to the Mediator.
+         * @param aCommandId - command to be sent as an event
+         * @param aCommandParam - Reference to command parameter
+         */
+        IMPORT_C void SendEvent( const TPhoneViewCommandId aCommandId, 
+            TPhoneCommandParam& aCommandParam );
+
+        /**
+         * Sends event to the Mediator.
+         * @param aCommandId - command to be sent as an event
+         * @param aCallId - command's call id
+         * @param aCommandParam - Reference to command parameter
+         */
+        IMPORT_C void SendEvent( const TPhoneViewCommandId aCommandId, 
+            const TInt aCallId, 
+            TPhoneCommandParam& aCommandParam ) const;
+
+        /**
+         * Sends event to the Mediator.
+         * @param aCommandId - command to be sent as an event
+         * @param aCallId - command's call id
+         * @param aCommandParam - Pointer to TDesC16
+         */
+        IMPORT_C void SendEvent( const TPhoneViewCommandId aCommandId, 
+            const TInt aCallId, 
+            const TDesC* aMessage ) const;
+
+        /**
+        * Issue a Mediator Service command.
+        * 
+        * @param aDomain    The identifier of the domain     
+        * @param aCategory  The identifier of the category.
+        * @param aCommandId The identifier of the command.
+        * @param aVersion   The version information for the command.
+        * @param aData      The parameters of the command.
+        * @return TInt      an error code
+        */
+        IMPORT_C TInt IssueCommand( const TUid aDomain, 
+                                    const TUid aCategory, 
+                                    const TInt aCommandId,
+                                    const TVersion aVersion, 
+                                    const TDesC8& aData,
+                                    MPhoneShutdownCommand* aShutdownCommand = NULL );
+
+        /**
+        * A response to a Mediator Service command.
+        *
+        * @param aDomain    The identifier of the domain          
+        * @param aCategory  The identifier of the category.
+        * @param aCommandId The identifier of the command.
+        * @param aStatus    Standard Symbian error code indicating the
+        *                   success of the command.
+        * @param aData      The parameters of the response.
+        */
+        void CommandResponseL( TUid aDomain,
+                               TUid aCategory, 
+                               TInt aCommandId,
+                               TInt aStatus, 
+                               const TDesC8& aData );     
+
+    private:
+
+        /**
+        * Instantiates this class and returns a pointer to us
+        */
+        static CPhoneMediatorSender* NewL();
+
+        /**    
+         * Protected constructor because of Singleton Pattern
+         */    
+        CPhoneMediatorSender();  
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+               
+        /**
+        * Registers generic Mediator Events sent via this interface.
+        */
+        void RegisterGenericEvents();
+        
+        /**
+        * Reacts to Video Telephony specific Mediator Command reponse.
+        * @param aCommandId - Command to react for.
+        */
+        void VideoTelephonyCommandResponse( TInt aCommandId );
+        
+        /**
+        * Maps Phone Engine call state to the ones defined in our Mediator API.
+        * @param aCallState - Phone Engine's call state which to map
+        * @return TCallState
+        */
+        TCallState MapCallState( const TInt aCallState ) const;
+
+        /**
+        * Maps Phone Engine call type to the ones defined in our Mediator API.
+        * @param aCallTypr - Phone Engine's call type which to map
+        * @return TCallType
+        */
+        TCallType MapCallType( const TInt aCallType ) const;
+        
+        /**
+        * Resets the values of used TPhoneCommandBuffer.
+        */
+        void ResetCommandBuffer();
+                
+        
+    private:
+        
+        /**
+         * Interface for sending events to Mediator
+         */
+        CMediatorEventProvider* iEventSender;
+        
+        /**
+         * List of events - used for registering events we provide
+         */
+        MediatorService::REventList iEvents;
+        
+        /**
+        * List of generic events - used for registering events we provide
+        */
+        MediatorService::REventList iGenericEvents;
+
+        /**
+        * Interface for sending commands to Mediator
+        */        
+        CMediatorCommandInitiator* iCommandInitiator;
+    
+        /**
+        * Buffer for re-sending command after received Mediator response
+        */
+        TPhoneCommandBuffer iCommandBuffer;
+
+        /**
+        * Pointer for executing command related to Video Telephony shutdown.
+        */
+        MPhoneShutdownCommand* iShutdownCommand;
+    };
+    
+#endif // CPHONEMEDIATORSENDER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphonereleasecommand.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Command for releasing a connection at Video Telephony shutdown.
+*
+*/
+
+
+#ifndef CPHONERELEASECOMMAND_H
+#define CPHONERELEASECOMMAND_H
+
+// INCLUDES
+#include <e32base.h>
+#include "mphoneshutdowncommand.h"
+#include "mphoneenginemessagesender.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+class CPhoneReleaseCommand : public CBase, public MPhoneShutdownCommand
+    {
+    public:  
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneReleaseCommand();
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneReleaseCommand* NewL( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+        * Executes this Command.
+        */
+        virtual void ExecuteLD();
+        
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneReleaseCommand( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+        
+        
+    private:
+
+        /**
+        * For sending message to Phone Engine.
+        */    
+        MPhoneEngineMessageSender& iEngineMessageSender;
+                     
+    };
+    
+#endif // CPHONERELEASECOMMAND_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphoneswitchtovideoorvoicecommand.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Command for switching to video/voice at Video Telephony shutdown.
+*
+*/
+
+
+#ifndef CPHONESWITCHTOVIDEOORVOICECOMMAND_H
+#define CPHONESWITCHTOVIDEOORVOICECOMMAND_H
+
+// INCLUDES
+#include <e32base.h>
+#include "mphoneshutdowncommand.h"
+#include "mphoneenginemessagesender.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+class CPhoneSwitchToVideoOrVoiceCommand : public CBase, 
+    public MPhoneShutdownCommand
+    {
+    public:  
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneSwitchToVideoOrVoiceCommand();
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneSwitchToVideoOrVoiceCommand* NewL( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+        * Executes this Command.
+        */
+        virtual void ExecuteLD();
+        
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneSwitchToVideoOrVoiceCommand( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+        
+        
+    private:
+
+        /**
+        * For sending message to Phone Engine.
+        */    
+        MPhoneEngineMessageSender& iEngineMessageSender;
+                     
+    };
+    
+#endif // CPHONESWITCHTOVIDEOORVOICECOMMAND_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/cphoneterminateallconnectionscommand.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Command for terminating all connections at Video Telephony shutdown.
+*
+*/
+
+
+#ifndef CPHONETERMINATEALLCONNECTIONSCOMMAND_H
+#define CPHONETERMINATEALLCONNECTIONSCOMMAND_H
+
+// INCLUDES
+#include <e32base.h>
+#include "mphoneshutdowncommand.h"
+#include "mphoneenginemessagesender.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+class CPhoneTerminateAllConnectionsCommand : public CBase, 
+    public MPhoneShutdownCommand
+    {
+    public:  
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneTerminateAllConnectionsCommand();
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneTerminateAllConnectionsCommand* NewL( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+        * Executes this Command.
+        */
+        virtual void ExecuteLD();
+        
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneTerminateAllConnectionsCommand( 
+            MPhoneEngineMessageSender& aEngineMessageSender );
+        
+        /**
+         * By default EPOC constructor is private.
+         */
+        void ConstructL();
+        
+        
+    private:
+
+        /**
+        * For sending message to Phone Engine.
+        */    
+        MPhoneEngineMessageSender& iEngineMessageSender;
+                     
+    };
+    
+#endif // CPHONETERMINATEALLCONNECTIONSCOMMAND_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/mphonemediatormessage.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Command Design Pattern's Command Interface for sending Mediator Messages.
+*
+*/
+
+
+#ifndef MPHONEMEDIATORMESSAGE_H
+#define MPHONEMEDIATORMESSAGE_H
+
+/**
+*  Command Design Pattern's Command Interface for sending Mediator Messages.
+*/
+class MPhoneMediatorMessage
+    {
+    public:
+        
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneMediatorMessage() {};
+
+        /**
+        * Executes the Command.
+        */
+        virtual void ExecuteL() = 0;
+        
+    };
+    
+#endif // MPHONEMEDIATORMESSAGE_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/inc/mphoneshutdowncommand.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Command Design Pattern's Command Interface for sending relevant Phone
+*     Engine message related to Video Telephony shutdown.
+*
+*/
+
+
+#ifndef MPHONESHUTDOWNCOMMAND_H
+#define MPHONESHUTDOWNCOMMAND_H
+
+/**
+*  Command Design Pattern's Command Interface for sending Phone Engine message
+*  when Video Telephony shutdown operation is done.
+*/
+class MPhoneShutdownCommand
+    {
+    public:
+        
+        /**
+        * Executes the Command.
+        */
+        virtual void ExecuteLD() = 0;
+        
+    };
+    
+#endif // MPHONESHUTDOWNCOMMAND_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphonecontinueemergencycallcommand.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneContinueEmergencyCallCommand.
+*
+*/
+
+
+// INCLUDE FILES
+#include "phonelogger.h"
+#include "cphonecontinueemergencycallcommand.h"
+#include "pevirtualengine.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneContinueEmergencyCallCommand::CPhoneContinueEmergencyCallCommand
+// ---------------------------------------------------------
+//
+CPhoneContinueEmergencyCallCommand::CPhoneContinueEmergencyCallCommand( 
+    MPhoneEngineMessageSender& aEngineMessageSender ) : 
+    iEngineMessageSender( aEngineMessageSender )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneContinueEmergencyCallCommand::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneContinueEmergencyCallCommand::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneContinueEmergencyCallCommand::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneContinueEmergencyCallCommand* CPhoneContinueEmergencyCallCommand::NewL( 
+    MPhoneEngineMessageSender& aEngineMessageSender )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneContinueEmergencyCallCommand::NewL( ) ");
+    CPhoneContinueEmergencyCallCommand* self = new( ELeave ) 
+        CPhoneContinueEmergencyCallCommand( aEngineMessageSender );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneContinueEmergencyCallCommand::~CPhoneContinueEmergencyCallCommand
+// ---------------------------------------------------------
+//
+CPhoneContinueEmergencyCallCommand::~CPhoneContinueEmergencyCallCommand()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneContinueEmergencyCallCommand::ExecuteLD
+// ---------------------------------------------------------
+//
+void CPhoneContinueEmergencyCallCommand::ExecuteLD()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, 
+        "CPhoneContinueEmergencyCallCommand::ExecuteL( ) ");
+    iEngineMessageSender.SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageContinueEmergencyCallInitialization );
+    delete this;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphonedataportmessage.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneDataPortMessage class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <videotelcontrolmediatorapi.h>
+#include <MediatorDomainUIDs.h>
+#include "phonelogger.h"
+#include "cphonedataportmessage.h"
+#include "cphonemediatorsender.h"
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneDataPortMessage::CPhoneDataPortMessage
+// ---------------------------------------------------------
+//
+CPhoneDataPortMessage::CPhoneDataPortMessage( MPEEngineInfo& aEngineInfo ) :
+    iEngineInfo( aEngineInfo )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneDataPortMessage::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneDataPortMessage::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneDataPortMessage::NewL
+// ---------------------------------------------------------
+//
+CPhoneDataPortMessage* CPhoneDataPortMessage::NewL( MPEEngineInfo& aEngineInfo )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneDataPortMessage::NewL( ) ");
+    CPhoneDataPortMessage* self = new( ELeave ) CPhoneDataPortMessage( aEngineInfo );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneDataPortMessage::~CPhoneDataPortMessage
+// ---------------------------------------------------------
+//
+CPhoneDataPortMessage::~CPhoneDataPortMessage()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneDataPortMessage::ExecuteL
+// ---------------------------------------------------------
+//
+void CPhoneDataPortMessage::ExecuteL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneDataPortMessage::ExecuteL( ) ");
+    const TName& dataPortName = iEngineInfo.DataPortName();
+    TDataPortPackage dataPortPackage( dataPortName );
+    CPhoneMediatorSender::Instance()->IssueCommand( KMediatorVideoTelephonyDomain,
+                                                    KCatPhoneToVideotelCommands,
+                                                    EVtCmdUseDataport,
+                                                    TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                              KPhoneToVideotelCmdVersionMinor,
+                                                              KPhoneToVideotelCmdVersionBuild ),
+                                                    dataPortPackage );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphonemediatorcommandlistener.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,408 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMediatorCommandListener class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <MediatorDomainUIDs.h>
+#include "mphonemenuandcbaevents.h"
+#include "mphonekeyeventhandler.h"
+#include "mphoneviewcommandhandle.h"
+#include "cphonemediatorcommandlistener.h"
+#include "phonelogger.h"
+#include "phonemediatorpackagetypes.h"
+#include "cphonestatehandle.h"
+#include "tphonecmdparamboolean.h"
+#include "videoteltophonecommandsapi.h"
+#include "mediatoraudiocommandstotelephonyapi.h"
+#include "phoneui.pan"
+#include "phoneui.hrh"
+#include "pevirtualengine.h"
+#include "mpeengineinfo.h"
+#include "mediatorcommandstotelephonyapi.h"
+#include "cphonereconnectquery.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneMediatorCommandListener::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneMediatorCommandListener* CPhoneMediatorCommandListener::Instance()
+    {
+    CPhoneMediatorCommandListener* instance = static_cast<CPhoneMediatorCommandListener*> 
+        ( CCoeEnv::Static ( KUidMediatorCommandListenerSingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneMediatorCommandListener::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneUtilsCouldNotCreateSingleton );    
+            }
+        }
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::CPhoneMediatorCommandListener
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMediatorCommandListener::CPhoneMediatorCommandListener() :
+    CCoeStatic( KUidMediatorCommandListenerSingleton )
+    {
+    }
+
+// Destructor
+CPhoneMediatorCommandListener::~CPhoneMediatorCommandListener()
+    {
+    if ( iCommandResponder )
+        {
+        iCommandResponder->UnregisterCommand( KMediatorTelephonyDomain, 
+                                              KCatVideoTelToPhoneCommands, 
+                                              iVideoTelCommands );
+
+        iCommandResponder->UnregisterCommand( KMediatorTelephonyDomain, 
+                                              KCatAudioCommandsToTelephony, 
+                                              iAudioCommands );
+
+        iCommandResponder->UnregisterCommand( KMediatorTelephonyDomain, 
+                                              KCatCommandsToTelephony, 
+                                              iGenericCommands );
+
+        delete iCommandResponder;
+        iCommandResponder = NULL;
+        }
+    iVideoTelCommands.Close();
+    iAudioCommands.Close();
+    iGenericCommands.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::ConstructL( ) ");
+
+    RegisterMediatorCommandsL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneMediatorCommandListener::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneMediatorCommandListener* CPhoneMediatorCommandListener::NewL()
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::NewL( ) ");
+    CPhoneMediatorCommandListener* self = new( ELeave ) CPhoneMediatorCommandListener();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::Initialize
+// -----------------------------------------------------------------------------
+//    
+void CPhoneMediatorCommandListener::Initialize( 
+    MPhoneMenuAndCbaEvents* aMenuAndCbaEventHandler,
+    MPhoneEngineMessageSender* aMessageSender,
+    MPEEngineInfo* aEngineInfo )
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::Initialize( ) ");
+    iMenuAndCbaHandler = aMenuAndCbaEventHandler;
+    iMessageSender = aMessageSender;
+    iEngineInfo = aEngineInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::RegisterMediatorCommandsL
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::RegisterMediatorCommandsL()
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::RegisterMediatorCommandsL( ) ");
+    iCommandResponder = CMediatorCommandResponder::NewL( this );
+
+    RegisterVideoTelephonyMediatorCommands();
+    RegisterAudioMediatorCommands();
+    RegisterGenericMediatorCommands();                                                
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands()
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands( ) ");
+    TCapabilitySet caps;
+    caps.SetEmpty();
+
+    // Video Telephony Commands
+    MediatorService::TCommand newCommand;
+    newCommand.iCommandId = EVtCmdFallback;
+    newCommand.iVersion = TVersion( KVideoTelToPhoneCmdVersionMajor, 
+        KVideoTelToPhoneCmdVersionMinor, KVideoTelToPhoneCmdVersionBuild );
+    caps.Set( ECapabilityNetworkControl );
+    newCommand.iCaps = caps;
+    newCommand.iTimeout = KPhoneUiMediatorIfTimeout;    
+    iVideoTelCommands.Append( newCommand );
+
+    newCommand.iCommandId = EVtCmdSwitchToVoice;
+    iVideoTelCommands.Append( newCommand );
+    
+    newCommand.iCommandId = EVtCmdLowMemory;
+    iVideoTelCommands.Append( newCommand );
+
+    // Register Video Telephony Commands
+    TInt error = iCommandResponder->RegisterCommand( KMediatorTelephonyDomain, 
+                                                     KCatVideoTelToPhoneCommands, 
+                                                     iVideoTelCommands );
+    __ASSERT_DEBUG( error == KErrNone, Panic( EPhoneMediatorCenterRegistrationFailed ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::RegisterAudioMediatorCommands
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::RegisterAudioMediatorCommands()
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::RegisterAudioMediatorCommands( ) ");
+    TCapabilitySet caps;
+    caps.SetEmpty();
+
+    // Audio Commands
+    MediatorService::TCommand newCommand;
+    newCommand.iCommandId = EAudioCmdUnmute;
+    newCommand.iVersion = TVersion( KAudioCmdToTelephonyVersionMajor, 
+        KAudioCmdToTelephonyVersionMinor, KAudioCmdToTelephonyVersionBuild );
+    caps.Set( ECapabilityNetworkControl );
+    newCommand.iCaps = caps;
+    newCommand.iTimeout = KPhoneUiMediatorIfTimeout;    
+    iAudioCommands.Append( newCommand );
+
+    newCommand.iCommandId = EAudioCmdMute;
+    iAudioCommands.Append( newCommand );
+
+    // Register Audio Commands
+    TInt error = iCommandResponder->RegisterCommand( KMediatorTelephonyDomain, 
+                                                     KCatAudioCommandsToTelephony, 
+                                                     iAudioCommands );
+    __ASSERT_DEBUG( error == KErrNone, Panic( EPhoneMediatorCenterRegistrationFailed ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::RegisterGenericMediatorCommands
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::RegisterGenericMediatorCommands()
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::RegisterGenericMediatorCommands( ) ");
+    TCapabilitySet caps;
+    caps.SetEmpty();
+
+    // Generic Commands
+    MediatorService::TCommand newCommand;
+    newCommand.iCommandId = EPhoneCmdEndActiveCall;
+    newCommand.iVersion = TVersion( KTelephonyCommandsVersionMajor, 
+        KTelephonyCommandsVersionMinor, KTelephonyCommandsVersionBuild );
+    caps.Set( ECapabilityNetworkControl );
+    newCommand.iCaps = caps;
+    newCommand.iTimeout = KPhoneUiMediatorIfTimeout;    
+    iGenericCommands.Append( newCommand );
+
+    // Register Generic Commands
+    TInt error = iCommandResponder->RegisterCommand( KMediatorTelephonyDomain, 
+                                                     KCatCommandsToTelephony, 
+                                                     iGenericCommands );
+    __ASSERT_DEBUG( error == KErrNone, Panic( EPhoneMediatorCenterRegistrationFailed ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::MediatorCommandL
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::MediatorCommandL( 
+    TUid aDomain, 
+    TUid aCategory, 
+    TInt aCommandId, 
+    TVersion aVersion, 
+    const TDesC8& /*aData*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::MediatorCommandL( ) ");
+    if( aDomain == KMediatorTelephonyDomain &&
+        aCategory == KCatVideoTelToPhoneCommands )
+        {
+        VideoTelephonyCommandL( aCommandId, aVersion );
+        SendResponse( aDomain, aCategory, aCommandId );
+        return;         
+        }
+    else if( aDomain == KMediatorTelephonyDomain &&
+             aCategory == KCatAudioCommandsToTelephony )
+        {
+        AudioCommandL( aCommandId, aVersion );
+        SendResponse( aDomain, aCategory, aCommandId );
+        return;
+        }
+    else if( aDomain == KMediatorTelephonyDomain &&
+             aCategory == KCatCommandsToTelephony )
+        {
+        GenericCommandL( aCommandId, aVersion );
+        SendResponse( aDomain, aCategory, aCommandId );
+        return;         
+        }
+    
+    TInt error = iCommandResponder->IssueResponse( aDomain, 
+                                                 aCategory, 
+                                                 aCommandId,
+                                                 KErrNotFound, 
+                                                 KNullDesC8 );                              
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::CancelMediatorCommand
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::CancelMediatorCommand( 
+    TUid /*aDomain*/,
+    TUid /*aCategory*/, 
+    TInt /*aCommandId*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::CancelMediatorCommand( ) ");
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::SendResponse
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::SendResponse( 
+    TUid aDomain, 
+    TUid aCategory, 
+    TInt aCommandId )
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::SendResponse( ) ");
+    iCommandResponder->IssueResponse( aDomain, 
+                                      aCategory, 
+                                      aCommandId,
+                                      KErrNone, 
+                                      KNullDesC8 );     
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::VideoTelephonyCommandL
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::VideoTelephonyCommandL( TInt aCommandId, TVersion /*aVersion*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::VideoTelephonyCommandL( ) ");
+        
+    __ASSERT_DEBUG( iMenuAndCbaHandler, Panic( EPhoneMediatorCenterSingletonNotInitialized ) );
+    __ASSERT_DEBUG( iMessageSender, Panic( EPhoneMediatorCenterSingletonNotInitialized ) );
+    
+    switch( aCommandId )
+        {
+        case EVtCmdFallback:
+            iMenuAndCbaHandler->HandleCommandL( EPhoneInCallCmdEndThisActiveCall );
+            CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue );
+            break;
+            
+        case EVtCmdSwitchToVoice:
+            iMenuAndCbaHandler->HandleCommandL( EPhoneCmdYesSwitchToVoice );
+            break;
+            
+        case EVtCmdLowMemory:
+            iMenuAndCbaHandler->HandleCommandL( EPhoneCmdVideoCallOutOfMemory );
+            break;
+            
+        default:
+            __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) );
+            break;
+        }       
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::AudioCommandL
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::AudioCommandL( TInt aCommandId, TVersion /*aVersion*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::AudioCommandL( ) ");
+
+    __ASSERT_DEBUG( iMessageSender, Panic( EPhoneMediatorCenterSingletonNotInitialized ) );
+    __ASSERT_DEBUG( iEngineInfo, Panic( EPhoneMediatorCenterSingletonNotInitialized ) );
+        
+    switch( aCommandId )
+        {
+        case EAudioCmdUnmute:
+            iEngineInfo->SetAudioMuteCommand( false );
+            iMessageSender->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageSetAudioMute );
+            break;
+            
+        case EAudioCmdMute:
+            iEngineInfo->SetAudioMuteCommand( true );
+            iMessageSender->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageSetAudioMute );
+            break;
+            
+        default:
+            __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorCommandListener::GenericCommandL
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorCommandListener::GenericCommandL( TInt aCommandId, TVersion /*aVersion*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneMediatorCenter, 
+        "CPhoneMediatorCommandListener::GenericCommandL( ) ");
+    __ASSERT_DEBUG( iMenuAndCbaHandler, Panic( EPhoneMediatorCenterSingletonNotInitialized ) );
+
+    switch( aCommandId )
+        {
+        case EPhoneCmdEndActiveCall:
+            iMenuAndCbaHandler->HandleCommandL( EPhoneInCallCmdEndThisActiveCall );
+            break;
+            
+        default:
+            __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) );
+            break;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphonemediatorfactory.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMediatorFactory class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonemediatorfactory.h"
+#include "phonelogger.h"
+#include "phoneconstants.h"
+#include "phoneui.pan"
+#include "cphonemediatorsender.h"
+#include "cphonemediatorcommandlistener.h"
+#include "cphonemediatormessagefactory.h"
+#include "mphonemenuandcbaevents.h"
+#include "mphoneenginemessagesender.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneMediatorFactory::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorFactory* CPhoneMediatorFactory::Instance()
+    {
+    CPhoneMediatorFactory* instance = static_cast<CPhoneMediatorFactory*> 
+        ( CCoeEnv::Static ( KUidMediatorFactorySingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneMediatorFactory::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneMediatorCenterCouldNotCreateSingleton );   
+            }
+        }
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::CPhoneMediatorFactory
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMediatorFactory::CPhoneMediatorFactory() :
+    CCoeStatic( KUidMediatorFactorySingleton )
+    {
+    }
+
+// Destructor
+CPhoneMediatorFactory::~CPhoneMediatorFactory()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorFactory::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::ConstructL( ) ");
+    }
+
+// -----------------------------------------------------------
+// CPhoneMediatorFactory::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneMediatorFactory* CPhoneMediatorFactory::NewL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::NewL( ) ");
+    
+    CPhoneMediatorFactory* self = new ( ELeave ) CPhoneMediatorFactory;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::Sender
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorSender* CPhoneMediatorFactory::Sender()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::Sender( ) ");
+    return CPhoneMediatorSender::Instance();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::CommandListener
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorCommandListener* CPhoneMediatorFactory::CommandListener( 
+    MPhoneMenuAndCbaEvents* aMenuAndCbaEventHandler, 
+    MPhoneEngineMessageSender* aMessageSender,
+    MPEEngineInfo* aEngineInfo )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::CommandListener( ) ");
+    
+    if( aEngineInfo && !iEngineInfo )
+        {
+        iEngineInfo = aEngineInfo;          
+        }
+    
+    if( aMenuAndCbaEventHandler && aMessageSender )
+        {
+        iMenuAndCbaEvents = aMenuAndCbaEventHandler;
+        iMessageSender = aMessageSender;
+        CPhoneMediatorCommandListener::Instance()->Initialize( aMenuAndCbaEventHandler,
+            aMessageSender, aEngineInfo );
+        }
+    else
+        {
+        // Sanity checks
+        __ASSERT_DEBUG( iMenuAndCbaEvents, Panic( EPhoneMediatorCenterParameterNotInitialized ) );
+        __ASSERT_DEBUG( iMessageSender, Panic( EPhoneMediatorCenterParameterNotInitialized ) );
+        __ASSERT_DEBUG( iEngineInfo, Panic( EPhoneMediatorCenterParameterNotInitialized ) );
+        }
+    return CPhoneMediatorCommandListener::Instance();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::MediatorMessage
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPhoneMediatorMessage* CPhoneMediatorFactory::MediatorMessage(
+    const TInt aMessage, TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::MediatorMessage( ) ");
+    __ASSERT_DEBUG( iEngineInfo, Panic( EPhoneMediatorCenterParameterNotInitialized ) );
+
+    CPhoneMediatorMessageFactory* messageFactory = NULL;
+    MPhoneMediatorMessage* message = NULL;
+    
+    TRAPD( error, messageFactory = CPhoneMediatorMessageFactory::NewL( *iEngineInfo ) );
+    if( error == KErrNone )
+        {
+        TRAP_IGNORE( message = messageFactory->CreateMessageL( aMessage, aCallId ) );
+        delete messageFactory;
+        }
+
+    return message;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphonemediatormessagefactory.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMediatorMessageFactory class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "pevirtualengine.h"
+#include "phoneui.pan"
+#include "cphonemediatormessagefactory.h"
+#include "cphonedataportmessage.h"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneMediatorMessageFactory::CPhoneMediatorMessageFactory
+// ---------------------------------------------------------
+//
+CPhoneMediatorMessageFactory::CPhoneMediatorMessageFactory( MPEEngineInfo& aEngineInfo ) : 
+    iEngineInfo( aEngineInfo )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneMediatorMessageFactory::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneMediatorMessageFactory::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneMediatorMessageFactory::NewL
+// ---------------------------------------------------------
+//
+CPhoneMediatorMessageFactory* CPhoneMediatorMessageFactory::NewL( MPEEngineInfo& aEngineInfo )
+    {
+    CPhoneMediatorMessageFactory* self = new( ELeave ) CPhoneMediatorMessageFactory( aEngineInfo );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneMediatorMessageFactory::~CPhoneMediatorMessageFactory
+// ---------------------------------------------------------
+//
+CPhoneMediatorMessageFactory::~CPhoneMediatorMessageFactory()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneMediatorMessageFactory::CreateMessageL
+// ---------------------------------------------------------
+//
+MPhoneMediatorMessage* CPhoneMediatorMessageFactory::CreateMessageL( 
+    const TInt aMessage, TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorMessageFactory::CreateMessageL( ) ");
+    __PHONELOG2( EBasic, EPhoneMediatorCenter, 
+        "CPhoneMediatorMessageFactory::CreateMessageL - aMessage=%d, aCallId=%d", aMessage, aCallId );
+
+    MPhoneMediatorMessage* message = NULL;
+
+    switch( aMessage )
+        {
+        case MEngineMonitor::EPEMessageDataPortLoaned:
+            message = CPhoneDataPortMessage::NewL( iEngineInfo );
+            break;
+            
+        default:
+            break;
+        }
+            
+    return message;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphonemediatorsender.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,486 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMediatorSender class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <MediatorDomainUIDs.h>
+#include <videotelcontrolmediatorapi.h>
+#include "phoneui.hrh"
+#include "cphonemediatorsender.h"
+#include "phonelogger.h"
+#include "phoneconstants.h"
+#include "phonemediatorpackagetypes.h"
+#include "phoneui.pan"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamboolean.h"
+#include "mphoneenginemessagesender.h"
+#include "pevirtualengine.h"
+#include "mphoneshutdowncommand.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneMediatorSender::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorSender* CPhoneMediatorSender::Instance()
+    {
+    CPhoneMediatorSender* instance = static_cast<CPhoneMediatorSender*> 
+        ( CCoeEnv::Static ( KUidMediatorSenderSingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneMediatorSender::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneMediatorCenterCouldNotCreateSingleton );   
+            }
+        }
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::CPhoneMediatorSender
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMediatorSender::CPhoneMediatorSender() :
+    CCoeStatic( KUidMediatorSenderSingleton )
+    {
+    }
+
+// Destructor
+CPhoneMediatorSender::~CPhoneMediatorSender()
+    {
+    delete iCommandInitiator;
+    iEvents.Close();
+    iGenericEvents.Close(); 
+    delete iEventSender;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::ConstructL( ) ");
+    iCommandInitiator = CMediatorCommandInitiator::NewL( this );
+    iEventSender = CMediatorEventProvider::NewL();
+    ResetCommandBuffer();
+    
+    RegisterGenericEvents();        
+    }
+
+// -----------------------------------------------------------
+// CPhoneMediatorSender::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneMediatorSender* CPhoneMediatorSender::NewL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::NewL( ) ");
+    
+    CPhoneMediatorSender* self = new ( ELeave ) CPhoneMediatorSender;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::RegisterGenericEvents
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::RegisterGenericEvents()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::RegisterGenericEvents( ) ");
+    TCapabilitySet caps;
+    caps.SetEmpty();
+    
+    MediatorService::TEvent newEvent;
+    newEvent.iEventId = EPhoneEventCallData;
+    newEvent.iVersion = TVersion( KTelephonyEventsVersionMajor,
+                                  KTelephonyEventsVersionMinor, 
+                                  KTelephonyEventsVersionBuild );
+    newEvent.iCaps = caps;
+    
+    TRAPD( errorCode, iGenericEvents.AppendL( newEvent ));
+    if( errorCode == ECCPErrorNone )
+        {
+        TInt res = iEventSender->RegisterEvent( KMediatorTelephonyDomain,
+                                     KCatEventsFromTelephony,
+                                     iGenericEvents );  
+        __ASSERT_DEBUG( !res, Panic( EPhoneMediatorCenterRegistrationFailed ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( 
+    const TPhoneViewCommandId /*aCommandId*/ ) const
+    {
+    // No one yet intereseted this event.
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( const TPhoneViewCommandId aCommandId, 
+    const TInt aCallId ) const
+    {
+    switch( aCommandId )
+        {
+        case EPhoneViewRemoveCallHeader:
+            {
+            __PHONELOG1( EBasic, EPhoneMediatorCenter, 
+                "CPhoneMediatorSender::SendEvent - EPhoneEventCallData iCallId:%d" ,aCallId );
+            TTelephonyCallDataParam callDataParam;
+            callDataParam.iCallId = aCallId;
+            callDataParam.iCallState = ECallStateIdle;
+            TTelephonyCallDataParamPackage callDataParamPackage( callDataParam );
+            iEventSender->RaiseEvent( KMediatorTelephonyDomain,
+                                      KCatEventsFromTelephony,
+                                      EPhoneEventCallData,
+                                      TVersion( KTelephonyEventsVersionMajor,
+                                        KTelephonyEventsVersionMinor, 
+                                        KTelephonyEventsVersionBuild ),
+                                      callDataParamPackage );   
+            }
+            break;
+            
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( const TPhoneViewCommandId aCommandId, 
+    TPhoneCommandParam& aCommandParam )
+    {
+    switch( aCommandId )
+        {
+        case EPhoneViewActivateMuteUIChanges:
+            {
+            TPhoneCmdParamBoolean& booleanParam = static_cast<TPhoneCmdParamBoolean&>( aCommandParam );
+            const TBool audioMute( booleanParam.Boolean() );
+            TInt response = KErrNone;
+
+            TInt command = -1; 
+            if( audioMute )
+                {
+                __PHONELOG( EBasic, EPhoneMediatorCenter, 
+                    "CPhoneMediatorSender::SendEvent - transformed to Mediator Command EVtCmdMute" );
+                command = EVtCmdMute;
+                response = IssueCommand( KMediatorVideoTelephonyDomain,
+                                         KCatPhoneToVideotelCommands, 
+                                         command,
+                                         TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                   KPhoneToVideotelCmdVersionMinor, 
+                                                   KPhoneToVideotelCmdVersionBuild ),
+                                         KNullDesC8 );
+                }
+            else
+                {
+                __PHONELOG( EBasic, EPhoneMediatorCenter, 
+                    "CPhoneMediatorSender::SendEvent - transformed to Mediator Command EVtCmdUnmute" );
+                command = EVtCmdUnmute;
+                response = IssueCommand( KMediatorVideoTelephonyDomain,
+                                         KCatPhoneToVideotelCommands, 
+                                         command,
+                                         TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                   KPhoneToVideotelCmdVersionMinor, 
+                                                   KPhoneToVideotelCmdVersionBuild ),
+                                         KNullDesC8 );
+                }
+                
+            if( ( response == KErrInUse ) && ( iCommandBuffer.iCommandId == KErrNotFound ) )
+                {
+                // Previous command wasn't handled yet so buffer the last unhandled command.
+                // This command will be sent after we get response to the previous command
+                iCommandBuffer.iCommandId = command;
+                iCommandBuffer.iDomainUid = KMediatorVideoTelephonyDomain;
+                iCommandBuffer.iCategoryUid = KCatPhoneToVideotelCommands;
+                iCommandBuffer.iVersion = TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                    KPhoneToVideotelCmdVersionMinor, 
+                                                    KPhoneToVideotelCmdVersionBuild );
+                }
+            }
+            break;
+            
+        default:
+            break;    
+        }   
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( const TPhoneViewCommandId aCommandId, 
+    const TInt aCallId, TPhoneCommandParam& aCommandParam ) const
+    {
+    switch( aCommandId )
+        {
+        case EPhoneViewCreateCallHeader:
+            {
+            TPhoneCmdParamCallHeaderData& callHeaderParam = static_cast<TPhoneCmdParamCallHeaderData&>( aCommandParam );
+            __PHONELOG2( EBasic, EPhoneMediatorCenter, 
+                "CPhoneMediatorSender::SendEvent - EPhoneEventCallData iCallId:%d iCLIText:%S",
+                aCallId, &callHeaderParam.CLIText() );
+            TTelephonyCallDataParam callDataParam;
+            callDataParam.iCallId = aCallId;
+            callDataParam.iCLIText = callHeaderParam.CLIText();
+            callDataParam.iCallState = MapCallState( callHeaderParam.CallState() );
+            callDataParam.iRemotePhoneNumber = callHeaderParam.RemotePhoneNumber();
+            callDataParam.iCallType = MapCallType( callHeaderParam.CallType() );
+            TTelephonyCallDataParamPackage callDataParamPackage( callDataParam );
+            iEventSender->RaiseEvent( KMediatorTelephonyDomain,
+                                      KCatEventsFromTelephony,
+                                      EPhoneEventCallData,
+                                      TVersion( KTelephonyEventsVersionMajor,
+                                        KTelephonyEventsVersionMinor, 
+                                        KTelephonyEventsVersionBuild ),
+                                      callDataParamPackage );   
+            }
+            break;
+            
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( 
+    const TPhoneViewCommandId /*aCommandId*/, 
+    const TInt /*aCallId*/, const TDesC* /*aMessage*/ ) const
+    {
+    // No one interested yet from these events.
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::IssueCommand
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneMediatorSender::IssueCommand( const TUid aDomain, const TUid aCategory, 
+    const TInt aCommandId, const TVersion aVersion, const TDesC8& aData, 
+    MPhoneShutdownCommand* aShutdownCommand  )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::IssueCommand( ) ");
+    __PHONELOG3( EBasic, EPhoneMediatorCenter, 
+            "aCommandId = %d, aDomain = %d, aCategory = %d", aCommandId, aDomain, aCategory );
+    if( aShutdownCommand )
+        {
+        iShutdownCommand = aShutdownCommand;            
+        }
+
+    return iCommandInitiator->IssueCommand( 
+        aDomain, 
+        aCategory, 
+        aCommandId, 
+        aVersion, 
+        aData );        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::CommandResponseL
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::CommandResponseL( TUid aDomain, TUid aCategory, 
+    TInt aCommandId, TInt /*aStatus*/, const TDesC8& /*aData*/ )
+    {
+    // First check for buffered command
+    if( iCommandBuffer.iCommandId != KErrNotFound )
+        {
+        // We have a buffered command waiting
+        __PHONELOG( EBasic, EPhoneMediatorCenter, 
+            "CPhoneMediatorSender::VideoTelephonyCommandResponse - Buffered Command waiting" );
+        if( iCommandBuffer.iCommandId != aCommandId )
+            {
+            // And it's not identical to the command which response we now received
+            // so it's necessary to re-send it
+            __PHONELOG1( EBasic, EPhoneMediatorCenter, 
+                "CPhoneMediatorSender::VideoTelephonyCommandResponse - Resending command %d", iCommandBuffer.iCommandId );
+            IssueCommand( iCommandBuffer.iDomainUid,
+                          iCommandBuffer.iCategoryUid, 
+                          iCommandBuffer.iCommandId,
+                          iCommandBuffer.iVersion,
+                          KNullDesC8 );
+                          
+            ResetCommandBuffer();
+            }
+        }
+
+    if( ( aDomain == KMediatorVideoTelephonyDomain ) &&
+        ( aCategory == KCatPhoneToVideotelCommands ) )
+        {
+        VideoTelephonyCommandResponse( aCommandId );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::VideoTelephonyCommandResponse
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::VideoTelephonyCommandResponse( TInt aCommandId )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::VideoTelephonyCommandResponse( ) ");
+    __PHONELOG1( EBasic, EPhoneMediatorCenter, 
+        "VideoTelephonyCommandResponse aCommandId = %d", aCommandId );
+
+    switch( aCommandId )
+        {
+        case EVtCmdReleaseDataport:
+            __ASSERT_DEBUG( iShutdownCommand, Panic( EPhoneMediatorCenterParameterNotInitialized ) );
+            TRAP_IGNORE( iShutdownCommand->ExecuteLD());
+            break;
+            
+        default:
+            break;
+        }     
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::MapCallState
+// -----------------------------------------------------------------------------
+//
+TCallState CPhoneMediatorSender::MapCallState( const TInt aCallState ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::MapCallState( ) ");
+    TCallState callState( ECallStateUnknown );
+    
+    switch( aCallState )
+        {
+        case EPEStateUnknown:
+            callState = ECallStateUnknown;
+            break;
+            
+        case EPEStateIdle:
+            callState = ECallStateIdle;
+            break;
+            
+        case EPEStateDialing:
+            callState = ECallStateDialling;
+            break;
+            
+        case EPEStateEmergencyDialing:
+            callState = ECallStateEmergencyDialling;
+            break;
+            
+        case EPEStateRinging:
+            callState = ECallStateRinging;
+            break;
+            
+        case EPEStateConnecting:
+            callState = ECallStateConnecting;
+            break;
+            
+        case EPEStateConnected:
+            callState = ECallStateConnected;
+            break;
+            
+        case EPEStateHangingUp:
+            callState = ECallStateHangingUp;
+            break;
+            
+        case EPEStateHeld:
+            callState = ECallStateHeld;
+            break;
+            
+        case EPEStateAnswering:
+            callState = ECallStateAnswering;
+            break;
+            
+        case EPEStateRejecting:
+            callState = ECallStateRejecting;
+            break;
+            
+        case EPEStateDisconnecting:
+            callState = ECallStateDisconnecting;
+            break;
+            
+        default:
+            break;
+        }
+        
+    return callState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::MapCallType
+// -----------------------------------------------------------------------------
+//
+TCallType CPhoneMediatorSender::MapCallType( const TInt aCallType ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::MapCallType( ) ");
+    TCallType callType( ECallTypeUninitialized );
+    
+    switch( aCallType )
+        {
+        case EPECallTypeUninitialized:
+            callType = ECallTypeUninitialized;
+            break;
+            
+        case EPECallTypeCSVoice:
+            callType = ECallTypeCSVoice;
+            break;
+            
+        case EPECallTypeVideo:
+            callType = ECallTypeVideo;
+            break;
+            
+        case EPECallTypeVoIP:
+            callType = ECallTypeVoIP;
+            break;
+            
+        default:
+            break;
+        }
+        
+    return callType;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::ResetCommandBuffer
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::ResetCommandBuffer()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::ResetCommandBuffer( ) ");
+    TUid nullUid = TUid::Null();
+    iCommandBuffer.iCommandId = KErrNotFound;
+    iCommandBuffer.iDomainUid = nullUid;
+    iCommandBuffer.iCategoryUid = nullUid;
+    iCommandBuffer.iVersion = TVersion( KErrNotFound, KErrNotFound, KErrNotFound );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphonereleasecommand.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneReleaseCommand class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "phonelogger.h"
+#include "cphonereleasecommand.h"
+#include "pevirtualengine.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneReleaseCommand::CPhoneReleaseCommand
+// ---------------------------------------------------------
+//
+CPhoneReleaseCommand::CPhoneReleaseCommand( 
+    MPhoneEngineMessageSender& aEngineMessageSender ) : 
+    iEngineMessageSender( aEngineMessageSender )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneReleaseCommand::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneReleaseCommand::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneReleaseCommand::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneReleaseCommand* CPhoneReleaseCommand::NewL( 
+    MPhoneEngineMessageSender& aEngineMessageSender )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneReleaseCommand::NewL( ) ");
+    CPhoneReleaseCommand* self = new( ELeave ) 
+        CPhoneReleaseCommand( aEngineMessageSender );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneReleaseCommand::~CPhoneReleaseCommand
+// ---------------------------------------------------------
+//
+CPhoneReleaseCommand::~CPhoneReleaseCommand()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneReleaseCommand::ExecuteL
+// ---------------------------------------------------------
+//
+void CPhoneReleaseCommand::ExecuteLD()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, 
+        "CPhoneReleaseCommand::ExecuteL( ) ");
+    iEngineMessageSender.SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageRelease );
+    delete this;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphoneswitchtovideoorvoicecommand.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneSwitchToVideoOrVoiceCommand class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "phonelogger.h"
+#include "cphoneswitchtovideoorvoicecommand.h"
+#include "pevirtualengine.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneSwitchToVideoOrVoiceCommand::CPhoneSwitchToVideoOrVoiceCommand
+// ---------------------------------------------------------
+//
+CPhoneSwitchToVideoOrVoiceCommand::CPhoneSwitchToVideoOrVoiceCommand( 
+    MPhoneEngineMessageSender& aEngineMessageSender ) : 
+    iEngineMessageSender( aEngineMessageSender )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneSwitchToVideoOrVoiceCommand::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneSwitchToVideoOrVoiceCommand::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneSwitchToVideoOrVoiceCommand::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneSwitchToVideoOrVoiceCommand* CPhoneSwitchToVideoOrVoiceCommand::NewL( 
+    MPhoneEngineMessageSender& aEngineMessageSender )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneSwitchToVideoOrVoiceCommand::NewL( ) ");
+    CPhoneSwitchToVideoOrVoiceCommand* self = new( ELeave ) 
+        CPhoneSwitchToVideoOrVoiceCommand( aEngineMessageSender );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneSwitchToVideoOrVoiceCommand::~CPhoneSwitchToVideoOrVoiceCommand
+// ---------------------------------------------------------
+//
+CPhoneSwitchToVideoOrVoiceCommand::~CPhoneSwitchToVideoOrVoiceCommand()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneSwitchToVideoOrVoiceCommand::ExecuteL
+// ---------------------------------------------------------
+//
+void CPhoneSwitchToVideoOrVoiceCommand::ExecuteLD()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, 
+        "CPhoneSwitchToVideoOrVoiceCommand::ExecuteL( ) ");
+    iEngineMessageSender.SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageSwitchToVideoOrVoice );
+    delete this;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonemediatorcenter/src/cphoneterminateallconnectionscommand.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneTerminateAllConnectionsCommand class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "phonelogger.h"
+#include "cphoneterminateallconnectionscommand.h"
+#include "pevirtualengine.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneTerminateAllConnectionsCommand::CPhoneTerminateAllConnectionsCommand
+// ---------------------------------------------------------
+//
+CPhoneTerminateAllConnectionsCommand::CPhoneTerminateAllConnectionsCommand( 
+    MPhoneEngineMessageSender& aEngineMessageSender ) : 
+    iEngineMessageSender( aEngineMessageSender )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneTerminateAllConnectionsCommand::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneTerminateAllConnectionsCommand::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneTerminateAllConnectionsCommand::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneTerminateAllConnectionsCommand* CPhoneTerminateAllConnectionsCommand::NewL( 
+    MPhoneEngineMessageSender& aEngineMessageSender )
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneTerminateAllConnectionsCommand::NewL( ) ");
+    CPhoneTerminateAllConnectionsCommand* self = new( ELeave ) 
+        CPhoneTerminateAllConnectionsCommand( aEngineMessageSender );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneTerminateAllConnectionsCommand::~CPhoneTerminateAllConnectionsCommand
+// ---------------------------------------------------------
+//
+CPhoneTerminateAllConnectionsCommand::~CPhoneTerminateAllConnectionsCommand()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneTerminateAllConnectionsCommand::ExecuteL
+// ---------------------------------------------------------
+//
+void CPhoneTerminateAllConnectionsCommand::ExecuteLD()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, 
+        "CPhoneTerminateAllConnectionsCommand::ExecuteL( ) ");
+    iEngineMessageSender.SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageTerminateAllConnections );
+    delete this;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/bwins/PhoneRingingtonePlayeru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+EXPORTS
+	?StopPlaying@CPhoneRingingToneController@@QAEXXZ @ 1 NONAME ; void CPhoneRingingToneController::StopPlaying(void)
+	?PlayRingToneL@CPhoneRingingToneController@@QAEXPAVTPhoneCommandParam@@@Z @ 2 NONAME ; void CPhoneRingingToneController::PlayRingToneL(class TPhoneCommandParam *)
+	?NewL@CPhoneRingingToneController@@SAPAV1@XZ @ 3 NONAME ; class CPhoneRingingToneController * CPhoneRingingToneController::NewL(void)
+	?MuteRingingToneOnAnswer@CPhoneRingingToneController@@QAEXXZ @ 4 NONAME ; void CPhoneRingingToneController::MuteRingingToneOnAnswer(void)
+	?MuteRingingTone@CPhoneRingingToneController@@QAEXXZ @ 5 NONAME ; void CPhoneRingingToneController::MuteRingingTone(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/eabi/PhoneRingingtonePlayeru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,11 @@
+EXPORTS
+	_ZN27CPhoneRingingToneController11StopPlayingEv @ 1 NONAME
+	_ZN27CPhoneRingingToneController13PlayRingToneLEP18TPhoneCommandParam @ 2 NONAME
+	_ZN27CPhoneRingingToneController15MuteRingingToneEv @ 3 NONAME
+	_ZN27CPhoneRingingToneController23MuteRingingToneOnAnswerEv @ 4 NONAME
+	_ZN27CPhoneRingingToneController4NewLEv @ 5 NONAME
+	_ZTI17CPhoneAudioPlayer @ 6 NONAME ; #<TI>#
+	_ZTI17CPhoneRingingTone @ 7 NONAME ; #<TI>#
+	_ZTV17CPhoneAudioPlayer @ 8 NONAME ; #<VT>#
+	_ZTV17CPhoneRingingTone @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/group/bld.inf	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_EXPORTS
+
+
+PRJ_MMPFILES
+phoneringingtoneplayer.mmp
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/group/phoneringingtoneplayer.mmp	Fri Jun 04 10:19:18 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 <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY ALL -TCB
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          phoneringingtoneplayer.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x2002134E
+
+SOURCEPATH      ../src
+
+
+SOURCE          cphoneaudioplayer.cpp
+SOURCE          cphoneringingtone.cpp
+SOURCE          cphoneringingtonecontroller.cpp
+SOURCE          cphoneringingtoneplayer.cpp 
+SOURCE          cphonettsplayer.cpp
+
+/* Languages */
+LANG SC
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../phoneuiqtviewadapter/inc
+USERINCLUDE     ../../phoneuicontrol/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui2/srcdata
+USERINCLUDE     ../../phonemediatorcenter/inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+SYSTEMINCLUDE   /epoc32/include/mda/client
+SYSTEMINCLUDE   /epoc32/include/mmf/common
+SYSTEMINCLUDE   /epoc32/include/mmf/server
+
+LIBRARY         phoneuiutils.lib
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib               // TParse
+LIBRARY         ecom.lib                // for CSFIUtilsPhoneInterface plugin
+LIBRARY         apgrfx.lib              // Apa server
+LIBRARY         mediaclient.lib
+LIBRARY         mediaclientaudio.lib
+LIBRARY         drmhelper.lib
+LIBRARY         apmime.lib
+LIBRARY         caf.lib
+LIBRARY         charconv.lib            // UTF-8 conversion for the TTS
+LIBRARY         featmgr.lib             // FeatureManager
+LIBRARY         mediatorclient.lib
+LIBRARY         audiooutputrouting.lib  // Ringingtone output
+LIBRARY         platformenv.lib         // PathInfo
+LIBRARY         cone.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/cphoneaudioplayer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,355 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPHONEAUDIOPLAYER_H
+#define CPHONEAUDIOPLAYER_H
+
+// System includes
+#include <e32base.h>
+#include <mdaaudiosampleplayer.h>
+#include <mdaaudiotoneplayer.h>
+
+// Forward declarations
+class MPhoneAudioPlayerObserver;
+class C3DRingingToneInterface;
+class CPhoneRingingTone;
+class CAudioOutput;
+ 
+/**
+*  Audio player for playing audio sample or tone file. 
+*
+*  @since 1.0
+*/
+class CPhoneAudioPlayer :
+    public CBase,
+    private MMdaAudioPlayerCallback,
+    private MMdaAudioToneObserver
+    {
+    public:
+
+        enum TAudioPlayerStatus
+            {
+            EToneLoading,
+            EToneReady,
+            ETonePlaying
+            };
+
+        enum TRingingType
+            {
+            ETypeRinging,
+            ETypeRingingOnce,
+            ETypeAscending
+            };
+
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aRingingTone The ringing tone
+        * @param aPriority The priority for the playing
+        * @param aPreference The preference value
+        * @param aObserver Audio player observer
+        * @param aId The id of this audio player
+        * @param aMdaServer The reference to media server
+        * @param aExtSecNeeded ETrue if DRM extend security is needed
+        * @return The instance of the audio player.
+        */
+        static CPhoneAudioPlayer* NewL( 
+            const CPhoneRingingTone& aRingingTone, 
+            TInt aPriority, 
+            TUint aPreference,
+            MPhoneAudioPlayerObserver& aObserver, 
+            TInt aId = 0,
+            CMdaServer* aMdaServer = NULL,
+            TBool aExtSecNeeded = EFalse );
+
+        /**
+        * Two-phased constructor.
+        * @param aRingingTone The ringing tone
+        * @param aPriority The priority for the playing
+        * @param aPreference The preference value
+        * @param aObserver Audio player observer
+        * @param aId The id of this audio player
+        * @param aMdaServer The reference to media server
+        * @param aExtSecNeeded ETrue if DRM extend security is needed
+        * @return The instance of the audio player. NULL if the function fails.
+        */
+        static CPhoneAudioPlayer* New( 
+            const CPhoneRingingTone& aRingingTone, 
+            TInt aPriority, 
+            TUint aPreference,
+            MPhoneAudioPlayerObserver& aObserver, 
+            TInt aId = 0,
+            CMdaServer* aMdaServer = NULL,
+            TBool aExtSecNeeded = EFalse );
+            
+        /**
+        * Two-phased constructor.
+        * @param aFileName The ringing tone file name.
+        * @param aPriority The priority for the playing
+        * @param aPreference The preference value
+        * @param aObserver Audio player observer
+        * @param aId The id of this audio player
+        * @param aMdaServer The reference to media server
+        * @param aExtSecNeeded ETrue if DRM extend security is needed
+        * @return The instance of the audio player.
+        */
+        static CPhoneAudioPlayer* NewL( 
+            const TDesC& aFileName, 
+            TInt aPriority, 
+            TUint aPreference,
+            MPhoneAudioPlayerObserver& aObserver, 
+            TInt aId = 0,
+            CMdaServer* aMdaServer = NULL,
+            TBool aExtSecNeeded = EFalse );            
+
+        /**
+        * Two-phased constructor, take audio from descriptor.
+        *
+        * @param aSequence sequence to be played.
+        * @param aPriority priority of tone.
+        * @param aPreference preference of tone.
+        * @param aObserver observer.
+        * @param aId identifier, used in observer interface 
+        *            calls.
+        * @param aMdaServer The reference to media server
+        */
+        static CPhoneAudioPlayer* NewSeqL(
+            const TDesC8& aSequence,
+            TInt aPriority,
+            TUint aPreference,
+            MPhoneAudioPlayerObserver& aObserver, 
+            TInt aId = 0,
+            CMdaServer* aMdaServer = NULL );
+         
+        /**
+        * Two-phased constructor, takes Text-To-Speech text to be played.
+        * @since Series 60 3.0
+        * @param aText Text to be pronounced.
+        * @param aPriority priority of tone.
+        * @param aPreference preference of tone.
+        * @param aObserver observer.
+        * @param aId identifier, used in observer interface 
+        *            calls.
+        */        
+        static CPhoneAudioPlayer* NewTtsL(
+            const TDesC& aText,
+            TInt aPriority,
+            TUint aPreference,
+            MPhoneAudioPlayerObserver& aObserver, 
+            TInt aId = 0);
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneAudioPlayer();
+       
+    public: // new function
+
+        /**
+        * Play the audio file or tone
+        * @param aRingingType 
+        * @param aVolume take value from 1 to 10
+        * @param aTTsToBePlayed
+        */
+        void Play(
+            TRingingType aRingType,
+            TInt aVolume,
+            TBool aTTsToBePlayed );
+
+        /**
+        * Stop current file playing
+        */
+        void StopPlaying();
+        
+          
+        /**
+        * Sets new volumes and ramptimes.
+        * @param aVolume -volume to be set
+        * @param aRamptime -ramptime to be set.
+        */           
+        void SetNewVolumeAndRamptime( TInt aVolume, TInt aRamptime );
+        
+        /**
+        * Re starts playing.
+        */
+        void ReStartPlaying();
+        /**
+        * Enable or disable TTs playing.
+        * @param aTTsToBePlayed
+        */
+        void SetTTsToBePlayed( TBool aTTsToBePlayed );
+        
+        /**
+        * Sets volume level to zero.
+        * @since Series 60 3.1
+        */  
+        void MutePlaying();
+      
+
+    private: //from base class
+
+        /**
+        * from MMdaAudioPlayerCallback
+        */
+        virtual void MapcInitComplete(
+            TInt aError, 
+            const TTimeIntervalMicroSeconds& aDuration );
+
+        /**
+        * from MMdaAudioPlayerCallback
+        */
+        virtual void MapcPlayComplete( TInt aError );
+
+        /**
+        * from MMdaAudioToneObserver
+        */
+        virtual void MatoPrepareComplete(TInt aError);
+
+        /**
+        * from MMdaAudioToneObserver
+        */
+        virtual void MatoPlayComplete(TInt aError);
+        
+    private:
+
+        enum TAudioDataFormat
+            {
+            EFormatTone,
+            EFormatSample,
+            EFormatTts // Text-To-Speech
+            };
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneAudioPlayer( 
+            TAudioDataFormat aDataFormat,
+            MPhoneAudioPlayerObserver& aObserver, 
+            TInt aPriority, 
+            TUint aPreference,
+            TInt aId );
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL( 
+            const TDesC& aFileName, CMdaServer* aMdaServer );
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructSeqL( 
+            const TDesC8& aSequence,
+            CMdaServer* aMdaServer ); 
+
+        /**
+        * Symbian OS constructor for the Text-To-Speech option
+        * @since Series 60 3.0
+        */
+        void ConstructTtsL( 
+            const TDesC& aTtsText, 
+            TInt aPriority,
+            TUint aPreference );
+
+        /**
+        * Do the playing stuff
+        */
+        void DoPlay();
+
+        /**
+        * Ser tinging type properties
+        */
+        void SetRingingTypeProperties();
+
+        /**
+        * Call back function for timer
+        */
+        static TInt TimerCallBack( TAny* aAny );
+
+        /**
+        * Handle timer events
+        */
+        void HandleTimerEvent();
+        
+        /*
+        * Convert volume to the scale used by hardware
+        * @param aVolume volume to be altered
+        * @return TInt   new volume
+        */
+        TInt ConvertVolume( TInt aVolume );
+
+    private:    // Data  
+
+        // The format of audio data, audio sample file or tone file
+        TAudioDataFormat iFormat;
+
+        // Observer for error handling
+        MPhoneAudioPlayerObserver& iObserver;
+
+        // Priority. It's only used in playing tone file
+        const TInt iPriority; 
+        // Preference. Only used for tone file
+        const TUint iPreference; 
+
+        // Identifier number
+        TInt iId;
+
+        // Player for tone file.
+        CMdaAudioToneUtility* iTonePlayer;
+
+        // Player for audio file.
+        CMdaAudioPlayerUtility* iSamplePlayer;
+
+        // Player for the Text-To-Speech texts
+        CMdaAudioPlayerUtility* iTtsPlayer;
+
+        // The status of the player
+        TAudioPlayerStatus iPlayerStatus;
+
+        // How does the file played. It's only used if the player
+        // is playing the file
+        TRingingType iRingType;
+
+        // Volume
+        TInt iVolume;
+
+        // For ascending and descending used for set current volume
+        TInt iCurrentVolume;
+
+        // Used by sample player
+        TBool iToBePlaying;
+
+        // Store for sequence.
+        HBufC8* iSequence;
+        
+        // Store for the TTS source string
+        HBufC8* iTtsText;
+
+        // 3D Audio ringing tone plugin
+        C3DRingingToneInterface* i3DPlugin;
+        
+        // Flag to  indicate whether we need to play TTs or not
+        TBool iTTsToBePlayed;
+        
+        // Ringingtone output
+        CAudioOutput* iAudioOutput; 
+    };
+
+#endif      // CPHONEAUDIOPLAYER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/cphoneringingtone.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef CPHONERINGINGTONE_H
+#define CPHONERINGINGTONE_H
+
+// INCLUDES
+#include <e32base.h>
+#include <Profile.hrh>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Ringing tone
+*  Wrapper for file name. In addtion, provides methods
+*  for ringing tone type identification. 
+*
+*  @lib Phone.app
+*  @since Series 60 3.1
+*/
+class CPhoneRingingTone : public CBase
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aFileName Ringing tone file name with path.
+        * @param aDrmInPlayback ETrue to use IsFileDrmProtected().
+        */
+        static CPhoneRingingTone* NewL( 
+            const TDesC& aFileName,
+            TBool aDrmInPlayback = EFalse );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneRingingTone();
+
+    public: // New functions
+        
+        
+        /**
+        * Sets the file name including path.
+        * @since Series 60 3.1
+        * @param aFileName file name plus path.
+        */
+        void SetFileName( const TDesC& aFileName );
+        
+        /**
+        * Returns file name including path.
+        * @since Series 60 3.1
+        * @return File name.
+        */
+        const TDesC& FileName() const;
+        
+        /**
+        * Returns MIME type.
+        * @since Series 60 3.1
+        * @return MIME type.
+        */
+        const TDesC& MimeType() const;
+        
+        /**
+        * Checks if video ringing tone.
+        * @since Series 60 3.1
+        * @return ETrue if video ringing tone.
+        */
+        TBool IsVideoRingingTone();
+        
+        /**
+        * Checks if the file is a DCF file.
+        * @since Series 60 3.1
+        * @return ETrue if files is DRM protected.
+        */
+        TBool IsFileDrmProtected() const;
+        
+        /**
+        * Checks if the file is in ROM.
+        * @since Series 60 3.1
+        */
+        TBool IsFileInRom() const;
+
+        /**
+        * Set profile's ringing type  
+        * @since Series 60 5.0
+        */        
+        void SetRingingType( TProfileRingingType aRingingType);
+
+        /**
+        * Return ringing type of current ringingtone  
+        * @since Series 60 5.0
+        */            
+        TProfileRingingType RingingType() const;        
+        
+        /**
+        * Set profile's ringingtone volume  
+        * @since Series 60 5.0
+        */            
+        void SetVolume( const TInt aVolume );
+        
+        /**
+        * Return volume of current ringingtone  
+        * @since Series 60 5.0
+        */         
+        TInt Volume() const;
+        
+        /**
+        * Set profile's TTS value
+        * @since Series 60 5.0
+        */         
+        void SetTtsToneToBePlayed( TBool aTtsToneToBePlayed );
+
+        /**
+        * Return TTS status of current profile  
+        * @since Series 60 5.0
+        */         
+        TBool TtsToneToBePlayed() const;       
+        
+        /**
+        * Checks if ringing tone file's size is larger than the size limit.
+        * If size limit is exceeded, default tone is played instead.
+        * @since 3.1
+        * @param aRingingTone  Tone to check.
+        * @return EFalse if the limit was exceeded and thus default tone played.
+        *         ETrue  if tone file's size was valid and the checked tone 
+        *                can be played.
+        */
+        TBool CheckAndHandleToneSizeLimit();
+        
+        /**
+        * Checks if ringing tone file's size is larger than the size limit.
+        * @since 3.1
+        * @param aFile   File to check.
+        *        aSizeLimitKB  the size limit in kB is set to this variable.
+        * @return KErrNone        if the file can be used as a ringing tone.
+        *         KErrTooBig        if the file size limit is exceeded.
+        *         Other error value if error happened during size checking.
+        */
+        TInt CheckToneFileSize( const TDesC& aFile, TInt aSizeLimitKB );
+        
+        /**
+        * Reads from central repository the file size limit of following tones:
+        * -contact's personal ringing tone
+        * -voice call line1
+        * -voice call line2
+        * Value 0 means all sizes are allowed.
+        * @since 3.1
+        * @return leaves on error.
+        */
+        void GetMaxToneFileSize();      
+        
+    private:
+
+        /**
+        * Refresh MIME type. This must be called
+        * before using MimeType().
+        */
+        TInt RefreshMime();    
+        
+        /**
+        * Refresh MIME type.
+        */
+        void RefreshMimeL();
+        
+        /**
+        * Checks if file is located in video directory.
+        */
+        TBool IsFileInVideoDirectory() const;
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneRingingTone( TBool aDrmInPlayback );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( const TDesC& aFileName );
+
+    private:    // Data
+
+        // File name with path
+        HBufC* iFileName;
+        
+        // MIME type
+        HBufC* iMimeType;
+        
+        // Extended security
+        TBool iDrmInPlayback;
+        
+        TProfileRingingType iRingingType;
+    
+        TInt iVolume;
+        
+        // Voice call ringing tone file size max value.
+        TInt iToneFileSizeLimitKB;
+        
+        TBool iTtsToneToBePlayed;
+    };
+
+#endif      // CPHONERINGINGTONE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/cphoneringingtonecontroller.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef CPHONERINGINGTONECONTROLLER_H
+#define CPHONERINGINGTONECONTROLLER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <Profile.hrh>
+#include "mphoneaudioplayerobserver.h"
+#include "mphonevideoplayerobserver.h"
+#include "mphonecoveruiobserver.h"
+#include "cphoneaudioplayer.h"
+#include "mphonetimer.h"
+#include "mphonevideoplayer.h"
+#include "cphonemediatorsender.h"
+
+// FORWARD DECLARATIONS
+//class MPhoneRingingToneObserver;
+class CPhoneAudioPlayer;
+class CPhoneRingingtonePlayer;
+class CPhoneTTSPlayer;
+class MPhoneDisplayProvider;
+class CPhoneRingingTone;
+class TPhoneCommandParam;
+
+// CLASS DECLARATION
+
+/**
+* It implements ringing tone functionality. 
+* Note that when issuing Play-command to audio side, ALWAYS set the tone type
+* before the Play() is called. This is to ensure that correct tone is tried to
+* be played. 
+*
+* @since 1.0
+*/
+NONSHARABLE_CLASS(CPhoneRingingToneController) :
+    public CBase,
+    private MPhoneVideoPlayerObserver,
+    private MPhoneCoverUiObserver
+    {
+    public:
+        // States for this active object
+        enum TState
+            {
+            EIdleState,  
+            EDeletingAudioPlayer,
+            EDeletingVideoPlayer,
+            EPlayingDefaultVideo
+            };
+
+    public:
+        
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        IMPORT_C static CPhoneRingingToneController* NewL();
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneRingingToneController();
+
+        /**
+        * Play ring tone
+        * @param aCommandParam a command param
+        */
+        IMPORT_C void PlayRingToneL( TPhoneCommandParam *aCommandParam );
+
+        /**
+        * Stops playing the ringing tone.
+        * Method does not do anything if ringing tone is not playing.
+        */
+        IMPORT_C void StopPlaying();
+
+        /**
+        * Continues video playback ( and ringing tone ) with volume 0
+        * Stream not closed ( If music player was ongoing ) 
+        */
+        IMPORT_C void MuteRingingToneOnAnswer();
+          
+        /**
+        * Continues video playback with muted audio.
+        * Ringing tone is stopped.
+        */
+        IMPORT_C void MuteRingingTone();
+        
+          
+        /**
+        * Sets video player.
+        * @since Series 60 v3.2
+        * @param aVideoPlayer Video player reference.
+        */
+        void SetVideoPlayer( MPhoneVideoPlayer* aVideoPlayer );
+
+        /**
+        * Play video ring tone.
+        * @since Series 60 3.1
+        * @param aRingingTone Ringing tone to be played.
+        * @param aVolume Volume used to play the ringing tone.
+        * @param aRingingType Ringing type.
+        */
+        void PlayVideoRingingTone( 
+            const CPhoneRingingTone& aRingingTone, 
+            TInt aVolume, 
+            TProfileRingingType aRingingType,
+            TBool aPersonalTone = EFalse );
+
+        /**
+        * Checks if extended security required.
+        * @since Series 60 3.1
+        * @return ETrue if extended security is required.
+        */
+        TBool ExtendedSecurity() const;
+   
+   
+        /**
+        * Command when necessary Cover UI to play video ringing tone.
+        * return ETrue if Cover ui handle video ringing tone playing.
+        * return EFalse if Phone must handle video ringing tone playing.
+        */
+        TBool CoverUIPlayVideoRingingToneL( 
+            const CPhoneRingingTone& aRingingTone );
+
+        /**
+        * This function is called when Mediator receives response to the sent
+        * ShowMultiMediaRingingTone command.
+        * @param aStatus - Standard Symbian error code indicating the
+        *                  success of the command.
+        */
+        void ShowMultimediaRingingToneResponseL( TInt aStatus );
+
+    private: // from MPhoneVideoPlayerObserver
+
+        /**
+        * HandleVideoPlayerError
+        */
+        virtual void HandleVideoPlayerError( 
+            TPhoneVideoPlayerErrorEvent aEvent,
+            TInt aError );
+
+        /**
+        * HandleVideoPlayerInitComplete
+        */
+        virtual void HandleVideoPlayerInitComplete();
+
+        /**
+        * HandleVideoPlayerPlayingComplete
+        */
+        virtual void HandleVideoPlayerPlayingComplete();
+   
+    private: 
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneRingingToneController();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+
+        /**
+        * Convert ringing type from PhoneAppEnging to the ringing type in 
+        * MPhoneVideoPlayer.
+        * @since Series 60 3.1
+        * @param aRingingType the ringing type form PhoneAppEngine.
+        * @return ringing type of MPhoneVideoPlayer.
+        */
+        MPhoneVideoPlayer::TPlayMode ConvertVideoRingingType(
+            TProfileRingingType aRingingType );
+
+
+       /**
+        * Plays default L1 or L2 video ring tone asynchronously.
+        * @since Series 60 3.1
+        */
+        void PlayDefaultVideoAsync();
+
+        /**
+        * Deletes video player and plays default L1 or L2
+        * tone asynchronously.
+        * @since Series 60 3.1
+        */
+        void DeleteVideoPlayerAndPlayDefaultAsync();
+        
+        /**
+        * Mutes the ringing tone.
+        */
+        void DoMuteRingingTone();
+        
+        /**
+        * Play audio ring tone 
+        */
+        void PlayAudioRingTone( 
+            TInt aVolume, 
+            TProfileRingingType aRingingType );
+        
+
+    private:    // Data
+
+        // Audio/Video tone
+        CPhoneRingingTone* iAudioVideoRingingTone;
+
+        // Volume for backup tone playing.
+        TInt iVolume;
+
+        // Ringing type for backup tone playing.
+        TProfileRingingType iRingingType;
+
+        // Video ringing tone player
+        MPhoneVideoPlayer* iVideoPlayer;
+
+        // Pointer to Mediator Sender
+        CPhoneMediatorSender* iMediatorSender;
+
+        // Active Cover UI command EPhoneCoverUiShowMultimediaRingingTone
+        TBool iActiveCoverUICommand;
+        
+        // Flag. Indicates video scaling capability of the device.
+        TBool iArbitraryVideoScaling;
+        
+        CPhoneRingingtonePlayer* iRingingtonePlayer;
+        
+        CPhoneTTSPlayer* iTTSPlayer; 
+
+    };
+
+#endif      // CPHONERINGINGTONECONTROLLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/cphoneringingtoneplayer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,371 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPHONERINGINGTONEPLAYER_H_
+#define CPHONERINGINGTONEPLAYER_H_
+
+// System includes
+#include <e32base.h>
+#include <Profile.hrh>
+
+// User includes
+#include "mphoneaudioplayerobserver.h"
+#include "cphoneaudioplayer.h"
+#include "mphonevideoplayer.h"
+#include "mphonecenrepobserver.h"
+#include "mphonetimer.h"
+
+// Forward declarations
+class CPhoneTimer;
+class CPhoneRingingTone;
+
+
+NONSHARABLE_CLASS(CPhoneRingingtonePlayer) : public CActive,
+                                             public MPhoneAudioPlayerObserver,
+                                             public MPhoneCenRepObserver,
+                                             private MPhoneTimer
+    {
+public:
+    CPhoneRingingtonePlayer();
+    virtual ~CPhoneRingingtonePlayer();
+    
+    
+    /**
+    * Two-phased constructor.
+    * @return new instance.
+    */
+     static CPhoneRingingtonePlayer* NewL();
+    
+     /**
+      * Playing ringing tone based on profile.
+      * @param aAudioVideoRingingTone
+      */     
+     void PlayProfileBasedTone( CPhoneRingingTone* aAudioVideoRingingTone );   
+     
+    /**
+     * Playing the Beep once.
+     * @param aVolume volume used to play the ringing tone.
+     */
+     void PlayBeepOnce( TInt aVolume );
+
+     /**
+     * Play silent tone. No_sound.wav will be played. If vibration alert
+     * is ON, it will vibrate.
+     */
+     void PlaySilentTone();
+
+     /**
+     * Play video ring tone.
+     * @since Series 60 3.1
+     * @param aRingingTone Ringing tone to be played.
+     * @param aVolume Volume used to play the ringing tone.
+     * @param aRingingType Ringing type.
+     */
+     void PlayVideoRingingTone( 
+         const CPhoneRingingTone& aRingingTone, 
+         TInt aVolume, 
+         TProfileRingingType aRingingType,
+         TBool aPersonalTone = EFalse );
+     
+     /**
+     * Play default tone.
+     * @param aVolume volume used for the playing.
+     * @param aRingingType ringing type.
+     */
+     void PlayDefaultTone( 
+         TInt aVolume, 
+         TProfileRingingType aRingingType );
+
+     /**
+     * Play backup tone.
+     * @param aVolume volume used for the playing.
+     * @param aRingingType ringing type.
+     */
+     void PlayBackupTone( 
+         TInt aVolume, 
+         TProfileRingingType aRingingType );
+     
+     /**
+     * Stops playing the ringing tone.
+     * Method does not do anything if ringing tone is not playing.
+     */
+     void StopPlaying();
+     
+     /** 
+     * Enumerates identifiers for each player:
+     * EPlayerAudio - audio
+     * EPlayerBeepOnce - beep once
+     * EPlayerSilent - silent
+     * EPlayerDefault - default
+     * EPlayerBackup - backup
+     *
+     * EPlayerFirst and EPlayerLast are alias
+     * to other identifiers.
+     * EPlayerFirst - first player
+     * EPlayerLast - last player
+     */
+     enum TPlayerId
+         {
+         EPlayerFirst,
+         EPlayerAudio = EPlayerFirst,
+         EPlayerBeepOnce,
+         EPlayerSilent,
+         EPlayerDefault,
+         EPlayerBackup,
+         EPlayerTts, 
+         EPlayerLast = EPlayerTts,
+         EPlayerCount
+         };     
+     
+     CPhoneAudioPlayer* GetCurrentlyActiveAudioPlayer();
+     
+     void MuteActiveAudioPlayer();
+   
+public: // From MPhoneCenRepObserver
+
+    /**
+    * Handle the change of the setting from Central Repository
+    * @param aUid identifing the central repository UID.
+    * @param aId central repository ID.
+    */
+    virtual void HandleCenRepChangeL( 
+        const TUid& aUid,
+        const TUint aId );
+
+   
+     
+private:
+    
+    /**
+    * By default Symbian OS constructor is private.
+    */
+    void ConstructL();
+
+private: // CActive
+    
+    /**
+    * @see CActive::RunL.
+    */
+    void RunL();
+
+    /**
+    * @see CActive::DoCancel.
+    */
+    void DoCancel();
+    
+private: // from MPhoneAudioPlayerObserver
+    /**
+    * Handle the error of audio file player.
+    */
+    virtual void HandleAudioPlayerError( 
+        TPhoneAudioPlayerErrorEvent aEvent, 
+        TInt aError, 
+        TInt aId = KPhoneAudioPlayerNotSpecified );
+
+    /**
+    * Handle audio player initialize complete.
+    */
+    virtual void HandleAudioPlayerInitComplete(
+        TInt aId = KPhoneAudioPlayerNotSpecified );
+
+    /**
+    * Handle auido file playing complete successfully.
+    */
+    virtual void HandlePlayingComplete( 
+        TInt aId = KPhoneAudioPlayerNotSpecified );    
+ 
+private:
+    
+    /**
+    * @see MPhoneTimer
+    */
+    virtual void HandleTimeOutL();
+    
+private:    
+    
+
+    // Indicate which tone is playing or need to be played:
+    // EIdle - idle,
+    // EAudioTonePlaying - audio playing,
+    // EBeepOnce - beep once playing,
+    // ESilentTonePlaying - silent tone playing,
+    // EDefaultTonePlaying - default tone playing,
+    // EBackupTonePlaying - backup tone playing,
+    // EVideoTonePlaying - playing video ringing tone
+    // ESilentVideoTonePlaying  - silent playing video ringing tone
+    // EPersonalVideoTonePlaying - personal playing video ringing tone
+    enum TTonePlayingStatus
+        {
+        EIdle,
+        EAudioTonePlaying,
+        EBeepOnce,
+        ESilentTonePlaying,
+        EDefaultTonePlaying,
+        EBackupTonePlaying,
+        EVideoTonePlaying,
+        ESilentVideoTonePlaying,
+        EPersonalVideoTonePlaying
+        };
+    
+    // States for this active object
+    enum TState
+        {
+        EIdleState,  
+        EDeletingAudioPlayer,
+        EDeletingVideoPlayer,
+        EPlayingDefaultVideo
+        };
+    
+    /**
+    * Deletes player asynchronoysly.
+    * @param aPlayer player to be deleted.
+    */
+    void DeletePlayerAsync(
+        TPlayerId aPlayer );
+    
+    /**
+    * Construct sequence players.
+    * @param aPlayer player to be constructed.
+    */
+    void ConstructSequencePlayer(
+        TPlayerId aPlayer );
+
+    /**
+    * Construct sequence players.
+    * @param aPlayer player to be constructed.
+    */
+    void ConstructSequencePlayerL(
+        TPlayerId aPlayer );     
+    
+    /**
+    * Construct backup tone player.
+    */
+    TInt ConstructBackupPlayer();
+    
+
+    /**
+    * Construct media server and backup tone player.
+    */
+    void ConstructBackupPlayerL();
+    
+    /**
+    * Default ringingtone from profile engine.
+    */
+    void ConstructDefaultPlayerL();
+      
+    /**
+    * Do construct tone.
+    * @param aRingingTone Ringing tone.
+    * @return The instance of the player. NULL is returned if it's failed.
+    */
+    CPhoneAudioPlayer* ConstructTonePlayer( 
+        const CPhoneRingingTone& aRingingTone,
+        TInt aId );
+    
+    /**
+    * Convert ringing type from PhoneAppEnging to the ringing type in 
+    * CPhoneAudioPlayer.
+    * @param aRingingType the ringing type form PhoneAppEngine.
+    * @return ringing type of CPhoneAudioPlayer.
+    */
+    CPhoneAudioPlayer::TRingingType ConvertRingingType(
+        TProfileRingingType aRingingType );
+
+    /**
+    * Convert ringing type from PhoneAppEnging to the ringing type in 
+    * MPhoneVideoPlayer.
+    * @since Series 60 3.1
+    * @param aRingingType the ringing type form PhoneAppEngine.
+    * @return ringing type of MPhoneVideoPlayer.
+    */
+    MPhoneVideoPlayer::TPlayMode ConvertVideoRingingType(
+        TProfileRingingType aRingingType );      
+
+    /**
+    * Cleanup players.
+    */
+    void CleanupPlayers();   
+    
+    /**
+    * Handle audio player error.
+    * @param aDelete ETrue if deletion of the player allowed, 
+    *                EFalse otherwise.
+    * @param aSync ETrue if synchronous deletion of players is allowed,
+    *              EFalse otherwise.
+    */
+    void DoHandlePlayerError(
+        TBool aDelete,
+        TBool aSync );
+    
+
+private:    // Data
+    
+    
+    // State of this active object
+    TState iState;
+    
+    // Player to be deleted asynchronously.
+    RPointerArray<CPhoneAudioPlayer> iAsyncDeletePlayers;
+    
+    // Current playing status.
+    TTonePlayingStatus iTonePlayingStatus;
+    
+    // Voice call ringing tone file size max value.
+    TInt iToneFileSizeLimitKB;   
+    
+    // DRM extend security
+    TBool iExtSecNeeded;
+    
+    // Volume for backup tone playing.
+    TInt iVolume;
+    
+    // Ringing type for backup tone playing.
+    TProfileRingingType iRingingType;
+    
+    // Audio ring tone player. Memory allocated during construction.
+    // After constructed, no leave may be caused during audio playing
+    CPhoneAudioPlayer* iAudioPlayer;
+
+    // Audio player for beep once.
+    CPhoneAudioPlayer* iBeepOncePlayer;
+
+    // Audio player for silent tone.
+    CPhoneAudioPlayer* iSilentPlayer;
+
+    // Default player.
+    CPhoneAudioPlayer* iDefaultPlayer;
+    
+    // Tts player.
+    CPhoneAudioPlayer* iTtsPlayer;
+
+    // Backup ringing tone. Incase all default player failed.
+    CPhoneAudioPlayer* iBackupPlayer;
+    
+    // Default player
+    CPhoneRingingTone* iDefaultRingingTone;     
+    
+    // Media server.
+    CMdaServer* iMdaServer;
+    
+    // Timer.
+    CPhoneTimer* iTimer;
+    
+    // Audio/Video tone
+    CPhoneRingingTone* iAudioVideoRingingTone;
+    };
+
+#endif /* CPHONERINGINGTONEPLAYER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/cphonettsplayer.h	Fri Jun 04 10:19:18 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 CPHONETTSPLAYER_H_
+#define CPHONETTSPLAYER_H_
+
+// System includes
+#include <e32base.h>
+#include <Profile.hrh>
+
+// User includes
+#include "cphonetimer.h"
+#include "cphoneaudioplayer.h"
+#include "mphoneaudioplayerobserver.h"
+
+// Forward declarations
+class CPhoneRingingTone;
+class CPhoneRingingtonePlayer;
+
+NONSHARABLE_CLASS(CPhoneTTSPlayer): public CBase,
+                        public MPhoneAudioPlayerObserver
+                       
+    {
+public:
+    CPhoneTTSPlayer(CPhoneRingingtonePlayer* aRingingtonePlayer);
+    virtual ~CPhoneTTSPlayer();
+    
+    /**
+    * Two-phased constructor.
+    * @return new instance.
+    */
+     static CPhoneTTSPlayer* NewL(CPhoneRingingtonePlayer* aRingingtonePlayer);
+    
+     
+public:
+    
+    /**
+    * Play TTS tone simultaneously with Personal or Default tones.
+    * This method does not command phone to play TTS immediately. Instead 
+    * it registers a request to play TTS, when Personal or default tones 
+    * are played.
+    *
+    * @since Series 60 3.0
+    * @param aTextToSay Text, that should be pronounced by the 
+    * Text-To-Speech engine. This is normal descriptor, no UTF-8 
+    * and no "(tts)" prefix
+    */
+    void PlayTtsTone(
+        const TDesC& aTextToSay,
+        CPhoneRingingTone* aAudioVideoRingingTone );
+    
+    void StopPlaying();
+   
+    
+    /**
+    * Checks if TTS component should be played for the current ringtone 
+    * playback and initializes the TTS playback. This method is to be 
+    * called from within PlayXXXXTone methods
+    * @since Series 60 3.0
+    * @param aRingingType ringing type
+    */
+    void AddTtsPlaybackIfNeeded();
+    
+    
+private: // from MPhoneAudioPlayerObserver
+    /**
+    * Handle the error of audio file player.
+    */
+    virtual void HandleAudioPlayerError( 
+        TPhoneAudioPlayerErrorEvent aEvent, 
+        TInt aError, 
+        TInt aId = KPhoneAudioPlayerNotSpecified );
+
+    /**
+    * Handle audio player initialize complete.
+    */
+    virtual void HandleAudioPlayerInitComplete(
+        TInt aId = KPhoneAudioPlayerNotSpecified );
+
+    /**
+    * Handle auido file playing complete successfully.
+    */
+    virtual void HandlePlayingComplete( 
+        TInt aId = KPhoneAudioPlayerNotSpecified );  
+    
+private:
+    
+    /**
+    * Enumerates how many times TTs is played
+    * ESaidOnce -once
+    * ESaidTwice twice 
+    */    
+    enum TTtsStatus
+        {
+        ESaidOnce,
+        ESaidTwice
+        };
+    
+    /**
+    * Wrapper of DoHandleTtsDelayTimeout, that can be used as TCallback. 
+    * Immediately passes control to DoHandleTtsDelayTimeout method.
+    * @since Series 60 3.0
+    * @param object Object to call DoHandleTtsDelayTimeout() on, . 
+    *        instance of CPhoneRingingTonePlayer.
+    * @return KErrNone.
+    */
+    static TInt HandleTtsDelayTimeout( TAny* object );
+    
+    /**
+    * It is called after TTS delay elapsed. Starts playing TTS.
+    */
+    void DoHandleTtsDelayTimeout();
+         
+    /**
+    * Returns currently active player which is used with TTS player.
+    * @return pointer to CPhoneAudioPlayer.
+    */
+    CPhoneAudioPlayer* GetCurrentlyActiveAudioPlayerWithTTs();   
+     
+    /**
+    * TTs cases only. Calculates new volume and ramptimes
+    * for Ascending TTS ringing case and normal TTS ringing case.
+    * @param aStatus -status of TTs player.
+    */         
+    void SolveNewVolumeAndRamptime( TTtsStatus aStatus );   
+    
+    /**
+    * Retarts currently active ringingtone player.
+    */
+    void ReStartRingingTonePlayer();
+    
+    /**
+    * Convert ringing type from PhoneAppEnging to the ringing type in 
+    * CPhoneAudioPlayer.
+    * @param aRingingType the ringing type form PhoneAppEngine.
+    * @return ringing type of CPhoneAudioPlayer.
+    */
+    CPhoneAudioPlayer::TRingingType ConvertRingingType(
+        TProfileRingingType aRingingType );    
+        
+private:
+    
+    /**
+    * By default Symbian OS constructor is private.
+    */
+    void ConstructL();
+    
+private: 
+    
+    // Tts player.
+    CPhoneAudioPlayer* iTtsPlayer;
+    
+    // True if Tts is currently playing. Is different from 
+    // iTonePlayingStatus, because TTS is played in
+    // parallel with the other tone types
+    TBool iTtsTonePlaying;
+    
+    // Index of the TTS delay that is "executed" currently or is to be 
+    // "executed" after the current playing of the TTS tone. Is zero based
+    TInt iTtsDelayIndex;
+    
+    // True if TTS tone should be played when the next playing of the 
+    // default or personal tone is fired.
+    TBool iTtsToneToBePlayed;
+    
+    // Timer, that tracks delays before playing TTS
+    CPhoneTimer* iTtsDelayTimer;
+
+    // Number of times TTS tone should be played for the CURRENT ringtone
+    // If ringing tone is to be played just once, iTtsDelayCount == 1,
+    // otherwise iTtsDelayCount == KTtsDelayCount
+    TInt iTtsDelaysCount;
+    
+    // Counter for TTs timeouts
+    TInt iTTsTimeOutCounter;
+    
+    // RingingType for TtsPlayer only.
+    TProfileRingingType iTtsRingingType;
+    
+    // Volume of the text pronounced by the TTS engine
+    TInt iTtsVolume;
+    
+    CPhoneRingingtonePlayer* iRingingtonePlayer;
+    };
+
+#endif /* CPHONETTSPLAYER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/mphoneaudioplayerobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 MPHONEAUDIOPLAYEROBSERVER_H
+#define MPHONEAUDIOPLAYEROBSERVER_H
+
+// User includes
+#include "phoneconstants.h"
+
+// Class declaration
+
+/**
+*  Observer interface for audio player.
+*
+* @since 1.0
+*/
+class MPhoneAudioPlayerObserver
+    {
+    public:  // Constructors and destructor
+        
+        // Enumerates different failures.
+        //
+        // EAudioPlayerInitializingFailure - failure in initialising
+        // EAudioPlayerPlayingFailure - failure during playing
+        enum TPhoneAudioPlayerErrorEvent
+            {
+            EAudioPlayerInitializingFailure,
+            EAudioPlayerPlayingFailure
+            };
+        
+        /**
+        * Observe the error.
+        * @param aEvent the error event happend in initializing or playing.
+        * @param aError The error code return by audio server. Observer can 
+        *               handle  these two error code for recoverable 
+        *               and unrecoverable errors.
+        * @param aId Indicate which audio player is outof working.
+        */
+        virtual void HandleAudioPlayerError( 
+            TPhoneAudioPlayerErrorEvent aEvent,
+            TInt aError, 
+            TInt aId = KPhoneAudioPlayerNotSpecified ) = 0;
+
+        /**
+        * This function is called when audio player initialization complete.
+        * @param aId The id of the audio player.
+        */
+        virtual void HandleAudioPlayerInitComplete(
+            TInt aId = KPhoneAudioPlayerNotSpecified ) = 0;
+
+        /**
+        * This funciton is called after the playing complete successfully.
+        * @param aId The id of the audio player.
+        */
+        virtual void HandlePlayingComplete( 
+            TInt aId = KPhoneAudioPlayerNotSpecified ) = 0;
+    };
+
+#endif      // MPHONEAUDIOPLAYEROBSERVER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/mphonecoveruiobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MPHONECOVERUIOBSERVER_H
+#define MPHONECOVERUIOBSERVER_H
+
+// Class declaration
+
+/**
+*  Cover UI observer interface.
+*
+*/
+class MPhoneCoverUiObserver  
+    {
+    public:
+        
+        /**
+        * This function is called when Mediator receives response to the sent
+        * ShowMultiMediaRingingTone command.
+        * @param aStatus - Standard Symbian error code indicating the
+        *                  success of the command.
+        */
+        virtual void ShowMultimediaRingingToneResponseL( TInt aStatus ) = 0;
+    };
+
+#endif // MPHONECOVERUIOBSERVER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/mphoneringingtoneobserver.h	Fri Jun 04 10:19:18 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 MPHONERINGINGTONEOBSERVER_H
+#define MPHONERINGINGTONEOBSERVER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  Observer interface for ringing tone playing
+*
+* @since Series 60 3.1
+*/
+class MPhoneRingingToneObserver
+    {
+    public:  
+        /**
+        * Observer the ringing tone playing
+        * @param aPlayingAudio ETrue is ringing tone audio is playing.
+        * @param aPlayingVideo ETrue is ringing tone video is playing.
+        */
+        virtual void RingingTonePlaying( 
+            TBool aPlayingAudio,
+            TBool aPlayingVideo ) = 0;
+    };
+
+#endif      // MPHONERINGINGTONEOBSERVER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/mphonevideoplayer.h	Fri Jun 04 10:19:18 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 M_PHONEVIDEOPLAYER_H
+#define M_PHONEVIDEOPLAYER_H
+
+// Forward declarations
+class MPhoneVideoPlayerObserver;
+
+/**
+ *  Abstract video playing interface.
+ *
+ *
+ *  @lib Phone.exe
+ *  @since S60 v3.2
+ */
+class MPhoneVideoPlayer
+    {
+public:
+    /**  Play modes */
+    enum TPlayMode
+        {
+        EPlayInLoop,
+        EPlayOnce,
+        EPlayAscending    
+        }; 
+
+public:
+    /**
+    * Plays given video ringing tone.
+    *
+    * @since S60 S60 v3.2
+    * @param aFileName File name.
+    * @param aPlayMode Playing mode.
+    * @param aVolumeLevel Playing volume, range: 0-10.
+    * @param aArbitraryScaling Set ETrue if arbitrary scaling supported.
+    * @param aObserver Observer for playback events.
+    */
+    virtual void PlayVideoRingTone( const TDesC& aFileName,
+                                    TPlayMode aPlayMode,
+                                    TInt aVolumeLevel,
+                                    TBool aArbitraryScaling,
+                                    MPhoneVideoPlayerObserver* aObserver ) = 0;
+    
+    /**
+    * Stops ringing.
+    *
+    * @since S60 S60 v3.2
+    */
+    virtual void StopVideoRingTone() = 0;
+    
+    /**
+    * Mutes ringing tone playing.
+    *
+    * @since S60 S60 v3.2
+    */    
+    virtual void MuteVideoRingTone() = 0;
+        
+    /**
+    * Cancels ringing tone playing.
+    *
+    * @since S60 S60 v3.2
+    */
+    virtual void CancelVideoRingTone() = 0;
+    };
+
+
+#endif // M_PHONEVIDEOPLAYER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/inc/mphonevideoplayerobserver.h	Fri Jun 04 10:19:18 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 MPHONEVIDEOPLAYEROBSERVER_H
+#define MPHONEVIDEOPLAYEROBSERVER_H
+
+// Class declaration
+
+/**
+*  Video player observer interface.
+*
+*  @lib Phone.app
+*  @since Series 60 3.1
+*/
+class MPhoneVideoPlayerObserver  
+    {
+    public:
+        
+        // Enumerates different failure events.
+        //
+        enum TPhoneVideoPlayerErrorEvent
+            {
+            EVideoPlayerInitializingFailure, // Failure during initialization
+            EVideoPlayerPlayingFailure // Failure during playback
+            };
+        
+        /**
+        * This function is called for video player errors.
+        * @param aEvent The error event happend in initializing or playing.
+        * @param aError The error code return by MMF video player. 
+        */
+        virtual void HandleVideoPlayerError( 
+            TPhoneVideoPlayerErrorEvent aEvent,
+            TInt aError ) = 0;
+
+        /**
+        * This function is called when video player initialization complete
+        */
+        virtual void HandleVideoPlayerInitComplete() = 0;
+
+        /**
+        * This function is called after the playing completes successfully
+        */
+        virtual void HandleVideoPlayerPlayingComplete() = 0;
+    };
+
+#endif      // MPHONEVIDEOPLAYEROBSERVER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/src/cphoneaudioplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1063 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <eikenv.h>
+#include <apgcli.h>
+#include <apmrec.h>
+#include <AudioPreference.h>
+#include <utf.h>    // for converting data for tts
+#include <c3dringingtoneinterface.h>
+#include <AudioOutput.h>
+
+#include "cphoneaudioplayer.h"
+#include "cphoneringingtone.h"
+#include "mphoneaudioplayerobserver.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "phoneui.pan"
+
+
+// CONSTANTS
+
+
+_LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" );
+//Min volume level
+const TInt KMinVolumeLevel = 1;
+//Max volume level
+const TInt KMaxVolumeLevel = 10;
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::CPhoneAudioPlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer::CPhoneAudioPlayer( TAudioDataFormat aDataFormat,
+    MPhoneAudioPlayerObserver& aObserver, 
+    TInt aPriority, 
+    TUint aPreference,
+    TInt aId )
+    : iFormat( aDataFormat ),
+    iObserver( aObserver ),
+    iPriority( aPriority ),
+    iPreference( aPreference ),
+    iId( aId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::ConstructL(
+    const TDesC& aFileName,
+    CMdaServer* aMdaServer )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::ConstructL()" );
+    if ( iFormat == EFormatTone )
+        {
+        iTonePlayer = CMdaAudioToneUtility::NewL( *this, aMdaServer );
+        iTonePlayer->PrepareToPlayFileSequence( aFileName );
+        iPlayerStatus = EToneLoading;
+        }
+    else
+        {
+        //audio sample player
+        __PHONELOG3( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneAudioPlayer::ConstructL - aFileName(%S), iPriority(%d), iPreference(%d)",
+            &aFileName, 
+            iPriority, 
+            iPreference );
+
+        iSamplePlayer = CMdaAudioPlayerUtility::NewFilePlayerL( 
+            aFileName,
+            *this, 
+            iPriority,
+            static_cast< TMdaPriorityPreference >( iPreference ),
+            aMdaServer );            
+        iPlayerStatus = EToneLoading;
+        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::ConstructSeqL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::ConstructSeqL( 
+    const TDesC8& aSequence,
+        CMdaServer* aMdaServer )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::ConstructSeqL()" );
+    iTonePlayer = CMdaAudioToneUtility::NewL( *this, aMdaServer );
+    iSequence = aSequence.AllocL();
+    iTonePlayer->PrepareToPlayDesSequence( *iSequence );
+    iPlayerStatus = EToneLoading;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::ConstructTtsL
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::ConstructTtsL( 
+    const TDesC& aTtsText, 
+    TInt aPriority,
+    TUint aPreference )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::ConstructTtsL()" );
+    delete iTtsPlayer; // if any
+    iTtsPlayer = NULL;
+    iTtsPlayer = 
+        CMdaAudioPlayerUtility::NewL( 
+            *this, aPriority, 
+            static_cast< TMdaPriorityPreference >( aPreference ) );
+    
+    delete iTtsText;  // if any
+    iTtsText = NULL;
+    // UTF-8 strings can take up to 4 bytes per character
+    iTtsText = HBufC8::NewL( aTtsText.Length() << KTimesToMultiply ); 
+    
+    TPtr8 refText = iTtsText->Des(); 
+    User::LeaveIfError( 
+        CnvUtfConverter::ConvertFromUnicodeToUtf8( refText, aTtsText ) );
+
+    // UTF-8 chars can be up to 4 bytes long, but usually 
+    // take 1-2 bytes, 3 for asian chars.
+    HBufC8* oldText = iTtsText;
+    iTtsText = iTtsText->ReAlloc( iTtsText->Length() );
+    if ( !iTtsText )
+        {
+        // ReAlloc failed, set back to original.
+        iTtsText = oldText;
+        }
+    
+    iTtsPlayer->OpenDesL( *iTtsText );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::New
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneAudioPlayer::New( 
+    const CPhoneRingingTone& aRingingTone, 
+    TInt aPriority, 
+    TUint aPreference,
+    MPhoneAudioPlayerObserver& aObserver, 
+    TInt aId,
+    CMdaServer* aMdaServer,
+    TBool aExtSecNeeded )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::New()" );
+    CPhoneAudioPlayer* self = NULL;
+    TRAPD( err, self = CPhoneAudioPlayer::NewL( 
+        aRingingTone,
+        aPriority,
+        aPreference,
+        aObserver,
+        aId,
+        aMdaServer,
+        aExtSecNeeded ) );
+    if ( err != KErrNone )
+        {
+        return NULL;
+        }
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneAudioPlayer::NewL( 
+    const CPhoneRingingTone& aRingingTone, 
+    TInt aPriority,
+    TUint aPreference,
+    MPhoneAudioPlayerObserver& aObserver,
+    TInt aId,
+    CMdaServer* aMdaServer,
+    TBool aExtSecNeeded )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::NewL()" );
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneAudioPlayer::NewL - aExtSecNeeded(%d)",
+        aExtSecNeeded );
+    
+    // Check the file DRM property if extend secure is needed.
+    if ( aExtSecNeeded )
+        {
+        if ( !aRingingTone.IsFileInRom() &&
+             !aRingingTone.IsFileDrmProtected() )
+            {
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneAudioPlayer::NewL - DRM extend security check permission denied" );
+            User::Leave( KErrPermissionDenied );
+            }
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneAudioPlayer::NewL - DRM extend security check ok" );
+        }
+    // RNG file types have to be played with CMdaAudioToneUtility player.
+    // Otherwise use sample player
+    TAudioDataFormat format = 
+    ( aRingingTone.MimeType().CompareF( KFileListRngMimeType ) == KErrNone ) 
+    ? EFormatTone :EFormatSample;
+
+    CPhoneAudioPlayer* self = 
+        new (ELeave) CPhoneAudioPlayer( 
+            format,
+            aObserver, 
+            aPriority,
+            aPreference,
+            aId );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aRingingTone.FileName(), aMdaServer );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneAudioPlayer::NewL( 
+    const TDesC& aFileName, 
+    TInt aPriority,
+    TUint aPreference,
+    MPhoneAudioPlayerObserver& aObserver,
+    TInt aId,
+    CMdaServer* aMdaServer,
+    TBool aExtSecNeeded )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::NewL()" );
+    CPhoneRingingTone* tone = CPhoneRingingTone::NewL( aFileName );
+    CleanupStack::PushL( tone );
+
+    CPhoneAudioPlayer* player = CPhoneAudioPlayer::NewL( *tone,
+                                                         aPriority,
+                                                         aPreference,
+                                                         aObserver,
+                                                         aId,
+                                                         aMdaServer,
+                                                         aExtSecNeeded );
+
+    CleanupStack::PopAndDestroy( tone );
+    
+    return player;        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::NewSeqL
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneAudioPlayer::NewSeqL(
+    const TDesC8& aSequence,
+    TInt aPriority,
+    TUint aPreference,
+    MPhoneAudioPlayerObserver& aObserver, 
+    TInt aId,
+    CMdaServer* aMdaServer )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::NewSeqL()" );
+    CPhoneAudioPlayer* self = 
+        new (ELeave) CPhoneAudioPlayer( 
+            EFormatTone, 
+            aObserver, 
+            aPriority,
+            aPreference,
+            aId );
+    
+    CleanupStack::PushL( self );
+    self->ConstructSeqL( aSequence, aMdaServer  );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::NewTtsL
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneAudioPlayer::NewTtsL(
+    const TDesC& aText,
+    TInt aPriority,
+    TUint aPreference,
+    MPhoneAudioPlayerObserver& aObserver, 
+    TInt aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::NewTtsL()" );
+    CPhoneAudioPlayer* self = 
+        new (ELeave) CPhoneAudioPlayer( 
+            EFormatTts, 
+            aObserver, 
+            aPriority,
+            aPreference,
+            aId );
+    
+    CleanupStack::PushL( self );
+    self->ConstructTtsL( aText, aPriority, aPreference );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::~CPhoneAudioPlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer::~CPhoneAudioPlayer()
+    {
+    
+    if ( iAudioOutput )
+        {
+        delete iAudioOutput;    
+        }  
+    if ( iTonePlayer )  
+        {
+        delete iTonePlayer;  
+        } 
+    if ( i3DPlugin )
+       {
+        i3DPlugin->Stop();
+        delete i3DPlugin;
+        }
+    // ECom cleanup
+    REComSession::FinalClose();
+    if ( iSamplePlayer )    
+        {
+        delete iSamplePlayer; 
+        }
+    if ( iTtsPlayer )
+        {
+        delete iTtsPlayer;   
+        }
+    if ( iSequence )
+        {
+        delete iSequence; 
+        }
+    if ( iTtsText )  
+        {
+        delete iTtsText;
+        }   
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::Play
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::Play( TRingingType aRingType, TInt aVolume, TInt aTTsToBePlayed )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::Play()" );
+    __PHONELOG2( 
+        EBasic, 
+        EPhoneControl, 
+        "CPhoneAudioPlayer::Play - iFormat(%d), iPlayerStatus(%d)",
+        iFormat, 
+        iPlayerStatus );
+    __PHONELOG3( 
+        EBasic, 
+        EPhoneControl, 
+        "CPhoneAudioPlayer::Play - aRingType(%d), aVolume(%d), aTTsToBePlayed(%d)",
+        aRingType, 
+        aVolume,
+        aTTsToBePlayed );
+    iRingType = aRingType;
+    iVolume = aVolume;
+    iTTsToBePlayed = aTTsToBePlayed;
+    
+    if ( iFormat == EFormatTone )
+        {
+        switch ( iPlayerStatus )
+            {
+            case ETonePlaying:
+                iTonePlayer->CancelPlay();
+                DoPlay();
+                break;
+
+            case EToneReady:
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+
+            case EToneLoading:
+                iToBePlaying = ETrue;
+                break;
+
+            default:
+                __ASSERT_DEBUG( EFalse, 
+
+                      Panic( EPhoneViewCaseNotHandled ) );
+            }
+        }
+    else if ( iFormat == EFormatTts )
+        {
+        switch ( iPlayerStatus )
+            {
+            case ETonePlaying:
+                //stop previous playing
+                iTtsPlayer->Stop();
+                DoPlay();
+                break;
+
+            case EToneReady:
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+
+            case EToneLoading:
+                iToBePlaying = ETrue;
+                break;
+
+            default:
+                __ASSERT_DEBUG( EFalse, 
+                        Panic( EPhoneViewCaseNotHandled ) );
+            }
+        }
+    else
+        {
+        switch ( iPlayerStatus )
+            {
+            case ETonePlaying:
+                //stop previous playing
+                StopPlaying();
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+
+            case EToneReady:
+                iPlayerStatus = ETonePlaying;
+                DoPlay();
+                break;
+
+            case EToneLoading:
+                iToBePlaying = ETrue;
+                break;
+
+            default:
+                __ASSERT_DEBUG( EFalse, 
+
+                        Panic( EPhoneViewCaseNotHandled ) );
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::ReStartPlaying
+// -----------------------------------------------------------------------------
+//    
+void CPhoneAudioPlayer::ReStartPlaying()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::ReStartPlaying()" );
+    __PHONELOG3( 
+        EBasic, 
+        EPhoneControl, 
+        "CPhoneAudioPlayer::ReStartPlaying - iFormat(%d), iRingType(%d), iVolume(%d)",
+        iFormat, 
+        iRingType, 
+        iVolume );
+        
+    if ( iFormat == EFormatTone )
+        {
+        iTonePlayer->Play();
+        iPlayerStatus = ETonePlaying;
+        }
+    else if ( iFormat == EFormatTts )
+        {
+        iTtsPlayer->Play();
+        iPlayerStatus = ETonePlaying;
+        }        
+    else
+        {
+        iSamplePlayer->Play();
+        iPlayerStatus = ETonePlaying;
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::StopPlaying
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::StopPlaying()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::StopPlaying()" );
+    iToBePlaying = EFalse;
+    
+    if ( iFormat == EFormatTone )
+        {
+        if ( EMdaAudioToneUtilityPrepared == iTonePlayer->State() )
+            {
+            iTonePlayer->CancelPrepare();
+            }
+        else if ( EMdaAudioToneUtilityPlaying == iTonePlayer->State() )
+            {
+            iTonePlayer->CancelPlay();
+            }
+        }
+    else if ( iFormat == EFormatTts )
+        {
+        iTtsPlayer->Stop();
+        }
+    else
+        {
+        if ( i3DPlugin )
+            {
+            i3DPlugin->Stop();
+            delete i3DPlugin;
+            i3DPlugin = NULL;
+            }
+        else
+            {
+            iSamplePlayer->Stop();        
+            }
+        }
+    
+    iPlayerStatus = EToneReady;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::MapcInitComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::MapcInitComplete(
+    TInt aError, 
+    const TTimeIntervalMicroSeconds& /*aDuration*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::MapcInitComplete()" );
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneAudioPlayer::MapcInitComplete - aError(%d)",
+        aError );
+    __ASSERT_DEBUG( ( ( iFormat == EFormatSample ) || ( iFormat == EFormatTts ) ) && 
+        ( iPlayerStatus == EToneLoading ), Panic( EPhoneViewGeneralError ) );
+    if ( aError == KErrNone )
+        {
+        if ( iToBePlaying )
+            {
+            iPlayerStatus = ETonePlaying;
+            iToBePlaying = EFalse;
+            DoPlay();
+            }
+        else
+            {
+            iPlayerStatus = EToneReady;
+            }
+        iObserver.HandleAudioPlayerInitComplete( iId );
+        }
+    else
+        {
+        iObserver.HandleAudioPlayerError( 
+            MPhoneAudioPlayerObserver::EAudioPlayerInitializingFailure, 
+            aError, iId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::MapcPlayComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::MapcPlayComplete( TInt aError )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::MapcPlayComplete()" );
+    __PHONELOG2( EBasic, EPhoneControl, "CPhoneAudioPlayer::MapcPlayComplete - iFormat(%d), aError(%d)",
+        iFormat, aError );
+    iPlayerStatus = EToneReady;
+
+    //Destruct 3D plugin before player itself gets destructed.
+    //In case of continuous ringing type, stopplaying() handles
+    //3d plugin destruction
+    if ( i3DPlugin )
+        {
+        i3DPlugin->Stop();
+        delete i3DPlugin;
+        i3DPlugin = NULL;            
+        }
+
+    if ( aError != KErrNone )
+        {
+        iObserver.HandleAudioPlayerError( 
+            MPhoneAudioPlayerObserver::EAudioPlayerPlayingFailure, 
+            aError, iId );
+        }
+    else
+        {
+        iObserver.HandlePlayingComplete( iId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::MatoPrepareComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::MatoPrepareComplete( TInt aError )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::MatoPrepareComplete()" );
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneAudioPlayer::MatoPrepareComplete - aError(%d)",
+        aError );
+        
+    __ASSERT_DEBUG( ( iFormat == EFormatTone ) && ( iPlayerStatus == EToneLoading ), 
+        Panic( EPhoneViewGeneralError ) );
+    if ( aError == KErrNone )
+        {
+        if ( iToBePlaying )
+            {
+            iPlayerStatus = ETonePlaying;
+            iToBePlaying = EFalse;
+            DoPlay();
+            }
+        else
+            {
+            iPlayerStatus = EToneReady;
+            }
+        iObserver.HandleAudioPlayerInitComplete( iId );
+        }
+    else
+        {
+        iObserver.HandleAudioPlayerError( 
+            MPhoneAudioPlayerObserver::EAudioPlayerInitializingFailure, 
+            aError, iId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::MatoPlayComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::MatoPlayComplete(TInt aError)
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::MatoPlayComplete()" );
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneAudioPlayer::MatoPlayComplete - aError(%d)",
+        aError );
+    if ( aError != KErrNone )
+        {
+        iObserver.HandleAudioPlayerError( 
+            MPhoneAudioPlayerObserver::EAudioPlayerPlayingFailure, 
+            aError, iId );
+        }
+    else
+        {
+        iObserver.HandlePlayingComplete( iId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::DoPlay
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::DoPlay()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::DoPlay()" );
+    __ASSERT_DEBUG( iPlayerStatus == ETonePlaying, 
+        Panic( EPhoneViewGeneralError ) );
+        
+    SetRingingTypeProperties();
+    
+    TInt err(KErrNone);
+    if ( iFormat == EFormatTone )
+        {
+        iTonePlayer->Play();
+        }
+    else if ( iFormat == EFormatTts )
+        {
+        iTtsPlayer->Play();
+        }        
+    else
+        {
+        TRAP( err,i3DPlugin = C3DRingingToneInterface::NewL( KNullUid ) );
+        if ( !err && i3DPlugin )
+            {
+            i3DPlugin->SetAttr( E3DRTIAttrAudioPlayerUtility, iSamplePlayer );
+            TRAP( err,i3DPlugin->PlayL() )
+            }
+        if ( err || !i3DPlugin )
+            {
+            if ( !iAudioOutput )
+                 {
+                 __PHONELOG( EBasic, EPhoneControl, "CPhoneAudioPlayer::DoPlay c aud ");
+                 TRAP (err, iAudioOutput = CAudioOutput::NewL( *iSamplePlayer ) );
+                if ( err )
+                    {
+                    __PHONELOG1(EBasic, EPhoneControl, 
+                        "P.AudPlayer.DoPlay.iAudioOutput.err ", err );
+                    }                               
+               }
+            if ( !err && iAudioOutput )
+                 {
+                 __PHONELOG( EBasic, EPhoneControl, "CPhoneAudioPlayer::DoPlay EALL ");
+                 TRAP (err, iAudioOutput->SetAudioOutputL( CAudioOutput::EAll ) );
+                 if ( err )
+                     {
+                     __PHONELOG1( EBasic, EPhoneControl, 
+                         "P.AudPlayer.DoPlay.SetAudioOutputL.err ", err );   
+                     }
+
+                 }
+            iSamplePlayer->Play();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::SetRingingTypeProperties
+// -----------------------------------------------------------------------------
+//
+void CPhoneAudioPlayer::SetRingingTypeProperties()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::SetRingingTypeProperties()" );
+    __PHONELOG2( EBasic, EPhoneControl, "CPhoneAudioPlayer::SetRingingTypeProperties - iFormat(%d), iRingType(%d)",
+        iFormat, iRingType );
+    TInt rampTime( 0 );     
+    if ( iFormat == EFormatTone )
+        {
+        switch ( iRingType )
+            {
+            case ETypeRinging:
+                //If we have TTS activated and ringingtype is ringing:
+                //We need to play TTS sequence again when ringingtone restarts.
+                //Thats why we need to set ringingtype to ETypeRingingOnce because  
+                //it is the only way of knowing when ringingtone is completed. 
+                //Then we can restart it with new TTS iterations.
+                if ( iTTsToBePlayed )
+                    {
+                     //play only once
+                    iTonePlayer->SetRepeats( 0, 
+                        TTimeIntervalMicroSeconds(
+                        KPhoneRingingRepeatsTrailPause ) ); 
+                    iTonePlayer->SetVolume( ConvertVolume( iVolume ) );
+                    __PHONELOG1( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ringing tone with TTS, Set volume(%d) and ring once",
+                        iVolume );
+                    }
+                else
+                    {
+                    iTonePlayer->SetRepeats( KPhoneMdaAudioToneRepeatForever,
+                        TTimeIntervalMicroSeconds( 
+                         KPhoneRingingRepeatsTrailPause ) );
+                    iTonePlayer->SetVolume( ConvertVolume( iVolume ) );
+                    __PHONELOG1( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ringing tone, Set volume(%d)",
+                        iVolume );
+                    }
+                break;
+
+            case ETypeRingingOnce:
+                //play only once
+                iTonePlayer->SetRepeats( 0, 
+                    TTimeIntervalMicroSeconds(
+                    KPhoneRingingRepeatsTrailPause ) ); 
+                iTonePlayer->SetVolume( ConvertVolume( iVolume ) );
+                __PHONELOG1( 
+                    EBasic, 
+                    EPhoneControl, 
+                    "CPhoneAudioPlayer::SetRingingTypeProperties - Ring once tone, set volume(%d)",
+                    iVolume );
+                break;
+
+            case ETypeAscending:
+                iTonePlayer->SetRepeats( KPhoneMdaAudioToneRepeatForever,
+                    TTimeIntervalMicroSeconds(
+                    KPhoneRingingRepeatsTrailPause ) );
+
+                //Special case for TTs + ascending profile. Volume 
+                //and ramptime needs to be different as usual
+                if ( iTTsToBePlayed )
+                    {
+                    //rampTime in this case is only 3 seconds and volume is 1.
+                    rampTime = KPhoneAudioAscendingRampDuration;
+                    __PHONELOG1( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ascending tone with TTS, Start from lowest volume, rampTime(%d)",
+                        rampTime );
+                    iTonePlayer->SetVolumeRamp( 
+                        TTimeIntervalMicroSeconds( rampTime ) ); 
+
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iTonePlayer->SetVolume( ConvertVolume( iCurrentVolume ) );
+                    }
+                else
+                    {
+                    //rampTime: time for one step * volume level
+                    rampTime = KPhoneAudioAscendingRampDuration*iVolume;
+                    __PHONELOG2( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ascending tone, Set volume(%d), rampTime(%d)",
+                        iVolume, rampTime );
+                    iTonePlayer->SetVolumeRamp( 
+                        TTimeIntervalMicroSeconds( rampTime ) );
+                        
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iTonePlayer->SetVolume( ConvertVolume( iVolume ) );       
+                    }
+                break;
+
+            default:
+                Panic( EPhoneViewGeneralError );
+                break;
+            }
+
+        __PHONELOG3( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneAudioPlayer::SetRingingTypeProperties - Tone, iPriority(%d), iPreference(%d), iVolume(%d)",
+            iPriority, iPreference, iVolume );
+
+        //Set priority and preference
+        iTonePlayer->SetPriority( iPriority, 
+            static_cast< TMdaPriorityPreference >( iPreference ) );
+        }
+    else if ( iFormat == EFormatTts )
+        {
+        switch ( iRingType )
+            {
+            case ETypeRinging:
+            case ETypeAscending:
+                // Not possible iRingType for TTS.
+                break;
+
+            case ETypeRingingOnce:
+                iTtsPlayer->SetRepeats( 0, // play only once
+                    TTimeIntervalMicroSeconds( 
+                    KPhoneRingingRepeatsTrailPause ) );
+                iTtsPlayer->SetVolume( ConvertVolume( iVolume ) );
+                __PHONELOG1( 
+                    EBasic, 
+                    EPhoneControl, 
+                    "CPhoneAudioPlayer::SetRingingTypeProperties - TTS, Set volume(%d)",
+                    iVolume );
+                break;
+            
+            default:
+                __ASSERT_DEBUG( EFalse, 
+                        Panic( EPhoneViewCaseNotHandled ) );
+            }
+        __PHONELOG( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneAudioPlayer::SetRingingTypeProperties - TTS" );
+        }
+    else
+        {
+        switch ( iRingType )
+            {
+            case ETypeRinging:
+                //If we have TTS activated and ringingtype is ringing:
+                //We need to play TTS sequence again when ringingtone restarts.
+                //Thats why we need to set ringingtype to ETypeRingingOnce because  
+                //it is theonly way of knowing when ringingtone is completed. 
+                //Then we can restartit with new TTS iterations.
+                if ( iTTsToBePlayed )
+                    {
+                     //play only once
+                    iSamplePlayer->SetRepeats( 0, 
+                        TTimeIntervalMicroSeconds(
+                        KPhoneRingingRepeatsTrailPause ) ); 
+                    iSamplePlayer->SetVolume( ConvertVolume( iVolume ) );
+                    __PHONELOG1( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ringing sample with TTS, Ring only once, Set volume(%d)",
+                        iVolume );
+                    }
+                else
+                    {
+                    iSamplePlayer->SetRepeats( KPhoneMdaAudioToneRepeatForever,
+                        TTimeIntervalMicroSeconds( 
+                        KPhoneRingingRepeatsTrailPause ) );
+                    iSamplePlayer->SetVolume( ConvertVolume( iVolume ) );
+                    __PHONELOG1( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ringing sample, Set volume(%d)",
+                        iVolume );
+                    }
+                break;
+
+            case ETypeRingingOnce:
+                iSamplePlayer->SetRepeats( 0,//play only once
+                    TTimeIntervalMicroSeconds( 
+                    KPhoneRingingRepeatsTrailPause ) ); 
+                iSamplePlayer->SetVolume( ConvertVolume( iVolume ) );
+                __PHONELOG1( 
+                    EBasic, 
+                    EPhoneControl, 
+                    "CPhoneAudioPlayer::SetRingingTypeProperties - Ring once sample, set volume(%d)",
+                    iVolume );
+                break;
+
+            case ETypeAscending:
+                iSamplePlayer->SetRepeats( KPhoneMdaAudioToneRepeatForever,
+                    TTimeIntervalMicroSeconds(
+                    KPhoneRingingRepeatsTrailPause ) );
+
+                //Special case for TTs + ascending profile. Volume 
+                //and ramptime needs to be different as usual
+                if ( iTTsToBePlayed )
+                    {
+                    //rampTime in this case is only 3 seconds and volume is 1.
+                    rampTime = KPhoneAudioAscendingRampDuration;
+                    __PHONELOG1( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ascending sample with TTS, Start from lowest volume, rampTime(%d)",
+                        rampTime );
+                    iSamplePlayer->SetVolumeRamp( 
+                        TTimeIntervalMicroSeconds( rampTime ) ); 
+
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iSamplePlayer->SetVolume( ConvertVolume( iCurrentVolume ) );
+                    }
+                else
+                    {
+                    //rampTime: time for one step * volume level
+                    rampTime = KPhoneAudioAscendingRampDuration*iVolume;
+                    __PHONELOG2( 
+                        EBasic, 
+                        EPhoneControl, 
+                        "CPhoneAudioPlayer::SetRingingTypeProperties - Ascending sample, Set volume(%d), rampTime(%d)",
+                        iVolume, rampTime );
+                    iSamplePlayer->SetVolumeRamp( 
+                        TTimeIntervalMicroSeconds( rampTime ) );
+                        
+                    iCurrentVolume = 1; //we start from the lowest volume
+                    iSamplePlayer->SetVolume( ConvertVolume( iVolume ) );
+                    }
+                break;
+
+            default:
+                Panic( EPhoneViewGeneralError );
+                break;
+            }
+
+        __PHONELOG( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneAudioPlayer::SetRingingTypeProperties - Sample" );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::SetNewVolumeAndRamptime
+// -----------------------------------------------------------------------------
+//    
+void CPhoneAudioPlayer::SetNewVolumeAndRamptime( TInt aVolume, TInt aRamptime )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneAudioPlayer::SetNewVolumeAndRamptime()" );
+   
+    //Check that volume is in valid range.
+   TInt volume = aVolume<1 ? 1:aVolume;
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneAudioPlayer::SetNewVolumeAndRamptime - aVolume(%d)",
+        aVolume ); 
+            
+    if ( iFormat == EFormatTone && iTonePlayer )
+        {
+        iTonePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds( aRamptime ) );
+        iTonePlayer->SetVolume( ConvertVolume( volume ) );
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneAudioPlayer::SetNewVolumeAndRamptime - Tone player" );
+        }
+    else if ( iFormat == EFormatTts && iTtsPlayer )
+        {
+        iTtsPlayer->SetVolumeRamp(TTimeIntervalMicroSeconds( aRamptime ) );
+        iTtsPlayer->SetVolume( ConvertVolume( volume ) );
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneAudioPlayer::SetNewVolumeAndRamptime - TTS player" );
+        }
+    else 
+        {
+        iSamplePlayer->SetVolumeRamp(TTimeIntervalMicroSeconds( aRamptime ) );
+        iSamplePlayer->SetVolume( ConvertVolume( volume ) );
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneAudioPlayer::SetNewVolumeAndRamptime - Sample player" );
+        }
+   
+    }
+   
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::ConvertVolume
+// -----------------------------------------------------------------------------
+//  
+TInt CPhoneAudioPlayer::ConvertVolume( TInt aVolume )
+    {
+    //_DDPRINT( 5, "P.AudPlayer.ConvertVolume.aVolume", aVolume );
+
+    TInt result( 0 );    
+    
+    if ( iFormat == EFormatTone )
+        {
+        result = iTonePlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
+        }
+    else if ( iFormat == EFormatTts )
+        {
+        result = iTtsPlayer->MaxVolume() * aVolume / KMaxVolumeLevel;    
+        }
+    else
+        {
+        result = iSamplePlayer->MaxVolume() * aVolume / KMaxVolumeLevel;       
+        }
+        
+    // if user has selected minimum volume level
+    // set HW volume 1
+    if ( aVolume == KMinVolumeLevel && result == 0 )
+        {
+        result = 1; 
+        }
+       
+    //_DDPRINT( 5, "P.AudPlayer.ConvertVolume.result", result );       
+    return result;    
+    }
+
+       
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::SetTTsToBePlayed
+// -----------------------------------------------------------------------------
+//  
+void CPhoneAudioPlayer::SetTTsToBePlayed( TBool aTTsToBePlayed )
+    {
+    iTTsToBePlayed = aTTsToBePlayed;
+    }  
+
+// -----------------------------------------------------------------------------
+// CPhoneAudioPlayer::MutePlaying
+// -----------------------------------------------------------------------------
+//  
+void CPhoneAudioPlayer::MutePlaying()
+    {
+    //_DPRINT( 5, "P.Aud.Mute" );
+    if ( iPlayerStatus == ETonePlaying )
+        {
+        if ( iFormat == EFormatTone )
+            {
+            iTonePlayer->SetVolume(0);
+            }
+        else if ( iFormat == EFormatTts )
+            {
+            iTtsPlayer->SetVolume(0);
+            }
+        else // EFormatSample
+            {
+            iSamplePlayer->SetVolume(0);        
+            }
+        }
+    else
+        {
+        // Mute called during EToneLoading state.
+        iToBePlaying = EFalse;    
+        }                   
+    }
+   
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/src/cphoneringingtone.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,449 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// INCLUDE FILES
+#include <apgcli.h>
+#include <DRMHelper.h>
+#include <bldvariant.hrh>
+#include <pathinfo.h>
+#include <ProfileEngineDomainCRKeys.h>
+#include "cphoneringingtone.h"
+#include "cphonecenrepproxy.h"
+#include "phonelogger.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+
+// CONSTANTS
+// Rich audio file MIME types
+_LIT(KAac, "audio/aac");
+_LIT(KMp3, "audio/mp3");
+_LIT(KMpeg, "audio/mpeg");
+_LIT(K3gpp, "audio/3gpp");
+_LIT(KMp4, "audio/mp4");
+_LIT(KAmrWb, "audio/amr-wb");
+_LIT(KWavX, "audio/x-wav");
+_LIT(KWav, "audio/wav");
+
+// Rich video file MIME types
+_LIT(KV3gpp, "video/3gpp");
+_LIT(KVMp4, "video/mp4");
+_LIT(KV3gpp2, "video/3gpp2");
+
+// MACROS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::CPhoneRingingTone
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingTone::CPhoneRingingTone( TBool aDrmInPlayback ) :
+    iDrmInPlayback( aDrmInPlayback )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTone::ConstructL( const TDesC& aFileName )
+    {
+    iFileName = aFileName.AllocL();
+    
+    GetMaxToneFileSize();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingTone* CPhoneRingingTone::NewL( 
+    const TDesC& aFileName,
+    TBool aDrmInPlayback )
+    {
+    CPhoneRingingTone* self = new( ELeave ) CPhoneRingingTone(
+        aDrmInPlayback );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aFileName );
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+    
+// Destructor
+CPhoneRingingTone::~CPhoneRingingTone()
+    {
+    delete iFileName;
+    delete iMimeType;    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::SetFileName
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTone::SetFileName( const TDesC& aFileName )
+    {
+    delete iFileName;
+    iFileName = NULL;
+    iFileName = aFileName.Alloc();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::SetVolume
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTone::SetVolume( const TInt aVolume )
+    {
+    iVolume = aVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::SetRingingType
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTone::SetRingingType( TProfileRingingType aRingingType)
+    {
+    iRingingType = aRingingType;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::Volume
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingTone::Volume() const
+    {
+    return iVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::RingingType
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TProfileRingingType CPhoneRingingTone::RingingType() const
+    {
+    return iRingingType; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::FileName
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CPhoneRingingTone::FileName() const
+    {
+    // iFileName is never NULL
+    return *iFileName;            
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::SetTtsToneToBePlayed
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTone::SetTtsToneToBePlayed( TBool aTtsToneToBePlayed ) 
+    {
+    iTtsToneToBePlayed = aTtsToneToBePlayed;          
+    }
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::TtsToneToBePlayed
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneRingingTone::TtsToneToBePlayed() const
+    {
+    
+    return iTtsToneToBePlayed;    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::MimeType
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TDesC& CPhoneRingingTone::MimeType() const
+    {
+    if ( iMimeType )
+        {
+        return *iMimeType;        
+        }
+    else
+        {
+        return KNullDesC;    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::IsVideoRingingTone
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+TBool CPhoneRingingTone::IsVideoRingingTone()
+    {
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    if ( RefreshMime() != KErrNone  )
+        {
+        // try to handle as audio
+        return EFalse;                
+        }
+
+    TBool isVideo( EFalse );    
+        
+    if ( iMimeType && iMimeType->MatchF( KPhoneRingingToneVideoMime ) != 
+         KErrNotFound )
+        {
+        isVideo = ETrue;
+        }
+    else if ( iMimeType && iMimeType->MatchF( KPhoneRingingToneRealVideoMime ) != 
+              KErrNotFound )
+        {
+        isVideo = ETrue;    
+        }
+    
+    if ( isVideo )
+        {
+        if ( IsFileInRom() && !IsFileInVideoDirectory() )
+            {
+            // For ROM files check also location, because
+            // MIME check is not fully reliable.
+            isVideo = EFalse;        
+            }            
+        }
+    
+    return isVideo;
+#else
+    // if extended security -> refresh MIME
+    if ( iDrmInPlayback )
+        {
+        RefreshMime();            
+        }
+    
+    return EFalse;
+#endif    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::IsFileDrmProtected
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+TBool CPhoneRingingTone::IsFileDrmProtected() const
+    {
+    const TDesC& type = MimeType();
+        
+    if ( type == KAac  || type == KMp3 || type == KMpeg ||
+         type == K3gpp || type == KMp4 || type == KAmrWb ||
+         type == KWavX || type == KWav || type == KV3gpp || 
+         type == KVMp4 || type == KV3gpp2 )
+        {
+        ContentAccess::CContent* content = NULL;
+        TRAPD( err, content = ContentAccess::CContent::NewL( *iFileName ) );
+        if ( err == KErrNone && content )
+            {
+            TInt drmProtected( 0 );
+            content->GetAttribute( ContentAccess::EIsProtected, drmProtected );
+            delete content;
+            return drmProtected;        
+            }
+        }
+    
+    return ETrue; // Other MIMEs can be played without DRM check.    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::IsFileInRom
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+TBool CPhoneRingingTone::IsFileInRom() const
+    {
+    TParsePtrC parsedName( *iFileName );
+    
+    // Files on rom are not DRM checked
+    if ( parsedName.Drive().CompareF( KPhoneRingingToneDriveZ ) == 0 )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;    
+        }        
+    }    
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::IsFileInVideoDirectory
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneRingingTone::IsFileInVideoDirectory() const
+    {
+    TParsePtrC parsedName( *iFileName );
+    
+    if ( PathInfo::PathType( parsedName.DriveAndPath() ) == 
+         PathInfo::EVideosPath )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;    
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::RefreshMime
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingTone::RefreshMime()
+    {
+    TRAPD( err, RefreshMimeL() );
+    return err;        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingTone::RefreshMimeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+void CPhoneRingingTone::RefreshMimeL()
+    {
+    RApaLsSession apaLsSession;
+    User::LeaveIfError( apaLsSession.Connect() );
+    CleanupClosePushL( apaLsSession );
+
+    TUid dummyUid = { 0 };
+    TDataType dataType( dummyUid );
+    
+    User::LeaveIfError(
+        apaLsSession.AppForDocument( *iFileName, dummyUid, dataType ) );
+        
+    CleanupStack::PopAndDestroy(); // CleanupClosePushL
+    
+    delete iMimeType;
+    iMimeType = NULL;
+    iMimeType = dataType.Des().AllocL();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneRingingTone::CheckAndHandleToneSizeLimit()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtone::CheckAndHandleToneSizeLimit()" );
+    
+    TBool bValidSize = ETrue;
+ 
+    // If user has somehow managed to get a too large file as ringing tone,
+    // play default tone instead.
+    if ( iToneFileSizeLimitKB )
+        {
+        if ( CheckToneFileSize( FileName(), iToneFileSizeLimitKB) != KErrNone )
+            {
+            bValidSize = EFalse;
+            }            
+        }
+    __PHONELOG1( 
+        EBasic,
+        EPhoneControl, 
+        "CPhoneRingingtone::CheckAndHandleToneSizeLimit - bValidSize(%d)",
+        bValidSize);
+        
+    return bValidSize;
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingTone::CheckToneFileSize( const TDesC& aFile, 
+                                           TInt aSizeLimitKB )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtone::CheckToneFileSize()" );
+    //return KErrNone;
+    
+    // Get file size
+    TInt size = 0;
+
+    RFs fs;   
+    TInt error = fs.Connect();
+    TEntry entry;
+    if ( KErrNone == error )
+        {
+        if (KErrNone == fs.Entry( aFile, entry ))
+            {
+            size = entry.iSize;
+            }    
+            
+        // Check
+        aSizeLimitKB *= Kkilo;
+        if ( aSizeLimitKB  &&  size > aSizeLimitKB )
+            {
+            error = KErrTooBig;
+            }
+        }
+
+    fs.Close();
+    __PHONELOG1( 
+        EBasic,
+        EPhoneControl, 
+        "CPhoneRingingtonePlayer::CheckToneFileSize - size (%d)",
+        size );    
+    return error;
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingTone::GetMaxToneFileSize()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtone::GetMaxToneFileSize()" );
+
+    TInt error(KErrNone);           
+    iToneFileSizeLimitKB = 5000;
+   
+    if ( error != KErrNone )
+        {
+        iToneFileSizeLimitKB = 0;
+        }
+    if ( iToneFileSizeLimitKB < 0 )
+        {
+        iToneFileSizeLimitKB = 0;
+        }
+  
+    __PHONELOG2( 
+        EBasic,
+        EPhoneControl, 
+        "CPhoneRingingtonePlayer::GetMaxToneFileSize - error (%d), aMaxSizeKB(%d)",
+        error,
+        iToneFileSizeLimitKB );       
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/src/cphoneringingtonecontroller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,588 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <telephonyvariant.hrh>
+#include "cphoneringingtonecontroller.h"
+#include "phonelogger.h"
+#include "cphoneringingtone.h"
+#include "tphonecmdparamringtone.h"
+#include "cphonecenrepproxy.h"
+#include "cphoneringingtoneplayer.h"
+#include "cphonettsplayer.h"
+
+// CONSTANTS
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneRingingToneController* CPhoneRingingToneController::NewL()
+    {
+    CPhoneRingingToneController* self = 
+        new ( ELeave ) CPhoneRingingToneController();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::CPhoneRingingToneController
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingToneController::CPhoneRingingToneController()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::ConstructL()" );
+    //iMediatorSender = CPhoneMediatorSender::NewL();
+    //iMediatorSender->AttachCoverUiObserverL( this );
+    
+    iRingingtonePlayer = CPhoneRingingtonePlayer::NewL(); 
+
+    // Check video player configuration.
+    iArbitraryVideoScaling = 
+    CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( 
+            KTelephonyLVFlagArbitraryVideoScaling );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::~CPhoneRingingToneController
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingToneController::~CPhoneRingingToneController()
+    {
+    /*if ( iMediatorSender )
+        {
+        iMediatorSender->DetachCoverUiObserver( this );
+        }*/
+
+    //delete iMediatorSender;
+    //iMediatorSender = NULL
+    
+    
+    delete iAudioVideoRingingTone;
+    iAudioVideoRingingTone = NULL;
+    delete iTTSPlayer;
+    iTTSPlayer = NULL;
+    delete iRingingtonePlayer;
+    iRingingtonePlayer = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayRingToneL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::PlayRingToneL( 
+                                         TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::PlayRingToneL()" );
+
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdRingTone )
+        {
+        TPhoneCmdParamRingTone* ringToneParam = 
+            static_cast<TPhoneCmdParamRingTone*>( aCommandParam );
+
+        const TInt volume = ringToneParam->Volume();
+        TProfileRingingType ringingType = 
+        static_cast<TProfileRingingType>( ringToneParam->RingingType() );
+        
+        if ( !iAudioVideoRingingTone )
+            {
+            iAudioVideoRingingTone = CPhoneRingingTone::NewL(
+                ringToneParam->RingTone() );
+            }
+
+        // Store pofile based parameters.
+        iAudioVideoRingingTone->SetFileName( ringToneParam->RingTone() );
+        iAudioVideoRingingTone->SetVolume( volume );
+        iAudioVideoRingingTone->SetRingingType ( ringingType );
+        iAudioVideoRingingTone->SetTtsToneToBePlayed(
+                ringToneParam->TextToSay().Length()? ETrue : EFalse);
+
+        
+        // Caller contact text and image and image has
+        // higher priority than video ringing tone set for caller.
+        if ( iAudioVideoRingingTone->IsVideoRingingTone() )
+            {
+            if ( ringToneParam->IsCallerImage() )
+                {
+                // Play only audio from video ringingtone
+                PlayAudioRingTone(
+                        volume,
+                        ringingType );
+                }
+            else
+                {
+                // Play video ring tone
+                const TBool ringToneIsPersonal = ringToneParam->Type() ==
+                    EPhoneRingTonePersonal;
+                PlayVideoRingingTone( 
+                    *iAudioVideoRingingTone, 
+                    volume, 
+                    ringingType,
+                    ringToneIsPersonal );
+                }
+            }
+        else
+            {
+            // Play text to speech, if available
+            if ( ringToneParam->TextToSay().Length() )
+                {
+                if (iTTSPlayer) 
+                    {
+                    delete iTTSPlayer;
+                    iTTSPlayer = NULL;
+                    }
+                iTTSPlayer = CPhoneTTSPlayer::NewL(iRingingtonePlayer); 
+                iTTSPlayer->AddTtsPlaybackIfNeeded();
+                iTTSPlayer->PlayTtsTone(
+                    ringToneParam->TextToSay(),
+                    iAudioVideoRingingTone );
+                }
+            // Play audio ring tone
+            PlayAudioRingTone( 
+                volume, 
+                ringingType );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayAudioRingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::PlayAudioRingTone( 
+    TInt aVolume, 
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::PlayAudioRingTone()" );
+    __PHONELOG2( 
+        EBasic,
+        EPhoneControl, 
+        "CPhoneRingingToneController::PlayAudioRingTone - aVolume(%d), aRingingType(%d)",
+        aVolume,
+        aRingingType );
+ 
+    if ( !iAudioVideoRingingTone ||
+         !iAudioVideoRingingTone->CheckAndHandleToneSizeLimit() )
+        {
+        iRingingtonePlayer->PlayDefaultTone( aVolume, aRingingType );
+        }
+    else if ( aRingingType == EProfileRingingTypeSilent )
+        {
+        iRingingtonePlayer->PlaySilentTone();
+        }
+    else if ( aRingingType == EProfileRingingTypeBeepOnce )
+        {
+        iRingingtonePlayer->PlayBeepOnce( aVolume );
+        }
+    else
+        {
+        iRingingtonePlayer->PlayProfileBasedTone(iAudioVideoRingingTone);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::MuteRingingToneOnAnswer
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::MuteRingingToneOnAnswer()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::MuteRingingToneOnAnswer()" );
+    
+  /*  if ( iVideoPlayer && iTonePlayingStatus == EVideoTonePlaying ||
+         iTonePlayingStatus == EPersonalVideoTonePlaying )
+        {
+        // Mute the video audio
+        iVideoPlayer->MuteVideoRingTone();
+        iTonePlayingStatus = ESilentVideoTonePlaying;
+        iVolume = 0;
+        }
+    else
+        {*/
+        DoMuteRingingTone();
+        //}
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::MuteRingingTone
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::MuteRingingTone()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::MuteRingingTone()" );
+    
+ /*   if ( iVideoPlayer && iTonePlayingStatus == EVideoTonePlaying ||
+         iTonePlayingStatus == EPersonalVideoTonePlaying )
+        {
+        // Mute the video audio
+        iVideoPlayer->MuteVideoRingTone();
+        iTonePlayingStatus = ESilentVideoTonePlaying;
+        iVolume = 0;
+        }
+    else
+        {*/
+        StopPlaying();
+        //}
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::StopPlaying
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::StopPlaying()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::StopPlaying()" );
+    if ( iTTSPlayer )
+        {
+        iTTSPlayer->StopPlaying();
+        delete iTTSPlayer;
+        iTTSPlayer = NULL;
+        }
+    iRingingtonePlayer->StopPlaying();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::DoMuteRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::DoMuteRingingTone()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::DoMuteRingingTone()" );
+    
+  /*  switch( iTonePlayingStatus )
+        {
+        case EVideoTonePlaying: // video ringing tone, fall through
+        case EPersonalVideoTonePlaying: // fall through
+        case ESilentVideoTonePlaying:
+            if ( iVideoPlayer )
+                {
+                iVideoPlayer->MuteVideoRingTone();
+                return;                 
+                }
+            break;
+            
+        default:
+            break;
+        }*/
+    
+    iRingingtonePlayer->MuteActiveAudioPlayer();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ConvertVideoRingingType
+// -----------------------------------------------------------------------------
+//
+MPhoneVideoPlayer::TPlayMode CPhoneRingingToneController::ConvertVideoRingingType(
+    TProfileRingingType aRingingType )
+    {
+    MPhoneVideoPlayer::TPlayMode playMode;
+        
+    switch ( aRingingType )
+        {
+        case EProfileRingingTypeAscending:
+            playMode = MPhoneVideoPlayer::EPlayAscending;
+            break;
+        case EProfileRingingTypeRingingOnce:
+            playMode = MPhoneVideoPlayer::EPlayOnce;
+            break;
+        case EProfileRingingTypeRinging:
+        default:
+            playMode = MPhoneVideoPlayer::EPlayInLoop;
+            break;
+        }
+    
+    return playMode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::SetVideoPlayer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::SetVideoPlayer( 
+    MPhoneVideoPlayer* aVideoPlayer )
+    {
+    iVideoPlayer = aVideoPlayer;    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayVideoRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::PlayVideoRingingTone( 
+    const CPhoneRingingTone& /*aRingingTone*/, 
+    TInt /*aVolume*/, 
+    TProfileRingingType /*aRingingType*/,
+    TBool /*aPersonalTone*/ )
+    {
+    /*
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::PlayVideoRingingTone()" );
+    
+    __ASSERT_DEBUG( iVideoPlayer, Panic( EPhoneViewGeneralError ) );
+    
+    iVolume = aVolume;
+    iRingingType = aRingingType;
+    TBool startTimer( ETrue );
+    
+     // Extended security check
+    if ( ExtendedSecurity() )
+        {
+        if ( !aRingingTone.IsFileInRom() &&
+             !aRingingTone.IsFileDrmProtected() )
+            {
+            __PHONELOG( EBasic, 
+                        EPhoneControl, 
+                        "CPhoneRingingToneController::HandleVideoPlayerError - PermissionDenied" );
+            iRingingtonePlayer->PlayDefaultTone( iVolume, iRingingType );
+            return;
+            }
+        __PHONELOG( EBasic, 
+                    EPhoneControl, 
+                    "CPhoneRingingToneController::HandleVideoPlayerError - ExtSecChk ok" );            
+            }
+         
+    // If flip is closed then show video on Cover UI
+    TBool videoPlaySentToCoverUi( EFalse );
+    TInt leaveCode( KErrNone );
+    if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) )
+        {
+        const TInt flipOpen = CPhonePubSubProxy::Instance()->Value(
+            KPSUidUikon, KUikFlipStatus );
+        if( !flipOpen ) 
+            {
+            TRAP( leaveCode, videoPlaySentToCoverUi = CoverUIPlayVideoRingingToneL( 
+                aRingingTone ) );
+            }
+        }
+    // Play ringing tone here if video play sending did leave or
+    // video playing wasn't delegated to Cover UI   
+    if( !leaveCode && videoPlaySentToCoverUi )
+        {
+        iTimer->After( KPhoneMaxRingingWaiting, this );
+        return;
+        }
+ 
+    __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingToneController::PlayVideoRingingTone - play" );
+    switch( aRingingType )
+        {
+        case EProfileRingingTypeSilent:
+            iVideoPlayer->PlayVideoRingTone( 
+                aRingingTone.FileName(),
+                ConvertVideoRingingType( aRingingType ),
+                0,
+                iArbitraryVideoScaling,
+                this );
+            iRingingtonePlayer->PlaySilentTone();
+            iVolume = 0; // for repeat
+            startTimer = EFalse; // no need for fallback
+            break;
+        
+        case EProfileRingingTypeBeepOnce:
+            iVideoPlayer->PlayVideoRingTone( 
+                aRingingTone.FileName(),
+                ConvertVideoRingingType( aRingingType ),
+                0,
+                iArbitraryVideoScaling,
+                this );
+            iRingingtonePlayer->BeepOnce( aVolume );
+            iVolume = 0; // for repeat
+            startTimer = EFalse; // no need for fallback
+            break;
+        default:
+            iVideoPlayer->PlayVideoRingTone( 
+                aRingingTone.FileName(),
+                ConvertVideoRingingType( aRingingType ),
+                iVolume,
+                iArbitraryVideoScaling,
+                this );
+            break;                
+        }
+
+    if ( aPersonalTone )
+        {
+        iTonePlayingStatus = EPersonalVideoTonePlaying;
+        }
+    else
+        {
+        iTonePlayingStatus = EVideoTonePlaying;
+        }
+
+    if ( startTimer && !iTimer->IsActive() )
+        {
+        // Start timer to guard video opening
+        iTimer->After( KPhoneMaxRingingWaiting, this );
+        }
+    */
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::HandleVideoPlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::HandleVideoPlayerError( 
+    TPhoneVideoPlayerErrorEvent /*aEvent*/,
+    TInt /*aError*/ )
+    {
+   /* __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::HandleVideoPlayerError()" );
+
+    if ( aError )
+        {
+        __PHONELOG1( EBasic, 
+                     EPhoneControl, 
+                     "CPhoneRingingToneController::HandleVideoPlayerError - error (%d)",
+                     aError );        
+        }
+  
+    // cancel guarding timer
+    iTimer->Cancel();
+
+    // to remove video window
+    iVideoPlayer->CancelVideoRingTone();
+
+    if ( iTonePlayingStatus == EPersonalVideoTonePlaying )
+        {
+        // Play default tone (active profile tone).
+        if ( iAudioVideoRingingTone &&
+             !iAudioVideoRingingTone->IsVideoRingingTone() )
+            {
+            PlayAudioRingTone( iVolume, iRingingType );
+            }
+        else // audio/video tone is video
+            {
+            PlayDefaultVideoAsync();
+            }
+        }
+    else
+        {
+        // Play backup tone
+        iRingingtonePlayer->PlayDefaultTone( iVolume, iRingingType );
+        }
+*/
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::HandleVideoPlayerInitComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::HandleVideoPlayerInitComplete()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::HandleVideoPlayerInitComplete()" );
+    
+    // cancel guarding timer
+    //iTimer->Cancel();
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::HandleVideoPlayerPlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::HandleVideoPlayerPlayingComplete()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::HandleVideoPlayerPlayingComplete()" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayDefaultVideoAsync
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::PlayDefaultVideoAsync()
+    {
+  /*  __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::PlayDefaultVideoAsync()" );    
+     
+    Cancel();
+
+    iState = EPlayingDefaultVideo; 
+
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    SetActive();*/
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ExtendedSecurity
+// -----------------------------------------------------------------------------
+//    
+TBool CPhoneRingingToneController::ExtendedSecurity() const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::ExtendedSecurity()" );
+    return EFalse;
+    //return iExtSecNeeded;        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::CoverUIPlayVideoRingingToneL
+// -----------------------------------------------------------------------------
+//   
+TBool CPhoneRingingToneController::CoverUIPlayVideoRingingToneL( 
+    const CPhoneRingingTone& aRingingTone )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::CoverUIPlayVideoRingingToneL()" );
+
+    TBool showVideo( EFalse );
+
+    RBuf8 data;
+    CleanupClosePushL( data );
+    data.CreateL( aRingingTone.FileName().Length() );
+    data.Copy( aRingingTone.FileName() );
+    /*TInt err = iMediatorSender->IssueCommand( 
+        EPhoneCmdCoverUiShowMultimediaRingingTone, 
+        data );
+    if ( err == KErrNone )
+        {
+        showVideo = ETrue;
+        iActiveCoverUICommand = ETrue;
+        }*/
+    CleanupStack::PopAndDestroy(); //data 
+
+    return showVideo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ShowMultimediaRingingToneResponseL
+// -----------------------------------------------------------------------------
+//   
+void CPhoneRingingToneController::ShowMultimediaRingingToneResponseL( 
+    TInt aStatus )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::ShowMultimediaRingingToneResponseL()" );
+
+    //iTimer->Cancel();
+    if( aStatus != KErrNone && iActiveCoverUICommand )
+        {
+        iRingingtonePlayer->PlayDefaultTone( iVolume, iRingingType );           
+        }
+    iActiveCoverUICommand = EFalse;
+    }
+
+
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/src/cphoneringingtoneplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,968 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <cntdef.h>
+#include <f32file.h>
+#include <featmgr.h>
+#include <utility.h>
+#include <AudioPreference.h>
+#include <ProfileEngineDomainCRKeys.h>
+#include <DRMHelperServerInternalCRKeys.h>
+#include <DRMHelper.h>
+#include <activeidle2domainpskeys.h>
+#include <data_caging_path_literals.hrh>
+#include "cphoneringingtoneplayer.h"
+#include "cphoneaudioplayer.h"
+#include "cphoneringingtone.h"
+#include "phonelogger.h"
+#include "cphonecenrepproxy.h"
+#include "cphonepubsubproxy.h"
+#include "cphonetimer.h"
+#include "phoneconstants.h"
+#include "phoneui.pan"
+
+CPhoneRingingtonePlayer::CPhoneRingingtonePlayer():
+CActive( CActive::EPriorityStandard ), iAsyncDeletePlayers( EPlayerCount )
+{
+    CActiveScheduler::Add( this );
+}
+
+CPhoneRingingtonePlayer::~CPhoneRingingtonePlayer()
+    {
+    iAsyncDeletePlayers.ResetAndDestroy();
+    iAsyncDeletePlayers.Close();
+        
+    delete iTimer;
+    
+    CleanupPlayers();
+    
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::CleanupPlayers()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::CleanupPlayers()" );
+    
+    delete iAudioPlayer;
+    iAudioPlayer = NULL;
+    delete iDefaultPlayer;
+    iDefaultPlayer = NULL;
+    delete iBeepOncePlayer;
+    iBeepOncePlayer = NULL;
+    delete iSilentPlayer;
+    iSilentPlayer = NULL;
+    delete iBackupPlayer;
+    iBackupPlayer = NULL;
+    delete iMdaServer;
+    iMdaServer = NULL;
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingtonePlayer* CPhoneRingingtonePlayer::NewL()
+    {
+    CPhoneRingingtonePlayer* self = 
+        new ( ELeave ) CPhoneRingingtonePlayer();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructL()
+    {
+    
+    // Construct timer.
+    iTimer = CPhoneTimer::NewL();
+    
+    for ( TInt i = EPlayerFirst; i <= EPlayerLast; i++ )
+        {
+        User::LeaveIfError( 
+            iAsyncDeletePlayers.Append( NULL ) );
+        }
+    
+    //disabling the DRM for the TB10.1wk46 release. Lets see if need to put it back and how.
+    //iExtSecNeeded = ( ( err == KErrNone ) && extSecNeeded ) ? ETrue : EFalse;
+    iExtSecNeeded = EFalse; 
+        
+    // Construct players.
+    if ( !iMdaServer )
+        {
+        iMdaServer = CMdaServer::NewL();
+        }
+    
+    // Backup player. 
+    ConstructBackupPlayer();
+    ConstructDefaultPlayerL();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayProfileBasedTone( CPhoneRingingTone* aAudioVideoRingingTone )
+    {
+    iAudioVideoRingingTone = aAudioVideoRingingTone;
+    // Construct player for line 1.
+     if ( !iAudioPlayer )
+         {
+         iAudioPlayer = ConstructTonePlayer( 
+             *iAudioVideoRingingTone, 
+             EPlayerAudio );
+         if ( !iTimer->IsActive() )
+             {
+             // Start timer, since the player is constructed.
+             iTimer->After( KPhoneMaxRingingWaiting, this );
+             }
+         }
+
+     // Start playing.
+     if ( !iAudioPlayer )
+         {
+         iTimer->Cancel();
+         PlayDefaultTone( aAudioVideoRingingTone->Volume(), 
+                          aAudioVideoRingingTone->RingingType() );
+         }
+     else
+         {
+         __PHONELOG( 
+             EBasic, 
+             EPhoneControl, 
+             "CPhoneRingingtonePlayer::PlayAudioRingTone - Start playing audio" );
+         iVolume = aAudioVideoRingingTone->Volume();
+         iRingingType = aAudioVideoRingingTone->RingingType();
+         //AddTtsPlaybackIfNeeded( aRingingType );
+         iTonePlayingStatus = EAudioTonePlaying;
+         iAudioPlayer->Play( 
+             ConvertRingingType( aAudioVideoRingingTone->RingingType() ),
+             aAudioVideoRingingTone->Volume(),
+             aAudioVideoRingingTone->TtsToneToBePlayed());
+         }
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayBeepOnce( TInt aVolume )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::BeepOnce()" );
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::BeepOnce - aVolume(%d)",
+        aVolume );
+
+    if ( !iBeepOncePlayer )
+        {
+        ConstructSequencePlayer( EPlayerBeepOnce );
+        }
+
+    if ( iBeepOncePlayer )
+        {
+        __PHONELOG( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneRingingtonePlayer::BeepOnce - Play" );
+        iTonePlayingStatus = EBeepOnce;
+        iBeepOncePlayer->Play( CPhoneAudioPlayer::ETypeRingingOnce, 
+            aVolume, EFalse );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlaySilentTone()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::PlaySilentTone()" );
+
+    if ( !iSilentPlayer )
+        {
+        ConstructSequencePlayer( EPlayerSilent );
+        }
+
+    if ( iSilentPlayer )
+        {
+        __PHONELOG( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneRingingtonePlayer::PlaySilentTone - play" );
+        iTonePlayingStatus = ESilentTonePlaying;
+        iSilentPlayer->Play( CPhoneAudioPlayer::ETypeRinging, 0, EFalse );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayDefaultTone( 
+    TInt aVolume, 
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::PlayDefaultTone()" );
+
+    if( aRingingType == EProfileRingingTypeSilent ||
+        aRingingType == EProfileRingingTypeBeepOnce )
+        {
+        return;
+        }
+        
+    if ( !iDefaultRingingTone )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::PlayDefaultTone - default tone does not exist, play backup..." );
+        PlayBackupTone( aVolume, aRingingType );
+        return;    
+        }
+
+    // Construct player.
+    if ( !iDefaultPlayer )
+        {
+        iDefaultPlayer = ConstructTonePlayer( 
+            *iDefaultRingingTone, 
+            EPlayerDefault );
+        if ( !iTimer->IsActive() )
+            {
+            iTimer->After( KPhoneMaxRingingWaiting, this );
+            }
+        }
+
+    // Start playing backup.
+    if ( !iDefaultPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::PlayDefaultTone - player not constructed, play backup..." );
+        iTimer->Cancel();
+        PlayBackupTone( aVolume, aRingingType );
+        }
+    else
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::PlayDefaultTone - play" );
+        iVolume = aVolume;
+        iRingingType = aRingingType;
+        iTonePlayingStatus = EDefaultTonePlaying;
+        iDefaultPlayer->Play( 
+            ConvertRingingType( aRingingType ), aVolume,
+            iAudioVideoRingingTone->TtsToneToBePlayed());
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::PlayBackupTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayBackupTone( 
+    TInt aVolume, 
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::PlayBackupTone()" );
+    __ASSERT_DEBUG( iBackupPlayer, Panic( EPhoneViewGeneralError ) );
+
+    if ( !iBackupPlayer )
+        {
+        ConstructBackupPlayer();
+        }
+
+    if ( iBackupPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::PlayBackupTone - play" );
+        iTonePlayingStatus = EBackupTonePlaying;
+/*
+        // playing text-to-speech, if necessary
+        iTtsToneToBePlayed = EFalse;
+        iTTsTimeOutCounter = 0;
+        iTtsDelayTimer->Cancel();
+        if ( iTtsPlayer )
+            {
+            iTtsPlayer->StopPlaying();
+            delete iTtsPlayer;
+            iTtsPlayer = NULL;
+            }*/
+
+        iBackupPlayer->Play( 
+            ConvertRingingType( aRingingType ), aVolume, EFalse );        
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::StopPlaying()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::StopPlaying()" );
+
+    iTimer->Cancel();
+
+    switch( iTonePlayingStatus )
+        {
+        case EAudioTonePlaying:
+            if( iAudioPlayer )
+                {
+                iAudioPlayer->StopPlaying();
+                delete iAudioPlayer;
+                iAudioPlayer = NULL;
+                }
+            break;
+        case EDefaultTonePlaying:
+            if ( iDefaultPlayer )
+                {
+                iDefaultPlayer->StopPlaying();
+                delete iDefaultPlayer;
+                iDefaultPlayer = NULL;
+                }
+            break;
+        case EBeepOnce:
+            if( iBeepOncePlayer )
+                {
+                iBeepOncePlayer->StopPlaying();
+                delete iBeepOncePlayer;
+                iBeepOncePlayer = NULL;
+                }
+            break;
+        case EBackupTonePlaying:
+            if( iBackupPlayer )
+                {
+                iBackupPlayer->StopPlaying();
+                }
+            break;
+        case ESilentTonePlaying:
+            if( iSilentPlayer )
+                {
+                iSilentPlayer->StopPlaying();
+                delete iSilentPlayer;
+                iSilentPlayer = NULL;
+                }
+            break;
+        case EVideoTonePlaying: // video ringing tone
+        case EPersonalVideoTonePlaying:
+        case ESilentVideoTonePlaying:
+            if ( iBeepOncePlayer )
+                {
+                iBeepOncePlayer->StopPlaying();
+                delete iBeepOncePlayer;
+                iBeepOncePlayer = NULL;                    
+                }
+                
+            if ( iSilentPlayer )
+                {
+                iSilentPlayer->StopPlaying();
+                delete iSilentPlayer;
+                iSilentPlayer = NULL;                    
+                }    
+            /*if ( iVideoPlayer )
+                {
+                iVideoPlayer->StopVideoRingTone();
+                }*/
+            if ( iAudioVideoRingingTone )
+                {
+                delete iAudioVideoRingingTone;
+                iAudioVideoRingingTone = NULL;    
+                }
+            break;
+        case EIdle:
+            // Do nothing here.
+            return;
+        default:
+            Panic( EPhoneViewCaseNotHandled );
+            break;
+        }
+
+    iTonePlayingStatus = EIdle;
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer* CPhoneRingingtonePlayer::ConstructTonePlayer( 
+    const CPhoneRingingTone& aRingingTone,
+    TInt aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::ConstructTonePlayer()" );
+    return CPhoneAudioPlayer::New(
+        aRingingTone, 
+        KAudioPriorityPhoneCall, 
+        KAudioPrefIncomingCall,
+        *this, 
+        aId,
+        iMdaServer,
+        aId == EPlayerDefault ? EFalse : iExtSecNeeded );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingtonePlayer::ConstructBackupPlayer()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::ConstructBackupPlayer()" );
+    TRAPD( err, ConstructBackupPlayerL() );
+    return err;
+    }
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructBackupPlayerL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::ConstructBackupPlayerL()" );
+
+    // Construct Backup player.
+    if ( !iBackupPlayer )
+        {
+        TFileName defaultSoundFile( KDriveZ );
+        defaultSoundFile.Append( KPhoneDefaultSoundFile );
+        iBackupPlayer = CPhoneAudioPlayer::NewL( 
+            defaultSoundFile,
+            KAudioPriorityPhoneCall,
+            KAudioPrefIncomingCall,
+            *this,
+            EPlayerBackup,
+            iMdaServer 
+            );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructDefaultPlayerL()
+    {
+    // Construct the default ringing tone
+    TBuf<KMaxFileName> defaultTone;
+    defaultTone = _L("z:\\data\\sounds\\digital\\Nokia tune.aac");        
+    TInt err(KErrNone);
+    
+    if ( err == KErrNone )
+        {
+        iDefaultRingingTone = CPhoneRingingTone::NewL( defaultTone );
+        }
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructSequencePlayer( TPlayerId aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::ConstructSequencePlayer()" );
+
+    // Construct players.
+    TRAPD( err, ConstructSequencePlayerL( aId ) );
+    if ( err )
+        {
+        __PHONELOG1( EBasic, EPhoneControl, 
+        "CPhoneRingingtonePlayer::ConstructSequencePlayer - err(%d)", err );    
+        }
+    }
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructSequencePlayerL( TPlayerId aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::ConstructSequencePlayerL()" );
+    // Construct beep once player
+    if ( aId == EPlayerBeepOnce )
+        {
+#ifdef __WINS__    
+        TParse* fp = new (ELeave) TParse();
+        fp->Set( KPhoneBeepOnceSoundFile, &KDC_RESOURCE_FILES_DIR, NULL ); 
+        TFileName fileName( fp->FullName() );
+        delete fp;
+
+        iBeepOncePlayer = CPhoneAudioPlayer::NewL(
+            fileName, 
+            KAudioPriorityPhoneCall,
+            KAudioPrefIncomingCall,
+            *this, 
+            EPlayerBeepOnce );
+#else
+        iBeepOncePlayer = CPhoneAudioPlayer::NewSeqL(
+            KPhoneBeepSequence(),
+            KAudioPriorityPhoneCall,
+            KAudioPrefIncomingCall,
+            *this, 
+            EPlayerBeepOnce );
+#endif // __WINS__
+        }
+
+    // Construct Silent Player.
+    else if ( aId == EPlayerSilent )
+        {
+#ifdef __WINS__
+        TParse* fp = new (ELeave) TParse();
+        fp->Set( KPhoneSilentSoundFile, &KDC_RESOURCE_FILES_DIR, NULL ); 
+        TFileName fileName( fp->FullName() );
+        delete fp;
+
+        iSilentPlayer = CPhoneAudioPlayer::NewL( 
+            fileName, 
+            KAudioPriorityPhoneCall,
+            KAudioPrefIncomingCall,
+            *this, 
+            EPlayerSilent );
+#else
+        iSilentPlayer = CPhoneAudioPlayer::NewSeqL(
+            KPhoneNoSoundSequence(),
+            KAudioPriorityPhoneCall,
+            KAudioPrefIncomingCall,
+            *this,
+            EPlayerSilent );
+#endif // __WINS__
+        }        
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleAudioPlayerError( 
+    TPhoneAudioPlayerErrorEvent /*aEvent*/, 
+    TInt aError, 
+    TInt /*aId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::HandleAudioPlayerError()" );
+    // This is called from CPhoneAudioPlayer - we do not 
+    // want to delete instances from which this method
+    // is called.
+    
+     __PHONELOG1( EBasic, 
+                 EPhoneControl, 
+                 "CPhoneRingingtonePlayer::HandleAudioPlayerError - error (%d)",
+                 aError ); 
+
+    const TBool deleteAll = ( aError == KErrServerTerminated );
+
+    if ( deleteAll )
+        {
+        // KErrServerTerminated is considered as fatal error. So we
+        // need to delete everything.
+
+        for ( TInt i = EPlayerFirst; i <= EPlayerLast; i++ )
+            {
+            DeletePlayerAsync( static_cast< TPlayerId >( i ) );
+            }
+
+        // Now all member audio players point to NULL, except
+        // those players in iAsyncDeletePlayers. Recreate 
+        // players.
+
+        ConstructBackupPlayer(); // Ignore error code.
+        }
+
+    iTimer->Cancel();
+    DoHandlePlayerError( !deleteAll, EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleAudioPlayerInitComplete( TInt aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::HandleAudioPlayerInitComplete()" );
+    // This is called from CPhoneAudioPlayer - we do not 
+    // want to delete instances from which this method
+    // is called. 
+
+    if ( iTonePlayingStatus == EAudioTonePlaying && aId == EPlayerAudio ||
+        iTonePlayingStatus == EDefaultTonePlaying && aId == EPlayerDefault )
+        {
+        iTimer->Cancel();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::HandlePlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandlePlayingComplete( TInt /*aId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::HandlePlayingComplete()" );
+    // This is called from CPhoneAudioPlayer - we do not 
+    // want to delete instances from which this method
+    // is called. 
+
+
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::HandlePlayingComplete - delete player - iTonePlayingStatus(%d)",
+        iTonePlayingStatus ); 
+/*    if (iAudioVideoRingingTone->TtsToneToBePlayed() &&
+        iAudioVideoRingingTone->RingingType() == EProfileRingingTypeRinging )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::HandlePlayingComplete - return" ); 
+        return;
+        }*/
+    
+    switch( iTonePlayingStatus )
+        {
+        case EAudioTonePlaying:
+            DeletePlayerAsync( EPlayerAudio );
+            iAudioPlayer = NULL;
+            break;
+            
+        case EDefaultTonePlaying:
+            DeletePlayerAsync( EPlayerDefault );
+            iDefaultPlayer = NULL;
+            break;
+            
+        case ESilentTonePlaying:
+            DeletePlayerAsync( EPlayerSilent );
+            iSilentPlayer = NULL;
+            break;
+            
+        case EBeepOnce:
+            DeletePlayerAsync( EPlayerBeepOnce );
+            iBeepOncePlayer = NULL;
+            break;
+            
+        case EVideoTonePlaying:
+        case EPersonalVideoTonePlaying:
+            DeletePlayerAsync( EPlayerBeepOnce );
+            iBeepOncePlayer = NULL;
+            return; // beep once + video
+            
+        case EBackupTonePlaying:
+            break;
+            
+        default:
+            Panic( EPhoneViewCaseNotHandled );
+            break;
+        }
+
+    iTonePlayingStatus = EIdle;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::DeletePlayerAsync( TPlayerId aPlayer )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::DeletePlayerAsync()" );
+    __ASSERT_DEBUG( aPlayer >= EPlayerFirst && aPlayer < iAsyncDeletePlayers.Count(),
+        Panic( EPhoneViewInvariant ) );
+        
+    // Player is not deleted here, but in RunL.
+    Cancel();
+
+    if ( iAsyncDeletePlayers[ aPlayer ] ) 
+        {
+        delete iAsyncDeletePlayers[ aPlayer ];
+        iAsyncDeletePlayers[ aPlayer ] = NULL;
+        }
+
+    CPhoneAudioPlayer** players[] =
+        {
+        &iAudioPlayer,
+        &iBeepOncePlayer,
+        &iSilentPlayer,
+        &iDefaultPlayer,
+        &iBackupPlayer,
+        &iTtsPlayer
+        };
+
+    __ASSERT_DEBUG( iAsyncDeletePlayers.Count() > aPlayer, Panic( EPhoneUtilsIndexOutOfBounds ) );
+    iAsyncDeletePlayers[ aPlayer ] = 
+        *(players[ aPlayer ]);
+    *(players[ aPlayer ]) = NULL;
+
+    iState = EDeletingAudioPlayer;
+
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::RunL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::RunL()" );
+
+    switch ( iState )
+        {
+        case EDeletingAudioPlayer:
+            {
+            for ( TInt i = EPlayerFirst; i <= EPlayerLast; i++ )
+                {
+                delete iAsyncDeletePlayers[ i ];
+                iAsyncDeletePlayers[ i ] = NULL;
+                }
+            }
+            break;
+
+      case EPlayingDefaultVideo:
+            {
+            //PlayAudioRingTone( iVolume, iRingingType );
+            }
+            break;
+
+        case EIdleState:  
+        default:
+            break;
+        } // switch iState
+    
+    iState = EIdleState;
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::DoCancel()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::DoCancel()" );
+    // Request is completed immediately before SetActive.
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneRingingtonePlayer::HandleCenRepChangeL
+// -----------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleCenRepChangeL( 
+    const TUid& aUid,
+    const TUint /*aId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::HandleCenRepChangeL()");
+    
+    if ( aUid == KCRUidDRMHelperServer )
+        {
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::HandleTimeOutL()" );
+   /* if( iActiveCoverUICommand )
+        {
+        iMediatorSender->CancelCommand( 
+            EPhoneCmdCoverUiShowMultimediaRingingTone );
+        PlayDefaultTone( iVolume, iRingingType );
+        iActiveCoverUICommand = EFalse;
+        }*/
+
+    // Guarding timer for startup has expired
+    if ( iTonePlayingStatus == EVideoTonePlaying ||
+         iTonePlayingStatus == ESilentVideoTonePlaying ||   
+         iTonePlayingStatus == EPersonalVideoTonePlaying )
+        {
+        //iVideoPlayer->CancelVideoRingTone(); // close video ringtone display
+        PlayDefaultTone( iVolume, iRingingType );
+        }
+    else
+        {
+        // Start new audio player synchronously.
+        DoHandlePlayerError( ETrue, ETrue );
+        }           
+    
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::DoHandlePlayerError(TBool aDelete, TBool aSync )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::DoHandlePlayerError()" );
+    switch ( iTonePlayingStatus )
+        {
+        case EAudioTonePlaying:
+            if ( aDelete )
+                {
+                if ( aSync )
+                    {
+                    delete iAudioPlayer;
+                    }
+                else
+                    {
+                    DeletePlayerAsync( EPlayerAudio );
+                    }
+
+                iAudioPlayer = NULL;
+                }
+
+#ifdef __WINS__
+            //PlayAudioRingTone( iVolume, iRingingType );
+            iTonePlayingStatus = EDefaultTonePlaying;
+#else
+            PlayDefaultTone( iVolume, iRingingType );
+#endif
+            break;
+        case EDefaultTonePlaying:
+            if ( aDelete )
+                {
+                if ( aSync )
+                    {
+                    delete iDefaultPlayer;
+                    }
+                else
+                    {
+                    DeletePlayerAsync( EPlayerDefault );
+                    }
+
+                iDefaultPlayer = NULL;
+                }
+
+            PlayBackupTone( iVolume, iRingingType );
+            break;
+        case ESilentTonePlaying:
+        case EBeepOnce:
+        case EBackupTonePlaying:
+            break;
+        default:
+            break;
+        }
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer::TRingingType CPhoneRingingtonePlayer::ConvertRingingType(
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::ConvertRingingType()" );
+
+    CPhoneAudioPlayer::TRingingType ringingType = 
+        CPhoneAudioPlayer::ETypeRinging;
+    switch ( aRingingType )
+        {
+        case EProfileRingingTypeRinging:
+            ringingType = CPhoneAudioPlayer::ETypeRinging;
+            break;
+
+        case EProfileRingingTypeAscending:
+            ringingType = CPhoneAudioPlayer::ETypeAscending;
+            break;
+
+        case EProfileRingingTypeRingingOnce:
+            ringingType = CPhoneAudioPlayer::ETypeRingingOnce;
+            break;
+
+        default:
+            break;
+        }
+    return ringingType;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//    
+CPhoneAudioPlayer* 
+CPhoneRingingtonePlayer::GetCurrentlyActiveAudioPlayer()
+    {    
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::GetCurrentlyActiveAudioPlayerWithTTs()" );
+
+    if( iAudioPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::GetCurrentlyActiveAudioPlayerWithTTs - audio player" ); 
+        return iAudioPlayer;         
+        }
+    else if ( iDefaultPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::GetCurrentlyActiveAudioPlayerWithTTs - default player" ); 
+        return iDefaultPlayer;     
+        }
+    else if( iBackupPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneRingingtonePlayer::GetCurrentlyActiveAudioPlayerWithTTs - backup player" ); 
+        return iBackupPlayer;
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::MuteActiveAudioPlayer()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingtonePlayer::ActiveAudioPlayer()" );
+
+    switch( iTonePlayingStatus )
+        {
+        case EAudioTonePlaying:
+            if( iAudioPlayer )
+                {
+                iAudioPlayer->MutePlaying();
+                }
+            break;
+            
+        case EDefaultTonePlaying:
+            if ( iDefaultPlayer )
+                {
+                return iDefaultPlayer->MutePlaying();
+                }
+            break;
+            
+        case EBeepOnce:
+            if( iBeepOncePlayer )
+                {
+                return iBeepOncePlayer->MutePlaying();
+                }
+            break;
+            
+        case EBackupTonePlaying:
+            if( iBackupPlayer )
+                {
+                return iBackupPlayer->MutePlaying();
+                }
+            break;
+            
+        case ESilentTonePlaying:
+            if( iSilentPlayer )
+                {
+                return iSilentPlayer->MutePlaying();
+                }
+            break;
+            
+        case EVideoTonePlaying: // video ringing tone
+        case EPersonalVideoTonePlaying:
+        case ESilentVideoTonePlaying:
+            if ( iBeepOncePlayer )
+                {
+                return iBeepOncePlayer->MutePlaying();                    
+                }    
+            else if ( iSilentPlayer )
+                {
+                return iSilentPlayer->MutePlaying();                    
+                }    
+            break;
+            
+        default:
+            break;
+        }      
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/src/cphonettsplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,502 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "cphonettsplayer.h"
+#include "cphoneringingtone.h"
+#include "cphoneringingtoneplayer.h"
+#include "phonelogger.h"
+#include <AudioPreference.h>
+
+CPhoneTTSPlayer::CPhoneTTSPlayer(CPhoneRingingtonePlayer* aRingingtonePlayer):
+iRingingtonePlayer (aRingingtonePlayer)
+    {
+    
+
+    }
+
+CPhoneTTSPlayer::~CPhoneTTSPlayer()
+    {
+    delete iTtsDelayTimer;
+    delete iTtsPlayer;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CPhoneTTSPlayer* CPhoneTTSPlayer::NewL(CPhoneRingingtonePlayer* aRingingtonePlayer)
+    {
+    CPhoneTTSPlayer* self = 
+        new ( ELeave ) CPhoneTTSPlayer(aRingingtonePlayer);
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::ConstructL()
+    {
+    iTtsDelayTimer = CPhoneTimer::NewL();
+    }
+      
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::PlayTtsTone( 
+    const TDesC& aTextToSay, 
+    CPhoneRingingTone* aAudioVideoRingingTone )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::PlayTtsTone()" );
+    //__PHONELOG2( EBasic, EPhoneControl, "CPhoneTTSPlayer::PlayTtsTone - aVolume(%d), aRingingType(%d)",
+    //    aVolume, aRingingType );
+
+    if ( iTtsPlayer )
+        {
+        delete iTtsPlayer;
+        iTtsPlayer = NULL;
+        }
+
+    //Set ringingtype for Tts.
+    iTtsRingingType = aAudioVideoRingingTone->RingingType();
+    iTtsVolume = aAudioVideoRingingTone->Volume();
+
+    // TTS should be a bit louder, than main component.
+    // No need to check for overflows, they are handled in SET_PHONE_VOLUME macro.
+    
+    TPtrC ttsHeader( KPhoneTtsHeader );
+    HBufC* preparedString = 
+        HBufC::New( aTextToSay.Length() + ttsHeader.Length() );
+
+    if ( preparedString )
+        {
+        TPtr pPreparedString = preparedString->Des();
+        pPreparedString.Append( ttsHeader );
+        pPreparedString.Append( aTextToSay );
+           
+        __PHONELOG1( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneTTSPlayer::PlayTtsTone - about to say %S",
+            &pPreparedString );
+
+        TRAPD( 
+            error, 
+            iTtsPlayer = CPhoneAudioPlayer::NewTtsL( 
+               *preparedString, 
+               KAudioPriorityPhoneCall, 
+               KAudioPrefTextToSpeechCallHardCoded,
+               *this, 
+               CPhoneRingingtonePlayer::EPlayerTts ) );
+        if( error == KErrNone ) 
+            {
+            // To be played when default or personal tone will be played
+            iTtsToneToBePlayed = ETrue;
+            }
+        __PHONELOG2(
+            EBasic,
+            EPhoneControl,
+            "CPhoneTTSPlayer::PlayTtsTone - error(%d), iTtsPhoneToBePlayed(%d)",
+            error, 
+            iTtsToneToBePlayed );
+
+        delete preparedString;  
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::StopPlaying()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::StopPlaying()" );
+
+    iTtsToneToBePlayed = EFalse;
+    iTTsTimeOutCounter = 0;
+    iTtsDelayTimer->Cancel();
+    if ( iTtsPlayer )
+        {
+        iTtsPlayer->StopPlaying();
+        delete iTtsPlayer;
+        iTtsPlayer = NULL;
+        }
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::HandleAudioPlayerError( 
+    TPhoneAudioPlayerErrorEvent /*aEvent*/, 
+    TInt /*aError*/, 
+    TInt /*aId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::HandleAudioPlayerError()" );
+
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::HandleAudioPlayerInitComplete( TInt /*aId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::HandleAudioPlayerInitComplete()" );
+    // This is called from CPhoneAudioPlayer - we do not 
+    // want to delete instances from which this method
+    // is called. 
+
+    if( iTtsToneToBePlayed )  
+        {
+        // Start TTS timer just before "normal ringtone component" starts 
+        // playing, i.e. after init completed.
+        if ( iTtsDelayIndex < iTtsDelaysCount )  
+            {
+            if ( !iTtsDelayTimer->IsActive() )
+                {
+                // There are TTS iterations to be played yet.
+                iTtsDelayTimer->After( 
+                    KPhoneTtsDelays[iTtsDelayIndex], 
+                    TCallBack( HandleTtsDelayTimeout, this ) );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::HandlePlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::HandlePlayingComplete( TInt aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::HandlePlayingComplete()" );
+    // This is called from CPhoneAudioPlayer - we do not 
+    // want to delete instances from which this method
+    // is called. 
+
+  /*  __PHONELOG2(
+        EBasic, 
+        EPhoneControl,
+        "CPhoneTTSPlayer::HandlePlayingComplete - aId(%d), iRingingType(%d)",
+        aId,
+        iRingingType );*/
+    __PHONELOG2(
+        EBasic, 
+        EPhoneControl,
+        "CPhoneTTSPlayer::HandlePlayingComplete - iTtsToneToBePlayed(%d), iTtsDelayIndex(%d)",
+        iTtsToneToBePlayed,
+        iTtsDelayIndex );
+
+    if ( aId == CPhoneRingingtonePlayer::EPlayerTts ) 
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::HandlePlayingComplete - resuming after TTS" );
+
+        // TTS playing complete, normal tone player should volume up.
+        if ( ( iTtsToneToBePlayed ) && ( ++iTtsDelayIndex < iTtsDelaysCount ) )  
+            {
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::HandlePlayingComplete - resuming after TTS first time" );
+            //Callers name is said once. increase tone player volume.    
+            SolveNewVolumeAndRamptime( ESaidOnce );
+            
+            if ( !iTtsDelayTimer->IsActive() )
+                {
+                // There are TTS iterations to be played yet.
+                iTtsDelayTimer->After( KPhoneTtsDelays[iTtsDelayIndex], 
+                    TCallBack( HandleTtsDelayTimeout,this ) );
+                }
+            }
+        else
+            {
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::HandlePlayingComplete - resuming after TTS second time" );
+            SolveNewVolumeAndRamptime( ESaidTwice );
+            }
+        
+        // No further processing. All TTS player-related events are not 
+        // "real" ringtone playing completions.
+        return;
+        }
+    //Case: RingintonePlayer has completed playing with following set: ring once and
+    // TTS is activated   
+   if ( iTtsRingingType == EProfileRingingTypeRingingOnce && 
+        iTtsToneToBePlayed )   
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::HandlePlayingComplete - ring once and TTS" );
+         if ( iTtsDelayIndex < iTtsDelaysCount )
+            {
+            ReStartRingingTonePlayer();
+            //Do not destroy player yet. Return.
+            return;            
+            }
+        }
+    //Case: RingintonePlayer has completed playing with following set: ringing 
+    //and TTS is activated. We need  to restart ringintoneplayer and new TTS
+    //iterations are required.
+    else if ( iTtsRingingType == EProfileRingingTypeRinging && iTtsToneToBePlayed )
+        {  
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::HandlePlayingComplete - ringing and TTS" );
+        if ( iTtsDelayIndex == iTtsDelaysCount )
+            {
+            //Case: Ringingtype is EProfileRingingTypeRinging. New TTS
+            //iterations are required.    
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::HandlePlayingComplete - need to restart TTS sequence" );
+            //TTS has completed its iterations,set index to zero. 
+            iTtsDelayIndex = 0;
+            if ( !iTtsDelayTimer->IsActive() )
+                {
+                //Restart TTS sequence
+                iTtsDelayTimer->After( 
+                    KPhoneTtsDelays[iTtsDelayIndex], 
+                    TCallBack( HandleTtsDelayTimeout, this ) ); 
+                }
+            }
+        
+        ReStartRingingTonePlayer();
+        //Do not destroy player yet. Return
+        return;  
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneTTSPlayer::HandleTtsDelayTimeout( TAny* object )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::HandleTtsDelayTimeout()" );
+    static_cast<CPhoneTTSPlayer*>( object )->
+        DoHandleTtsDelayTimeout();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::DoHandleTtsDelayTimeout()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::DoHandleTtsDelayTimeout()" );
+    __PHONELOG2( EBasic, EPhoneControl, "CPhoneTTSPlayer::DoHandleTtsDelayTimeout - iTtsRingingType(%d), iTTsTimeOutCounter(%d)",
+        iTtsRingingType, iTTsTimeOutCounter );
+
+    CPhoneAudioPlayer* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTs();        
+    
+    if ( !currPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::DoHandleTtsDelayTimeout - null current player" );
+        return;
+        }
+    TInt volume( 0 );
+     //Ascending case. TTs player needs to be ascending.
+    if ( iTtsRingingType == EProfileRingingTypeAscending )
+        {
+        //Volume needs to be different in different ascending steps
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::DoHandleTtsDelayTimeout - play ascending" ); 
+        if ( !iTTsTimeOutCounter )
+            {
+            //We are saying callers name for the first time in ascending mode.
+            //Say callers name by volume level KTtsVolumeMin.             
+            volume = KTtsVolumeMin;
+                
+            iTtsPlayer->Play(
+                ConvertRingingType( EProfileRingingTypeRingingOnce ),
+                volume,
+                iTtsToneToBePlayed );
+            }
+        else
+            {
+            //Checks the case that ringingtone is very quiet. Then do not play
+            //TTS too loud
+            volume = iTtsVolume < KTtsVolumeMin ? KTtsVolumeMin : KTtsVolumeAscendingRepeat;     
+                           
+            //We are saying callers name for the second time in ascending mode.
+            //Say callers name by volume level KTtsVolumeAscendingRepeat and decrease current players volume
+            //to KPlayerVolumeAscendingRepeat. RampTime is zero
+            currPlayer->SetNewVolumeAndRamptime( KPlayerVolumeAscendingRepeat, 0 );
+            iTtsPlayer->Play(
+                ConvertRingingType( EProfileRingingTypeRingingOnce ),
+                volume,
+                iTtsToneToBePlayed );
+            }
+       
+        }
+    else //Normal ringing case.
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::DoHandleTtsDelayTimeout - play normal" ); 
+        currPlayer->SetNewVolumeAndRamptime( iTtsVolume-5, 0 );                       
+        iTtsPlayer->Play(
+            ConvertRingingType( EProfileRingingTypeRingingOnce ),
+            iTtsVolume,
+            iTtsToneToBePlayed );
+        }
+      
+     iTTsTimeOutCounter++;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::AddTtsPlaybackIfNeeded
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::AddTtsPlaybackIfNeeded()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::AddTtsPlaybackIfNeeded()" );
+    if ( iTtsToneToBePlayed )   
+        {
+        iTtsDelayIndex = 0;
+        iTtsDelaysCount = KPhoneTtsDelaysCount;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::SolveNewVolumeAndRamptime
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::SolveNewVolumeAndRamptime( TTtsStatus aStatus )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::SolveNewVolumeAndRamptime()" );
+
+    CPhoneAudioPlayer* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTs();
+    if ( !currPlayer )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneTTSPlayer::SolveNewVolumeAndRamptime - null current player" );
+        return;
+        }
+    TInt ramptime( 0 );
+    //Here is handled the cases when Callers name is said. Sequence is:
+    //3 sec. tone + name + 4 sec. tone + name +the tone until the end. 
+    switch ( aStatus )
+        {
+        case ESaidOnce:
+            if ( iTtsRingingType == EProfileRingingTypeAscending )
+                {
+                //The ramptime could be ( 4 )* KPhoneTtsAscendingStep but now
+                //we are setting this to 0 because when Say callers name is said
+                //for first time: play ringing tone on level 3 for four secs.
+                ramptime = 0;
+                __PHONELOG1( EBasic, EPhoneControl, "CPhoneTTSPlayer::SolveNewVolumeAndRamptime - said once ascending - ramptime(%d)",
+                    ramptime ); 
+                currPlayer->SetNewVolumeAndRamptime( KPlayerVolumeAscendingRepeat, ramptime );
+                }
+            else
+                {
+                 //Normal ringingtone case. Adjust volume back to profile level. 
+                __PHONELOG1( EBasic, EPhoneControl, "CPhoneTTSPlayer::SolveNewVolumeAndRamptime - said once normal - ramptime(%d)",
+                    ramptime ); 
+                currPlayer->SetNewVolumeAndRamptime( iTtsVolume, 0 );    
+                }
+             break;
+        
+        case ESaidTwice:
+            if ( iTtsRingingType == EProfileRingingTypeAscending )
+                {
+                TInt vol = iTtsVolume;
+                if ( vol > KPlayerVolumeAscendingRepeat )
+                    {
+                    vol = vol - KTtsVolumeAscendingDecrease;
+                    }
+                          
+                //TTS playing complete for second time. increase tone player volume.
+                ramptime = ( vol )*KPhoneTtsAscendingStep;
+                __PHONELOG1( EBasic, EPhoneControl, "CPhoneTTSPlayer::SolveNewVolumeAndRamptime - said twice ascending - ramptime(%d)",
+                    ramptime ); 
+                currPlayer->SetNewVolumeAndRamptime( iTtsVolume, ramptime );
+                }
+            else
+                {
+                 //Normal ringingtone case. Adjust volume back to profile level. 
+                __PHONELOG1( EBasic, EPhoneControl, "CPhoneTTSPlayer::SolveNewVolumeAndRamptime - said twice normal - ramptime(%d)",
+                    ramptime ); 
+                currPlayer->SetNewVolumeAndRamptime( iTtsVolume, 0 );
+                }
+            break;
+        
+        default:
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//    
+CPhoneAudioPlayer* 
+CPhoneTTSPlayer::GetCurrentlyActiveAudioPlayerWithTTs()
+    {    
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::GetCurrentlyActiveAudioPlayerWithTTs()" );
+
+    return iRingingtonePlayer->GetCurrentlyActiveAudioPlayer();
+    }
+    
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//      
+void CPhoneTTSPlayer::ReStartRingingTonePlayer()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::ReStartRingingTonePlayer()" );
+
+    //First get currently active player which plays among TTS player.
+    CPhoneAudioPlayer* currPlayer = NULL;
+    currPlayer = GetCurrentlyActiveAudioPlayerWithTTs();   
+    if ( currPlayer )
+        {
+        currPlayer->ReStartPlaying();
+        }      
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer::TRingingType CPhoneTTSPlayer::ConvertRingingType(
+    TProfileRingingType aRingingType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneTTSPlayer::ConvertRingingType()" );
+
+    CPhoneAudioPlayer::TRingingType ringingType = 
+        CPhoneAudioPlayer::ETypeRinging;
+    switch ( aRingingType )
+        {
+        case EProfileRingingTypeRinging:
+            ringingType = CPhoneAudioPlayer::ETypeRinging;
+            break;
+
+        case EProfileRingingTypeAscending:
+            ringingType = CPhoneAudioPlayer::ETypeAscending;
+            break;
+
+        case EProfileRingingTypeRingingOnce:
+            ringingType = CPhoneAudioPlayer::ETypeRingingOnce;
+            break;
+
+        default:
+            break;
+        }
+    return ringingType;
+    }
+
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/main.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include "t_phoneringingtoneplayer.h"
+
+
+int main(int argc, char *argv[])
+{
+    HbApplication app (argc, argv); 
+    // main window widget instantiated. 
+    // includes decorators such as signal strength and battery life indicator.
+    HbMainWindow mainWindow;    
+    t_phoneringingtoneplayer* player = new t_phoneringingtoneplayer ();
+    mainWindow.addView(player);
+    mainWindow.setCurrentView(player);
+    mainWindow.show();
+    return app.exec();
+}
Binary file phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/sample.mp3 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui/QApplication.h>
+#include <hbaction.h>
+#include <hbmenu.h>
+#include <hbmenuitem.h>
+#include <hbpushbutton.h>
+#include <hbslider.h>
+#include <profile.hrh>
+#include "t_phoneringingtoneplayer.h"
+#include "cphoneringingtonecontroller.h"
+#include "TPhoneCmdParamRingTone.h"
+
+
+_LIT(KNokiatune, "Z:\\Data\\Sounds\\Digital\\Nokia tune.aac");
+_LIT(KSamplemp3, "c:\\Data\\Sounds\\Digital\\sample.mp3");
+
+t_phoneringingtoneplayer::t_phoneringingtoneplayer(QGraphicsItem *parent)
+    : HbView(parent), m_volume(10)
+{
+    setTitle(tr("t_ringingtoneplayer"));
+    createMenu();
+    createContent();
+
+    m_ringingtone.Format(KNokiatune);
+    m_ringingtoneplayer = CPhoneRingingToneController::NewL();
+}
+
+t_phoneringingtoneplayer::~t_phoneringingtoneplayer()
+{
+    delete m_ringingtoneplayer;
+}
+void t_phoneringingtoneplayer::createMenu()
+{
+    HbMenu *optionsMenu = menu();
+    /*connect(optionsMenu->addAction(tr("EProfileRingingTypeRinging"))->action(), SIGNAL(triggered()), this, SLOT(PlayRingingtoneRingning()));
+    connect(optionsMenu->addAction(tr("EProfileRingingTypeBeepOnce"))->action(), SIGNAL(triggered()), this, SLOT(PlayRingingtoneBeepOnce()));
+    connect(optionsMenu->addAction(tr("EProfileRingingTypeSilent"))->action(), SIGNAL(triggered()), this, SLOT(PlayRingingtoneSilence()));
+    connect(optionsMenu->addAction(tr("EProfileRingingTypeRinging+tts"))->action(), SIGNAL(triggered()), this, SLOT(PlayRingingtoneTTS()));  
+    connect(optionsMenu->addAction(tr("EProfileRingingTypeAscending"))->action(), SIGNAL(triggered()), this, SLOT(PlayRingingtoneAscending()));  
+    connect(optionsMenu->addAction(tr("EProfileRingingTypeRingingOnce"))->action(), SIGNAL(triggered()), this, SLOT(PlayRingingtoneOnce()));  
+    connect(optionsMenu->addAction(tr("Stop ringingtone"))->action(), SIGNAL(triggered()), this, SLOT(StopRingingtone())); */
+    connect(optionsMenu->addAction(tr("sample.mp3"))->action(), SIGNAL(triggered()), this, SLOT(SampleMP3()));
+    connect(optionsMenu->addAction(tr("nokiatune.aac"))->action(), SIGNAL(triggered()), this, SLOT(Nokiatuneaac()));
+    //connect(optionsMenu->addAction(tr("Quit"))->action(), SIGNAL(triggered()), qApp, SLOT(quit()));
+    
+    
+}
+
+void t_phoneringingtoneplayer::createContent()
+{
+    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
+    
+    HbPushButton *ringingButton = new HbPushButton(tr("EProfileRingingTypeRinging"), this); 
+    connect(ringingButton, SIGNAL(clicked()), this, SLOT(PlayRingingtoneRingning()));
+    
+    HbPushButton *beeponceButton = new HbPushButton(tr("EProfileRingingTypeBeepOnce"), this); 
+    connect(beeponceButton, SIGNAL(clicked()), this, SLOT(PlayRingingtoneBeepOnce()));
+    
+    HbPushButton *silenceButton = new HbPushButton(tr("EProfileRingingTypeSilent"), this); 
+    connect(silenceButton, SIGNAL(clicked()), this, SLOT(PlayRingingtoneSilence()));
+    
+    HbPushButton *ttsButton = new HbPushButton(tr("EProfileRingingTypeRinging+tts"), this); 
+    connect(ttsButton, SIGNAL(clicked()), this, SLOT(PlayRingingtoneTTS()));
+    
+    HbPushButton *ascendingButton = new HbPushButton(tr("EProfileRingingTypeAscending"), this); 
+    connect(ascendingButton, SIGNAL(clicked()), this, SLOT(PlayRingingtoneAscending()));
+
+    HbPushButton *ringingonceButton = new HbPushButton(tr("EProfileRingingTypeRingingOnce"), this); 
+    connect(ringingonceButton, SIGNAL(clicked()), this, SLOT(PlayRingingtoneOnce()));
+
+    HbPushButton *stopButton = new HbPushButton(tr("Stop ringingtone"), this); 
+    connect(stopButton, SIGNAL(clicked()), this, SLOT(StopRingingtone()));
+    
+    HbPushButton *quitButton = new HbPushButton(tr("Quit"), this); 
+    connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
+    
+    HbSlider *volumeslider = new HbSlider(this);
+    //volumeslider->setSliderType(HbSlider::VolumeSlider);
+    volumeslider->setOrientation( Qt::Horizontal);
+    volumeslider->setMinimum(EProfileRingingVolumeLevel1);
+    volumeslider->setMaximum(EProfileRingingVolumeLevel10);
+    volumeslider->setSingleStep(1);
+    volumeslider->setValue(m_volume);
+    connect(volumeslider, SIGNAL(valueChanged(int)), this, SLOT(volumeSliderChanged(int)));
+    
+    mainLayout->addItem(volumeslider);
+    mainLayout->addItem(ringingButton);
+    mainLayout->addItem(beeponceButton);
+    mainLayout->addItem(silenceButton);
+    mainLayout->addItem(ttsButton);
+    mainLayout->addItem(ascendingButton);
+    mainLayout->addItem(ringingonceButton);
+    mainLayout->addItem(stopButton);
+    mainLayout->addItem(quitButton);
+    //mainLayout->addStretch();
+
+    setLayout(mainLayout);
+}
+
+void t_phoneringingtoneplayer::PlayRingingtoneRingning()
+{
+    m_ringingtoneplayer->StopPlaying();
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(m_volume);
+    ringToneParam.SetRingingType(EProfileRingingTypeRinging);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( m_ringingtone);
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    m_ringingtoneplayer->PlayRingToneL( &ringToneParam );
+}
+
+void t_phoneringingtoneplayer::PlayRingingtoneBeepOnce()
+{
+    m_ringingtoneplayer->StopPlaying();
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(m_volume);
+    ringToneParam.SetRingingType(EProfileRingingTypeBeepOnce);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( m_ringingtone);
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    m_ringingtoneplayer->PlayRingToneL( &ringToneParam );
+}
+
+
+void t_phoneringingtoneplayer::PlayRingingtoneSilence()
+{
+    m_ringingtoneplayer->StopPlaying();
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(m_volume);
+    ringToneParam.SetRingingType(EProfileRingingTypeSilent);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( m_ringingtone);
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    m_ringingtoneplayer->PlayRingToneL( &ringToneParam );
+}
+
+void t_phoneringingtoneplayer::PlayRingingtoneTTS()
+{
+    m_ringingtoneplayer->StopPlaying();
+    _LIT(KTextToSay, "Mr. Brownstone");
+    TBuf<30> texttosay (KTextToSay);
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(m_volume);
+    ringToneParam.SetRingingType(EProfileRingingTypeRinging);
+    ringToneParam.SetTextToSay(texttosay);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( m_ringingtone);
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    m_ringingtoneplayer->PlayRingToneL( &ringToneParam );
+}
+
+void t_phoneringingtoneplayer::PlayRingingtoneAscending()
+{
+    m_ringingtoneplayer->StopPlaying();
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(m_volume);
+    ringToneParam.SetRingingType(EProfileRingingTypeAscending);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( m_ringingtone);
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    m_ringingtoneplayer->PlayRingToneL( &ringToneParam );
+}
+
+void t_phoneringingtoneplayer::PlayRingingtoneOnce()
+{
+    m_ringingtoneplayer->StopPlaying();
+
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(m_volume);
+    ringToneParam.SetRingingType(EProfileRingingTypeRingingOnce);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone(m_ringingtone);
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    m_ringingtoneplayer->PlayRingToneL( &ringToneParam );
+}
+
+
+void t_phoneringingtoneplayer::StopRingingtone()
+{
+    m_ringingtoneplayer->StopPlaying();
+}
+
+void t_phoneringingtoneplayer::SampleMP3()
+{
+   m_ringingtone.Format(KSamplemp3);
+}
+void t_phoneringingtoneplayer::Nokiatuneaac()
+{
+    m_ringingtone.Format(KNokiatune); 
+}
+void t_phoneringingtoneplayer::volumeSliderChanged(int value)
+    {
+    m_volume = value;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer.h	Fri Jun 04 10:19:18 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 T_PHONERINGINGTONEPLAYER_H
+#define T_PHONERINGINGTONEPLAYER_H
+
+#include <QGraphicsItem>
+#include <hbview.h>
+
+class CPhoneRingingToneController;
+
+class t_phoneringingtoneplayer : public HbView
+{
+    Q_OBJECT
+
+public:
+     t_phoneringingtoneplayer(QGraphicsItem *parent = 0);
+    ~t_phoneringingtoneplayer();
+
+private: 
+    void createMenu();
+    void createContent();
+    
+protected slots:
+    void PlayRingingtoneRingning();
+    void StopRingingtone();  
+    void PlayRingingtoneBeepOnce();
+    void PlayRingingtoneSilence();
+    void PlayRingingtoneTTS();
+    void PlayRingingtoneAscending();
+    void PlayRingingtoneOnce();
+    void SampleMP3();
+    void Nokiatuneaac();
+    void volumeSliderChanged(int value);
+
+private:
+    
+    TBuf<50> m_ringingtone;
+    int m_volume;
+    CPhoneRingingToneController *m_ringingtoneplayer;
+};
+
+#endif // T_PHONERINGINGTONEPLAYER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer.pro	Fri Jun 04 10:19:18 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:                                                        
+#                                                                     
+#
+
+TEMPLATE = app
+TARGET = t_phoneringingtoneplayer 
+CONFIG += hb 
+
+symbian {
+
+    INCLUDEPATH += /epoc32/include/platform/mw \
+                   /epoc32/include/platform \
+                   ../../../phoneuiutils/inc \
+                   ../../../phoneuiview2/src \
+                   ../../../phoneuiqtviewadapter/src \
+                   ../../inc \
+
+    LIBS += -lphoneringingtoneplayer \
+            -lphoneuiutils
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+}
+
+HEADERS   += t_phoneringingtoneplayer.h
+SOURCES   += t_phoneringingtoneplayer_reg.rss \
+             main.cpp \
+             t_phoneringingtoneplayer.cpp
+             
+RESOURCES +=
+
+symbian:TARGET.UID3 = 0xE87E453C
Binary file phoneapp/phoneringingtoneplayer/tsrc/t_phoneringingtoneplayer/t_phoneringingtoneplayer_armv5_urel.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/bwins/ut_cphoneringingtonecontrolleru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,8 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+	?StopPlaying@CPhoneRingingToneController@@QAEXXZ @ 2 NONAME ; void CPhoneRingingToneController::StopPlaying(void)
+	?PlayRingToneL@CPhoneRingingToneController@@QAEXPAVTPhoneCommandParam@@@Z @ 3 NONAME ; void CPhoneRingingToneController::PlayRingToneL(class TPhoneCommandParam *)
+	?NewL@CPhoneRingingToneController@@SAPAV1@XZ @ 4 NONAME ; class CPhoneRingingToneController * CPhoneRingingToneController::NewL(void)
+	?MuteRingingToneOnAnswer@CPhoneRingingToneController@@QAEXXZ @ 5 NONAME ; void CPhoneRingingToneController::MuteRingingToneOnAnswer(void)
+	?MuteRingingTone@CPhoneRingingToneController@@QAEXXZ @ 6 NONAME ; void CPhoneRingingToneController::MuteRingingTone(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/group/bld.inf	Fri Jun 04 10:19:18 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:
+*
+*/
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+
+PRJ_TESTMMPFILES
+ut_cphoneringingtonecontroller.mmp
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/group/ut_cphoneringingtonecontroller.mmp	Fri Jun 04 10:19:18 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 <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+ 
+TARGET          ut_cphoneringingtonecontroller.dll
+TARGETTYPE      dll
+UID             0x1000af5a 0x01700000
+
+CAPABILITY      ALL -TCB -DRM
+VENDORID        VID_DEFAULT
+
+SOURCEPATH              ../Src
+SOURCE                  ut_cphoneringingtonecontroller.cpp
+
+// Sources required by the test suite
+SOURCE                  ut_cphoneringingtonecontroller_dllmain.cpp
+
+// Code under test
+SOURCEPATH             ../../../../src
+SOURCE                  cphoneringingtonecontroller.cpp
+SOURCE                  cphoneringingtone.cpp
+
+SOURCEPATH              ../mocks
+SOURCE                  mock_cphoneringingtoneplayer.cpp
+SOURCE                  mock_cphonettsplayer.cpp 
+
+
+USERINCLUDE             ../Src
+
+USERINCLUDE             ../../../../../phoneuiqtviewadapter/src
+USERINCLUDE             ../../../../../phoneuicontrol/inc
+USERINCLUDE             ../../../../../phoneuiutils/inc
+USERINCLUDE             ../../../../../phoneui2/srcdata
+USERINCLUDE             ../../../../../phoneringingtoneplayer/inc
+
+APP_LAYER_SYSTEMINCLUDE                 // Application layer domain APIs
+SYSTEMINCLUDE           ../../../../inc     // phoneuicontrol inc
+SYSTEMINCLUDE           /epoc32/include/digia/eunit
+SYSTEMINCLUDE           /epoc32/include/mda/client
+SYSTEMINCLUDE           ../../../../../../inc    // phone internal headers
+
+
+SYSTEMINCLUDE           /epoc32/include/ecom
+SYSTEMINCLUDE           /epoc32/include/mmf/common
+SYSTEMINCLUDE           /epoc32/include/mmf/server
+
+
+
+LIBRARY                 eunit.lib
+LIBRARY                 eunitutil.lib
+
+
+LIBRARY                 phoneuiutils.lib
+LIBRARY                 euser.lib
+LIBRARY                 efsrv.lib                           // TParse
+LIBRARY                 ecom.lib                // for CSFIUtilsPhoneInterface plugin
+LIBRARY                 apgrfx.lib              // Apa server
+LIBRARY                 mediaclient.lib
+LIBRARY                 mediaclientaudio.lib
+LIBRARY                 drmhelper.lib
+LIBRARY                 apmime.lib
+LIBRARY                 caf.lib
+LIBRARY                 charconv.lib            // UTF-8 conversion for the TTS
+LIBRARY                 featmgr.lib             // FeatureManager
+LIBRARY                 mediatorclient.lib
+LIBRARY                 audiooutputrouting.lib  // Ringingtone output
+LIBRARY                 platformenv.lib                 // PathInfo
+LIBRARY                 symbianmock.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/mocks/mock_cphoneringingtoneplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <smcmockclassincludes.h>
+#include <ceunitalloctestcasedecorator.h>
+#include "cphoneringingtone.h"
+#include "cphoneringingtoneplayer.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::CPhoneRingingtonePlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingtonePlayer::CPhoneRingingtonePlayer(  )
+    :CActive( CActive::EPriorityStandard )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructL(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::~CPhoneRingingtonePlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingtonePlayer::~CPhoneRingingtonePlayer(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingtonePlayer * CPhoneRingingtonePlayer::NewL(  )
+    {
+    SMC_MOCK_NEWL0( CPhoneRingingtonePlayer * )
+
+    CPhoneRingingtonePlayer* self = new( ELeave ) CPhoneRingingtonePlayer;
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::PlayProfileBasedTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayProfileBasedTone( 
+        CPhoneRingingTone * aAudioVideoRingingTone )
+    {
+    SMC_MOCK_METHOD1( void, CPhoneRingingTone *, aAudioVideoRingingTone )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::PlayBeepOnce
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayBeepOnce( 
+        TInt aVolume )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aVolume )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::PlaySilentTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlaySilentTone(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::PlayVideoRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayVideoRingingTone( 
+        const CPhoneRingingTone & aRingingTone,
+        TInt aVolume,
+        TProfileRingingType aRingingType,
+        TBool aPersonalTone )
+    {
+    SMC_MOCK_METHOD4( void, const CPhoneRingingTone &, aRingingTone, 
+        TInt, aVolume, 
+        TProfileRingingType, aRingingType, 
+        TBool, aPersonalTone )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::PlayDefaultTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayDefaultTone( 
+        TInt aVolume,
+        TProfileRingingType aRingingType )
+    {
+    SMC_MOCK_METHOD2( void, TInt, aVolume, 
+        TProfileRingingType, aRingingType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::PlayBackupTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::PlayBackupTone( 
+        TInt aVolume,
+        TProfileRingingType aRingingType )
+    {
+    SMC_MOCK_METHOD2( void, TInt, aVolume, 
+        TProfileRingingType, aRingingType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::StopPlaying
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::StopPlaying(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::GetCurrentlyActiveAudioPlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer * CPhoneRingingtonePlayer::GetCurrentlyActiveAudioPlayer(  )
+    {
+    SMC_MOCK_METHOD0( CPhoneAudioPlayer * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::MuteActiveAudioPlayer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::MuteActiveAudioPlayer(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::HandleCenRepChangeL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleCenRepChangeL( 
+        const TUid & aUid,
+        const TUint aId )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD2( void, const TUid &, aUid, 
+        const TUint, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::RunL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::RunL(  )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::DoCancel(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::HandleAudioPlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleAudioPlayerError( 
+        TPhoneAudioPlayerErrorEvent aEvent,
+        TInt aError,
+        TInt aId )
+    {
+    SMC_MOCK_METHOD3( void, TPhoneAudioPlayerErrorEvent, aEvent, 
+        TInt, aError, 
+        TInt, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::HandleAudioPlayerInitComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleAudioPlayerInitComplete( 
+        TInt aId )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::HandlePlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandlePlayingComplete( 
+        TInt aId )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::HandleTimeOutL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::HandleTimeOutL(  )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::DeletePlayerAsync
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::DeletePlayerAsync( 
+        TPlayerId aPlayer )
+    {
+    SMC_MOCK_METHOD1( void, TPlayerId, aPlayer )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConstructSequencePlayer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructSequencePlayer( 
+        TPlayerId aPlayer )
+    {
+    SMC_MOCK_METHOD1( void, TPlayerId, aPlayer )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConstructSequencePlayerL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructSequencePlayerL( 
+        TPlayerId aPlayer )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD1( void, TPlayerId, aPlayer )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConstructBackupPlayer
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneRingingtonePlayer::ConstructBackupPlayer(  )
+    {
+    SMC_MOCK_METHOD0( TInt )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConstructBackupPlayerL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructBackupPlayerL(  )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConstructDefaultPlayerL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::ConstructDefaultPlayerL(  )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConstructTonePlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer * CPhoneRingingtonePlayer::ConstructTonePlayer( 
+        const CPhoneRingingTone & aRingingTone,
+        TInt aId )
+    {
+    SMC_MOCK_METHOD2( CPhoneAudioPlayer *, const CPhoneRingingTone &, aRingingTone, 
+        TInt, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConvertRingingType
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer::TRingingType CPhoneRingingtonePlayer::ConvertRingingType( 
+        TProfileRingingType aRingingType )
+    {
+    SMC_MOCK_METHOD1( CPhoneAudioPlayer::TRingingType, TProfileRingingType, aRingingType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::ConvertVideoRingingType
+// -----------------------------------------------------------------------------
+//
+MPhoneVideoPlayer::TPlayMode CPhoneRingingtonePlayer::ConvertVideoRingingType( 
+        TProfileRingingType aRingingType )
+    {
+    SMC_MOCK_METHOD1( MPhoneVideoPlayer::TPlayMode, TProfileRingingType, aRingingType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::CleanupPlayers
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::CleanupPlayers(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingtonePlayer::DoHandlePlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingtonePlayer::DoHandlePlayerError( 
+        TBool aDelete,
+        TBool aSync )
+    {
+    SMC_MOCK_METHOD2( void, TBool, aDelete, 
+        TBool, aSync )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/mocks/mock_cphonettsplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <smcmockclassincludes.h>
+#include "cphonettsplayer.h"
+#include "cphoneringingtone.h"
+#include "cphoneringingtoneplayer.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::CPhoneTTSPlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneTTSPlayer::CPhoneTTSPlayer( 
+        CPhoneRingingtonePlayer * aRingingtonePlayer )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::ConstructL(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::~CPhoneTTSPlayer
+// -----------------------------------------------------------------------------
+//
+CPhoneTTSPlayer::~CPhoneTTSPlayer(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneTTSPlayer * CPhoneTTSPlayer::NewL( 
+        CPhoneRingingtonePlayer * aRingingtonePlayer )
+    {
+    SMC_MOCK_NEWL1( CPhoneTTSPlayer *, CPhoneRingingtonePlayer *, aRingingtonePlayer )
+
+    CPhoneTTSPlayer* self = new( ELeave ) CPhoneTTSPlayer(aRingingtonePlayer);
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::PlayTtsTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::PlayTtsTone( 
+        const TDesC & aTextToSay,
+        CPhoneRingingTone * aAudioVideoRingingTone )
+    {
+    SMC_MOCK_METHOD2( void, const TDesC &, aTextToSay, 
+        CPhoneRingingTone *, aAudioVideoRingingTone )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::StopPlaying
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::StopPlaying(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::AddTtsPlaybackIfNeeded
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::AddTtsPlaybackIfNeeded(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::HandleAudioPlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::HandleAudioPlayerError( 
+        TPhoneAudioPlayerErrorEvent aEvent,
+        TInt aError,
+        TInt aId )
+    {
+    SMC_MOCK_METHOD3( void, TPhoneAudioPlayerErrorEvent, aEvent, 
+        TInt, aError, 
+        TInt, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::HandleAudioPlayerInitComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::HandleAudioPlayerInitComplete( 
+        TInt aId )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::HandlePlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::HandlePlayingComplete( 
+        TInt aId )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::HandleTtsDelayTimeout
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneTTSPlayer::HandleTtsDelayTimeout( 
+        TAny * object )
+    {
+    //SMC_MOCK_METHOD1( TInt, TAny *, object )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::DoHandleTtsDelayTimeout
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::DoHandleTtsDelayTimeout(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::GetCurrentlyActiveAudioPlayerWithTTs
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer * CPhoneTTSPlayer::GetCurrentlyActiveAudioPlayerWithTTs(  )
+    {
+    SMC_MOCK_METHOD0( CPhoneAudioPlayer * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::SolveNewVolumeAndRamptime
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::SolveNewVolumeAndRamptime( 
+        TTtsStatus aStatus )
+    {
+    SMC_MOCK_METHOD1( void, TTtsStatus, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::ReStartRingingTonePlayer
+// -----------------------------------------------------------------------------
+//
+void CPhoneTTSPlayer::ReStartRingingTonePlayer(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneTTSPlayer::ConvertRingingType
+// -----------------------------------------------------------------------------
+//
+CPhoneAudioPlayer::TRingingType CPhoneTTSPlayer::ConvertRingingType( 
+        TProfileRingingType aRingingType )
+    {
+    SMC_MOCK_METHOD1( CPhoneAudioPlayer::TRingingType, TProfileRingingType, aRingingType )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/src/ut_cphoneringingtonecontroller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,303 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <e32svr.h>
+#include <profile.hrh>
+#include <eunitmacros.h>
+#include <eunitdecorators.h>
+#include <csmcmockcontext.h>
+#include <msmcmockspecbuilder.h>
+#include <smcobjecttotypemapper.h>
+#include "ut_cphoneringingtonecontroller.h"
+#include "cphoneringingtonecontroller.h"
+#include "tphonecmdparamringtone.h"
+#include "cphoneringingtone.h"
+#include "cphonecenrepproxy.h"
+
+_LIT(KNokiatune, "Z:\\Data\\Sounds\\Digital\\Nokia tune.aac");
+
+
+
+// custom comparison method for matching expected and items
+TBool operator==( const CPhoneRingingTone& aData1, 
+        const CPhoneRingingTone& aData2 )
+    {
+    return ( aData1.FileName() == aData2.FileName()&& 
+             aData1.Volume() == aData2.Volume() &&
+             aData1.RingingType() == aData2.RingingType()&&
+             aData1.TtsToneToBePlayed() == aData2.TtsToneToBePlayed());
+    }
+
+// - Construction -----------------------------------------------------------
+
+ut_cphoneringingtonecontroller* ut_cphoneringingtonecontroller::NewL()
+    {
+    ut_cphoneringingtonecontroller* self = ut_cphoneringingtonecontroller::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+ut_cphoneringingtonecontroller* ut_cphoneringingtonecontroller::NewLC()
+    {
+    ut_cphoneringingtonecontroller* self = new( ELeave ) ut_cphoneringingtonecontroller();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+ut_cphoneringingtonecontroller::~ut_cphoneringingtonecontroller()
+    {
+    CSmcMockContext::Release();
+    }
+
+ut_cphoneringingtonecontroller::ut_cphoneringingtonecontroller()
+    {
+    }
+
+void ut_cphoneringingtonecontroller::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    iMockContext = CSmcMockContext::InstanceL();
+    }
+
+// - Test methods -----------------------------------------------------------
+
+
+
+void ut_cphoneringingtonecontroller::SetupL(  )
+    {
+    iMockContext->InitializeL();
+    // need to be created here otherwise memory leak can be detected.
+    iPhoneCenRepProxy = CPhoneCenRepProxy::Instance();
+    iRingingtoneplayer = CPhoneRingingToneController::NewL();
+    }
+    
+
+void ut_cphoneringingtonecontroller::Teardown(  )
+    {
+    delete CPhoneCenRepProxy::Instance();
+    UserSvr::DllFreeTls(KUidCenRepProxySingleton);
+    
+    delete iRingingtoneplayer; 
+    iRingingtoneplayer = NULL;
+    iMockContext->Reset();
+    }
+    
+
+void ut_cphoneringingtonecontroller::T_PlayRingingtoneRinging(  )
+    {
+    // Expected data
+    TBuf<50> ringingtone(KNokiatune);
+    _LIT8( KMethod, "CPhoneRingingtonePlayer::PlayProfileBasedTone" );
+    CPhoneRingingTone* aAudioVideoRingingTone = CPhoneRingingTone::NewL(ringingtone);
+    aAudioVideoRingingTone->SetRingingType(EProfileRingingTypeRinging);
+    aAudioVideoRingingTone->SetTtsToneToBePlayed(EFalse);
+    aAudioVideoRingingTone->SetVolume(5);
+    iMockContext->ExpectCallL( KMethod() ).WithL(aAudioVideoRingingTone);
+    
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(5);
+    ringToneParam.SetRingingType(EProfileRingingTypeRinging);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( ringingtone );
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    iRingingtoneplayer->PlayRingToneL( &ringToneParam );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    delete aAudioVideoRingingTone;
+    
+    }
+
+void ut_cphoneringingtonecontroller::T_PlayRingingtoneSilence(  )
+    {
+    _LIT8( KMethod, "CPhoneRingingtonePlayer::PlaySilentTone" );
+
+    iMockContext->ExpectCallL( KMethod() );
+    
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(5);
+    ringToneParam.SetRingingType(EProfileRingingTypeSilent);
+    // Set the profile ring tone
+    TBuf<50> ringingtone(KNokiatune);
+    ringToneParam.SetRingTone( ringingtone );
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    iRingingtoneplayer->PlayRingToneL( &ringToneParam );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    }
+
+void ut_cphoneringingtonecontroller::T_PlayRingingtoneBeepOnce(  )
+    {
+    _LIT8( KMethod, "CPhoneRingingtonePlayer::PlayBeepOnce" );
+    iMockContext->ExpectCallL( KMethod() ).WithL(5);    
+    
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(5);
+    ringToneParam.SetRingingType(EProfileRingingTypeBeepOnce);
+    // Set the profile ring tone
+    TBuf<50> ringingtone(KNokiatune);
+    ringToneParam.SetRingTone( ringingtone );
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    iRingingtoneplayer->PlayRingToneL( &ringToneParam );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    }
+
+void ut_cphoneringingtonecontroller::T_PlayRingingtoneAscending(  )
+    {
+    TBuf<50> ringingtone(KNokiatune);
+    _LIT8( KMethod, "CPhoneRingingtonePlayer::PlayProfileBasedTone" );
+    CPhoneRingingTone* aAudioVideoRingingTone = CPhoneRingingTone::NewL(ringingtone);
+    aAudioVideoRingingTone->SetRingingType(EProfileRingingTypeAscending);
+    aAudioVideoRingingTone->SetTtsToneToBePlayed(EFalse);
+    aAudioVideoRingingTone->SetVolume(5);
+    iMockContext->ExpectCallL( KMethod() ).WithL(aAudioVideoRingingTone);
+    
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(5);
+    ringToneParam.SetRingingType(EProfileRingingTypeAscending);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( ringingtone );
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    iRingingtoneplayer->PlayRingToneL( &ringToneParam );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    delete aAudioVideoRingingTone;
+    }
+
+void ut_cphoneringingtonecontroller::T_PlayRingingtoneRingingOnce(  )
+    {
+    TBuf<50> ringingtone(KNokiatune);
+    _LIT8( KMethod, "CPhoneRingingtonePlayer::PlayProfileBasedTone" );
+    CPhoneRingingTone* aAudioVideoRingingTone = CPhoneRingingTone::NewL(ringingtone);
+    aAudioVideoRingingTone->SetRingingType(EProfileRingingTypeRingingOnce);
+    aAudioVideoRingingTone->SetTtsToneToBePlayed(EFalse);
+    aAudioVideoRingingTone->SetVolume(5);
+    iMockContext->ExpectCallL( KMethod() ).WithL(aAudioVideoRingingTone);
+    
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(5);
+    ringToneParam.SetRingingType(EProfileRingingTypeRingingOnce);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( ringingtone );
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    iRingingtoneplayer->PlayRingToneL( &ringToneParam );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    delete aAudioVideoRingingTone;
+    }
+
+void ut_cphoneringingtonecontroller::T_PlayRingingtoneTTS()
+{
+    // Expected data
+    _LIT(KTextToSay, "Mr. Brownstone");
+    TBuf<30> texttosay (KTextToSay);
+    TBuf<50> ringingtone(KNokiatune);
+    CPhoneRingingTone* aAudioVideoRingingTone = CPhoneRingingTone::NewL(ringingtone);
+    aAudioVideoRingingTone->SetRingingType(EProfileRingingTypeRinging);
+    aAudioVideoRingingTone->SetTtsToneToBePlayed(ETrue);
+    aAudioVideoRingingTone->SetVolume(5);
+    _LIT8( KMethod, "CPhoneTTSPlayer::NewL" );
+    iMockContext->ExpectCallL( KMethod() );
+    _LIT8( KMethod2, "CPhoneTTSPlayer::PlayTtsTone" );
+    iMockContext->ExpectCallL( KMethod2() ).WithL(KTextToSay(), aAudioVideoRingingTone);   
+    _LIT8( KMethod3, "CPhoneRingingtonePlayer::PlayProfileBasedTone" );
+    iMockContext->ExpectCallL( KMethod3() ).WithL(aAudioVideoRingingTone);
+
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(5);
+    ringToneParam.SetRingingType(EProfileRingingTypeRinging);
+    ringToneParam.SetTextToSay(texttosay);
+    // Set the profile ring tone
+    ringToneParam.SetRingTone( ringingtone);
+    ringToneParam.SetType( EPhoneRingToneProfile );
+
+    iRingingtoneplayer->PlayRingToneL( &ringToneParam );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    delete aAudioVideoRingingTone;
+}
+
+void ut_cphoneringingtonecontroller::T_StopRingingtone()
+{
+    _LIT8( KMethod, "CPhoneRingingtonePlayer::StopPlaying" );
+    iMockContext->ExpectCallL( KMethod() );
+
+    iRingingtoneplayer->StopPlaying();
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+}
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+    ut_cphoneringingtonecontroller,
+    "Add test suite description here.",
+    "UNIT" )
+
+EUNIT_TEST(
+    "T_PlayRingingtoneRinging",
+    "",
+    "",
+    "FUNCTIONALITY",
+    SetupL, T_PlayRingingtoneRinging, Teardown)
+    
+EUNIT_TEST(
+    "T_PlayRingingtoneSilence",
+    "",
+    "",
+    "FUNCTIONALITY",
+    SetupL, T_PlayRingingtoneSilence, Teardown)
+
+EUNIT_TEST(
+    "T_PlayRingingtoneBeepOnce",
+    "",
+    "",
+    "FUNCTIONALITY",
+    SetupL, T_PlayRingingtoneBeepOnce, Teardown)
+    
+EUNIT_TEST(
+    "T_PlayRingingtoneAscending",
+    "",
+    "",
+    "FUNCTIONALITY",
+    SetupL, T_PlayRingingtoneAscending, Teardown)    
+     
+EUNIT_TEST(
+    "T_PlayRingingtoneAscending",
+    "",
+    "",
+    "FUNCTIONALITY",
+    SetupL, T_PlayRingingtoneRingingOnce, Teardown)   
+
+EUNIT_TEST(
+    "T_PlayRingingtoneTTS",
+    "",
+    "",
+    "FUNCTIONALITY",
+    SetupL, T_PlayRingingtoneTTS, Teardown)
+    
+EUNIT_TEST(
+    "T_StopRingingtone",
+    "",
+    "",
+    "FUNCTIONALITY",
+    SetupL, T_StopRingingtone, Teardown)
+EUNIT_END_TEST_TABLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/src/ut_cphoneringingtonecontroller.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef __UT_CPHONERINGINGTONEPLAYER_H__
+#define __UT_CPHONERINGINGTONEPLAYER_H__
+
+// INCLUDES
+#include <ceunittestsuiteclass.h>
+#include <eunitdecorators.h>
+
+
+// FORWARD DECLARATIONS
+
+class CPhoneRingingToneController;
+class CSmcMockContext;
+class CPhoneRingingTone;
+class CPhoneCenRepProxy;
+
+
+// custom comparison method for matching expected and actual SData items
+TBool operator==( const CPhoneRingingTone& aData1, const CPhoneRingingTone& aData2 );
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( ut_cphoneringingtonecontroller )
+	: public CEUnitTestSuiteClass
+    {
+    public:  // Constructors and destructor
+
+        static ut_cphoneringingtonecontroller* NewL();
+        static ut_cphoneringingtonecontroller* NewLC();
+        ~ut_cphoneringingtonecontroller();
+
+    private: // Constructors
+
+        ut_cphoneringingtonecontroller();
+        void ConstructL();
+
+    private: // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         void T_PlayRingingtoneRinging();
+         
+         void T_PlayRingingtoneSilence();
+         
+         void T_PlayRingingtoneBeepOnce();
+         
+         void T_PlayRingingtoneAscending();
+         
+         void T_PlayRingingtoneRingingOnce();
+         
+         void T_PlayRingingtoneTTS();
+         
+         void T_StopRingingtone();
+        
+
+    private: // Data
+
+        CPhoneRingingToneController* iRingingtoneplayer;
+        CPhoneCenRepProxy* iPhoneCenRepProxy; 
+        CSmcMockContext* iMockContext; 
+        
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  __UT_CPHONERINGINGTONEPLAYER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneringingtoneplayer/tsrc/ut_cphoneringingtonecontroller/src/ut_cphoneringingtonecontroller_dllmain.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_cphoneringingtonecontroller.h"
+#include <ceunittestsuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return ut_cphoneringingtonecontroller::NewL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/bwins/phonestringloaderu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+EXPORTS
+	?LoadL@StringLoader@@SAPAVHBufC16@@HPAVCCoeEnv@@@Z @ 1 NONAME ; class HBufC16 * StringLoader::LoadL(int, class CCoeEnv *)
+	?LoadL@StringLoader@@SAPAVHBufC16@@HABVMDesC16Array@@ABV?$CArrayFix@H@@PAVCCoeEnv@@@Z @ 2 NONAME ; class HBufC16 * StringLoader::LoadL(int, class MDesC16Array const &, class CArrayFix<int> const &, class CCoeEnv *)
+	?LoadLC@StringLoader@@SAPAVHBufC16@@HABVTDesC16@@HPAVCCoeEnv@@@Z @ 3 NONAME ; class HBufC16 * StringLoader::LoadLC(int, class TDesC16 const &, int, class CCoeEnv *)
+	?Load@StringLoader@@SAXAAVTDes16@@HPAVCCoeEnv@@@Z @ 4 NONAME ; void StringLoader::Load(class TDes16 &, int, class CCoeEnv *)
+	?LoadLC@StringLoader@@SAPAVHBufC16@@HPAVCCoeEnv@@@Z @ 5 NONAME ; class HBufC16 * StringLoader::LoadLC(int, class CCoeEnv *)
+	?LoadLC@StringLoader@@SAPAVHBufC16@@HHPAVCCoeEnv@@@Z @ 6 NONAME ; class HBufC16 * StringLoader::LoadLC(int, int, class CCoeEnv *)
+	?LoadLC@StringLoader@@SAPAVHBufC16@@HABVMDesC16Array@@PAVCCoeEnv@@@Z @ 7 NONAME ; class HBufC16 * StringLoader::LoadLC(int, class MDesC16Array const &, class CCoeEnv *)
+	?LoadL@StringLoader@@SAPAVHBufC16@@HABV?$CArrayFix@H@@PAVCCoeEnv@@@Z @ 8 NONAME ; class HBufC16 * StringLoader::LoadL(int, class CArrayFix<int> const &, class CCoeEnv *)
+	?LoadLC@StringLoader@@SAPAVHBufC16@@HABVMDesC16Array@@ABV?$CArrayFix@H@@PAVCCoeEnv@@@Z @ 9 NONAME ; class HBufC16 * StringLoader::LoadLC(int, class MDesC16Array const &, class CArrayFix<int> const &, class CCoeEnv *)
+	?LoadL@StringLoader@@SAPAVHBufC16@@HHPAVCCoeEnv@@@Z @ 10 NONAME ; class HBufC16 * StringLoader::LoadL(int, int, class CCoeEnv *)
+	?LoadL@StringLoader@@SAPAVHBufC16@@HABVMDesC16Array@@PAVCCoeEnv@@@Z @ 11 NONAME ; class HBufC16 * StringLoader::LoadL(int, class MDesC16Array const &, class CCoeEnv *)
+	?LoadLC@StringLoader@@SAPAVHBufC16@@HABVTDesC16@@PAVCCoeEnv@@@Z @ 12 NONAME ; class HBufC16 * StringLoader::LoadLC(int, class TDesC16 const &, class CCoeEnv *)
+	?LoadLC@StringLoader@@SAPAVHBufC16@@HABV?$CArrayFix@H@@PAVCCoeEnv@@@Z @ 13 NONAME ; class HBufC16 * StringLoader::LoadLC(int, class CArrayFix<int> const &, class CCoeEnv *)
+	?LoadL@StringLoader@@SAPAVHBufC16@@HABVTDesC16@@PAVCCoeEnv@@@Z @ 14 NONAME ; class HBufC16 * StringLoader::LoadL(int, class TDesC16 const &, class CCoeEnv *)
+	?LoadL@StringLoader@@SAPAVHBufC16@@HABVTDesC16@@HPAVCCoeEnv@@@Z @ 15 NONAME ; class HBufC16 * StringLoader::LoadL(int, class TDesC16 const &, int, class CCoeEnv *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/eabi/phonestringloaderu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+EXPORTS
+	_ZN12StringLoader4LoadER6TDes16iP7CCoeEnv @ 1 NONAME
+	_ZN12StringLoader5LoadLEiP7CCoeEnv @ 2 NONAME
+	_ZN12StringLoader5LoadLEiRK12MDesC16ArrayP7CCoeEnv @ 3 NONAME
+	_ZN12StringLoader5LoadLEiRK12MDesC16ArrayRK9CArrayFixIiEP7CCoeEnv @ 4 NONAME
+	_ZN12StringLoader5LoadLEiRK7TDesC16P7CCoeEnv @ 5 NONAME
+	_ZN12StringLoader5LoadLEiRK7TDesC16iP7CCoeEnv @ 6 NONAME
+	_ZN12StringLoader5LoadLEiRK9CArrayFixIiEP7CCoeEnv @ 7 NONAME
+	_ZN12StringLoader5LoadLEiiP7CCoeEnv @ 8 NONAME
+	_ZN12StringLoader6LoadLCEiP7CCoeEnv @ 9 NONAME
+	_ZN12StringLoader6LoadLCEiRK12MDesC16ArrayP7CCoeEnv @ 10 NONAME
+	_ZN12StringLoader6LoadLCEiRK12MDesC16ArrayRK9CArrayFixIiEP7CCoeEnv @ 11 NONAME
+	_ZN12StringLoader6LoadLCEiRK7TDesC16P7CCoeEnv @ 12 NONAME
+	_ZN12StringLoader6LoadLCEiRK7TDesC16iP7CCoeEnv @ 13 NONAME
+	_ZN12StringLoader6LoadLCEiRK9CArrayFixIiEP7CCoeEnv @ 14 NONAME
+	_ZN12StringLoader6LoadLCEiiP7CCoeEnv @ 15 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/phonestringloader.pri	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+SOURCES += ./src/stringloader.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/phonestringloader.pro	Fri Jun 04 10:19:18 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: Project file for building stringloader component
+#
+#
+
+TEMPLATE = lib
+TARGET = phonestringloader
+CONFIG += hb
+
+symbian {
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA =1
+    TARGET.UID3 = 0x20029F85
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+    INCLUDEPATH += ../../inc \  
+                   ../phoneuiutils/inc \
+                   ../phoneuiview2/inc \
+                   ../phoneuiqtviewadapter/inc
+                   
+    LIBS += -lphoneuiqtviewadapter
+    LIBS += -lphoneuiqtview
+    
+    defFiles = \
+        "$${LITERAL_HASH}ifdef WINS" \
+            "DEFFILE bwins/phonestringloader.def" \
+        "$${LITERAL_HASH}else" \
+            "DEFFILE eabi/phonestringloader.def" \
+        "$${LITERAL_HASH}endif"
+    
+    MMP_RULES += defFiles
+}
+
+# Input
+include(phonestringloader.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/src/stringloader.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,418 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  String loader class.
+*
+*/
+
+#include <exception> // must be before e32base.h so uncaught_exception gets defined
+#include <StringLoader.h>
+#include "phoneresourceadapter.h"
+#include "phoneaction.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// StringLoader::StringLoader
+// -----------------------------------------------------------------------------
+//
+/*
+StringLoader::StringLoader(  )
+    {
+    
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// StringLoader::Load
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void StringLoader::Load( 
+        TDes & aDest,
+        TInt aResourceId,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        aDest.Copy (text->text ().utf16 ());
+        delete text;        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadL( 
+        TInt aResourceId,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewL (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::New (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadL( 
+        TInt aResourceId,
+        TInt aInt,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, aInt);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewL (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::New (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadL( 
+        TInt aResourceId,
+        const TDesC & aString,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aString);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewL (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::New (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadL( 
+        TInt aResourceId,
+        const TDesC & aString,
+        TInt aInt,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aString, aInt);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewL (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::New (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadL( 
+        TInt aResourceId,
+        const CArrayFix<TInt> & aInts,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aInts);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewL (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::New (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadL( 
+        TInt aResourceId,
+        const MDesCArray & aStrings,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aStrings);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewL (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::New (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadL( 
+        TInt aResourceId,
+        const MDesCArray & aStrings,
+        const CArrayFix<TInt> & aInts,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aStrings, &aInts);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewL (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::New (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadLC( 
+        TInt aResourceId,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewLC (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::NewLC (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadLC( 
+        TInt aResourceId,
+        TInt aInt,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, aInt);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewLC (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::NewLC (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadLC( 
+        TInt aResourceId,
+        const TDesC & aString,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aString);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewLC (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::NewLC (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadLC( 
+        TInt aResourceId,
+        const TDesC & aString,
+        TInt aInt,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aString, aInt);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewLC (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::NewLC (1);
+    }
+    return buf;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadLC( 
+        TInt aResourceId,
+        const CArrayFix<TInt> & aInts,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aInts);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewLC (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::NewLC (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadLC( 
+        TInt aResourceId,
+        const MDesCArray & aStrings,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aStrings);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewLC (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::NewLC (1);
+    }
+    return buf;
+    }
+
+
+// -----------------------------------------------------------------------------
+// StringLoader::LoadLC
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC * StringLoader::LoadLC( 
+        TInt aResourceId,
+        const MDesCArray & aStrings,
+        const CArrayFix<TInt> & aInts,
+        CCoeEnv * aLoaderEnv )
+    {
+    Q_UNUSED (aLoaderEnv);
+    HBufC *buf;
+    QMap<PhoneAction::ActionType, PhoneAction *> map = PhoneResourceAdapter::Instance ()->convert (aResourceId, &aStrings, &aInts);
+    if (map.contains (PhoneAction::Text)) {
+        PhoneAction *text = map [PhoneAction::Text];
+        buf = HBufC::NewLC (text->text ().size ());
+        *buf = text->text ().utf16 ();
+        delete text;
+    } else {
+        // TODO: this else branch MUST be removed after all strings are localized!
+        //       now here only to prevent crashing
+        buf = HBufC::NewLC (1);
+    }
+    return buf;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/tsrc/runtests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+del \epoc32\winscw\c\private\EF78FF4E\ut_phonestringloader.log
+\epoc32\release\winscw\udeb\ut_phonestringloader.exe -o ut_phonestringloader.log
+type \epoc32\winscw\c\private\EF78FF4E\ut_phonestringloader.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/tsrc/unit.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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
+SUBDIRS += ut_phonestringloader
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/tsrc/ut_phonestringloader/phoneresourceadapter.h	Fri Jun 04 10:19:18 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: 
+*
+*/
+
+#include <QObject>
+#include <QMap>
+#include "phoneaction.h"
+
+#ifndef PHONERESOURCEADAPTER_H
+#define PHONERESOURCEADAPTER_H
+
+class PhoneResourceAdapter : public QObject
+{
+    Q_OBJECT
+public:
+    static PhoneResourceAdapter* Instance(QObject *parent = 0);
+    QMap<PhoneAction::ActionType, PhoneAction *> convert (int symbianResourceId, ...);
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/tsrc/ut_phonestringloader/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,392 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for StringLoader.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <hbapplication.h>
+#include <QSignalSpy>
+//#include <hbglobal_p.h>
+#include <stringloader.h>
+#include "phoneaction.h"
+#include "phoneresourceadapter.h"
+
+class TestPhoneStringLoader : public QObject
+{
+    Q_OBJECT
+public:
+    TestPhoneStringLoader();
+    virtual ~TestPhoneStringLoader();
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup (); 
+    
+private slots:
+    void testLoad ();
+    void testLoadL1 ();
+    void testLoadL2 ();
+    void testLoadL3 ();
+    void testLoadL4 ();
+    void testLoadL5 ();
+    void testLoadL6 ();
+    void testLoadL7 ();
+    void testLoadLC1 ();
+    void testLoadLC2 ();
+    void testLoadLC3 ();
+    void testLoadLC4 ();
+    void testLoadLC5 ();
+    void testLoadLC6 ();
+    void testLoadLC7 ();
+};
+
+int m_resourceId;
+bool m_convertCalled;
+bool m_set_text_map;
+PhoneResourceAdapter* m_resource_adapter;
+
+PhoneResourceAdapter* PhoneResourceAdapter::Instance (QObject *parent)
+{
+
+    Q_UNUSED (parent);
+    if ( 0 == m_resource_adapter )
+        m_resource_adapter = new PhoneResourceAdapter;
+    
+    return m_resource_adapter;
+}
+
+QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId, ...)
+{
+    m_resourceId = symbianResourceId;
+    m_convertCalled = true;
+    QMap<PhoneAction::ActionType, PhoneAction *> map;
+    if (m_set_text_map) {
+        PhoneAction *text = new PhoneAction;
+        text->setText(tr("Test"));
+        map[PhoneAction::Text] = text; 
+    }
+        
+    return map;
+}
+
+TestPhoneStringLoader::TestPhoneStringLoader ()
+{
+}
+
+TestPhoneStringLoader::~TestPhoneStringLoader ()
+{
+}
+
+void TestPhoneStringLoader::initTestCase ()
+{
+}
+
+void TestPhoneStringLoader::cleanupTestCase ()
+{
+}
+
+void TestPhoneStringLoader::init ()
+{
+    m_resourceId = -1;
+    m_convertCalled = false;
+    m_set_text_map = false;
+}
+
+void TestPhoneStringLoader::cleanup ()
+{
+    delete m_resource_adapter;
+    m_resource_adapter = 0;
+}
+
+void TestPhoneStringLoader::testLoad ()
+{
+    TBuf<255> string(KNullDesC);
+    StringLoader::Load(string, 1000);
+    QCOMPARE (m_resourceId, 1000);
+    QCOMPARE (m_convertCalled, true);
+    
+    m_set_text_map = true;
+    StringLoader::Load(string, 1000);
+    QCOMPARE (m_resourceId, 1000);
+    QCOMPARE (m_convertCalled, true);
+    
+}
+
+void TestPhoneStringLoader::testLoadL1 ()
+{
+    HBufC *buf = StringLoader::LoadL(1000);
+    QCOMPARE (m_resourceId, 1000);
+    QCOMPARE (m_convertCalled, true);
+    delete buf;
+    
+    m_set_text_map = true;
+    buf = StringLoader::LoadL(1000);
+    QCOMPARE (m_resourceId, 1000);
+    QCOMPARE (m_convertCalled, true);
+    delete buf;
+}
+
+void TestPhoneStringLoader::testLoadL2 ()
+{
+    HBufC *buf = StringLoader::LoadL(1234, 3);
+    QCOMPARE (m_resourceId, 1234);
+    QCOMPARE (m_convertCalled, true);	
+    delete buf;
+    
+    m_set_text_map = true;
+    buf = StringLoader::LoadL(1234, 3);
+    QCOMPARE (m_resourceId, 1234);
+    QCOMPARE (m_convertCalled, true);   
+    delete buf;
+}
+
+void TestPhoneStringLoader::testLoadL3 ()
+{
+    TBuf<255> string(KNullDesC);
+    HBufC *buf = StringLoader::LoadL(1234, string);
+    QCOMPARE (m_resourceId, 1234);
+    QCOMPARE (m_convertCalled, true);	
+    delete buf;
+    
+    m_set_text_map = true;
+    buf = StringLoader::LoadL(1234, string);
+    QCOMPARE (m_resourceId, 1234);
+    QCOMPARE (m_convertCalled, true);   
+    delete buf;
+}
+
+void TestPhoneStringLoader::testLoadL4 ()
+{
+    TBuf<255> string(KNullDesC);
+    HBufC *buf = StringLoader::LoadL(666, string, 5);
+    QCOMPARE (m_resourceId, 666);
+    QCOMPARE (m_convertCalled, true);	
+    delete buf;
+    
+    m_set_text_map = true;
+    buf = StringLoader::LoadL(666, string, 5);
+    QCOMPARE (m_resourceId, 666);
+    QCOMPARE (m_convertCalled, true);   
+    delete buf;
+}
+
+void TestPhoneStringLoader::testLoadL5 ()
+{
+    CArrayFixFlat<TInt>* list = new(ELeave)CArrayFixFlat<TInt>(2);
+    HBufC *buf = StringLoader::LoadL(4321, *list);
+    QCOMPARE (m_resourceId, 4321);
+    QCOMPARE (m_convertCalled, true);
+    delete buf;
+    
+    m_set_text_map = true;
+    buf = StringLoader::LoadL(4321, *list);
+    QCOMPARE (m_resourceId, 4321);
+    QCOMPARE (m_convertCalled, true);
+    delete list;
+    delete buf;
+}
+
+void TestPhoneStringLoader::testLoadL6 ()
+{
+    CDesCArray *list = new ( ELeave )CDesCArrayFlat(2);
+    HBufC *buf = StringLoader::LoadL(555, *list);
+    QCOMPARE (m_resourceId, 555);
+    QCOMPARE (m_convertCalled, true);
+    delete buf;
+    
+    m_set_text_map = true;
+    buf = StringLoader::LoadL(555, *list);
+    QCOMPARE (m_resourceId, 555);
+    QCOMPARE (m_convertCalled, true);
+    delete list;
+    delete buf;
+}
+
+void TestPhoneStringLoader::testLoadL7 ()
+{
+	CDesCArray *list = new ( ELeave )CDesCArrayFlat(2);
+    CArrayFixFlat<TInt>* list2 = new(ELeave)CArrayFixFlat<TInt>(2);
+    HBufC *buf = StringLoader::LoadL(5678, *list, *list2);
+    QCOMPARE (m_resourceId, 5678);
+    QCOMPARE (m_convertCalled, true);	
+    delete buf;
+    
+    m_set_text_map = true;
+    buf = StringLoader::LoadL(5678, *list, *list2);
+    QCOMPARE (m_resourceId, 5678);
+    QCOMPARE (m_convertCalled, true);   
+    delete list;
+    delete list2;
+    delete buf;
+}
+
+void TestPhoneStringLoader::testLoadLC1 ()
+{
+    HBufC *buf = 0;
+    TRAP_IGNORE( 
+            buf = StringLoader::LoadLC(1001); 
+            QCOMPARE (m_resourceId, 1001);
+            QCOMPARE (m_convertCalled, true);
+            CleanupStack::PopAndDestroy( buf );
+    );
+    
+    m_set_text_map = true;
+    TRAP_IGNORE(
+            buf = StringLoader::LoadLC(1001);
+            QCOMPARE (m_resourceId, 1001);
+            QCOMPARE (m_convertCalled, true);
+            CleanupStack::PopAndDestroy( buf );
+    );
+}
+
+void TestPhoneStringLoader::testLoadLC2 ()
+{
+    HBufC *buf = 0;
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(1235, 2);
+        QCOMPARE (m_resourceId, 1235);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    
+    m_set_text_map = true;
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(1235, 2);
+        QCOMPARE (m_resourceId, 1235);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+}
+
+void TestPhoneStringLoader::testLoadLC3 ()
+{
+    HBufC *buf = 0;
+    TBuf<255> string(KNullDesC);
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(1234, string);
+        QCOMPARE (m_resourceId, 1234);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    
+    m_set_text_map = true;
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(1234, string);
+        QCOMPARE (m_resourceId, 1234);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+}
+
+void TestPhoneStringLoader::testLoadLC4 ()
+{
+    HBufC *buf = 0;
+    TBuf<255> string(KNullDesC);
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(667, string, 9);
+        QCOMPARE (m_resourceId, 667);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    
+    m_set_text_map = true;
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(667, string, 9);
+        QCOMPARE (m_resourceId, 667);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+}
+
+void TestPhoneStringLoader::testLoadLC5 ()
+{
+    HBufC *buf = 0;
+    CArrayFixFlat<TInt>* list = new(ELeave)CArrayFixFlat<TInt>(2);
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(4322, *list);
+        QCOMPARE (m_resourceId, 4322);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    
+    m_set_text_map = true;
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(4322, *list);
+        QCOMPARE (m_resourceId, 4322);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    delete list;
+}
+
+void TestPhoneStringLoader::testLoadLC6 ()
+{
+    HBufC *buf = 0;
+    CDesCArray *list = new ( ELeave )CDesCArrayFlat(5);
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(556, *list);
+        QCOMPARE (m_resourceId, 556);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    
+    m_set_text_map = true;
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(556, *list);
+        QCOMPARE (m_resourceId, 556);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    delete list;
+}
+
+void TestPhoneStringLoader::testLoadLC7 ()
+{
+    HBufC *buf = 0;
+    CDesCArray *list = new ( ELeave )CDesCArrayFlat(3);
+    CArrayFixFlat<TInt>* list2 = new(ELeave)CArrayFixFlat<TInt>(2);
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(5679, *list, *list2);
+        QCOMPARE (m_resourceId, 5679);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    
+    m_set_text_map = true;
+    
+    TRAP_IGNORE(
+        buf = StringLoader::LoadLC(5679, *list, *list2);
+        QCOMPARE (m_resourceId, 5679);
+        QCOMPARE (m_convertCalled, true);
+        CleanupStack::PopAndDestroy( buf );
+    );
+    
+    delete list;
+    delete list2;
+}
+
+QTEST_MAIN(TestPhoneStringLoader)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phonestringloader/tsrc/ut_phonestringloader/ut_phonestringloader.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEF78FF4E
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   ../../../phoneuiview2/inc \
+                   ../../../phoneuiutils/inc \
+                   ../../../../inc \
+                   ../../../phoneui2/srcdata
+
+    LIBS += -lphoneuiqtview
+    LIBS += -lbafl
+
+    TARGET.CAPABILITY = ALL -TCB
+}
+
+# Input
+HEADERS += phoneresourceadapter.h
+SOURCES += ../../src/stringloader.cpp
+SOURCES += unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/inc/hbphonemainwindow.h	Fri Jun 04 10:19:18 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:  Main window for PhoneUI
+*
+*/
+
+
+#ifndef HBPHONEMAINWINDOW_H_
+#define HBPHONEMAINWINDOW_H_
+
+#include <QGraphicsItem>
+#include <hbmainwindow.h>
+
+class PhoneUiHouseHold;
+
+class HbPhoneMainWindow: public HbMainWindow
+    {
+
+public:
+
+    HbPhoneMainWindow(QWidget* parent = 0);
+    ~HbPhoneMainWindow();
+
+
+private: // data
+    PhoneUiHouseHold* mHouseHold;
+    
+
+    };
+
+
+
+#endif /* HBPHONEMAINVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/inc/phoneuicommandadapter.h	Fri Jun 04 10:19:18 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:  Adapter for UI commands from view to state.
+*
+*/
+
+#ifndef PHONEUICOMMANDADAPTER_H
+#define PHONEUICOMMANDADAPTER_H
+
+#include <QObject>
+
+class MPhoneMenuAndCbaEvents;
+
+class PhoneUiCommandAdapter : public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    /*!
+       Constructor
+     */
+    PhoneUiCommandAdapter (MPhoneMenuAndCbaEvents &commandHandler, QObject *parent = 0);
+    
+    /*!
+       Destructor
+     */
+    virtual ~PhoneUiCommandAdapter ();
+    
+    
+public slots:
+
+    /*!
+        \fn void handleCommand (int command)
+    
+        This method handles UI command by passing it phone state.
+    */
+    void handleCommand (int command);
+    
+private:
+
+    MPhoneMenuAndCbaEvents &m_handler;
+    
+};
+
+#endif // PHONEUICOMMANDADAPTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/inc/phoneuihousehold.h	Fri Jun 04 10:19:18 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:  UI house hold for PhoneUI
+*
+*/
+
+#ifndef PHONEUIHOUSEHOLD_H
+#define PHONEUIHOUSEHOLD_H
+
+
+class PhoneUiHouseHoldPrivate;
+class HbMainWindow;
+
+class PhoneUiHouseHold
+{
+
+public:
+    PhoneUiHouseHold (HbMainWindow &window);
+    ~PhoneUiHouseHold ();
+
+
+private:
+    PhoneUiHouseHoldPrivate* mHouseHoldPrivate;
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/inc/phoneuihousehold_p.h	Fri Jun 04 10:19:18 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:  UI house hold private for PhoneUI
+*
+*/
+
+#ifndef PHONEUIHOUSEHOLDPRIVATE_H
+#define PHONEUIHOUSEHOLDPRIVATE_H
+
+#include <QtGui>
+#include <pevirtualengine.h>
+#include "mphonepubsubobserver.h"
+#include "cphonerecoverysystem.h"
+
+class MPEPhoneModel;
+class CPhoneUIController;
+class CPhoneQwertyHandler;
+class HbMainWindow;
+class PhoneUIKeyEventAdapter;
+class PhoneUiCommandAdapter;
+class QtCall;
+class PhoneUIQtViewAdapter;
+
+class PhoneUiHouseHoldPrivate : 
+    private MPhonePubSubObserver
+{
+
+public:
+    
+    PhoneUiHouseHoldPrivate (HbMainWindow &window);
+
+    ~PhoneUiHouseHoldPrivate ();
+    
+    /**
+    * Performs startup signalling. 
+    *
+    * Calls either idle or security signalling.
+    */
+    static TInt DoStartupSignalL( TAny* aAny );
+    
+    /**
+    * Idle signalling.
+    */
+    TInt DoStartupSignalIdleL();
+    
+    /**
+    * Security signalling. 
+    */
+    TInt DoStartupSignalSecurityL();
+  
+  // From MPhonePubSubObserver
+  /**
+  * This function is called when there is property value change.
+  * @param aCategory Category of the property
+  * @param aKey Property key that is changed
+  * @param aValue New property value
+  */
+  void HandlePropertyChangedL( 
+      const TUid& aCategory,
+      const TUint aKey,
+      const TInt aValue );
+
+private:
+    
+   /**
+    * Constructor
+    */
+    void ConstructL();
+    
+private:
+    // Startup states.
+    // EPhoneStartupInitial - Initial state.
+    // EPhoneStartedUp - Phone application is ready.
+    // EPhoneIdleStartedUp - Idle application is ready.
+    enum
+        {
+        EPhoneStartupInitial = 0x00000001,
+        EPhoneStartedUp = 0x00000002,
+        EPhoneIdleStartedUp = 0x00000004
+        };
+
+    
+    // Application (Phone and Idle) startup status.
+    TInt iAppsReady;
+
+    // Recovery id for startup signalling.
+    TRecoveryId iStartupSignalRecoveryId;
+
+    //Boolean flag. ETrue iff we have reached light idle
+    TBool iLightIdleReached;
+        
+    //Indicates whether onscreen dialer is defined
+    TBool iOnScreenDialer;
+    
+    CPhoneQwertyHandler* iQwertyHandler;
+
+    CPhoneUIController* iPhoneUIController;
+    
+    HbMainWindow &m_window;
+
+    PhoneUIKeyEventAdapter* iKeyEventAdapter;
+    
+    PhoneUiCommandAdapter* iCommandAdapter;
+    
+    PhoneUIQtViewAdapter* iViewAdapter;
+    
+    //List for translators
+    QList<QTranslator*> m_translators;
+    
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/inc/phoneuikeyeventadapter.h	Fri Jun 04 10:19:18 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:  Adapter for converting Qt key event types to
+*               Symbian types.
+*
+*/
+
+#ifndef PHONEUIKEYEVENTADAPTER_H
+#define PHONEUIKEYEVENTADAPTER_H
+
+#include <QObject>
+#include "mphonekeyeventhandler.h"
+
+class QKeyEvent;
+
+class PhoneUIKeyEventAdapter : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    /*!
+       Constructor
+     */
+    PhoneUIKeyEventAdapter (MPhoneKeyEventHandler &keyEventHandler, QObject *parent = 0);
+    
+    /*!
+       Destructor
+     */
+    virtual ~PhoneUIKeyEventAdapter ();
+    
+    
+public slots:
+
+    /*!
+        \fn void keyPressed (QKeyEvent *event)
+    
+        This method is called when keyPressEvent signal
+        is emitted from view.
+    */
+    void keyPressed (QKeyEvent *event);
+    
+    /*!
+        \fn void keyReleased (QKeyEvent *event)
+    
+        This method is called when keyReleaseEvent signal
+        is emitted from view.
+    */
+    void keyReleased (QKeyEvent *event);
+
+private:
+ 
+    /*!
+        \fn void forwardKeyEvent(TEventCode symbianEventCode,QKeyEvent *event)
+    
+        This method forwards key event for ui control.
+    */
+    void forwardKeyEvent(TEventCode symbianEventCode, QKeyEvent *event);
+    
+    /*!
+        \fn void convertKeyCode(QKeyEvent *event)
+    
+        Returns symbian key code for Qt key event.
+    */
+    int convertKeyCode(QKeyEvent *event);
+    
+private:
+
+    MPhoneKeyEventHandler &mHandler;
+
+};
+
+#endif // PHONEUIKEYEVENTADAPTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/basiccallhandling.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined.
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: It is used as softkey text. If the
+// d: softkey is pressed, then a call is dropped.
+// l: control_pane_t1/opt7
+// w:
+//
+#define text_softkey_drop "End call"
+
+// d: It is text for option in menu in call coming in
+// d: state. It answers the incoming call.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_call_answer_option "Answer"
+
+// d: It is text for option in menu in call coming in
+// d: state. It rejects the incoming call.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_call_reject_option "Reject"
+
+// d: It is used in error note when
+// d: call termination cause is 'number not in use'.
+// l: popup_note_window
+// w:
+//
+#define text_unassigned_number "Number not in use"
+
+// d: It is used in error note when
+// d: call termination cause is 'number busy'.
+// l: popup_note_window
+// w:
+//
+#define text_user_busy "Number busy"
+
+// d: It is used in error note when
+// d: call termination cause is 'no answer'.
+// l: popup_note_window
+// w:
+//
+#define text_no_answer "No answer"
+
+// d: It is used in error note when
+// d: call termination cause is 'network busy'.
+// l: popup_note_window
+// w:
+//
+#define text_network_busy "Network busy"
+
+// d: It is used in error note when
+// d: call termination cause is 'network failure'.
+// l: popup_note_window
+// w:
+//
+#define text_network_failure "Error in connection"
+
+// d: It is used in error note when
+// d: call termination cause is 'invalid number'.
+// l: popup_note_window
+// w:
+//
+#define text_invalid_number "Invalid phone number"
+
+// d: It is used in error note when
+// d: call termination cause is 'number barred'.
+// l: popup_note_window
+// w:
+//
+#define text_cterm_nbr_barred "Number barred"
+
+// d: It is used in error note when
+// d: call termination cause is 'number not in closed group'.
+// l: popup_note_window
+// w:
+//
+#define text_cterm_nbr_not_in_cug "Number not in closed group"
+
+// d: It is used in error note when call is terminated
+// d: because outgoing calls were barred in CUG.
+// l: popup_note_window
+// w:
+//
+#define text_cterm_d_barred_in_cug "Call barred in closed group"
+
+// d: It is used in error note when call is terminated
+// d: because no CUG was selected.
+// l: popup_note_window
+// w:
+//
+#define text_cterm_d_no_cug_selected "Select closed group"
+
+// d: It is used in error note when call is terminated
+// d: because CUG index was unknown
+// l: popup_note_window
+// w:
+//
+#define text_cterm_d_unknown_cug_index "Closed group unknown"
+
+// d: It is used in error note when call is terminated
+// d: because CUG index was not compatible with basic service.
+// l: popup_note_window
+// w:
+//
+#define text_cterm_d_cug_bs_incompab "Service not possible in this group"
+
+// d: It is used in error note when call is terminated
+// d: because of unspecified CUG call failure
+// l: popup_note_window
+// w:
+//
+#define text_cterm_d_cug_call_failur "Check closed user group"
+
+// d: It is used in error note when call is terminated
+// d: because CLIR was not subscribed.
+// l: popup_note_window
+// w:
+//
+#define text_cterm_d_clir_not_subscr "Check own number sending"
+
+// d: It's a menu item. When it's selected, the call will be
+// d: answered and audio will be routed to handportable mode.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 3.0
+//
+#define qtn_call_answer_hp_vt_option "Answer to handportable"
+
+// d: It is displayed as a note when user makes long voice key press
+// d: while there is already active call.
+// l: popup_note_window
+//
+#define text_call_in_progress "Call in progress"
+
+// d: Answers call and routes audios to
+// d: loudspeaker( or headset if connected )
+// l: control_pane_t3/opt7
+// w:
+//
+#define qtn_msk_call_answer_loudspeaker "Answer"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/callheadertexts.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,258 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: It is used on the first line in call pop up windows
+// d: in in-call state, when no name/number/company for
+// d: the call exists. It is also used in some notes as
+// d: the calling line identification. %N will be replaced
+// d: with the order of the call (1, 2, 3, ..).
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_number "Call %N"
+
+// d: It is used on the first line of incoming call pop up
+// d: window when calling party's phone number is not available.
+// d: (by default)
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_call "Call"
+
+// d: If the call setup message contains 'diverted' flag,
+// d: and calling line identification is not present, it
+// d: is used on the first line of incoming call pop up
+// d: window.
+// d: Note that the second line is empty.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_diverted_call "Diverted call"
+
+// d: When alerting for an incoming call with withheld 
+// d: calling line idenfication information, it is used
+// d: on the first line of incoming call pop up window.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_cli_withheld "Private number"
+
+// d: It is shown in the first line of active conference call
+// d: as the calling line identification.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_multc_conference_pop_up "Conference"
+
+// d: It is text used in call header pop up, when
+// d: emergency call is made.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_emerg_call_pop_up "Emergency call"
+
+// d: It is on the first line in outgoing call pop up
+// d: window in call setup state.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_out_going_call "Calling"
+
+// d: It is on the first line in outgoing call pop up
+// d: window in call setup state, short version.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_out_going_call_short "Calling"
+
+// d: It is used on the second line of incoming call pop up
+// d: window when calling party's phone number is available.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_incoming_call "calling"
+
+// d: It is used on the second line of incoming call pop up
+// d: window when calling party's phone number is available.
+// d: It is short version.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_incoming_call_short "calling"
+
+// d: It is used on the second line of waiting call
+// d: pop up window.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// 
+#define qtn_multc_window_waiting "waiting"
+
+// d: It is used on the second line of waiting call
+// d: pop up window. It is short version.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// 
+#define qtn_multc_window_waiting_short "waiting"
+
+// d: It is used on the second line of call pop ups,
+// d: when call is on hold.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_incal_window_held "on hold"
+
+// d: It is used on the second line of call pop ups,
+// d: when call is on hold. It is short version.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_incal_window_held_short "on hold"
+
+// d: It is used on the second line of call pop ups,
+// d: when call is disconnected. 
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_window_discon "disconnected"
+
+// d: It is used on the second line of call pop ups,
+// d: when call is disconnected. It is short version.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_window_discon_short "disconnected" 
+
+// d: It is used on the second line of call pop ups,
+// d: when incoming call is disconnected in case
+// d: first row contains call. 
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_window_discon_nonum "disconnected"
+
+// d: It is used on the second line of call pop ups,
+// d: when incoming call is disconnected in case
+// d: first row contains private number. 
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_window_discon_privat "disconnected"
+
+// d: It is used on the second line of call pop ups,
+// d: when incoming call is disconnected in case
+// d: first row contains diverted call. 
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_window_discon_divert "disconnected"
+
+// d: It is used on the second row of held call when
+// d: first row contains "Call %N".
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// 
+#define qtn_incal_window_held_call "on hold"
+
+// d: It is used on the second row of disconnected call when
+// d: first row contains "Call %N".
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// 
+#define qtn_call_window_discon_call "disconnected"
+
+// d: It is used on the second row of conference call.
+// l: popup_call_audio_first_window_t4/opt17
+//
+#define qtn_incal_window_held_conf "on hold"
+
+// d: It is used on the second row of disconnected conference call.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// 
+#define qtn_call_window_discon_conf "disconnected"
+
+// d: It is used on the second line of call pop ups,
+// d: when call is on line 2, it is incoming and its
+// d: number is not known.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// 
+#define qtn_als_incoming_line2_nonum "on line 2"
+
+// d: It is used on the second line of call pop ups,
+// d: when call is on line 2, it is arriving and its
+// d: number is known.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_als_arriving_line2_number "calling, line 2"
+ 
+// d: It is used on the second line of call pop ups,
+// d: when call is on line 2, it is waiting and its
+// d: number is known.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_als_waiting_line2_number "waiting, line 2" 
+
+// d: It is used on the second line of call pop ups,
+// d: when receiving a video call.
+// d: 
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_incoming_video_call "Video call"
+
+// d: It is used on the second line of call pop ups,
+// d: when receiving a video call and there is no room
+// d: for longer text.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_incoming_vt_short "Video call"
+
+// d: It is used on the second line of call pop ups,
+// d: when creating a video call.
+// d: 
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_out_going_video_call "Video call"
+
+// d: It is used on the second line of call pop ups,
+// d: when creating a video call and there is no room
+// d: for longer text.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_call_out_going_vt_short "Video call"
+
+// d: When alerting for an incoming call with payphone
+// d: calling line idenfication information, it is used
+// d: on the first line of incoming call pop up window.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+//
+#define qtn_mtcal_cli_payphone "Payphone"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/callterminationnote.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: It is text used in the first line in call termination 
+// d: note.
+// l: popup_note_window
+//
+#define text_cterm_note_title "Call Terminated"
+
+// d: It is text used in the second line in call termination
+// d: note. After the text, last call timer value is shown.
+// l: popup_note_window
+//
+#define qtn_cterm_time "Time"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/dialer.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Dialer
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+// d: Text in the Dialer Options menu. Only when there 
+// d: exist a call/calls. Brings the Telephone
+// d: application into the foreground.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_call_handling_option "Call Handling" 
+
+// d: Text in Dialer Options menu. Opens the recent calls 
+// d: list from Logs Application.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_recent_calls_option "Recent calls"
+
+// d: Text in Dialer Options menu. Opens the Phonebook
+// d: application.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_contacts_option "Contacts"
+
+// d: Text in Dialer Options menu.
+// d: Opens the call settings view.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_call_settings_option "Call settings"
+
+// d: Text in Dialer Options menu.
+// d: Opens the Speed dial application in its main view.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_speed_dial_option "Speed Dial"
+
+
+// d: Text in Dialer Options menu.
+// d: Opens the VKB for the user to insert a VoIP address.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_touch_input_options "Touch input"
+
+
+// d: Prompt of the list query dialog containing 
+// d: selectable items "create new" and "update
+// d: existing" allowing a user to save a number/address
+// d: from Dialer number entry to contacts.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_create_new "Create new"
+
+// d: Selectable item in list query dialog allowing
+// d: user to add a number in Dialer number entry 
+// d: to existing contact.
+// l: list_single_pane_t1_cp2  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_update_existing "Update existing"
+
+// d: Selectable item in list query dialog allowing
+// d: user to create a new contact from a number in 
+// d: Dialer number entry.
+// l: heading_pane_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_add_to_contact "Add to contacts:"
+
+
+// d: Prompt text for number entry.
+// d: Topmost row shows text in case of Dtmf dialer. 
+// l: heading_pane_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_dtmf_number_input_field_text "DTMF number:"
+
+
+// d: Tooltip text for Dialer toolbar 'Clear' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_tooltip_clear "Clear"
+
+// d: Tooltip text for Dialer toolbar 'Contacts' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_tooltip_contacts "Contacts"
+
+// d: Tooltip text for Dialer toolbar 'Add to contacts' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_tooltip_add_to_contacts "Add to contacts"
+
+// d: Tooltip text for Dialer toolbar 'Call' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_tooltip_call "Call"
+
+// d: Tooltip text for Dialer toolbar 'Send' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_tooltip_send "Send"
+
+// d: Tooltip text for Dialer toolbar 'Recent calls' button.
+// l: popup_preview_text_window_t1  
+// w:
+// r: 5.0
+//
+#define qtn_dialer_tooltip_recent_calls "Recent calls"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/dtmfsignalling.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for phone.
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: It is prompt in data query which asks user to enter
+// d: dtmf string.
+// l: popup_query_data_window
+//
+#define qtn_dtmf_number_query "DTMF number:"
+
+// d: It is prompt in confirmation query shown when 
+// d: 'w' character is processed in dtmf signalling.
+// d: %U is replaced with the remainder of the string to
+// d: be sent.
+// l: popup_note_window
+//
+#define qtn_dtmf_send_string_query "Send string:\n%U"
+
+// d: It is prompt in data query which asks user to enter
+// d: speed dial location.
+// l: popup_query_data_window
+// 
+#define qtn_dtmf_spdial_number_query "Speed dial number:"
+
+// d: It is wait note during dtmf sending procedure.
+// d: %U is replaced with the string to be sent.
+// l: popup_note_wait_window
+//
+#define qtn_dtmf_sending_wait_note "Sending\n%U"
+
+// d: It is displayed as error note when speed dial location
+// d: is invalid in dtmf signalling.
+// l: popup_note_window
+//
+#define qtn_dtmf_invalid_spdial_err_note "Invalid speed dial location"
+
+// d: It is displayed as error note when speed dial location
+// d: is empty in dtmf signalling.
+// l: popup_note_window
+//
+#define qtn_dtmf_spdial_empty_err_note "Speed dial not assigned"
+
+// d: It is displayed as error note when speed dial location
+// d: does not contain any numbers.
+// l: popup_note_window
+//
+#define qtn_dtmf_no_nro_err_note "No numbers"
+
+// d: It is text displayed in title pane during single item fetches.
+// l: title_pane_t2/opt9
+//
+#define qtn_dtmf_phonebook_title "Send DTMF"
+
+// d: It is the text displayed in top of choice list when choosing 
+// d: the DTMF to be sent 
+// l: heading_pane_t1
+//
+#define qtn_send_dtmf_query_prmpt "Send DTMF"
+
+// d: It is Item displayed in "Send DTMF" list 
+// l:list_single_pane_t1_cp2
+//
+#define qtn_find_query_item "Find"
+
+// d: It is Item displayed in "Send DTMF" list 
+// l:list_single_pane_t1_cp2
+//
+#define qtn_enter_manually_query_item "Enter manually"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/incallmenuandsoftkeys.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+// d: It is text for a menu option. If it is selected, 
+// d: calls are swapped.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_swap_option "Swap"
+
+
+// d: It is text for a menu option. If it is selected, 
+// d: incoming/waiting call is rejected.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_reject_option "Reject"
+
+// d: It is text for a menu option. If it is selected, 
+// d: call is put on hold.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_hold_option "Hold"
+
+// d: It is text for a menu option. If it is selected, 
+// d: held call is activated.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_unhold_option "Unhold"
+
+// d: It is text for a menu option. If it is selected, 
+// d: all calls are terminated (not waiting call).
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_end_option "End all calls"
+
+// d: It is text for a menu option. If it is selected, 
+// d: phone is muted.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_mute_option "Mute"
+
+// d: It is text for a menu option. If it is selected, 
+// d: phone is unmuted.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_unmute_option "Unmute"
+
+// d: It is text for a menu option. If it is selected,
+// d: a dialog is opened to allow user to enter a number
+// d: and make a call.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_new_call_option "New call"
+
+// d: It is text for a menu option. If it is selected, 
+// d: conference is built from calls.
+// l: list_single_pane_t1_cp2/opt3
+// w:
+//
+#define qtn_incal_conference_option "Conference"
+
+// d: It is text for a menu option. If it is selected, 
+// d: conference is built from calls.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_join_option "Join"
+
+// d: It is text for a menu option. If it is selected, 
+// d: the user can choose a participant in conference.
+// d: It will make one-to-one call with the selected
+// d: participant.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_private_option "Private"
+
+// d: It is text for a menu option. If it is selected, 
+// d: the user can choose a participant in conference.
+// d: The selected participant will be dropped.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_drop_conf_option "Drop participant"
+
+// d: It is text for a menu option. If it is selected, 
+// d: calls are transferred (ECT).
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_transfer_option "Transfer"
+
+// d: It is text for a menu option. If it is selected,
+// d: active call is dropped and waiting call is answered.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_replace_option "Replace"
+
+// d: It is text for a menu option. If it is selected, 
+// d: allows user to enter dtmf string to be sent.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_send_dtmf_option "Send DTMF"
+
+// d: It is used as softkey text. If the
+// d: softkey is pressed, then phone is muted.
+// l: control_pane_t1/opt7
+// w:
+//
+#define text_softkey_mute "Mute"
+
+// d: It is used as softkey text. If the
+// d: softkey is pressed, then phone is unmuted.
+// l: control_pane_t1/opt7
+// w:
+//
+#define text_softkey_unmute "Unmute"
+
+// d: It is used as softkey text. If the
+// d: softkey is pressed, then call is activated.
+// l: control_pane_t1/opt7
+// w:
+//
+#define text_softkey_unhold "Unhold"
+
+// d: It is used as softkey text. If the
+// d: softkey is pressed, then calls are swapped.
+// l: control_pane_t1/opt7
+// w:
+//
+#define text_softkey_swap "Swap"
+
+// d: It is used as softkey text. If the softkey
+// d: is pressed, then all calls are ended
+// l: control_pane_t1/opt7
+// w:
+//
+#define qtn_incal_softk_end_all "End calls"
+
+// d: It is text for a menu option. If it is selected, 
+// d: calls are transferred (Unattended transfer).
+// l: list_single_pane_t1_cp2
+// w: 
+// r: 3.0
+//
+#define qtn_incal_unattended_transfer_option "Unattended transfer"
+
+
+// d: It is used as softkey text. If pressed, the call isn't rejected,
+// d: but a unified message editor with soft reject default text is opened.
+// l: control_pane_t1/opt7
+//
+#define qtn_softkey_soft_reject "Soft Reject"
+
+// d: It is text for a menu option. If it is selected,
+// d: Switches current voice call to video
+// l: list_single_pane_t1_cp2
+// w:
+// r: 3.1u
+//
+#define qtn_incal_voice_to_video "Switch to video call"
+
+// d: It is used as middle softkey text. If the softkey
+// d: is pressed, Contacts app is activated.
+// l: control_pane_t3/opt7
+// w:
+// r: 3.2
+//
+#define qtn_msk_contacts "Contacts"
+
+// d: It is text for a menu option. If it is selected,
+// d: Switches current video call to voice call
+// l: list_single_pane_t1_cp2
+// w:
+// r: 3.1u
+//
+#define qtn_incal_video_to_voice "Switch to voice call"
+
+// d: It is used as softkey text. If the
+// d: softkey is pressed, then a view is changed to dialer.
+// l: control_pane_t1/opt7
+// w:
+// r: 5.0
+//
+#define qtn_incal_softk_dialer "Dialer"
+
+// d: It is text for a menu option. If it is selected, 
+// d: view is changed to dialer.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 5.0
+//
+#define qtn_incal_dialer_option "Dialer"
+
+// d: It is text for a menu option. If it is selected, 
+// d: call is added to conference.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 5.0
+//
+#define qtn_incal_add_to_conf_option "Add to conference"
+
+// d: It is text for a menu option. If it is selected, 
+// d: participants list is opened.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 5.0
+//
+#define qtn_incal_participants_option "Participants"
+
+// d: It is text for a menu option. If it is selected, 
+// d: operation separates selected remote party 
+// d: call from the active conference call.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 5.0
+//
+#define qtn_incal_private_part_option "Private"
+
+// d: It is text for a menu option. If it is selected, 
+// d: the user can choose a participant in conference.
+// d: The selected participant will be dropped.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 5.0
+//
+#define qtn_incal_drop_part_option "Drop participant"
+
+// d: It is text for a menu option. If it is selected, 
+// d: handover is initiated
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_vcc_ho_to_wlan_option "Handover to WLAN"
+
+// d: It is text for a menu option. If it is selected, 
+// d: handover is initiated
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_incal_vcc_ho_to_gsm_option "Handover to GSM"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/incalloperations.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,530 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+// d: Local hold operation is confirmed with
+// d: the text in confirmation note. %U is replaced
+// d: with call identification.
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_conf_hold_cli "%U on hold"
+
+// d: Local hold operation is confirmed with
+// d: the text in confirmation note. There is no name
+// d: in phonebook for the number of the call.
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_conf_hold_nocli "Call %N on hold"
+
+// d: Local hold operation is confirmed with
+// d: the text in confirmation note. The held call is
+// d: conference.
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_conf_hold_conf "Conference on hold"
+
+
+// d: It is title in new call data query.
+// l: popup_query_data_window
+// w: 
+//
+#define text_phone_number "Phone number:"
+
+// d: It is softkey used to initiate single entry fetch.
+// l: control_pane_t1/opt7
+// w: 
+//
+#define text_softkey_find "Search"
+
+// d: It is softkey in new call data query. It starts making
+// d: call to the number specified in query.
+// l: control_pane_t1/opt7
+// w: 
+//
+#define text_softkey_new_call "Call"
+
+// d: It is title in single item fetch from new call query.
+// l: title_pane_t2/opt9
+// w: 
+//
+#define qtn_incal_call_title "New call to"
+
+// d: When the remote end holds the active Call, it will be indicated to 
+// d: the user with this information note
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_info_hold "On hold"
+
+// d: When the remote end activates the held call, it will be indicated to 
+// d: the user with this information note
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_remote_active_note "Connected"
+
+// d: If the remote end transfers the call before the transferred to party 
+// d: has answered, this wait note pop-up window is displayed
+// l: popup_note_wait_window
+// w: 
+//
+#define qtn_incal_wait_transfer "Transfer in progress"
+
+// d: When the remote end transfers the call to a third party, this
+// d: information note is shown if the calling line identification of the 
+// d: transferred to party is not available.
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_transferred_note "Transferred"
+
+// d: If the call identification of the transferred to party is 
+// d: available, this information note is displayed instead, 
+// d: where %U is the calling line identification.
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_transferred_nro_note "Connected to %U"
+
+// d: If the remote end joins the user to a multiparty call,this 
+// d: information note is displayed
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_info_conf_active "Conference call active"
+
+// d: If user tries to disconnect BT connection while there is
+// d: audio on going, the following query will be displayed.
+// l: popup_note_window
+// w: 
+//
+#define qtn_que_continue_in_handset "Connection is closed. Continue in handportable mode?"
+
+// d: When sending a media file to caller
+// d: the text in confirmation note. %U is replaced
+// l: popup_note_window
+// w: 
+//
+#define qtn_incal_sfi_sent "Sending file to %U"
+
+// d: If user tries to disconnect BT connection while there is
+// d: video call ongoing, the following query will be displayed.
+// l: popup_note_window
+// w: 
+//
+#define qtn_que_continue_in_louds "Connection is closed. Continue in loudspeaker mode?"
+
+// d: information note when trying to switch to video in 2G.
+// l: popup_note_window
+// w: 
+// r: 3.1u
+//
+#define qtn_incal_info_no_network_support "No network support for video call"
+
+// d: Confirmation note when switching from voice to video
+// l: popup_note_window
+// w: 
+// r: 3.1u
+//
+#define qtn_query_create_video_call "End active call and create video call to the same contact?"
+
+// d: Confirmation note when switching from video to voice
+// l: popup_note_window
+// w: 
+// r: 3.1u
+//
+#define qtn_incal_query_create_video_call "End active call and create voice call to the same contact?"
+
+// d: information note when trying to switch to video or MO video call attempt during MC or PCSuite restore.
+// l: popup_note_window
+// w: 
+// r: 3.1
+//
+#define qtn_video_call_not_allowed "Video call not allowed during restore"
+
+// d: It is text for a command button. If it is selected, 
+// d: the user can choose a participant in conference.
+// d: The selected participant will be dropped.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_drop "Drop participant"
+
+// d: It is text for a command button. If it is selected, 
+// d: operation separates selected remote party 
+// d: call from the active conference call.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_private "Private"
+
+// d: It is text for a command button. If it is selected, 
+// d: active call is ended.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_end_active_call "End active call"
+
+// d: It is text for a command button. If it is selected, 
+// d: add call to conference call.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_join "Add to conference"
+
+// d: It is text for a command button. If it is selected, 
+// d: calls are swapped.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_swap "Swap"
+
+// d: It is text for a command button. If it is selected, 
+// d: view is changed to idle.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_go_idle "Go to idle"
+
+// d: It is text for a command button. If it is selected, 
+// d: all calls are ended.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_end_all_calls "End all calls"
+
+// d: It is text for a command button  If it is selected, 
+// d: participants list is opened.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_participants "Participants"
+
+// d: It is text for a command button. If it is selected, 
+// d: held call is activated.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_unhold "Unhold"
+
+// d: It is text for a command button. If it is selected, 
+// d: call is put on hold.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_hold "Hold"
+
+// d: It is text for a command button. If it is selected,
+// d: handsfree is activated.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_loudspeaker "Loudspeaker"
+
+// d: It is text for a command button. If it is selected,
+// d: audio is routed to handset mode
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_handset "Handset"
+
+// d: It is text for a command button. If it is selected, 
+// d: phone is unmuted.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_unmute_mic "Unmute"
+
+// d: It is text for a command button. If it is selected, 
+// d: phone is muted.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_mute_mic "Mute"
+
+// d: It is text for a command button. If it is selected, 
+// d: call is changed from voice to video.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_voice_to_video "Voice to video"
+
+// d: It is text for a command button. If it is selected, 
+// d: conference is built from calls.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_conference "Conference"
+
+// d: It is text for a command button. If it is selected, 
+// d: audio is routed bt handsfree.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_bluetooth "BT Handsfree"
+
+// d: It is text for a command button. If it is selected, 
+// d: call is ended.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_end_call "End call"
+
+// d: It is text for a command button. If it is selected, 
+// d: incoming call is rejected.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_reject "Reject"
+
+// d: It is text for a command button. If it is selected, 
+// d: incoming call is answered.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_answer "Answer"
+
+// d: It is text for a command button. If it is selected, 
+// d: ringing tone is muted.
+// l: cell_call4_button_pane_t1
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_silence "Silence"
+
+// d: Confirmation note when switching from video to voice
+// l: popup_note_window
+// w: 
+// r: 5.0
+//
+#define qtn_incal_query_vcall_failed "Video call setup failed. Create voice to the same contact?"
+
+
+
+//Landscape texts for buttons
+
+
+
+// d: It is text for a command button. If it is selected, 
+// d: the user can choose a participant in conference.
+// d: The selected participant will be dropped.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_drop_landscape "Drop"
+
+// d: It is text for a command button. If it is selected, 
+// d: operation separates selected remote party 
+// d: call from the active conference call.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_private_landscape "Private"
+
+// d: It is text for a command button. If it is selected, 
+// d: active call is ended.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_end_active_call_landscape "End active call"
+
+// d: It is text for a command button. If it is selected, 
+// d: add call to conference call.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_join_landscape "Join"
+
+// d: It is text for a command button. If it is selected, 
+// d: calls are swapped.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_swap_landscape "Swap"
+
+// d: It is text for a command button. If it is selected, 
+// d: view is changed to idle.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_go_idle_landscape "Go to idle"
+
+// d: It is text for a command button. If it is selected, 
+// d: all calls are ended.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_end_all_calls_landscape "End all calls"
+
+// d: It is text for a command button  If it is selected, 
+// d: participants list is opened.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_participants_landscape "Participants"
+
+// d: It is text for a command button. If it is selected, 
+// d: held call is activated.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_unhold_landscape "Unhold"
+
+// d: It is text for a command button. If it is selected, 
+// d: call is put on hold.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_hold_landscape "Hold"
+
+// d: It is text for a command button. If it is selected,
+// d: handsfree is activated.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_loudspeaker_landscape "Loudspeaker"
+
+// d: It is text for a command button. If it is selected,
+// d: audio is routed to handset mode
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_handset_landscape "Handset"
+
+// d: It is text for a command button. If it is selected, 
+// d: phone is unmuted.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_unmute_mic_landscape "Unmute"
+
+// d: It is text for a command button. If it is selected, 
+// d: phone is muted.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_mute_mic_landscape "Mute"
+
+// d: It is text for a command button. If it is selected, 
+// d: call is changed from voice to video.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_voice_to_video_landscape "Video call"
+
+// d: It is text for a command button. If it is selected, 
+// d: call is changed from video to voice.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_video_to_voice_landscape "Voice call"
+
+// d: It is text for a command button. If it is selected, 
+// d: conference is built from calls.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_conference_landscape "Conference"
+
+// d: It is text for a command button. If it is selected, 
+// d: audio is routed bt handsfree.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_bluetooth_landscape "BT handsfree"
+
+// d: It is text for a command button. If it is selected, 
+// d: call is ended.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_end_call_landscape "End call"
+
+// d: It is text for a command button. If it is selected, 
+// d: incoming call is rejected.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_reject_landscape "Reject"
+
+// d: It is text for a command button. If it is selected, 
+// d: incoming call is answered.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_answer_landscape "Answer"
+
+// d: It is text for a command button. If it is selected, 
+// d: ringing tone is muted.
+// l: cell_call4_button_pane_t1/opt2
+// w:
+// r: 5.0
+//
+#define qtn_incal_button_silence_landscape "Silence"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/mobileoriginatedcalls.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: When making an outgoing call, a subscriber is informed by
+// d: this information note that he has active cal diverts(no tone
+// d: played). This is an indication of conditional divert.
+// l: popup_note_window
+//
+#define qtn_mocal_active_diverts_note "Note:  you have active diverts"
+
+// d: When making an outgoing call, a subscriber is informed by
+// d: this information note that he has active cal diverts(no tone
+// d: played). This is an indication of unconditional divert.
+// l: popup_note_window
+//
+#define qtn_mocal_calls_diverted_note "Note:  all incoming calls diverted"
+
+// d: In some casees, the calling party may recieve information from the 
+// d: network telling that the original called party cannot be reached and 
+// d: the call is being diverted to another number. This is a information 
+// d: note
+// l: popup_note_window
+//
+#define qtn_mocal_diverting_note "Diverting"
+
+// d: If the user has call barring services active when establishing a 
+// d: call, the network may notify the phone of such a situation, using
+// d: this information note
+// l: popup_note_window
+//
+#define qtn_mocal_barred_note "Note: you have active barrings"
+
+// d: If the called party has activated the call waiting service and he
+// d: has a call going on, the the calling party may be informed that 
+// d: his call is waiting for the called party by this information 
+// d: note
+// l: popup_note_window
+//
+#define qtn_mocal_waiting_note "Waiting"
+
+// d: It is text used when receiving end is out of 3g-coverage,
+// d: or is not supporting video call.
+// l: popup_note_window
+//
+#define qtn_video_call_not_possible "Video call didn't succeed to called end."
+
+// d: It is text used when video call setup fails in protocol level,
+// d: e.g. H.324, H.245, H.223 level.
+// l: popup_note_window
+//
+#define qtn_tel_info_video_setup_failed "Video call setup failed"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/multicallhandling.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: It is global note shown when waiting call is detected.
+// d: %U stands for cli information from personal directory.
+// d: This note is shown only if such information is available.
+// l: popup_note_window
+//
+#define qtn_multc_info_wait_with "%U waiting"
+
+// d: It is global note shown when waiting call is detected.
+// l: popup_note_window
+//
+#define qtn_multc_info_wait_without "Call waiting"
+
+// d: It is softkey in incall private operation. 
+// l: control_pane_t1/opt7
+//
+#define qtn_softkey_private "Private"
+
+// d: It is softkey in incall drop participant operation. 
+// l: control_pane_t1/opt7
+//
+#define qtn_softkey_drop_participant "Drop"
+
+// d: It is shown in information note when call is resumed because
+// d: user ends active call. Cli for the call is not known.
+// l: popup_note_window
+// 
+#define qtn_multc_unhold_done_note "Call %N active"
+
+// d: It is shown in information note when call is resumed because
+// d: user ends active call. Cli is known for the call.
+// l: popup_note_window
+// 
+#define qtn_multc_cli_unhold_done_note "%U active"
+
+// d: It is shown in information note when call is resumed because
+// d: user ends active call. The resumed call is conference.
+// l: popup_note_window
+// 
+#define qtn_multc_conference_note "Conference active"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/numberentry.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: It is an option in Number Acquisition state menu.
+// d: It contains submenu for two items defining type of saving.
+// l: list_single_pane_t1_cp2/opt3
+//
+#define qtn_phob_opt_save_to_pb "Save to phonebook"
+
+// d: It is an sub-option in Number Acquisition state menu.
+// d: It saves the number in number entry to phonebook.
+// l: list_single_popup_submenu_pane_t1
+//
+#define qtn_phob_opt_save_to_pb_new "New entry"
+
+// d: It is an sub-option in Number Acquisition state menu.
+// d: It adds the number in number entry to phonebook.
+// l: list_single_popup_submenu_pane_t1
+//
+#define qtn_phob_opt_save_to_pb_old "Add to earlier"
+
+// d: It is an option in Number Acquisition state menu. It makes
+// d: a call to the number that is in the number entry component.
+// l: list_single_pane_t1_cp2
+//
+#define text_number_call "Call"
+
+// d: It is an option in Number Acquisition state menu. It makes
+// d: ss/ussd request to the network.
+// l: list_single_pane_t1_cp2
+//
+#define text_nren_send_com "Send"
+
+// d: It is an option in menu in Number Acquisition state. It opens
+// d: a unified message editor.
+// l: list_single_pane_t1_cp2
+//
+#define qtn_nren_send_message "Send message"
+
+// d: It is an option in menu in Number Acquisition state. It opens
+// d: a cascade menu, which contains three options.
+// l: list_single_pane_t1_cp2
+//
+#define text_number_send_sms "Send message"
+
+// d: It is an option in Send message submenu. It allows user to 
+// d: write a short message and send it to the number that was in 
+// d: the number entry.
+// l: list_single_popup_submenu_pane_t1
+//
+#define qtn_nren_send_sms "Short message"
+
+// d: It is an option in Send message submenu. It allows user to
+// d: make a multimedia message and send it to the number that was
+// d: in the number entry.
+// l: list_single_popup_submenu_pane_t1
+//
+#define qtn_nren_send_mms "Multimedia message"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/phone.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,454 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*     This is a localisation file for Phone
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined.
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: It is text shown in a wait note when phone
+// d: tries to make an emergency call.
+// l: popup_note_window
+// w:
+//
+#define qtn_emerg_emergency_call_note "Attempting emergency call"
+
+// d: It is text shown in an error note when
+// d: emergency call creation fails.
+// l: popup_note_window
+// w:
+//
+#define qtn_emerg_call_error_note "Emergency call failed"
+
+// d: It is shown in a warning note when
+// d: user tries to make a normal call and
+// d: phone is requesting SIM card.
+// l: popup_note_window
+// w:
+//
+#define qtn_emerg_emergency_only "Emergency calls only"
+
+// d: It is text of phone application in application shell grid.
+// d: When user selects that item, then phone goes to idle state
+// d: or call related state.
+// l: cell_app_pane_t1
+// w:
+//
+#define qtn_apps_phone_grid "Tel"
+
+// d: It is text of phone application in application shell list.
+// d: When user selects that item, then phone goes to idle state
+// d: or call related state.
+// l: list_single_large_graphic_pane_t1
+// w:
+//
+#define qtn_apps_phone_list "Telephone"
+
+// d: It is the prompt text in one confirmation query dialog
+// d: It confirms the user to change the phone line(Toggle primary
+// d: and alternative phone line)
+// l: popup_note_window
+// w:
+//
+#define text_als_line_change_query "Change outgoing phone line?"
+
+// d: It is possible to change the line by long keypress on # -key
+// d: when the user has a possibility to use the number entry e.g.
+// d: in number entry (when there are no other digits included), when
+// d: the phone is in idle state and while in call. If the line
+// d: blocking setting is on, then the error note with this string
+// d: will be shown.
+// l: popup_note_window
+// w:
+//
+#define qtn_als_line_error_no_line_change "Line cannot be changed. The line blocking is on."
+
+// d: If the incoming call is diverted, this information note is shown
+// d: on the originally called party's phone.
+// l: popup_note_window
+// w:
+//
+#define qtn_mtcal_diverting_note "Diverting"
+
+// d: This message may be sent to the phone by the network at any time.
+// d: The message means that some supplementary service information has been lost
+// d:  in the network and the user will have to activate her services again.
+// d: The message is presented as a information Note with this text
+// l: popup_note_window
+// w:
+//
+#define text_net_info_lost "Check network services"
+
+// d: The unit format of the cug soft indicator
+// l: soft_indicator_pane_t1
+// w:
+//
+#define qtn_cug_indic_group "Group %N"
+
+// d: The confirmation query for the speed dial assignment. If the user tries
+// d: to create a call to speed dial number which is empty, this query dialog
+// d: is shown.
+// l: popup_note_window
+// w:
+//
+#define text_speed_dial_assign_new_qu "Speed dial not assigned. Assign it now?"
+
+// d: If user personalize the softkey on Idle state to "New message", when user
+// d: press softkey on idle state, the popup list dialog is shown on the screen.
+// d: The first line is this string, indicate user to write a new message.
+// d: same defination can be found in Message center
+// l: heading_pane_t1
+// w:
+//
+#define qtn_mce_pop_up_write "Write:"
+
+// d: The format string defines how date are shown on the navi pane of idle state.
+// d: %0U stands for the week day, and %1U stands for date.
+// l: navi_text_pane_t1
+// w:
+#define qtn_idle_time_format "%0U %1U"
+
+// d: It is template for information note text used to show
+// d: IMEI code.
+// d: %U is replaced with IMEI of the phone.
+// l: popup_note_window
+// w:
+//
+#define text_imei "Serial No.\n%U"
+
+// d: It is text shown in error note when empty sim location
+// d: is recalled in abbreviated dialling code.
+// l: popup_note_window
+// w:
+//
+#define qtn_simp_note_empty_location "No number stored in location %N"
+
+// d: suplement service notification. The network may send a notification
+// d: to the calling user which tells the CUG index used for the current
+// d: call. After the notification is received from the network, the phone
+// d: displays this confirmation note.
+// l: popup_note_window
+// w:
+//
+#define text_cug_in_use "Closed group %N in use"
+
+// d: If the network doesn’t support temporary CLIR suppression, this
+// d: Non-Phone Error Note is displayed and the call is made without
+// d: CLIR suppression.
+// l: popup_note_window
+// w:
+//
+#define text_clir_suppr_reject "Could not send own number"
+
+// d: If the call is diverted and the COLP has been activated there may be
+// d: a notification from the network. The information note with this
+// d: text is shown, where %U is the connected number.
+// l: popup_note_window
+// w:
+//
+#define text_colp_connected "Connected to %U"
+
+// d: If user tries to initiate a CS call during GPRS connection( attach or
+// d: context states ), an error note with this text is displayed.
+// l: popup_note_window
+// w:
+//
+#define qtn_gprs_err_conn_in_progress "End GPRS connection first"
+
+// d: When user enters *#2820# to the number entry a bluetooth address
+// d: is shown in a note. The note has this text before the address.
+// l: popup_note_window
+// w:
+//
+#define qtn_bt_dev_address "Bluetooth device address: %U"
+
+// d: When user enters *#9990# to the number entry and the bluetooth
+// d: loopback is enabled this text is shown in a note.
+// l: popup_note_window
+// w:
+//
+#define qtn_bt_loopback_enabled "Bluetooth RF loopback enabled."
+
+// d: When user enters *#9990# to the number entry and the bluetooth
+// d: loopback is disabled this text is shown in a note.
+// l: popup_note_window
+// w:
+//
+#define qtn_bt_loopback_disabled "Bluetooth RF loopback disabled."
+
+// d: If the network always presents calling party’s number to connected party and
+// d: user has temporarily tried to prevent this by invoking CLIR, the calling is prevented by
+// d: the operator. A global information note with following text is shown.
+// l: popup_note_window
+// w:
+#define text_clir_change "Activate own number sending"
+
+// d: If the user tries to press the volume key while in a TTY call, the following information
+// d: note is displayed and the volume is unchanged.
+// l: popup_note_window
+// w:
+//
+#define qtn_tty_info_no_audio_control "TTY call active. Volume control not available"
+
+// d: It is template for information note text used to show
+// d: Life timer code.
+// d: %U is replaced with Life timer value of the phone.
+// l: popup_note_window
+// w:
+//
+#define qtn_note_life_timer "Life timer\n%U"
+
+// d: Text in title pane in idle state
+// d: Remote SIM Access Profile is active. SIM or network  is not accessible
+// d: from the terminal. This doesn't relate to normal user profiles like General
+// d: or Meeting.
+// l: title_pane_t2/opt9
+// w:
+// r: 3.0
+//
+#define qtn_mode_sap "Remote SIM"
+
+// d: It's a menu item. When it's selected, the call isn't
+// d: rejected, but a unified message editor with soft reject default text is opened.
+// l: list_single_pane_t1_cp2
+// w:
+//
+#define qtn_call_soft_reject_option "Soft Reject"
+
+// d: It is template for information note text used to show WLAN MAC.
+// d: %U is replaced with MAC address.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_wlan_info_mac_address "WLAN MAC address: %U"
+
+// d: It is text shown in an error note when
+// d: fixed dialling active.
+// l: popup_note_window
+// w:
+// r: 3.2
+//
+#define qtn_fdn_call_not_allowed "Call not allowed, fixed dialling active"
+
+// d: This cause indicates that the called user cannot be reached because the network
+// d: through which the call has been routed does not serve the destination desired.
+// d: No route to destination
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value3 "Unable to make video call. Not supported by other phone or network."
+
+// d: This cause indicates that the call is being cleared because one of the users
+// d: involved in the call has requested that the call be cleared.
+// d: Normal call clearing
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value16 "Call ended"
+
+// d: This cause is used when a user does not respond to a call establishment
+// d: message with either an alerting or connect indication within the
+// d: prescribed period of time allocated.
+// d: No user responding
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value18 "No answer"
+
+// d: This cause indicates that the equipment sending this cause does not wish
+// d: to accept this call, although it could have accepted the call because the
+// d: equipment sending this cause is neither busy nor incompatible.
+// d: Call rejected
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value21 "Call rejected"
+
+// d: This cause is returned to a calling mobile station when the called party number
+// d: indicated by the calling mobile station is no longer assigned.
+// d: Number changed
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value22 "Number not in use"
+
+// d: This cause is used to report a normal event only when no other cause in the
+// d: normal class applies.
+// d: Normal, unspecified
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value31 "Call ended"
+
+// d: This cause indicates that there is no appropriate circuit/channel presently
+// d: available to handle the call.
+// d: No circuit/channel available
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value34 "Network busy"
+
+// d: This cause indicates that the network is not functioning correctly and that the
+// d: condition is likely to last a relatively long period of time; e.g., immediately
+// d: re-attempting the call is not likely to be successful.
+// d: Network out of order
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value38 "Unable to make video call. Not supported by other phone or network."
+
+// d: This cause indicates that the requested supplementary service could not be
+// d: provided by the network because the user has no completed the necessary
+// d: administrative arrangements with its supporting networks.
+// d: That cause may indicate also that the attempt fails due to the fact that receiving
+// d: end doesn’t support video call or is out of 3G coverage.
+// d: Requested facility not subscribed
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value50 "Unable to make video call. Not supported by other phone or network."
+
+// d: This cause indicates that although the called party is a member of the CUG for
+// d: the incoming CUG call, incoming calls are not allowed within this CUG.
+// d: Incoming calls barred within the CUG
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value55 "Number barred"
+
+// d: This cause indicates that the mobile station has requested a bearer capability
+// d: which is implemented by the equipment which generated this cause but the
+// d: mobile station is not authorized to use.
+// d: Bearer capability not authorized
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value57 "Unable to make video call. Not supported by other phone or network."
+
+// d: This cause indicates that the mobile station has requested a bearer capability
+// d: which is implemented by the equipment which generated this cause but which is
+// d: not available at this time.
+// d: Bearer capability not presently available
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value58 "Unable to make video call. Not supported by other phone or network."
+
+// d: This cause indicates that the equipment sending this cause has received a request
+// d: to establish a call which has low layer compatibility, high layer compatibility, or
+// d: other compatibility attributes (e.g., data rate) which cannot be accommodated.
+// d: Incompatible destination
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value88 "Unable to make video call. Not supported by other phone or network."
+
+// d: This cause indicates that there has been interworking with a network which does
+// d: not provide causes for actions it takes; thus, the precise cause for a message
+// d: which is being sent cannot be ascertained.
+// d: Interworking, unspecified
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_cause_value127 "Unable to make video call. Not supported by other phone or network."
+
+// d: Causes 25, 29, 30, 96, 97, 98, 99 and 102
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_not_supported "Unable to make video call. Not supported by other phone or network."
+
+// d: Causes 63, 65, 70 and 79
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_call_info_service_not_available "Unable to make video call. Not supported by other phone or network."
+
+// d: Defines wait note text when handover from WLAN->GSM is in progress.
+// l: popup_note_window
+// w:
+// r: 5.0
+#define qtn_vcc_wait_ho_from_wlan "Handover from WLAN to GSM"
+
+// d: Defines wait note text when handover from GSM->WLAN is in progress.
+// l: popup_note_window
+// w:
+// r: 5.0
+#define qtn_vcc_wait_ho_from_gsm "Handover from GSM to WLAN"
+
+// d: If handover fails, this note is displayed.
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_vcc_info_ho_failed "Handover failed"
+
+// d: Displayed when manual handover item is visible, but handover is not possible.
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_vcc_info_not_allowed "Handover not allowed"
+
+// d: Displayed when mobile originated video call gets out of UMTS coverage
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_video_call_only_possible_under_3g_coverage "Videocall only possible under 3G coverage"
+
+// d: Displayed when user tries to make a video call to a terminal which does not have a
+// d: video telephony client
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_unable_to_make_video_call_not_supported_by_other_phone "Unable to make video call. Not supported by other phone."
+
+// d: Displayed when user tries to make a video call to a terminal which is out of UMTS coverage
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_phone_out_of_3g_coverage "Phone switched off or out of 3G coverage"
+
+// d: Displayed when user tries to make a video call to a terminal which have barred incomin calls
+// l: popup_note_window
+// w:
+// r: 5.0
+//
+#define qtn_called_number_has_barred_incoming_calls "Called number has barred incoming calls"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/loc/voip.loc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,583 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This is a localisation file for VoIP specific strings
+*     A .loc file is the one and only place where the logical strings
+*     to be localised are defined. 
+*
+*/
+
+
+// LOCALISATION STRINGS
+
+// d: If SIPS fail while securing VoIP call, a warning note with this text is shown
+// l: popup_note_window
+// w:
+//
+#define qtn_voip_rel2_sips_failed "Unable to secure call using call signalling"
+
+// d: Defines wait note text when VoIP registration in progress during call.
+// l: popup_note_wait_window
+// w:
+// r:
+//
+#define qtn_voip_rel2_registering_to_service "Registering to service" 
+
+// d: Defines wait note text when VoIP registration fails.
+// l: popup_note_window
+// w:
+// r:
+//
+#define qtn_voip_rel2_unable_to_register_note "Unable to register to service" 
+
+// d: Text in select address which to forward call query header
+// l: heading_pane_t1
+// w:
+//
+#define qtn_voip_rel2_popup_title_forward_call_to "Forward call to:"
+
+// d: Text in call is being forwarded information note
+// l: popup_note_window
+// w:
+//
+#define qtn_voip_rel2_call_being_forwarded "Call is being forwarded"
+
+//d: Command text associated to a softkey in the control pane.
+//d: Terminates call
+//l: control_pane_t1/opt7
+//w: 
+//
+#define qtn_voip_rel2_softkey_end_call "End call"
+
+// d: Text in save new address confirmation note
+// l: popup_note_window
+// w:
+//
+#define qtn_voip_rel2_save_new_address_query "Recipient address has changed permanently. Save new address in phonebook?"
+
+// d: Text in save new address
+// d: %U represents contact name
+// l: popup_note_window
+// w:
+//
+#define qtn_voip_rel2_address_save_note "Address saved for %U"
+
+// d: It is shown when user tries to make Internet Call
+// d: but there are no VoIP profiles.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_no_service "There are no VoIP settings defined, define one in VoIP settings"
+
+// d: It is shown in a select call type query
+// d: when user has voip in the phone and no 
+// d: preferred call type is selected.
+// l: heading_pane_t1
+// w:
+// r: 3.0
+//
+#define qtn_voip_select_call_type "Select call type:"
+
+// d: It is shown in a select call type query
+// d: when user has voip in the phone and no 
+// d: preferred call type is selected.
+// l: list_single_pane_t1_cp2 
+// w:
+// r: 3.0
+//
+#define qtn_voip_call_type_cs "Voice call"
+
+// d: It is shown in a select call type query
+// d: when user has voip in the phone and no 
+// d: preferred call type is selected.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 3.0
+//
+#define qtn_voip_call_type_internet "Internet call"
+
+// d: It is shown when user tries to make Internet Call
+// d: but service is not available.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_no_voip_service_info "Internet call service not available"
+
+// d: It is shown when user tries to make Internet Call
+// d: but no WLAN coferage to make Internet call.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_no_wlan_coverage_info "No WLAN coverage to make an Internet call"
+
+// d: It is shown in a confirmation note when
+// d: No WLAN coferage for Internet call.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_no_wlan_coverage_query "No WLAN coverage to make an Internet call, call a cellular call instead?"
+
+// d: It is shown in a confirmation note when
+// d: Internet call service not available.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_no_voip_service_query "Internet call service not available, call a cellular call instead?"
+
+// d: It is shown in a confirmation note when
+// d: user tries to make Internet Call but
+// d: not logged in to the Internet call service.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_not_logged_in_query "Not registered to the Internet call service, register now?"
+
+// d: It is shown in a confirmation note when
+// d: user tries to make Internet Call but
+// d: Preferred VoIP profile is unusable.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_info_preferred_unusable "Preferred setting is unusable"
+
+// d: Defines reconnection query header when preferred VoIP profile is unusable.
+// l: heading_pane_t1
+// w:
+// r: 3.0
+//
+#define qtn_tel_query_voip_profile "Connect via:"
+
+// d: Defines list query header when user wants make CS call instead.
+// l: heading_pane_t1
+// w:
+// r: 3.0
+//
+#define qtn_tel_query_voip_call_cs "Call:"
+
+// d: Defines confirmation text when logged to the VoIP service.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_voip_conf_logged_in "Registered to the Internet telephony service"
+
+// d: Profile value text Unregistered
+// l: list_set_graphic_pane_t1
+// w:
+// r: 3.0
+//
+#define qtn_voip_value_unregister "Unregistered"
+
+// d: It is title in VoIP registration view.
+// l: title_pane_t2/opt9
+// w:
+// r: 3.0
+//
+#define qtn_voip_registration_title "Voice over IP"
+
+// d: It is used in error note when call is terminated
+// d: because of recipient restriction
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_recipient_restricts_call "Unable to call due to recipient's restrictions"
+
+// d: It is used in error note when call is terminated
+// d: because of address not in use
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_address_not_in_use "Address not in use"
+
+// d: It is used in error note when call is terminated
+// d: because of request time out
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_request_time_out "Request time out"
+
+// d: It is used in error note when call is terminated
+// d: because of invalid recipient address
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_err_invalid_address "Invalid Internet call address"
+
+// d: It is used in error note when call is terminated
+// d: because of number busy
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_address_busy "Address busy"
+
+// d: It is template for infomation note used when call is parked
+// d: %U is replaced with number to retrieve the call.
+// l: popup_note_window
+// r: 3.0
+// w:
+//
+#define qtn_voip_sccp_call_parked_query "Call parked. To retrieve the\ncall,dial %U"
+
+// d: It is used in error note when can no longer be found at 
+// d: the address in the Request-URI.
+// l: popup_note_window
+// r: 3.0
+// w:
+//
+#define qtn_voip_not_found "Not found"
+
+// d: It is used in error note when VoIP
+// d: call termination cause is 'no answer'.
+// l: popup_note_window
+// r: 3.0
+// w: 
+//
+#define qtn_voip_no_answer "No answer"
+
+// d: It's used when VoIP CLIR is set.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// r:3.0
+//
+#define qtn_voip_private_address "Private address"
+
+// d: If user has incoming VoIP call, 
+// d: "calling to" text is shown in call header.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// r:3.0
+//
+#define qtn_mtcal_voip_incoming_call "Calling to"
+
+// d: If user has incoming VoIP call, 
+// d: "calling to" text (short) is shown in call header.
+// l: popup_call_audio_first_window_t4/opt17
+// w:
+// r: 3.0
+//
+#define qtn_mtcal_voip_incoming_call_short "Calling to"
+
+// d: It is text for a menu option. If it is selected, 
+// d: Park active SCCP VoIP call
+// l: list_single_pane_t1_cp2
+// w:
+// r: 3.0
+//
+#define qtn_incal_park_option "Park"
+
+// d: It is text for a menu option. If it is selected,
+// d: a dialog is opened to allow user to enter a SIP URI
+// d: and make a call.
+// l: list_single_pane_t1_cp2
+// w:
+// r: 3.0
+//
+#define qtn_voip_new_call_voip "Internet call"
+
+// d: information note when unattended transfer request is rejected.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_info_transfer_req_rejected "Transfer request rejected"
+
+// d: Wait note when waiting acceptance for transfer request.
+// l: popup_note_wait_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_wait_waiting_accept "Waiting acceptance"
+
+// d: It is shown in a confirmation note when
+// d: unattended transfer call back event is occurred.
+// l: popup_info_list_pane_t1
+// w: 
+// r: 3.0
+//
+#define qtn_voip_transfer_call_back "Call back to\n%U"
+
+// d: It is title in transfer data query.
+// l: popup_query_data_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_transfer_address "Address:"
+
+// d: It is used when putting VoIP call on hold
+// d: fails.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_hold_failed "Putting %U on hold failed"
+
+// d: It is used when putting VoIP call on hold
+// d: fails.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_hold_number_failed "Putting Call %N on hold failed"
+
+// d: It is used when resuming VoIP call fails.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_resume_failed "Resuming %U failed"
+
+// d: It is used when resuming VoIP call fails.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_resume_number_failed "Resuming Call %N failed"
+
+// d: It is used when swapping of calls fails.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_swap_failed "Swapping of calls failed"
+
+// d: It is used when putting VoIP conference call on hold
+// d: fails.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_conference_hold_failed "Putting conference call on hold failed"
+
+// d: It is used when resuming VoIP conference call fails.
+// l: popup_note_window
+// w: 
+// r: 3.0
+//
+#define qtn_voip_conference_resume_failed "Resuming conference call failed"
+
+// d: Confirmation query when unattended transfer request is occurred.
+// l: popup_info_list_pane_t1
+// w: 
+// r: 3.0
+//
+#define qtn_voip_query_accept_identified "%0U asks acceptance to transfer call to %1U"
+
+// d: Confirmation query when unattended transfer request is occurred
+// d: and originator address is unknown.
+// l: popup_info_list_pane_t1
+// w: 
+// r: 3.0
+//
+#define qtn_voip_query_accept_cli_restricted "Anonymous asks acceptance to transfer callto %U"
+
+// d: Defines softkey text in VoIP registration view.
+// l: control_pane_t1/opt7
+// w:
+// r: 3.0
+//
+#define qtn_softk_register "Register"
+
+// d: Defines wait note text when VoIP registration in progress.
+// l: popup_note_window
+// w:
+// r: 3.0
+//
+#define qtn_sip_note_requesting "Requesting"
+
+// d:Header for unattended transfer request query qtn_voip_query_accept_identified 
+// l: heading_pane_t1 
+// w: 
+// r: 3.0
+//
+#define qtn_voip_query_acc_id_header "Transfer request:"
+
+// d: Header for unattended transfer request query qtn_voip_transfer_call_back 
+// l: heading_pane_t1 
+// w: 
+// r: 3.0
+//
+#define qtn_voip_transfer_call_back_header "Call back request:"
+
+// d: It is title in new VoIP call data query.
+// l: popup_query_data_window
+// w: 
+// r: 3.2
+//
+#define qtn_voip_new_address_query  "Address:"
+
+// d: Defines wait note text when Service registration in progress during call.
+// l: popup_note_wait_window
+// w:
+// r: VoIP Rel3.0
+//
+#define qtn_voip_enabling_service_wait_note "Enabling %U service" 
+
+// d: It is used as a softkey text in number entry state.
+// d: Command text associated to a softkey in the control pane.
+// d: Soft key 2. Creates VoIP call
+// l: control_pane_t2/opt7
+// w: 
+// r: VoIP Rel3.0
+//
+#define qtn_voip_softkey_voip_call "VoIP call"
+
+// d: Defines query header when there are 2+ services to select.
+// l: heading_pane_t1
+// w:
+// r: VoIP Rel3.0
+//
+#define qtn_voip_select_service_query "Select service to be used:"
+
+// d: Displayed when authetication fails. 
+// l: popup_note_window
+// w:
+// r: VoIP Rel3.0
+//
+#define qtn_voip_error_note_authentication_failed "Authentication failed"
+
+// d: Displayed when registering is failed due to incomplete or wrong settings.
+// d: %U is replaced with service name 
+// l: popup_note_window
+// w:
+// r: VoIP Rel3.0
+//
+#define qtn_voip_defective_settings_note "Defective settings. %U service not available"
+
+// d: It is shown when user tries to make Internet Call or call out call
+// d: but terminal is not within network coverage.
+// l: popup_note_window
+// w:
+// r: VoIP Rel3.0
+//
+#define qtn_voip_no_connections_available_note "No connections available"
+
+// d: Displayed if there are no access points in service’s destination.
+// l: popup_note_window
+// w: 
+// r: VoIP Rel3.0
+//
+#define qtn_voip_no_connections_defined "No connections defined"
+
+// d: Displayed when recived following error codes from network 
+// d: 482 Loop detected
+// d: 483 Too many hops
+// d: 500 Internal server error
+// d: 501 Not implemented
+// d: 502 Bad gateway
+// d: 503 Service unavailable
+// d: 504 Server timeout
+// d: 505 Version not supported
+// d: 513 Message too large
+// d: 580 Precondition failure
+// d: 5xx General request failure
+// l: popup_note_window
+// w: 
+// r: VoIP Rel3.0
+//
+#define qtn_voip_network_error_note "Network error"
+
+// d: Displayed when the service is in enabled and
+// d: and registered state. The user tries to call 
+// d: but access point does not support calls.
+// l: popup_note_window
+// w: 
+// r: VoIP Rel3.0
+//
+#define qtn_voip_error_in_connection "Error in connection"
+
+// d: Displayed when recived following error codes from network
+// d: 401, 402, 403, 407, 423, 489, 494
+// d: %U means the service that was used when response
+// d: was received.
+// l: popup_note_window
+// w: 
+// r: VoIP Rel3.0
+//
+#define qtn_no_service_available_info "%U service not available"
+
+
+// d: Defines wait note text when access point that does not support calling
+// d: is being removed from destination used by the service.
+// d: %U states the service's name.
+// l: popup_note_wait_window
+// w:
+// r: VoIP Rel3.0
+//
+#define qtn_voip_disconnecting_service_wait_note "Disconnecting %U" 
+
+// d: It is shown in a confirmation note when
+// d: user has added new connection method to destination used by the service
+// d: and the call fails because the new connection method does not support voip calls.
+// d: %U states the connection method's name.
+// l: popup_note_window
+// w:
+// r: VoIP Rel3.0
+//
+#define qtn_voip_calls_not_supported_disconnect_query "%U connection does not support calling. Remove it and register to another?"
+
+// d: Shown in a wait note when user starts connection establishment by calling 
+// d: outside service tab.
+// l: popup_note_wait_window
+// w:
+// r: 5.0
+#define qtn_ipcomm_connecting_servicename_wait_note "Connecting %U"
+
+// d: Shown when user tries to connect to service outside service tab and
+// d: there are no connections defined.
+// l: popup_note_window
+// w:
+// r: 5.0
+#define qtn_ipcomm_no_conn_defined_note "No connections defined for %U"
+
+// d: Shown when user tries to connect to service outside service tab and
+// d: access points defined for service are not available.
+// l: popup_note_window
+// w:
+// r: 5.0
+#define qtn_ipcomm_no_conn_available_note "No connections available for %U"  
+
+// d: Shown in case when user tries to call using a service which does not support
+// d: internet call or service is connected via 2G.
+// l: popup_note_window
+// w:
+// r: 5.0
+#define qtn_ipcomm_conn_supports_no_calls_note "%U connection does not support calls"
+
+// d: Shown when user tries to create an internet call outside service tab when 
+// d: service is either creating connection or performing application level roaming.
+// l: popup_note_window
+// w:
+// r: 5.0
+#define qtn_ipcomm_not_available_during_alr "%U not available when connecting" 
+
+// d: Shown when connection tried outside service tab fails due to incomplete 
+// d: settings which will most definetely prevent the registration.
+// l: popup_note_window
+// w:
+// r: 5.0
+#define qtn_ipcomm_creating_conn_failed_permanently "Connecting %U failed due to defective settings. Contact your service provider."
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/phoneui2.pro	Fri Jun 04 10:19:18 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: Project file for building Phoneui component
+#
+#
+
+
+TEMPLATE = app
+TARGET = phoneui
+CONFIG += hb svg
+RESOURCES = ./phoneui2.qrc
+
+TRANSLATIONS = telephone.ts
+
+symbian {
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.UID3 = 0x100058B3
+    TARGET.VID = VID_DEFAULT
+    TARGET.EPOCHEAPSIZE = 0x1000 0xA00000 
+    DEFINES += FT_SYMBIAN_INTEGRATION
+
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    INCLUDEPATH += ../../inc \
+                   ../phoneui/inc \
+                   ../phoneuicontrol/inc \
+                   ../phoneuiutils/inc \
+                   ../phoneuiqtviewadapter/inc \
+                   ../phoneuiview2/inc
+
+    LIBS += -lphoneengine \
+            -lphoneuiutils \
+            -lphoneuicontrol \
+            -lphoneuiqtviewadapter \
+            -lphoneuiqtview \
+            -lFeatMgr      
+      
+      BLD_INF_RULES.prj_exports += \
+       "$${LITERAL_HASH}include <platform_paths.hrh>" \
+       "./rom/phoneui.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(phoneui.iby)" \
+       "./rom/phoneuiresources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(phoneuiresources.iby)"
+       
+       RSS_RULES += "hidden = KAppIsHidden;"
+}
+
+HEADERS += ./inc/hbphonemainwindow.h \
+           ./inc/phoneuikeyeventadapter.h \
+           ./inc/phoneuicommandadapter.h \
+           ./inc/phoneuihousehold.h \
+           ./inc/phoneuihousehold_p.h
+       
+SOURCES   += ./src/main.cpp \
+             ./src/phoneuikeyeventadapter.cpp \
+             ./src/phoneuicommandadapter.cpp \
+             ./src/hbphonemainwindow.cpp \
+             ./src/phoneuihousehold.cpp \
+             ./src/phoneuihousehold_p.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/phoneui2.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,21 @@
+<RCC>
+    <qresource prefix="/" >                  
+        <file>themes/icons/hbdefault/scalable/qtg_mono_swap.svg</file>        
+        <file>themes/icons/hbdefault/scalable/qtg_mono_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_reject_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_end_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_hold_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_join_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_private_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_drop_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_replace_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_send.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_mic_mute.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_mic_unmute.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_dialer.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_speaker.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_contacts.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_mobile.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/rom/phoneui.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI iby file
+*
+*/
+
+
+#ifndef __PHONEUI_IBY__
+#define __PHONEUI_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+#define UPGRADABLE_APP_REG_RSC(NAME) data=DATAZ_\PRIVATE\10003A3F\IMPORT\APPS\ ## NAME ## _reg.rsc        Private\10003a3f\import\apps\ ## NAME ## _reg.rsc
+
+REM PhoneUI
+S60_APP_EXE(phoneui)
+UPGRADABLE_APP_REG_RSC(phoneui)
+S60_APP_AIF_RSC(phoneui)
+//S60_APP_BITMAP(phoneui)
+//S60_APP_AIF_ICONS(phoneui)
+
+//#if defined (FF_TOUCH_CALL_HANDLING) || defined ( __ON_SCREEN_DIALER )
+//SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,PhoneUI)
+//#endif // FF_TOUCH_CALL_HANDLING || __ON_SCREEN_DIALER
+
+file=ABI_DIR\BUILD_DIR\phoneuicontrol.dll               SHARED_LIB_DIR\phoneuicontrol.dll
+file=ABI_DIR\BUILD_DIR\phoneuiutils.dll                 SHARED_LIB_DIR\phoneuiutils.dll
+file=ABI_DIR\BUILD_DIR\phoneuistates.dll                SHARED_LIB_DIR\phoneuistates.dll
+file=ABI_DIR\BUILD_DIR\phoneuiqtviewadapter.dll         SHARED_LIB_DIR\phoneuiqtviewadapter.dll
+file=ABI_DIR\BUILD_DIR\phoneuiqtview.dll                SHARED_LIB_DIR\phoneuiqtview.dll
+file=ABI_DIR\BUILD_DIR\phoneringingtoneplayer.dll       SHARED_LIB_DIR\phoneringingtoneplayer.dll
+file=ABI_DIR\BUILD_DIR\phonestringloader.dll            SHARED_LIB_DIR\phonestringloader.dll
+file=ABI_DIR\BUILD_DIR\phonemediatorcenter.dll          SHARED_LIB_DIR\phonemediatorcenter.dll
+file=ABI_DIR\BUILD_DIR\phoneuivoipextension.dll         SHARED_LIB_DIR\phoneuivoipextension.dll
+
+data=ZSYSTEM\install\phoneuivoipextension_stub.sis  System\Install\phoneuivoipextension_stub.sis
+//data=ZSYSTEM\install\phoneui_stub.sis               System\Install\phoneui_stub.sis
+data=ZSYSTEM\install\phoneuicontrol_stub.sis        System\Install\phoneuicontrol_stub.sis
+data=ZSYSTEM\install\phoneuistates_stub.sis         System\Install\phoneuistates_stub.sis
+data=ZSYSTEM\install\phoneuiutils_stub.sis          System\Install\phoneuiutils_stub.sis
+data=ZSYSTEM\install\phonemediatorcenter_stub.sis   System\Install\phonemediatorcenter_stub.sis
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/rom/phoneuiresources.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI Resources iby file
+*
+*/
+
+
+#ifndef __PHONEUI_RESOURCES_IBY__
+#define __PHONEUI_RESOURCES_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\RESOURCE_FILES_DIR\PhoneClient.rsc RESOURCE_FILES_DIR\PhoneClient.rsc
+data=DATAZ_\RESOURCE_FILES_DIR\PhoneServer.rsc RESOURCE_FILES_DIR\PhoneServer.rsc
+
+S60_APP_RESOURCE(phoneui)
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\telephone.qm QT_TRANSLATIONS_DIR\telephone.qm
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/src/hbphonemainwindow.cpp	Fri Jun 04 10:19:18 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:  Main window class.
+*
+*/
+
+#include "hbphonemainwindow.h"
+#include "phoneuihousehold.h"
+
+HbPhoneMainWindow::HbPhoneMainWindow(QWidget *parent): 
+    HbMainWindow(parent)
+{
+    mHouseHold = new PhoneUiHouseHold (*this);
+}
+
+HbPhoneMainWindow::~HbPhoneMainWindow ()
+{
+    delete mHouseHold;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/src/main.cpp	Fri Jun 04 10:19:18 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:  Main.
+*
+*/
+
+#include <QGraphicsWidget>
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbtoolbar.h>
+
+#include "hbphonemainwindow.h"
+
+
+int main (int argc, char *argv[])
+{
+    HbApplication app (argc, argv, Hb::NoSplash);
+    HbPhoneMainWindow window;
+    return app.exec ();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/src/phoneuicommandadapter.cpp	Fri Jun 04 10:19:18 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:  Adapter for UI commands from view to state.
+*
+*/
+
+#include <exception> // must be before e32base.h so uncaught_exception gets defined
+#include "mphonemenuandcbaevents.h"
+#include "phoneuicommandadapter.h"
+
+PhoneUiCommandAdapter::PhoneUiCommandAdapter (
+    MPhoneMenuAndCbaEvents &commandHandler, QObject *parent ) :
+    QObject (parent), m_handler (commandHandler)
+{
+}
+
+PhoneUiCommandAdapter::~PhoneUiCommandAdapter ()
+{   
+}
+
+void PhoneUiCommandAdapter::handleCommand (int command)
+{
+    TRAP_IGNORE(m_handler.HandleCommandL ( (TInt) command ));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/src/phoneuihousehold.cpp	Fri Jun 04 10:19:18 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:  Ui household class.
+*
+*/
+
+#include "phoneuihousehold.h"
+#include "phoneuihousehold_p.h"
+
+PhoneUiHouseHold::PhoneUiHouseHold (HbMainWindow &window)
+{
+    mHouseHoldPrivate = new PhoneUiHouseHoldPrivate (window);
+}
+
+PhoneUiHouseHold::~PhoneUiHouseHold ()
+{
+    delete mHouseHoldPrivate;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/src/phoneuihousehold_p.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,376 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Household private class.
+*
+*/
+
+#include <exception> // must be before e32base.h so uncaught_exception gets defined
+#include <starterclient.h>
+#include <telinternalpskeys.h>
+#include <QLocale>
+#include <QTranslator>
+#include <telremotepartyinformationpskeys.h>
+#include <telinformationpskeys.h>
+#include <UikonInternalPSKeys.h>
+#include <startupdomainpskeys.h>
+#include <featmgr.h>        // for FeatureManager
+#include <hbmainwindow.h>
+#include "phoneconstants.h"
+#include "cphonelogger.h"
+#include "cphonepubsubproxy.h"
+#include "cphoneqwertyhandler.h"
+#include "cphoneuicontroller.h"
+#include "phoneuihousehold_p.h"
+#include "phoneuiqtviewadapter.h"
+#include "phoneuiqtview.h"
+#include "phoneuikeyeventadapter.h"
+#include "phoneuicommandadapter.h"
+#include "phonenotecontroller.h"
+#include "qtphonelog.h"
+#include "cphoneclearblacklist.h"
+#include "hbinstance.h"
+
+PhoneUiHouseHoldPrivate::PhoneUiHouseHoldPrivate(HbMainWindow &window) :
+    iAppsReady (0), iStartupSignalRecoveryId (0), iLightIdleReached (EFalse),
+    iOnScreenDialer (EFalse), iQwertyHandler (0), iPhoneUIController (0),
+    m_window (window)
+{
+    PHONE_DEBUG("phoneui - Start phoneapp");
+    
+    TRAPD( error, ConstructL() );
+    qt_symbian_throwIfError(error);
+}
+
+PhoneUiHouseHoldPrivate::~PhoneUiHouseHoldPrivate()
+{
+    while (!m_translators.isEmpty()) {
+        QTranslator *translator = m_translators.takeFirst();
+        qApp->removeTranslator(translator);
+        delete translator;
+        translator = 0;
+    }
+    
+    delete iKeyEventAdapter;
+    delete iCommandAdapter;
+    delete iPhoneUIController;
+    delete iViewAdapter;
+}
+
+TInt PhoneUiHouseHoldPrivate::DoStartupSignalL( TAny* aAny )
+{
+    PhoneUiHouseHoldPrivate* appUi =
+        static_cast< PhoneUiHouseHoldPrivate* >( aAny );
+    
+    return
+        !appUi->iLightIdleReached ?
+            appUi->DoStartupSignalIdleL() :
+            appUi->DoStartupSignalSecurityL();
+}
+
+TInt PhoneUiHouseHoldPrivate::DoStartupSignalIdleL()
+    {
+    TBool idleReached = EFalse;
+    
+    // Check if Idle application has been started.
+    const TInt idleUid = 0x20022F35;
+    PHONE_DEBUG2("phoneui::DoStartupSignalIdleL() idleUID=", idleUid);
+    
+    if ( idleUid != 0 && idleUid != KErrNotFound )
+        {
+        // Idle application has already started
+        if ( !( iAppsReady & EPhoneIdleStartedUp ) )
+            {
+            PHONE_DEBUG("phoneui::DoStartupSignalIdleL() Idle App started ");
+            iAppsReady += EPhoneIdleStartedUp;
+            
+            // Remove Phone application from Fast Swap Window.
+//            iPhoneViewController->SetHiddenL( ETrue );
+            
+            // Set Idle's UID to PubSub.
+            CPhonePubSubProxy::Instance()->ChangePropertyValue(
+                KPSUidUikon,
+                KUikVideoCallTopApp,
+                idleUid );
+                
+            // hack to make sure EPhonePhase1Ok is set - to be fixed properly
+            idleReached = true;
+            PHONE_DEBUG("phoneui::DoStartupSignalIdleL() Phone and Idle apps have both been started");    
+            CPhonePubSubProxy::Instance()->ChangePropertyValue(
+                KPSUidStartup,
+                KPSPhonePhase1Ok,
+                EPhonePhase1Ok );
+            }
+        }
+
+    if ( idleReached )
+        {
+        PHONE_DEBUG("phoneui::DoStartupSignalIdleL() Idle reached!");
+        // Now err == KErrNone and it means that
+        // we have succeeded in signalling.
+        CPhoneRecoverySystem::Instance()->EnablePreconditionL();
+
+        // Update the Phone light idle flag
+        iLightIdleReached = ETrue;
+
+        // Notify the UI controller that the phone is ready
+        iPhoneUIController->HandlePhoneStartupL();
+        }
+    else 
+        {
+        PHONE_DEBUG("phoneui::DoStartupSignalIdleL() Idle is not reached yet!");
+        // Idle has not been reached yet. Indicate to the recovery
+        // system that this iteration has failed so that it will
+        // try again at a later time.
+        User::Leave( KErrNotReady );
+        }
+
+    return KErrNone;
+    }
+
+TInt PhoneUiHouseHoldPrivate::DoStartupSignalSecurityL()
+    {
+    TInt err = KErrNone;    
+    return err;
+    }
+
+void PhoneUiHouseHoldPrivate::HandlePropertyChangedL(
+        const TUid& aCategory, const TUint /*aKey*/, const TInt /*aValue*/)
+{
+    PHONE_DEBUG("phoneui::HandlePropertyChangedL()");
+    
+    if ( aCategory == KPSUidStartup )
+        {
+        
+        const TInt startupState = CPhonePubSubProxy::Instance()->Value(
+            KPSUidStartup,
+            KPSGlobalSystemState );
+        
+        PHONE_DEBUG2("phoneui::HandlePropertyChangedL() StartupState value=%d", startupState );
+       
+        if ( startupState == ESwStateCriticalPhaseOK ||
+            startupState == ESwStateEmergencyCallsOnly ||
+            startupState == ESwStateNormalRfOn ||
+            startupState == ESwStateNormalRfOff ||
+            startupState == ESwStateNormalBTSap )
+            {
+            PHONE_DEBUG("phoneui::HandlePropertyChangedL() Try to update the startup signal again..." );
+            // Try to update the startup signal again
+            CPhoneRecoverySystem::Instance()->RecoverNow(
+                iStartupSignalRecoveryId, 
+                CTeleRecoverySystem::EPhonePriorityHigh );    
+            }
+        }
+}
+
+void PhoneUiHouseHoldPrivate::ConstructL()
+{
+    new( ELeave ) CPhoneLogger( KUidPhoneUILoggerSingleton );
+    FeatureManager::InitializeLibL();
+    
+    QString locale = QLocale::system ().name ();
+    QTranslator *translator = new QTranslator;
+    QString path = QString("z:\\resource\\qt\\translations\\");
+
+    bool translatorLoaded = translator->load(QString(path + "telephone_" + locale));
+    PHONE_DEBUG2("PhoneUiHouseHoldPrivate::ConstructL() translator.load:", translatorLoaded);
+	if (translatorLoaded) {
+        qApp->installTranslator(translator);
+        m_translators.append(translator);
+	}else {
+        delete translator;
+        translator = 0;
+    }
+    
+    QTranslator *translator2 = new QTranslator;
+    translatorLoaded = translator2->load(path + "telephone_cp_" + locale);
+    if (translatorLoaded) {
+        qApp->installTranslator(translator2);
+        m_translators.append(translator2);
+    } else {
+        delete translator2;
+        translator2 = 0;
+    }
+
+    QTranslator *translator3 = new QTranslator;
+    translatorLoaded = translator3->load(path + "common_" + locale);
+    if (translatorLoaded) {
+        qApp->installTranslator(translator3);
+        m_translators.append(translator3);
+    } else {
+        delete translator3;
+        translator3 = 0;
+    }
+
+    PhoneUIQtView *view = new PhoneUIQtView(m_window);
+    iViewAdapter = new PhoneUIQtViewAdapter(*view);
+    iPhoneUIController = CPhoneUIController::NewL(iViewAdapter);
+    
+    m_window.addView (view);
+    m_window.setCurrentView (view);
+    m_window.scene ()->setFocusItem (view);
+    iQwertyHandler = CPhoneQwertyHandler::NewL();
+    iKeyEventAdapter = new PhoneUIKeyEventAdapter (*iPhoneUIController);
+    iCommandAdapter = new PhoneUiCommandAdapter (*iPhoneUIController);
+    QObject::connect(view, SIGNAL(dialpadIsAboutToClose()), iViewAdapter, SLOT(dialpadClosed()));
+    QObject::connect(view, SIGNAL(keyReleased(QKeyEvent *)), iViewAdapter, SLOT(keyReleased (QKeyEvent *)));
+    QObject::connect(view, SIGNAL(keyPressed (QKeyEvent *)), iKeyEventAdapter, SLOT(keyPressed (QKeyEvent *)));
+    QObject::connect(view, SIGNAL(keyReleased (QKeyEvent *)), iKeyEventAdapter, SLOT(keyReleased (QKeyEvent *)));
+    QObject::connect(view, SIGNAL(command (int)), iCommandAdapter, SLOT(handleCommand (int)),
+                     Qt::QueuedConnection); // async to enable deletion of widget during signal handling
+    QObject::connect(view, SIGNAL(windowActivated()), iViewAdapter, SLOT(handleWindowActivated()));
+    QObject::connect(view, SIGNAL(windowDeactivated()), iViewAdapter, SLOT(handleWindowDeactivated()));
+    
+    QObject::connect(iViewAdapter->noteController(), SIGNAL(command (int)), 
+                     iCommandAdapter, SLOT(handleCommand (int))); 
+    
+    // Disable default Send key functionality in application framework 
+    CAknAppUi *appUi = static_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
+    appUi->SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | 
+                             CAknAppUiBase::EDisableSendKeyLong );
+    
+    // CLI Name.
+    TInt err = RProperty::Define( 
+        KPSUidTelRemotePartyInformation,
+        KTelCLIName,
+        RProperty::EText,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );
+      
+    // CLI Number.
+    err = RProperty::Define( 
+        KPSUidTelRemotePartyInformation,
+        KTelCLINumber,
+        RProperty::EText,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );
+
+    // Define the top application system property
+    err = RProperty::Define( 
+        KPSUidUikon,
+        KUikVideoCallTopApp,
+        RProperty::EInt,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );
+
+
+    // Startup event signalling
+    // Define the telephony application system property 
+ 
+     err = RProperty::Define( 
+        KPSUidTelInformation,
+        KTelPhoneUid,
+        RProperty::EInt,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );  
+
+// DefineNewPSKeys:
+
+    // UID: KPSUidTelInternalInformation:
+    err = RProperty::Define( 
+        KPSUidTelInternalInformation,
+        KTelRemotePartyContactInfo,
+        RProperty::EByteArray,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );    
+               
+    // VT UID.
+    err = RProperty::Define( 
+        KPSUidTelInternalInformation,
+        KTelVideoCallUid,
+        RProperty::EInt,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy );
+
+    // TELINTERNALPSKEY CHANGE 
+    // Move to AudioHandling
+    // UID: KPSUidTelAudioPreference
+    // Call Audio Routing
+    err = RProperty::Define( 
+        KPSUidTelAudioPreference, 
+        KTelAudioOutput, 
+        RProperty::EInt,
+        KPhoneReadPolicyAlwaysPass,
+        KPhoneWritePolicy );
+
+    // UID: KPSUidNEInformation
+    err = RProperty::Define( 
+        KPSUidNEInformation, 
+        KTelNumberEntryInfo, 
+        RProperty::EInt,
+        KPhoneReadPolicyAlwaysPass,
+        KPhoneWritePolicy );
+
+
+    // Add DoStartupSignalL to the recovery system 
+    iStartupSignalRecoveryId = 
+        CPhoneRecoverySystem::Instance()->AddL( 
+            TCallBack( DoStartupSignalL, this ),
+            CTeleRecoverySystem::EPhonePriorityHigh,
+            CTeleRecoverySystem::EPhoneStateIdle );
+
+    // Call DoStartupSignalL within recovery system
+    const TInt startupState = CPhonePubSubProxy::Instance()->Value(
+        KPSUidStartup,
+        KPSGlobalSystemState );
+
+    PHONE_DEBUG2("phoneui::main() startupState value=", startupState );
+
+    if ( startupState == ESwStateCriticalPhaseOK ||
+        startupState == ESwStateEmergencyCallsOnly ||
+        startupState == ESwStateNormalRfOn ||
+        startupState == ESwStateNormalRfOff ||
+        startupState == ESwStateNormalBTSap )
+        {
+        PHONE_DEBUG("phoneui::main() Notify Starter that phone is ready...");    
+        CPhoneRecoverySystem::Instance()->RecoverNow(
+            iStartupSignalRecoveryId, 
+            CTeleRecoverySystem::EPhonePriorityHigh );
+        }
+    else
+        {        
+        PHONE_DEBUG("phoneui::main() Startup not ready yet. Start listening...");
+        CPhonePubSubProxy::Instance()->NotifyChangeL(
+            KPSUidStartup,
+            KPSGlobalSystemState,
+            this );
+        }
+
+    if ( err == KErrNone || err == KErrAlreadyExists )
+        {
+        // Indicate to the system that the Phone has been started
+        CPhonePubSubProxy::Instance()->ChangePropertyValue(
+            KPSUidTelInformation,
+            KTelPhoneUid,
+            KUidPhoneApplication.iUid );
+        }
+
+    // Update the Apps ready flag
+    iAppsReady += EPhoneStartedUp;
+    
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )     
+        {
+        iOnScreenDialer = ETrue;
+        }
+
+     HbMainWindow *main = hbInstance->allMainWindows().at(0);
+    RWindow *win = static_cast<RWindow *>(main->effectiveWinId()->DrawableWindow());
+
+    CEikonEnv* env = CEikonEnv::Static();
+    if ( env ) {
+        env->SetSystem(ETrue);
+        // Blacklist singleton is initialized here
+        CPhoneClearBlacklist::CreateL( env->WsSession(), *win);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/src/phoneuikeyeventadapter.cpp	Fri Jun 04 10:19:18 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:  Adapter for converting Qt key event types to
+*               Symbian types.
+*
+*/
+
+#include <exception> // must be before e32base.h so uncaught_exception gets defined
+#include <QKeyEvent>
+#include "phoneuikeyeventadapter.h"
+#include "phoneconstants.h"
+
+PhoneUIKeyEventAdapter::PhoneUIKeyEventAdapter (MPhoneKeyEventHandler &keyEventHandler, QObject *parent) :
+    QObject (parent), mHandler (keyEventHandler)
+{
+}
+
+PhoneUIKeyEventAdapter::~PhoneUIKeyEventAdapter ()
+{
+    
+}
+
+void PhoneUIKeyEventAdapter::keyPressed (QKeyEvent *event)
+{
+    forwardKeyEvent(EEventKey, event);
+}
+
+void PhoneUIKeyEventAdapter::keyReleased (QKeyEvent *event)
+{
+    forwardKeyEvent(EEventKeyUp, event);    
+}
+
+void PhoneUIKeyEventAdapter::forwardKeyEvent(
+        TEventCode symbianEventCode, QKeyEvent *event)
+{
+    TKeyEvent symbianKeyEvent;
+    symbianKeyEvent.iCode = convertKeyCode(event);
+    symbianKeyEvent.iRepeats = 0;
+    
+    if (event->isAutoRepeat()) {
+        symbianEventCode = (TEventCode)EEventLongPress;
+    }
+    symbianKeyEvent.iScanCode = convertKeyCode(event);
+    
+    TRAP_IGNORE(mHandler.HandleKeyEventL (symbianKeyEvent, symbianEventCode));  
+}
+
+int PhoneUIKeyEventAdapter::convertKeyCode(QKeyEvent *event)
+{
+    int code(0);
+    
+    switch(event->key()) {
+        case Qt::Key_Yes:
+            code = EKeyYes;
+            break;
+        case Qt::Key_No:
+            code = EKeyNo;
+            break;
+        case Qt::Key_NumberSign:
+            code = KPhoneDtmfHashCharacter;
+            break;
+        case Qt::Key_Asterisk:
+            code = KPhoneDtmfStarCharacter;
+            break;
+        default:
+            code = event->key();
+            break;
+        }
+ 
+    return code;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/srcdata/phoneui.hrh	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains declarations for resources of PhoneAppS60.
+*     The file can be included in C++ or resource file.
+*     
+*
+*/
+
+#ifndef PHONEUI_HRH
+#define PHONEUI_HRH
+
+#include    <bldvariant.hrh>
+#include    <phoneappcommands.hrh>
+
+//  CONSTANTS
+
+#define PHONEUI_SCALABLE_AIF_ICON_FILE  "Z:\\resource\\apps\\phoneui_aif.mif"
+#define PHONEUI_AIF_ICON_FILE       "Z:\\resource\\apps\\phoneui_aif.mbm"
+
+#define LOCALISABLE_RESOURCE_FILE_EXE   "\\resource\\apps\\phoneui"
+#define LOCALISABLE_RESOURCE_FILE_APP   "\\System\\Apps\\phoneui"
+
+enum 
+    { 
+    EPhoneGeneralNote = 1,
+    EPhoneWaitNote
+    };
+
+// CALLING LINE IDENTITY
+
+// It enumerates different states for a call.
+enum 
+    {
+    // DO NOT MODIFY THESE
+    EPhoneStAny = 0x100,          // any state.
+    EPhoneStIncoming = 0x200,     // arriving, waiting
+    EPhoneStOutgoing = 0x400,     // initializing, alerting
+    EPhoneStConnected = 0x800,    // alerting, active, on hold
+    EPhoneStOngoing = 0x1000,     // alerting, active, on hold, disconnected
+
+    EPhoneStIdle = 0x100 + 0x7,
+    EPhoneStArriving = 0x200 + 0x100 + 0,
+    EPhoneStWaiting = 0x200 + 0x100 + 1,
+    EPhoneStInitializing = 0x400 + 0x100 + 2,
+    EPhoneStAlerting = 0x1000 + 0x400 + 0x800 + 0x100 + 3,
+    EPhoneStActive = 0x1000 + 0x800 + 0x100 + 4,
+    EPhoneStOnHold = 0x1000 + 0x800 + 0x100 + 5,
+    EPhoneStDisconnected = 0x1000 + 0x100 + 6
+    };
+
+enum TPhoneUIGSMStatesConferenceStates
+    {
+    ENoActiveCalls = 0,
+    EOneActiveCall,
+    ETwoActiveCalls
+    };
+
+enum //enums for SWIS Sharing 
+    {
+    EPhoneVideoSharing =  10000,
+    EPhoneVideoSharingOpt2,
+    EPhoneVideoSharingOpt3 
+    };
+
+// Configurable buttons
+enum TPhoneUIConfigurableButtons
+    {
+    EPhoneConfigIncomingCallButtons = 0,
+    EPhoneButtonConfigCount
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/srcdata/phoneui.pan	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI panic reason codes
+ *
+*/
+
+
+#ifndef __PHONEUI_PAN__
+#define __PHONEUI_PAN__
+
+
+enum TPhoneUiUtils
+	{
+    EPhoneUtilsIndexOutOfBounds = 1,
+    EPhoneUtilsResourcePhoneappNotFound = 2,
+    EPhoneUtilsCouldNotCreateSingleton = 3,
+    EPhoneUtilsBufferOverflow = 4,
+    EPhoneUtilsInvariant = 5,
+    EPhoneUtilsParameterNotInitialized = 6,
+    EPhoneUtilsNoCallBack = 7,
+    EPhoneUtilsInvalidArgument = 8
+    };
+
+enum TPhoneUiView
+	{
+	EPhoneViewCaseNotHandled = 20,
+	EPhoneViewGeneralError = 21,
+	EPhoneViewNoImgConverterObserver = 22,
+	EPhoneViewParameterNotInitialized = 23,
+	EPhoneViewIndexOutOfBounds = 24,
+	EPhoneViewInvariant = 25,
+	EPhoneViewErrorInAddingResourceFile = 26
+	};
+	
+enum TPhoneUiControl
+	{
+	EPhoneCtrlSingletonNotInitialized = 40,
+	EPhoneCtrlFactoryLibraryNotFound = 41,
+	EPhoneCtrlUnknownPanic = 42,
+	EPhoneCtrlInvariant = 43,
+	EPhoneCtrlParameterNotInitialized = 44,
+	EPhoneCtrlCaseNotHandled = 45,
+	EPhoneCtrlIndexOutOfBounds = 46,
+	EPhoneCtrlPSKeyDefineFail = 47,
+	};
+
+enum TPhoneUi
+	{
+    EPhoneUiNoWindowGroup = 60
+	};
+
+enum TPhoneMediatorCenter
+	{
+	EPhoneMediatorCenterSingletonNotInitialized = 80,
+	EPhoneMediatorCenterCouldNotCreateSingleton,
+	EPhoneMediatorCenterParameterNotInitialized,
+	EPhoneMediatorCenterInvalidCommand,
+	EPhoneMediatorCenterInitializationPanic,
+	EPhoneMediatorCenterRegistrationFailed
+	};
+
+inline void Panic( TInt aReason )
+    {
+	_LIT( componentName, "Common phone" );
+    User::Panic( componentName, aReason );
+    }
+
+#endif  // __PHONEUI_PAN__
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,9 @@
+<?xml version="1.0" ?>
+<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1 Tiny//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd'>
+<svg baseProfile="tiny" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<rect fill="none" height="30" width="30"/>
+
+<path d="M28.58,7.523l-7.359,4.248c-0.364,0.152-0.771,0.057-0.953-0.256l-1.277-2.142c-0.002,0.002-0.006,0.007-0.007,0.008-0.001-0.001,0-0.003-0.001-0.004-1.119,0.582-3.617,2.223-5.187,3.79-1.632,1.635-3.149,3.394-4.417,5.576,0,0-0.006,0.008-0.008,0.01,0.009,0.002,0.018,0.002,0.027,0.003l2.725,1.743c0.344,0.222,0.412,0.706,0.158,1.078l-4.794,7.05c-0.254,0.37-0.736,0.491-1.081,0.268,0,0-0.298-0.194-1.021-0.83h-0.003c-0.394-0.347-0.411-0.476-0.785-0.925-0.319-0.385-0.573-0.765-0.783-1.114-0.001-0.001-0.004,0-0.005-0.002-0.043-0.071-0.081-0.139-0.119-0.207-0.005-0.009-0.01-0.018-0.015-0.024-0.391-0.698-0.56-1.211-0.56-1.211-0.178-0.688-0.252-3.057,0.563-5.205,0.52-1.364,3.24-5.672,6.42-8.854,3.181-3.182,8.125-6.349,10.3-7.005,2.176-0.656,3.903-0.556,4.417-0.374,0,0,1.326,0.434,2.53,1.536,0.401,0.367,0.439,0.382,0.751,0.765,0.002,0.003,0,0.006,0.002,0.008-0.002-0.002-0.002-0.004-0.004-0.005,0.615,0.757,0.818,1.062,0.818,1.062,0.19,0.327,0.04,0.787-0.34,1.006z"/>
+
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_contacts.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="32px" version="1.1" viewBox="-3 -3 32 32" width="32px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<path d="M16.813,13.657c0.711-0.849,1.363-2.117,1.363-3.617c0-1.499-0.703-4.04-3.174-4.04c-2.469,0-3.172,2.704-3.172,4.04  c0,1.337,0.457,2.672,1.363,3.617c1.785,1.865-2.877,2.49-3.49,3.647C9.4,17.878,8.491,20,9.379,20c1.203,0,10.039,0,11.246,0  c0.875,0-0.02-2.122-0.322-2.695C19.691,16.147,15.209,15.575,16.813,13.657z"/>
+<path d="M25,0H4C3.45,0,3,0.45,3,1v3H2C0.897,4,0,4.897,0,6s0.897,2,2,2h1v3H2c-1.103,0-2,0.897-2,2s0.897,2,2,2h1v3H2  c-1.103,0-2,0.897-2,2s0.897,2,2,2h1v3c0,0.55,0.45,1,1,1h21c0.549,0,1-0.45,1-1V1C26,0.45,25.549,0,25,0z M2,7C1.45,7,1,6.55,1,6  s0.45-1,1-1h3c0.55,0,1,0.45,1,1S5.55,7,5,7H2z M2,14c-0.55,0-1-0.45-1-1s0.45-1,1-1h3c0.55,0,1,0.45,1,1s-0.45,1-1,1H2z M2,21  c-0.55,0-1-0.45-1-1s0.45-1,1-1h3c0.55,0,1,0.45,1,1s-0.45,1-1,1H2z M24,24H5v-2c1.103,0,2-0.897,2-2s-0.897-2-2-2v-3  c1.103,0,2-0.897,2-2s-0.897-2-2-2V8c1.103,0,2-0.897,2-2S6.103,4,5,4V2h19V24z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_dialer.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="30" version="1.1" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<rect fill="none" height="30" width="30"/>
+<path d="M0,0v30h30V0H0z M29,29H1V1h28V29z" fill="#FF0000"/>
+<polygon fill="#FF0000" points="24.344,2.415 27.584,5.655 18.242,15.001 27.585,24.346 24.346,27.585 14.999,18.238 5.655,27.585   2.415,24.346 11.76,15 2.415,5.655 5.655,2.415 15.002,11.763 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_drop_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="30px" version="1.1" viewBox="0 0 30 30" width="30px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<g fill-opacity="0.5" stroke-opacity="0.5">
+<rect fill="none" height="30" width="30"/>
+</g>
+<path d="M7.129,14.841c-0.006-0.09,0-0.523,0-0.614c0.621-0.419,1.057-0.91,1.383-1.552c0.605-1.188,0.281-3.985,0.281-3.985  C8.793,7.45,7.146,6,5.895,6H5.1C3.846,6,2.197,7.45,2.197,8.689c0,0-0.287,2.783,0.279,3.981c0.311,0.654,0.76,1.139,1.395,1.556  c0.002,0.085,0.007,0.529,0.002,0.614C3.795,16.056,0.2,18.233,0,18.497V22h11.5v-3.5C11.299,18.235,7.205,16.056,7.129,14.841z"/>
+<path d="M11.019,12.166l2.82-2.818c-0.124-0.181-0.2-0.352-0.21-0.507c-0.006-0.09,0-0.523,0-0.614  c0.621-0.419,1.057-0.91,1.383-1.552c0.605-1.188,0.281-3.985,0.281-3.985C15.293,1.45,13.646,0,12.395,0H11.6  c-1.254,0-2.902,1.45-2.902,2.689c0,0-0.118,1.153-0.052,2.294c1.202,0.875,2.088,2.216,2.145,3.568  c0.098,0.898,0.291,3.486-0.496,5.031c-0.215,0.422-0.468,0.806-0.762,1.156c0.403,0.321,1.018,0.747,1.815,1.261h3.505  L11.019,12.166z"/>
+<path d="M24.261,17.111c0.001-0.137,0.002-0.266,0.003-0.314c0.814-0.549,1.385-1.194,1.814-2.037  c0.795-1.559,0.369-5.229,0.369-5.229c0-1.626-2.16-3.53-3.805-3.53H21.6c-1.645,0-3.81,1.904-3.81,3.53c0,0-0.043,0.425-0.071,1.04  L24.261,17.111z"/>
+<path d="M30,22.851v-0.444c-0.079-0.104-0.616-0.434-1.328-0.884L30,22.851z"/>
+<path d="M18.411,19.559c-1.64,1.318-3.989,2.618-4.161,2.844V27h11.603L18.411,19.559z"/>
+<rect height="20.977" transform="matrix(0.7066 -0.7076 0.7076 0.7066 -6.9576 21.0662)" width="1.867" x="20.99" y="8.434"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_end_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="M28.908,18.236l-7.671-2.057c-0.341-0.139-0.547-0.472-0.461-0.798l0.571-2.261c-0.002,0.001-0.008,0.001-0.01,0.001
+	c0.001-0.001,0.002-0.002,0.002-0.003c-1.125-0.355-3.859-0.922-5.933-0.923c-2.159,0.001-4.325,0.161-6.604,0.766
+	c0,0-0.009,0.002-0.012,0.002c0.006,0.007,0.012,0.013,0.017,0.02l0.648,2.953c0.081,0.374-0.194,0.738-0.608,0.816l-7.822,1.486
+	c-0.412,0.076-0.811-0.162-0.891-0.537c0,0-0.068-0.325-0.126-1.224c-0.001,0-0.001,0-0.001-0.002
+	c-0.031-0.489,0.042-0.586,0.092-1.13c0.043-0.466,0.126-0.885,0.219-1.254c0-0.001-0.003-0.003-0.002-0.005
+	c0.019-0.074,0.039-0.145,0.059-0.216c0.002-0.009,0.005-0.018,0.006-0.025c0.203-0.72,0.43-1.17,0.43-1.17
+	c0.338-0.572,1.855-2.187,3.813-3.068C5.867,9.05,10.514,8.001,14.718,8c4.205-0.001,9.565,1.174,11.438,2.178
+	s2.946,2.212,3.165,2.671c0,0,0.59,1.164,0.658,2.688c0.023,0.509,0.037,0.543-0.01,1.002c0,0.003-0.003,0.004-0.003,0.007
+	c0-0.003,0-0.004,0-0.007c-0.094,0.907-0.161,1.243-0.161,1.243C29.71,18.14,29.308,18.344,28.908,18.236z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_hold_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="M28.908,10.028l-7.671,2.057c-0.341,0.139-0.547,0.472-0.461,0.798l0.571,2.261c-0.002-0.001-0.008-0.001-0.01-0.001
+	c0.001,0.001,0.002,0.002,0.002,0.003c-1.125,0.355-3.859,0.922-5.933,0.923c-2.159-0.001-4.325-0.161-6.604-0.766
+	c0,0-0.009-0.002-0.012-0.002c0.006-0.007,0.012-0.013,0.017-0.02l0.648-2.953c0.081-0.374-0.194-0.738-0.608-0.816l-7.822-1.486
+	c-0.412-0.076-0.811,0.162-0.891,0.537c0,0-0.068,0.325-0.126,1.224c-0.001,0-0.001,0-0.001,0.002
+	c-0.031,0.489,0.042,0.586,0.092,1.13c0.043,0.466,0.126,0.885,0.219,1.254c0,0.001-0.003,0.003-0.002,0.005
+	c0.019,0.074,0.039,0.145,0.059,0.216c0.002,0.009,0.005,0.018,0.006,0.025c0.203,0.72,0.43,1.17,0.43,1.17
+	c0.338,0.572,1.855,2.187,3.813,3.068c1.244,0.559,5.891,1.607,10.095,1.608c4.205,0.001,9.565-1.174,11.438-2.178
+	s2.946-2.212,3.165-2.671c0,0,0.59-1.164,0.658-2.688c0.023-0.509,0.037-0.543-0.01-1.002c0-0.003-0.003-0.004-0.003-0.007
+	c0,0.003,0,0.004,0,0.007c-0.094-0.907-0.161-1.243-0.161-1.243C29.71,10.125,29.308,9.921,28.908,10.028z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_join_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,31 @@
+<?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="M10.213,8.109c0.054,0.038,0.102,0.08,0.158,0.117c0.002,0.085,0.007,0.529,0.002,0.614
+	c-0.004,0.053-0.023,0.109-0.042,0.166c0.089,1.067,0.151,3.104-0.483,4.349c-0.273,0.539-0.615,1.011-1.033,1.424
+	c0.305,0.294,0.856,0.707,1.623,1.221h6.824c-0.354-0.427-0.67-0.879-0.912-1.389c-0.469-0.993-0.623-2.394-0.651-3.634
+	c-1.034-0.719-2.032-1.543-2.069-2.137c-0.006-0.09,0-0.523,0-0.614c0.621-0.419,1.057-0.91,1.383-1.552
+	c0.605-1.188,0.281-3.985,0.281-3.985C15.293,1.45,13.646,0,12.395,0H11.6c-1.254,0-2.902,1.45-2.902,2.689
+	c0,0-0.172,1.68,0.018,2.992C9.477,6.346,10.033,7.214,10.213,8.109z"/>
+<path d="M19.987,15.797c0.003,0.112,0.009,0.695,0.001,0.807c-0.005,0.076-0.032,0.158-0.061,0.24c0-0.001,0.002-0.002,0.002-0.003
+	h4.393c-0.027-0.081-0.055-0.162-0.06-0.237c-0.007-0.118-0.001-0.687,0.001-0.807c0.814-0.549,1.385-1.194,1.814-2.037
+	c0.795-1.559,0.369-5.229,0.369-5.229c0-1.626-2.16-3.53-3.805-3.53H21.6c-1.645,0-3.81,1.904-3.81,3.53
+	c0,0-0.376,3.652,0.367,5.225C18.564,14.615,19.153,15.25,19.987,15.797z"/>
+<path d="M24.677,17.443l-2.552,5.771l-2.551-5.771c-0.549,0.688-1.57,1.464-2.574,2.146V26h13v-4.594
+	C29.778,21.114,25.947,19.043,24.677,17.443z"/>
+<path d="M7.129,14.841c-0.006-0.09,0-0.523,0-0.614c0.621-0.419,1.057-0.91,1.383-1.552c0.605-1.188,0.281-3.985,0.281-3.985
+	C8.793,7.45,7.146,6,5.895,6H5.1C3.846,6,2.197,7.45,2.197,8.689c0,0-0.287,2.783,0.279,3.981c0.311,0.654,0.76,1.139,1.395,1.556
+	c0.002,0.085,0.007,0.529,0.002,0.614C3.811,15.82,1.139,17.425,0,18.148V22h1.454l7.665-5.078
+	C8.115,16.217,7.166,15.42,7.129,14.841z"/>
+<polygon points="11,18.075 2,23.537 11,29 11,26 15,26 15,21 11,21 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mic_mute.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,15 @@
+<?xml version="1.0" ?>
+<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1 Tiny//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd'>
+<svg baseProfile="tiny" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<rect fill="none" height="30" width="30"/>
+
+<path d="M12.39,8.243l4.364-4.364c1.17-1.17,3.073-1.17,4.242,0l2.13,2.121c1.169,1.17,1.169,3.073,0,4.243l-4.363,4.363,1.414,1.414,4.363-4.363c1.953-1.953,1.953-5.118,0-7.071l-2.121-2.121c-1.953-1.953-5.119-1.953-7.071,0l-4.364,4.364,1.41,1.421z"/>
+
+<path d="M17,12.5c0-1.93-1.57-3.5-3.5-3.5-0.109,0-0.212,0.021-0.318,0.032l3.786,3.785c0.01-0.11,0.03-0.21,0.03-0.32z"/>
+
+<path d="M20,26h-5v-4.808l1.023-1.022-9.19-9.19-1.387,1.388c-0.791,0.791-1.245,1.782-1.396,2.81l-0.019,0.019,0.016,0.016c-0.209,1.499,0.245,3.074,1.398,4.228l2.121,2.121c1.153,1.153,2.728,1.607,4.227,1.398l0.016,0.016,0.019-0.019c0.059-0.009,0.117-0.007,0.175-0.017v3.05h-5c-0.553,0-1,0.447-1,1v2h15v-2c0-0.55-0.45-1-1-1z"/>
+
+<rect height="35.83" transform="matrix(0.7066 -0.7076 0.7076 0.7066 -6.1479 14.8607)" width="1.867" x="13.91" y="-3.069"/>
+
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mic_unmute.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,9 @@
+<?xml version="1.0" ?>
+<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1 Tiny//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd'>
+<svg baseProfile="tiny" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<rect fill="none" height="30" width="30"/>
+
+<path d="M24.56,4.586l-2.121-2.121c-1.953-1.953-5.119-1.953-7.071,0l-4.95,4.95-1.42-1.415-2.121,2.121,1.414,1.415-2.828,2.828c-0.791,0.791-1.245,1.782-1.396,2.81l-0.019,0.019,0.016,0.016c-0.209,1.499,0.245,3.074,1.398,4.228l2.121,2.121c1.153,1.153,2.728,1.607,4.227,1.398l0.016,0.016,0.019-0.019c0.059-0.009,0.117-0.007,0.175-0.017v3.06h-5c-0.553,0-1,0.447-1,1v2h15v-2c0-0.553-0.447-1-1-1h-5v-4.808l2.464-2.464,1.414,1.414,2.121-2.121-1.414-1.414,4.95-4.95c1.96-1.956,1.96-5.121,0.01-7.074zm-11.04,9.914c-1.104,0-2-0.896-2-2s0.896-2,2-2,2,0.896,2,2-0.89,2-2,2zm9.62-4.26l-4.95,4.95-1.419-1.42c0.155-0.396,0.248-0.823,0.248-1.273,0-1.93-1.57-3.5-3.5-3.5-0.45,0-0.878,0.093-1.273,0.248l-0.42-0.419,4.95-4.95c1.17-1.17,3.073-1.17,4.242,0l2.12,2.121c1.17,1.17,1.17,3.073,0,4.24z"/>
+
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_mobile.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="32px" version="1.1" viewBox="-7 -3 32 32" width="32px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<path d="M17,0H1C0.449,0,0,0.45,0,1v24c0,0.55,0.449,1,1,1h16c0.549,0,1-0.45,1-1V1C18,0.45,17.549,0,17,0z M4,23H3  c-0.551,0-1-0.45-1-1s0.449-1,1-1h1c0.549,0,1,0.45,1,1S4.549,23,4,23z M11,23c0,0.55-0.451,1-1,1H8c-0.551,0-1-0.45-1-1v-2  c0-0.55,0.449-1,1-1h2c0.549,0,1,0.45,1,1V23z M15,23h-1c-0.551,0-1-0.45-1-1s0.449-1,1-1h1c0.549,0,1,0.45,1,1S15.549,23,15,23z   M16,18H2V2h14V18z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_private_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="30px" version="1.1" viewBox="0 0 30 30" width="30px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<g fill-opacity="0.5" stroke-opacity="0.5">
+<rect fill="none" height="30" width="30"/>
+</g>
+<path d="M7.129,15.841c-0.006-0.09,0-0.523,0-0.614c0.621-0.419,1.057-0.91,1.383-1.552c0.605-1.188,0.281-3.985,0.281-3.985  C8.793,8.45,7.146,7,5.895,7H5.1C3.846,7,2.197,8.45,2.197,9.689c0,0-0.287,2.783,0.279,3.981c0.311,0.654,0.76,1.139,1.395,1.556  c0.002,0.085,0.007,0.529,0.002,0.614C3.795,17.056,0.2,19.233,0,19.497V23h11.5v-3.5C11.299,19.235,7.205,17.056,7.129,15.841z"/>
+<path d="M16.35,16.611c-0.603-1.273-0.687-3.219-0.65-4.633c-1.034-0.719-2.033-1.543-2.07-2.138c-0.006-0.09,0-0.523,0-0.614  c0.621-0.419,1.057-0.91,1.383-1.552c0.605-1.188,0.281-3.985,0.281-3.985C15.293,2.45,13.646,1,12.395,1H11.6  c-1.254,0-2.902,1.45-2.902,2.689c0,0-0.118,1.153-0.052,2.294c1.202,0.875,2.088,2.216,2.145,3.568  c0.098,0.898,0.291,3.486-0.496,5.031c-0.215,0.422-0.468,0.806-0.762,1.156c0.403,0.321,1.018,0.747,1.815,1.261h5.229  C16.504,16.868,16.415,16.749,16.35,16.611z"/>
+<path d="M26.447,10.53c0-0.746-0.465-1.543-1.115-2.195l-7.244,7.245c0.022,0.059,0.044,0.121,0.069,0.175  c0.361,0.764,0.877,1.345,1.569,1.85l6.752-6.752C26.461,10.651,26.447,10.53,26.447,10.53z"/>
+<path d="M24.263,18.604c-0.007-0.118-0.001-0.687,0.001-0.807c0.814-0.549,1.385-1.194,1.814-2.037  c0.297-0.583,0.424-1.461,0.466-2.332L14.25,25.722V28h1.386l8.84-8.84C24.355,18.964,24.273,18.775,24.263,18.604z"/>
+<path d="M23.765,7.263C23.385,7.104,23.001,7,22.643,7H21.6c-1.645,0-3.81,1.904-3.81,3.53c0,0-0.14,1.365-0.079,2.785L23.765,7.263  z"/>
+<path d="M25.771,20.505L18.276,28h3.665l5.967-5.968C27.198,21.57,26.427,21.039,25.771,20.505z"/>
+<path d="M30,23.406c-0.042-0.055-0.223-0.179-0.479-0.346L24.581,28h3.665L30,26.246V23.406z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_reject_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,25 @@
+<?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="M15.691,11.542c1.257-0.96,2.563-1.786,3.289-2.164c0.001,0.001,0,0.003,0.001,0.004c0.001-0.001,0.005-0.006,0.007-0.008
+	l1.277,2.142c0.183,0.313,0.589,0.408,0.953,0.256l7.359-4.248c0.383-0.22,0.533-0.68,0.334-1.022c0,0-0.203-0.305-0.818-1.062
+	c0.002,0.001,0.002,0.003,0.004,0.005c-0.002-0.002,0-0.005-0.002-0.008c-0.312-0.383-0.35-0.397-0.751-0.765
+	c-1.204-1.103-2.53-1.536-2.53-1.536c-0.514-0.182-2.241-0.282-4.417,0.374c-1.677,0.506-4.996,2.505-7.888,4.851L15.691,11.542z"/>
+<path d="M9.396,18.757c-0.01-0.001-0.019-0.001-0.027-0.003c0.002-0.002,0.008-0.01,0.008-0.01c0.652-1.125,1.375-2.136,2.143-3.077
+	l-3.205-3.205c-2.367,2.794-4.219,5.808-4.637,6.907c-0.814,2.148-0.74,4.517-0.563,5.205c0,0,0.169,0.513,0.56,1.211
+	c0.005,0.007,0.01,0.016,0.015,0.024c0.038,0.068,0.076,0.136,0.119,0.207c0.001,0.002,0.004,0.001,0.005,0.002
+	c0.21,0.35,0.464,0.729,0.783,1.114c0.374,0.449,0.392,0.578,0.785,0.925c0.001,0,0.002,0,0.003,0
+	c0.723,0.636,1.021,0.83,1.021,0.83c0.345,0.224,0.827,0.103,1.08-0.268l4.794-7.042c0.254-0.372,0.186-0.856-0.158-1.078
+	L9.396,18.757z"/>
+<rect x="13.74" y="-3.24" transform="matrix(0.7066 -0.7076 0.7076 0.7066 -6.0774 14.6889)" width="1.867" height="35.826"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_replace_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="M27.578,6.523l-7.36,4.248c-0.363,0.152-0.77,0.057-0.952-0.256l-1.278-2.142c-0.001,0.002-0.004,0.007-0.006,0.008
+	c0-0.001,0-0.003,0-0.004c-1.121,0.582-3.618,2.223-5.188,3.79c-1.632,1.635-3.15,3.394-4.417,5.576c0,0-0.006,0.008-0.008,0.01
+	c0.009,0.002,0.018,0.002,0.027,0.003l2.725,1.743c0.344,0.222,0.412,0.706,0.158,1.078L6.485,27.62
+	c-0.253,0.37-0.735,0.491-1.08,0.268c0,0-0.298-0.194-1.021-0.83c-0.001,0-0.002,0-0.003,0c-0.394-0.347-0.411-0.476-0.785-0.925
+	c-0.319-0.385-0.573-0.765-0.783-1.114c-0.001-0.001-0.004,0-0.005-0.002c-0.043-0.071-0.081-0.139-0.119-0.207
+	c-0.005-0.009-0.01-0.018-0.015-0.024c-0.391-0.698-0.56-1.211-0.56-1.211c-0.178-0.688-0.252-3.057,0.563-5.205
+	c0.52-1.364,3.24-5.672,6.42-8.854c3.181-3.182,8.124-6.349,10.3-7.005s3.903-0.556,4.416-0.374c0,0,1.326,0.434,2.531,1.536
+	c0.401,0.367,0.439,0.382,0.75,0.765c0.002,0.003,0.002,0.006,0.003,0.008c-0.001-0.002-0.003-0.004-0.005-0.005
+	c0.616,0.757,0.818,1.062,0.818,1.062C28.11,5.844,27.962,6.304,27.578,6.523z"/>
+<path d="M24.001,11L18,19h1.963h2v2.522V25H20v-5h-0.037H16v4v1l0,0c0,3,2.775,5,5.5,5s5.5-2,5.5-5v-6h3L24.001,11z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_send.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="32px" version="1.1" viewBox="0 -7 32 32" width="32px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<polygon points="1,6 1.5,8 5,8 5,6 "/>
+<polygon points="2,10 2.5,12 5,12 5,10 "/>
+<polygon points="0,2 0.5,4 5,4 5,2 "/>
+<path d="M31,0H7C6.449,0,6,0.45,6,1v17c0,0.55,0.449,1,1,1h24c0.549,0,1-0.45,1-1V1C32,0.45,31.549,0,31,0z M19,12.146l3.447-1.991  L29.293,17H8.707l6.846-6.846L19,12.146z M23.344,9.637L30,5.794v10.499L23.344,9.637z M8,2h22v1.484L19,9.836L8,3.484V2z   M14.656,9.637L8,16.293V5.794L14.656,9.637z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<rect fill="none" height="30" width="30"/>
+<rect fill="none" height="30" width="30"/>
+<path d="M10.235,9H3v12h7.297l9.953,5.806V3.199L10.235,9z M9,18.75H5.25v-7.5H9V18.75z M18,22.889l-6-3.5v-8.811l6-3.476V22.889z"/>
+<path d="M22.5,15.337c0,1.847-0.252,3.633-0.714,5.331l1.292,0.94C23.676,19.622,24,17.518,24,15.337 c0-2.429-0.404-4.764-1.141-6.946l-1.27,0.924C22.182,11.218,22.5,13.241,22.5,15.337z"/>
+<path d="M27,15.324c0,2.847-0.486,5.579-1.371,8.125l1.269,0.924c1.036-2.822,1.603-5.869,1.603-9.049 c0-3.426-0.664-6.696-1.857-9.697l-1.254,0.911C26.427,9.269,27,12.229,27,15.324z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<rect fill="none" height="30" width="30"/>
+<rect fill="none" height="30" width="30"/>
+<rect height="9" width="5.25" x="4.862" y="11.61"/>
+<polygon points="19.862,14.009 19.862,5.61 14.545,8.691 "/>
+<polygon points="10.862,11.232 10.862,21.361 19.862,26.611 19.862,20.231 "/>
+<rect height="33.236" transform="matrix(-0.7061 0.7082 -0.7082 -0.7061 39.3599 12.3905)" width="1.4" x="16.408" y="-2.254"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/themes/icons/hbdefault/scalable/qtg_mono_swap.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="30" version="1.1" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<rect fill="none" height="30" width="30"/>
+<path d="M0,0v30h30V0H0z M29,29H1V1h28V29z" fill="#FF0000"/>
+<polygon fill="#FF0000" points="24.344,2.415 27.584,5.655 18.242,15.001 27.585,24.346 24.346,27.585 14.999,18.238 5.655,27.585   2.415,24.346 11.76,15 2.415,5.655 5.655,2.415 15.002,11.763 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phonemainwindow/common.pri	Fri Jun 04 10:19:18 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: 
+#
+######################################################################
+# Unit tests
+######################################################################
+include(../../../../trunk_6742/trunk/hb/hb/hb.prf)
+
+CONFIG += hb qtestlib
+ LIBS += -lphoneengine \
+            -lphoneuiutils \
+            -lphoneuicontrol \
+            -lphoneuiqtviewadapter \
+            -lphoneuiqtview \
+            -lFeatMgr
+unix {
+    test.commands = ./$(TARGET)
+    autotest.commands = ./$(TARGET) -style plastique -xml -o ../$(QMAKE_TARGET).xml
+} else:win32 {
+    DESTDIR = ./
+    test.CONFIG += recursive
+    autotest.CONFIG += recursive
+    build_pass {
+        test.commands = $(TARGET)
+        autotest.commands = $(TARGET) -xml -o ../$(QMAKE_TARGET).xml
+    }
+}
+QMAKE_EXTRA_TARGETS += test autotest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phonemainwindow/hbglobal_p.h	Fri Jun 04 10:19:18 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 HBGLOBAL_P_H
+#define HBGLOBAL_P_H
+
+
+#define HB_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+
+#endif // HBGLOBAL_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phonemainwindow/phoneuihousehold_stub.cpp	Fri Jun 04 10:19:18 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:  UI house hold class.
+*
+*/
+
+#include <QtGlobal>
+#include <hbmainwindow.h>
+#include "phoneuihousehold.h"
+
+PhoneUiHouseHold::PhoneUiHouseHold (HbMainWindow &window)
+{
+   Q_UNUSED(window);
+}
+
+PhoneUiHouseHold::~PhoneUiHouseHold ()
+{
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phonemainwindow/ut_phonemainwindow.cpp	Fri Jun 04 10:19:18 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 <QtGui>
+#include <QtTest/QtTest>
+#include <QDebug>
+#include <hbapplication.h>
+#include <hbglobal_p.h>
+#include "hbphonemainwindow.h"
+
+
+class U_PhoneMainWindow: public QObject
+{
+Q_OBJECT
+
+public:
+	U_PhoneMainWindow();
+	~U_PhoneMainWindow();
+
+private slots:
+	void initTestCase();
+    void cleanupTestCase();
+	void testShow();
+	
+private:
+	
+    HbPhoneMainWindow* m_Window; // widget under test
+
+};
+
+U_PhoneMainWindow::U_PhoneMainWindow()
+{
+}
+
+U_PhoneMainWindow::~U_PhoneMainWindow()
+{
+}
+
+void U_PhoneMainWindow::initTestCase()
+{
+
+    m_Window = new HbPhoneMainWindow();
+	
+}
+
+void U_PhoneMainWindow::cleanupTestCase()
+{
+	delete m_Window;
+}
+
+void U_PhoneMainWindow::testShow()
+{
+    m_Window->show();
+    Q_ASSERT(m_Window->isVisible());
+	
+}
+
+HB_TEST_MAIN(U_PhoneMainWindow)
+#include "ut_phonemainwindow.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phonemainwindow/ut_phonemainwindow.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: Project file for building unit test component
+#
+#
+
+include(common.pri)
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+INCLUDEPATH += ..\..\src
+
+
+# Input
+HEADERS += ..\..\inc\phoneuihousehold.h
+HEADERS += ..\..\inc\hbphonemainwindow.h
+
+SOURCES += phoneuihousehold_stub.cpp
+SOURCES += ut_phonemainwindow.cpp
+SOURCES += ..\..\src\hbphonemainwindow.cpp
+
+
+
+TARGET.CAPABILITY = ALL -TCB
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/cphoneuicontroller_stub.cpp	Fri Jun 04 10:19:18 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: Implementation of CPhoneUIController class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "CPhoneUIController_Stub.h"
+
+int m_command;
+bool m_leave;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------
+// CPhoneUIController::CPhoneUIController
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------
+//
+CPhoneUIController_Stub::CPhoneUIController_Stub()  
+    {
+    m_leave = false;	
+    }
+
+
+
+// -----------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------
+
+CPhoneUIController_Stub::~CPhoneUIController_Stub()
+    {
+
+    }
+
+
+
+// ---------------------------------------------------------
+// CPhoneUIController_Stub::HandleCommandL
+// ---------------------------------------------------------
+//
+TBool CPhoneUIController_Stub::HandleCommandL( TInt aCommand )
+    {
+    m_command = 0;
+    
+    if (m_leave)
+        {
+        User::Leave(KErrArgument);
+        }
+        
+    m_command = aCommand;
+    
+    return ETrue;
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController_Stub::ProcessCommandL
+// ---------------------------------------------------------
+//
+TBool CPhoneUIController_Stub::ProcessCommandL( TInt /*aCommand*/ )
+    {  
+    return ETrue;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/cphoneuicontroller_stub.h	Fri Jun 04 10:19:18 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: 
+*     Phone UI controller class.
+*
+*/
+
+
+#ifndef CPHONEUICONTROLLER_STUB_H
+#define CPHONEUICONTROLLER_STUB_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+#include "mphonemenuandcbaevents.h"
+
+extern int m_command;
+extern bool m_leave;
+
+// FORWARD DECLARATIONS
+
+class CPhoneUIController_Stub : 
+    public MPhoneMenuAndCbaEvents
+    {
+    public:
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneUIController_Stub();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneUIController_Stub();
+
+// From MPhoneMenuAndCbaEvents
+
+        /**
+        * HandleCommandL
+        */
+        TBool HandleCommandL( TInt aCommand );
+
+        /**
+        * Process command.
+        */
+        TBool ProcessCommandL( TInt aCommand );
+        
+    };
+
+#endif      // CPHONEUICONTROLLER_STUB_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/unit_tests.cpp	Fri Jun 04 10:19:18 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:  Unit tests for PhoneUIQtView.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QVariant>
+#include <QKeyEvent>
+#include <hbapplication.h>
+#include "phoneuicommandadapter.h"
+#include "cphoneuicontroller_stub.h"
+
+
+//CONSTANTS
+
+
+#define PHONE_QT_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestPhoneCommandAdapter : public QObject
+{
+    Q_OBJECT
+    
+public:
+    TestPhoneCommandAdapter ();
+    ~TestPhoneCommandAdapter ();
+
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase (); 
+    void init ();
+    void cleanup ();
+    
+private slots:
+    void testKeyHandleCommand ();
+    void testLeave ();
+
+
+
+private:
+    PhoneUiCommandAdapter *m_command_adapter; // class under test
+    CPhoneUIController_Stub *m_uicontrol;
+
+};
+
+
+TestPhoneCommandAdapter::TestPhoneCommandAdapter ()
+{    
+}
+
+TestPhoneCommandAdapter::~TestPhoneCommandAdapter ()
+{
+}
+
+void TestPhoneCommandAdapter::initTestCase ()
+{	
+}
+
+void TestPhoneCommandAdapter::cleanupTestCase ()
+{
+}
+
+void TestPhoneCommandAdapter::init ()
+{
+    m_uicontrol = new CPhoneUIController_Stub(); 
+    m_command_adapter = new PhoneUiCommandAdapter(*m_uicontrol);
+}
+
+void TestPhoneCommandAdapter::cleanup ()
+{
+    delete m_uicontrol;
+    delete m_command_adapter;
+}
+
+void TestPhoneCommandAdapter::testKeyHandleCommand ()
+{
+    int command = 1001;
+        	
+    m_command_adapter->handleCommand(command);
+
+    QVERIFY( command == m_command );
+
+}
+
+void TestPhoneCommandAdapter::testLeave ()
+{
+    m_leave = true;	
+    int command = 1001;
+    
+    m_command_adapter->handleCommand(command);
+    
+    QVERIFY( 0 == m_command );
+    m_leave = false;
+
+}
+
+PHONE_QT_TEST_MAIN(TestPhoneCommandAdapter)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuicommandadapter/ut_phoneuicommandadapter.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = ut_phoneuicommandadapter
+TARGET.UID3 = 0xEA9BEF3D
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+CONFIG += hb qtestlib
+
+symbian {
+
+    INCLUDEPATH += /epoc32/include/platform/mw \
+                   /epoc32/include/platform/app \
+                   /epoc32/include/mw \
+                   ../../../phoneuicontrol/inc/ \
+                   ../../inc/ \
+                   ../../../../inc \
+                   ./
+
+}
+
+
+# Input
+HEADERS += ../../inc/phoneuicommandadapter.h \
+           cphoneuicontroller_stub.h
+SOURCES += ../../src/phoneuicommandadapter.cpp \
+           unit_tests.cpp \
+           cphoneuicontroller_stub.cpp
+           
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/cphoneuicontroller_stub.cpp	Fri Jun 04 10:19:18 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: Implementation of CPhoneUIController class.
+*
+*/
+
+// INCLUDE FILES
+
+#include "CPhoneUIController_Stub.h"
+#include "phoneconstants.h"
+
+int m_scan_code;
+int m_code;
+int m_scan_code_down;
+int m_code_down;
+int m_repeats;
+bool m_leave;
+TEventCode m_eventCode;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------
+// CPhoneUIController::CPhoneUIController
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------
+//
+CPhoneUIController_Stub::CPhoneUIController_Stub()  
+{
+    m_leave = false;	
+}
+
+
+
+// -----------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------
+
+CPhoneUIController_Stub::~CPhoneUIController_Stub()
+{
+}
+
+
+
+// ---------------------------------------------------------
+// CPhoneUIController_Stub::HandleKeyEventL
+// ---------------------------------------------------------
+//
+TKeyResponse CPhoneUIController_Stub::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+{
+    m_scan_code = 0;
+    m_code = 0;
+    m_scan_code_down = 0;
+    m_code_down = 0;
+    m_eventCode = aEventCode;
+    
+    if (m_leave) {
+        User::Leave(KErrArgument);
+    }
+        
+    m_repeats = aKeyEvent.iRepeats;
+    
+    if(EEventKeyUp == aEventCode) {
+        m_scan_code = aKeyEvent.iScanCode;
+        m_code = aKeyEvent.iCode;
+    } else if(EEventKey == aEventCode) {
+        m_scan_code_down = aKeyEvent.iScanCode;
+        m_code_down = aKeyEvent.iCode;       	
+    } else if(EEventLongPress) {
+        m_scan_code = aKeyEvent.iScanCode;
+        m_code = aKeyEvent.iCode;
+    }
+    
+    return EKeyWasNotConsumed;
+}
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/cphoneuicontroller_stub.h	Fri Jun 04 10:19:18 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: 
+*     Phone UI controller class.
+*
+*/
+
+
+#ifndef CPHONEUICONTROLLER_STUB_H
+#define CPHONEUICONTROLLER_STUB_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+#include "MPhoneKeyEventHandler.h"
+
+extern int m_scan_code;
+extern int m_code;
+extern int m_scan_code_down;
+extern int m_code_down;
+extern int m_repeats;
+extern bool m_leave;
+extern TEventCode m_eventCode;
+
+// FORWARD DECLARATIONS
+
+class CPhoneUIController_Stub : 
+    public MPhoneKeyEventHandler
+    {
+    public:
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneUIController_Stub();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneUIController_Stub();
+
+
+        TKeyResponse HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+
+        
+    };
+
+#endif      // CPHONEUICONTROLLER_STUB_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/unit_tests.cpp	Fri Jun 04 10:19:18 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:  Unit tests for PhoneUIQtView.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QVariant>
+#include <QKeyEvent>
+#include <hbapplication.h>
+#include "phoneuikeyeventadapter.h"
+#include "cphoneuicontroller_stub.h"
+#include "phoneconstants.h"
+
+
+//CONSTANTS
+
+
+#define PHONE_QT_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestPhoneKeyEventAdapter : public QObject
+{
+    Q_OBJECT
+    
+public:
+    TestPhoneKeyEventAdapter ();
+    ~TestPhoneKeyEventAdapter ();
+
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase (); 
+    void init ();
+    void cleanup ();
+    
+private slots:
+    void testKeyPressEvents();
+    void testKeyReleaseEvents();
+    void testKeyPressEventsByQtKeys();
+    void testLeave();
+
+
+
+private:
+    PhoneUIKeyEventAdapter *m_keyadapter; // class under test
+    CPhoneUIController_Stub *m_uicontrol;
+
+};
+
+
+TestPhoneKeyEventAdapter::TestPhoneKeyEventAdapter ()
+{    
+}
+
+TestPhoneKeyEventAdapter::~TestPhoneKeyEventAdapter ()
+{
+}
+
+void TestPhoneKeyEventAdapter::initTestCase ()
+{	
+}
+
+void TestPhoneKeyEventAdapter::cleanupTestCase ()
+{
+}
+
+void TestPhoneKeyEventAdapter::init ()
+{
+    m_uicontrol = new CPhoneUIController_Stub(); 
+    m_keyadapter = new PhoneUIKeyEventAdapter(*m_uicontrol);
+}
+
+void TestPhoneKeyEventAdapter::cleanup ()
+{
+    delete m_uicontrol;
+    delete m_keyadapter;
+}
+
+void TestPhoneKeyEventAdapter::testKeyPressEvents ()
+{
+    quint32 scanCode = 123;
+    quint32 code = 123;
+    quint32 modifiers = 0; 
+    QKeyEvent *keyEvent = QKeyEvent::createExtendedKeyEvent( 
+        QEvent::KeyPress, 123, Qt::NoModifier, scanCode, code, modifiers );
+        	
+    m_keyadapter->keyPressed(keyEvent);
+    
+    QVERIFY( 0 == m_repeats );
+    QVERIFY( scanCode == m_scan_code_down );
+    QVERIFY( code == m_code_down );
+    
+    delete keyEvent;
+}
+
+void TestPhoneKeyEventAdapter::testKeyReleaseEvents ()
+{
+    quint32 scanCode = 100;
+    quint32 code = 100;
+    quint32 modifiers = 0; 
+    QKeyEvent *keyEvent = QKeyEvent::createExtendedKeyEvent( 
+        QEvent::KeyRelease, code, Qt::NoModifier, scanCode, code, modifiers );
+        	
+    m_keyadapter->keyReleased(keyEvent);
+    
+    QVERIFY( 0 == m_repeats );
+    QVERIFY( scanCode == m_scan_code );
+    QVERIFY( code == m_code );
+    
+    delete keyEvent;
+    
+}
+
+void TestPhoneKeyEventAdapter::testKeyPressEventsByQtKeys ()
+{
+    quint32 scanCode = 100;
+    quint32 code = 20;
+    quint32 modifiers = 0; 
+    QKeyEvent *keyEvent = QKeyEvent::createExtendedKeyEvent( 
+        QEvent::KeyRelease, Qt::Key_Yes, Qt::NoModifier, scanCode, code, modifiers );
+            
+    m_keyadapter->keyPressed(keyEvent);
+    
+    QVERIFY( 0 == m_repeats );
+    QVERIFY( EKeyYes == m_scan_code_down );
+    QVERIFY( EKeyYes == m_code_down );
+    
+    delete keyEvent;
+    
+    keyEvent = QKeyEvent::createExtendedKeyEvent( 
+            QEvent::KeyRelease, Qt::Key_No, Qt::NoModifier, scanCode, code, modifiers );
+                
+    m_keyadapter->keyPressed(keyEvent);
+        
+    QVERIFY( 0 == m_repeats );
+    QVERIFY( EKeyNo == m_scan_code_down );
+    QVERIFY( EKeyNo == m_code_down );
+    
+    delete keyEvent;
+    
+    keyEvent = QKeyEvent::createExtendedKeyEvent( 
+            QEvent::KeyRelease, Qt::Key_NumberSign, Qt::NoModifier, scanCode, code, modifiers );
+                
+    m_keyadapter->keyPressed(keyEvent);
+        
+    QVERIFY( 0 == m_repeats );
+    QVERIFY( KPhoneDtmfHashCharacter == m_scan_code_down );
+    QVERIFY( KPhoneDtmfHashCharacter == m_code_down );
+    
+    delete keyEvent;
+    
+}
+
+void TestPhoneKeyEventAdapter::testLeave ()
+{
+    m_leave = true;	
+    quint32 scanCode = 100;
+    quint32 code = 20;
+    quint32 modifiers = 0; 
+    QKeyEvent *keyEvent = QKeyEvent::createExtendedKeyEvent( 
+        QEvent::KeyRelease, 0, Qt::NoModifier, scanCode, code, modifiers );
+    
+    m_keyadapter->keyPressed(keyEvent);
+    
+    QVERIFY( 0 == m_scan_code );
+    QVERIFY( 0 == m_code );
+        	
+    m_keyadapter->keyReleased(keyEvent);
+    
+    QVERIFY( 0 == m_scan_code );
+    QVERIFY( 0 == m_code );
+    
+    m_leave = false;
+    
+    delete keyEvent;
+}
+
+PHONE_QT_TEST_MAIN(TestPhoneKeyEventAdapter)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/ut_phoneuikeyeventadapter.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = ut_phoneuikeyeventadapter
+TARGET.UID3 = 0xEA9BEF3E
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+CONFIG += hb qtestlib
+
+symbian {
+
+    INCLUDEPATH += /epoc32/include/platform/mw \
+                   /epoc32/include/platform/app \
+                   /epoc32/include/mw \
+                   ../../../phoneuicontrol/inc/ \
+                   ../../../phoneuiutils/inc/ \
+                   ../../inc/ \
+                   ../../../../inc \
+                   ./
+
+}
+
+
+# Input
+HEADERS += ../../inc/phoneuikeyeventadapter.h \
+           cphoneuicontroller_stub.h
+SOURCES += ../../src/phoneuikeyeventadapter.cpp \
+           unit_tests.cpp \
+           cphoneuicontroller_stub.cpp
+           
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/bwins/phoneuicontrolu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,238 @@
+EXPORTS
+	?CallWaitingNoteL@CPhoneState@@IAEXH@Z @ 1 NONAME ; void CPhoneState::CallWaitingNoteL(int)
+	?HandleKeyMessageL@CPhoneStateIncoming@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 2 NONAME ; void CPhoneStateIncoming::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?EnableCallUIL@CPhoneState@@QAEXXZ @ 3 NONAME ; void CPhoneState::EnableCallUIL(void)
+	?TopAppIsDisplayedL@CPhoneState@@IBEHXZ @ 4 NONAME ; int CPhoneState::TopAppIsDisplayedL(void) const
+	?HandleKeyMessageL@CPhoneStateCallSetup@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 5 NONAME ; void CPhoneStateCallSetup::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?SetContextMenuL@CPhoneState@@MAEXH@Z @ 6 NONAME ; void CPhoneState::SetContextMenuL(int)
+	?CallFetchedNumberL@CPhoneStateInCall@@MAEXABVTDesC16@@@Z @ 7 NONAME ; void CPhoneStateInCall::CallFetchedNumberL(class TDesC16 const &)
+	?SetCbaL@CPhoneCbaManager@@QAEXH@Z @ 8 NONAME ; void CPhoneCbaManager::SetCbaL(int)
+	?InstanceL@CPhoneReconnectQuery@@SAPAV1@XZ @ 9 NONAME ; class CPhoneReconnectQuery * CPhoneReconnectQuery::InstanceL(void)
+	?HandlePhoneStartupL@CPhoneState@@UAEXXZ @ 10 NONAME ; void CPhoneState::HandlePhoneStartupL(void)
+	?HandlePhoneFocusLostEventL@CPhoneStateIdle@@UAEXXZ @ 11 NONAME ; void CPhoneStateIdle::HandlePhoneFocusLostEventL(void)
+	?HandleIdleL@CPhoneStateInCall@@IAEXH@Z @ 12 NONAME ; void CPhoneStateInCall::HandleIdleL(int)
+	?ShowQueryL@CPhoneState@@IAEXH@Z @ 13 NONAME ; void CPhoneState::ShowQueryL(int)
+	?PhoneNumberAvailableInPhoneEngineL@CPhoneStateInCall@@IAEXH@Z @ 14 NONAME ; void CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL(int)
+	?DisplayCallTerminationNoteL@CPhoneState@@IAEXXZ @ 15 NONAME ; void CPhoneState::DisplayCallTerminationNoteL(void)
+	??0CPhoneStateInCall@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 16 NONAME ; CPhoneStateInCall::CPhoneStateInCall(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?HandleNumberLongKeyPressL@CPhoneStateIdle@@IAEXXZ @ 17 NONAME ; void CPhoneStateIdle::HandleNumberLongKeyPressL(void)
+	?PhoneEngine@CPhoneStateMachine@@UAEPAVMPEPhoneModel@@XZ @ 18 NONAME ; class MPEPhoneModel * CPhoneStateMachine::PhoneEngine(void)
+	?OpenMenuBarL@CPhoneStateCallSetup@@MAEXXZ @ 19 NONAME ; void CPhoneStateCallSetup::OpenMenuBarL(void)
+	??1CPhoneStateCallSetup@@UAE@XZ @ 20 NONAME ; CPhoneStateCallSetup::~CPhoneStateCallSetup(void)
+	?HandleEnvironmentChangeL@CPhoneUIController@@UAEXH@Z @ 21 NONAME ; void CPhoneUIController::HandleEnvironmentChangeL(int)
+	?SetToolbarButtonLoudspeakerEnabled@CPhoneState@@IAEXXZ @ 22 NONAME ; void CPhoneState::SetToolbarButtonLoudspeakerEnabled(void)
+	?Instance@CPhoneStateHandle@@SAPAV1@XZ @ 23 NONAME ; class CPhoneStateHandle * CPhoneStateHandle::Instance(void)
+	?HandleNumberEntryClearedL@CPhoneStateIdle@@MAEXXZ @ 24 NONAME ; void CPhoneStateIdle::HandleNumberEntryClearedL(void)
+	?DynInitMenuPaneL@CPhoneStateIncoming@@MAEXHPAVCEikMenuPane@@@Z @ 25 NONAME ; void CPhoneStateIncoming::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?HandleCommandL@CPhoneState@@UAEHH@Z @ 26 NONAME ; int CPhoneState::HandleCommandL(int)
+	?StartAlsLineChangeTimerL@CPhoneState@@IAEXXZ @ 27 NONAME ; void CPhoneState::StartAlsLineChangeTimerL(void)
+	?IsNumberEntryVisibleL@CPhoneState@@QAEHXZ @ 28 NONAME ; int CPhoneState::IsNumberEntryVisibleL(void)
+	?RetainPreviousKeylockStateL@CPhoneState@@QAEXXZ @ 29 NONAME ; void CPhoneState::RetainPreviousKeylockStateL(void)
+	?HandlePhoneEngineMessageL@CPhoneStateIdle@@UAEXHH@Z @ 30 NONAME ; void CPhoneStateIdle::HandlePhoneEngineMessageL(int, int)
+	?HandleDialingL@CPhoneStateIdle@@MAEXH@Z @ 31 NONAME ; void CPhoneStateIdle::HandleDialingL(int)
+	?CustomizedDialerCbaResourceIdL@CPhoneState@@IAEHXZ @ 32 NONAME ; int CPhoneState::CustomizedDialerCbaResourceIdL(void)
+	?CaptureKeysDuringCallNotificationL@CPhoneState@@IAEXH@Z @ 33 NONAME ; void CPhoneState::CaptureKeysDuringCallNotificationL(int)
+	?HandleKeyPressDurationL@CPhoneState@@UAEXW4TKeyCode@@VTTimeIntervalMicroSeconds@@@Z @ 34 NONAME ; void CPhoneState::HandleKeyPressDurationL(enum TKeyCode, class TTimeIntervalMicroSeconds)
+	?ChangeState@CPhoneStateMachine@@UAEXH@Z @ 35 NONAME ; void CPhoneStateMachine::ChangeState(int)
+	?IsSimStateNotPresentWithSecurityModeEnabled@CPhoneState@@IAEHXZ @ 36 NONAME ; int CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled(void)
+	?HandlePhoneEngineMessageL@CPhoneState@@UAEXHH@Z @ 37 NONAME ; void CPhoneState::HandlePhoneEngineMessageL(int, int)
+	?HandleNumberEntryClearedL@CPhoneStateIncoming@@UAEXXZ @ 38 NONAME ; void CPhoneStateIncoming::HandleNumberEntryClearedL(void)
+	?HandleKeyEventL@CPhoneUIController@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 39 NONAME ; enum TKeyResponse CPhoneUIController::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?HandleRemConCommandL@CPhoneStateIdle@@MAEHW4TRemConCoreApiOperationId@@W4TRemConCoreApiButtonAction@@@Z @ 40 NONAME ; int CPhoneStateIdle::HandleRemConCommandL(enum TRemConCoreApiOperationId, enum TRemConCoreApiButtonAction)
+	?HandleAudioPlayStoppedL@CPhoneStateIncoming@@MAEXXZ @ 41 NONAME ; void CPhoneStateIncoming::HandleAudioPlayStoppedL(void)
+	?HandleCenRepChangeL@CPhoneState@@UAEXABVTUid@@I@Z @ 42 NONAME ; void CPhoneState::HandleCenRepChangeL(class TUid const &, unsigned int)
+	?HandleLongHashL@CPhoneState@@UAEXXZ @ 43 NONAME ; void CPhoneState::HandleLongHashL(void)
+	?DialL@CPhoneStateIdle@@MAEXABVTDesC16@@W4TPhoneNumberType@@W4TDialInitiationMethod@1@@Z @ 44 NONAME ; void CPhoneStateIdle::DialL(class TDesC16 const &, enum TPhoneNumberType, enum CPhoneStateIdle::TDialInitiationMethod)
+	?ShowNumberBusyNoteL@CPhoneState@@IAEXXZ @ 45 NONAME ; void CPhoneState::ShowNumberBusyNoteL(void)
+	?DisconnectCallL@CPhoneState@@IAEHXZ @ 46 NONAME ; int CPhoneState::DisconnectCallL(void)
+	?HandleNumberEntryClearedL@CPhoneStateCallSetup@@MAEXXZ @ 47 NONAME ; void CPhoneStateCallSetup::HandleNumberEntryClearedL(void)
+	?HandleIdleForegroundEventL@CPhoneStateIdle@@UAEXXZ @ 48 NONAME ; void CPhoneStateIdle::HandleIdleForegroundEventL(void)
+	?HandleDisconnectingL@CPhoneState@@IAEXH@Z @ 49 NONAME ; void CPhoneState::HandleDisconnectingL(int)
+	?HandleAudioMuteChangedL@CPhoneState@@IAEXXZ @ 50 NONAME ; void CPhoneState::HandleAudioMuteChangedL(void)
+	?HandleKeyLockEnabled@CPhoneState@@UAEXH@Z @ 51 NONAME ; void CPhoneState::HandleKeyLockEnabled(int)
+	?HandleCommandL@CPhoneStateIncoming@@UAEHH@Z @ 52 NONAME ; int CPhoneStateIncoming::HandleCommandL(int)
+	?UpdateSingleActiveCallL@CPhoneState@@IAEXH@Z @ 53 NONAME ; void CPhoneState::UpdateSingleActiveCallL(int)
+	?IsOnScreenDialerSupported@CPhoneState@@IBEHXZ @ 54 NONAME ; int CPhoneState::IsOnScreenDialerSupported(void) const
+	?SimState@CPhoneState@@IBE?AW4TPESimState@@XZ @ 55 NONAME ; enum TPESimState CPhoneState::SimState(void) const
+	?HandleKeyEventL@CPhoneStateCallSetup@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 56 NONAME ; void CPhoneStateCallSetup::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?SetupIdleScreenInBackgroundL@CPhoneState@@IAEXXZ @ 57 NONAME ; void CPhoneState::SetupIdleScreenInBackgroundL(void)
+	?SendGlobalWarningNoteL@CPhoneState@@IAEXH@Z @ 58 NONAME ; void CPhoneState::SendGlobalWarningNoteL(int)
+	?CompleteSatRequestL@CPhoneState@@IAEXH@Z @ 59 NONAME ; void CPhoneState::CompleteSatRequestL(int)
+	?NewL@CPhoneStateStartup@@SAPAV1@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 60 NONAME ; class CPhoneStateStartup * CPhoneStateStartup::NewL(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?LaunchNewCallQueryL@CPhoneStateInCall@@IAEXXZ @ 61 NONAME ; void CPhoneStateInCall::LaunchNewCallQueryL(void)
+	?NeedToSendToBackgroundL@CPhoneState@@IBEHXZ @ 62 NONAME ; int CPhoneState::NeedToSendToBackgroundL(void) const
+	?SetCallHeaderTextsForCallComingInL@CPhoneState@@IAEXHHPAVTPhoneCmdParamCallHeaderData@@@Z @ 63 NONAME ; void CPhoneState::SetCallHeaderTextsForCallComingInL(int, int, class TPhoneCmdParamCallHeaderData *)
+	?IsSimOk@CPhoneState@@QAEHXZ @ 64 NONAME ; int CPhoneState::IsSimOk(void)
+	?ClearNumberEntryContentCache@CPhoneState@@IAEXXZ @ 65 NONAME ; void CPhoneState::ClearNumberEntryContentCache(void)
+	?HandleCommandL@CPhoneStateIdle@@UAEHH@Z @ 66 NONAME ; int CPhoneStateIdle::HandleCommandL(int)
+	?ViewCommandHandle@CPhoneStateHandle@@QAEPAVMPhoneViewCommandHandle@@XZ @ 67 NONAME ; class MPhoneViewCommandHandle * CPhoneStateHandle::ViewCommandHandle(void)
+	?DialMultimediaCallL@CPhoneStateIdle@@IAEXXZ @ 68 NONAME ; void CPhoneStateIdle::DialMultimediaCallL(void)
+	?DisconnectOutgoingCallL@CPhoneStateInCall@@IAEXXZ @ 69 NONAME ; void CPhoneStateInCall::DisconnectOutgoingCallL(void)
+	?IsKeyLockOn@CPhoneState@@MBEHXZ @ 70 NONAME ; int CPhoneState::IsKeyLockOn(void) const
+	??1CPhoneStateInCall@@UAE@XZ @ 71 NONAME ; CPhoneStateInCall::~CPhoneStateInCall(void)
+	?CustomizedDialerMenuResourceIdL@CPhoneState@@IAEHXZ @ 72 NONAME ; int CPhoneState::CustomizedDialerMenuResourceIdL(void)
+	?ShowReconnectQueryL@CPhoneReconnectQuery@@QAEXH@Z @ 73 NONAME ; void CPhoneReconnectQuery::ShowReconnectQueryL(int)
+	?UpdateSilenceButtonDimming@CPhoneState@@IAEXXZ @ 74 NONAME ; void CPhoneState::UpdateSilenceButtonDimming(void)
+	?SetNumberEntryVisibilityL@CPhoneState@@IAEXH@Z @ 75 NONAME ; void CPhoneState::SetNumberEntryVisibilityL(int)
+	?HandleError@CPhoneUIController@@UAEXABUTPEErrorInfo@@@Z @ 76 NONAME ; void CPhoneUIController::HandleError(struct TPEErrorInfo const &)
+	?ConstructL@CPhoneStateInCall@@MAEXXZ @ 77 NONAME ; void CPhoneStateInCall::ConstructL(void)
+	?OnlyHashInNumberEntryL@CPhoneStateIdle@@MAEXXZ @ 78 NONAME ; void CPhoneStateIdle::OnlyHashInNumberEntryL(void)
+	?IsVideoCallRingingL@CPhoneStateInCall@@MAEHXZ @ 79 NONAME ; int CPhoneStateInCall::IsVideoCallRingingL(void)
+	?HandlePhoneForegroundEventL@CPhoneStateIdle@@UAEXXZ @ 80 NONAME ; void CPhoneStateIdle::HandlePhoneForegroundEventL(void)
+	?HandleHoldSwitchL@CPhoneState@@QAEXXZ @ 81 NONAME ; void CPhoneState::HandleHoldSwitchL(void)
+	?CloseDtmfQueryL@CPhoneStateInCall@@IAEXXZ @ 82 NONAME ; void CPhoneStateInCall::CloseDtmfQueryL(void)
+	?DynInitMenuBarL@CPhoneState@@UAEXHPAVCEikMenuBar@@@Z @ 83 NONAME ; void CPhoneState::DynInitMenuBarL(int, class CEikMenuBar *)
+	?HandleDtmfKeyToneL@CPhoneStateStartup@@EAEXABUTKeyEvent@@W4TEventCode@@@Z @ 84 NONAME ; void CPhoneStateStartup::HandleDtmfKeyToneL(struct TKeyEvent const &, enum TEventCode)
+	?HandleNumberEntryEdited@CPhoneState@@MAEXXZ @ 85 NONAME ; void CPhoneState::HandleNumberEntryEdited(void)
+	?ShowTextQueryL@CPhoneState@@IAEXHHHPAVTDes16@@H@Z @ 86 NONAME ; void CPhoneState::ShowTextQueryL(int, int, int, class TDes16 *, int)
+	?DialMultimediaCallL@CPhoneState@@IAEXXZ @ 87 NONAME ; void CPhoneState::DialMultimediaCallL(void)
+	?NewL@CPhoneUIController@@SAPAV1@PAVMPhoneViewCommandHandle@@@Z @ 88 NONAME ; class CPhoneUIController * CPhoneUIController::NewL(class MPhoneViewCommandHandle *)
+	?HandleCreateNumberEntryL@CPhoneStateStartup@@EAEXABUTKeyEvent@@W4TEventCode@@@Z @ 89 NONAME ; void CPhoneStateStartup::HandleCreateNumberEntryL(struct TKeyEvent const &, enum TEventCode)
+	?CheckDisableHWKeysAndCallUIL@CPhoneState@@QAEXXZ @ 90 NONAME ; void CPhoneState::CheckDisableHWKeysAndCallUIL(void)
+	?IsMenuBarVisibleL@CPhoneState@@UBEHXZ @ 91 NONAME ; int CPhoneState::IsMenuBarVisibleL(void) const
+	?HandleErrorL@CPhoneState@@UAEXABUTPEErrorInfo@@@Z @ 92 NONAME ; void CPhoneState::HandleErrorL(struct TPEErrorInfo const &)
+	?HandleCommandL@CPhoneStateCallSetup@@UAEHH@Z @ 93 NONAME ; int CPhoneStateCallSetup::HandleCommandL(int)
+	?HandleAudioOutputChangedL@CPhoneState@@IAEXXZ @ 94 NONAME ; void CPhoneState::HandleAudioOutputChangedL(void)
+	??1CPhoneUIController@@UAE@XZ @ 95 NONAME ; CPhoneUIController::~CPhoneUIController(void)
+	?HandleKeyEventL@CPhoneState@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 96 NONAME ; void CPhoneState::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?UpdateIncomingContextMenuL@CPhoneState@@MAEXH@Z @ 97 NONAME ; void CPhoneState::UpdateIncomingContextMenuL(int)
+	?OpenMenuBarL@CPhoneStateInCall@@MAEXXZ @ 98 NONAME ; void CPhoneStateInCall::OpenMenuBarL(void)
+	?UpdateIncomingCbaL@CPhoneCbaManager@@QAEXH@Z @ 99 NONAME ; void CPhoneCbaManager::UpdateIncomingCbaL(int)
+	?SetTouchPaneButtonDisabled@CPhoneState@@IAEXH@Z @ 100 NONAME ; void CPhoneState::SetTouchPaneButtonDisabled(int)
+	?ConstructL@CPhoneStateIncoming@@MAEXXZ @ 101 NONAME ; void CPhoneStateIncoming::ConstructL(void)
+	?CreatePhoneEngineL@CPhoneStateMachine@@UAEPAVMPEPhoneModel@@AAVMEngineMonitor@@@Z @ 102 NONAME ; class MPEPhoneModel * CPhoneStateMachine::CreatePhoneEngineL(class MEngineMonitor &)
+	?SetTouchPaneButtons@CPhoneState@@IAEXH@Z @ 103 NONAME ; void CPhoneState::SetTouchPaneButtons(int)
+	?HandleIdleForegroundEventL@CPhoneStateStartup@@UAEXXZ @ 104 NONAME ; void CPhoneStateStartup::HandleIdleForegroundEventL(void)
+	?CallFromNumberEntryL@CPhoneState@@IAEXXZ @ 105 NONAME ; void CPhoneState::CallFromNumberEntryL(void)
+	?UpdateCbaL@CPhoneCbaManager@@QAEXH@Z @ 106 NONAME ; void CPhoneCbaManager::UpdateCbaL(int)
+	?IsVideoCall@CPhoneState@@IAEHH@Z @ 107 NONAME ; int CPhoneState::IsVideoCall(int)
+	?IsSwivelClosed@CPhoneState@@QBEHXZ @ 108 NONAME ; int CPhoneState::IsSwivelClosed(void) const
+	?CloseCustomizedDialerL@CPhoneState@@QAEXXZ @ 109 NONAME ; void CPhoneState::CloseCustomizedDialerL(void)
+	?HandlePhoneForegroundEventL@CPhoneUIController@@UAEXXZ @ 110 NONAME ; void CPhoneUIController::HandlePhoneForegroundEventL(void)
+	?CheckIfRestoreNEContentAfterDtmfDialer@CPhoneState@@IAEXXZ @ 111 NONAME ; void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer(void)
+	?UpdateInCallContextMenuL@CPhoneState@@UAEXXZ @ 112 NONAME ; void CPhoneState::UpdateInCallContextMenuL(void)
+	?HandleNumericKeyEventL@CPhoneState@@MAEXABUTKeyEvent@@W4TEventCode@@@Z @ 113 NONAME ; void CPhoneState::HandleNumericKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?SetToolbarDimming@CPhoneState@@IAEXH@Z @ 114 NONAME ; void CPhoneState::SetToolbarDimming(int)
+	?SendGlobalErrorNoteL@CPhoneState@@QAEXH@Z @ 115 NONAME ; void CPhoneState::SendGlobalErrorNoteL(int)
+	?IsAutoLockOn@CPhoneState@@UBEHXZ @ 116 NONAME ; int CPhoneState::IsAutoLockOn(void) const
+	?UpdateCbaL@CPhoneStateCallSetup@@MAEXH@Z @ 117 NONAME ; void CPhoneStateCallSetup::UpdateCbaL(int)
+	?RestoreNumberEntryContentL@CPhoneState@@IAEXXZ @ 118 NONAME ; void CPhoneState::RestoreNumberEntryContentL(void)
+	?HandleKeyEventL@CPhoneStateIdle@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 119 NONAME ; void CPhoneStateIdle::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?IsNumberEntryContentStored@CPhoneState@@IAEHXZ @ 120 NONAME ; int CPhoneState::IsNumberEntryContentStored(void)
+	?IsVideoCallActiveL@CPhoneStateInCall@@MAEHXZ @ 121 NONAME ; int CPhoneStateInCall::IsVideoCallActiveL(void)
+	?HandlePhoneStartupL@CPhoneStateStartup@@UAEXXZ @ 122 NONAME ; void CPhoneStateStartup::HandlePhoneStartupL(void)
+	?DialVoiceCallL@CPhoneState@@IAEXXZ @ 123 NONAME ; void CPhoneState::DialVoiceCallL(void)
+	?StateMachine@CPhoneStateHandle@@QAEPAVMPhoneStateMachine@@XZ @ 124 NONAME ; class MPhoneStateMachine * CPhoneStateHandle::StateMachine(void)
+	?EndUiUpdate@CPhoneState@@IAEXXZ @ 125 NONAME ; void CPhoneState::EndUiUpdate(void)
+	?HandleKeyPressDurationL@CPhoneStateIncoming@@UAEXW4TKeyCode@@VTTimeIntervalMicroSeconds@@@Z @ 126 NONAME ; void CPhoneStateIncoming::HandleKeyPressDurationL(enum TKeyCode, class TTimeIntervalMicroSeconds)
+	?UpdateInCallCbaL@CPhoneStateInCall@@MAEXXZ @ 127 NONAME ; void CPhoneStateInCall::UpdateInCallCbaL(void)
+	?EndTransEffect@CPhoneState@@QAEXXZ @ 128 NONAME ; void CPhoneState::EndTransEffect(void)
+	?HandleEnvironmentChangeL@CPhoneState@@UAEXH@Z @ 129 NONAME ; void CPhoneState::HandleEnvironmentChangeL(int)
+	?HandleKeyMessageL@CPhoneStateInCall@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 130 NONAME ; void CPhoneStateInCall::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?SetRingingTonePlaybackL@CPhoneState@@IAEXH@Z @ 131 NONAME ; void CPhoneState::SetRingingTonePlaybackL(int)
+	?ProcessCommandL@CPhoneState@@UAEHH@Z @ 132 NONAME ; int CPhoneState::ProcessCommandL(int)
+	?BeginUiUpdateLC@CPhoneState@@IAEXXZ @ 133 NONAME ; void CPhoneState::BeginUiUpdateLC(void)
+	?DecreaseAudioVolumeL@CPhoneState@@IAEXXZ @ 134 NONAME ; void CPhoneState::DecreaseAudioVolumeL(void)
+	?PhoneEngineInfo@CPhoneStateMachine@@UAEPAVMPEEngineInfo@@XZ @ 135 NONAME ; class MPEEngineInfo * CPhoneStateMachine::PhoneEngineInfo(void)
+	?CreateNumberEntryL@CPhoneStateInCall@@IAEXXZ @ 136 NONAME ; void CPhoneStateInCall::CreateNumberEntryL(void)
+	?HandleSystemEventL@CPhoneUIController@@UAEXABVTWsEvent@@@Z @ 137 NONAME ; void CPhoneUIController::HandleSystemEventL(class TWsEvent const &)
+	?DynInitMenuPaneL@CPhoneUIController@@UAEXHPAVCEikMenuPane@@@Z @ 138 NONAME ; void CPhoneUIController::DynInitMenuPaneL(int, class CEikMenuPane *)
+	??0CPhoneStateStartup@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 139 NONAME ; CPhoneStateStartup::CPhoneStateStartup(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?GetRemoteInfoDataL@CPhoneState@@IAEXHAAVTDes16@@@Z @ 140 NONAME ; void CPhoneState::GetRemoteInfoDataL(int, class TDes16 &)
+	?SetDivertIndication@CPhoneState@@UAEXH@Z @ 141 NONAME ; void CPhoneState::SetDivertIndication(int)
+	?UpdateCbaL@CPhoneStateInCall@@MAEXH@Z @ 142 NONAME ; void CPhoneStateInCall::UpdateCbaL(int)
+	?SetCallId@CPhoneStateMachine@@UAEXH@Z @ 143 NONAME ; void CPhoneStateMachine::SetCallId(int)
+	?ProcessCommandL@CPhoneUIController@@UAEHH@Z @ 144 NONAME ; int CPhoneUIController::ProcessCommandL(int)
+	?DisplayHeaderForCallComingInL@CPhoneState@@IAEXHH@Z @ 145 NONAME ; void CPhoneState::DisplayHeaderForCallComingInL(int, int)
+	??0CPhoneStateIdle@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 146 NONAME ; CPhoneStateIdle::CPhoneStateIdle(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?SendPhoneEngineMessage@CPhoneStateMachine@@UAEXH@Z @ 147 NONAME ; void CPhoneStateMachine::SendPhoneEngineMessage(int)
+	??0CPhoneStateCallSetup@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 148 NONAME ; CPhoneStateCallSetup::CPhoneStateCallSetup(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	??0CPhoneState@@QAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 149 NONAME ; CPhoneState::CPhoneState(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?HandleDtmfKeyToneL@CPhoneState@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 150 NONAME ; void CPhoneState::HandleDtmfKeyToneL(struct TKeyEvent const &, enum TEventCode)
+	?HandleKeyMessageL@CPhoneStateIdle@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 151 NONAME ; void CPhoneStateIdle::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?HandleForegroundEventL@CPhoneUIController@@UAEXH@Z @ 152 NONAME ; void CPhoneUIController::HandleForegroundEventL(int)
+	?HandleSendCommandL@CPhoneStateIdle@@MAEXXZ @ 153 NONAME ; void CPhoneStateIdle::HandleSendCommandL(void)
+	?HandleCommandL@CPhoneUIController@@UAEHH@Z @ 154 NONAME ; int CPhoneUIController::HandleCommandL(int)
+	?HandleCreateNumberEntryL@CPhoneState@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 155 NONAME ; void CPhoneState::HandleCreateNumberEntryL(struct TKeyEvent const &, enum TEventCode)
+	?DisableHWKeysL@CPhoneState@@QAEXXZ @ 156 NONAME ; void CPhoneState::DisableHWKeysL(void)
+	?DisplayHeaderForOutgoingCallL@CPhoneState@@IAEXH@Z @ 157 NONAME ; void CPhoneState::DisplayHeaderForOutgoingCallL(int)
+	?GetBlockedKeyList@CPhoneState@@UBEABV?$RArray@H@@XZ @ 158 NONAME ; class RArray<int> const & CPhoneState::GetBlockedKeyList(void) const
+	?HandlePhoneEngineMessageL@CPhoneStateInCall@@UAEXHH@Z @ 159 NONAME ; void CPhoneStateInCall::HandlePhoneEngineMessageL(int, int)
+	?IsSpeedDialNumber@CPhoneStateIdle@@IBEHABVTDesC16@@@Z @ 160 NONAME ; int CPhoneStateIdle::IsSpeedDialNumber(class TDesC16 const &) const
+	?IsNumberEntryUsedL@CPhoneState@@UAEHXZ @ 161 NONAME ; int CPhoneState::IsNumberEntryUsedL(void)
+	?PhoneStorage@CPhoneStateMachine@@UAEPAVMPhoneStorage@@XZ @ 162 NONAME ; class MPhoneStorage * CPhoneStateMachine::PhoneStorage(void)
+	??1CPhoneState@@UAE@XZ @ 163 NONAME ; CPhoneState::~CPhoneState(void)
+	?HandleCreateNumberEntryL@CPhoneStateCallSetup@@MAEXABUTKeyEvent@@W4TEventCode@@@Z @ 164 NONAME ; void CPhoneStateCallSetup::HandleCreateNumberEntryL(struct TKeyEvent const &, enum TEventCode)
+	?HandlePhoneEngineMessageL@CPhoneStateCallSetup@@UAEXHH@Z @ 165 NONAME ; void CPhoneStateCallSetup::HandlePhoneEngineMessageL(int, int)
+	?HandlePhoneFocusLostEventL@CPhoneState@@UAEXXZ @ 166 NONAME ; void CPhoneState::HandlePhoneFocusLostEventL(void)
+	??1CPhoneStateMachine@@UAE@XZ @ 167 NONAME ; CPhoneStateMachine::~CPhoneStateMachine(void)
+	?HandleIdleForegroundEventL@CPhoneState@@UAEXXZ @ 168 NONAME ; void CPhoneState::HandleIdleForegroundEventL(void)
+	?DynInitMenuPaneL@CPhoneState@@UAEXHPAVCEikMenuPane@@@Z @ 169 NONAME ; void CPhoneState::DynInitMenuPaneL(int, class CEikMenuPane *)
+	?IsDTMFEditorVisibleL@CPhoneState@@IBEHXZ @ 170 NONAME ; int CPhoneState::IsDTMFEditorVisibleL(void) const
+	?ConstructL@CPhoneStateCallSetup@@MAEXXZ @ 171 NONAME ; void CPhoneStateCallSetup::ConstructL(void)
+	?BeginTransEffectLC@CPhoneState@@QAEXW4TStateTransEffectType@@@Z @ 172 NONAME ; void CPhoneState::BeginTransEffectLC(enum TStateTransEffectType)
+	?HandleMessage@CPhoneUIController@@UAEXHH@Z @ 173 NONAME ; void CPhoneUIController::HandleMessage(int, int)
+	?HandleSystemEventL@CPhoneState@@UAEXABVTWsEvent@@@Z @ 174 NONAME ; void CPhoneState::HandleSystemEventL(class TWsEvent const &)
+	?DisplayCallSetupL@CPhoneStateIdle@@IAEXH@Z @ 175 NONAME ; void CPhoneStateIdle::DisplayCallSetupL(int)
+	?ConstructL@CPhoneStateStartup@@MAEXXZ @ 176 NONAME ; void CPhoneStateStartup::ConstructL(void)
+	?HandleKeyMessageL@CPhoneStateStartup@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 177 NONAME ; void CPhoneStateStartup::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?ShowNoteL@CPhoneState@@IAEXH@Z @ 178 NONAME ; void CPhoneState::ShowNoteL(int)
+	?HandlePropertyChangedL@CPhoneState@@UAEXABVTUid@@IH@Z @ 179 NONAME ; void CPhoneState::HandlePropertyChangedL(class TUid const &, unsigned int, int)
+	?IsAnyQueryActiveL@CPhoneState@@QAEHXZ @ 180 NONAME ; int CPhoneState::IsAnyQueryActiveL(void)
+	?State@CPhoneStateMachine@@UAEPAVMPhoneState@@XZ @ 181 NONAME ; class MPhoneState * CPhoneStateMachine::State(void)
+	?SetHandsfreeModeL@CPhoneState@@IAEXH@Z @ 182 NONAME ; void CPhoneState::SetHandsfreeModeL(int)
+	?IsCustomizedDialerVisibleL@CPhoneState@@QBEHXZ @ 183 NONAME ; int CPhoneState::IsCustomizedDialerVisibleL(void) const
+	?UpdateInCallCbaL@CPhoneStateCallSetup@@MAEXXZ @ 184 NONAME ; void CPhoneStateCallSetup::UpdateInCallCbaL(void)
+	?HandleNumberEntryClearedL@CPhoneStateInCall@@MAEXXZ @ 185 NONAME ; void CPhoneStateInCall::HandleNumberEntryClearedL(void)
+	??0CPhoneStateIncoming@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 186 NONAME ; CPhoneStateIncoming::CPhoneStateIncoming(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	??1CPhoneStateIncoming@@UAE@XZ @ 187 NONAME ; CPhoneStateIncoming::~CPhoneStateIncoming(void)
+	?HandleKeyLockEnabled@CPhoneUIController@@UAEXH@Z @ 188 NONAME ; void CPhoneUIController::HandleKeyLockEnabled(int)
+	?DisableCallUIL@CPhoneState@@QAEXXZ @ 189 NONAME ; void CPhoneState::DisableCallUIL(void)
+	?DeleteTouchPaneButtons@CPhoneState@@IAEXXZ @ 190 NONAME ; void CPhoneState::DeleteTouchPaneButtons(void)
+	?ProcessCommandL@CPhoneStateIdle@@UAEHH@Z @ 191 NONAME ; int CPhoneStateIdle::ProcessCommandL(int)
+	?IsNoteVisibleL@CPhoneState@@MAEHXZ @ 192 NONAME ; int CPhoneState::IsNoteVisibleL(void)
+	?DynInitMenuBarL@CPhoneUIController@@UAEXHPAVCEikMenuBar@@@Z @ 193 NONAME ; void CPhoneUIController::DynInitMenuBarL(int, class CEikMenuBar *)
+	?IsAlphanumericSupportedAndCharInput@CPhoneState@@MAEHABUTKeyEvent@@@Z @ 194 NONAME ; int CPhoneState::IsAlphanumericSupportedAndCharInput(struct TKeyEvent const &)
+	?HandlePhoneEngineMessageL@CPhoneStateStartup@@UAEXHH@Z @ 195 NONAME ; void CPhoneStateStartup::HandlePhoneEngineMessageL(int, int)
+	?HandleKeyEventL@CPhoneStateIncoming@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 196 NONAME ; void CPhoneStateIncoming::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?HandleKeyEventL@CPhoneStateStartup@@UAEXABUTKeyEvent@@W4TEventCode@@@Z @ 197 NONAME ; void CPhoneStateStartup::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?HandleNumberEntryClearedL@CPhoneState@@MAEXXZ @ 198 NONAME ; void CPhoneState::HandleNumberEntryClearedL(void)
+	?OnlyHashInNumberEntryL@CPhoneState@@MAEXXZ @ 199 NONAME ; void CPhoneState::OnlyHashInNumberEntryL(void)
+	?IncreaseAudioVolumeL@CPhoneState@@IAEXXZ @ 200 NONAME ; void CPhoneState::IncreaseAudioVolumeL(void)
+	?ConstructL@CPhoneStateIdle@@MAEXXZ @ 201 NONAME ; void CPhoneStateIdle::ConstructL(void)
+	?CheckIfShowCallTerminationNote@CPhoneState@@MAEHXZ @ 202 NONAME ; int CPhoneState::CheckIfShowCallTerminationNote(void)
+	?SendGlobalInfoNoteL@CPhoneState@@QAEXH@Z @ 203 NONAME ; void CPhoneState::SendGlobalInfoNoteL(int)
+	?DisplayIdleScreenL@CPhoneState@@IAEXXZ @ 204 NONAME ; void CPhoneState::DisplayIdleScreenL(void)
+	?StartShowSecurityNoteL@CPhoneState@@IAEXXZ @ 205 NONAME ; void CPhoneState::StartShowSecurityNoteL(void)
+	?StoreNumberEntryContentL@CPhoneState@@IAEXXZ @ 206 NONAME ; void CPhoneState::StoreNumberEntryContentL(void)
+	?SetBTHandsfreeModeL@CPhoneState@@IAEXH@Z @ 207 NONAME ; void CPhoneState::SetBTHandsfreeModeL(int)
+	?HandlePhoneEngineMessageL@CPhoneStateIncoming@@UAEXHH@Z @ 208 NONAME ; void CPhoneStateIncoming::HandlePhoneEngineMessageL(int, int)
+	?SetDefaultFlagsL@CPhoneState@@IAEXXZ @ 209 NONAME ; void CPhoneState::SetDefaultFlagsL(void)
+	?HandleCommandL@CPhoneStateInCall@@UAEHH@Z @ 210 NONAME ; int CPhoneStateInCall::HandleCommandL(int)
+	?DialVoiceCallL@CPhoneStateIdle@@IAEXXZ @ 211 NONAME ; void CPhoneStateIdle::DialVoiceCallL(void)
+	?UpdateRemoteInfoDataL@CPhoneState@@IAEXH@Z @ 212 NONAME ; void CPhoneState::UpdateRemoteInfoDataL(int)
+	?GetRingingCallL@CPhoneStateInCall@@MAEHXZ @ 213 NONAME ; int CPhoneStateInCall::GetRingingCallL(void)
+	?HandleIdleForegroundEventL@CPhoneUIController@@UAEXXZ @ 214 NONAME ; void CPhoneUIController::HandleIdleForegroundEventL(void)
+	?SetBackButtonActive@CPhoneState@@IAEXH@Z @ 215 NONAME ; void CPhoneState::SetBackButtonActive(int)
+	?HandlePhoneForegroundEventL@CPhoneState@@UAEXXZ @ 216 NONAME ; void CPhoneState::HandlePhoneForegroundEventL(void)
+	?HandleForegroundEventL@CPhoneState@@UAEXH@Z @ 217 NONAME ; void CPhoneState::HandleForegroundEventL(int)
+	?DisplayIncomingCallL@CPhoneStateIdle@@IAEXH@Z @ 218 NONAME ; void CPhoneStateIdle::DisplayIncomingCallL(int)
+	?HandleRemConCommandL@CPhoneState@@UAEHW4TRemConCoreApiOperationId@@W4TRemConCoreApiButtonAction@@@Z @ 219 NONAME ; int CPhoneState::HandleRemConCommandL(enum TRemConCoreApiOperationId, enum TRemConCoreApiButtonAction)
+	??1CPhoneStateIdle@@UAE@XZ @ 220 NONAME ; CPhoneStateIdle::~CPhoneStateIdle(void)
+	?PhoneNumberFromEntryLC@CPhoneState@@IAEPAVHBufC16@@XZ @ 221 NONAME ; class HBufC16 * CPhoneState::PhoneNumberFromEntryLC(void)
+	?BaseConstructL@CPhoneState@@QAEXXZ @ 222 NONAME ; void CPhoneState::BaseConstructL(void)
+	?HandlePhoneStartupL@CPhoneUIController@@UAEXXZ @ 223 NONAME ; void CPhoneUIController::HandlePhoneStartupL(void)
+	?SpeedDialL@CPhoneStateIdle@@IAEXABIW4TDialInitiationMethod@1@@Z @ 224 NONAME ; void CPhoneStateIdle::SpeedDialL(unsigned int const &, enum CPhoneStateIdle::TDialInitiationMethod)
+	?SetCallHeaderType@CPhoneState@@IAEXH@Z @ 225 NONAME ; void CPhoneState::SetCallHeaderType(int)
+	?SetTouchPaneButtonEnabled@CPhoneState@@IAEXH@Z @ 226 NONAME ; void CPhoneState::SetTouchPaneButtonEnabled(int)
+	?SetPhoneEngine@CPhoneStateMachine@@UAEXPAVMPEPhoneModel@@@Z @ 227 NONAME ; void CPhoneStateMachine::SetPhoneEngine(class MPEPhoneModel *)
+	?SpeedDialCanceledL@CPhoneStateIdle@@IAEXABI@Z @ 228 NONAME ; void CPhoneStateIdle::SpeedDialCanceledL(unsigned int const &)
+	?CloseDTMFEditorL@CPhoneState@@IAEXXZ @ 229 NONAME ; void CPhoneState::CloseDTMFEditorL(void)
+	?SetTouchPaneVisible@CPhoneState@@IAEXH@Z @ 230 NONAME ; void CPhoneState::SetTouchPaneVisible(int)
+	?HandlePhoneFocusLostEventL@CPhoneUIController@@UAEXXZ @ 231 NONAME ; void CPhoneUIController::HandlePhoneFocusLostEventL(void)
+	?HandleKeyLockEnabled@CPhoneStateIncoming@@UAEXH@Z @ 232 NONAME ; void CPhoneStateIncoming::HandleKeyLockEnabled(int)
+	??0CPhoneStateMachine@@IAE@PAVMPhoneViewCommandHandle@@@Z @ 233 NONAME ; CPhoneStateMachine::CPhoneStateMachine(class MPhoneViewCommandHandle *)
+	??1CPhoneStateStartup@@UAE@XZ @ 234 NONAME ; CPhoneStateStartup::~CPhoneStateStartup(void)
+	?HandleKeyMessageL@CPhoneState@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 235 NONAME ; void CPhoneState::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?OpenSoftRejectMessageEditorL@CPhoneState@@MAEXXZ @ 236 NONAME ; void CPhoneState::OpenSoftRejectMessageEditorL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/eabi/phoneuicontrolu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,474 @@
+EXPORTS
+	_ZN11CPhoneState10ShowQueryLEi @ 1 NONAME
+	_ZN11CPhoneState11EndUiUpdateEv @ 2 NONAME
+	_ZN11CPhoneState11IsVideoCallEi @ 3 NONAME
+	_ZN11CPhoneState12HandleErrorLERK12TPEErrorInfo @ 4 NONAME
+	_ZN11CPhoneState13EnableCallUILEv @ 5 NONAME
+	_ZN11CPhoneState14BaseConstructLEv @ 6 NONAME
+	_ZN11CPhoneState14DialVoiceCallLEv @ 7 NONAME
+	_ZN11CPhoneState14DisableCallUILEv @ 8 NONAME
+	_ZN11CPhoneState14DisableHWKeysLEv @ 9 NONAME
+	_ZN11CPhoneState14EndTransEffectEv @ 10 NONAME
+	_ZN11CPhoneState14HandleCommandLEi @ 11 NONAME
+	_ZN11CPhoneState14IsNoteVisibleLEv @ 12 NONAME
+	_ZN11CPhoneState14ShowTextQueryLEiiiP6TDes16i @ 13 NONAME
+	_ZN11CPhoneState15BeginUiUpdateLCEv @ 14 NONAME
+	_ZN11CPhoneState15DisconnectCallLEv @ 15 NONAME
+	_ZN11CPhoneState15DynInitMenuBarLEiP11CEikMenuBar @ 16 NONAME
+	_ZN11CPhoneState15HandleKeyEventLERK9TKeyEvent10TEventCode @ 17 NONAME
+	_ZN11CPhoneState15HandleLongHashLEv @ 18 NONAME
+	_ZN11CPhoneState15ProcessCommandLEi @ 19 NONAME
+	_ZN11CPhoneState15SetContextMenuLEi @ 20 NONAME
+	_ZN11CPhoneState16CallWaitingNoteLEi @ 21 NONAME
+	_ZN11CPhoneState16CloseDTMFEditorLEv @ 22 NONAME
+	_ZN11CPhoneState16DynInitMenuPaneLEiP12CEikMenuPane @ 23 NONAME
+	_ZN11CPhoneState16SetDefaultFlagsLEv @ 24 NONAME
+	_ZN11CPhoneState17HandleHoldSwitchLEv @ 25 NONAME
+	_ZN11CPhoneState17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 26 NONAME
+	_ZN11CPhoneState17IsAnyQueryActiveLEv @ 27 NONAME
+	_ZN11CPhoneState17SetCallHeaderTypeEi @ 28 NONAME
+	_ZN11CPhoneState17SetHandsfreeModeLEi @ 29 NONAME
+	_ZN11CPhoneState17SetToolbarDimmingEi @ 30 NONAME
+	_ZN11CPhoneState18BeginTransEffectLCE21TStateTransEffectType @ 31 NONAME
+	_ZN11CPhoneState18DisplayIdleScreenLEv @ 32 NONAME
+	_ZN11CPhoneState18GetRemoteInfoDataLEiR6TDes16 @ 33 NONAME
+	_ZN11CPhoneState18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 34 NONAME
+	_ZN11CPhoneState18HandleSystemEventLERK8TWsEvent @ 35 NONAME
+	_ZN11CPhoneState18IsNumberEntryUsedLEv @ 36 NONAME
+	_ZN11CPhoneState19CompleteSatRequestLEi @ 37 NONAME
+	_ZN11CPhoneState19DialMultimediaCallLEv @ 38 NONAME
+	_ZN11CPhoneState19HandleCenRepChangeLERK4TUidj @ 39 NONAME
+	_ZN11CPhoneState19HandlePhoneStartupLEv @ 40 NONAME
+	_ZN11CPhoneState19SendGlobalInfoNoteLEi @ 41 NONAME
+	_ZN11CPhoneState19SetBTHandsfreeModeLEi @ 42 NONAME
+	_ZN11CPhoneState19SetBackButtonActiveEi @ 43 NONAME
+	_ZN11CPhoneState19SetDivertIndicationEi @ 44 NONAME
+	_ZN11CPhoneState19SetTouchPaneButtonsEi @ 45 NONAME
+	_ZN11CPhoneState19SetTouchPaneVisibleEi @ 46 NONAME
+	_ZN11CPhoneState19ShowNumberBusyNoteLEv @ 47 NONAME
+	_ZN11CPhoneState20CallFromNumberEntryLEv @ 48 NONAME
+	_ZN11CPhoneState20DecreaseAudioVolumeLEv @ 49 NONAME
+	_ZN11CPhoneState20HandleDisconnectingLEi @ 50 NONAME
+	_ZN11CPhoneState20HandleKeyLockEnabledEi @ 51 NONAME
+	_ZN11CPhoneState20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 52 NONAME
+	_ZN11CPhoneState20IncreaseAudioVolumeLEv @ 53 NONAME
+	_ZN11CPhoneState20SendGlobalErrorNoteLEi @ 54 NONAME
+	_ZN11CPhoneState21IsNumberEntryVisibleLEv @ 55 NONAME
+	_ZN11CPhoneState21UpdateRemoteInfoDataLEi @ 56 NONAME
+	_ZN11CPhoneState22CloseCustomizedDialerLEv @ 57 NONAME
+	_ZN11CPhoneState22DeleteTouchPaneButtonsEv @ 58 NONAME
+	_ZN11CPhoneState22HandleForegroundEventLEi @ 59 NONAME
+	_ZN11CPhoneState22HandleNumericKeyEventLERK9TKeyEvent10TEventCode @ 60 NONAME
+	_ZN11CPhoneState22HandlePropertyChangedLERK4TUidji @ 61 NONAME
+	_ZN11CPhoneState22OnlyHashInNumberEntryLEv @ 62 NONAME
+	_ZN11CPhoneState22PhoneNumberFromEntryLCEv @ 63 NONAME
+	_ZN11CPhoneState22SendGlobalWarningNoteLEi @ 64 NONAME
+	_ZN11CPhoneState22StartShowSecurityNoteLEv @ 65 NONAME
+	_ZN11CPhoneState23HandleAudioMuteChangedLEv @ 66 NONAME
+	_ZN11CPhoneState23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 67 NONAME
+	_ZN11CPhoneState23HandleNumberEntryEditedEv @ 68 NONAME
+	_ZN11CPhoneState23SetRingingTonePlaybackLEi @ 69 NONAME
+	_ZN11CPhoneState23UpdateSingleActiveCallLEi @ 70 NONAME
+	_ZN11CPhoneState24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 71 NONAME
+	_ZN11CPhoneState24HandleEnvironmentChangeLEi @ 72 NONAME
+	_ZN11CPhoneState24StartAlsLineChangeTimerLEv @ 73 NONAME
+	_ZN11CPhoneState24StoreNumberEntryContentLEv @ 74 NONAME
+	_ZN11CPhoneState24UpdateInCallContextMenuLEv @ 75 NONAME
+	_ZN11CPhoneState25HandleAudioOutputChangedLEv @ 76 NONAME
+	_ZN11CPhoneState25HandleNumberEntryClearedLEv @ 77 NONAME
+	_ZN11CPhoneState25HandlePhoneEngineMessageLEii @ 78 NONAME
+	_ZN11CPhoneState25SetNumberEntryVisibilityLEi @ 79 NONAME
+	_ZN11CPhoneState25SetTouchPaneButtonEnabledEi @ 80 NONAME
+	_ZN11CPhoneState26HandleIdleForegroundEventLEv @ 81 NONAME
+	_ZN11CPhoneState26HandlePhoneFocusLostEventLEv @ 82 NONAME
+	_ZN11CPhoneState26IsNumberEntryContentStoredEv @ 83 NONAME
+	_ZN11CPhoneState26RestoreNumberEntryContentLEv @ 84 NONAME
+	_ZN11CPhoneState26SetTouchPaneButtonDisabledEi @ 85 NONAME
+	_ZN11CPhoneState26UpdateIncomingContextMenuLEi @ 86 NONAME
+	_ZN11CPhoneState26UpdateSilenceButtonDimmingEv @ 87 NONAME
+	_ZN11CPhoneState27DisplayCallTerminationNoteLEv @ 88 NONAME
+	_ZN11CPhoneState27HandlePhoneForegroundEventLEv @ 89 NONAME
+	_ZN11CPhoneState27RetainPreviousKeylockStateLEv @ 90 NONAME
+	_ZN11CPhoneState28CheckDisableHWKeysAndCallUILEv @ 91 NONAME
+	_ZN11CPhoneState28ClearNumberEntryContentCacheEv @ 92 NONAME
+	_ZN11CPhoneState28OpenSoftRejectMessageEditorLEv @ 93 NONAME
+	_ZN11CPhoneState28SetupIdleScreenInBackgroundLEv @ 94 NONAME
+	_ZN11CPhoneState29DisplayHeaderForCallComingInLEii @ 95 NONAME
+	_ZN11CPhoneState29DisplayHeaderForOutgoingCallLEi @ 96 NONAME
+	_ZN11CPhoneState30CheckIfShowCallTerminationNoteEv @ 97 NONAME
+	_ZN11CPhoneState30CustomizedDialerCbaResourceIdLEv @ 98 NONAME
+	_ZN11CPhoneState31CustomizedDialerMenuResourceIdLEv @ 99 NONAME
+	_ZN11CPhoneState34CaptureKeysDuringCallNotificationLEi @ 100 NONAME
+	_ZN11CPhoneState34SetCallHeaderTextsForCallComingInLEiiP28TPhoneCmdParamCallHeaderData @ 101 NONAME
+	_ZN11CPhoneState34SetToolbarButtonLoudspeakerEnabledEv @ 102 NONAME
+	_ZN11CPhoneState35IsAlphanumericSupportedAndCharInputERK9TKeyEvent @ 103 NONAME
+	_ZN11CPhoneState38CheckIfRestoreNEContentAfterDtmfDialerEv @ 104 NONAME
+	_ZN11CPhoneState43IsSimStateNotPresentWithSecurityModeEnabledEv @ 105 NONAME
+	_ZN11CPhoneState7IsSimOkEv @ 106 NONAME
+	_ZN11CPhoneState9ShowNoteLEi @ 107 NONAME
+	_ZN11CPhoneStateC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 108 NONAME
+	_ZN11CPhoneStateC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 109 NONAME
+	_ZN11CPhoneStateD0Ev @ 110 NONAME
+	_ZN11CPhoneStateD1Ev @ 111 NONAME
+	_ZN11CPhoneStateD2Ev @ 112 NONAME
+	_ZN15CPhoneStateIdle10ConstructLEv @ 113 NONAME
+	_ZN15CPhoneStateIdle10SpeedDialLERKjNS_21TDialInitiationMethodE @ 114 NONAME
+	_ZN15CPhoneStateIdle14DialVoiceCallLEv @ 115 NONAME
+	_ZN15CPhoneStateIdle14HandleCommandLEi @ 116 NONAME
+	_ZN15CPhoneStateIdle14HandleDialingLEi @ 117 NONAME
+	_ZN15CPhoneStateIdle15HandleKeyEventLERK9TKeyEvent10TEventCode @ 118 NONAME
+	_ZN15CPhoneStateIdle15ProcessCommandLEi @ 119 NONAME
+	_ZN15CPhoneStateIdle17DisplayCallSetupLEi @ 120 NONAME
+	_ZN15CPhoneStateIdle17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 121 NONAME
+	_ZN15CPhoneStateIdle18HandleSendCommandLEv @ 122 NONAME
+	_ZN15CPhoneStateIdle18SpeedDialCanceledLERKj @ 123 NONAME
+	_ZN15CPhoneStateIdle19DialMultimediaCallLEv @ 124 NONAME
+	_ZN15CPhoneStateIdle20DisplayIncomingCallLEi @ 125 NONAME
+	_ZN15CPhoneStateIdle20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 126 NONAME
+	_ZN15CPhoneStateIdle22OnlyHashInNumberEntryLEv @ 127 NONAME
+	_ZN15CPhoneStateIdle25HandleNumberEntryClearedLEv @ 128 NONAME
+	_ZN15CPhoneStateIdle25HandleNumberLongKeyPressLEv @ 129 NONAME
+	_ZN15CPhoneStateIdle25HandlePhoneEngineMessageLEii @ 130 NONAME
+	_ZN15CPhoneStateIdle26HandleIdleForegroundEventLEv @ 131 NONAME
+	_ZN15CPhoneStateIdle26HandlePhoneFocusLostEventLEv @ 132 NONAME
+	_ZN15CPhoneStateIdle27HandlePhoneForegroundEventLEv @ 133 NONAME
+	_ZN15CPhoneStateIdle5DialLERK7TDesC1616TPhoneNumberTypeNS_21TDialInitiationMethodE @ 134 NONAME
+	_ZN15CPhoneStateIdleC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 135 NONAME
+	_ZN15CPhoneStateIdleC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 136 NONAME
+	_ZN15CPhoneStateIdleD0Ev @ 137 NONAME
+	_ZN15CPhoneStateIdleD1Ev @ 138 NONAME
+	_ZN15CPhoneStateIdleD2Ev @ 139 NONAME
+	_ZN16CPhoneCbaManager10UpdateCbaLEi @ 140 NONAME
+	_ZN16CPhoneCbaManager18UpdateIncomingCbaLEi @ 141 NONAME
+	_ZN16CPhoneCbaManager7SetCbaLEi @ 142 NONAME
+	_ZN17CPhoneStateHandle12StateMachineEv @ 143 NONAME
+	_ZN17CPhoneStateHandle17ViewCommandHandleEv @ 144 NONAME
+	_ZN17CPhoneStateHandle8InstanceEv @ 145 NONAME
+	_ZN17CPhoneStateInCall10ConstructLEv @ 146 NONAME
+	_ZN17CPhoneStateInCall10UpdateCbaLEi @ 147 NONAME
+	_ZN17CPhoneStateInCall11HandleIdleLEi @ 148 NONAME
+	_ZN17CPhoneStateInCall12OpenMenuBarLEv @ 149 NONAME
+	_ZN17CPhoneStateInCall14HandleCommandLEi @ 150 NONAME
+	_ZN17CPhoneStateInCall15CloseDtmfQueryLEv @ 151 NONAME
+	_ZN17CPhoneStateInCall15GetRingingCallLEv @ 152 NONAME
+	_ZN17CPhoneStateInCall16UpdateInCallCbaLEv @ 153 NONAME
+	_ZN17CPhoneStateInCall17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 154 NONAME
+	_ZN17CPhoneStateInCall18CallFetchedNumberLERK7TDesC16 @ 155 NONAME
+	_ZN17CPhoneStateInCall18CreateNumberEntryLEv @ 156 NONAME
+	_ZN17CPhoneStateInCall18IsVideoCallActiveLEv @ 157 NONAME
+	_ZN17CPhoneStateInCall19IsVideoCallRingingLEv @ 158 NONAME
+	_ZN17CPhoneStateInCall19LaunchNewCallQueryLEv @ 159 NONAME
+	_ZN17CPhoneStateInCall23DisconnectOutgoingCallLEv @ 160 NONAME
+	_ZN17CPhoneStateInCall25HandleNumberEntryClearedLEv @ 161 NONAME
+	_ZN17CPhoneStateInCall25HandlePhoneEngineMessageLEii @ 162 NONAME
+	_ZN17CPhoneStateInCall34PhoneNumberAvailableInPhoneEngineLEi @ 163 NONAME
+	_ZN17CPhoneStateInCallC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 164 NONAME
+	_ZN17CPhoneStateInCallC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 165 NONAME
+	_ZN17CPhoneStateInCallD0Ev @ 166 NONAME
+	_ZN17CPhoneStateInCallD1Ev @ 167 NONAME
+	_ZN17CPhoneStateInCallD2Ev @ 168 NONAME
+	_ZN18CPhoneStateMachine11ChangeStateEi @ 169 NONAME
+	_ZN18CPhoneStateMachine11PhoneEngineEv @ 170 NONAME
+	_ZN18CPhoneStateMachine12PhoneStorageEv @ 171 NONAME
+	_ZN18CPhoneStateMachine14SetPhoneEngineEP13MPEPhoneModel @ 172 NONAME
+	_ZN18CPhoneStateMachine15PhoneEngineInfoEv @ 173 NONAME
+	_ZN18CPhoneStateMachine18CreatePhoneEngineLER14MEngineMonitor @ 174 NONAME
+	_ZN18CPhoneStateMachine22SendPhoneEngineMessageEi @ 175 NONAME
+	_ZN18CPhoneStateMachine5StateEv @ 176 NONAME
+	_ZN18CPhoneStateMachine9SetCallIdEi @ 177 NONAME
+	_ZN18CPhoneStateMachineC1EP23MPhoneViewCommandHandle @ 178 NONAME
+	_ZN18CPhoneStateMachineC2EP23MPhoneViewCommandHandle @ 179 NONAME
+	_ZN18CPhoneStateMachineD0Ev @ 180 NONAME
+	_ZN18CPhoneStateMachineD1Ev @ 181 NONAME
+	_ZN18CPhoneStateMachineD2Ev @ 182 NONAME
+	_ZN18CPhoneStateStartup10ConstructLEv @ 183 NONAME
+	_ZN18CPhoneStateStartup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 184 NONAME
+	_ZN18CPhoneStateStartup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 185 NONAME
+	_ZN18CPhoneStateStartup18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 186 NONAME
+	_ZN18CPhoneStateStartup19HandlePhoneStartupLEv @ 187 NONAME
+	_ZN18CPhoneStateStartup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 188 NONAME
+	_ZN18CPhoneStateStartup25HandlePhoneEngineMessageLEii @ 189 NONAME
+	_ZN18CPhoneStateStartup26HandleIdleForegroundEventLEv @ 190 NONAME
+	_ZN18CPhoneStateStartup4NewLEP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 191 NONAME
+	_ZN18CPhoneStateStartupC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 192 NONAME
+	_ZN18CPhoneStateStartupC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 193 NONAME
+	_ZN18CPhoneStateStartupD0Ev @ 194 NONAME
+	_ZN18CPhoneStateStartupD1Ev @ 195 NONAME
+	_ZN18CPhoneStateStartupD2Ev @ 196 NONAME
+	_ZN18CPhoneUIController11HandleErrorERK12TPEErrorInfo @ 197 NONAME
+	_ZN18CPhoneUIController13HandleMessageEii @ 198 NONAME
+	_ZN18CPhoneUIController14HandleCommandLEi @ 199 NONAME
+	_ZN18CPhoneUIController15DynInitMenuBarLEiP11CEikMenuBar @ 200 NONAME
+	_ZN18CPhoneUIController15HandleKeyEventLERK9TKeyEvent10TEventCode @ 201 NONAME
+	_ZN18CPhoneUIController15ProcessCommandLEi @ 202 NONAME
+	_ZN18CPhoneUIController16DynInitMenuPaneLEiP12CEikMenuPane @ 203 NONAME
+	_ZN18CPhoneUIController18HandleSystemEventLERK8TWsEvent @ 204 NONAME
+	_ZN18CPhoneUIController19HandlePhoneStartupLEv @ 205 NONAME
+	_ZN18CPhoneUIController20HandleKeyLockEnabledEi @ 206 NONAME
+	_ZN18CPhoneUIController22HandleForegroundEventLEi @ 207 NONAME
+	_ZN18CPhoneUIController24HandleEnvironmentChangeLEi @ 208 NONAME
+	_ZN18CPhoneUIController26HandleIdleForegroundEventLEv @ 209 NONAME
+	_ZN18CPhoneUIController26HandlePhoneFocusLostEventLEv @ 210 NONAME
+	_ZN18CPhoneUIController27HandlePhoneForegroundEventLEv @ 211 NONAME
+	_ZN18CPhoneUIController4NewLEP23MPhoneViewCommandHandle @ 212 NONAME
+	_ZN18CPhoneUIControllerD0Ev @ 213 NONAME
+	_ZN18CPhoneUIControllerD1Ev @ 214 NONAME
+	_ZN18CPhoneUIControllerD2Ev @ 215 NONAME
+	_ZN19CPhoneStateIncoming10ConstructLEv @ 216 NONAME
+	_ZN19CPhoneStateIncoming14HandleCommandLEi @ 217 NONAME
+	_ZN19CPhoneStateIncoming15HandleKeyEventLERK9TKeyEvent10TEventCode @ 218 NONAME
+	_ZN19CPhoneStateIncoming16DynInitMenuPaneLEiP12CEikMenuPane @ 219 NONAME
+	_ZN19CPhoneStateIncoming17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 220 NONAME
+	_ZN19CPhoneStateIncoming20HandleKeyLockEnabledEi @ 221 NONAME
+	_ZN19CPhoneStateIncoming23HandleAudioPlayStoppedLEv @ 222 NONAME
+	_ZN19CPhoneStateIncoming23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 223 NONAME
+	_ZN19CPhoneStateIncoming25HandleNumberEntryClearedLEv @ 224 NONAME
+	_ZN19CPhoneStateIncoming25HandlePhoneEngineMessageLEii @ 225 NONAME
+	_ZN19CPhoneStateIncomingC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 226 NONAME
+	_ZN19CPhoneStateIncomingC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 227 NONAME
+	_ZN19CPhoneStateIncomingD0Ev @ 228 NONAME
+	_ZN19CPhoneStateIncomingD1Ev @ 229 NONAME
+	_ZN19CPhoneStateIncomingD2Ev @ 230 NONAME
+	_ZN20CPhoneReconnectQuery19ShowReconnectQueryLEi @ 231 NONAME
+	_ZN20CPhoneReconnectQuery9InstanceLEv @ 232 NONAME
+	_ZN20CPhoneStateCallSetup10ConstructLEv @ 233 NONAME
+	_ZN20CPhoneStateCallSetup10UpdateCbaLEi @ 234 NONAME
+	_ZN20CPhoneStateCallSetup12OpenMenuBarLEv @ 235 NONAME
+	_ZN20CPhoneStateCallSetup14HandleCommandLEi @ 236 NONAME
+	_ZN20CPhoneStateCallSetup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 237 NONAME
+	_ZN20CPhoneStateCallSetup16UpdateInCallCbaLEv @ 238 NONAME
+	_ZN20CPhoneStateCallSetup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 239 NONAME
+	_ZN20CPhoneStateCallSetup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 240 NONAME
+	_ZN20CPhoneStateCallSetup25HandleNumberEntryClearedLEv @ 241 NONAME
+	_ZN20CPhoneStateCallSetup25HandlePhoneEngineMessageLEii @ 242 NONAME
+	_ZN20CPhoneStateCallSetupC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 243 NONAME
+	_ZN20CPhoneStateCallSetupC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 244 NONAME
+	_ZN20CPhoneStateCallSetupD0Ev @ 245 NONAME
+	_ZN20CPhoneStateCallSetupD1Ev @ 246 NONAME
+	_ZN20CPhoneStateCallSetupD2Ev @ 247 NONAME
+	_ZNK11CPhoneState11IsKeyLockOnEv @ 248 NONAME
+	_ZNK11CPhoneState12IsAutoLockOnEv @ 249 NONAME
+	_ZNK11CPhoneState14IsSwivelClosedEv @ 250 NONAME
+	_ZNK11CPhoneState17GetBlockedKeyListEv @ 251 NONAME
+	_ZNK11CPhoneState17IsMenuBarVisibleLEv @ 252 NONAME
+	_ZNK11CPhoneState18TopAppIsDisplayedLEv @ 253 NONAME
+	_ZNK11CPhoneState20IsDTMFEditorVisibleLEv @ 254 NONAME
+	_ZNK11CPhoneState23NeedToSendToBackgroundLEv @ 255 NONAME
+	_ZNK11CPhoneState25IsOnScreenDialerSupportedEv @ 256 NONAME
+	_ZNK11CPhoneState26IsCustomizedDialerVisibleLEv @ 257 NONAME
+	_ZNK11CPhoneState8SimStateEv @ 258 NONAME
+	_ZNK15CPhoneStateIdle17IsSpeedDialNumberERK7TDesC16 @ 259 NONAME
+	_ZTI11CPhoneState @ 260 NONAME
+	_ZTI15CPhoneStateIdle @ 261 NONAME
+	_ZTI17CPhoneStateHandle @ 262 NONAME
+	_ZTI17CPhoneStateInCall @ 263 NONAME
+	_ZTI18CPhoneStateMachine @ 264 NONAME
+	_ZTI18CPhoneStateStartup @ 265 NONAME
+	_ZTI18CPhoneUIController @ 266 NONAME
+	_ZTI19CPhoneStateIncoming @ 267 NONAME
+	_ZTI20CPhoneReconnectQuery @ 268 NONAME
+	_ZTI20CPhoneStateCallSetup @ 269 NONAME
+	_ZTI23CPhoneDtmfWaitCharTimer @ 270 NONAME
+	_ZTI23CPhoneKeyEventForwarder @ 271 NONAME
+	_ZTI24CPhoneSystemEventHandler @ 272 NONAME
+	_ZTI26CPhoneRemoteControlHandler @ 273 NONAME
+	_ZTI27CPhoneBtaaDisconnectHandler @ 274 NONAME
+	_ZTV11CPhoneState @ 275 NONAME
+	_ZTV15CPhoneStateIdle @ 276 NONAME
+	_ZTV17CPhoneStateHandle @ 277 NONAME
+	_ZTV17CPhoneStateInCall @ 278 NONAME
+	_ZTV18CPhoneStateMachine @ 279 NONAME
+	_ZTV18CPhoneStateStartup @ 280 NONAME
+	_ZTV18CPhoneUIController @ 281 NONAME
+	_ZTV19CPhoneStateIncoming @ 282 NONAME
+	_ZTV20CPhoneReconnectQuery @ 283 NONAME
+	_ZTV20CPhoneStateCallSetup @ 284 NONAME
+	_ZTV23CPhoneDtmfWaitCharTimer @ 285 NONAME
+	_ZTV23CPhoneKeyEventForwarder @ 286 NONAME
+	_ZTV24CPhoneSystemEventHandler @ 287 NONAME
+	_ZTV26CPhoneRemoteControlHandler @ 288 NONAME
+	_ZTV27CPhoneBtaaDisconnectHandler @ 289 NONAME
+	_ZThn12_N11CPhoneState15DynInitMenuBarLEiP11CEikMenuBar @ 290 NONAME
+	_ZThn12_N11CPhoneState16DynInitMenuPaneLEiP12CEikMenuPane @ 291 NONAME
+	_ZThn12_N11CPhoneState18HandleSystemEventLERK8TWsEvent @ 292 NONAME
+	_ZThn12_N11CPhoneState19HandleCenRepChangeLERK4TUidj @ 293 NONAME
+	_ZThn12_N11CPhoneState19HandlePhoneStartupLEv @ 294 NONAME
+	_ZThn12_N11CPhoneState20HandleKeyLockEnabledEi @ 295 NONAME
+	_ZThn12_N11CPhoneState22HandleForegroundEventLEi @ 296 NONAME
+	_ZThn12_N11CPhoneState22HandlePropertyChangedLERK4TUidji @ 297 NONAME
+	_ZThn12_N11CPhoneState24HandleEnvironmentChangeLEi @ 298 NONAME
+	_ZThn12_N11CPhoneState26HandleIdleForegroundEventLEv @ 299 NONAME
+	_ZThn12_N11CPhoneState26HandlePhoneFocusLostEventLEv @ 300 NONAME
+	_ZThn12_N11CPhoneState27HandlePhoneForegroundEventLEv @ 301 NONAME
+	_ZThn12_N11CPhoneStateD0Ev @ 302 NONAME
+	_ZThn12_N11CPhoneStateD1Ev @ 303 NONAME
+	_ZThn12_N15CPhoneStateIdle26HandleIdleForegroundEventLEv @ 304 NONAME
+	_ZThn12_N15CPhoneStateIdle26HandlePhoneFocusLostEventLEv @ 305 NONAME
+	_ZThn12_N15CPhoneStateIdle27HandlePhoneForegroundEventLEv @ 306 NONAME
+	_ZThn12_N15CPhoneStateIdleD0Ev @ 307 NONAME
+	_ZThn12_N15CPhoneStateIdleD1Ev @ 308 NONAME
+	_ZThn12_N17CPhoneStateInCallD0Ev @ 309 NONAME
+	_ZThn12_N17CPhoneStateInCallD1Ev @ 310 NONAME
+	_ZThn12_N18CPhoneStateStartup19HandlePhoneStartupLEv @ 311 NONAME
+	_ZThn12_N18CPhoneStateStartup26HandleIdleForegroundEventLEv @ 312 NONAME
+	_ZThn12_N18CPhoneStateStartupD0Ev @ 313 NONAME
+	_ZThn12_N18CPhoneStateStartupD1Ev @ 314 NONAME
+	_ZThn12_N18CPhoneUIController15DynInitMenuBarLEiP11CEikMenuBar @ 315 NONAME
+	_ZThn12_N18CPhoneUIController16DynInitMenuPaneLEiP12CEikMenuPane @ 316 NONAME
+	_ZThn12_N18CPhoneUIController18HandleSystemEventLERK8TWsEvent @ 317 NONAME
+	_ZThn12_N18CPhoneUIController19HandlePhoneStartupLEv @ 318 NONAME
+	_ZThn12_N18CPhoneUIController20HandleKeyLockEnabledEi @ 319 NONAME
+	_ZThn12_N18CPhoneUIController22HandleForegroundEventLEi @ 320 NONAME
+	_ZThn12_N18CPhoneUIController24HandleEnvironmentChangeLEi @ 321 NONAME
+	_ZThn12_N18CPhoneUIController26HandleIdleForegroundEventLEv @ 322 NONAME
+	_ZThn12_N18CPhoneUIController26HandlePhoneFocusLostEventLEv @ 323 NONAME
+	_ZThn12_N18CPhoneUIController27HandlePhoneForegroundEventLEv @ 324 NONAME
+	_ZThn12_N18CPhoneUIControllerD0Ev @ 325 NONAME
+	_ZThn12_N18CPhoneUIControllerD1Ev @ 326 NONAME
+	_ZThn12_N19CPhoneStateIncoming16DynInitMenuPaneLEiP12CEikMenuPane @ 327 NONAME
+	_ZThn12_N19CPhoneStateIncoming20HandleKeyLockEnabledEi @ 328 NONAME
+	_ZThn12_N19CPhoneStateIncomingD0Ev @ 329 NONAME
+	_ZThn12_N19CPhoneStateIncomingD1Ev @ 330 NONAME
+	_ZThn12_N20CPhoneStateCallSetupD0Ev @ 331 NONAME
+	_ZThn12_N20CPhoneStateCallSetupD1Ev @ 332 NONAME
+	_ZThn16_N11CPhoneState14HandleCommandLEi @ 333 NONAME
+	_ZThn16_N11CPhoneState15ProcessCommandLEi @ 334 NONAME
+	_ZThn16_N11CPhoneStateD0Ev @ 335 NONAME
+	_ZThn16_N11CPhoneStateD1Ev @ 336 NONAME
+	_ZThn16_N15CPhoneStateIdle14HandleCommandLEi @ 337 NONAME
+	_ZThn16_N15CPhoneStateIdle15ProcessCommandLEi @ 338 NONAME
+	_ZThn16_N15CPhoneStateIdleD0Ev @ 339 NONAME
+	_ZThn16_N15CPhoneStateIdleD1Ev @ 340 NONAME
+	_ZThn16_N17CPhoneStateInCall14HandleCommandLEi @ 341 NONAME
+	_ZThn16_N17CPhoneStateInCallD0Ev @ 342 NONAME
+	_ZThn16_N17CPhoneStateInCallD1Ev @ 343 NONAME
+	_ZThn16_N18CPhoneStateStartupD0Ev @ 344 NONAME
+	_ZThn16_N18CPhoneStateStartupD1Ev @ 345 NONAME
+	_ZThn16_N18CPhoneUIController14HandleCommandLEi @ 346 NONAME
+	_ZThn16_N18CPhoneUIController15ProcessCommandLEi @ 347 NONAME
+	_ZThn16_N18CPhoneUIControllerD0Ev @ 348 NONAME
+	_ZThn16_N18CPhoneUIControllerD1Ev @ 349 NONAME
+	_ZThn16_N19CPhoneStateIncoming14HandleCommandLEi @ 350 NONAME
+	_ZThn16_N19CPhoneStateIncomingD0Ev @ 351 NONAME
+	_ZThn16_N19CPhoneStateIncomingD1Ev @ 352 NONAME
+	_ZThn16_N20CPhoneStateCallSetup14HandleCommandLEi @ 353 NONAME
+	_ZThn16_N20CPhoneStateCallSetupD0Ev @ 354 NONAME
+	_ZThn16_N20CPhoneStateCallSetupD1Ev @ 355 NONAME
+	_ZThn20_N11CPhoneState20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 356 NONAME
+	_ZThn20_N11CPhoneStateD0Ev @ 357 NONAME
+	_ZThn20_N11CPhoneStateD1Ev @ 358 NONAME
+	_ZThn20_N15CPhoneStateIdle20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 359 NONAME
+	_ZThn20_N15CPhoneStateIdleD0Ev @ 360 NONAME
+	_ZThn20_N15CPhoneStateIdleD1Ev @ 361 NONAME
+	_ZThn20_N17CPhoneStateInCallD0Ev @ 362 NONAME
+	_ZThn20_N17CPhoneStateInCallD1Ev @ 363 NONAME
+	_ZThn20_N18CPhoneStateStartupD0Ev @ 364 NONAME
+	_ZThn20_N18CPhoneStateStartupD1Ev @ 365 NONAME
+	_ZThn20_N19CPhoneStateIncomingD0Ev @ 366 NONAME
+	_ZThn20_N19CPhoneStateIncomingD1Ev @ 367 NONAME
+	_ZThn20_N20CPhoneStateCallSetupD0Ev @ 368 NONAME
+	_ZThn20_N20CPhoneStateCallSetupD1Ev @ 369 NONAME
+	_ZThn24_N11CPhoneState19SetDivertIndicationEi @ 370 NONAME
+	_ZThn24_N11CPhoneStateD0Ev @ 371 NONAME
+	_ZThn24_N11CPhoneStateD1Ev @ 372 NONAME
+	_ZThn24_N15CPhoneStateIdleD0Ev @ 373 NONAME
+	_ZThn24_N15CPhoneStateIdleD1Ev @ 374 NONAME
+	_ZThn24_N17CPhoneStateInCallD0Ev @ 375 NONAME
+	_ZThn24_N17CPhoneStateInCallD1Ev @ 376 NONAME
+	_ZThn24_N18CPhoneStateStartupD0Ev @ 377 NONAME
+	_ZThn24_N18CPhoneStateStartupD1Ev @ 378 NONAME
+	_ZThn24_N19CPhoneStateIncomingD0Ev @ 379 NONAME
+	_ZThn24_N19CPhoneStateIncomingD1Ev @ 380 NONAME
+	_ZThn24_N20CPhoneStateCallSetupD0Ev @ 381 NONAME
+	_ZThn24_N20CPhoneStateCallSetupD1Ev @ 382 NONAME
+	_ZThn28_NK11CPhoneState17GetBlockedKeyListEv @ 383 NONAME
+	_ZThn32_N11CPhoneState25HandleNumberEntryClearedLEv @ 384 NONAME
+	_ZThn32_N15CPhoneStateIdle25HandleNumberEntryClearedLEv @ 385 NONAME
+	_ZThn32_N17CPhoneStateInCall25HandleNumberEntryClearedLEv @ 386 NONAME
+	_ZThn32_N19CPhoneStateIncoming25HandleNumberEntryClearedLEv @ 387 NONAME
+	_ZThn32_N20CPhoneStateCallSetup25HandleNumberEntryClearedLEv @ 388 NONAME
+	_ZThn36_N11CPhoneState23HandleNumberEntryEditedEv @ 389 NONAME
+	_ZThn36_N11CPhoneStateD0Ev @ 390 NONAME
+	_ZThn36_N11CPhoneStateD1Ev @ 391 NONAME
+	_ZThn36_N15CPhoneStateIdleD0Ev @ 392 NONAME
+	_ZThn36_N15CPhoneStateIdleD1Ev @ 393 NONAME
+	_ZThn36_N17CPhoneStateInCallD0Ev @ 394 NONAME
+	_ZThn36_N17CPhoneStateInCallD1Ev @ 395 NONAME
+	_ZThn36_N18CPhoneStateStartupD0Ev @ 396 NONAME
+	_ZThn36_N18CPhoneStateStartupD1Ev @ 397 NONAME
+	_ZThn36_N19CPhoneStateIncomingD0Ev @ 398 NONAME
+	_ZThn36_N19CPhoneStateIncomingD1Ev @ 399 NONAME
+	_ZThn36_N20CPhoneStateCallSetupD0Ev @ 400 NONAME
+	_ZThn36_N20CPhoneStateCallSetupD1Ev @ 401 NONAME
+	_ZThn40_NK11CPhoneState11IsKeyLockOnEv @ 402 NONAME
+	_ZThn40_NK11CPhoneState12IsAutoLockOnEv @ 403 NONAME
+	_ZThn4_N11CPhoneState12HandleErrorLERK12TPEErrorInfo @ 404 NONAME
+	_ZThn4_N11CPhoneState25HandlePhoneEngineMessageLEii @ 405 NONAME
+	_ZThn4_N11CPhoneStateD0Ev @ 406 NONAME
+	_ZThn4_N11CPhoneStateD1Ev @ 407 NONAME
+	_ZThn4_N15CPhoneStateIdle25HandlePhoneEngineMessageLEii @ 408 NONAME
+	_ZThn4_N15CPhoneStateIdleD0Ev @ 409 NONAME
+	_ZThn4_N15CPhoneStateIdleD1Ev @ 410 NONAME
+	_ZThn4_N17CPhoneStateInCall25HandlePhoneEngineMessageLEii @ 411 NONAME
+	_ZThn4_N17CPhoneStateInCallD0Ev @ 412 NONAME
+	_ZThn4_N17CPhoneStateInCallD1Ev @ 413 NONAME
+	_ZThn4_N18CPhoneStateMachine11ChangeStateEi @ 414 NONAME
+	_ZThn4_N18CPhoneStateMachine11PhoneEngineEv @ 415 NONAME
+	_ZThn4_N18CPhoneStateMachine12PhoneStorageEv @ 416 NONAME
+	_ZThn4_N18CPhoneStateMachine14SetPhoneEngineEP13MPEPhoneModel @ 417 NONAME
+	_ZThn4_N18CPhoneStateMachine15PhoneEngineInfoEv @ 418 NONAME
+	_ZThn4_N18CPhoneStateMachine18CreatePhoneEngineLER14MEngineMonitor @ 419 NONAME
+	_ZThn4_N18CPhoneStateMachine22SendPhoneEngineMessageEi @ 420 NONAME
+	_ZThn4_N18CPhoneStateMachine5StateEv @ 421 NONAME
+	_ZThn4_N18CPhoneStateMachine9SetCallIdEi @ 422 NONAME
+	_ZThn4_N18CPhoneStateMachineD0Ev @ 423 NONAME
+	_ZThn4_N18CPhoneStateMachineD1Ev @ 424 NONAME
+	_ZThn4_N18CPhoneStateStartup25HandlePhoneEngineMessageLEii @ 425 NONAME
+	_ZThn4_N18CPhoneStateStartupD0Ev @ 426 NONAME
+	_ZThn4_N18CPhoneStateStartupD1Ev @ 427 NONAME
+	_ZThn4_N18CPhoneUIController11HandleErrorERK12TPEErrorInfo @ 428 NONAME
+	_ZThn4_N18CPhoneUIController13HandleMessageEii @ 429 NONAME
+	_ZThn4_N19CPhoneStateIncoming25HandlePhoneEngineMessageLEii @ 430 NONAME
+	_ZThn4_N19CPhoneStateIncomingD0Ev @ 431 NONAME
+	_ZThn4_N19CPhoneStateIncomingD1Ev @ 432 NONAME
+	_ZThn4_N20CPhoneStateCallSetup25HandlePhoneEngineMessageLEii @ 433 NONAME
+	_ZThn4_N20CPhoneStateCallSetupD0Ev @ 434 NONAME
+	_ZThn4_N20CPhoneStateCallSetupD1Ev @ 435 NONAME
+	_ZThn8_N11CPhoneState14IsNoteVisibleLEv @ 436 NONAME
+	_ZThn8_N11CPhoneState15HandleKeyEventLERK9TKeyEvent10TEventCode @ 437 NONAME
+	_ZThn8_N11CPhoneState15HandleLongHashLEv @ 438 NONAME
+	_ZThn8_N11CPhoneState17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 439 NONAME
+	_ZThn8_N11CPhoneState18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 440 NONAME
+	_ZThn8_N11CPhoneState23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 441 NONAME
+	_ZThn8_N11CPhoneState24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 442 NONAME
+	_ZThn8_N11CPhoneState35IsAlphanumericSupportedAndCharInputERK9TKeyEvent @ 443 NONAME
+	_ZThn8_N11CPhoneStateD0Ev @ 444 NONAME
+	_ZThn8_N11CPhoneStateD1Ev @ 445 NONAME
+	_ZThn8_N15CPhoneStateIdle15HandleKeyEventLERK9TKeyEvent10TEventCode @ 446 NONAME
+	_ZThn8_N15CPhoneStateIdle17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 447 NONAME
+	_ZThn8_N15CPhoneStateIdleD0Ev @ 448 NONAME
+	_ZThn8_N15CPhoneStateIdleD1Ev @ 449 NONAME
+	_ZThn8_N17CPhoneStateInCall17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 450 NONAME
+	_ZThn8_N17CPhoneStateInCallD0Ev @ 451 NONAME
+	_ZThn8_N17CPhoneStateInCallD1Ev @ 452 NONAME
+	_ZThn8_N18CPhoneStateStartup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 453 NONAME
+	_ZThn8_N18CPhoneStateStartup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 454 NONAME
+	_ZThn8_N18CPhoneStateStartup18HandleDtmfKeyToneLERK9TKeyEvent10TEventCode @ 455 NONAME
+	_ZThn8_N18CPhoneStateStartup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 456 NONAME
+	_ZThn8_N18CPhoneStateStartupD0Ev @ 457 NONAME
+	_ZThn8_N18CPhoneStateStartupD1Ev @ 458 NONAME
+	_ZThn8_N18CPhoneUIController15HandleKeyEventLERK9TKeyEvent10TEventCode @ 459 NONAME
+	_ZThn8_N18CPhoneUIControllerD0Ev @ 460 NONAME
+	_ZThn8_N18CPhoneUIControllerD1Ev @ 461 NONAME
+	_ZThn8_N19CPhoneStateIncoming15HandleKeyEventLERK9TKeyEvent10TEventCode @ 462 NONAME
+	_ZThn8_N19CPhoneStateIncoming17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 463 NONAME
+	_ZThn8_N19CPhoneStateIncoming23HandleKeyPressDurationLE8TKeyCode25TTimeIntervalMicroSeconds @ 464 NONAME
+	_ZThn8_N19CPhoneStateIncomingD0Ev @ 465 NONAME
+	_ZThn8_N19CPhoneStateIncomingD1Ev @ 466 NONAME
+	_ZThn8_N20CPhoneStateCallSetup15HandleKeyEventLERK9TKeyEvent10TEventCode @ 467 NONAME
+	_ZThn8_N20CPhoneStateCallSetup17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 468 NONAME
+	_ZThn8_N20CPhoneStateCallSetup24HandleCreateNumberEntryLERK9TKeyEvent10TEventCode @ 469 NONAME
+	_ZThn8_N20CPhoneStateCallSetupD0Ev @ 470 NONAME
+	_ZThn8_N20CPhoneStateCallSetupD1Ev @ 471 NONAME
+	_ZThn8_NK11CPhoneState17IsMenuBarVisibleLEv @ 472 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUIControl bld file
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_EXPORTS
+
+// Stub SIS files:
+../group/phoneuicontrol_stub.sis                /epoc32/data/z/system/install/phoneuicontrol_stub.sis
+
+PRJ_MMPFILES
+phoneuicontrol.mmp
+
+#endif // RD_PHONE_NG
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/group/phoneuicontrol.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  UIControl subcomponent of PhoneUI
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+// <-- QT PHONE START --> 
+CAPABILITY CAP_GENERAL_DLL
+//CAPABILITY CAP_APPLICATION MultiMediaDD NetworkControl PowerMgmt DRM DiskAdmin
+// <-- QT PHONE END --> 
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          phoneuicontrol.dll
+TARGETTYPE      dll
+UID             0x1000008d  0x101F4D0C
+
+//EXPORTUNFROZEN
+
+SOURCEPATH      ../src
+SOURCE          cphonebtaadisconnecthandler.cpp
+SOURCE          cphonedtmfwaitchartimer.cpp
+SOURCE          cphoneenginehandler.cpp
+
+SOURCE          cphonereconnectquery.cpp
+SOURCE          cphoneremotecontrolhandler.cpp
+SOURCE          cphonestate.cpp
+SOURCE          cphonestatecallsetup.cpp
+SOURCE          cphonestatehandle.cpp
+SOURCE          cphonestateidle.cpp
+SOURCE          cphonestateincall.cpp
+SOURCE          cphonestateincoming.cpp
+SOURCE          cphonestatemachine.cpp
+SOURCE          cphonestatestartup.cpp
+SOURCE          cphonesystemeventhandler.cpp
+SOURCE          cphoneuicontroller.cpp
+SOURCE          cphonekeyeventforwarder.cpp
+SOURCE          cphoneaccessorybthandler.cpp
+SOURCE          tphonecallheaderparam.cpp
+SOURCE          cphonecallheadermanager.cpp 
+SOURCE          cphonenumberentrymanager.cpp
+SOURCE          cphonecbamanager.cpp 
+
+/* Languages */
+LANG SC
+
+
+USERINCLUDE     ../inc
+// <-- QT PHONE START --> 
+USERINCLUDE     ../../phoneuiqtviewadapter/inc
+//USERINCLUDE     ../../phoneuiview/inc
+// <-- QT PHONE END --> 
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui2/srcdata
+USERINCLUDE     ../../phoneuistates/inc
+USERINCLUDE     ../../phonemediatorcenter/inc
+USERINCLUDE     ../../phoneuiutils/inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+LIBRARY         euser.lib
+LIBRARY         cone.lib 
+LIBRARY         phoneuiutils.lib
+LIBRARY         efsrv.lib 
+LIBRARY         engineinfo.lib
+LIBRARY         ws32.lib 
+LIBRARY         fbscli.lib
+// <-- QT PHONE START --> 
+LIBRARY         phonestringloader.lib
+//LIBRARY         commonengine.lib //StringLoader 
+// <-- QT PHONE END --> 
+LIBRARY         featmgr.lib // FeatureManager
+LIBRARY         connmon.lib // RConnectionMonitor
+LIBRARY         avkon.lib // AknTextUtils
+
+// RemCon
+LIBRARY         remconcoreapi.lib
+LIBRARY         remconinterfacebase.lib
+LIBRARY         phonecmdhandler.lib
+// Soft reject
+LIBRARY         eikcore.lib // CCharFormatLayer, CParaFormatLayer
+
+// Profiles
+LIBRARY         profileeng.lib
+
+LIBRARY         sssettings.lib
+LIBRARY         bafl.lib                // Descriptor arrays
+
+LIBRARY         apgrfx.lib
+LIBRARY         serviceprovidersettings.lib
+
+LIBRARY         starterclient.lib
+
+LIBRARY         phonemediatorcenter.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/group/phoneuicontrol_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phoneuicontrol component.
+;
+; Languages
+&EN
+
+; Header
+#{"PhoneUIControl"}, (0x101F4D0C), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+;
+;  PhoneUIControl
+;
+"" - "z:\sys\bin\PhoneUIControl.dll"
Binary file phoneapp/phoneuicontrol/group/phoneuicontrol_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphoneaccessorybthandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Accessory and Bluetooth handler.
+*
+*/
+
+
+#ifndef CPHONEACCESSORYBTHANDLER_H_
+#define CPHONEACCESSORYBTHANDLER_H_
+
+// INCLUDES
+#include <e32base.h>
+#include <pevirtualengine.h> 
+#include <mphoneneclearedhandler.h>
+#include <mphonestatemachine.h>
+#include <mphoneviewcommandhandle.h>
+
+// CLASS DECLARATION
+ 
+/**
+*  It waits for bluetooth audio disconnection and
+*  shows query when it happens.
+*
+*/
+NONSHARABLE_CLASS( CPhoneAccessoryBTHandler ) : public CBase
+    {
+    public:
+        
+        /**
+        * Two-phased constructor
+        * @param aViewCommandHandle reference to View Command Handler
+        * @param aStateMachine: reference to Phone UI state machine
+        * @return an instance of class CPhoneAccessoryBTHandler
+        */
+        static CPhoneAccessoryBTHandler* NewLC( MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneStateMachine* aStateMachine, MPhoneNEClearedHandler* aNEClearedHandler );
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneAccessoryBTHandler();
+
+
+        /**
+         * Sets BT debug mode on.
+         */
+        void SetBTDebugModeL();
+
+        /**
+        * Set the BT handsfree mode
+        * @param aHandsfreeMode ETrue to activate BT, EFalse to deactivate
+        * @return ETrue if allowed
+        */
+        TBool SetBTHandsfreeModeL( TBool aHandsfreeMode );
+
+        /**
+        * Set the handsfree mode
+        * @param aHandsfreeMode ETrue to activate IHF, EFalse to deactivate
+        * @return ETrue if allowed
+        */
+        TBool SetHandsfreeModeL( TBool aHandsfreeMode );
+
+        /**
+        * Shows BT address
+        */
+        void ShowBTAddressL();
+          
+        /**
+        * Shows BT loopback status note
+        */
+        void ShowBTLoopbackL();
+        
+        /**
+        * Shows BT activated note
+        */
+        void ShowBTActivatedL();
+          
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneAccessoryBTHandler( MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneStateMachine* aStateMachine, MPhoneNEClearedHandler* aNEClearedHandler );
+
+        /**
+        * Set the handsfree mode
+        * @param aHandsfreeMode ETrue to activate, EFalse to deactivate
+        * @param aAudioOutput audio output
+        * @return ETrue if allowed
+        */
+        TBool DoSetHandsfreeModeL( TBool aHandsfreeMode, TPEAudioOutput aAudioOutput );
+
+    private:    // Data  
+       
+        /**
+        * Reference to the Phone UI View command handle
+        */
+        MPhoneViewCommandHandle* iViewCommandHandle;
+
+        /**
+        * Reference to State machine
+        */
+        MPhoneStateMachine* iStateMachine;
+
+        /**
+        * Reference to handler for Number Entry cleared event
+        */
+        MPhoneNEClearedHandler* iNEClearedHandler;
+
+    };
+
+
+#endif /*CPHONEACCESSORYBTHANDLER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonebtaadisconnecthandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bluetooth audio disconnection handler.
+*
+*/
+
+
+#ifndef CPHONEBTAADISCONNECTHANDLER_H
+#define CPHONEBTAADISCONNECTHANDLER_H
+
+// INCLUDES
+#include <coemain.h>
+#include "mphonetimer.h"
+ 
+// CLASS DECLARATION
+class CPhoneTimer;
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+ 
+/**
+*  It waits for bluetooth audio disconnection and
+*  shows query when it happens.
+*
+*/
+class CPhoneBtaaDisconnectHandler : public CCoeStatic, protected MPhoneTimer
+    {
+    public:
+        
+        /**
+         * Returns the bluetooth accessory disconnect handler singleton, constructing it if needed.
+         * 
+         * @return  Bluetooth accessory disconnect handler instance.
+         */
+        static CPhoneBtaaDisconnectHandler* InstanceL();
+        
+        /**
+        * Handles connection lost situation.
+        */
+        void HandleConnectionLostL();
+ 
+        /**
+        * Handles query dismissal.
+        * @param aCommand command selected.
+        */
+        void HandleQueryDismissL( TInt aCommand );
+
+        /**
+        * Cancels current operation.
+        */
+        void Cancel();
+        
+        /**
+        * Return query status
+        */
+        TBool IsQuery();
+        
+    protected: //from base class
+
+        /**
+        * @see CPhoneTimer, handles timeout.
+        */
+        virtual void HandleTimeOutL();
+        
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneBtaaDisconnectHandler();
+
+        /**
+        * Destructor.
+        */
+        ~CPhoneBtaaDisconnectHandler();
+        
+        /**
+        * Lauches query.
+        */
+        void LaunchQueryL();
+
+        /**
+        * Deletes all temporary instances.
+        */
+        void DeleteAll();
+
+        /**
+        * Terminate all calls.
+        */
+        void TerminateAllCallsL(); 
+      
+        /**
+        * Show query
+        * @param aResourceId resource id to be resolved
+        */      
+        void ShowQueryL( TInt aResourceId );
+        
+        /**
+        * Set mute
+        * @param aStatus ETrue if muted else unmute
+        */
+        void SetMuteL( TBool aStatus );
+
+    protected:  // Data        
+        /**
+        * Phone UI View command handle
+        */
+        MPhoneViewCommandHandle* iViewCommandHandle;
+        
+        // Interface for setting and getting active state
+        MPhoneStateMachine* iStateMachine;
+
+    private:    // Data  
+       
+        /**
+        * Enumerates states.
+        *
+        * EIdle - idle, waiting for disconnection.
+        * ELaunchQuery - query to be launched.
+        */
+        enum TState
+            {
+            EIdle,
+            ELaunchQuery,
+            };
+
+        // Current state.
+        TState iState;
+
+        // Timer.
+        CPhoneTimer* iTimer;
+     
+        // Old mute state.
+        TBool iOldMuted;
+
+        // Indicates if call is supposed to be continued in 
+        // handset or loudspeaker. ETrue corresponds to loudspeaker,
+        // while EFalse corresponds to handset.
+        TBool iVideoCallStatus;
+
+    };
+
+#endif      // CPHONEBTAADISCONNECTHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonecallheadermanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bubble manager wrapper.
+*
+*/
+
+
+#ifndef CPHONECALLHEADERMANAGER_H
+#define CPHONECALLHEADERMANAGER_H
+
+//INCLUDES
+#include <e32base.h>
+#include "mphonecallheadermanagerutility.h"
+#include "mphonestatemachine.h"
+#include "mphoneviewcommandhandle.h"
+#include "mphonecustomization.h"
+
+class TPhoneCmdParamCallHeaderData;
+class TPhoneCallHeaderParam;
+
+/**
+ * Class contains helper functions for bubble manager.
+ *
+ * @lib phoneuicontrol
+ * @since S60 v9.1
+ */
+NONSHARABLE_CLASS( CPhoneCallHeaderManager ) :  public CBase,
+                                                public MPhoneCallHeaderManagerUtility
+    {
+    public:
+        
+        /**
+        * Creates new instance of CPhoneCallHeaderManager
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @param aCustomization: handle to customization.
+        * @return CPhoneCallHeaderManager* object  
+        */
+        static CPhoneCallHeaderManager* NewL(
+                    MPhoneViewCommandHandle& aViewCommandHandle,
+                    MPhoneStateMachine& aStateMachine,
+                    MPhoneCustomization* aCustomization );
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneCallHeaderManager();
+        
+    public:
+        
+        /**
+        * Returns updated remote information data.
+        * @param aCallId - Call Id.
+        */
+        TPhoneCmdParamCallHeaderData UpdateCallHeaderInfoL( 
+                const TInt aCallId );
+        
+        void GetRemoteInfoDataL(  const TInt aCallId, TDes& aData ) const;
+       
+        /**
+        * Display call header for call coming in ( the remote info data 
+        * and picture is displayed immediately )
+        * @param aCallid call id
+        * @param aWaitingCall waiting call indication
+        */
+        void DisplayHeaderForCallComingInL(
+                const TInt aCallId, 
+                const TBool aWaitingCall );
+       
+        /**
+        * Display call header for outgoing call (the phone number is initially
+        * displayed)
+        * @param aCallid call id
+        */
+        void DisplayHeaderForOutgoingCallL(
+                const TInt aCallId );
+
+        /**
+        * Sets the call header type used in the call bubble.
+        * @param aCallHeaderType, call header type.
+        */
+        void SetCallHeaderType( 
+                TInt aCallHeaderType );
+        
+        /**
+        * Returns the set call header type.
+        */
+        TInt CallHeaderType() const;
+                
+        /**
+        * Sets divert indication to call header if necessary
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header where indication will be set
+        *                          if needed.
+        */
+        void SetDivertIndication( const TBool aDivertIndication );
+        
+        /**
+        * Checks if call is waiting, returns ETrue if call is waiting
+        * otherwise EFalse.
+        * @param aCallId, call id.
+        */
+        TBool IsWaitingCallL( const TInt aCallId ) const;
+        
+        /**
+        * Checks if call is video, returns ETrue if call is video
+        * otherwise EFalse.
+        * @param aCallId, call id.
+        */
+        TBool IsVideoCall( const TInt aCallId ) const;
+ 
+        /**
+        * Sets texts to call header
+        * @param aCallId - Call Id.
+        * @param aWaitingCall waiting call indication
+        * @param aCallHeaderData - Call header where indication will be set
+        *                          if needed.
+        */         
+        void SetCallHeaderTextsForCallComingIn(
+                const TInt aCallId, 
+                const TBool aWaitingCall,
+                TPhoneCmdParamCallHeaderData* aCallHeaderData );
+        
+    public:  // Functions from base class
+        
+        /**
+        * @see MPhoneBubbleManagerUtility.
+        */
+        void SetPhoneNumberAvailabilityL( 
+                const TInt aNumberLength,
+                const TBool aContactInfoAvailable );
+        
+        /**
+        * @see MPhoneBubbleManagerUtility.
+        */
+        void GetInCallNumberTextL( TInt aCallId, TDes& aData ) const;
+        
+        /**
+        * @see MPhoneBubbleManagerUtility.
+        */
+        void LoadCallHeaderTexts(
+            const TInt aLabelId, 
+            const TInt aShortLabelId,
+            TPhoneCmdParamCallHeaderData* aCallHeaderData ); 
+        
+        /**
+        * @see MPhoneBubbleManagerUtility.
+        */
+        MPhoneCustomization* Customization(){ return iCustomization; }
+        
+        /**
+        * @see MPhoneBubbleManagerUtility.
+        */
+        void LoadResource( TDes& aData, const TInt aResource );
+        
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CPhoneCallHeaderManager(
+                MPhoneViewCommandHandle& aViewCommandHandle,
+                MPhoneStateMachine& aStateMachine,
+                MPhoneCustomization* aCustomization );
+        
+        /**
+        * Symbian constructor
+        */
+        void ConstructL();
+        
+    private:
+        
+        MPhoneViewCommandHandle& iViewCommandHandle;
+        MPhoneStateMachine& iStateMachine;
+        MPhoneCustomization* iCustomization;
+        TPhoneCallHeaderParam* iCallHeaderParam;
+    };
+
+
+#endif // CPHONECALLHEADERMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonecbamanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class takes care of CBA's.
+*
+*/
+
+
+#ifndef CPHONECBAMANAGER_H
+#define CPHONECBAMANAGER_H
+
+//INCLUDES
+#include <e32base.h>
+
+//FORWARD
+class MPhoneViewCommandHandle;
+class MPhoneStateMachine;
+class CPhoneState;
+
+/**
+ * Class takes care of CBA's.
+ *
+ * @lib phoneuicontrol
+ * @since S60 v9.1
+ */
+NONSHARABLE_CLASS( CPhoneCbaManager ) :  public CBase
+    {
+    public:
+        
+        /**
+        * Creates new instance of CPhoneCbaManager
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return CPhoneCbaManager* object  
+        */
+        static CPhoneCbaManager* NewL(
+                    CPhoneState* aState,
+                    MPhoneViewCommandHandle& aViewCommandHandle,
+                    MPhoneStateMachine& aStateMachine );
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneCbaManager();
+        
+    public:
+
+        /**
+        * Update CBA
+        */
+        IMPORT_C void UpdateCbaL( TInt aResource );
+
+        /**
+        * Set CBA
+        */
+        IMPORT_C void SetCbaL( TInt aResource );
+        
+        /**
+        * Update incoming CBAs
+        */
+        IMPORT_C void UpdateIncomingCbaL( TInt aCallId );
+        
+    public:
+        
+        /**
+        * Update In Call CBA
+        */ 
+        void UpdateInCallCbaL();
+        
+        /**
+        * Sets the ringtone silenced status
+        * @param aSilenceStatus, new status
+        */
+        void SetRingtoneSilencedStatus( const TBool aSilenceStatus );
+        
+    private:
+        
+        /*
+        * Updated Cba when Swivel state changes.
+        */
+        void UpdateCbaSwivelStateChangedL();
+        
+        /**
+        * Check is alerting or active voice call
+        */
+        TBool IsVoiceCallAlertingOrActiveL();
+        
+        /**
+        * Get silence cba resource when incomng call
+        * @param aSoftRejectActivated Is soft reject activated or not
+        * @return Resource id of CBA
+        */
+        TInt GetIncomingCallSilenceCBA( const TBool aSoftRejectActivated ); 
+        
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CPhoneCbaManager(
+                CPhoneState* aState,
+                MPhoneViewCommandHandle& aViewCommandHandle,
+                MPhoneStateMachine& aStateMachine );
+        
+    private:
+        
+        // Not owned:
+        CPhoneState* iState;
+        MPhoneViewCommandHandle& iViewCommandHandle;
+        MPhoneStateMachine& iStateMachine;
+        
+        // RingtoneSilenced flag.
+        // This is used to determine if the ringtone
+        // for incoming call is silenced. The information
+        // is used while updating softkeys in method
+        // UpdateIncomingCbaL only
+        TBool iRingtoneSilenced;
+        
+    };
+
+
+#endif // CPHONECBAMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonedtmfwaitchartimer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Class for implementing DTMF wait character timer.
+*
+*/
+
+
+#ifndef CPHONEDTMFWAITCHARTIMER_H
+#define CPHONEDTMFWAITCHARTIMER_H
+
+// INCLUDES
+#include "cphonetimer.h"
+
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+
+// CLASS DECLARATION
+
+class CPhoneDtmfWaitCharTimer : public CBase,
+                                protected MPhoneTimer
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneDtmfWaitCharTimer();
+        
+        /**
+        * This function is called after timeout.
+        */
+        void HandleTimeOutL();
+
+        /**
+        * Two-phased constructor.
+        * @param aStateMachine - pointer to our state machine.
+        */
+        static CPhoneDtmfWaitCharTimer* NewL( MPhoneStateMachine* aStateMachine );
+        
+        /**
+        * This method should be called when DTMF wait note is
+        * displayed and CBA is pressed for transmitting the rest
+        * of the remaining DTMF string.
+        * Calling this method triggers our internal timer so that
+        * we get enough run time at the view's end to get our
+        * method calls end properly. Otherwise we will fall into
+        * recursive calls with multiple wait characters in a DTMF
+        * string and that causes telephony application to crash.
+        *
+        * This is a dirty hack I know. If you come up with a better
+        * solution you are more than welcome to change this.
+        * To test this works make a single call and send 'www456ppp'
+        * DTMF string. If it doesn't crash in the target HW it works :)
+        */
+        void ButtonPressedL();
+        
+
+    private:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * C++ default constructor.
+        * @param aStateMachine - pointer to our state machine.
+        */
+        CPhoneDtmfWaitCharTimer( MPhoneStateMachine* aStateMachine );
+                        
+        
+    private:
+    
+        /**
+        * Our internal timer
+        */
+        CPhoneTimer* iTimer;
+        
+        /**
+        * Pointer to the state machine for sending
+        * EPEMessageContinueDTMFSending message.
+        */
+        MPhoneStateMachine* iStateMachine;
+                
+    };
+    
+#endif // CPHONEDTMFWAITCHARTIMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphoneenginehandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Class for handling messages from Engine and from all inputs to the
+*     states.
+*
+*/
+
+
+#ifndef __CPHONEENGINEHANDLER_H
+#define __CPHONEENGINEHANDLER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <pevirtualengine.h>
+
+#include "mphonestatemachine.h"
+
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+
+// CLASS DECLARATION
+
+/**
+* Class for handling messages from Engine and from all inputs to the states
+*/
+class CPhoneEngineHandler : public CBase
+    {
+    public: 
+
+        /**
+        * Two-phased constructor
+        * @param aStateMachine: reference to Phone UI state machine
+        * @return an instance of class CPhoneEngineHandler
+        */
+        static CPhoneEngineHandler* NewL(
+            MPhoneStateMachine* aStateMachine );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneEngineHandler(){};
+        
+        /**
+        * Handles message from Phone Engine.
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        void DoHandleMessageL( 
+            const TInt aMessage, 
+            TInt aCallId );       
+
+    private:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneEngineHandler( MPhoneStateMachine* aStateMachine );
+
+    private: // Data   
+
+        /**
+        * Handle to State machine
+        */
+        MPhoneStateMachine* iStateMachine;
+
+    };
+
+#endif      // __CPHONEENGINEHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonekeyeventforwarder.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  It is keyevent forwarder.
+*
+*/
+
+
+#ifndef CPHONEKEYEVENTFORWARDER_H
+#define CPHONEKEYEVENTFORWARDER_H
+
+// INCLUDES
+#include    <bldvariant.hrh> //Feature flags
+#include    <coecntrl.h>
+ 
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+class MPhoneKeyEventHandler;
+class MPhoneViewCommandHandle;
+class CPhoneTimer;
+
+// CLASS DECLARATION
+
+/**
+*  It is keyevent forwarder.
+*
+*/
+class CPhoneKeyEventForwarder 
+    : public CCoeControl 
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aRect rectangle of this control.
+        * @param aStateMachine state machine
+        * @param aViewCommandHandle View command handle
+        * @return new instance.
+        */
+        static CPhoneKeyEventForwarder* NewL( const TRect& aRect, 
+                MPhoneStateMachine* aStateMachine,
+                MPhoneViewCommandHandle* aViewCommandHandle  );
+        
+        /**
+        * Destructor.
+        */
+        ~CPhoneKeyEventForwarder();     
+
+    public: // New functions.
+       
+    public: // Functions from base classes
+ 
+        /**
+        * From CCoeControl, returns the amount of component controls.
+        *
+        * @return Returns the amount of component controls.
+        */
+        TInt CountComponentControls() const;              
+        
+        /**
+        * From CCoeControl, returns a control by index.
+        *    
+        * @param aIndex It is the index of the control. 
+        * @return Returns a control by index.
+        */
+        CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CCoeControl, informs that the size is changed to update 
+        * the sizes of component controls appropriately.
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl, draws the contents of the view.
+        *
+        * @param aRect It is the area to be redrawn.
+        */
+        void Draw( const TRect& aRect ) const;
+    
+        /**
+        * From CCoeControl, offers a key event to the view. 
+        *
+        * @param aKeyEvent It contains information about the key event.
+        * @param aType It is the type of the event.
+        * @return Returns information which indicates whether the keypress
+        *         was processed or not.
+        */
+        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+        
+        /**
+        * This function should be called from AppUi, after framework has
+        * Looped through CCoeControlStack
+        *
+        * @param aKeyEvent It contains information about the key event.
+        * @param aType It is the type of the event.
+        * @return Returns information which indicates whether the keypress
+        *         was processed or not.
+        */
+        TKeyResponse OfferKeyEventAfterControlStackL( 
+                const TKeyEvent& aKeyEvent,
+                TEventCode aType );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneKeyEventForwarder( MPhoneStateMachine* aStateMachine,
+                MPhoneViewCommandHandle* aViewCommandHandle  );
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL( const TRect& aRect );
+
+        /**
+        * This function should be called before FEP or other components in 
+        * CCoeControl stack
+        *
+        * @param aKeyEvent It contains information about the key event.
+        * @param aType It is the type of the event.
+        * @return Returns information which indicates whether the keypress
+        *         was processed or not.
+        */
+        TKeyResponse OfferKeyEventBeforeControlStackL( 
+                const TKeyEvent& aKeyEvent,
+                TEventCode aType );
+        
+        /** 
+        * Handle EEventKeyDown
+        * @param aKeyEvent     Tells which key was pressed.
+        * @return              tells whether the event was consumed or not.
+        */
+        TKeyResponse HandleEventKeyDownBeforeControlStackL( const TKeyEvent& aKeyEvent );
+        
+        /** 
+        * Handle EEventKey
+        * @param aKeyEvent     Tells which key was pressed.
+        * @return              tells whether the event was consumed or not.
+        */
+        TKeyResponse HandleEventKeyBeforeControlStackL( const TKeyEvent& aKeyEvent );
+        
+        /** 
+        * Handle EEventKeyUp
+        * @param aKeyEvent     Tells which key was pressed.
+        * @return              tells whether the event was consumed or not.
+        */
+        TKeyResponse HandleEventKeyUpBeforeControlStackL( const TKeyEvent& aKeyEvent );
+
+      
+        /**
+        * Callback function for long press of a particular key
+        */
+        static TInt DoHandleLongPressKeyEventCallbackL( TAny* aAny );
+        
+        /**
+        * Convert key code
+        */   
+        void ConvertKeyCode( TUint& aCode, const TKeyEvent& aKeyEvent ); 
+
+        /**
+        * Handle key long press
+        */
+        void HandleLongPressKeyEventL();
+        
+        /**
+         * Checks from the statemachine is the given keyevent 
+         * from one of the allowed characters
+         */
+        TBool IsAlphaNumericKey( const TKeyEvent& aKeyEvent );
+                
+        /**
+         * Checks is the given key special character (*, 0, # ) from half-qwerty
+         * keyboard and conver key code if needed.
+         */
+        TBool ConvertHalfQwertySpecialChar( TUint& aCode, const TKeyEvent& aKeyEvent );
+        
+        /**
+         * Checks if key should be blocked from phone.
+         * 
+         * @ return ETrue if alpha mode, EFalse otherwise.
+         */
+        TBool IsKeyBlocked( const TKeyEvent& aKeyEvent ) const;
+
+    private:    // Data
+        
+        /**
+        * State machine
+        */
+        MPhoneStateMachine* iStateMachine;
+        
+        /**
+         * Interface to view command handle
+         */
+        MPhoneViewCommandHandle* iViewCommandHandle;
+        
+        /**
+         * For long key press. Long press is handled within a 
+         * specific duration.
+         */
+        CPhoneTimer* iLongPressKeyEventTimer; 
+
+        /**
+         * Key press time
+         */
+        TTime iKeyPressTime;
+
+        /**
+         * Key code
+         */
+        TUint iKeyPressedDown;
+        
+        /**
+         * Key scan code from EEventKey Updated in HandleEventKeyDownL. 
+         * Zeroed in HandleEventKeyUpL.
+         */
+        TInt iScanCode;
+    };
+
+#endif      // CPHONEKEYEVENTFORWARDER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonenumberentrymanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,220 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Manager number entry for state
+*
+*/
+
+
+#ifndef CPONENUMBERENTRYMANAGER_H
+#define CPONENUMBERENTRYMANAGER_H
+
+//INCLUDES
+#include <e32base.h>
+
+#include "cphonestate.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamkeyevent.h"
+
+class CPhoneCbaManager;
+class MPhoneViewCommandHandle;
+class MPhoneStateMachine;
+class MPhoneCustomization;
+class CPhoneState;
+class CEikonEnv;
+
+/**
+ * Class contains helper functions for NE content
+ *
+ * @lib phoneuicontrol
+ * @since S60 v9.1
+ */
+NONSHARABLE_CLASS( CPhoneNumberEntryManager ) :  public CBase
+                                             
+    {
+    public:
+        
+        /**
+        * Creates new instance of CPhoneNumberEntryManager
+        * @param aState: Handle to cphonestate.
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: Handle to the PhoneUIView.
+        * @param aCustomization: Handle to customization.
+        * @param aCbaManager: Handle to cphonecbamanager.
+        * @return CPhoneNumberEntryManager* object  
+        */
+        static CPhoneNumberEntryManager* CPhoneNumberEntryManager::NewL(
+                    CPhoneState* aState,
+                    MPhoneViewCommandHandle& aViewCommandHandle,
+                    MPhoneStateMachine& aStateMachine,
+                    MPhoneCustomization* aCustomization,
+                    CPhoneCbaManager& aCbaManager );
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneNumberEntryManager();    
+        
+    public:
+
+        /**
+        * Stores the number entry content to the cache
+        */
+        void StoreNumberEntryContentL();
+        
+        /**
+        * Restores the number entry content from the cache 
+        */        
+        void RestoreNumberEntryContentL();
+
+        /**
+        * Check if number entry content is stored
+        * @param None
+        * @return boolean value indicating that number entry content is stored
+        */
+        TBool IsNumberEntryContentStored();
+        
+        /**
+        * Clears the number entry content cache
+        */        
+        void ClearNumberEntryContentCache();
+        
+        /**
+        * Creates number entry
+        */ 
+        void CreateNumberEntryL();
+        
+        /**
+        * Set Number Entry visibility.
+        * @param aVisible ETrue if numberentry is wanted to be shown
+        *                 (Note ETrue will set NE CBA's)
+        *                 EFalse if numberentry isnt wanted to be shown
+        *                 (Note EFalse doesnt affect to CBA's)
+        */
+        void SetNumberEntryVisibilityL( TPhoneCmdParamBoolean aVisible );
+        
+        /**
+        * Passes create number entry command forward if NE can be created.
+        */
+        void HandleCreateNumberEntryL();
+        
+        /**
+        * Check if number entry is used
+        * @return boolean value indicating that number entry is used
+        */
+        TBool IsNumberEntryUsedL() const;
+        
+        /**
+        * Check if number entry is visible
+        * @return boolean value indicating that number entry is visible
+        */
+        TBool IsNumberEntryVisibleL() const;
+        
+        /**
+         * Returns phone number from the phone number entry.
+         * @return  Phone number
+         */
+        HBufC* PhoneNumberFromEntryLC() const;
+        
+        /**
+        * Informs phoneengine that phone number has been edited i.e. phonenumber parser is run
+        */
+        void HandleNumberEntryEdited();
+        
+        /**
+        * Handles key events in situations when there exists a number entry.
+        * In this case number entry may be visible or hidden.
+        * @param aKeyEvent - key event
+        * @param aEventCode - event code
+        */
+        void KeyEventForExistingNumberEntryL(
+                const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+        
+        /**
+        * Returns ETrue if alphanumeric characters are supported.
+        * @param aKeyEvent Key event.
+        * @return ETrue if alphanumeric chars are supported.
+        */
+        TBool IsAlphanumericSupportedAndCharInput(
+                const TKeyEvent& aKeyEvent ) const;
+        
+        /**
+        * Handle state-specific behaviour when number entry is cleared
+        */
+        void HandleNumberEntryClearedL();
+        
+        /**
+         * Internal number entry handling methods.
+         */
+        void NumberEntryClearL() const;
+         
+        /**
+         * Returns ETrue if NumberEntry is in numeric mode.
+         */
+        TBool NumberEntryInNumericModeL();
+        
+        /**
+         * Toggles alpha numeric mode.
+         */
+        TBool NumberEntryToggleAlphaNumericModeL();
+        
+    private:
+        
+        /**
+        * Checks is given key contains numeric charaters or if customization is used
+        * alphanumeir letters
+        */
+        TBool IsValidAlphaNumericKey( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+    
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CPhoneNumberEntryManager(
+                CPhoneState* aState,
+                MPhoneViewCommandHandle& aViewCommandHandle,
+                MPhoneStateMachine& aStateMachine,
+                MPhoneCustomization* aCustomization,
+                CPhoneCbaManager& aCbaManager );
+        
+        /**
+        * Symbian constructor
+        */
+        void ConstructL();
+        
+    private:
+        
+        CPhoneState* iState;
+        MPhoneViewCommandHandle& iViewCommandHandle;
+        MPhoneStateMachine& iStateMachine;
+        MPhoneCustomization* iCustomization;
+        CPhoneCbaManager& iCbaManager;
+        
+                
+        /**
+        * Cache for the number entry content
+        */
+        HBufC* iNumberEntryContent;
+        
+        /**
+        * Internal variable for EikonEnv to avoid
+        * use of static system calls
+        */
+        CEikonEnv& iEnv;
+
+    };
+
+
+#endif // CPONENUMBERENTRYMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonereconnectquery.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*     Singleton class for implementing reconnect query.
+*
+*/
+
+
+#ifndef CPHONERECONNECTQUERY_H
+#define CPHONERECONNECTQUERY_H
+
+// INCLUDES
+#include <mcauireconnectqueryobserver.h>
+#include <coemain.h>
+#include "mphonetimer.h"
+
+// FORWARD DECLARATIONS
+class CPhoneTimer;
+
+// CLASS DECLARATION
+
+class CPhoneReconnectQuery : public CCoeStatic, public MPhoneTimer,
+    public MCaUiReconnectQueryObserver
+    {
+    public:
+
+        /**
+         * Returns an instance of this class. When called for the first
+         * time, a new instance is created and returned.  After that,
+         * calling InstanceL returns the same instance that was created
+         * earlier.
+         *
+         * @return A pointer to a CPhoneReconnectQuery object
+         */
+        IMPORT_C static CPhoneReconnectQuery* InstanceL();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneReconnectQuery();
+
+        /**
+        * This function is called after on timeout.
+        */
+        void HandleTimeOutL();
+
+        /**
+        * Called when MCaUiReconnectQueryObserver has got a key press.
+        *
+        * @param aReconType The reconnect choice of the user.
+        */
+        virtual void OptionSelected( MCaUiReconnectQueryObserver::TCaUiReconType aOption );
+
+        /**
+        * Shows reconnect query.
+        * External DLL is loaded and request is delegated to
+        * the dll.
+        * @param aShowVideo - ETrue to show video option, otherwise EFalse
+        */
+        IMPORT_C void ShowReconnectQueryL( TBool aShowVideo );
+
+        /**
+        * Cancels reconnect query timer.
+        */
+        void CancelReconnectQueryTimer();
+
+        /**
+        * Fetches the information is reconnect query displayed on the
+        * screen or not.
+        * @return ETrue if being displayed otherwise EFalse.
+        */
+        TBool IsDisplayingQuery();
+
+
+    private:
+
+        /**
+         * Default constructor is private because we are using the
+         * singleton design pattern.
+         */
+        CPhoneReconnectQuery();
+
+        /**
+        * Shows number entry and sets number entry CBAs.
+        */
+        void ShowNumberEntryL();
+
+
+    private:
+
+        /**
+        * This timer delays reconnect query to give time to information note
+        */
+        CPhoneTimer* iReconQueryTimer;
+
+        /**
+        * If video call option is needed in reconnect query this is true
+        * otherwise false.
+        */
+        TBool iIncludeVideo;
+
+        /**
+        * ETrue if reconnect query is currently displayed on the screen.
+        * EFalse if not.
+        */
+        TBool iDisplayingQuery;
+
+    };
+
+#endif // CPHONERECONNECTQUERY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphoneremotecontrolhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Class for handling messages from Engine and from all inputs to the
+*     states.
+*
+*/
+
+
+#ifndef __CPHONEREMOTECONTROLHANDLER_H
+#define __CPHONEREMOTECONTROLHANDLER_H
+
+// INCLUDES
+#include <remconcoreapitargetobserver.h>
+#include <e32base.h>
+#include "mphonestatemachine.h"
+
+
+// FORWARD DECLARATIONS
+class CRemConInterfaceSelector;  
+class CRemConCoreApiTarget;
+class MPhoneStateMachine;
+class CPhoneHandler;
+
+// CLASS DECLARATION
+
+/**
+* Class for handling messages from Engine and from all inputs to the states
+*/
+class CPhoneRemoteControlHandler : 
+    public CBase,
+    public MRemConCoreApiTargetObserver
+    {
+    public: 
+
+        /**
+        * Two-phased constructor
+        * @param aStateMachine: reference to Phone UI state machine
+        * @return an instance of class CPhoneRemoteControlHandler
+        */
+        static CPhoneRemoteControlHandler* NewL(
+            MPhoneStateMachine* aStateMachine );
+        /*
+        * Destructor.
+        */
+        virtual ~CPhoneRemoteControlHandler();
+        
+    protected:
+
+        /**
+        * @see MRemConCoreApiTargetObserver.
+        *
+        * A command has been received. 
+        * @param aOperationId The operation ID of the command.
+        * @param aButtonAct The button action associated with the command.
+        */
+        void MrccatoCommand( 
+            TRemConCoreApiOperationId aOperationId, 
+            TRemConCoreApiButtonAction aButtonAct);
+        
+    private:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneRemoteControlHandler( MPhoneStateMachine* aStateMachine );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+
+        /**
+        * Catch button timer event. Current remote operation is repeated
+        * @param aAny
+        */
+        static TInt DoHandleButtonRepeat( TAny* aAny );
+        
+    private: // Data  
+        
+        /** Remote Controller */
+        CRemConInterfaceSelector* iInterfaceSelector;  
+        
+        /** Remote Controller */
+        CRemConCoreApiTarget* iCoreTarget;
+
+        /** Current Remote Controller operation */
+        TRemConCoreApiOperationId iOperationId;
+        
+        /** Current Remote Controller button act */
+        TRemConCoreApiButtonAction iButtonAct;
+
+        /** Button repeat timer */
+        CPeriodic* iButtonRepeatTimer;
+        
+        /**
+        * Handle to State machine
+        */
+        MPhoneStateMachine* iStateMachine;
+        
+        /** Phone Handler */
+        CPhoneHandler*  iPhoneHandler;
+
+    };
+
+#endif      // __CPhoneRemoteControlHandler_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestate.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1192 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*     A base class for an object implementing the state.
+*
+*/
+
+
+#ifndef CPHONESTATE_H
+#define CPHONESTATE_H
+
+// INCLUDES
+#include <w32std.h>
+#include <remconcoreapitargetobserver.h>
+#include <MProfileEngine.h>
+#include "mphonestate.h"
+#include "mphoneviewcommandhandle.h"
+#include "cphonecbamanager.h"
+
+// FORWARD DECLARATIONS
+class MPhoneState;
+class MPhoneStateMachine;
+class CPhoneCallHeaderManager;
+class CPhoneTimer;
+class TPhoneCmdParamCallHeaderData;
+class MPhoneCustomization;
+class CPhoneNumberEntryManager;
+
+enum TStateTransEffectType
+    {
+    ENoneType,
+    ENumberEntryOpen,
+    ENumberEntryClose,
+    ENumberEntryCreate
+    };
+
+// CLASS DECLARATION
+
+/**
+*  An abstract class for an object implementing the state.
+*
+*/
+class CPhoneState :
+    public CBase,
+    public MPhoneState
+    {
+    public:
+
+        /**
+        * Constructor
+        */
+        IMPORT_C CPhoneState(
+            MPhoneStateMachine* aStateMachine,
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aCustomization);
+
+        /**
+        * Creates CbaManager instance.
+        */
+        IMPORT_C void BaseConstructL();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneState();
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage,
+            TInt aCallId );
+
+        /**
+        * HandleError
+        * Implements error handling framework
+        * @param aErrorInfo: the error info
+        */
+        IMPORT_C virtual void HandleErrorL(
+            const TPEErrorInfo& aErrorInfo );
+
+        /**
+        * Handle processed (short, long) key messages from the key event
+        * handler
+        * @param aMessage a key message
+        * @param aCode key event code
+        */
+        IMPORT_C virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * Handles raw key events from the key event handler
+        * @param aKeyEvent a key event
+        * @param aEventCode key event code
+        */
+        IMPORT_C virtual void HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        /**
+        * Handles key press duration events from the key event handler
+        * @param aCode key event code
+        * @param aKeyPressDuration key press duration
+        */
+        IMPORT_C virtual void HandleKeyPressDurationL(
+            TKeyCode aCode,
+            TTimeIntervalMicroSeconds aKeyPressDuration );
+
+        /**
+        * From CAknAppUi, initialise a menupane (dynamic).
+        *
+        * @param aResourceId It is the resource id for the pane.
+        * @param aMenuPane It is the menu pane corresponding to the resource.
+        */
+        IMPORT_C virtual void DynInitMenuPaneL(
+            TInt aResourceId,
+            CEikMenuPane* aMenuPane );
+
+        /**
+        * From CAknAppUi, initialise a menubar (dynamic).
+        *
+        * @param aResourceId It is the resource id for the bar.
+        * @param aMenuBar It is the menu bar corresponding to the resource.
+        */
+        IMPORT_C virtual void DynInitMenuBarL(
+            TInt aResourceId,
+            CEikMenuBar* aMenuBar );
+
+        /**
+        * From CEikAppUi. For Idle indicator
+        */
+        IMPORT_C virtual void HandleSystemEventL(
+            const TWsEvent& aEvent );
+
+        /**
+        * From CAknAppUi, indicates when app ui is on the foreground.
+        * @param aForeground It is true if app is on the foreground.
+        */
+        IMPORT_C virtual void HandleForegroundEventL( TBool aForeground );
+
+        /**
+        * Indicates when the Phone app is in the foreground.
+        */
+        IMPORT_C virtual void HandlePhoneForegroundEventL();
+
+        /**
+        * Indicates when the Phone app is losing focus.
+        */
+        IMPORT_C virtual void HandlePhoneFocusLostEventL();
+
+        /**
+        * Indicates when the Idle app is in the foreground.
+        */
+        IMPORT_C virtual void HandleIdleForegroundEventL();
+
+        /**
+        * Indicates when the keylock events
+        */
+        IMPORT_C virtual void HandleKeyLockEnabled( TBool aKeylockEnabled );
+        
+        /**
+        * Handle environment changes.
+        * @param aChanges environment changes which may be reported by
+        *  a change notifier through the RChangeNotifier interface.
+        */
+        IMPORT_C void HandleEnvironmentChangeL( const TInt aChanges );
+
+        /**
+        * Handles startup of the phone application
+        */
+        IMPORT_C virtual void HandlePhoneStartupL();
+
+        /**
+        * This function is called when there is property value change.
+        * @param aCategory Category of the property
+        * @param aKey Property key that is changed
+        * @param aValue New property value
+        */
+        IMPORT_C virtual void HandlePropertyChangedL(
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue );
+
+        /**
+        * Handle the change of the setting from Central Repository
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        */
+        IMPORT_C virtual void HandleCenRepChangeL(
+            const TUid& aUid,
+            const TUint aId );
+
+        /**
+        * Handles commands.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state
+        *          (ETrue) or not (EFalse)
+        */
+        IMPORT_C virtual TBool HandleCommandL( TInt aCommand );
+
+        /**
+        * Processes command.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state
+        *          (ETrue) or not (EFalse)
+        */
+        IMPORT_C virtual TBool ProcessCommandL( TInt aCommand );
+
+        /**
+        * Handles commands from the Remote Control framework.
+        * @param aOperationId The operation ID of the command.
+        * @param aButtonAct The button action associated with the command.
+        * @return ETrue if the event was handled, EFalse otherwise.
+        */
+        IMPORT_C virtual TBool HandleRemConCommandL(
+            TRemConCoreApiOperationId aOperationId,
+            TRemConCoreApiButtonAction aButtonAct);
+
+        /**
+        * Setter for divert indication showing in bubble.
+        * @param aDivertIndication ETrue to show divert indication,
+        *          EFalse to not. Usually setting EFalse isn't necessary
+        *         as it's a default value in bubble creation.
+        */
+        IMPORT_C virtual void SetDivertIndication(
+            const TBool aDivertIndication );
+
+        /**
+        * Handles Long hash key press
+        */
+        IMPORT_C void HandleLongHashL();
+
+        /**
+        * Informs view to start Transition effect
+        * @param aType a transition effect, default none
+        * EndTransEffect() must be called when update is done.
+        */
+        IMPORT_C void BeginTransEffectLC( TStateTransEffectType aType = ENoneType );
+
+        /**
+        * Informs view to complete Transition effect
+        */
+        IMPORT_C void EndTransEffect();
+
+        /**
+        * Checks whether customized dialer view is active,
+        * @return ETrue if customized dialer is active
+        */
+        IMPORT_C TBool IsCustomizedDialerVisibleL() const;
+
+        /**
+        * Closes customized dialer view
+        */
+        IMPORT_C void CloseCustomizedDialerL();
+
+        /**
+         * Plays DTMF tone for key event
+         * */
+        IMPORT_C void HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+
+        /**
+        * Show global InfoNote
+        * @param aResourceId resource id to be resolved
+        */
+        IMPORT_C void SendGlobalInfoNoteL( TInt aResourceId );
+
+        /**
+        * Show global ErrorNote
+        * @param aResourceId resource id to be resolved
+        */
+        IMPORT_C void SendGlobalErrorNoteL( TInt aResourceId );
+
+        /**
+         * Get blocked key list
+         * @returns RArray<TInt>& lsit of blocked keys 
+         */
+        IMPORT_C const RArray<TInt>& GetBlockedKeyList() const;
+
+        /**
+         * Disable HW Keys if needed
+         */
+        IMPORT_C void DisableHWKeysL();
+
+        /**
+         * Disable Call UI
+         */
+        IMPORT_C void DisableCallUIL();
+
+        /**
+         * Enable Call UI
+         */
+        IMPORT_C void EnableCallUIL();
+
+        /**
+         * Disable HW Keys and Call UI if needed
+         */
+        IMPORT_C void CheckDisableHWKeysAndCallUIL();
+
+        /**
+         * Handle hold switch key event when there is an incoming or waiting call
+         */
+        IMPORT_C void HandleHoldSwitchL();
+        
+        /**
+         * Enable HW Keys and Call UI if needed
+         */
+        IMPORT_C void CheckEnableHWKeysAndCallUIL();
+        
+        /**
+        * Fetches autolock information - is it set on or not
+        * @return is autolock set on (ETrue) or off (EFalse)
+        */
+        IMPORT_C TBool IsAutoLockOn() const;
+
+        /**
+        * Return is sim state ok
+        * @return ETrue if is sim ok, otherwise EFalse
+        **/
+        IMPORT_C TBool IsSimOk();
+
+        /**
+        * Checks Svivel state.
+        * @return ETrue if swivel is closed.
+        */
+        IMPORT_C TBool IsSwivelClosed() const;
+
+        /**
+        * Check if note, query or blockingDialog is visible
+        * @return boolean value indicating that note, query or
+        * blocking dialog is visible
+        */
+        IMPORT_C TBool IsAnyQueryActiveL();
+
+        /**
+        * Check if menu bar is visible
+        * @return boolean value indicating that menu bar is visible
+        */
+        IMPORT_C TBool IsMenuBarVisibleL() const;
+
+        /**
+         * Sets context menu to correspond the incall options menu
+         *
+         */
+        IMPORT_C virtual void UpdateInCallContextMenuL();
+
+        /*
+        * If KFeatureIdFfSimlessOfflineSupport is undefined and
+        * UI shows note which will be closed by key event then
+        * method return ETrue otherwise EFalse.
+        */
+        TBool IsNoteDismissableL();
+
+        IMPORT_C void RetainPreviousKeylockStateL();
+        
+    public: // NumberEntry functions.
+
+        /**
+        * Passes create number entry command forward if NE can be created.
+        */
+        IMPORT_C virtual void HandleCreateNumberEntryL(
+                const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+        /**
+        * Check if number entry is used
+        * @return boolean value indicating that number entry is used
+        */
+        IMPORT_C virtual TBool IsNumberEntryUsedL();
+
+        /**
+        * Check if number entry is visible
+        * @return boolean value indicating that number entry is visible
+        */
+        IMPORT_C TBool IsNumberEntryVisibleL();
+
+    protected:
+
+        /**
+        * Handle EPEMessageAudioMuteChanged
+        */
+        IMPORT_C void HandleAudioMuteChangedL();
+
+        /**
+        * Handle EPEMessageAudioOutputChanged
+        */
+        IMPORT_C void HandleAudioOutputChangedL();
+
+        /**
+        * Handle SideVolumeKeyInc
+        */
+        IMPORT_C void IncreaseAudioVolumeL();
+
+        /**
+        * Handle SideVolumeKeyDec
+        */
+        IMPORT_C void DecreaseAudioVolumeL();
+
+        /**
+        * Dial CS multimedia call
+        */
+        IMPORT_C void DialMultimediaCallL();
+
+        /**
+        * Dial CS voice call
+        */
+        IMPORT_C void DialVoiceCallL();
+
+        /**
+        * Disconnect call
+        */
+        IMPORT_C TBool DisconnectCallL();
+
+        /**
+        * Display idle screen
+        */
+        IMPORT_C void DisplayIdleScreenL();
+
+        /**
+        * Set up the Idle screen in the background for the cases
+        * where the phone is no longer the top application (eg. end
+        * call when an external app is being displayed)
+        */
+        IMPORT_C void SetupIdleScreenInBackgroundL();
+
+        /**
+        * Display call header for call coming in ( the remote info data
+        * and picture is displayed immediately )
+        * @param aCallid call id
+        * @param aWaitingCall waiting call indication
+        */
+        IMPORT_C void DisplayHeaderForCallComingInL(
+            TInt aCallId,
+            TInt aWaitingCall );
+
+        /**
+        * Sets call header texts for call coming in
+        * @param aCallid call id
+        * @param aWaitingCall waiting call indication
+        * @param aCallHeaderData - Call header parameter into which the text
+        *                          will be set.
+        */
+        IMPORT_C void SetCallHeaderTextsForCallComingInL(
+            TInt aCallId,
+            TBool aWaitingCall,
+            TPhoneCmdParamCallHeaderData* aCallHeaderData );
+
+        /**
+        * Display call header for outgoing call (the phone number is initially
+        * displayed)
+        * @param aCallid call id
+        */
+        IMPORT_C void DisplayHeaderForOutgoingCallL( TInt aCallId );
+
+        /**
+        * Update Single Active Call
+        * @param aCallid call id
+        */
+        IMPORT_C void UpdateSingleActiveCallL( TInt aCallId );
+
+        /**
+        * Update remote information data in the call header
+        * @param aCallid call id
+        */
+        IMPORT_C void UpdateRemoteInfoDataL( TInt aCallId );
+
+        /**
+        * Return remote info data
+        * @param aCallid call id
+        * @param aData the returned remote info data
+        */
+        IMPORT_C void GetRemoteInfoDataL( TInt aCallId, TDes& aData );
+
+        /**
+         * Sets context menu
+         *
+         * @param aResourceId   resource
+         */
+        IMPORT_C virtual void SetContextMenuL( TInt aResourceId );
+
+        /**
+         * Sets context menu to correspond the incoming options menu
+         *
+         * @param aCallId   incoming call id
+         */
+        IMPORT_C virtual void UpdateIncomingContextMenuL( TInt aCallId );
+
+
+        /**
+        * Show note
+        * @param aResourceId resource id to be resolved
+        */
+        IMPORT_C void ShowNoteL( TInt aResourceId );
+
+        /**
+        * Show query
+        * @param aResourceId resource id to be resolved
+        */
+        IMPORT_C void ShowQueryL( TInt aResourceId );
+
+        /**
+        * Show text query
+        * @param aDialogResourceId dialog's resource id
+        * @param aDefaultCbaResourceId default CBA's resource id
+        * @param aContentCbaResourceId content CBA's resource id
+        * @param aDataText pointer to data text
+        * @param aSendKeyEnabled send key enabled status for the query
+        */
+        IMPORT_C void ShowTextQueryL(
+            TInt aDialogResourceId,
+            TInt aDefaultCbaResourceId,
+            TInt aContentCbaResourceId,
+            TDes* aDataText,
+            TBool aSendKeyEnabled = EFalse );
+
+        /**
+        * Check if note is visible
+        * @return boolean value indicating that note is visible
+        */
+        IMPORT_C TBool IsNoteVisibleL();
+
+        /**
+        * Handle numeric key event
+        */
+        IMPORT_C virtual void HandleNumericKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        /**
+        * Check if the application needs to be sent to the background
+        * @return boolean value indicating that application needs to be
+        *  sent to the background
+        */
+        IMPORT_C TBool NeedToSendToBackgroundL() const;
+
+        /**
+        * Check if the top application is currently displayed in the foreground
+        * @return boolean value indicating that top app is displayed
+        */
+        IMPORT_C TBool TopAppIsDisplayedL() const;
+
+        /**
+        * Capture keys during call notifications (dialing, incoming, waiting)
+        * @param aCaptured ETrue if keys are to be captured
+        */
+        IMPORT_C void CaptureKeysDuringCallNotificationL( TBool aCaptured );
+
+        /**
+        * Displays the call termination note, if required
+        */
+        IMPORT_C void DisplayCallTerminationNoteL();
+
+        /**
+        * Set the handsfree mode
+        * @param aHandsfreeMode ETrue to activate IHF, EFalse to deactivate
+        */
+        IMPORT_C void SetHandsfreeModeL( TBool aHandsfreeMode );
+
+        /**
+        * Set the BT handsfree mode
+        * @param aHandsfreeMode ETrue to activate BT, EFalse to deactivate
+        */
+        IMPORT_C void SetBTHandsfreeModeL( TBool aHandsfreeMode );
+
+         /**
+        * Show global WarningNote
+        * @param aResourceId resource id to be resolved
+        */
+        IMPORT_C void SendGlobalWarningNoteL( TInt aResourceId );
+
+        /**
+        * Checks is the call id a video call.
+        * @param aCallId - call id to be checked
+        * @return ETrue if video call id, otherwise EFalse
+        */
+        IMPORT_C TBool IsVideoCall( const TInt aCallId );
+
+        /**
+        * Return SimState.
+        */
+        IMPORT_C TPESimState SimState() const;
+
+        /**
+        * Starts ALS line change timer.
+        * This should be called after receiving long keypress
+        * which is 0.8 seconds. ALS line change timer ticks
+        * 2.2 seconds before callback is called.
+        */
+        IMPORT_C void StartAlsLineChangeTimerL();
+
+        /**
+        * Start show security note
+        * This should be called in startup and idle state
+        * if sim state not ok
+        */
+        IMPORT_C void StartShowSecurityNoteL();
+
+        /**
+        * Check if the sim card state is EPESimNotPresent with
+        * the security mode is enabled.
+        * @return ETrue if the sim card state is EPESimNotPresent and
+        * the security mode is enabled, otherwise EFalse
+        **/
+        IMPORT_C TBool IsSimStateNotPresentWithSecurityModeEnabled();
+
+        /**
+        * Handle audio output availability change
+        */
+        void HandleAudioAvailableOutputChangedL();
+
+        /**
+        * Shows 'Number busy' note.
+        */
+        IMPORT_C void ShowNumberBusyNoteL();
+
+        /**
+        * Fetches keylock information - is it set on or not
+        * @return is keylock set on (ETrue) or off (EFalse)
+        */
+        IMPORT_C TBool IsKeyLockOn() const;
+
+        /**
+        * Informs Phone Engine Sat request completion
+        * @param aCallId a call id
+        */
+        IMPORT_C void CompleteSatRequestL( const TInt aCallId );
+
+        /**
+        * Sets the call header type used in the call bubble.
+        */
+        IMPORT_C void SetCallHeaderType( TInt aCallHeaderType );
+
+        /**
+        * Handles situation when hash key has been kept down long
+        * (long keypress) and the hash character is the only character
+        * in number entry.
+        */
+        IMPORT_C virtual void OnlyHashInNumberEntryL();
+
+        /**
+        * Informs view that UI is being updated (call bubble or number editor).
+        * EndUiUpdate() must be called when update is done.
+        */
+        IMPORT_C void BeginUiUpdateLC();
+
+        /**
+        * Informs view that UI update is completed.
+        */
+        IMPORT_C void EndUiUpdate();
+
+        /*
+        * Checks if necessary to show call termination note
+        *
+        * @param aCallId call id
+        * @return true if note should be shown
+        */
+        IMPORT_C virtual TBool CheckIfShowCallTerminationNote( );
+
+        /*
+        * Sets used touchpane buttons.
+        *
+        * @param touchpane resource id.
+        */
+        IMPORT_C void SetTouchPaneButtons( TInt aResourceId );
+
+        /*
+        * Sets touchpane visibility.
+        *
+        * @param ETrue if visible otherwise EFalse.
+        */
+        IMPORT_C void SetTouchPaneVisible( TBool aVisible );
+
+        /*
+        * Destroys touchpane buttons.
+        */
+        IMPORT_C void DeleteTouchPaneButtons();
+
+        /*
+        * Enables touchpane button that holds given command id.
+        *
+        * @param aCommandId Command id.
+        */
+        IMPORT_C void SetTouchPaneButtonEnabled( TInt aCommandId );
+
+        /*
+        * Disables touchpane button that holds given command id.
+        *
+        * @param aCommandId Command id.
+        */
+        IMPORT_C void SetTouchPaneButtonDisabled( TInt aCommandId );
+
+        /*
+        * Checks if DTMF editor is active,
+        * @return true is DTMF is active
+        */
+        IMPORT_C TBool IsDTMFEditorVisibleL() const;
+
+        /**
+        * Closes dtmf editor.
+        */
+        IMPORT_C void CloseDTMFEditorL();
+
+        /**
+        * Set default flags values.
+        * No active call
+        */
+        IMPORT_C void SetDefaultFlagsL();
+
+        /**
+        * Check if contact info available and
+        * shown waiting note with or without caller name
+        */
+        IMPORT_C void CallWaitingNoteL( TInt aCallId );
+
+        /*
+        * Sets ringtone playback.
+        * @param aCallId call id
+        */
+        IMPORT_C void SetRingingTonePlaybackL( TInt aCallId );
+
+        /**
+        * A message handling function for message EPEMessageDisconnecting
+        * @param aCallId: the call id of the call
+        */
+        IMPORT_C void HandleDisconnectingL( TInt aCallId );
+
+        /**
+        * Returns customized dialer menu resource id
+        */
+        IMPORT_C TInt CustomizedDialerMenuResourceIdL();
+
+        /**
+        * Returns customized dialer CBA resource id
+        */
+        IMPORT_C TInt CustomizedDialerCbaResourceIdL();
+        
+        /**
+        * Opens soft reject message editor.
+        */
+        IMPORT_C virtual void OpenSoftRejectMessageEditorL();
+
+    protected: // NumberEntry functions.
+
+        /**
+        * Set Number Entry visibility.
+        * @param aVisible ETrue if numberentry is wanted to be shown
+        *                 (Note ETrue will set NE CBA's)
+        *                 EFalse if numberentry isnt wanted to be shown
+        *                 (Note EFalse doesnt affact to CBA's)
+        */
+        IMPORT_C void SetNumberEntryVisibilityL( const TBool aVisible );
+
+        /**
+        * Create call if in numberentry more that 2 number and Send key
+        * Send manual control sequence
+        * if 1-2 number in numberentry and Send key
+        */
+        IMPORT_C void CallFromNumberEntryL();
+
+        /**
+         * Returns phone number from the phone number entry.
+         * @return  Phone number
+         */
+        IMPORT_C HBufC* PhoneNumberFromEntryLC();
+
+        /**
+        * Check if number entry content is stored
+        * @return boolean value indicating that number entry content is stored
+        */
+        IMPORT_C TBool IsNumberEntryContentStored();
+
+        /**
+        * Stores the number entry content to the cache
+        */
+        IMPORT_C void StoreNumberEntryContentL();
+
+        /**
+        * Restores the number entry content from the cache
+        */
+        IMPORT_C void RestoreNumberEntryContentL();
+
+        /**
+        * Clears the number entry content cache
+        */
+        IMPORT_C void ClearNumberEntryContentCache();
+
+        /**
+        * Restores number entry content after dtmf dialer
+        */
+        IMPORT_C void CheckIfRestoreNEContentAfterDtmfDialer();
+
+        /**
+         * Checks if on screen dialer feature is supported.
+         */
+        IMPORT_C TBool IsOnScreenDialerSupported() const;
+
+        /**
+        * Informs phoneengine that phone number has been edited i.e. phonenumber parser is run
+        */
+        IMPORT_C virtual  void HandleNumberEntryEdited();
+
+        /**
+         * Returns ETrue if alphanumeric characters are supported.
+         * @param aKeyEvent Key event.
+         * @return ETrue if alphanumeric chars are supported.
+         */
+         IMPORT_C TBool IsAlphanumericSupportedAndCharInput(
+                     const TKeyEvent& aKeyEvent );
+
+         /**
+         * Handle state-specific behaviour when number entry is cleared
+         */
+         IMPORT_C virtual void HandleNumberEntryClearedL();
+
+         /**
+         * Internal number entry handling methods.
+         */
+         void NumberEntryClearL();
+         
+          
+         /**
+         * Dims silence touch button if call is not alerting.
+         * @param None
+         */
+         IMPORT_C void UpdateSilenceButtonDimming();
+
+         /**
+         * Sets toolbar dimming.
+         * @param aDimmed ETrue if dimmed
+         */
+         IMPORT_C void SetToolbarDimming( TBool aDimmed );
+
+         /**
+         * Sets toolbar loudspeaker button enabled.
+         */
+         IMPORT_C void SetToolbarButtonLoudspeakerEnabled();
+         
+         /**
+         * Sets state of TitleBar Back button 
+         */
+         IMPORT_C void SetBackButtonActive( TBool aActive );
+
+    protected:
+
+       /**
+       * Returns updated remote information data.
+       * NOTE: This metohed is used when state receives
+       * EPEMessageRemotePartyInfoChanged from PhoneEngine.
+       * @param aCallId - Call Id.
+       */
+       TPhoneCmdParamCallHeaderData UpdateCallHeaderInfoL( TInt aCallId );
+
+       /**
+       * Checks if call is waiting, returns ETrue if call is waiting
+       * otherwise EFalse.
+       * @param aCallId, call id.
+       */
+       TBool IsWaitingCallL( const TInt aCallId );
+
+       /**
+       * Shows dtmf dialer
+       */
+       void ShowDtmfDialerL();
+
+       /**
+       * Checks status of KFeatureIdSideVolumeKeys and KTelephonyLVFlagScrollVolumeKeys
+       * keys. If KTelephonyLVFlagScrollVolumeKeys is false and KFeatureIdSideVolumeKeys is true
+       * then side volume keys are only supported and method returns true, otherwise false.
+       */
+       TBool OnlySideVolumeKeySupported();
+
+       /**
+       * Checks if device has connected call ongoing.
+       * List of connected call states: EPEStateConnected
+       *                                EPEStateConnectedConference
+       *                                EPEStateConnecting
+       */
+       TBool IsAnyConnectedCalls();
+
+    private:
+
+        /**
+        * Update incall indicator
+        * @param aCallState a call state
+        */
+        void UpdateIncallIndicatorL( TInt aCallState );
+
+        /**
+        * Handle EPEMessageChangedCallDuration
+        * @param aCallId call id of the message
+        */
+        void HandleChangedCallDurationL( TInt aCallId );
+
+        /**
+        * Update profile display
+        */
+        void UpdateProfileDisplayL();
+
+        /**
+        * Update operator display
+        */
+        void UpdateOperatorDisplayL();
+
+        /**
+        * Sends key down event to the phone engine
+        * @param aKeyEvent a key event
+        * @param aEventCode key event code
+        */
+        void SendKeyPressL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        /**
+        * Sends key events to the phone engine
+        * @param aKeyEvent a key event
+        * @param aEventCode key event code
+        */
+        void SendKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        /**
+        * ETrue if title pane is visible
+        */
+        TBool TitlePaneIsVisibleL() const;
+
+        /**
+        * Change Audio volume level
+        * @param aLevel New volume level.
+        * @param aUpdateControl Set ETrue if volume ui control
+        *                       needs to be updated.
+        */
+        void ChangeAudioVolumeL( TInt aLevel,
+                                 TBool aUpdateControl = ETrue );
+
+        /**
+        * Handles EPEMessageInitiatedEmergency call message from Phone Engine.
+        * @param aCallId - Caller id.
+        */
+        void HandleInitiatedEmergencyCallL( TInt aCallId );
+
+        /**
+         *  Handles EPEMessageInitiatedEmergencyWhileActiveVideo message from
+         * Phone Engine.
+         */
+        void HandleInitiatedEmergencyWhileActiveVideoL();
+
+        /**
+        * Shows IMEI note
+        */
+        void HandleShowImeiL();
+
+        /**
+        * Handles network ciphering info changes
+        */
+        void HandleCallSecureStatusChangeL( TInt aCallId );
+
+        /**
+        * Shows Life time note
+        */
+        void HandleShowLifeTimerL();
+
+        /**
+        * Handles change als line command
+        */
+        void ChangeAlsLineL();
+
+        /**
+        * Active call id
+        */
+        TInt GetActiveCallIdL();
+
+        /**
+        * Callback function for launching ALS line change dialog
+        * This is called when Als line change timer timeout is
+        * reached which means user has pushed the #-key long enough.
+        * @param aAny - not used
+        */
+        static TInt AlsLineChangeTimerCallbackL( TAny* aAny );
+
+        /**
+        * Shows WLAN MAC address note
+        */
+        void ShowWlanMacAddressL();
+
+        /**
+        * Check if ALS line change is possible
+        */
+        TBool IsAlsLineChangePossible();
+
+        /**
+        * A message handling function for message EPEMessageRemoteBusy
+        * @param aCallId a call id
+        */
+        void HandleRemoteBusyL( const TInt aCallId );
+
+        /**
+        * Creates caller information. Sets CNAP, phone number, thumbnail image
+        * etc. into the call header parameter.
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header parameter where modifications
+        *                          are made.
+        */
+        void CreateCallerInfoL( const TInt aCallId,
+            TPhoneCmdParamCallHeaderData* aCallHeaderData );
+
+        /**
+        * TCleanupOperation to call EndUiUpdate(), if leave occurs
+        * after BeginUiUpdate().
+        */
+        static void UiUpdateCleanup(TAny* aThis );
+
+        /**
+        * TCleanupOperation to call EndTransEffect, if leave occurs
+        * after BeginTransEffect().
+        */
+        static void EffectCleanup(TAny* aThis );
+
+        /**
+        * Gets volume level from ui control.
+        */
+        TInt GetVolumeLevel();
+
+        /**
+        * Shows video call specific out of memory note.
+        */
+        void ShowVideoCallOutOfMemoryNoteL();
+
+        /**
+        * Returns sim security status:
+        * Rejected or UnAccepted.
+        */
+        TInt SimSecurityStatus() const;
+
+        /**
+        * Show CUG in use note
+        */
+        void HandleCugInUseNoteL();
+
+        /**
+         * Handles changes in the SIM card state.
+         */
+        void HandleSimStateChangedL();
+
+        /**
+         * Checks if key events are allowed to be redirected for further handling
+         */
+        TBool IsKeyEventFurtherProcessedL( const TKeyEvent& aKeyEvent ) const;
+
+        /*
+         * Checks is given key contains numeric charaters or if customization is used
+         * alphanumeir letters
+        */
+        TBool IsValidAlphaNumericKey( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+
+        /*
+         * Updates CBA using either customization or resource resolver
+         */
+        void CustomizeCbaForPhoneNumberL();
+
+        /*
+         * Checks if Touch dialer is on in DTMF mode.
+         */
+        TBool IsTouchDTmfDialerOn() const;
+
+        /*
+         * Checks if keyevent is from dtmf key and sends it to phone-engine
+         */
+        void SendDtmfKeyEventL( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode  );
+
+        /*
+         * Creates call header manager if needed.
+        */
+        CPhoneCallHeaderManager* CallheaderManagerL();
+
+        /*
+        * Creates number entry content if needed.
+        */
+        CPhoneNumberEntryManager* NumberEntryManagerL();
+
+        /*
+        * Updated Cba when Swivel state changes.
+        */
+        void UpdateCbaSwivelStateChangedL();
+
+        /**
+        * Loads data commonengine stringloader.
+        * @param aData - The returned data including needed text.
+        * @param aResourceId - Resource id for text.
+        */
+        void LoadResource( TDes& aData, const TInt aResource ) const;
+
+        /**
+        * Opens virtual keyboard.
+        */
+        void OpenVkbL();
+
+    private: // NumberEntry functions.
+
+        /**
+        * Handles key events in situations when there exists a number entry.
+        * In this case number entry may be visible or hidden.
+        * @param aKeyEvent - key event
+        * @param aEventCode - event code
+        */
+        void KeyEventForExistingNumberEntryL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+    protected:  // Data
+
+        /**
+        * Reference to State machine
+        */
+        MPhoneStateMachine* iStateMachine;
+
+        /**
+        * Reference to the Phone UI View command handle
+        */
+        MPhoneViewCommandHandle* iViewCommandHandle;
+
+    protected:
+
+        //Indicates whether onscreen dialer is defined
+        TBool iOnScreenDialer;
+
+        /**
+        * Customization of functionality according to e.g.
+        * call type specific needs.
+        * Not own.
+        */
+        MPhoneCustomization* iCustomization;
+
+        // CBA key manager. Own.
+        CPhoneCbaManager* iCbaManager;
+
+    private:
+
+        /**
+         * Previously handled SIM card state.
+         */
+        TPESimState iPreviousSimState;
+
+        // Bitmap redraw counter
+        TInt iBitmapRedrawCounter;
+
+        /**
+        * Timer for ALS line change.
+        */
+        CPhoneTimer* iAlsLineChangeKeyPressTimer;
+
+        // Internal variable for EikonEnv to avoid
+        // use of static system calls
+        CEikonEnv& iEnv;
+
+        // Call header manager.
+        CPhoneCallHeaderManager* iCallHeaderManager;
+
+        // Number entry manager
+        CPhoneNumberEntryManager* iNumberEntryManager;
+
+        // RingtoneSilenced flag.
+        // This is used to determine if the ringtone
+        // for incoming call is silenced. The information
+        // is used while updating softkeys in method
+        // UpdateIncomingCbaL only
+        TBool iRingtoneSilenced;
+
+        /**
+         * Handle to the Operator logo resource.
+         */
+        TInt iLogoHandle;
+        };
+
+#endif // CPHONESTATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestatecallsetup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Call setup state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATECALLSETUP
+#define CPHONESTATECALLSETUP
+
+// INCLUDES
+#include "cphonestate.h"
+
+// FORWARD DECLARATIONS
+class CPhoneDtmfWaitCharTimer;
+
+// CLASS DECLARATION
+/**
+*  Call setup state
+*/
+class CPhoneStateCallSetup : public CPhoneState
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneStateCallSetup();
+
+        /**
+        * Creates the Call Setup state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateCallSetup
+        */
+        static CPhoneStateCallSetup* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aCustomization );
+
+        IMPORT_C virtual void HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        IMPORT_C virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+        
+        /**
+        * Handles commands.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        *          (ETrue) or not (EFalse)
+        */
+        IMPORT_C virtual TBool HandleCommandL( TInt aCommand );
+        
+    protected:
+
+        /** 
+        * Handle state-specific behaviour when number entry is cleared
+        */ 
+        IMPORT_C virtual void HandleNumberEntryClearedL();
+        
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneStateCallSetup( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+        
+        /**
+        * Upadated CBAs CallSetup case
+        */
+        IMPORT_C virtual void UpdateInCallCbaL();
+         
+        /**
+        * Upadated CBAs
+        */
+        IMPORT_C virtual void UpdateCbaL( TInt aResource );    
+        
+        /**
+        * Open menu bar
+        */
+        IMPORT_C virtual void OpenMenuBarL();
+        
+        
+        // Prevents to open number entry dialog during call setup phase
+        IMPORT_C virtual void HandleCreateNumberEntryL ( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+                
+    private:
+
+        /**
+        * A message handling function for EPEMessageHandleConnected
+        * @param aCallId: the call id of the call
+        */
+        void HandleConnectedL( TInt aCallId );
+
+        /**
+        * A message handling function for EPEMessageIdle
+        * @param aCallId: the call id of the call
+        */
+        void HandleIdleL( TInt aCallId );
+
+        /**
+        * A message handling function for message EPEMessageRemoteTerminated
+        */
+        void HandleRemoteTerminatedL( TInt aCallId );
+        
+        /**
+        * Handle EPEMessageAudioOutputChanged
+        */
+        void HandleAudioOutputChangedL();
+     
+        /**
+        * Handle EPEMessageSendingDTMF
+        */
+        void HandleSendingDTMFL();
+        
+        /**
+        * Handle EPEMessageStoppedDTMF
+        */
+        void HandleStoppedDTMFL();
+
+        /**
+        * Handles EPEMessageDTMFSent
+        *         EPEMessageDTMFSendingAborted
+        */
+        void CancelDTMFSendingL();
+        
+        /**
+        * Sends DTMF sequence to Phone Engine
+        */
+        void SendDtmfL();
+        
+        /**
+        * Sends Key specific DTMF to Phone Engine
+        */
+        void PlayKeySpecificDTMF( const TUint aCode );
+             
+    private:
+                
+        /**
+        * Special timer for preventing recursive calls
+        * which would otherwise occur with multiple
+        * wait characters in a DTMF string.
+        */
+        CPhoneDtmfWaitCharTimer* iDtmfWaitCharTimer;
+         
+    };
+
+#endif // CPHONESTATECALLSETUP
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestatehandle.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Singleton class for handling states and their transitions.
+*
+*/
+
+
+#ifndef CPHONESTATEHANDLE_H
+#define CPHONESTATEHANDLE_H
+
+// INCLUDES
+#include <pevirtualengine.h>
+#include "mphonestatemachine.h"
+#include "cphoneresourceresolverbase.h"
+#include "mphoneviewcommandhandle.h"
+#include "cphoneuistatemachinefactorybase.h"
+#include <coemain.h>
+
+// FORWARD DECLARATIONS
+class MPhoneState;
+class CPhoneErrorMessagesHandler;
+
+// CLASS DECLARATION
+
+/**
+*  Singleton class for handling states and their transitions
+*/
+class CPhoneStateHandle : public CCoeStatic
+    {
+    public: 
+
+        /**
+        * First call initializes the singleton object. Subsequent calls panic. 
+        * Singleton must be initialized only once and then Instance() method 
+        * must be used to get handle to instance.
+        * @return the created instance.
+        */
+        static CPhoneStateHandle* CreateL( 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            const TDesC& aFileName, 
+            const TUid aFactoryUid );
+    
+        /**
+        * Returns an instance of this class.
+        * @return A pointer to CPhoneStateHandle class 
+        */
+        IMPORT_C static CPhoneStateHandle* Instance();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStateHandle();
+        
+        /**
+        * Returns the state machine
+        * @return State machine
+        */
+        IMPORT_C MPhoneStateMachine* StateMachine();
+        
+        /**
+        * Returns the view command handle
+        * @return view command handle
+        */
+        IMPORT_C MPhoneViewCommandHandle* ViewCommandHandle();
+
+    private:
+
+        /**
+        * Loads handle to GSM or VoIP factory
+        * @return pointer to Phone Engine Info
+        */
+        void LoadLibraryHandleL( 
+            const TDesC& aFileName,
+            const TUid aFactoryUid );
+
+        /**
+        * Default constructor is private because we are using the
+        * Singleton design pattern.
+        */
+        CPhoneStateHandle(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL(
+            const TDesC& aFileName, 
+            const TUid aFactoryUid );
+
+    private:
+
+        /**
+        * View's command handle
+        */
+        MPhoneViewCommandHandle* iViewCommandHandle;
+
+        /**
+        * Pointer to GSM or VoIP specific state machine
+        */
+        MPhoneStateMachine* iPhoneStateMachine;
+
+        /**
+        * Pointer to GSM or VoIP specific resource resolver
+        */
+        CPhoneResourceResolverBase*   iPhoneResourceResolver;
+        
+        /**
+        * Pointer to GSM or VoIP specific error messages handler
+        */
+        CPhoneErrorMessagesHandler* iPhoneErrorMessagesHandler;
+
+        /**
+        * Pointer to GSM or VoIP specific factory.
+        */
+        CPhoneUIStateMachineFactoryBase* iStateMachineFactory;
+
+        TLibraryFunction iEntry;
+
+        RLibrary iFactoryLibrary;
+
+    };
+
+#endif // CPHONESTATEHANDLE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestateidle.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Idle state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATEIDLE
+#define CPHONESTATEIDLE
+
+// INCLUDES
+#include "cphonestate.h"
+#include "tphonecmdparamspeeddial.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Idle state
+*/
+class CPhoneStateIdle : public CPhoneState
+    {
+    public:  
+        
+    /** Dial initiation method. */
+    enum TDialInitiationMethod
+        {
+        /** Dial initiation method unknown. */
+        EDialMethodUnknown          = 0,
+        /** Dial is initiated by explicit call type selection from menu.*/
+        EDialMethodMenuSelection    = 1,
+        /** Dial is initiated by send command. */
+        EDialMethodSendCommand      = 2,
+        /** Dial is initiated by one key dialing. */
+        EDialMethodOneKeyDialing    = 3
+
+        };
+    
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneStateIdle();
+
+        /**
+        * Creates the Idle state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIdle
+        */
+        static CPhoneStateIdle* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        IMPORT_C virtual void HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        IMPORT_C void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+            
+        IMPORT_C virtual TBool HandleCommandL( TInt aCommand );
+        
+        IMPORT_C virtual TBool ProcessCommandL( TInt aCommand );
+
+        /**
+        * Indicates when the Idle app is in the foreground.
+        */
+        IMPORT_C virtual void HandleIdleForegroundEventL();
+
+        /**
+        * Indicates when the Phone app is in the foreground.
+        */
+        IMPORT_C virtual void HandlePhoneForegroundEventL();
+
+        /**
+        * Indicates when the Phone app has lost focus.
+        */
+        IMPORT_C virtual void HandlePhoneFocusLostEventL();
+
+    protected:
+
+        /** 
+        * Handle state-specific behaviour when number entry is cleared
+        */ 
+        IMPORT_C virtual void HandleNumberEntryClearedL();
+
+        IMPORT_C virtual TBool HandleRemConCommandL( 
+            TRemConCoreApiOperationId aOperationId, 
+            TRemConCoreApiButtonAction aButtonAct );
+
+        /**
+        * Display Incoming Call
+        * @param aCallid call id
+        */
+        IMPORT_C void DisplayIncomingCallL( TInt aCallId );
+
+        /**
+        * Display Call Setup
+        * @param aCallid call id
+        */
+        IMPORT_C void DisplayCallSetupL( TInt aCallId );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneStateIdle( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+
+        /**
+        * Dial the specified number. 
+        * @param    aNumber            The number to call.
+        * @param    aNumberType        A number type.
+        * @param    aDialMethod        A dial initiation method.
+        */
+        IMPORT_C virtual void DialL( const TDesC& aNumber, 
+            TPhoneNumberType aNumberType, TDialInitiationMethod aDialMethod );
+        
+        /**
+        * Dial CS multimedia call
+        * @param None
+        */
+        IMPORT_C void DialMultimediaCallL();
+
+        /**
+        * Dial CS voice call
+        * @param None
+        */
+        IMPORT_C void DialVoiceCallL();
+
+        /**
+        * Handles situation when hash key has been kept down long
+        * (long keypress) and the hash character is the only character
+        * in number entry.
+        */
+        IMPORT_C virtual void OnlyHashInNumberEntryL();
+
+        /**
+        * A message handling function for EPEMessageDialling
+        * @param aCallId: the call id of the call
+        */
+        IMPORT_C virtual void HandleDialingL( TInt aCallId );
+
+        /**
+        * This is called when Speed Dial dialog is cancelled or user didn't give
+        * a valid number.
+        * @param aDigit: entered digit
+        */
+        IMPORT_C void SpeedDialCanceledL( const TUint& aDigit );
+        
+        /**
+        * Handle long key press of a number.
+        */
+        IMPORT_C void HandleNumberLongKeyPressL();
+        
+        /**
+        * Tests whether given number is speed dial number.
+        * @param    aNumber    A number to test.
+        * @return   ETrue if given number is speed dial number.
+        */
+        IMPORT_C TBool IsSpeedDialNumber( const TDesC& aNumber ) const;
+        
+        /**
+        * Handles speed dialing.
+        * @param aDigit             Entered digit.
+        * @param aDialMethod        Dial initiation method.
+        */
+        IMPORT_C void SpeedDialL( const TUint& aDigit, 
+            TDialInitiationMethod aDialMethod );
+
+        /**
+        * Handles send command.
+        */
+        IMPORT_C virtual void HandleSendCommandL();
+        
+    private: // New functions
+
+        /**
+        * A message handling function for EPEMessageIncoming
+        * @param aCallId: the call id of the call
+        */
+        void HandleIncomingL( TInt aCallId );
+
+        /**
+        * A message handling function for EPEMessageHandleConnected
+        * @param aCallId: the call id of the call
+        */
+        void HandleConnectedL( TInt aCallId );
+        
+        /**
+        * A message handling function for EPEMessageIdle
+        * @param aCallId: the call id of the call
+        */
+        void HandleIdleL( TInt aCallId );
+
+        /**
+        * Launches application.
+        */
+        void LaunchApplicationL();
+
+        /**
+        * Send Exit command
+        */
+        void SendExitCommandL();
+
+        /**
+        * Dials video call 
+        */
+        void DialVideoCallL();
+        
+        /**
+        * Handles end key press that was catched in HandleKeyMessageL
+        * @param aMessage - key event message
+        */
+        void HandleEndKeyPressL( TPhoneKeyEventMessages aMessage );
+        
+        /**
+        * Changes manner mode.
+        * Switches from any profile to the Silent profile or from the
+        * Silent profile to the General profile.
+        */
+        void ChangeMannerModeL();
+        
+        /**
+        * Checks if MC/PCSuite restore ongoing.
+        * @param none.
+        * @return ETrue if ongoing.
+        */
+        TBool RestoreOngoing();
+        
+        /**
+        * Handles back command. 
+        */
+        void HandleBackCommandL();
+
+        /**
+         * Checks for application launching configurations from 
+         * central repository.
+         * @param aCode key code.
+         * @return ETrue if configuration found.
+         */        
+         TBool CheckAppLaunchingL( const TKeyCode aCode );
+
+         /**
+          * Returns phone number for specified speed dial location.
+          * @param  aDigit Speed dial digit.
+          * @param  aDigit On return contains speed dial parameters.
+          * @return Phone number
+          */   
+         HBufC* NumberForSpeedDialLocationL( const TUint& aDigit,
+             TPhoneCmdParamSpeedDial& aSpeedDialParam ) const;
+
+         void HandleVoiceCallCommandL( TBool aSendKey );
+         
+    private:
+    
+        // Owned profile engine
+        MProfileEngine* iEngine;
+        // indicates that incomming call is arrived.
+        TBool iIncommingCall;
+  
+    };
+
+#endif // CPHONESTATEIDLE
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestateincall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     In call state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATEINCALL
+#define CPHONESTATEINCALL
+
+// INCLUDES
+#include "cphonestate.h"
+
+// FORWARD DECLARATIONS
+class CPhoneDtmfWaitCharTimer;
+
+// CLASS DECLARATION
+/**
+*  In call state
+*/
+class CPhoneStateInCall : public CPhoneState
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneStateInCall();
+
+        /**
+        * Creates the InCall state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateInCall
+        */
+        static CPhoneStateInCall* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aCustomization );
+
+        IMPORT_C virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+            
+        IMPORT_C virtual TBool HandleCommandL( TInt aCommand );
+
+    protected:
+
+        /** 
+        * Handle state-specific behaviour when number entry is cleared
+        */ 
+        IMPORT_C virtual void HandleNumberEntryClearedL();
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneStateInCall( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+
+        /**
+        * Open menu bar
+        */
+        IMPORT_C virtual void OpenMenuBarL();
+
+        /**
+        * Launch the New call phone number query
+        */
+        IMPORT_C void LaunchNewCallQueryL();
+
+        /**
+        * Call number fetched from New call dialog
+        * @param aFetchedNumber number fetched from the diaog
+        */
+        IMPORT_C virtual void CallFetchedNumberL( 
+            const TDesC& aFetchedNumber );
+
+        /**
+        * Handle EPEMessageIdle
+        */
+        IMPORT_C void HandleIdleL( TInt aCallId );
+        
+        /**
+        * Method for quering is video call active.
+        * @return ETrue if active otherwise EFalse
+        */
+        IMPORT_C virtual TBool IsVideoCallActiveL();
+         
+        /**
+        * Method for quering is video call ringing.
+        * @return ETrue if ringing otherwise EFalse
+        */
+        IMPORT_C virtual TBool IsVideoCallRingingL();
+        
+        /**
+        * Method for quering ringing call .
+        * @return call id otherwise KErrNotFound
+        */
+        IMPORT_C virtual TBool GetRingingCallL();
+        /**
+        * Search and release outgoingcall
+        */
+        IMPORT_C void DisconnectOutgoingCallL();
+        
+        /**
+        * Upadated CBAs Incall case
+        */
+        IMPORT_C virtual void UpdateInCallCbaL();
+        
+
+        /**
+        * Upadated CBAs
+        */
+        IMPORT_C virtual void UpdateCbaL( TInt aResource );     
+
+        /**
+        * Close all dtmf dialogs
+        */
+        IMPORT_C void CloseDtmfQueryL();
+    
+        /**
+        * Creates number entry.
+        */
+        IMPORT_C void CreateNumberEntryL();
+        
+        
+        /**
+          * Concludes does the engine have information of the
+          * phone number. This information is then send to the view.
+          * @param aCallId - Call Id.
+        */
+        IMPORT_C void PhoneNumberAvailableInPhoneEngineL( TInt aCallId );
+    
+    private: // New functions
+
+        /**
+        * Handle EPEMessageAudioMuteChanged
+        */
+        void HandleAudioMuteChangedL();
+
+        /**
+        * Handle EPEMessageAudioOutputChanged
+        */
+        void HandleAudioOutputChangedL();
+        
+        /**
+        * Handle EPEMessageAudioVolumeChanged
+        */
+        void HandleAudioVolumeChangedL();
+        
+        /**
+        * Handle EPEMessageSendingDTMF
+        */
+        void HandleSendingDTMFL();
+        
+        /**
+        * Handle EPEMessageStoppedDTMF
+        */
+        void HandleStoppedDTMFL();
+
+        /**
+        * Handles EPEMessageDTMFSent
+        *         EPEMessageDTMFSendingAborted
+        */
+        void CancelDTMFSendingL();
+
+        /**
+        * Handle EPEMessagePromptSpeedDial
+        */
+        void HandleDTMFPromptSpeedDialL();
+
+        /**
+        * Sends DTMF sequence to Phone Engine
+        */
+        void SendDtmfL();
+        
+        /**
+        * Sends DTMF speed dial number sequence to Phone Engine
+        */
+        void SendDtmfSpeedDialNumberL();
+        
+        /**
+        * Sends command to view for launching manual DTMF entry
+        */
+        void LaunchDtmfManualQueryL();
+
+        /**
+        * Sends command to view for launching DTMF list query
+        */
+        void LaunchDtmfListQueryL();
+        
+        /**
+        * Launch DTMF Single Item fetch dialog
+        */
+        void LaunchDtmfSearchDialogL();
+        
+        /**
+        * Launch DTMF Single Item fetch for DTMF List query usage
+        */
+        void LaunchDtmfListViewSearchDialogL();
+
+        /**
+        * Launch New call fetch dialog
+        */
+        void LaunchNewCallSearchDialogL();
+              
+        /**
+        * Sends command to view for 'Lock keypad'
+        */
+        void LockKeypadL();
+        
+        /**
+        * Handle successful single item fetch.
+        */
+        void HandleSuccessFetchedNumberL();
+        
+        /**
+        * Handle failed single item fetch.
+        */
+        void HandleFailedFetchedNumberL();
+        
+        /**
+        * Update remote data and label to the call header.
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header parameters where modifications
+        *                          are made.
+        */
+        void UpdateRemoteInfoDataAndLabelL( 
+                TInt aCallId, 
+                TPhoneCmdParamCallHeaderData aCallHeaderParam );
+        
+        /**
+        * Show dtmf text query
+        * @param aDialogResourceId dialog's resource id
+        * @param aDefaultCbaResourceId default CBA's resource id
+        * @param aContentCbaResourceId content CBA's resource id
+        * @param aDataText pointer to data text
+        * @param aSendKeyEnabled send key enabled status for the query
+        */
+        void ShowDtmfTextQueryL(
+            TInt aDialogResourceId,
+            TInt aDefaultCbaResourceId,
+            TInt aContentCbaResourceId,
+            TDes* aDataText,
+            TBool aSendKeyEnabled = EFalse );
+                        
+        /**
+        * Handles End key pressing (long/short).
+        * @param aMessage - Key event from AVKON
+        */
+        void HandleEndKeyPressL( TPhoneKeyEventMessages aMessage );
+
+        /**
+        * Handles Voice key pressing.
+        * @param aMessage - Key event from AVKON
+        */
+        void HandleVoiceKeyPressL( TPhoneKeyEventMessages aMessage );
+        
+    private:
+    
+        /**
+        * Special timer for preventing recursive calls
+        * which would otherwise occur with multiple
+        * wait characters in a DTMF string.
+        */
+        CPhoneDtmfWaitCharTimer* iDtmfWaitCharTimer;
+  
+    
+    };
+
+#endif // CPHONESTATEINCALL
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestateincoming.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,200 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Incoming state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATEINCOMING
+#define CPHONESTATEINCOMING
+
+// INCLUDES
+#include "cphonestate.h"
+
+// FORWARD DECLARATIONS
+class TPhoneCmdParamCallStateData;
+
+// CLASS DECLARATION
+/**
+*  Incoming state
+*/
+class CPhoneStateIncoming : public CPhoneState
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneStateIncoming();
+
+        /**
+        * Creates the Incoming state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneStateIncoming* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        IMPORT_C void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        IMPORT_C void HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        IMPORT_C virtual void HandleKeyPressDurationL(
+            TKeyCode aCode,
+            TTimeIntervalMicroSeconds aKeyPressDuration );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+            
+        IMPORT_C TBool HandleCommandL( TInt aCommand );
+
+        /** 
+        * Handle state-specific behaviour when number entry is cleared
+        */ 
+        IMPORT_C void HandleNumberEntryClearedL();
+
+        /** 
+        * Handle keylock state change events
+        */ 
+        IMPORT_C void HandleKeyLockEnabled( TBool aKeylockEnabled );
+        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneStateIncoming( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+        
+        /**
+        * From CAknAppUi, initialise a menupane (dynamic).
+        *
+        * @param aResourceId It is the resource id for the pane.
+        * @param aMenuPane It is the menu pane corresponding to the resource.
+        */
+        IMPORT_C virtual void DynInitMenuPaneL( 
+            TInt aResourceId, 
+            CEikMenuPane* aMenuPane );
+
+        /**
+        * Audio play stopped handling
+        */
+        IMPORT_C virtual void HandleAudioPlayStoppedL();            
+        
+    private: // From CPhoneState
+
+        /**
+        * A message handling function for EPEMessageConnected
+        * @param aCallId: the call id of the call
+        */
+        void HandleConnectedL( TInt aCallId );
+
+        /**
+        * A message handling function for EPEMessageIdle
+        * @param aCallId: the call id of the call
+        */
+        void HandleIdleL( TInt aCallId );
+        
+        /**
+        * Handles Send key or command, when pressed from the dialer 
+        */
+        void HandleSendL();
+        
+        /**
+        * Open soft reject message editor
+        */
+        void OpenSoftRejectMessageL();
+
+        /**
+        * Indicator if soft reject message editor is displayed
+        */
+        TBool SoftRejectMessageEditorIsDisplayedL() const;
+
+        /**
+        * Open menu bar
+        */
+        void OpenMenuBarL();
+
+        /**
+        * Answer the MT call
+        */
+        void AnswerCallL();
+        
+        /**
+        * Disconnects the waiting call
+        */
+        void DisconnectWaitingCallL();
+        
+        /**
+        * Gets resource to use when number entry is open
+        * @return resource id
+        */
+        TInt GetNumberEntryVisibleMenuBar();
+        
+        /**
+        * Gets resource to use when number entry is closed
+        * @return resource id
+        */
+        TInt GetNumberEntryNotVisibleMenuBar();
+        
+        /**
+        * Updates incoming CBA's
+        */
+        void UpdateInCallCbaL( TInt aCallId );
+        
+        /**
+        * Show disconnected note
+        */        
+        void ShowDisconnectingL( TInt aCallId ); 
+        
+        /**
+        * Update remote data and label to the call header.
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header parameters where modifications
+        *                          are made.
+        */
+        void UpdateRemoteInfoDataAndLabelL( 
+                TInt aCallId, 
+                TPhoneCmdParamCallHeaderData aCallHeaderParam );
+       
+    protected:
+        // call id of ringing call
+        TInt iRingingCallId;
+        
+    };
+
+#endif // CPHONESTATEINCOMING
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestatemachine.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Class for handling states and their transitions.
+*
+*/
+
+
+#ifndef CPHONESTATEMACHINE_H
+#define CPHONESTATEMACHINE_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <pevirtualengine.h>
+#include "mphonestatemachine.h"
+#include "mphonestate.h"
+#include "mphoneviewcommandhandle.h"
+
+// FORWARD DECLARATIONS
+class MPhoneState;
+class MPhoneStorage;
+
+// CLASS DECLARATION
+
+/**
+*  Class for handling states and their transitions
+*/
+class CPhoneStateMachine : 
+    public CBase, 
+    public MPhoneStateMachine
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneStateMachine();
+
+    public: // From MPhoneStateMachine
+
+        /**
+        * Sets the next state to be set.
+        * New state will be constructed and old one destructed in next
+        * State() call.
+        * @param aState to be set
+        */
+        IMPORT_C void ChangeState( TInt aState );
+
+        /**
+        * Returns active state
+        */
+        IMPORT_C MPhoneState* State();
+
+        /**
+        * Sets pointer to Phone Engine
+        * @param aPhoneEngine pointer to Phone Engine instance
+        */
+        IMPORT_C void SetPhoneEngine( MPEPhoneModel* aPhoneEngine );
+
+        /**
+        * Gets pointer to Phone Engine
+        * @returns pointer to Phone Engine
+        */
+        IMPORT_C MPEPhoneModel* PhoneEngine();
+
+        /**
+        * Gets pointer to Phone Engine Info
+        * @return pointer to Phone Engine Info
+        */
+        IMPORT_C MPEEngineInfo* PhoneEngineInfo();
+        
+        /**
+        * Instantiates protocol specific Phone Engine
+        * @param reference to Engine Monitor
+        * @return Phone Engine instance
+        */
+        IMPORT_C MPEPhoneModel* CreatePhoneEngineL(
+            MEngineMonitor& aEngineMonitor );
+        /**
+        * Send message to phoneEngine
+        * @param aMessage
+        */     
+        IMPORT_C void SendPhoneEngineMessage( 
+            TInt aMessage );
+
+        /**
+        * Set callId to phoneEngineinfo
+        * @param aCallId
+        */    
+        IMPORT_C void SetCallId( const TInt aCallId );
+
+       
+        /**
+        * Instantiates phone storage.
+        * @return storage instance    
+        */    
+        IMPORT_C MPhoneStorage* PhoneStorage();        
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneStateMachine(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+
+    protected: // Data   
+
+        /**
+        * Currently active state
+        */
+        MPhoneState* iState; 
+
+        /**
+        * Old state ID - needed in state transitions
+        */
+        TInt iOldStateId;
+
+        /**
+        * New state ID to be used - needed in state transitions
+        */
+        TInt iNewStateId;
+
+        /**
+        * View's command handle
+        */
+        MPhoneViewCommandHandle* iViewCommandHandle;
+
+        /**
+        * Pointer to Phone Engine - uses relation
+        */
+        MPEPhoneModel* iPhoneEngine;
+
+        // Idle state which is hold in memory all the time
+        MPhoneState* iIdleState;
+
+        // Phone's storage
+        MPhoneStorage* iPhoneStorage;
+    };
+
+#endif      // CPHONESTATEMACHINE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonestatestartup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Startup state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATESTARTUP_H
+#define CPHONESTATESTARTUP_H
+
+// INCLUDES
+#include "cphonestate.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Startup state
+*/
+class CPhoneStateStartup : public CPhoneState
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneStateStartup();
+
+        /**
+        * Creates the Startup state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateStartup
+        */
+        IMPORT_C static CPhoneStateStartup* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+            
+        IMPORT_C void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+        
+        IMPORT_C void HandleKeyEventL( 
+                const TKeyEvent& aKeyEvent, 
+                TEventCode aEventCode );
+
+        /**
+        * Handles startup of the phone application 
+        */
+        IMPORT_C virtual void HandlePhoneStartupL();
+
+        /**
+         * Indicates when the Idle app is in the foreground.
+         */
+        IMPORT_C virtual void HandleIdleForegroundEventL();
+
+        protected:
+
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+        
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneStateStartup( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );        
+
+        
+    private:
+
+        /**
+        * Passes create number entry command forward if NE can be created.
+        */
+        IMPORT_C void HandleCreateNumberEntryL( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+
+        /**
+         * Plays DTMF tone for key event 
+         * */
+        IMPORT_C void HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+        
+        /**
+        * A message handling function for message EPEMessagePEConstructionReady.
+        * @param aCallId: the call id of the call
+        */
+        void HandlePEConstructionReadyL( TInt aCallId );
+        
+        /**
+        * Starts to shows note.
+        */
+        static TInt DoShowNoteL( TAny* aAny );
+        
+        /**
+        * Create and show appropriate note AFTER idle callback
+        * if necessary.
+        */
+        void CreateAndShowNoteAfterIdle();
+
+
+    protected: // Data
+
+        // Provides phone engine startup status
+        TBool iPEReady;
+
+    private: // Data
+
+        // Provides phone application startup status
+        TBool iPhoneReady;
+        
+        // Ownded: idle object to create note.
+        CIdle* iCreateNote;
+    };
+
+#endif // CPHONESTATESTARTUP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphonesystemeventhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Base class for handling key events.
+*
+*/
+
+
+#ifndef __CPHONESYSTEMEVENTHANDLER_H
+#define __CPHONESYSTEMEVENTHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "mphonesystemeventhandler.h"
+#include "mphonepubsubobserver.h"
+#include "mphonecenrepobserver.h"
+
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+
+/**
+* Transforms system events to be sent to the states
+*/
+class CPhoneSystemEventHandler : 
+    public CBase, 
+    public MPhoneSystemEventHandler,
+    public MPhonePubSubObserver,
+    public MPhoneCenRepObserver
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneSystemEventHandler* NewL( 
+            MPhoneStateMachine* aStateMachine );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneSystemEventHandler();
+
+    public: // From MPhoneSystemEvents
+
+        void DynInitMenuPaneL( 
+            TInt aResourceId, 
+            CEikMenuPane* aMenuPane );
+
+        void DynInitMenuBarL( 
+            TInt aResourceId, 
+            CEikMenuBar* aMenuBar );
+
+        void HandleSystemEventL( const TWsEvent& aEvent );
+
+        void HandleForegroundEventL( TBool aForeground );
+
+        void HandlePhoneForegroundEventL();
+
+        void HandleIdleForegroundEventL();
+
+        void HandleEnvironmentChangeL( const TInt aChanges );
+
+        void HandlePhoneStartupL();
+        
+        void HandlePhoneFocusLostEventL();
+
+        void HandleKeyLockEnabled( TBool aKeylockEnabled );
+        
+    public: // From MPhonePubSubObserver
+
+        /**
+        * This function is called when there is property value change.
+        * @param aCategory Category of the property
+        * @param aKey Property key that is changed
+        * @param aValue New property value
+        */
+        virtual void HandlePropertyChangedL( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue );
+
+    public: // From MPhoneCenRepObserver
+
+        /**
+        * Handle the change of the setting from Central Repository
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        */
+        virtual void HandleCenRepChangeL( 
+            const TUid& aUid,
+            const TUint aId );
+
+    private:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneSystemEventHandler( MPhoneStateMachine* aStateMachine );
+
+    private:  // Data
+
+        /**
+        * State machine
+        */
+        MPhoneStateMachine* iStateMachine;
+
+    };
+
+#endif      // __CPHONESYSTEMEVENTHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphoneuicontroller.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Phone UI controller class.
+*
+*/
+
+
+#ifndef CPHONEUICONTROLLER_H
+#define CPHONEUICONTROLLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+#include "mphonekeyeventhandler.h"
+#include "mphonemenuandcbaevents.h"
+#include "mphonesystemeventhandler.h"
+#include "mphonestatemachine.h"
+
+// FORWARD DECLARATIONS
+class CPhoneEngineHandler;
+class MPhoneKeyEventHandler;
+class CPhoneSystemEventHandler;
+class MPhoneViewCommandHandle;
+class MPhoneStateMachine;
+class CPhoneStateHandle;
+class CPEPhoneModel;
+class CPhoneRemoteControlHandler;
+class CPhoneKeyEventForwarder;
+
+class CPhoneUIController : 
+    public CBase, 
+    public MEngineMonitor,
+    public MPhoneKeyEventHandler,
+    public MPhoneSystemEventHandler,
+    public MPhoneMenuAndCbaEvents
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneUIController* NewL( 
+            MPhoneViewCommandHandle* aViewCommandHandle );
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneUIController();
+
+        /**
+        * HandleMessage
+        * Creates a trap for leaves from message handling functions and 
+        * calls DoHandleMessage to handle the message.
+        * @param aMessage: a message Id from phone application engine
+        * @param aCallId: a Id of the call
+        * @return 
+        */
+        IMPORT_C void HandleMessage( 
+            const TInt aMessage, 
+            const TInt aCallId );
+            
+        /**
+        * HandleError
+        * Implements error handling framework
+        * @param aErrorInfo: the error info
+        */
+        IMPORT_C void HandleError( const TPEErrorInfo& aErrorInfo );
+
+        IMPORT_C TKeyResponse HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        /**
+        * From CAknAppUi, initialise a menupane (dynamic).
+        *
+        * @param aResourceId It is the resource id for the pane.
+        * @param aMenuPane It is the menu pane corresponding to the resource.
+        */
+        IMPORT_C void DynInitMenuPaneL( 
+            TInt aResourceId, 
+            CEikMenuPane* aMenuPane );
+
+        /**
+        * From CAknAppUi, initialise a menubar (dynamic).
+        *
+        * @param aResourceId It is the resource id for the bar.
+        * @param aMenuBar It is the menu bar corresponding to the resource.
+        */
+        IMPORT_C void DynInitMenuBarL( 
+            TInt aResourceId, 
+            CEikMenuBar* aMenuBar );
+
+        /**
+        * From CEikAppUi. For Idle indicator
+        */
+        IMPORT_C void HandleSystemEventL(
+            const TWsEvent& aEvent );
+
+        /**
+        * From CAknAppUi, indicates when app ui is on the foreground.
+        * @param aForeground It is true if app is on the foreground.
+        */
+        IMPORT_C void HandleForegroundEventL( TBool aForeground );
+
+        /**
+        * Indicates when the Phone app is in the foreground.
+        */
+        IMPORT_C virtual void HandlePhoneForegroundEventL();
+
+        /**
+        * Indicates when the Phone app is losing focus.
+        */
+        IMPORT_C virtual void HandlePhoneFocusLostEventL();
+        
+        /**
+        * Indicates when the Idle app is in the foreground.
+        */
+        IMPORT_C virtual void HandleIdleForegroundEventL();
+
+        /**
+        * Handle environment changes.
+        * @param aChanges environment changes which may be reported by
+        *  a change notifier through the RChangeNotifier interface.
+        */
+        IMPORT_C void HandleEnvironmentChangeL( const TInt aChanges );
+
+        /**
+        * Handles startup of the phone application 
+        */
+        IMPORT_C void HandlePhoneStartupL();
+
+        /**
+        * Handles commands.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        *          (ETrue) or not (EFalse)
+        */
+        IMPORT_C TBool HandleCommandL( TInt aCommand );
+
+        /**
+        * Process command.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        *          (ETrue) or not (EFalse)
+        */
+        IMPORT_C TBool ProcessCommandL( TInt aCommand );
+
+        /**
+        * Handles keylock events
+        * @param aCommand It is the code of the command to be handled.
+        */
+        IMPORT_C void HandleKeyLockEnabled( TBool aKeylockEnabled );
+        
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneUIController();
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL( MPhoneViewCommandHandle* aViewCommandHandle );
+        
+        /**
+        * Creates correct protocol DLL depending of the variation.
+        */
+        void CreateProtocolDllL( MPhoneViewCommandHandle* aViewCommandHandle );
+        /**
+        * CallBack for Phone Number Editor
+        */
+        static TInt HandlePhoneNumberEditorCallBack( TAny* aAny );
+        
+        /**
+        * Handles the CallBack for Phone Number Editor
+        */
+        void DoHandlePhoneNumberEditorCallBack();
+        
+    private:    // Data
+
+        /**
+        * CPEPhoneModel
+        */
+        MPEPhoneModel*  iPhoneEngine;
+
+        /**
+        * MPEEngineInfo
+        */
+        MPEEngineInfo*  iEngineInfo;
+
+        /**
+        * iEngineHandler : 
+        */
+        CPhoneEngineHandler* iEngineHandler;
+
+        /**
+        * iKeyEventHandler : 
+        */
+        MPhoneKeyEventHandler* iKeyEventHandler;
+
+        /**
+        * iSystemEventHandler : 
+        */
+        CPhoneSystemEventHandler* iSystemEventHandler;
+        
+        /**
+        * iRemoteControlHandler : 
+        */
+        CPhoneRemoteControlHandler* iRemoteControlHandler;
+
+        /**
+        * MPhoneStateMachine
+        */
+        CPhoneStateHandle* iStateHandle;
+
+        /**
+        * MPhoneStateMachine
+        */
+        MPhoneStateMachine* iStateMachine;  // NOT OWNED
+        
+        /**
+        * iKeyEventForwarder
+        */
+        CPhoneKeyEventForwarder* iKeyEventForwarder;
+        
+    };
+
+#endif      // CPHONEUICONTROLLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/cphoneuistatemachinefactorybase.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     See class description.
+*
+*/
+
+
+#ifndef CPHONEUISTATEMACHINEFACTORYBASE_H
+#define CPHONEUISTATEMACHINEFACTORYBASE_H
+
+//  INCLUDES
+#include    <e32base.h>
+#include    "mphoneuistatemachinefactory.h"
+
+/**
+*  This class implements the PhoneUIStateMachine factory base. This class
+*  contains common code used for Phone UI State Machine Factories. Also derived
+*  from CBase, thus providing the cleanupstack support etc.
+*/
+class CPhoneUIStateMachineFactoryBase :
+    public CBase,
+    public MPhoneUIStateMachineFactory
+    {
+    public:
+    };
+
+#endif // CPHONEUISTATEMACHINEFACTORYBASE_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphoneblockedkeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  An abstract class for get blocked key list.
+*
+*/
+
+
+#ifndef MPHONEBLOCKEDKEYS_H
+#define MPHONEBLOCKEDKEYS_H
+
+// INCLUDES
+#include <e32cmn.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  An abstract class get blocked key list
+*
+*/
+class MPhoneBlockedKeys
+    {
+    public:
+
+        /**
+        * Get blocked key list
+        * @returns RArray<TInt>& lsit of blocked keys 
+        */
+        virtual const RArray<TInt>& GetBlockedKeyList() const = 0;
+        
+    };
+
+#endif // MPHONEBLOCKEDKEYS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonecallheadermanagerutility.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for setting and getting CLI related from engine.
+*
+*/
+
+#ifndef MPHONECALLHEADERMANAGERUTILITY_H
+#define MPHONECALLHEADERMANAGERUTILITY_H
+
+#include "tphonecmdparamcallheaderdata.h"
+#include "mphonecustomization.h"
+
+/**
+* Utily Interface for loading resources and using customization.
+*
+* @since S60 v9.1
+*/
+class MPhoneCallHeaderManagerUtility
+    {
+    public:
+        
+        /**
+        * Concludes does the engine have information of the
+        * phone number. This information is then send to the view.
+        * @param aNumberLength - phone number's length
+        * @param aContactInfoAvailable - is contact's info available
+        */
+        virtual void SetPhoneNumberAvailabilityL(
+                const TInt aNumberLength,
+                const TBool aContactInfoAvailable ) = 0;
+        
+        /**
+        * Resolves call header text in InCall-state,
+        * text could be 'Call 1', 'Call 2', ...
+        * @param aCallId - Call Id.
+        * @param aData - The returned data including needed text.
+        */
+        virtual void GetInCallNumberTextL( 
+                TInt aCallId, 
+                TDes& aData ) const = 0;
+        
+        /**
+        * Loads strings for displaying in call header.
+        * @param aCallLabelId - Resource Id for longer text.
+        * @param aShortLabelId - Resource id for short text
+        * @param aCallHeaderData - Call header parameter into which the text
+        *                          will be set.
+        */
+        virtual void LoadCallHeaderTexts(
+            const TInt aLabelId, 
+            const TInt aShortLabelId,
+            TPhoneCmdParamCallHeaderData* aCallHeaderData ) = 0; 
+        
+        /**
+        * Loads data commonengine stringloader.                           
+        * @param aData - The returned data including needed text.
+        * @param aResourceId - Resource id for text.
+        */
+        virtual void LoadResource( TDes& aData, const TInt aResourceId ) = 0;
+        
+        /**
+        * Returns instance of class MPhoneCustomization
+        */
+        virtual MPhoneCustomization* Customization() = 0;
+        
+    };
+
+#endif // MPHONECALLHEADERMANAGERUTILITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonecustomization.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class for ui customization.
+*
+*/
+
+#ifndef MPHONECUSTOMIZATION_H
+#define MPHONECUSTOMIZATION_H
+
+class CEikMenuBar;
+class CEikMenuPane;
+class TPhoneCmdParamCallHeaderData;
+
+
+// CLASS DECLARATION
+/**
+*  Interface class for ui customization.
+*/
+class MPhoneCustomization
+    {
+public:
+    /**
+    * Customizes menu bar.
+    * @param aResuorceId Menu bar resource id
+    * @param aMenuBar Menu bar.
+    */
+    virtual void CustomizeMenuBarL( TInt aResourceId, 
+                                    CEikMenuBar* aMenuBar) = 0;
+    
+    /**
+    * Customizes menu pane.
+    * @param aResuorceId Menu pane resource id
+    * @param aMenuPane Menu pane.
+    */
+    virtual void CustomizeMenuPaneL( TInt aResourceId, 
+                                     CEikMenuPane* aMenuPane) = 0;
+
+    /**
+    * Handles custom menu commands.
+    * @param aCommand Command id.
+    * @return ETrue if command handled.
+    */
+    virtual TBool HandleCommandL( TInt aCommand ) = 0;
+
+    /**
+    * Checks is alphanumeric mode allowed for number entry/
+    * dialer.
+    * @return ETrue if allowed.     
+    */
+    virtual TBool AllowAlphaNumericMode() = 0; 
+    
+    /**
+    * Returns resource id for soft keys.
+    * @return Resource id.
+    */
+    virtual TInt CustomizeSoftKeys() = 0;
+    
+    /**
+    * Returns text resource id for private call header.
+    * @return Resource id.
+    */
+    virtual TInt CustomizeCallHeaderText() = 0;
+    
+    /**
+    * Customizes call header texts shown in a call bubble.
+    * @param    aCallId             Call identifier.
+    * @param    aHeaderData         Call header data to be modified.
+    * @param    aInCallNumberText   In call number text (Call 1, Call 2...).
+    */
+    virtual void ModifyCallHeaderTexts( TInt aCallId, 
+        TPhoneCmdParamCallHeaderData* aHeaderData,
+        const TDesC& aInCallNumberText ) = 0;
+    
+    /**
+    * Returns text resource id for busy note.
+    * @return Resource id.
+    */
+    virtual TInt CustomizeBusyNoteText() = 0;
+
+    /**
+    * Handles calls from number entry.
+    * @return ETrue when call is handled by customization.
+    *         EFalse otherwice.
+    */
+    virtual TBool HandleCallFromNumberEntryL() = 0;
+
+    /**
+    * A message handling function for Phone Engine messages
+    * @param aMessage   Id of the message 
+    * @param aCallId    the call id of the call
+    */
+    virtual TBool HandlePhoneEngineMessageL(
+        const TInt aMessage, 
+        TInt aCallId ) = 0; 
+        
+    /**
+    * Handles dial by unknown service id.
+    * @param aNumber   Number/Address 
+    */
+    virtual void HandleDialL( const TDesC& aNumber ) = 0; 
+        
+    };
+    
+#endif // MPHONECUSTOMIZATION_H
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonedivertif.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Interface for manipulating divert information.
+*
+*/
+
+
+#ifndef MPHONEDIVERTIF_H
+#define MPHONEDIVERTIF_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// CLASS DECLARATION
+
+/**
+*  Handle all possible messages from Phone Engine
+*/
+class MPhoneDivertIF
+    {
+    public:
+        
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneDivertIF() {};
+
+        /**
+        * Setter for divert indication showing in bubble.
+        * @param aDivertIndication ETrue to show divert indication,
+        *        EFalse to not. Usually setting EFalse isn't necessary
+        *        as it's a default value in bubble creation.
+        */
+        virtual void SetDivertIndication(
+            const TBool aDivertIndication ) = 0;            
+    };
+
+#endif      // MPHONEDIVERTIF_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphoneengineevents.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     All possible event types from Phone Engine.
+*
+*/
+
+
+#ifndef MPHONEENGINEEVENTS_H
+#define MPHONEENGINEEVENTS_H
+
+//  INCLUDES
+#include <e32def.h>
+#include <pevirtualengine.h>
+
+// CLASS DECLARATION
+
+/**
+*  Handle all possible messages from Phone Engine
+*/
+class MPhoneEngineEvents
+    {
+    public:
+        
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneEngineEvents() {};
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aCallId: the call id of the call
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId ) = 0; 
+           
+        /**
+        * Handles errors codes sent by Phone Engine.
+        * @param aErrorInfo 
+        */
+        virtual void HandleErrorL( 
+            const TPEErrorInfo& aErrorInfo ) = 0;
+    };
+
+#endif      // MPHONEENGINEEVENTS_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphoneenginemessagesender.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Describes the interface for sending messages to Phone Engine.
+*
+*/
+
+
+#ifndef MPHONEENGINEMESSAGESENDER_H
+#define MPHONEENGINEMESSAGESENDER_H
+
+/**
+*  Describes the interface for sending messages to Phone Engine
+*/
+class MPhoneEngineMessageSender
+    {
+    public:
+        
+        
+        /**
+        * Send message to Phone Engine
+        * @param aMessage
+        */
+        virtual void SendPhoneEngineMessage( TInt aMessage ) = 0;
+  
+    };
+    
+#endif // MPHONEENGINEMESSAGESENDER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonekeyeventhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     Interface class for handling key events.
+*
+*/
+
+
+#ifndef __MPHONEKEYEVENTHANDLER_H
+#define __MPHONEKEYEVENTHANDLER_H
+
+//  INCLUDES
+
+#include    <w32std.h>
+#include    <coedef.h>
+
+// CLASS DECLARATION
+/**
+*  Interface class for executing UI commands
+*/
+class MPhoneKeyEventHandler
+    {
+    public:
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneKeyEventHandler(){};
+
+        /**
+        * Handles key events
+        */
+        virtual TKeyResponse HandleKeyEventL( 
+            const TKeyEvent& aKeyEvent, 
+            TEventCode aEventCode ) = 0;
+    };
+
+#endif      // __MPHONEKEYEVENTHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonekeyevents.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   See class description.
+*
+*/
+
+
+#ifndef MPHONEKEYEVENTS_H
+#define MPHONEKEYEVENTS_H
+
+
+//  INCLUDES
+#include <e32def.h>
+#include <e32keys.h>
+#include <w32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  MPhoneKeyEvents:
+*  An abstract class whose purpose is to define an interface from the key
+*  event handler to the UI controller.
+*/
+
+class MPhoneKeyEvents
+{
+    public: // Message Ids
+        
+        enum TPhoneKeyEventMessages
+            {
+            // Processed key-events.  
+            // Most classes are expected to act upon processed events only.
+            EPhoneKeyShortPress,      // Args: TKeyCode
+            EPhoneKeyLongPress,       // Args: TKeyCode
+            };
+
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneKeyEvents(){};
+
+    public: // Message handling functions
+
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode ) = 0;
+
+        virtual void HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode ) = 0;
+
+        virtual void HandleKeyPressDurationL(
+            TKeyCode aCode,
+            TTimeIntervalMicroSeconds aKeyPressDuration ) = 0;
+            
+        virtual void HandleLongHashL() = 0;
+
+        virtual TBool IsNoteVisibleL() = 0;
+
+        virtual TBool IsMenuBarVisibleL() const = 0;
+        
+        virtual void HandleCreateNumberEntryL( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode ) = 0;
+        
+        virtual void HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent,
+                        TEventCode aEventCode ) = 0;
+        
+        virtual TBool IsAlphanumericSupportedAndCharInput( 
+                const TKeyEvent& aKeyEvent ) = 0 ;
+};
+
+#endif // __MPHONEKEYEVENTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonelockinfo.h	Fri Jun 04 10:19:18 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:  An abstract class for get blocked key list.
+*
+*/
+
+
+#ifndef MPhoneLockInfo_H
+#define MPhoneLockInfo_H
+
+// INCLUDES
+#include <e32cmn.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  An abstract class get phone lock info
+*
+*/
+class MPhoneLockInfo
+    {
+    public:
+
+        /**
+        * Fetches autolock information - is it set on or not
+        * @return is autolock set on (ETrue) or off (EFalse)
+        */
+        virtual TBool IsAutoLockOn() const = 0;
+
+        /**
+        * Fetches keylock information - is it set on or not
+        * @return is keylock set on (ETrue) or off (EFalse)
+        */
+        virtual TBool IsKeyLockOn() const = 0;
+        
+    };
+
+#endif // MPhoneLockInfo_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonemenuandcbaevents.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     All possible menu and CBA events.
+*
+*/
+
+
+#ifndef MPHONEMENUANDCBAEVENTS_H
+#define MPHONEMENUANDCBAEVENTS_H
+
+//  INCLUDES
+#include <aknappui.h>
+
+// CLASS DECLARATION
+
+/**
+*  All possible menu and CBA events
+*/
+class MPhoneMenuAndCbaEvents
+    {
+
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneMenuAndCbaEvents(){};
+
+        /**
+        * From CAknAppUi, handles commands.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        * (ETrue) or not (EFalse)
+        */
+        virtual TBool HandleCommandL( TInt aCommand ) = 0;
+        
+        /**
+        * Process command.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        * (ETrue) or not (EFalse)
+        */
+        virtual TBool ProcessCommandL( TInt aCommand ) = 0;
+        
+    };
+
+#endif      // MPHONEMENUANDCBAEVENTS_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphoneneclearedhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface to response for Number Entry clearing.
+*
+*/
+
+
+#ifndef MPHONENECLEAREDHANDLER_H
+#define MPHONENECLEAREDHANDLER_H
+
+//  INCLUDES
+#include <e32def.h>
+
+// CLASS DECLARATION
+
+/**
+*  Handle NE cleared indication
+*/
+class MPhoneNEClearedHandler
+    {
+    public:
+        
+        /**
+        * To response to Number Entry cleared event.
+        */
+        virtual void HandleNumberEntryClearedL() = 0;            
+    };
+
+#endif      // MPHONENECLEAREDHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonenumberentryevents.h	Fri Jun 04 10:19:18 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:  Interface to response for Number Entry clearing.
+*
+*/
+
+#ifndef MPHONENUMBERENTRYEVENTS_H
+#define MPHONENUMBERENTRYEVENTS_H
+
+
+//  INCLUDES
+#include <e32def.h>
+#include <e32keys.h>
+#include <w32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  MPhoneKeyEvents:
+*  An abstract class whose purpose is to define an interface from the key
+*  event handler to the UI controller.
+*/
+
+class MPhoneNumberEntryEvents
+{
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneNumberEntryEvents(){};
+
+    public: // Message handling functions
+
+        virtual void HandleNumberEntryEdited() = 0;
+};
+
+#endif // MPHONENUMBERENTRYEVENTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphoneremotecontrolevents.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     Interface class for handling key events.
+*
+*/
+
+
+#ifndef __MPHONEREMOTECONTROLEVENTS_H
+#define __MPHONEREMOTECONTROLEVENTS_H
+
+//  INCLUDES
+#include    <remconcoreapitargetobserver.h>
+
+// CLASS DECLARATION
+/**
+*  Interface class for executing UI commands
+*/
+class MPhoneRemoteControlEvents
+    {
+    public:
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneRemoteControlEvents(){};
+
+        /**
+        * Handles commands from the Remote Control framework.
+        * @param aOperationId The operation ID of the command.
+        * @param aButtonAct The button action associated with the command.
+        * @return ETrue if the event was handled, EFalse otherwise.
+        */
+        virtual TBool HandleRemConCommandL( 
+            TRemConCoreApiOperationId aOperationId, 
+            TRemConCoreApiButtonAction aButtonAct) = 0;
+         
+    };
+
+#endif      // __MPHONEREMOTECONTROLEVENTS_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonestate.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     An abstract class for an object implementing the state.
+*
+*/
+
+
+#ifndef MPHONESTATE_H
+#define MPHONESTATE_H
+
+// INCLUDES
+#include "mphoneengineevents.h"
+#include "mphonekeyevents.h"
+#include "mphonesystemevents.h"
+#include "mphonemenuandcbaevents.h"
+#include "mphoneremotecontrolevents.h"
+#include "mphonedivertif.h"
+#include "mphoneneclearedhandler.h"
+#include "mphonenumberentryevents.h"
+#include "mphonelockinfo.h"
+#include "mphoneblockedkeys.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  An abstract class for an object implementing the state.
+*
+*/
+class MPhoneState : 
+    public MPhoneEngineEvents, 
+    public MPhoneKeyEvents, 
+    public MPhoneSystemEvents,
+    public MPhoneMenuAndCbaEvents,
+    public MPhoneRemoteControlEvents,
+    public MPhoneDivertIF,
+    public MPhoneBlockedKeys,
+    public MPhoneNEClearedHandler,
+    public MPhoneNumberEntryEvents,
+    public MPhoneLockInfo
+    {
+    public:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneState() {};
+        
+    };
+
+#endif // MPHONESTATE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonestatemachine.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Describes the interface for setting and getting active state.
+*
+*/
+
+
+#ifndef MPHONESTATEMACHINE_H
+#define MPHONESTATEMACHINE_H
+
+// INCLUDES
+#include "mphonestate.h"
+#include "mphoneenginemessagesender.h"
+
+
+// CLASS DECLARATION
+class MPhoneState;
+class MPEPhoneModel;
+class MPEEngineInfo;
+class CSpdiaControl;
+class MPhoneStorage;
+
+/**
+*  Describes the interface for setting and getting active state
+*/
+
+class MPhoneStateMachine : public MPhoneEngineMessageSender
+    {
+    public:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneStateMachine() {};
+    
+        /**
+        * Sets active state
+        */
+        virtual void ChangeState( TInt aState ) = 0;
+
+        /**
+        * Returns active state
+        */
+        virtual MPhoneState* State() = 0;
+        
+        /**
+        * Sets pointer to Phone Engine
+        * @param aPhoneEngine pointer to Phone Engine instance
+        */
+        virtual void SetPhoneEngine( MPEPhoneModel* aPhoneEngine ) = 0;
+
+        /**
+        * Gets pointer to Phone Engine
+        * @returns pointer to Phone Engine
+        */
+        virtual MPEPhoneModel* PhoneEngine() = 0;
+
+        /**
+        * Gets pointer to Phone Engine Info
+        * @return pointer to Phone Engine Info
+        */
+        virtual MPEEngineInfo* PhoneEngineInfo() = 0;
+        
+        /**
+        * Instantiates protocol specific Phone Engine
+        * @param reference to Engine Monitor
+        * @return Phone Engine instance
+        */
+        virtual MPEPhoneModel* CreatePhoneEngineL( 
+            MEngineMonitor& aEngineMonitor ) = 0;
+        
+        /**
+        * Sets callId to Phone Engine Info
+        * @param aCallId
+        */    
+        virtual void SetCallId( TInt aCallId ) = 0;
+        
+        /**
+        * Phone's Storage
+        */
+        virtual MPhoneStorage* PhoneStorage() = 0;        
+
+    };
+
+#endif // MPHONESTATEMACHINE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonesystemeventhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Describes all possible System events.
+*
+*/
+
+
+#ifndef __MPHONESYSTEMEVENTHANDLER_H
+#define __MPHONESYSTEMEVENTHANDLER_H
+
+//  INCLUDES
+#include <aknappui.h>
+
+// CLASS DECLARATION
+
+/**
+*  All possible system events
+*/
+class MPhoneSystemEventHandler
+    {
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneSystemEventHandler(){};
+
+        /**
+        * From CAknAppUi, initialise a menupane (dynamic).
+        *
+        * @param aResourceId It is the resource id for the pane.
+        * @param aMenuPane It is the menu pane corresponding to the resource.
+        */
+        virtual void DynInitMenuPaneL( 
+            TInt aResourceId, 
+            CEikMenuPane* aMenuPane ) = 0;
+
+        /**
+        * From CAknAppUi, initialise a menubar (dynamic).
+        *
+        * @param aResourceId It is the resource id for the bar.
+        * @param aMenuBar It is the menu bar corresponding to the resource.
+        */
+        virtual void DynInitMenuBarL( 
+            TInt aResourceId, 
+            CEikMenuBar* aMenuBar ) = 0;
+
+        /**
+        * From CEikAppUi. For Idle indicator
+        */
+        virtual void HandleSystemEventL( const TWsEvent& aEvent ) = 0;
+
+        /**
+        * From CAknAppUi, indicates when app ui is on the foreground.
+        * @param aForeground It is true if app is on the foreground.
+        */
+        virtual void HandleForegroundEventL( TBool aForeground ) = 0;
+
+        /**
+        * Indicates when the Phone app is in the foreground.
+        */
+        virtual void HandlePhoneForegroundEventL() = 0;
+
+        /**
+        * Indicates when the Idle app is in the foreground.
+        */
+        virtual void HandleIdleForegroundEventL() = 0;
+
+        /**
+        * Indicates when the Phone app is is losing focus.
+        */
+        virtual void HandlePhoneFocusLostEventL() = 0;
+
+        /**
+        * Handle environment changes.
+        * @param aChanges environment changes which may be reported by
+        *  a change notifier through the RChangeNotifier interface.
+        */
+        virtual void HandleEnvironmentChangeL( const TInt aChanges ) = 0;
+
+        /**
+        * Handles startup of the phone application 
+        */
+        virtual void HandlePhoneStartupL() = 0;
+
+        /**
+        * Indicates when the keylock events
+        */
+        virtual void HandleKeyLockEnabled( TBool aKeylockEnabled ) = 0;
+        
+    };
+
+#endif      // __MPHONESYSTEMEVENTHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphonesystemevents.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Describes all possible System events.
+*
+*/
+
+
+#ifndef __MPHONESYSTEMEVENTS_H
+#define __MPHONESYSTEMEVENTS_H
+
+//  INCLUDES
+#include <aknappui.h>
+
+// CLASS DECLARATION
+
+/**
+*  All possible system events
+*/
+class MPhoneSystemEvents
+    {
+
+    public:
+
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneSystemEvents(){};
+
+        /**
+        * From CAknAppUi, initialise a menupane (dynamic).
+        *
+        * @param aResourceId It is the resource id for the pane.
+        * @param aMenuPane It is the menu pane corresponding to the resource.
+        */
+        virtual void DynInitMenuPaneL( 
+            TInt aResourceId, 
+            CEikMenuPane* aMenuPane ) = 0;
+
+        /**
+        * From CAknAppUi, initialise a menubar (dynamic).
+        *
+        * @param aResourceId It is the resource id for the bar.
+        * @param aMenuBar It is the menu bar corresponding to the resource.
+        */
+        virtual void DynInitMenuBarL( 
+            TInt aResourceId, 
+            CEikMenuBar* aMenuBar ) = 0;
+
+        /**
+        * From CEikAppUi. For Idle indicator
+        */
+        virtual void HandleSystemEventL( const TWsEvent& aEvent ) = 0;
+
+        /**
+        * From CAknAppUi, indicates when app ui is on the foreground.
+        * @param aForeground It is true if app is on the foreground.
+        */
+        virtual void HandleForegroundEventL( TBool aForeground ) = 0;
+
+        /**
+        * Indicates when the Phone app is in the foreground.
+        */
+        virtual void HandlePhoneForegroundEventL() = 0;
+        
+        /**
+        * Indicates when the Phone app is is losing focus.
+        */
+        virtual void HandlePhoneFocusLostEventL() = 0;
+        
+        /**
+        * Indicates when the Idle app is in the foreground.
+        */
+        virtual void HandleIdleForegroundEventL() = 0;
+
+        /**
+        * Indicates when the keylock events
+        */
+        virtual void HandleKeyLockEnabled( TBool aKeylockEnabled ) = 0;
+        
+        /**
+        * Handle environment changes.
+        * @param aChanges environment changes which may be reported by
+        *  a change notifier through the RChangeNotifier interface.
+        */
+        virtual void HandleEnvironmentChangeL( const TInt aChanges ) = 0;
+
+        /**
+        * Handles startup of the phone application 
+        */
+        virtual void HandlePhoneStartupL() = 0;
+
+        /**
+        * This function is called when there is property value change.
+        * @param aCategory Category of the property
+        * @param aKey Property key that is changed
+        * @param aValue New property value
+        */
+        virtual void HandlePropertyChangedL( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue ) = 0;
+
+        /**
+        * Handle the change of the setting from Central Repository
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        */
+        virtual void HandleCenRepChangeL( 
+            const TUid& aUid,
+            const TUint aId ) = 0;
+    };
+
+#endif      // __MPHONESYSTEMEVENTS_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/mphoneuistatemachinefactory.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     See class description.
+*
+*/
+
+#ifndef __MPHONEUISTATEMACHINEFACTORY_H
+#define __MPHONEUISTATEMACHINEFACTORY_H
+
+//  INCLUDES
+#include <e32std.h>
+
+
+// FORWARD DECLARATIONS
+
+class CPhoneUIController;
+class MPhoneStateMachine;
+class CPhoneResourceResolverBase;
+class CPhoneErrorMessagesHandler;
+
+class MPhoneViewCommandHandle;
+
+/**
+*  Class MPhoneUIStateMachineFactory : This abstract M-class defines the 
+*  interface for PhoneUiStateMachine factory. The interface provides the 
+*  abstraction of variant specific factory objects. The interface 
+*  consists of methods that can be used for creating instances of variant 
+*  specific classes.
+*/
+class MPhoneUIStateMachineFactory
+    {
+    public:
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneUIStateMachineFactory(){};
+
+        /**
+        * Creates an instance of CPhoneStateMachine
+        * derived class using the loaded factory DLL. The user of this function
+        * is responsible of the cleanup of the created object.
+        * @return an instance of the class upcasted to CPhoneStateMachine
+        */
+        virtual MPhoneStateMachine* CreatePhoneStateMachineL(
+            MPhoneViewCommandHandle* aViewCommandHandle ) = 0;
+
+        /**
+        * Creates an instance of CPhoneResourceResolverBase
+        * derived class. The user of this function is responsible of cleanup of the created object.
+        * @param None.
+        * @return an instance of class upcasted to CPhoneResourceResolverBase class
+        */
+        virtual CPhoneResourceResolverBase* CreatePhoneResourceResolverL() = 0;
+        
+        /**
+        * Creates an instance of CPhoneErrorMessagesHandler
+        * derived class. The user of this function is responsible of cleanup of the created object.
+        * @param None.
+        * @return an instance of class upcasted to CPhoneErrorMessagesHandler class
+        */
+        virtual CPhoneErrorMessagesHandler* CreatePhoneErrorMessagesHandlerL(
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneStateMachine* aStateMachine ) = 0;
+    };
+
+#endif      // __MPHONEUISTATEMACHINEFACTORY_H
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/phonestatedefinitions.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   Common phone state definitions.
+*
+*/
+
+
+#ifndef PHONESTATEDEFINITIONS_H
+#define PHONESTATEDEFINITIONS_H
+
+// INCLUDES
+
+#include "phoneconstants.h"
+
+// DATA TYPES
+
+typedef TInt TPhoneStateId;
+
+enum
+    { 
+    EPhoneStateNull = KPhoneStateCommonFirst,
+    EPhoneStateStartup,
+    EPhoneStateIdle,            
+    EPhoneStateCallSetup,
+    EPhoneStateSingle,
+    EPhoneStateIncoming,
+    EPhoneStateEmergency
+    };
+
+#endif // PHONESTATEDEFINITIONS_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/inc/tphonecallheaderparam.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A parameter class for setting call header information
+*
+*/
+
+
+#ifndef TPHONECALLHEADERPARAM_H
+#define TPHONECALLHEADERPARAM_H
+
+//INCLUDES
+#include    "mpeengineinfo.h"
+#include    "tphonecmdparamcallheaderdata.h"
+
+//FORWARD
+class MPhoneStateMachine;
+class MPhoneCallHeaderManagerUtility;
+class TPhoneCmdParamCallHeaderData;
+
+/**
+ * A parameter class for setting call header information.
+ *
+ *  @since S60 v9.1
+ */
+class TPhoneCallHeaderParam
+    {
+    public: // Constructors & destructors.
+            
+        /**
+        * C++ constructor.
+        */
+        TPhoneCallHeaderParam( 
+                MPhoneCallHeaderManagerUtility& aManagerUtility,
+                MPhoneStateMachine& aStateMachine );
+        
+    public: // New functions.
+        
+        /**
+        * Sets info to outgoing call header.
+        * @param aCallId - call id.
+        * @param aWaitingCall - if call is waiting value is ETrue otherwise EFalse.
+        * @param aVideoCall - if call is video value is ETrue otherwise EFalse.
+        * @param aCallHeaderData - Call header parameter into which the text/picture
+        *                          parameters will be set.
+        */           
+        void SetIncomingCallHeaderParamsL(
+                const TInt aCallId, 
+                const TBool aWaitingCall,
+                const TBool aVideoCall,
+                TPhoneCmdParamCallHeaderData* aCallHeaderData );
+        /**
+        * Sets info to outgoing call header.
+        * @param aCallId - call id.
+        * @param aCallHeaderData - Call header parameter into which the text/picture
+        *                          parameters will be set.
+        */
+        void SetOutgoingCallHeaderParamsL(
+                const TInt aCallId,
+                TPhoneCmdParamCallHeaderData* aCallHeaderData );
+        /**
+        * Updates call header info. 
+        * NOTE: This method is used when state receives
+        * EPEMessageRemotePartyInfoChanged from PhoneEngine.
+        * 
+        * @param aCallId - call id.
+        * @param aWaitingCall - if call is waiting value is ETrue otherwise EFalse.
+        * @param aVideoCall - if call is video value is ETrue otherwise EFalse.
+        * @param aCallHeaderData - Call header parameter into which the text/picture
+        *                          parameters will be set.
+        */             
+        void UpdateCallHeaderInfoL( 
+                const TInt aCallId,
+                const TBool aWaitingCall,
+                const TBool aVideoCall,
+                TPhoneCmdParamCallHeaderData* aCallHeaderData );
+
+        /**
+        * Sets the call header type used in the call bubble.
+        * @param aCallHeaderType, call header type.
+        */    
+        void SetCallHeaderType( 
+                TInt aCallHeaderType );
+        /**
+        * Returns the set call header type. Used for constructing right type
+        * of call bubble.
+        */
+        TInt CallHeaderType() const;
+            
+        /**
+        * Setter for divert indication showing in bubble.
+        * @param aDivertIndication ETrue to show divert indication,
+        *        EFalse to not. Usually setting EFalse isn't necessary
+        *        as it's a default value in bubble creation.
+        */
+        void SetDivertIndication( const TBool aDivertIndication );
+        
+        /**
+        * Return remote info data
+        * @param aCallid call id
+        * @param aData the returned remote info data
+        */
+        void GetRemoteInfoDataL( 
+                const TInt aCallId,
+                TDes& aData ) const;           
+    
+        /**
+        * Sets texts for voice call header.
+        * @param aCallId - Call Id.
+        * @param aWaitingCall - Waiting call indication.
+        * @param aCallHeaderData - Call header parameter into which the text
+        *                          will be set.
+        */
+        void SetCallHeaderTexts( 
+            const TInt aCallId, 
+            const TBool aWaitingCall,
+            const TBool aVideoCall,
+            TPhoneCmdParamCallHeaderData* aCallHeaderData );
+
+    private:
+        
+        
+        
+        /**
+        * Set basic info to call header.
+        * @param aCallId - call id.
+        * @param aCallHeaderData - Call header parameter into which the text/picture
+        *                          parameters will be set.
+        */
+        void SetBasicCallHeaderParamsL(
+            const TInt aCallId, 
+            TPhoneCmdParamCallHeaderData* aCallHeaderData );
+        
+        /**
+        * Sets divert indication to call header if necessary
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header where indication will be set
+        *                          if needed.
+        */
+        void SetDivertIndicatorToCallHeader( 
+                const TInt aCallId, 
+                TPhoneCmdParamCallHeaderData* aCallHeaderData );
+        
+        /**
+        * Sets divert indication to call header if necessary
+        * @param aFeatureKey - feature key id Id.
+        * @param aCallId - Call Id.
+        */
+        TBool IsFeatureSupported( 
+                const TInt aFeatureKey, 
+                const TInt aCallId ) const;
+        
+        /**
+        * Return CNAP (Calling Name Presentation) text
+        * @param aCallid call id
+        * @param aData the returned CNAP text
+        * @param aDirection the returned CNAP clipping direction
+        */
+        void GetCNAPText( 
+               const TInt aCallId,
+               TDes& aData, 
+               TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection& aDirection ) const;
+        
+        /**
+        * Check if contact is available(RemoteName or RemoteCompanyName),
+        * if available ETrue is returned otherwise EFalse.
+        * @param aCallid call id
+        */
+        TBool ContactInfoAvailable( 
+                const TInt aCallId ) const;
+        
+        /**
+        * Returns call type and stores type to member variable.
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header data.
+        */
+        TPECallType GetCallType( 
+                const TInt aCallId,
+                TPhoneCmdParamCallHeaderData* aCallHeaderData ); 
+        
+        /**
+        * Sets caller image. 
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header parameter where modifications
+        *                          are made.
+        */
+        void SetCallerImage( 
+                const TInt aCallId, 
+                TPhoneCmdParamCallHeaderData* aCallHeaderData );
+        
+        /**
+        * Updates cli and cnap parameters to call header.
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header parameter where modifications
+        *                          are made.
+        */
+        void SetCliAndCnapParamatersL( 
+                const TInt aCallId, 
+                TPhoneCmdParamCallHeaderData* aCallHeaderData  );
+        /**
+        * Updates cli parameter to call header.
+        * @param aCallId - Call Id.
+        * @param aCallHeaderData - Call header parameter where modifications
+        *                          are made.
+        */
+        void SetCliParamatersL(
+                const TInt aCallId, 
+                TPhoneCmdParamCallHeaderData* aCallHeaderData );  
+        
+        /**
+        * Check if call is private or payphone number. If call is 
+        * Private/PayPhone call then IsCallPrivateOrPayPhone will 
+        * set SetIdentitySpecificCallHeaderData parameters.
+        * 
+        * @param aCallId Call id.
+        * @return ETrue if call is private or payphone number.
+        */
+        TBool IsCallPrivateOrPayPhone( const TInt aCallId, TDes& aData ) const;
+        
+        /**
+        * Sets identity specific call header text.
+        * 
+        * @param aCallId Call id.
+        * @param aData Identity  specific call header text data.
+        */
+        void SetIdentitySpecificCallHeaderData( const TInt aCallId, TDes& aData ) const;
+        
+        /**
+        * Concludes does the engine have information of the
+        * phone number. This information is then send to the view.
+        * @param aNumberLength - phone number's length
+        * @param aContactInfoAvailable - is contact's info available
+        */
+        void SetPhoneNumberAvailabilityL( 
+                const TInt aNumberLength,
+                const TBool aContactInfoAvailable );
+                
+    private:
+        
+        MPhoneCallHeaderManagerUtility& iManagerUtility;
+        MPhoneStateMachine& iStateMachine;
+        TInt iCallHeaderType;
+        TBool iSetDivertIndication;
+            
+    };
+
+#endif // TPHONECALLHEADERPARAM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphoneaccessorybthandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Acessory and Bluetooth handler.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <featmgr.h>
+#include    <StringLoader.h>
+#include    <btengdomainpskeys.h>
+#include    <btengdomaincrkeys.h>
+#include    <mpeengineinfo.h>
+
+#include    "cphoneaccessorybthandler.h"
+#include    "cphonecenrepproxy.h"
+#include    "cphonemainresourceresolver.h"
+#include    "mphoneneclearedhandler.h"
+#include    "mphonestatemachine.h"
+#include    "mphoneviewcommandhandle.h"
+#include    "phoneconstants.h"
+#include    "phonelogger.h"
+#include    "phoneui.pan"
+#include    "phonerssbase.h"
+#include    "tphonecmdparamnote.h"
+
+// CONSTANTS
+
+const TInt KPhoneBtAddressTextLength = 64;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CPhoneAccessoryBTHandler::CPhoneAccessoryBTHandler( 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneStateMachine* aStateMachine,
+    MPhoneNEClearedHandler* aNEClearedHandler ) :
+    iViewCommandHandle( aViewCommandHandle ),
+    iStateMachine( aStateMachine ),
+    iNEClearedHandler( aNEClearedHandler )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneAccessoryBTHandler::NewLC()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneAccessoryBTHandler* CPhoneAccessoryBTHandler::NewLC( 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneStateMachine* aStateMachine,
+    MPhoneNEClearedHandler* aNEClearedHandler )
+    {
+    CPhoneAccessoryBTHandler* self = new (ELeave) CPhoneAccessoryBTHandler( 
+        aViewCommandHandle, aStateMachine, aNEClearedHandler );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneAccessoryBTHandler::~CPhoneAccessoryBTHandler
+// -----------------------------------------------------------------------------
+//
+CPhoneAccessoryBTHandler::~CPhoneAccessoryBTHandler()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneAccessoryBTHandler::SetBTDebugModeL
+// Handling for message EPEMessageBTDebugMode.
+// Sets BT debug mode PS key on.
+// -----------------------------------------------------------
+//
+void CPhoneAccessoryBTHandler::SetBTDebugModeL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneAccessoryBTHandler::SetBTDebugModeL( ) ");
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewClearNumberEntryContent );                      
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );   
+        }
+    iNEClearedHandler->HandleNumberEntryClearedL();
+    if ( RProperty::Set( KPSUidBluetoothDutMode, KBTSspDebugmode, EBTSspDebugModeOn ))
+        {
+        __PHONELOG( EOnlyFatal, EPhoneControl, "CPhoneAccessoryBTHandler::SetBTDebugModeL PS key not defined" );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneAccessoryBTHandler::SetBTHandsfreeModeL
+// ---------------------------------------------------------
+//
+TBool CPhoneAccessoryBTHandler::SetBTHandsfreeModeL( TBool aHandsfreeMode )
+    {
+    return DoSetHandsfreeModeL( aHandsfreeMode, aHandsfreeMode ? EPEBTAudioAccessory : EPEHandset );
+    }
+
+// ---------------------------------------------------------
+// CPhoneAccessoryBTHandler::SetHandsfreeModeL
+// ---------------------------------------------------------
+//
+TBool CPhoneAccessoryBTHandler::SetHandsfreeModeL( TBool aHandsfreeMode )
+    {
+    return DoSetHandsfreeModeL( aHandsfreeMode, aHandsfreeMode ? EPELoudspeaker : EPEHandset );
+    }
+
+// ---------------------------------------------------------
+// CPhoneAccessoryBTHandler::ShowBTAddressL
+// ---------------------------------------------------------
+//
+void CPhoneAccessoryBTHandler::ShowBTAddressL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneAccessoryBTHandler::ShowBTAddressL( ) ");
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ))
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewClearNumberEntryContent );                      
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );   
+        }
+     
+    // Get BT address
+    TBuf<KPhoneBtAddressTextLength> addressBuffer;
+
+    CPhoneCenRepProxy::Instance()->GetString(             
+        KCRUidBluetoothLocalDeviceAddress,
+        KBTLocalDeviceAddress,
+        addressBuffer );
+    
+    // BT address was empty. BT is not turned on.
+    if ( addressBuffer.Length() == 0 )
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneAccessoryBTHandler::ShowBTAddressL.NoAddress" );
+        }
+
+    // So we got the address. Now we need the localised text:
+    HBufC* buf = StringLoader::LoadLC( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhonePhoneBtDevAddress ) , 
+        addressBuffer );
+        
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteCustom );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInformationWaitNote ) );
+    noteParam.SetText( *buf );
+
+    // Display note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+    
+    CleanupStack::PopAndDestroy( buf );               
+    }    
+
+// -----------------------------------------------------------
+// CPhoneAccessoryBTHandler::ShowBTLoopbackL
+// Handling for message EPEMessageShowBTLoopback.
+// Shows BT loopback status note.
+// -----------------------------------------------------------
+//
+void CPhoneAccessoryBTHandler::ShowBTLoopbackL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneAccessoryBTHandler::ShowBTLoopbackL( ) ");
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ))
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewClearNumberEntryContent );                      
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );   
+        }
+    TInt btLoopback( EBTDutOff );
+
+    // Get current status of BT loopback
+    TInt err = RProperty::Get( KPSUidBluetoothDutMode, KBTDutEnabled, 
+        btLoopback );
+
+    // If loopback was disabled enable it. According to current knowledge
+    // disabling BT test loop is not possible. If error getting the value
+    // assume that it is disabled.
+    if ( btLoopback == EBTDutOff || err != KErrNone )
+        {
+        // Safe to overwrite the previous error code since it is nolonger needed
+        err = RProperty::Set( KPSUidBluetoothDutMode,
+                  KBTDutEnabled,
+                  EBTDutOn );
+        if( !err )
+            {
+            btLoopback = EBTDutOn;
+            }
+        }
+
+    HBufC* btLoopbackString( NULL );
+
+    // Get localised text according to setting status
+    btLoopbackString = StringLoader::LoadLC( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( btLoopback == EBTDutOn ? 
+        EPhoneBtLoopbackEnabled : EPhoneBtLoopbackDisabled ) );
+
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteCustom );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInformationWaitNote ) );
+    noteParam.SetText( *btLoopbackString );
+    noteParam.SetTone( CAknNoteDialog::EConfirmationTone );
+
+    // Display note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+
+    CleanupStack::PopAndDestroy( btLoopbackString );
+    }
+
+// -----------------------------------------------------------
+// CPhoneAccessoryBTHandler::ShowBTActivatedL
+// Shows BT activated note.
+// -----------------------------------------------------------
+//
+void CPhoneAccessoryBTHandler::ShowBTActivatedL()
+    {
+    // Get localised text 
+    HBufC* buf = StringLoader::LoadLC( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneInfoBTAccActivated ) );
+    
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteConfirmation );
+    noteParam.SetText( *buf );
+
+    // Display note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+// ---------------------------------------------------------
+// CPhoneAccessoryBTHandler::DoSetHandsfreeModeL
+// ---------------------------------------------------------
+//
+TBool CPhoneAccessoryBTHandler::DoSetHandsfreeModeL( 
+        TBool aHandsfreeMode, TPEAudioOutput aAudioOutput )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneAccessoryBTHandler::DoSetHandsfreeModeL( ) ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), 
+        Panic( EPhoneCtrlInvariant ));
+ 
+    TBool allowed;
+    // Only toggle the handsfree mode if there is no wired accessory connected
+    if( iStateMachine->PhoneEngineInfo()->AudioOutput() != EPEWiredAudioAccessory )
+        {
+        TBool showNote = aHandsfreeMode || 
+            !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling );
+
+        iStateMachine->PhoneEngineInfo()->SetAudioOutputCommand( 
+            aAudioOutput, showNote );
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageSetAudioOutput );
+        allowed = ETrue; 
+        }
+    else
+        {
+        allowed = EFalse;   
+        }
+    return allowed;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonebtaadisconnecthandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bluetooth audio disconnection handler.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <featmgr.h>
+#include    <StringLoader.h>
+#include    <mpeengineinfo.h>
+
+#include    "phoneui.hrh"
+#include    "mphonestatemachine.h"
+#include    "mphoneviewcommandhandle.h"
+#include    "phoneconstants.h"
+#include    "cphonebtaadisconnecthandler.h"
+#include    "cphonemainresourceresolver.h"
+#include    "cphonetimer.h"
+#include    "phonelogger.h"
+#include    "phonerssbase.h"
+#include    "tphonecmdparamquery.h"
+#include    "tphonecmdparamcallstatedata.h"
+#include    "telinternalsingletonuids.h"
+#include    "cphonestatehandle.h"
+
+// CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::InstanceL
+// -----------------------------------------------------------------------------
+//
+CPhoneBtaaDisconnectHandler* CPhoneBtaaDisconnectHandler::InstanceL()
+    {
+    CPhoneBtaaDisconnectHandler* self = 
+        static_cast<CPhoneBtaaDisconnectHandler*>( CCoeEnv::Static( KUidBtaaDisconnectHandlerSingleton ) );
+
+    if ( !self )
+        {
+        self = new ( ELeave ) CPhoneBtaaDisconnectHandler;
+        }
+    
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::CPhoneBtaaDisconnectHandler
+// -----------------------------------------------------------------------------
+//
+CPhoneBtaaDisconnectHandler::CPhoneBtaaDisconnectHandler()
+    : CCoeStatic( KUidBtaaDisconnectHandlerSingleton ), iState( EIdle )
+    {
+    CPhoneStateHandle* stateHandle = CPhoneStateHandle::Instance();
+    
+    iViewCommandHandle = stateHandle->ViewCommandHandle();
+    iStateMachine = stateHandle->StateMachine();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::~CPhoneBtaaDisconnectHandler
+// -----------------------------------------------------------------------------
+//
+CPhoneBtaaDisconnectHandler::~CPhoneBtaaDisconnectHandler()
+    {
+    delete iTimer;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::HandleTimeOutL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneBtaaDisconnectHandler::HandleTimeOutL()");
+    Cancel();
+    TerminateAllCallsL();
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::Cancel
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::Cancel()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneBtaaDisconnectHandler::Cancel()");
+    TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ) );
+    DeleteAll();
+    if ( !iOldMuted && iStateMachine->PhoneEngineInfo()->AudioMute() )
+        {
+        TRAP_IGNORE ( SetMuteL( EFalse ) );
+        }
+    iOldMuted = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::LaunchQueryL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::LaunchQueryL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneBtaaDisconnectHandler::LaunchQueryL()");
+ 
+    if ( iState == ELaunchQuery )
+        {
+        // Query already available.
+        __PHONELOG( EBasic,EPhoneControl,"CPhoneBtaaDisconnectHandler::LaunchQueryL.nok");
+        return;
+        }
+   
+    if ( !iTimer )
+        {
+        iTimer = CPhoneTimer::NewL();
+        }
+
+    // Start timer.
+    iTimer->After( KPhoneBtaaConnectionLostQueryTimeout, this );
+    
+    // Mute the phone if needed.
+    iOldMuted = iStateMachine->PhoneEngineInfo()->AudioMute() ;
+    
+    if ( !iOldMuted )
+        {
+        SetMuteL( ETrue );
+        }
+        
+    iState = ELaunchQuery;
+    
+    if ( iVideoCallStatus )
+        {
+        ShowQueryL( EPhoneContinueInLoudspeakerConfirmationQuery );
+        }
+    else
+        {
+        ShowQueryL( EPhoneContinueInHandsetConfirmationQuery ); 
+        }        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::HandleConnectionLostL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::HandleConnectionLostL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneBtaaDisconnectHandler::HandleConnectionLostL()"); 
+    iVideoCallStatus = EFalse;
+           
+    if ( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+        {
+        // Fetch active call's id from view
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateConnected );
+        iViewCommandHandle->HandleCommandL( 
+            EPhoneViewGetCallIdByState, &callStateData );
+        TInt call = callStateData.CallId();
+        if ( call != KErrNotFound &&
+            iStateMachine->PhoneEngineInfo()->CallType( call ) == EPECallTypeVideo )
+            {
+            iVideoCallStatus = ETrue;
+            }
+        __PHONELOG1( EBasic, EPhoneControl, 
+                "CPhoneBtaaDisconnectHandler::HandleConnectionLostL callType: %d",
+                call != KErrNotFound ? 
+                iStateMachine->PhoneEngineInfo()->CallType( call ) : KErrNotFound );            
+        }
+ 
+    if ( iState == EIdle )
+        {
+        LaunchQueryL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::HandleQueryDismissL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::HandleQueryDismissL( 
+        TInt aCommand )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,"CPhoneBtaaDisconnectHandler::HandleQueryDismissL()");
+                                   
+    if ( aCommand == EPhoneCmdYesBtDisconnectQuery )
+        {
+     
+        // If phone was muted only for the duration of the note, unmute.
+        if ( !iOldMuted )
+            {
+            SetMuteL( EFalse );
+            }
+
+        // Activate loudspeaker when required.
+        if ( iVideoCallStatus )
+            {
+            iStateMachine->PhoneEngineInfo()->SetAudioOutputCommand( 
+                EPELoudspeaker, ETrue);
+            iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageSetAudioOutput );
+            }
+         }
+    else
+        {
+        TerminateAllCallsL();
+        //Unmute, for robustness      
+        SetMuteL( EFalse );        
+        }
+    
+    DeleteAll();
+    iOldMuted = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::DeleteAll
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::DeleteAll()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,"CPhoneBtaaDisconnectHandler::DeleteAll()");
+    
+    if ( iTimer ) 
+        {
+        if ( iTimer->IsActive() )
+            {
+            iTimer->Cancel();
+            }
+        delete iTimer;
+        iTimer = NULL;
+        }
+ 
+    iState = EIdle;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::TerminateAllCallsL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::TerminateAllCallsL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,"CPhoneBtaaDisconnectHandler::TerminateAllCallsL()");
+    
+    if( iVideoCallStatus )
+        {
+        // Fetch active call's id from view
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateConnected );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+            
+        if ( callStateData.CallId() != KErrNotFound )
+            {
+            iStateMachine->SetCallId( callStateData.CallId() );
+            iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageRelease );        
+            }
+        else
+            {
+            iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageReleaseAll );        
+            }        
+        }
+    else
+        {
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageReleaseAll );        
+        }        
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::ShowQueryL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::ShowQueryL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneBtaaDisconnectHandler::ShowQueryL( ) ");
+    //__ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    TPhoneCmdParamQuery queryParam;
+    queryParam.SetQueryType( EPhoneGlobalQueryDialog );
+  
+    HBufC* queryPrompt = StringLoader::LoadLC( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                aResourceId ));
+   
+    queryParam.SetQueryPrompt( *queryPrompt );
+    queryParam.SetDefaultCba(             
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneDisconnectingQueryCBA ) );
+  
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParam );
+    
+    CleanupStack::PopAndDestroy( queryPrompt );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::SetMuteL
+// -----------------------------------------------------------------------------
+//
+void CPhoneBtaaDisconnectHandler::SetMuteL( TBool aStatus )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneBtaaDisconnectHandler::SetMuteL( ) ");
+    
+    iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( aStatus );
+    iStateMachine->SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageSetAudioMute );    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneBtaaDisconnectHandler::IsQuery 
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneBtaaDisconnectHandler::IsQuery()
+    {
+    TBool ret = EFalse;
+    if ( iState == ELaunchQuery )
+        {
+        ret = ETrue;
+        __PHONELOG1( EBasic, EPhoneControl, 
+                     "CPhoneBtaaDisconnectHandler::IsQuery: %d", ret );
+        }
+    return ret;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonecallheadermanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,375 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bubble manager wrapper.
+*
+*/
+
+#include <mpeengineinfo.h>
+#include <StringLoader.h>
+#include "cphonecallheadermanager.h"
+#include "tphonecallheaderparam.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phoneui.pan"
+#include "phoneviewcommanddefinitions.h"
+#include "phonelogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneCallHeaderManager::CPhoneCallHeaderManager
+// ---------------------------------------------------------------------------
+//
+CPhoneCallHeaderManager::CPhoneCallHeaderManager(
+         MPhoneViewCommandHandle& aViewCommandHandle,
+         MPhoneStateMachine& aStateMachine,
+         MPhoneCustomization* aCustomization )
+   : iViewCommandHandle ( aViewCommandHandle ),
+     iStateMachine ( aStateMachine ),
+     iCustomization ( aCustomization )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::CPhoneCallHeaderManager() ");
+    }
+
+ // ---------------------------------------------------------------------------
+ // CPhoneCallHeaderManager::NewL
+ // ---------------------------------------------------------------------------
+ //
+CPhoneCallHeaderManager* CPhoneCallHeaderManager::NewL( 
+        MPhoneViewCommandHandle& aViewCommandHandle,
+        MPhoneStateMachine& aStateMachine,
+        MPhoneCustomization* aCustomization )
+     {
+     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::NewL() ");
+     CPhoneCallHeaderManager* self = new (ELeave) CPhoneCallHeaderManager(
+             aViewCommandHandle,
+             aStateMachine,
+             aCustomization );
+     
+     CleanupStack::PushL( self );
+     self->ConstructL();
+     CleanupStack::Pop( self );
+     
+     return self;
+     }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallHeaderManager::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::ConstructL() ");
+    if ( !iCallHeaderParam )
+        {
+        iCallHeaderParam = new (ELeave) TPhoneCallHeaderParam ( *this, iStateMachine );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::~CPhoneCallHeaderManager
+// ---------------------------------------------------------------------------
+//
+CPhoneCallHeaderManager::~CPhoneCallHeaderManager()
+     {
+     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::~CPhoneCallHeaderManager() ");
+     delete iCallHeaderParam;
+     }
+ 
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneCallHeaderManager::LoadResource
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::LoadResource( TDes& aData, const TInt aResource )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::LoadResource() ");
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneCallHeaderManager::LoadResource - aResource: %d", aResource );
+    StringLoader::Load(  
+            aData, CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ), 
+            CCoeEnv::Static() );
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::UpdateCallHeaderInfoL
+// ---------------------------------------------------------------------------
+//
+TPhoneCmdParamCallHeaderData CPhoneCallHeaderManager::UpdateCallHeaderInfoL( 
+        const TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::UpdateCallHeaderInfoL() ");
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    iCallHeaderParam->UpdateCallHeaderInfoL( 
+                aCallId, 
+                IsWaitingCallL( aCallId ), 
+                IsVideoCall( aCallId ), 
+                &callHeaderParam );
+
+    callHeaderParam.SetCiphering(
+        iStateMachine.PhoneEngineInfo()->IsSecureCall( aCallId ) );
+    
+    callHeaderParam.SetCipheringIndicatorAllowed(
+        iStateMachine.PhoneEngineInfo()->SecureSpecified() );
+
+    return callHeaderParam;    
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::GetRemoteInfoDataL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::GetRemoteInfoDataL( 
+        const TInt aCallId, 
+        TDes& aData ) const 
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::GetRemoteInfoDataL() ");
+    iCallHeaderParam->GetRemoteInfoDataL( aCallId, aData);
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::SetCallHeaderTextsForCallComingIn
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::SetCallHeaderTextsForCallComingIn(
+        const TInt aCallId, 
+        const TBool aWaitingCall,
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCallHeaderManager::SetCallHeaderTextsForCallComingIn() ");
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+     
+    iCallHeaderParam->SetCallHeaderTexts( 
+            aCallId, 
+            aWaitingCall, 
+            IsVideoCall( aCallId ), 
+            aCallHeaderData );
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::DisplayHeaderForCallComingInL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::DisplayHeaderForCallComingInL(
+        const TInt aCallId, 
+        const TBool aWaitingCall )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCallHeaderManager::DisplayHeaderForCallComingInL() ");
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    
+    iCallHeaderParam->SetIncomingCallHeaderParamsL( 
+            aCallId, 
+            aWaitingCall, 
+            IsVideoCall( aCallId ), 
+            &callHeaderParam );
+
+    if( iCustomization )
+        {
+        // to do modifications to call header parameters
+        // if VoIP call in question
+        iCustomization->ModifyCallHeaderTexts( aCallId, &callHeaderParam,
+            KNullDesC );
+        }
+
+    // Display call header
+    iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewCreateCallHeader, 
+            aCallId, 
+            &callHeaderParam );    
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::DisplayHeaderForOutgoingCallL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::DisplayHeaderForOutgoingCallL( const TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::DisplayHeaderForOutgoingCallL() ");
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    
+    iCallHeaderParam->SetOutgoingCallHeaderParamsL( 
+            aCallId,
+            &callHeaderParam );
+            
+    if( iCustomization )
+        {
+        // to do modifications to call header parameters
+        // if VoIP call in question
+        iCustomization->ModifyCallHeaderTexts( aCallId, &callHeaderParam,
+            KNullDesC );
+        }
+    
+    // Display call header for outgoing call
+    iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewCreateCallHeader, 
+            aCallId, 
+            &callHeaderParam );
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::IsWaitingCallL
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneCallHeaderManager::IsWaitingCallL( const TInt aCallId  ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCallHeaderManager::IsWaitingCallL() ");
+    TBool waiting( EFalse );
+    if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging )
+        {
+        TPhoneCmdParamInteger activeCallCount;
+        iViewCommandHandle.ExecuteCommandL( 
+                EPhoneViewGetCountOfActiveCalls, 
+                &activeCallCount );
+        // if there is other calls then ringing call is waiting call.
+        if( activeCallCount.Integer() > 0 )
+            {
+            waiting = ETrue;
+            }
+        }
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneCallHeaderManager::IsWaitingCallL - waiting: %d", waiting );
+    return waiting;
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::IsVideoCall
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneCallHeaderManager::IsVideoCall( const TInt aCallId ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::IsVideoCall() ");
+    if( aCallId < 0 )
+        {
+        // Illegal call id, check call type command
+        return ( iStateMachine.PhoneEngineInfo()->CallTypeCommand()
+            == EPECallTypeVideo );  
+        }
+    return ( iStateMachine.PhoneEngineInfo()->CallType( aCallId )
+            == EPECallTypeVideo );
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::SetCallHeaderType
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::SetCallHeaderType( 
+    TInt aCallHeaderType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::SetCallHeaderType() ");
+    iCallHeaderParam->SetCallHeaderType( aCallHeaderType ); 
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::~CPhoneCallHeaderManager
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneCallHeaderManager::CallHeaderType() const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::CallHeaderType() ");
+    return iCallHeaderParam->CallHeaderType();            
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCallHeaderManager::SetDivertIndication
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::SetDivertIndication( const TBool aDivertIndication )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCallHeaderManager::SetDivertIndication()");
+    iCallHeaderParam->SetDivertIndication( aDivertIndication );           
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallHeaderManager::SetPhoneNumberAvailabilityL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallHeaderManager::SetPhoneNumberAvailabilityL( 
+        const TInt aNumberLength,
+        const TBool aContactInfoAvailable )
+    {
+    __LOGMETHODSTARTEND( 
+            EPhoneControl, 
+            "CPhoneCallHeaderManager::SetPhoneNumberAvailabilityL() ");
+    TPhoneCmdParamBoolean phoneNumberAvailable;
+    if( aNumberLength || aContactInfoAvailable )
+        {
+        // Phone number is available straight or via contact info
+        // so switch to video/voice call is possible
+        __PHONELOG( EBasic, 
+                EPhoneControl, 
+                "CPhoneCallHeaderManager::SetPhoneNumberAvailabilityL - Phonenumber is available" );
+        phoneNumberAvailable.SetBoolean( ETrue );
+        }
+    else
+        {
+        __PHONELOG( EBasic, 
+                EPhoneControl, 
+                "CPhoneCallHeaderManager::SetPhoneNumberAvailabilityL - Phonenumber is not available" );
+        phoneNumberAvailable.SetBoolean( EFalse );              
+        }
+    iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewSetPhoneNumberAvailableInPhoneEngine, 
+            &phoneNumberAvailable );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallHeaderManager::LoadCallHeaderTexts
+// -----------------------------------------------------------
+//
+void CPhoneCallHeaderManager::LoadCallHeaderTexts(
+    const TInt aLabelId, 
+    const TInt aShortLabelId,
+    TPhoneCmdParamCallHeaderData* aCallHeaderData ) 
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCallHeaderManager::LoadCallHeaderTexts( ) ");
+    if ( aLabelId != EPhoneStringList )
+        {
+        TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+        LoadResource( labelText, aLabelId );
+        aCallHeaderData->SetLabelText( labelText );
+
+        if ( aShortLabelId != EPhoneStringList )
+            {
+            TBuf<KPhoneCallHeaderLabelMaxLength> shortLabelText( KNullDesC );
+            LoadResource( shortLabelText, aShortLabelId );       
+            aCallHeaderData->SetShortLabelText( shortLabelText );        
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallHeaderManager::GetInCallNumberTextL
+// -----------------------------------------------------------
+//
+void CPhoneCallHeaderManager::GetInCallNumberTextL( 
+        TInt aCallId, 
+        TDes& aData ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCallHeaderManager::GetInCallNumberTextL( ) ");    
+    // Display "Call n", n = callId-8 for video and callId+1 for voice call
+    HBufC* tmp = StringLoader::LoadL( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInCallNumberText ), 
+        aCallId + ( IsVideoCall( aCallId ) ? -8 : 1 ), 
+        CCoeEnv::Static() );
+    
+    aData = *tmp;
+    delete tmp;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonecbamanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,464 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class takes care of CBA's.
+*
+*/
+
+#include "cphonecbamanager.h"
+
+#include "mpeengineinfo.h"
+#include "mphoneviewcommandhandle.h"
+#include "mphonestatemachine.h"
+
+#include <featmgr.h>
+
+#include "phonerssbase.h"
+#include "phoneui.pan"
+#include "phonelogger.h"
+
+#include "cphonestate.h"
+#include "cphonecenrepproxy.h"
+#include "cphonemainresourceresolver.h"
+
+#include "telephonyvariant.hrh"
+#include "phoneui.hrh"
+
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneCbaManager::CPhoneCbaManager
+// ---------------------------------------------------------------------------
+//
+CPhoneCbaManager::CPhoneCbaManager(
+         CPhoneState* aState,
+         MPhoneViewCommandHandle& aViewCommandHandle,
+         MPhoneStateMachine& aStateMachine )
+   : iState ( aState ), 
+     iViewCommandHandle ( aViewCommandHandle ),
+     iStateMachine ( aStateMachine )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCbaManager::CPhoneCbaManager() ");
+    }
+
+ // ---------------------------------------------------------------------------
+ // CPhoneCbaManager::NewL
+ // ---------------------------------------------------------------------------
+ //
+CPhoneCbaManager* CPhoneCbaManager::NewL( 
+        CPhoneState* aState,
+        MPhoneViewCommandHandle& aViewCommandHandle,
+        MPhoneStateMachine& aStateMachine )
+     {
+     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCbaManager::NewL() ");
+     return new (ELeave) CPhoneCbaManager( aState, aViewCommandHandle, aStateMachine );
+     }
+
+// ---------------------------------------------------------------------------
+//  CPhoneCbaManager::~CPhoneCbaManager
+// ---------------------------------------------------------------------------
+//
+CPhoneCbaManager::~CPhoneCbaManager()
+     {
+     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneCbaManager::~CPhoneCbaManager() ");
+     }
+ 
+// ======== LOCAL FUNCTIONS ========
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneCbaManager::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCbaManager::UpdateInCallCbaL() ");
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::UpdateCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneCbaManager::UpdateCbaL( TInt aResource )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCbaManager::UpdateCbaL() ");
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    TInt resourceId = aResource;
+    TPhoneCmdParamBoolean hold;
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewGetHoldFlag, &hold );
+
+    const TBool coverHideSendEndKey =
+        CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported(
+            KTelephonyLVFlagCoverHideSendEndKey );
+
+    const TPEAudioOutput audioOutput =
+        iStateMachine.PhoneEngineInfo()->AudioOutput();
+
+    TBool btAvailable = iStateMachine.PhoneEngineInfo()->AudioOutputAvailable(
+        EPEBTAudioAccessory );
+
+    // Call setup cases
+    if ( EPhoneCallHandlingCallSetupCBA == aResource )
+        {
+        if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling) )
+            {
+            if ( audioOutput == EPELoudspeaker )
+                {
+                resourceId = EPhoneCallHandlingCallSetupToHandsetCBA;
+                }
+            else if ( audioOutput == EPEHandset )
+                {
+                resourceId = EPhoneCallHandlingCallSetupToIhfCBA;
+                }
+            }
+        }
+
+    // Is numberentry visible
+    else if ( iState->IsNumberEntryUsedL() )
+        {
+        if ( iState->IsAutoLockOn() || !(iState->IsSimOk()) )
+            {
+            resourceId = EPhoneEmptyBackCBA;
+            }
+        else
+            {
+            TBool dtmfEditorVisible = iViewCommandHandle.HandleCommandL(
+                    EPhoneViewIsDTMFEditorVisible ) ==
+                    EPhoneViewResponseSuccess;
+            TPhoneCmdParamInteger activeCallCount;
+            iViewCommandHandle.ExecuteCommandL(
+                    EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+            
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateRinging );
+            iViewCommandHandle.HandleCommandL(
+                    EPhoneViewGetCallIdByState, &callStateData );
+            
+            TInt incomingCall = callStateData.CallId();
+
+            if( dtmfEditorVisible )
+                {
+                resourceId = EPhoneDtmfDialerCBA;
+                }                    
+            else if( activeCallCount.Integer() == ENoActiveCalls )
+                {
+                resourceId = EPhoneNumberAcqCBA;
+                }
+            else if ( activeCallCount.Integer() > ENoActiveCalls &&  
+                      incomingCall > KErrNotFound )
+                {
+                resourceId = EPhoneCallHandlingCallWaitingCBA;
+                }
+            else
+                {
+                resourceId = EPhoneInCallNumberAcqCBA;
+                }
+            }
+        }
+
+    // Check is Audio muted
+    else if ( iStateMachine.PhoneEngineInfo()->AudioMute() )
+        {
+        resourceId = EPhoneCallHandlingInCallUnmuteCBA;
+        }
+
+    // Multicall swap
+    else if ( EPhoneCallHandlingNewCallSwapCBA == aResource )
+        {
+        resourceId = EPhoneCallHandlingNewCallSwapCBA;
+        }
+
+    // Call waiting cases
+    else if ( EPhoneCallHandlingCallWaitingCBA == aResource )
+        {
+        resourceId = EPhoneCallHandlingCallWaitingCBA;
+        if ( iState->IsSwivelClosed() )
+            {
+            TPhoneCmdParamInteger activeCallCount;
+            iViewCommandHandle.ExecuteCommandL(
+                    EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+            if( activeCallCount.Integer() == EOneActiveCall )
+                {
+                resourceId = EPhoneCallHandlingWaitingAnswerSwivelClosedCBA;
+                }
+            else if( activeCallCount.Integer() == ETwoActiveCalls )
+                {
+                resourceId = EPhoneCallHandlingWaitingReplaceSwivelClosedCBA;
+                }
+            }
+        }
+
+    // Check is call in hold
+    else if ( hold.Boolean() )
+        {
+        resourceId = EPhoneCallHandlingInCallUnholdCBA;
+        }
+
+    // Is BT accessory connected
+    else if ( audioOutput == EPEBTAudioAccessory &&
+              IsVoiceCallAlertingOrActiveL() &&
+              !coverHideSendEndKey )
+        {
+        resourceId = EPhoneCallHandlingInCallHandsetCBA;
+        }
+
+    else if ( audioOutput == EPEWiredAudioAccessory ||
+              coverHideSendEndKey || iState->IsSwivelClosed() )
+        {
+        resourceId = EPhoneCallHandlingInCallNoIhfCBA;
+        }
+
+    // Check BT availability
+    else if ( audioOutput == EPELoudspeaker )
+        {
+        if ( btAvailable )
+            {
+            resourceId = EPhoneCallHandlingInCallBtaaCBA;
+            }
+        else
+            {
+            resourceId = EPhoneCallHandlingInCallHandsetCBA;
+            }
+        }
+    else if ( audioOutput == EPEHandset &&  btAvailable )
+        {
+        resourceId = EPhoneCallHandlingInCallBtaaCBA;
+        }
+
+    SetCbaL( resourceId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::UpdateIncomingCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneCbaManager::UpdateIncomingCbaL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,"CPhoneCbaManager::UpdateIncomingCbaL()" );
+
+    const TBool coverHideSendEndKey =
+        CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported(
+            KTelephonyLVFlagCoverHideSendEndKey );
+
+    const TProfileRingingType ringingType =
+        iStateMachine.PhoneEngineInfo()->RingingType();
+
+    const TBool callIsAlerting =
+            !(( ringingType == EProfileRingingTypeSilent ) ||
+              ( ringingType == EProfileRingingTypeBeepOnce ));
+
+    // Update soft reject flag
+    TBool softRejectActivated( ETrue );
+    // VoIP calls do not support sms sending
+    if ( iStateMachine.PhoneEngineInfo()->CallType( aCallId ) == EPECallTypeVoIP 
+        || iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() == 0 )
+        {
+        softRejectActivated = EFalse;
+        }
+    TPhoneCmdParamBoolean softRejectParam;
+    softRejectParam.SetBoolean( softRejectActivated );
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewSetSoftRejectFlag,
+        &softRejectParam );
+
+    TInt incomingCbaResourceId;
+
+    if ( iState->IsSwivelClosed() )
+        {
+        if ( !callIsAlerting || iRingtoneSilenced )
+            {
+            incomingCbaResourceId = EPhoneCallHandlingIncomingSilentSwivelClosedCBA;
+            }
+        else
+            {
+            incomingCbaResourceId = EPhoneCallHandlingIncomingSwivelClosedCBA;
+            }
+        }
+
+    else if ( coverHideSendEndKey )
+        {
+        if ( callIsAlerting )
+            {
+            // Set CBA to Options..Silence
+            incomingCbaResourceId = EPhoneCallHandlingIncomingSliderCBA;
+            }
+        else if ( softRejectActivated )
+            {
+            // Set CBA for soft reject
+            incomingCbaResourceId = EPhoneCallHandlingIncomingSoftRejectSliderCBA;
+            }
+        else
+            {
+            // Set CBA to Options..Reject
+            incomingCbaResourceId = EPhoneCallHandlingIncomingSilentSliderCBA;
+            }
+        }
+
+    else
+        {
+        if ( callIsAlerting )
+            {
+            incomingCbaResourceId = GetIncomingCallSilenceCBA( softRejectActivated );
+            }
+        else if ( softRejectActivated )
+            {
+            // Set CBA for soft reject
+            incomingCbaResourceId = EPhoneCallHandlingIncomingSoftRejectCBA;
+            }
+        else
+            {
+            incomingCbaResourceId = EPhoneCallHandlingIncomingRejectCBA;
+            }
+        }
+
+    SetCbaL( incomingCbaResourceId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::SetCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneCbaManager::SetCbaL( TInt aResource )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,"CPhoneCbaManager::SetCbaL()" );
+
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneCbaManager::SetCbaL : %d",aResource );
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger(
+        CPhoneMainResourceResolver::Instance()->ResolveResourceID(
+        aResource ) );
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewUpdateCba,
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::UpdateCbaSwivelStateChangedL
+// -----------------------------------------------------------
+//
+void CPhoneCbaManager::UpdateCbaSwivelStateChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,"CPhoneCbaManager::UpdateCbaSwivelStateChangedL()" );
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle.HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    TInt incomingCall = callStateData.CallId();
+
+    TPhoneCmdParamInteger activeCallCount;
+    iViewCommandHandle.ExecuteCommandL(
+            EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+
+    if ( incomingCall > KErrNotFound )
+        {
+       if( activeCallCount.Integer() == ENoActiveCalls )
+            {
+            UpdateIncomingCbaL( incomingCall );
+            }
+        else
+            {
+            UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+            }
+        }
+    else if ( activeCallCount.Integer() != ENoActiveCalls )
+        {
+        UpdateInCallCbaL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::IsVoiceCallAlertingOrActiveL
+// -----------------------------------------------------------
+//
+TBool CPhoneCbaManager::IsVoiceCallAlertingOrActiveL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneCbaManager::IsVoiceCallAlertingOrActiveL()" );
+    TBool retVal = EFalse;
+
+    // Fetch alerting call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnecting );
+    iViewCommandHandle.HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+
+    if ( callStateData.CallId() > KErrNotFound )
+        {
+        TPECallType type = iStateMachine.PhoneEngineInfo()->CallType(
+            callStateData.CallId() );
+
+        if ( EPECallTypeCSVoice == type || EPECallTypeVoIP == type )
+            {
+            retVal = ETrue;
+            }
+        }
+    else
+        {
+        // Fetch active call's id from view
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateConnected );
+        iViewCommandHandle.HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+
+        if ( callStateData.CallId() > KErrNotFound )
+            {
+            TPECallType type = iStateMachine.PhoneEngineInfo()->CallType(
+                 callStateData.CallId() );
+
+            if ( EPECallTypeCSVoice == type || EPECallTypeVoIP == type )
+                {
+                retVal = ETrue;
+                }
+            }
+        }
+    return retVal;
+    }
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::SetRingtoneSilencedStatus
+// -----------------------------------------------------------
+//
+void CPhoneCbaManager::SetRingtoneSilencedStatus( const TBool aSilencedStatus )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCbaManager::SetRingtoneSilencedStatus ()" );
+    // Set the internal TBool variable
+    iRingtoneSilenced = aSilencedStatus;
+    __PHONELOG1( 
+            EBasic, 
+            EPhoneControl, 
+            "CPhoneCbaManager::SetRingtoneSilencedStatus - iRingtoneSilenced =%d", 
+            iRingtoneSilenced  );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCbaManager::GetIncomingCallSilenceCBA
+// -----------------------------------------------------------
+//
+TInt CPhoneCbaManager::GetIncomingCallSilenceCBA( 
+        const TBool /*aSoftRejectActivated*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCbaManager::GetIncomingCallSilenceCBA ()" );
+    TInt ret = EPhoneCallHandlingIncomingCBA;
+    return ret;
+    }
+
+// ======== LOCAL FUNCTIONS ========
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonedtmfwaitchartimer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CPhoneDtmfWaitCharTimer implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonedtmfwaitchartimer.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "cphonestatehandle.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneDtmfWaitCharTimer::CPhoneDtmfWaitCharTimer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneDtmfWaitCharTimer::CPhoneDtmfWaitCharTimer( MPhoneStateMachine* aStateMachine ) :
+    iTimer( NULL ),
+    iStateMachine( aStateMachine )
+    {
+        
+    }
+
+// Destructor
+CPhoneDtmfWaitCharTimer::~CPhoneDtmfWaitCharTimer()
+    {
+    if( iTimer )
+        {
+        if( iTimer->IsActive() )
+            {
+            iTimer->CancelTimer();              
+            }
+        }
+        delete iTimer;
+    }
+
+// -----------------------------------------------------------
+// CPhoneDtmfWaitCharTimer::NewL()
+// Two-phased constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneDtmfWaitCharTimer* CPhoneDtmfWaitCharTimer::NewL( 
+    MPhoneStateMachine* aStateMachine )
+    {
+    CPhoneDtmfWaitCharTimer* self = 
+        new( ELeave ) CPhoneDtmfWaitCharTimer( aStateMachine );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CPhoneDtmfWaitCharTimer::ConstructL()
+// EPOC default constructor can leave.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneDtmfWaitCharTimer::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneNoteTimer::HandleTimeOutL
+// ---------------------------------------------------------
+//
+void CPhoneDtmfWaitCharTimer::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, 
+        "CPhoneDtmfWaitCharTimer::HandleTimeOutL( ) ");
+    
+    iStateMachine->SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageContinueDTMFSending );
+    }
+
+// ---------------------------------------------------------
+// CPhoneDtmfWaitCharTimer::ButtonPressedL
+// ---------------------------------------------------------
+//
+void CPhoneDtmfWaitCharTimer::ButtonPressedL()
+    {
+    if( !iTimer )
+        {
+        iTimer = CPhoneTimer::NewL();           
+        }
+    else
+        {
+        if( iTimer->IsActive() )
+            {
+            iTimer->CancelTimer();              
+            }
+        }   
+    
+    iTimer->After( KDtmfWaitNoteTimeoutValue, this );   
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphoneenginehandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CPhoneEngineHandler implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphoneenginehandler.h"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+CPhoneEngineHandler::CPhoneEngineHandler( 
+    MPhoneStateMachine* aStateMachine ) :
+    iStateMachine( aStateMachine )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneEngineHandler::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneEngineHandler* CPhoneEngineHandler::NewL( 
+    MPhoneStateMachine* aStateMachine )
+    {
+    CPhoneEngineHandler* self = 
+        new (ELeave) CPhoneEngineHandler( aStateMachine );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneEngineHandler::DoHandleMessageL
+// -----------------------------------------------------------
+void CPhoneEngineHandler::DoHandleMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneEngineHandler::DoHandleMessageL( ) " );
+    __PHONELOG2( EBasic, EPhoneControl,
+        "CPhoneEngineHandler::DoHandleMessageL - Message received (aMessage=%d aCallId=%d)",
+            aMessage, aCallId );
+    iStateMachine->State()->HandlePhoneEngineMessageL( aMessage, aCallId );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonekeyeventforwarder.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,570 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Key event forwarder.
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikenv.h>
+#include <eikappui.h>
+#include <bldvariant.hrh>
+#include <featmgr.h>
+#include <PtiDefs.h>
+
+#include "mphonestatemachine.h"
+#include "mphonekeyeventhandler.h"
+#include "cphonekeys.h"
+#include "cphonekeyeventforwarder.h"
+#include "cphonepubsubproxy.h"
+#include "cphonetimer.h"
+#include "phonelogger.h"
+#include "phoneui.pan"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneKeyEventForwarder* CPhoneKeyEventForwarder::NewL(
+        const TRect& aRect,
+        MPhoneStateMachine* aStateMachine,
+        MPhoneViewCommandHandle* aViewCommandHandle )
+    {
+    CPhoneKeyEventForwarder* self =
+        new (ELeave) CPhoneKeyEventForwarder( aStateMachine, aViewCommandHandle );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::~CPhoneKeyEventForwarder
+// -----------------------------------------------------------------------------
+//
+CPhoneKeyEventForwarder::~CPhoneKeyEventForwarder()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::~CPhoneKeyEventForwarder");
+
+    CEikonEnv* env = static_cast<CEikonEnv*>(ControlEnv());
+    if( env )
+        {
+        env->EikAppUi()->RemoveFromStack( this );
+        }
+    delete iLongPressKeyEventTimer;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::CountComponentControls
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneKeyEventForwarder::CountComponentControls() const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::CountComponentControls");
+    return 0;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::ComponentControl
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CPhoneKeyEventForwarder::ComponentControl(
+        TInt /*aIndex*/ ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::ComponentControl");
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::SizeChanged
+// -----------------------------------------------------------------------------
+//
+void CPhoneKeyEventForwarder::SizeChanged()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::SizeChanged");
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::Draw
+// -----------------------------------------------------------------------------
+//
+void CPhoneKeyEventForwarder::Draw(
+        const TRect& /*aRect*/ ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneKeyEventForwarder::Draw");
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::OfferKeyEventL
+// Checks is hte keyevent such that the number entry can be opened
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CPhoneKeyEventForwarder::OfferKeyEventL(
+        const TKeyEvent& aKeyEvent,
+        TEventCode aType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::OfferKeyEventL");
+
+    TKeyResponse ret( EKeyWasNotConsumed );
+    TKeyEvent keyEvent = aKeyEvent;
+
+    ret = OfferKeyEventBeforeControlStackL( aKeyEvent, aType );
+
+    // Convert event. Use already converted iKeyPressedDown.
+    // Do not convert other than DTMF tones
+    if( CPhoneKeys::IsDtmfTone( aKeyEvent, aType ) )
+        {
+        keyEvent.iCode = iKeyPressedDown;
+        }
+
+    if ( !keyEvent.iRepeats )
+        {
+        // Start and stop dtmf
+        iStateMachine->State()->HandleDtmfKeyToneL( keyEvent, aType );
+        if( aType != EEventKeyUp &&
+            ( CPhoneKeys::IsNumericKey( keyEvent, aType ) ||
+              IsAlphaNumericKey( keyEvent ) )
+          )
+            {
+            // Do not open number entry with up key
+            iStateMachine->State()->HandleCreateNumberEntryL( keyEvent, aType );
+            }
+        }
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::CPhoneKeyEventForwarder
+// -----------------------------------------------------------------------------
+//
+CPhoneKeyEventForwarder::CPhoneKeyEventForwarder(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle  )
+    : iStateMachine( aStateMachine ),
+    iViewCommandHandle( aViewCommandHandle )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::CPhoneKeyEventForwarder");
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneKeyEventForwarder::ConstructL( const TRect& aRect )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::ConstructL");
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) )
+        {
+        RWindowGroup& groupWin = iCoeEnv->RootWin();
+        }
+    // Create invisible control.
+    CreateWindowL();
+    MakeVisible( EFalse );
+    SetRect( aRect );
+
+    CEikonEnv* env = static_cast<CEikonEnv*>(ControlEnv());
+    if( env )
+        {
+        env->EikAppUi()->AddToStackL(
+            this,
+            ECoeStackPriorityEnvironmentFilter,
+            ECoeStackFlagRefusesFocus );
+        }
+
+    // Create the long press key event timer
+    iLongPressKeyEventTimer = CPhoneTimer::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::IsAlphaNumericKey
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneKeyEventForwarder::IsAlphaNumericKey( const TKeyEvent& aKeyEvent )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::IsAlphaNumericKey");
+
+    TBool alphaNumeric =
+       iStateMachine->State()->IsAlphanumericSupportedAndCharInput( aKeyEvent );
+
+    return alphaNumeric;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::ConvertHalfQwertySpecialChar
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneKeyEventForwarder::ConvertHalfQwertySpecialChar( TUint& aCode,
+        const TKeyEvent& aKeyEvent )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::ConvertHalfQwertySpecialChar");
+
+    TBool ret( EFalse );
+    TInt keyboard(KErrNotFound);
+    
+    if( keyboard == EPtiKeyboardHalfQwerty )
+        {
+        switch ( aKeyEvent.iScanCode )
+           {
+           case EStdKeyLeftShift:
+               ret = ETrue;
+               aCode = KPhoneDtmfHashCharacter;
+               break;
+           case EStdKeyLeftFunc:
+               ret = ETrue;
+               aCode = KPhoneDtmfStarCharacter;
+               break;
+           case EStdKeySpace:
+               ret = ETrue;
+               aCode = KPhoneDtmf0Character;
+               break;
+           default:
+               break;
+           }
+        }
+
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneKeyEventForwarder::ConvertHalfQwertySpecialChar =%d ",
+        ret );
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::OfferKeyEventBeforeControlStackL
+// Let phone handle before other components in control stack
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CPhoneKeyEventForwarder::OfferKeyEventBeforeControlStackL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::OfferKeyEventBeforeControlStackL");
+
+    TKeyResponse response( EKeyWasNotConsumed );
+    if( !IsKeyBlocked( aKeyEvent ) )
+        {
+        // Handle key events before FEP
+        // This is must becouse FEP consumes * key and when
+        // editor is in alphanumeric mode FEP consumes all alphanumeric
+        // keys
+        switch( aType )
+            {
+             // EEventKeyDown
+            case EEventKeyDown:
+                response = HandleEventKeyDownBeforeControlStackL( aKeyEvent );
+                break;
+            // EEventKey
+            case EEventKey:
+                response = HandleEventKeyBeforeControlStackL( aKeyEvent );
+                break;
+            // EEventKeyUp
+            case EEventKeyUp:
+                response = HandleEventKeyUpBeforeControlStackL( aKeyEvent );
+                break;
+            default:
+                break;
+            }
+
+        }
+    return response;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::OfferKeyEventAfterControlStackL
+// Let phone handle keys if no one has done it already
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CPhoneKeyEventForwarder::OfferKeyEventAfterControlStackL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::OfferKeyEventAfterControlStackL");
+    
+    if( !IsKeyBlocked( aKeyEvent ) )
+        {
+        // Send key to editor
+        iStateMachine->State()->HandleKeyEventL( aKeyEvent, aType );
+        
+        if( EEventKeyUp == aType 
+                && EKeyNull != iKeyPressedDown )
+            {
+            // Handle short key press
+            iStateMachine->State()->HandleKeyMessageL( 
+                MPhoneKeyEvents::EPhoneKeyShortPress, 
+                TKeyCode( iKeyPressedDown ) );
+
+            // Reset key code
+            iScanCode = EStdKeyNull;
+            iKeyPressedDown = EKeyNull;
+            }
+        }
+
+    return EKeyWasNotConsumed;
+    }
+
+// -----------------------------------------------------------
+// CPhoneKeyEventForwarder::HandleEventKeyDownBeforeControlStackL
+// -----------------------------------------------------------
+//
+TKeyResponse CPhoneKeyEventForwarder::HandleEventKeyDownBeforeControlStackL(
+    const TKeyEvent& aKeyEvent )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::HandleEventKeyDownBeforeControlStackL");
+
+    // Convert key code
+    ConvertKeyCode( iKeyPressedDown, aKeyEvent );
+    // Save key scan code
+    iScanCode = aKeyEvent.iScanCode;
+
+    // Start the key press timer
+    iKeyPressTime.UniversalTime();
+
+    // Cancel the long press key event timer, if it is active
+    if ( iLongPressKeyEventTimer->IsActive() )
+        {
+        iLongPressKeyEventTimer->CancelTimer();
+        }
+
+    // Re-start the timer
+    iLongPressKeyEventTimer->After(
+        KPhoneLongPressKeyEventDuration,
+        TCallBack( DoHandleLongPressKeyEventCallbackL,
+        this ) );
+
+    return ( EKeyWasNotConsumed );
+    }
+
+// -----------------------------------------------------------
+// CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL
+// Both short key press event (iRepeats == 0) and
+// long key press event (iRepeats == 1) are handled here
+// -----------------------------------------------------------
+//
+TKeyResponse CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL(
+    const TKeyEvent& aKeyEvent )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::HandleEventKeyBeforeControlStackL");
+
+    TKeyResponse response( EKeyWasNotConsumed );
+
+    // Convert event.
+    TKeyEvent keyEvent = aKeyEvent;
+    keyEvent.iCode = iKeyPressedDown;
+
+    if(  aKeyEvent.iRepeats > 0 &&
+        CPhoneKeys::IsDtmfTone( keyEvent, EEventKey ) )
+        {
+        // Do not repeat dtmf characters
+        response = EKeyWasConsumed;
+        }
+
+    return response;
+    }
+
+// -----------------------------------------------------------
+// CPhoneKeyEventForwarder::HandleEventKeyUpBeforeControlStackL
+// -----------------------------------------------------------
+//
+TKeyResponse CPhoneKeyEventForwarder::HandleEventKeyUpBeforeControlStackL(
+    const TKeyEvent& aKeyEvent )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::HandleEventKeyUpBeforeControlStackL");
+
+    // Send a long press key event to the current state provided
+    // that the key scan code is the same as the key that was pressed
+    if ( iScanCode == aKeyEvent.iScanCode )
+        {
+        // Pass the key press duration to the current state
+        TTime now;
+        now.UniversalTime();
+        TTimeIntervalMicroSeconds keyPressDuration = now.MicroSecondsFrom(
+           iKeyPressTime );
+        iStateMachine->State()->HandleKeyPressDurationL(
+            TKeyCode( iKeyPressedDown ),
+            keyPressDuration );
+
+        // Cancel the long press timer, if it is active. Otherwise
+        // ignore the key event since it was already handled as a long press
+        // key event.
+        if ( iLongPressKeyEventTimer->IsActive() )
+            {
+            iLongPressKeyEventTimer->CancelTimer();
+            }
+        }
+
+    return EKeyWasNotConsumed;
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallback
+//
+// This routine is called when the long press key event timer expires
+// after KPhoneLongPressKeyEventDuration.
+// ---------------------------------------------------------
+//
+TInt CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallbackL( TAny* aAny )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::DoHandleLongPressKeyEventCallbackL");
+
+    __ASSERT_DEBUG( aAny,
+        Panic( EPhoneCtrlUnknownPanic ) );
+
+    reinterpret_cast< CPhoneKeyEventForwarder* >( aAny )->
+        HandleLongPressKeyEventL();
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeyEventForwarder::HandleLongPressKeyEventL
+// Handle long press key event
+// ---------------------------------------------------------
+//
+void CPhoneKeyEventForwarder::HandleLongPressKeyEventL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::HandleLongPressKeyEventL");
+
+    // In alphanumeric mode EEventKey-event is not received so we must
+    // compare also with scan code.
+    if ( KPhoneDtmfHashCharacter == iKeyPressedDown )
+        {
+        // Separate handling for long hash key because there is so much
+        // different functionality under it and it works differently
+        // in different protocols.
+        iStateMachine->State()->HandleLongHashL();
+        }
+    else if ( KPhoneDtmfStarCharacter == iKeyPressedDown )
+        {
+        // KPhoneDtmfStarCharacter value used in configuration file for
+        // long key press application launching
+        iStateMachine->State()->HandleKeyMessageL(
+               MPhoneKeyEvents::EPhoneKeyLongPress,
+               TKeyCode( KPhoneDtmfStarCharacter ) );
+        }
+    else
+        {
+        __PHONELOG1(
+            EBasic, EPhoneControl,
+            "CPhoneKeyEventHandler::HandleLongPressKeyEventL iCode(%d)",
+            iKeyPressedDown );
+        iStateMachine->State()->HandleKeyMessageL(
+            MPhoneKeyEvents::EPhoneKeyLongPress,
+            TKeyCode( iKeyPressedDown ) );
+        }
+
+    // Reset key code
+    iScanCode = EStdKeyNull;
+    iKeyPressedDown = EKeyNull;
+    }
+
+// -----------------------------------------------------------
+// CPhoneKeyEventForwarder::ConvertKeyCode
+// -----------------------------------------------------------
+//
+void CPhoneKeyEventForwarder::ConvertKeyCode( TUint& aCode,
+        const TKeyEvent& aKeyEvent )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneKeyEventForwarder::ConvertKeyCode");
+
+    // Handler for special device key mapping in case iScanCode
+    // to iCode conversion hasn't been handled by CAknAppUi::GetAliasKeyCodeL
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneKeyEventHandler::ConvertKeyCode scan code (%d)",
+        aKeyEvent.iScanCode );
+
+    if( !ConvertHalfQwertySpecialChar( aCode, aKeyEvent ) )
+        {
+        switch ( aKeyEvent.iScanCode )
+            {
+            case EStdKeyEnter:
+                aCode = EKeyEnter;
+                break;
+            case EStdKeyYes:
+                aCode = EKeyYes;
+                break;
+            case EStdKeyNo:
+                aCode = EKeyNo;
+                break;
+            case EStdKeyDeviceF:
+                aCode = EKeyDeviceF;  // EStdKeyDeviceF mapping for unlock switch.
+                break;
+            case EStdKeyHash:
+                aCode = KPhoneDtmfHashCharacter;
+                break;
+            case EStdKeyNkpAsterisk:
+                aCode = KPhoneDtmfStarCharacter;
+                break;              
+            case EStdKeyApplication0:
+                aCode = EKeyApplication0;
+                break;
+
+            default:
+                aCode = aKeyEvent.iScanCode; // Use default code
+                break;
+            }
+        }
+
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneKeyEventHandler::ConvertKeyCode aCode (%d)", aCode );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneKeyEventForwarder::IsKeyBlocked
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneKeyEventForwarder::IsKeyBlocked( const TKeyEvent& aKeyEvent ) const
+    {
+    TBool ret = EFalse;
+    
+    // Check blocked keys
+    const RArray<TInt>& keyScanCodeList = iStateMachine->State()->GetBlockedKeyList();
+    TInt count = keyScanCodeList.Count();
+    if( count )
+        {
+        for( TInt i = 0; i < count; i++ )
+            {
+            if( keyScanCodeList[i] == aKeyEvent.iScanCode )
+                {
+                ret = ETrue;
+                }
+            }
+        }
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneKeyEventHandler::IsKeyBlocked return (%d)", ret );
+    
+    return ret;
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonenumberentrymanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,524 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  -
+*
+*/
+
+
+#include <StringLoader.h>
+#include <featmgr.h>
+#include <eikenv.h>
+
+#include "cphonenumberentrymanager.h"
+#include "mpeengineinfo.h"
+#include "mphoneviewcommandhandle.h"
+#include "mphonestatemachine.h"
+#include "mphonecustomization.h"
+
+#include "cphonecbamanager.h"
+#include "cphonepubsubproxy.h"
+#include "cphonekeys.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phoneui.pan"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneappcommands.hrh"
+#include "phonelogger.h"
+
+const TInt  KPhoneKeyStart            = 33;
+const TInt  KPhoneKeyEnd              = 127;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneNumberEntryManager::CPhoneNumberEntryManager
+// ---------------------------------------------------------------------------
+//
+CPhoneNumberEntryManager::CPhoneNumberEntryManager(
+         CPhoneState* aState,
+         MPhoneViewCommandHandle& aViewCommandHandle,
+         MPhoneStateMachine& aStateMachine,
+         MPhoneCustomization* aCustomization,
+         CPhoneCbaManager& aCbaManager )
+   : iState ( aState ),
+     iViewCommandHandle ( aViewCommandHandle ),
+     iStateMachine ( aStateMachine ),
+     iCustomization ( aCustomization ),
+     iCbaManager ( aCbaManager ),
+     iEnv( *CEikonEnv::Static() )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::CPhoneNumberEntryManager() ");
+    }
+
+ // ---------------------------------------------------------------------------
+ // CPhoneNumberEntryManager::NewL
+ // ---------------------------------------------------------------------------
+ //
+CPhoneNumberEntryManager* CPhoneNumberEntryManager::NewL( 
+        CPhoneState* aState,
+        MPhoneViewCommandHandle& aViewCommandHandle,
+        MPhoneStateMachine& aStateMachine,
+        MPhoneCustomization* aCustomization,
+        CPhoneCbaManager& aCbaManager )
+     {
+     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NewL() ");
+     CPhoneNumberEntryManager* self = new (ELeave) CPhoneNumberEntryManager(
+             aState,
+             aViewCommandHandle,
+             aStateMachine,
+             aCustomization,
+             aCbaManager );
+     
+     CleanupStack::PushL( self );
+     self->ConstructL();
+     CleanupStack::Pop( self );
+     
+     return self;
+     }
+
+// ---------------------------------------------------------------------------
+// CPhoneNumberEntryManager::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneNumberEntryManager::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::ConstructL() ");
+    }
+
+// ---------------------------------------------------------------------------
+//  CPhoneNumberEntryManager::~CPhoneNumberEntryManager
+// ---------------------------------------------------------------------------
+//
+CPhoneNumberEntryManager::~CPhoneNumberEntryManager()
+     {
+     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::~CPhoneNumberEntryManager() ");
+     delete iNumberEntryContent;  
+     }
+ 
+// ======== LOCAL FUNCTIONS ========
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::StoreNumberEntryContentL
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::StoreNumberEntryContentL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::StoreNumberEntryContentL( ) ");
+    // Store the number entry content to cache
+    if ( !iNumberEntryContent )
+        {
+        iNumberEntryContent = HBufC::NewL( KPhoneNumberEntryBufferSize );
+        }    
+    TPtr ptr( iNumberEntryContent->Des() );
+    ptr.Zero();   
+      
+    TPhoneCmdParamInteger numberEntryCountParam;
+    iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewGetNumberEntryCount,
+            &numberEntryCountParam );
+    
+    TInt neLength( numberEntryCountParam.Integer() );
+    if ( neLength > 0 )
+        {                    
+        TPhoneCmdParamString stringParam;
+        stringParam.SetString( &ptr );
+        iViewCommandHandle.ExecuteCommandL(
+                EPhoneViewGetNumberFromEntry,
+                &stringParam );  
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::RestoreNumberEntryContentL
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::RestoreNumberEntryContentL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::RestoreNumberEntryContentL( ) ");
+    if ( iNumberEntryContent )
+        {
+        // Restore the number entry content from cache
+        TPtr ptr( iNumberEntryContent->Des() );            
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewSetNumberEntryContent, 0, ptr );
+        delete iNumberEntryContent;
+        iNumberEntryContent = NULL;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::IsNumberEntryContentStored
+// -----------------------------------------------------------
+//
+TBool CPhoneNumberEntryManager::IsNumberEntryContentStored()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::IsNumberEntryContentStored( ) ");
+    return iNumberEntryContent ? ETrue : EFalse;
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::ClearNumberEntryContentCache
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::ClearNumberEntryContentCache()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::ClearNumberEntryContentCache( ) ");
+    delete iNumberEntryContent;
+    iNumberEntryContent = NULL;
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::CreateNumberEntryL
+// -----------------------------------------------------------
+void CPhoneNumberEntryManager::CreateNumberEntryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::CreateNumberEntryL( ) ");
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewCreateNumberEntry );
+    }
+ 
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::SetNumberEntryVisibilityL
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::SetNumberEntryVisibilityL( TPhoneCmdParamBoolean aVisible )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::SetNumberEntryVisibilityL( ) ");
+    __PHONELOG1( EBasic, EPhoneControl, 
+            "CPhoneNumberEntryManager::SetNumberEntryVisibilityL : aVisible =%d", 
+            aVisible.Boolean() );
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &aVisible );
+    if ( aVisible.Boolean() )
+        {
+        // Set Number Entry CBA
+        iCbaManager.UpdateCbaL( EPhoneNumberAcqCBA );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::HandleCreateNumberEntryL
+// add conditions here regarding when NE can be opened:
+// - activeidle is not the top most application
+// - any query is not visible
+// - dialog is not visible ("new call")
+// - information note is not visible ("IMEI code", "life timer")
+// - options menu bar is not visible
+// - "switch to ..." -operation  is not ongoing
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::HandleCreateNumberEntryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::HandleCreateNumberEntryL() ");
+    
+    const TBool autoLcokOn = iState->IsAutoLockOn();
+    const TBool idleVal = false;
+    const TBool queryActive = iState->IsAnyQueryActiveL();
+    const TBool menuBarVisible = iState->IsMenuBarVisibleL();
+    
+    if( autoLcokOn || 
+        ( idleVal /*== EPSAiForeground*/ ) ||
+        ( menuBarVisible || queryActive ) )
+        {
+        __PHONELOG( EBasic, EPhoneControl, 
+             "CPhoneNumberEntryManager::HandleCreateNumberEntryL() NE NOT CREATED" );
+        __PHONELOG2( EBasic, EPhoneControl, 
+             "CPhoneNumberEntryManager::HandleCreateNumberEntryL() autoLcokOn(%d) idleVal(%d)", 
+             autoLcokOn, idleVal );
+        __PHONELOG2( EBasic, EPhoneControl, 
+             "CPhoneNumberEntryManager::HandleCreateNumberEntryL() queryActive(%d) menuBarVisible(%d)", 
+             queryActive, menuBarVisible );
+        }
+    else
+        {
+        //creates NE
+        if( ( !iStateMachine.PhoneEngineInfo()->IsSwitchToOperationOngoing () ) &&
+            ( !IsNumberEntryUsedL() ) &&
+            ( !queryActive || FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) )
+            {
+            __PHONELOG( EBasic, EPhoneControl,
+                        "CPhoneNumberEntryManager::HandleCreateNumberEntryL() --create NE" );
+            
+            if ( iState->IsNoteDismissableL() )
+                {
+                iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNote );
+                }
+            
+            TPhoneCmdParamBoolean isSecurityMode;      
+            iViewCommandHandle.ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+            if( isSecurityMode.Boolean() )
+                {
+                iState->HandleCommandL( EPhoneNumberAcqSecurityDialer );
+                }
+            else
+                {
+                // Effect is shown when dialer is created.
+                iState->BeginTransEffectLC( ENumberEntryCreate );
+                iViewCommandHandle.ExecuteCommandL( EPhoneViewCreateNumberEntry );
+                iState->EndTransEffect();
+                // Go to current state implementation
+                iCbaManager.UpdateInCallCbaL();
+                iState->UpdateInCallContextMenuL();
+                iEnv.SyncNotifyFocusObserversOfChangeInFocus();
+                }
+            }
+
+        //shows existing NE
+        if ( ( !iStateMachine.PhoneEngineInfo()->IsSwitchToOperationOngoing () ) &&
+             ( !IsNumberEntryVisibleL() ) &&
+             ( !queryActive || FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) )
+            {
+            __PHONELOG( EBasic, EPhoneControl, 
+                        "CPhoneNumberEntryManager::HandleCreateNumberEntryL() -- show NE" );
+            
+            if ( iState->IsNoteDismissableL() )
+                {
+                iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNote );
+                }
+            
+            TPhoneCmdParamBoolean booleanParam;
+            booleanParam.SetBoolean( ETrue );
+            // Show the number entry
+            SetNumberEntryVisibilityL(booleanParam);
+            }
+        }
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::IsNumberEntryUsedL
+// -----------------------------------------------------------
+//
+TBool CPhoneNumberEntryManager::IsNumberEntryUsedL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsNumberEntryUsedL( ) ");
+    return iViewCommandHandle.HandleCommandL(
+        EPhoneViewGetNumberEntryIsUsedStatus ) ==
+        EPhoneViewResponseSuccess;
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::IsNumberEntryVisibleL
+// -----------------------------------------------------------
+//
+TBool CPhoneNumberEntryManager::IsNumberEntryVisibleL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsNumberEntryVisibleL( ) ");
+    return iViewCommandHandle.HandleCommandL(
+        EPhoneViewGetNumberEntryIsVisibleStatus ) ==
+        EPhoneViewResponseSuccess;
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::PhoneNumberFromEntryLC()
+// -----------------------------------------------------------
+//
+HBufC* CPhoneNumberEntryManager::PhoneNumberFromEntryLC() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::PhoneNumberFromEntryLC( ) ");
+    HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( phoneNumber->Des() );
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+    iViewCommandHandle.ExecuteCommand(
+        EPhoneViewGetNumberFromEntry,
+        &stringParam );
+    return phoneNumber;
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::HandleNumberEntryEdited
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::HandleNumberEntryEdited()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::HandleNumberEntryEdited( ) ");
+    TBool isNumberEntryVisible( EFalse );
+    TRAP_IGNORE( isNumberEntryVisible = IsNumberEntryVisibleL() );
+
+    if( isNumberEntryVisible )
+        {
+        HBufC* phoneNumber( NULL );
+        TRAP_IGNORE( phoneNumber = HBufC::NewL( KPhoneNumberEntryBufferSize ) );
+        if( phoneNumber )
+            {
+            phoneNumber->Des().Zero();
+            TPtr ptr( phoneNumber->Des() );
+            TPhoneCmdParamString stringParam;
+            stringParam.SetString( &ptr );
+            TRAP_IGNORE( iViewCommandHandle.ExecuteCommandL(
+                    EPhoneViewGetNumberFromEntry,
+                    &stringParam ) );
+            // Save the phone number
+            iStateMachine.PhoneEngineInfo()->SetPhoneNumber( ptr );
+
+            iStateMachine.SendPhoneEngineMessage(
+                    MPEPhoneModel::EPEMessagePhoneNumberEdited );
+
+            // remove the phone number
+            delete phoneNumber;
+
+            // Set service code flag to view
+            TPhoneCmdParamBoolean serviceCodeParam;
+            serviceCodeParam.SetBoolean(
+                iStateMachine.PhoneEngineInfo()->PhoneNumberIsServiceCode() );
+            TRAP_IGNORE( iViewCommandHandle.ExecuteCommandL( 
+                    EPhoneViewSetServiceCodeFlag,
+                    &serviceCodeParam ) );
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::KeyEventForExistingNumberEntryL
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::KeyEventForExistingNumberEntryL( 
+        const TKeyEvent& aKeyEvent,
+        TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::KeyEventForExistingNumberEntryL( ) ");
+
+    TPhoneCmdParamKeyEvent keyEventParam;
+    keyEventParam.SetKeyEvent( aKeyEvent );
+    keyEventParam.SetEventCode( aEventCode );
+
+    if ( IsValidAlphaNumericKey( aKeyEvent, aEventCode ) )
+        {
+        iViewCommandHandle.HandleCommandL(
+                EPhoneViewSendKeyEventToNumberEntry, &keyEventParam );
+        }
+    else if ( aKeyEvent.iCode == EKeyBackspace )
+        {
+        TPhoneViewResponseId resp = iViewCommandHandle.HandleCommandL(
+                    EPhoneViewSendKeyEventToNumberEntry, &keyEventParam );
+
+        if ( resp == EPhoneViewResponseNumberEntryCleared )
+            {
+            // Remove number entry from screen
+            iViewCommandHandle.ExecuteCommandL(
+                EPhoneViewRemoveNumberEntry );
+
+            // Stop DTMF tone playing just in case (user might be holding down a number
+            // key when pressed 'clear' key).
+            iStateMachine.SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+
+            // Handle state-specific behaviour when number entry is
+            // cleared
+            HandleNumberEntryClearedL();
+            }
+
+        }
+    else if( aKeyEvent.iCode == EKeyLeftArrow ||
+           aKeyEvent.iCode == EKeyRightArrow ||
+           aKeyEvent.iCode == EKeyUpArrow ||
+           aKeyEvent.iCode == EKeyDownArrow )
+           {
+           iViewCommandHandle.HandleCommandL(
+               EPhoneViewSendKeyEventToNumberEntry, &keyEventParam );
+           }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntryManager::IsValidAlphaNumericKey
+// Checks is the key event a number, a special character
+// or if VoIP is enabled some other character
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneNumberEntryManager::IsValidAlphaNumericKey( 
+        const TKeyEvent& aKeyEvent,
+        TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsValidAlphaNumericKey( ) ");
+    TBool ret(EFalse);
+    const TBool numericKeyEntered( CPhoneKeys::IsNumericKey(
+          aKeyEvent, aEventCode ) );
+
+    // a numeric key (1,2,3,4,6,7,8,9,0,+,*,p,w )
+    // or
+    // a letter from fullscreen qwerty, miniqwerty or handwriting
+    // when voip is enabled.
+    if ( numericKeyEntered
+        || IsAlphanumericSupportedAndCharInput( aKeyEvent ) )
+        {
+        ret= ETrue;
+        }
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput(
+        const TKeyEvent& aKeyEvent ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput( ) ");
+    TBool ret = ( ( iCustomization &&
+                 iCustomization->AllowAlphaNumericMode() ) &&
+                 ( ( aKeyEvent.iScanCode >= KPhoneKeyStart &&
+                     aKeyEvent.iScanCode <= KPhoneKeyEnd ) ||
+                     aKeyEvent.iModifiers & EModifierSpecial ) );
+    __PHONELOG1( EBasic, EPhoneControl, 
+            "CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput: %d", ret );
+    return ret;
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::HandleNumberEntryClearedL
+// -----------------------------------------------------------
+//
+void CPhoneNumberEntryManager::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::HandleNumberEntryClearedL( ) ");
+    }
+
+// ---------------------------------------------------------
+// CPhoneNumberEntryManager::NumberEntryClearL
+// ---------------------------------------------------------
+//
+void CPhoneNumberEntryManager::NumberEntryClearL() const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NumberEntryClearL( ) ");
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewClearNumberEntryContent );
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::NumberEntryInNumericModeL
+// -----------------------------------------------------------
+//
+TBool CPhoneNumberEntryManager::NumberEntryInNumericModeL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NumberEntryInNumericModeL( ) ");
+    return iViewCommandHandle.HandleCommandL(
+        EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess;
+    }
+
+// -----------------------------------------------------------
+// CPhoneNumberEntryManager::NumberEntryToggleAlphaNumericModeL
+// -----------------------------------------------------------
+//
+TBool CPhoneNumberEntryManager::NumberEntryToggleAlphaNumericModeL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NumberEntryToggleAlphaNumericModeL( ) ");
+    TPhoneCmdParamBoolean newModeAlpha;
+    // Toggle number entry alpha/numeric mode
+    iViewCommandHandle.ExecuteCommandL(
+        EPhoneViewToggleNumberEntryAlphaNumericMode, &newModeAlpha );
+    return newModeAlpha.Boolean();
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonereconnectquery.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CPhoneReconnectQuery implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include <mpeengineinfo.h>
+#include "cphonereconnectquery.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "phonerssbase.h"
+#include "cphonetimer.h"
+#include "cphonestatehandle.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "cphonemainresourceresolver.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneReconnectQuery::CPhoneReconnectQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneReconnectQuery::CPhoneReconnectQuery() : CCoeStatic( KUidReconnectQuerySingleton ),
+    iReconQueryTimer ( NULL ),
+    iIncludeVideo( EFalse )
+    {
+    }
+
+// Destructor
+CPhoneReconnectQuery::~CPhoneReconnectQuery()
+    {
+    CancelReconnectQueryTimer();
+    }
+
+// ---------------------------------------------------------
+// CPhoneReconnectQuery::InstanceL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneReconnectQuery* CPhoneReconnectQuery::InstanceL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::InstanceL( ) ");
+    CPhoneReconnectQuery* instance = static_cast<CPhoneReconnectQuery*>(
+        CCoeEnv::Static( KUidReconnectQuerySingleton ) );
+    if ( !instance )
+        {
+        instance = new ( ELeave ) CPhoneReconnectQuery;
+        }
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhoneReconnectQuery::CancelReconnectQueryTimer
+// ---------------------------------------------------------
+//
+void CPhoneReconnectQuery::CancelReconnectQueryTimer()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::CancelReconnectQueryTimer( ) ");
+    if( iReconQueryTimer && iReconQueryTimer->IsActive() )
+        {
+        iReconQueryTimer->CancelTimer();
+        }
+    delete iReconQueryTimer;
+    iReconQueryTimer = NULL;
+    }
+
+// -----------------------------------------------------------
+// CPhoneReconnectQuery::ShowReconnectQueryL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneReconnectQuery::ShowReconnectQueryL( TBool aShowVideo )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::ShowReconnectQueryL( ) ");
+    iIncludeVideo = aShowVideo;
+    if( !iReconQueryTimer )
+        {
+        iReconQueryTimer = CPhoneTimer::NewL();
+        }
+
+    iReconQueryTimer->After( KInformationNoteDisplayTime, this );
+    }
+
+// -----------------------------------------------------------
+// CPhoneReconnectQuery::HandleTimeOutL
+// -----------------------------------------------------------
+//
+void CPhoneReconnectQuery::HandleTimeOutL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::HandleTimeOutL( ) ");
+    }
+
+// -----------------------------------------------------------
+// CPhoneReconnectQuery::OptionSelected
+// -----------------------------------------------------------
+//
+void CPhoneReconnectQuery::OptionSelected(
+    MCaUiReconnectQueryObserver::TCaUiReconType aReconType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneReconnectQuery::HandleReconConfQueryResultL( ) ");
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneReconnectQuery::HandleReconConfQueryResultL aReconType = %d",
+        aReconType );
+
+    iDisplayingQuery = EFalse;
+
+    switch( aReconType )
+        {
+        case ECallUiReconTypeVoice:
+            CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
+                ->EngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice );
+            CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
+                ->HandleMessage( MPEPhoneModel::EPEMessageDial );
+            break;
+
+        case ECallUiReconTypeVideo:
+            CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
+                ->EngineInfo()->SetCallTypeCommand( EPECallTypeVideo );
+            CPhoneStateHandle::Instance()->StateMachine()->PhoneEngine()
+                ->HandleMessage( MPEPhoneModel::EPEMessageDial );
+            break;
+
+        case ECallUiReconTypeMsg:
+            // CallUi launches message editor
+            break;
+
+        default:
+            // Do nothing
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneReconnectQuery::ShowNumberEntryL
+// -----------------------------------------------------------
+//
+void CPhoneReconnectQuery::ShowNumberEntryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneReconnectQuery::ShowNumberEntryL( ) ");
+    // Show number entry
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    CPhoneStateHandle::Instance()->ViewCommandHandle()->
+        ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
+
+    // Set Number Entry CBA
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneNumberAcqCBA ) );
+    CPhoneStateHandle::Instance()->ViewCommandHandle()->
+        ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneReconnectQuery::IsDisplayingQuery
+// -----------------------------------------------------------
+//
+TBool CPhoneReconnectQuery::IsDisplayingQuery()
+    {
+    return iDisplayingQuery;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphoneremotecontrolhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CPhoneRemoteControlHandler implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include <PhoneHandler.h>
+#include <remconcoreapitarget.h>
+#include <remconinterfaceselector.h>
+#include "cphoneremotecontrolhandler.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+CPhoneRemoteControlHandler::CPhoneRemoteControlHandler( 
+    MPhoneStateMachine* aStateMachine ) :
+    iStateMachine( aStateMachine ) 
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneRemoteControlHandler::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneRemoteControlHandler::ConstructL()
+    {
+    iInterfaceSelector = CRemConInterfaceSelector::NewL();
+    
+    iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
+    
+    iPhoneHandler = CPhoneHandler::NewL( *iInterfaceSelector );
+    
+    iInterfaceSelector->OpenTargetL();
+
+    iButtonRepeatTimer = CPeriodic::NewL( CActive::EPriorityHigh );
+    }
+
+// -----------------------------------------------------------
+// CPhoneRemoteControlHandler::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneRemoteControlHandler* CPhoneRemoteControlHandler::NewL(
+    MPhoneStateMachine* aStateMachine )
+    {
+    CPhoneRemoteControlHandler* self = 
+        new (ELeave) CPhoneRemoteControlHandler( aStateMachine );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRemoteControlHandler::~CPhoneRemoteControlHandler
+// -----------------------------------------------------------------------------
+//
+CPhoneRemoteControlHandler::~CPhoneRemoteControlHandler()
+    {
+    delete iInterfaceSelector; // it intern deletes iCoreTarget 
+    
+    if(iButtonRepeatTimer)
+        {
+        if( iButtonRepeatTimer->IsActive() ) 
+            {
+            iButtonRepeatTimer->Cancel(); 
+            }
+        delete iButtonRepeatTimer;
+        }
+    
+    delete iPhoneHandler;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRemoteControlHandler::MrccatoCommand
+//
+// A command has been received. 
+// -----------------------------------------------------------------------------
+//
+void CPhoneRemoteControlHandler::MrccatoCommand(
+    TRemConCoreApiOperationId aOperationId, 
+    TRemConCoreApiButtonAction aButtonAct )
+    {
+    __PHONELOG2( EBasic, EPhoneControl, "CPhoneRemoteControlHandler::MrccatoCommand - aOperationId(%d) aButtonAct(%d)",
+        aOperationId, aButtonAct );
+    // Save the current command parameters
+    iOperationId = aOperationId;
+    iButtonAct = aButtonAct;
+    
+    TBool handled = EFalse;
+
+    // Act on the button
+    switch ( aButtonAct )
+        {
+        case ERemConCoreApiButtonClick:
+            {
+            // Pass the remote control operation to the current state
+            TRAP_IGNORE( handled = 
+                iStateMachine->State()->
+                    HandleRemConCommandL( aOperationId, aButtonAct ) );
+            break;            
+            }
+        case ERemConCoreApiButtonPress:
+            {
+            // Pass the remote control operation to the current state
+            TRAP_IGNORE( handled = 
+                iStateMachine->State()->
+                    HandleRemConCommandL( aOperationId, aButtonAct ) );
+            // Start the button repeat timer
+            if( iButtonRepeatTimer->IsActive() ) 
+                {
+                iButtonRepeatTimer->Cancel();
+                }
+            iButtonRepeatTimer->Start(
+                KPhoneButtonRepeatDelay,
+                KPhoneButtonRepeatDelay,
+                TCallBack( DoHandleButtonRepeat, this )  );
+            break;
+            }
+        case ERemConCoreApiButtonRelease:
+            {
+            // Cancel the button repeat timer
+            if( iButtonRepeatTimer->IsActive() ) 
+                {
+                iButtonRepeatTimer->Cancel();
+                }
+            break;
+            }
+        default:
+            break;
+        }
+        
+    // send a response if the operation was handled
+    if ( handled )
+        {        
+        TRequestStatus status;
+        
+        switch ( aOperationId )
+            {
+            case ERemConCoreApiVolumeUp:
+                iCoreTarget->VolumeDownResponse( status, KErrNone );
+                User::WaitForRequest( status );
+                break;
+                
+            case ERemConCoreApiVolumeDown:
+                iCoreTarget->VolumeUpResponse( status, KErrNone );
+                User::WaitForRequest( status );
+                break;
+
+            default:
+                break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRemoteControlHandler::DoHandleButtonRepeat
+// -----------------------------------------------------------------------------    
+//
+TInt CPhoneRemoteControlHandler::DoHandleButtonRepeat( TAny* aAny )
+    {
+    CPhoneRemoteControlHandler* self = 
+        reinterpret_cast<CPhoneRemoteControlHandler*>( aAny );
+
+    __PHONELOG2( EBasic, EPhoneControl, "CPhoneRemoteControlHandler::DoHandleButtonRepeat iOperationId(%d) iButtonAct(%d)",
+        self->iOperationId, self->iButtonAct );
+    // Pass the remote control operation to the current state
+    TRAP_IGNORE( self->iStateMachine->State()->
+                    HandleRemConCommandL( self->iOperationId, 
+                                          self->iButtonAct ) );
+
+    return KErrNone;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestate.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,4768 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneState class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <avkon.rsg>
+#include <bautils.h>
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <pevirtualengine.h>
+#include <mpeclientinformation.h>
+#include <mpeengineinfo.h>
+#include <cpephonemodelif.h>
+#include <featmgr.h>
+#include <rconnmon.h>
+#include <Profile.hrh>
+#include <PUAcodes.hrh>
+#include <AknUtils.h>
+#include <telephonyvariant.hrh>
+#include <aknsoundsystem.h>
+#include <wlaninternalpskeys.h>
+#include <btengdomainpskeys.h>
+#include <btengdomaincrkeys.h>
+#include <settingsinternalcrkeys.h>
+#include <starterclient.h>
+#include <rsssettings.h>
+#include <UikonInternalPSKeys.h>
+#include <telephonydomainpstypes.h>
+#include <telinformationpskeys.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <mccecall.h>
+#include <ccpdefs.h>
+#include <LogsDomainCRKeys.h>
+#include <spsettings.h>
+#include <startupdomainpskeys.h>
+#include <MediatorDomainUIDs.h>
+#include <videotelcontrolmediatorapi.h>
+#include <textresolver.h>
+#include <phoneappvoipcommands.hrh>
+#include <hwrmdomainpskeys.h>
+
+#include "phoneui.pan"
+#include "cphonestate.h"
+#include "mphonestatemachine.h"
+#include "mphoneviewcommandhandle.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamkeyevent.h"
+#include "tphonecmdparamdynmenu.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamincallindicatordata.h"
+#include "tphonecmdparamnote.h"
+#include "tphonecmdparamkeycapture.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparambitmap.h"
+#include "tphonecmdparamaudiooutput.h"
+#include "tphonecmdparamaudioavailability.h"
+#include "tphonecmdparamappinfo.h"
+#include "tphonecmdparamtranseffect.h"
+#include "tphonecmdparamringtone.h"
+#include "tphonecmdparamcustomdialer.h"
+#include "cphonekeys.h"
+#include "phoneui.hrh"
+#include "phonerssbase.h"
+#include "cphonebtaadisconnecthandler.h"
+#include "cphonemainresourceresolver.h"
+#include "cphonecenrepproxy.h"
+#include "cphonepubsubproxy.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phonelogger.h"
+#include "phonestatedefinitions.h"
+#include "cphonetimer.h"
+#include "cphonereconnectquery.h"
+#include "mphoneerrormessageshandler.h"
+#include "cphoneclearblacklist.h"
+#include "mphonecustomization.h"
+#include "cphonemainerrormessageshandler.h"
+#include "cphoneaccessorybthandler.h"
+#include "cphonemediatorfactory.h"
+#include "mphonemediatormessage.h"
+#include "cphonemediatorsender.h"
+#include "cphonereleasecommand.h"
+#include "cphonecontinueemergencycallcommand.h"
+#include "cphonecallheadermanager.h"
+#include "cphonenumberentrymanager.h"
+#include "tphonecmdparamsfidata.h" 
+#include "mphonestorage.h"
+#include "phoneconstants.h"
+#include "cphoneclearblacklist.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+EXPORT_C CPhoneState::CPhoneState(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aCustomization) :
+    iStateMachine( aStateMachine ),
+    iViewCommandHandle( aViewCommandHandle ),
+    iCustomization( aCustomization ),
+    iEnv( *CEikonEnv::Static() )
+    {
+    // Need to get current SimState for inherited classis
+    iPreviousSimState = SimState();
+    __ASSERT_ALWAYS(
+        aStateMachine && aViewCommandHandle,
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        iOnScreenDialer = ETrue;
+        }
+    }
+
+EXPORT_C void CPhoneState::BaseConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::BaseConstructL() ");
+    if ( !iCbaManager )
+        {
+        iCbaManager = CPhoneCbaManager::NewL(
+                        this,
+                        *iViewCommandHandle,
+                        *iStateMachine );
+        }
+    }
+
+EXPORT_C CPhoneState::~CPhoneState()
+    {
+    if( iAlsLineChangeKeyPressTimer )
+        {
+        if( iAlsLineChangeKeyPressTimer->IsActive() )
+            {
+            iAlsLineChangeKeyPressTimer->CancelTimer();
+            }
+        delete iAlsLineChangeKeyPressTimer;
+        }
+    delete iNumberEntryManager;
+    delete iCallHeaderManager;
+    delete iCbaManager;
+    }
+
+// <-------------------------- PHONE ENGINE EVENTS --------------------------->
+
+// -----------------------------------------------------------
+// CPhoneState::HandlePhoneEngineMessageL
+// Default handling for Phone Engine messages
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandlePhoneEngineMessageL(
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneEngineMessageL() ");
+
+    CPhoneAccessoryBTHandler* accessoryBtHandler;
+
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageNetworkRegistrationStatusChange:
+            {
+            __PHONELOG1( EBasic, EPhoneControl,
+               "PHONEUI_ERROR: EPEMessageNetworkRegistrationStatusChange - RegistrationStatus =%d ",
+               iStateMachine->PhoneEngineInfo()->NetworkRegistrationStatus());
+            }
+            break;
+
+        case MEngineMonitor::EPEMessageAudioMuteChanged:
+            HandleAudioMuteChangedL();
+            break;
+
+        case MEngineMonitor::EPEMessageAudioOutputChanged:
+            HandleAudioOutputChangedL();
+            // Go to current state implementation
+            iCbaManager->UpdateInCallCbaL();
+            break;
+
+        case MEngineMonitor::EPEMessageAvailableAudioOutputsChanged:
+            HandleAudioAvailableOutputChangedL();
+            if ( iStateMachine->PhoneEngineInfo()->AudioOutput() != EPENotActive )
+                {
+                // Go to current state implementation
+                iCbaManager->UpdateInCallCbaL();
+                }
+            break;
+
+        case MEngineMonitor::EPEMessageChangedCallDuration:
+            HandleChangedCallDurationL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageRemoteBusy:
+            HandleRemoteBusyL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageCallWaiting:
+            SendGlobalInfoNoteL( EPhoneWaitingText );
+            break;
+
+        case MEngineMonitor::EPEMessageProfileChanged:
+            {
+            TPhoneCmdParamBoolean keypadVolumeParam;
+            if ( iStateMachine->PhoneEngineInfo()->KeypadVolume() == 0 )
+                {
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioDisabled );
+                }
+            else
+                {
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewKeypadAudioEnabled );
+                }
+            UpdateProfileDisplayL();
+            }
+            break;
+
+        case MEngineMonitor::EPEMessageRemoteTerminated:
+            // Close menu bar, if it is displayed, for call ending note
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+            /* Flow through */
+        case MEngineMonitor::EPEMessageDisconnecting:
+            HandleDisconnectingL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageTransferDone:
+            SendGlobalInfoNoteL( EPhoneInCallTransferred );
+            break;
+
+       case MEngineMonitor::EPEMessageInitiatedEmergencyCall:
+            HandleInitiatedEmergencyCallL( aCallId );
+            break;
+
+       case MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo:
+           HandleInitiatedEmergencyWhileActiveVideoL();
+           break;
+
+        case MEngineMonitor::EPEMessageShowIMEI:
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+            HandleShowImeiL();
+            break;
+
+        case MEngineMonitor::EPEMessageCallSecureStatusChanged:
+            HandleCallSecureStatusChangeL( aCallId );
+
+            if ( iCustomization )
+                {
+                iCustomization->HandlePhoneEngineMessageL( aMessage,
+                    aCallId );
+                }
+            break;
+
+        case MEngineMonitor::EPEMessageActivateWarrantyMode:
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+            HandleShowLifeTimerL();
+            break;
+
+        case MEngineMonitor::EPEMessageIssuingUSSDRequest:
+            {
+             // Enable global notes
+            TPhoneCmdParamBoolean globalNotifierParam;
+            globalNotifierParam.SetBoolean( EFalse );
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewSetGlobalNotifiersDisabled,
+                &globalNotifierParam );
+
+            if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() )
+                {
+                // Remove number entry from screen
+                iViewCommandHandle->ExecuteCommandL(
+                    EPhoneViewRemoveNumberEntry );
+                }
+            else if ( IsOnScreenDialerSupported() )
+                {
+                NumberEntryClearL();
+                }
+            }
+            break;
+
+        case MEngineMonitor::EPEMessageIssuedUSSDRequest:
+            // Go to current state implementation
+            iCbaManager->UpdateInCallCbaL();
+            break;
+
+        // *#9990#
+        case MEngineMonitor::EPEMessageShowBTLoopback:
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+            accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC(
+                iViewCommandHandle, iStateMachine, this );
+            accessoryBtHandler->ShowBTLoopbackL();
+            CleanupStack::PopAndDestroy( accessoryBtHandler );
+            break;
+
+        // *#2820#
+        case MEngineMonitor::EPEMessageShowBTDeviceAddress:
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+            accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC(
+                iViewCommandHandle, iStateMachine, this );
+            accessoryBtHandler->ShowBTAddressL();
+            CleanupStack::PopAndDestroy( accessoryBtHandler );
+            break;
+
+        // *#7370#
+        case MEngineMonitor::EPEMessageActivateRfsDeep:
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+            // Launch RFS
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsDeep );
+            if ( !IsOnScreenDialerSupported() )
+                {
+                // Do state-specific operation when number entry is cleared
+                HandleNumberEntryClearedL();
+                }
+            break;
+
+        // *#7780#
+        case MEngineMonitor::EPEMessageActivateRfsNormal:
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+            // Launch RFS
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchRfsNormal );
+            if ( !IsOnScreenDialerSupported() )
+                {
+                // Do state-specific operation when number entry is cleared
+                HandleNumberEntryClearedL();
+                }
+            break;
+        // *#62209526#
+        case MEngineMonitor::EPEMessageShowWlanMacAddress:
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+            ShowWlanMacAddressL();
+            break;
+
+        case MEngineMonitor::EPEMessageThumbnailLoadingCompleted:
+            // Update call buble
+            UpdateRemoteInfoDataL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
+            UpdateRemoteInfoDataL ( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageSIMStateChanged:
+            __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::HandlePhoneEngineMessageL - simStateChanged =%d", SimState()  );
+            HandleSimStateChangedL();
+            break;
+
+        case MEngineMonitor::EPEMessageShowIncCallGroupIndex:
+            HandleCugInUseNoteL();
+            break;
+
+        // *#2873#
+        case MEngineMonitor::EPEMessageBTDebugMode:
+            accessoryBtHandler = CPhoneAccessoryBTHandler::NewLC(
+                iViewCommandHandle, iStateMachine, this );
+            accessoryBtHandler->SetBTDebugModeL();
+            CleanupStack::PopAndDestroy( accessoryBtHandler );
+            break;
+
+        default:
+
+            TBool handled( EFalse );
+
+            if ( iCustomization )
+                {
+                handled = iCustomization->HandlePhoneEngineMessageL(
+                                aMessage, aCallId );
+                }
+
+            if ( EFalse == handled )
+                {
+                MPhoneMediatorMessage* mediatorMessage = CPhoneMediatorFactory::Instance()->MediatorMessage( aMessage, aCallId );
+                if( mediatorMessage )
+                    {
+                    CleanupDeletePushL( mediatorMessage );
+                    mediatorMessage->ExecuteL();
+                    CleanupStack::PopAndDestroy( mediatorMessage );
+                    mediatorMessage = NULL;
+                    }
+                }
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleAudioMuteChangedL
+// Default handling for EPEMessageAudioMuteChanged message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleAudioMuteChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioMuteChangedL() ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    TPhoneCmdParamBoolean booleanParam;
+    const TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute();
+    booleanParam.SetBoolean( audioMute );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateMuteUIChanges,
+        &booleanParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleAudioOutputChangedL
+// Default handling for EPEMessageAudioOutputChanged message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleAudioOutputChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioOutputChangedL() ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    TPhoneCmdParamAudioOutput outputParam;
+
+    // Output
+    const TPEAudioOutput audioOutput =
+        iStateMachine->PhoneEngineInfo()->AudioOutput();
+    outputParam.SetAudioOutput( audioOutput );
+
+    // view update
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioPathUIChanges,
+        &outputParam );
+
+    // Previous Output
+    TPEPhoneAudioRouteParameters RouteParameters = iStateMachine->
+        PhoneEngineInfo()->RouteParameters();
+    const TPEAudioOutput previousOutput =
+        RouteParameters.iPreviousOutput;
+
+    // BT availability
+    TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable(
+            EPEBTAudioAccessory );
+
+    // Show note or BT disconnect handler
+    if ( audioOutput != EPENotActive &&
+         previousOutput == EPEBTAudioAccessory &&
+         !btAvailable )
+        {
+        CPhoneBtaaDisconnectHandler::InstanceL()->HandleConnectionLostL();
+        }
+    else if ( audioOutput == EPEBTAudioAccessory && 
+            previousOutput != EPEBTAudioAccessory &&
+            btAvailable )
+        {
+        CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC(
+            iViewCommandHandle, iStateMachine, this );
+        bt->ShowBTActivatedL();
+        CleanupStack::PopAndDestroy( bt );
+        }
+    else if ( audioOutput == EPENotActive &&
+              CPhoneBtaaDisconnectHandler::InstanceL()->IsQuery() )
+        {
+        CPhoneBtaaDisconnectHandler::InstanceL()->Cancel();
+        }
+    else if ( RouteParameters.iShowNote && audioOutput == EPELoudspeaker )
+        {
+        CAknKeySoundSystem* keySounds =
+               static_cast<CAknAppUi*>( iEnv.EikAppUi() )->KeySounds();
+        keySounds->PlaySound( EAvkonSIDIHFActive );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleSimStateChangedL
+// Handles changes in the SIM card state.
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleSimStateChangedL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleSimStateChangedL()" );
+    CPhoneMainResourceResolver& resolver = *CPhoneMainResourceResolver::Instance();
+    TPESimState simState = SimState();
+
+    __PHONELOG2( EBasic, EPhoneControl, "SIM state was changed from %d to %d", iPreviousSimState, simState );
+
+    switch ( simState )
+        {
+        case EPESimUsable: // Falls through.
+        case EPESimReadable: // Falls through.
+        case EPESimNotReady:
+            {
+            if ( iPreviousSimState == EPESimNotPresent )
+                {
+                __PHONELOG( EBasic, EPhoneControl, "SIM card was inserted, rebooting the phone" );
+                RStarterSession starterSession;
+                User::LeaveIfError( starterSession.Connect() );
+                CleanupClosePushL( starterSession );
+
+                HBufC* queryText = StringLoader::LoadLC( resolver.ResolveResourceID( EPhoneRebootRequired ) );
+
+                TPhoneCmdParamQuery queryParams;
+                queryParams.SetCommandParamId( TPhoneCommandParam::EPhoneParamRebootQuery );
+                queryParams.SetQueryPrompt( *queryText );
+                queryParams.SetDefaultCba( R_AVKON_SOFTKEYS_OK_EMPTY );
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParams );
+
+                starterSession.Reset( RStarterSession::ESIMStatusChangeReset );
+                CleanupStack::PopAndDestroy( 2, &starterSession ); // queryText
+                }
+            break;
+            }
+        case EPESimNotPresent:
+            {
+            if ( iPreviousSimState == EPESimUsable ||
+                 iPreviousSimState == EPESimReadable ||
+                 iPreviousSimState == EPESimNotReady )
+                {
+                __PHONELOG( EBasic, EPhoneControl, "SIM card was removed" );
+
+                TPhoneCmdParamGlobalNote globalNoteParam;
+                globalNoteParam.SetType( EAknGlobalInformationNote );
+                globalNoteParam.SetTone( EAvkonSIDNoSound );
+
+                globalNoteParam.SetTextResourceId(
+                    CPhoneMainResourceResolver::Instance()->
+                    ResolveResourceID( EPhoneSimRemoved ) );
+
+                iViewCommandHandle->ExecuteCommandL(
+                    EPhoneViewShowGlobalNote, &globalNoteParam );
+
+                }
+            // Show security note, if SIM not present and KFeatureIdFfSimlessOfflineSupport is disabled.
+            else if ( !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) &&
+                    ( iPreviousSimState != EPESimNotSupported ) )
+                {
+                StartShowSecurityNoteL();
+                }
+            break;
+            }
+        default:
+            break;
+        }
+
+    iPreviousSimState = simState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsValidAlphaNumericKey
+// Checks is the key event a number, a special character
+// or if VoIP is enabled some other character
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneState::IsValidAlphaNumericKey( const TKeyEvent& aKeyEvent,
+        TEventCode aEventCode )
+    {
+    TBool ret(EFalse);
+
+    const TBool numericKeyEntered( CPhoneKeys::IsNumericKey(
+          aKeyEvent, aEventCode ) );
+
+    // a numeric key (1,2,3,4,6,7,8,9,0,+,*,p,w )
+    // or
+    // a letter from fullscreen qwerty, miniqwerty or handwriting
+    // when voip is enabled
+    if ( numericKeyEntered
+        || IsAlphanumericSupportedAndCharInput( aKeyEvent ) )
+        {
+        ret= ETrue;
+        }
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::CustomizeCBAForPhoneNumber
+//
+// -----------------------------------------------------------------------------
+//
+void CPhoneState::CustomizeCbaForPhoneNumberL()
+    {
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) &&
+         iCustomization &&
+         iCustomization->AllowAlphaNumericMode() )
+        {
+        // Get the number entry contents
+        HBufC* phoneNumber = PhoneNumberFromEntryLC();
+
+        TPhoneCmdParamInteger integerParam;
+
+        //only charaters from set { 0, .., 9, *, #, +, p, w, P, W } used
+        if ( CPhoneKeys::Validate( phoneNumber->Des()) )
+            {
+            integerParam.SetInteger( CPhoneMainResourceResolver::Instance()->
+                                    ResolveResourceID( EPhoneNumberAcqCBA ) );
+            }
+        //other characters
+        else
+            {
+            integerParam.SetInteger( iCustomization->CustomizeSoftKeys() );
+            }
+
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateCba, &integerParam );
+        CleanupStack::PopAndDestroy( phoneNumber );
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsTouchDTmfDialerOn
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneState::IsTouchDTmfDialerOn() const
+    {
+    TBool status( EFalse );
+    if ( IsOnScreenDialerSupported() )
+        {
+        TBool isDialerVisible( EFalse );
+        TRAP_IGNORE( isDialerVisible = IsDTMFEditorVisibleL() );
+
+        if ( isDialerVisible )
+            {
+            status = ETrue;
+            }
+        }
+    return status;
+    }
+// -----------------------------------------------------------------------------
+// CPhoneState::SendDtmfKeyEventL
+// send dtmf event when,
+// -touch dtmf dialer is NOT visible
+// -query is not active
+// -menubar is not open
+// -----------------------------------------------------------------------------
+//
+void CPhoneState::SendDtmfKeyEventL( const TKeyEvent& aKeyEvent,
+               TEventCode aEventCode  )
+    {
+
+    if ( !IsTouchDTmfDialerOn()
+        && !IsAnyQueryActiveL()
+        && !IsMenuBarVisibleL() )
+        {
+        // Send the key event to the phone engine.
+        SendKeyEventL( aKeyEvent, aEventCode );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsKeyEventFurtherProcessed
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneState::IsKeyEventFurtherProcessedL( const TKeyEvent& aKeyEvent ) const
+    {
+    // While being in some special keyboard mode (Full Screen&mini QWERTY,
+    // handwriting mode) FEP sends only EEventKey -event and thus manual
+    // DTMFs can not be played with the user specified tone lengths. Also,
+    // in general, DTMFs are tried to play only in numeric mode.
+    TBool numericMode = iViewCommandHandle->HandleCommandL(
+      EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess;
+
+    if ( ( aKeyEvent.iModifiers & EModifierSpecial ) != 0 || !numericMode )
+        {
+        return EFalse;
+        }
+
+    return ETrue;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleErrorL
+// Default handling for HandleError message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleErrorL( const TPEErrorInfo& aErrorInfo )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleErrorL()");
+
+    __PHONELOG1( EBasic, EPhoneControl,
+            "PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iErrorCode =%d ",
+            aErrorInfo.iErrorCode );
+
+    __PHONELOG1( EBasic, EPhoneControl,
+        "PhoneUIControl: CPhoneState::HandleErrorL - aErrorInfo.iCallId =%d ",
+        aErrorInfo.iCallId );
+
+
+    // Sets touch buttons to correct status if error has occured.
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons );
+        }
+
+    // Do the common error handling (display proper notes etc)
+    CPhoneMainErrorMessagesHandler::Instance()->ShowErrorSpecificNoteL( aErrorInfo );
+
+    switch( aErrorInfo.iErrorCode )
+        {
+        case ECCPErrorCCUserAlertingNoAnswer:
+        case ECCPErrorCCResourceNotAvailable:
+            {
+            if( aErrorInfo.iCallId > KErrNotFound )
+                {
+                if ( iStateMachine->PhoneEngineInfo()->CallDirection(
+                        aErrorInfo.iCallId ) != RMobileCall::EMobileTerminated )
+                    {
+                    if( IsVideoCall( aErrorInfo.iCallId ) )
+                        {
+                        // Active MO video call lost 3G network.
+                        __PHONELOG1( EBasic, EPhoneControl,
+                        "PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 1, callid%d ",
+                        aErrorInfo.iCallId );
+                        CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue );
+                        }
+                    else
+                        {
+                         __PHONELOG1( EBasic, EPhoneControl,
+                            "PhoneUIControl: CPhoneState::HandleErrorL - No video call =%d ",
+                            aErrorInfo.iCallId );
+                        }
+                    }
+                }
+            }
+            break;
+
+            case ECCPErrorCCServiceNotAvailable:
+                {
+                if( IsVideoCall( aErrorInfo.iCallId ) )
+                    {
+                    CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( EFalse );
+                    }
+                }
+                break;
+
+            case ECCPErrorBadRequest:
+                {
+                TPECallType callType =
+                    iStateMachine->PhoneEngineInfo()->CallTypeCommand();
+
+                if( callType == EPECallTypeVideo )
+                    {
+                        // Dialling MO video call cannot reach 3G network.
+                        __PHONELOG1( EBasic, EPhoneControl,
+                            "PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 2, callid%d ",
+                            aErrorInfo.iCallId );
+                        CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue );
+                    }
+                }
+                break;
+
+        case ECCPErrorVideoCallNotSupportedByNetwork:
+        case ECCPErrorVideoCallSetupFailed:
+        case ECCPErrorNotReached:
+           // If call id found and seems to be Video Call
+            if ( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                // Get active call count
+                TPhoneCmdParamInteger activeCallCount;
+                iViewCommandHandle->ExecuteCommandL(
+                    EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+
+                if ( activeCallCount.Integer() == 0
+                     || iStateMachine->PhoneEngineInfo()->CallDirection(
+                        aErrorInfo.iCallId ) != RMobileCall::EMobileTerminated )
+                    {
+                    // Dialling MO video call attempted in 2G network or
+                    // dialing MO video to unvalid number
+                    // Reconnect query include video label if errorcode is unvalid number.
+                    __PHONELOG1( EBasic, EPhoneControl,
+                    "PhoneUIControl: CPhoneState::HandleErrorL - ShowReconnectQueryL vid 3, callid%d ",
+                    aErrorInfo.iCallId );
+                    CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL(
+                              ECCPErrorNotReached == aErrorInfo.iErrorCode );
+                    }
+                }
+            break;
+
+        case ECCPErrorNoService:
+            // No network -> hide volume popup
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
+            break;
+
+        case ECCPErrorSatControl:
+            {
+            // check, that there really was a call established before completing SAT request
+            if( aErrorInfo.iCallId != KPECallIdNotUsed )
+                {
+                }
+
+            // remove number entry
+            if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() )
+                {
+                iViewCommandHandle->ExecuteCommandL(
+                    EPhoneViewRemoveNumberEntry );
+                }
+            else if ( IsOnScreenDialerSupported() )
+                {
+                NumberEntryClearL();
+                }
+            }
+            break;
+
+        default:
+            break;
+        }
+
+    // clear call blacklist if call failure occurs
+    CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleChangedCallDurationL
+// Default handling for EPEMessageChangedCallDuration message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+void CPhoneState::HandleChangedCallDurationL( TInt aCallId )
+    {
+     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleChangedCallDurationL() ");
+    // Get the call duration
+    TTimeIntervalSeconds seconds =
+        iStateMachine->PhoneEngineInfo()->CallDuration( aCallId );
+
+    TPhoneCmdParamInteger time;
+    time.SetInteger(seconds.Int());
+    iViewCommandHandle->ExecuteCommandL(EPhoneViewUpdateCallHeaderCallDuration, aCallId, &time);
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::HandleRemoteBusyL
+// -----------------------------------------------------------------------------
+//
+void CPhoneState::HandleRemoteBusyL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleRemoteBusyL( ) ");
+    ShowNumberBusyNoteL();
+
+    const TPECallType callType =
+        iStateMachine->PhoneEngineInfo()->CallTypeCommand();
+
+    if( callType == EPECallTypeVideo )
+        {
+         // Launch reconnect query including video call menu item
+         __PHONELOG1( EBasic, EPhoneControl,
+            "PhoneUIControl: CPhoneState::HandleRemoteBusyL - ShowReconnectQueryL vid 5, callid%d ",
+                aCallId );
+        CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleDisconnectingL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleDisconnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleDisconnectingL( ) ");
+    // If there is no call in connected state then EPhoneDtmfTextQuery and EPhoneDtmfListQueryDialog
+    // must be dismmissed from UI, therefore we must set EPhoneViewSetNoConnectedCalls to ETrue this
+    // way we can ensure that CPhoneQueryController doesnt relaunch EPhoneDtmfListQueryDialog.
+    if ( !IsAnyConnectedCalls() )
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean(ETrue);
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNoConnectedCalls, &booleanParam );
+        }
+
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateDisconnecting );
+
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    LoadResource( labelText, EPhoneInCallDisconnected );
+
+    callHeaderParam.SetLabelText( labelText );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
+        &callHeaderParam );    
+
+    CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsCustomizedDialerVisibleL()
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsCustomizedDialerVisibleL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsCustomizedDialerVisibleL( ) ");
+    return iViewCommandHandle->HandleCommandL(
+        EPhoneIsCustomizedDialerVisible ) == EPhoneViewResponseSuccess;
+    }
+
+// <------------------------------- KEY EVENTS ------------------------------->
+
+// -----------------------------------------------------------
+// CPhoneState::HandleKeyMessageL( aMessage, aKeyCode )
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleKeyMessageL(
+    TPhoneKeyEventMessages /*aMessage*/,
+    TKeyCode /*aKeyCode*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyMessageL( ) ");
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode )
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyEventL( ) ");
+    if ( ( IsNumberEntryVisibleL() ) || OnlySideVolumeKeySupported() )
+        {
+        // Handle numeric keys when key events are received in single state
+        HandleNumericKeyEventL( aKeyEvent, aEventCode );
+        }
+    else if ( aKeyEvent.iScanCode == EStdKeyUpArrow &&
+              aEventCode == EEventKey )
+        {
+        // Increace audio volume
+        IncreaseAudioVolumeL();
+        }
+    else if ( aKeyEvent.iScanCode == EStdKeyDownArrow &&
+            aEventCode == EEventKey )
+        {
+        // Decreace audio volume
+        DecreaseAudioVolumeL();
+        }
+    else
+        {
+        // Handle numeric keys when key events are received in single state
+        HandleNumericKeyEventL( aKeyEvent, aEventCode );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::OnlySideVolumeKeySupported
+// -----------------------------------------------------------
+//
+TBool CPhoneState::OnlySideVolumeKeySupported()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::OnlySideVolumeKeySupported( ) ");
+    TBool onlySideVolumeKeySupported(EFalse);
+    if ( !CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagScrollVolumeKeys ) &&
+         FeatureManager::FeatureSupported( KFeatureIdSideVolumeKeys ) )
+        {
+        onlySideVolumeKeySupported = ETrue;
+        }
+    __PHONELOG1( EBasic, EPhoneControl,
+            "OnlySideVolumeKeySupported: %d",
+            onlySideVolumeKeySupported );
+    return onlySideVolumeKeySupported;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleKeyPressDurationL( aScanCode, aKeyPressDuration )
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleKeyPressDurationL(
+    TKeyCode aCode,
+    TTimeIntervalMicroSeconds /*aKeyPressDuration*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyPressDurationL( ) ");
+
+    if( aCode == KPhoneDtmfHashCharacter )
+        {
+        if( iAlsLineChangeKeyPressTimer )
+            {
+            if( iAlsLineChangeKeyPressTimer->IsActive() )
+                {
+                iAlsLineChangeKeyPressTimer->Cancel();
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsNoteVisibleL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsNoteVisibleL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNoteVisibleL( ) ");
+    TPhoneCmdParamBoolean booleanParam;
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewGetIsNoteVisible, &booleanParam );
+    return booleanParam.Boolean();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsMenuBarVisibleL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsMenuBarVisibleL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsMenuBarVisibleL( ) ");
+    return iViewCommandHandle->HandleCommandL(
+        EPhoneViewIsMenuBarVisible ) ==
+        EPhoneViewResponseSuccess;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleNumericKeyEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleNumericKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumericKeyEventL( ) ");
+
+    TBool numberEntryUsed = IsNumberEntryUsedL();
+
+    if ( numberEntryUsed && ( aKeyEvent.iRepeats == 0 ||
+              aKeyEvent.iScanCode == EStdKeyBackspace ||
+              aKeyEvent.iScanCode ==EStdKeyLeftArrow  ||
+              aKeyEvent.iScanCode ==EStdKeyRightArrow ))
+        {
+        // Number entry exists but may be hidden
+        KeyEventForExistingNumberEntryL( aKeyEvent, aEventCode );
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsAnyQueryActiveL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsAnyQueryActiveL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsAnyQueryActiveL( ) ");
+    TBool isActive( EFalse );
+
+    // If IsNoteDismissableL returns true then shown note is dismissable by key event
+    // and then there is no actual query and IsAnyQueryActiveL returns false.
+    if ( !IsNoteDismissableL() )
+        {
+        // Check is query displayed
+        TPhoneCmdParamBoolean isQueryDisplayed;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewIsQuery, &isQueryDisplayed );
+        // Check is Blocking Dialog active ( e.g. RFS query )
+        TPhoneCmdParamBoolean blockingDialogStatus;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus,
+            &blockingDialogStatus );
+        // Check is note displayed
+        TPhoneCmdParamBoolean isNoteActive;
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewIsNoteActive, &isNoteActive );
+
+        if ( isQueryDisplayed.Boolean() || blockingDialogStatus.Boolean() || isNoteActive.Boolean() )
+            {
+            isActive = ETrue;
+            }
+        }
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyQueryActiveL: %d ", isActive );
+    return isActive;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsNoteDismissable
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneState::IsNoteDismissableL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNoteDismissableL( ) ");
+    TBool dismiss = EFalse;
+    if ( !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ||
+         (FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) &&
+                  SimSecurityStatus() == ESimRejected )  )
+        {
+        // Check if note is dismissed by key event.
+        TPhoneCmdParamBoolean isNoteDismissed;
+        iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewIsActiveNoteDissmissableByKeyEvent, &isNoteDismissed );
+        if ( isNoteDismissed.Boolean() )
+            {
+            dismiss = ETrue;
+            }
+        }
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsNoteDismissableL: %d ", dismiss );
+    return dismiss;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::SendKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneState::SendKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyEventL( ) ");
+    switch( aEventCode )
+        {
+        // EEventKey
+        case EEventKey:
+            // Send the key press to the phone engine, if applicable
+            SendKeyPressL( aKeyEvent, aEventCode );
+            break;
+
+        // EEventKeyUp
+        case EEventKeyUp:
+            // Send a key up event for the last key code sent to
+            // the phone engine
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageEndDTMF );
+            break;
+
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::SendKeyPressL
+// -----------------------------------------------------------
+//
+void CPhoneState::SendKeyPressL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendKeyPressL( ) ");
+    const TBool dtmfToneKeyEntered =
+        CPhoneKeys::IsDtmfTone( aKeyEvent, aEventCode );
+
+    if ( dtmfToneKeyEntered ||
+        aKeyEvent.iCode == EKeyBackspace )
+        {
+        // Get the number entry contents, if it exists
+        if ( IsNumberEntryUsedL() )
+            {
+            HBufC* phoneNumber = PhoneNumberFromEntryLC();
+            // Save the phone number
+            __PHONELOG1( EBasic, EPhoneControl, "SetPhoneNumber: %S ", phoneNumber );
+            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
+
+            // Convert key code to western.
+            TBuf<1> buffer; // one character
+            buffer.Append( aKeyEvent.iCode );
+            __PHONELOG1( EBasic, EPhoneControl,
+                "CPhoneState::SendKeyPressL(%S)",
+                &buffer );
+            AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern );
+            __PHONELOG1( EBasic, EPhoneControl,
+                "CPhoneState::SendKeyPressL(%S)",
+                &buffer );
+            TLex code( buffer );
+
+            // Save the key code
+            iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() );
+
+            // Plays a DTMF tone if active call
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessagePlayDTMF );
+            // remove the phone number from the cleanup stack
+            CleanupStack::PopAndDestroy( phoneNumber );
+            }
+        }
+    }
+
+// <------------------------------ SYSTEM EVENTS ----------------------------->
+
+// -----------------------------------------------------------
+// CPhoneState::DynInitMenuPaneL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DynInitMenuPaneL(
+    TInt aResourceId,
+    CEikMenuPane* aMenuPane )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuPaneL( ) ");
+    __ASSERT_DEBUG( aMenuPane && aResourceId,
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+
+    // Save the number of digits in the number entry before processing
+    // the menu pane
+    if ( IsNumberEntryUsedL() )
+        {
+        TPhoneCmdParamBoolean serviceCodeParam;
+            serviceCodeParam.SetBoolean(
+            iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetServiceCodeFlag,
+            &serviceCodeParam );
+        }
+
+    // Process the menu pane
+    TPhoneCmdParamDynMenu dynMenuPane;
+    dynMenuPane.SetResourceId( aResourceId );
+    dynMenuPane.SetDynMenu( aMenuPane );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuPane, &dynMenuPane );
+
+    if ( iCustomization )
+        {
+        // Menu pane is customized after default items are decided
+        iCustomization->CustomizeMenuPaneL(aResourceId, aMenuPane);
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DynInitMenuBarL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DynInitMenuBarL(
+    TInt aResourceId,
+    CEikMenuBar* aMenuBar )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DynInitMenuBarL( ) ");
+    __ASSERT_DEBUG( aMenuBar && aResourceId,
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+
+    TPhoneCmdParamDynMenu dynMenuBar;
+    dynMenuBar.SetResourceId( aResourceId );
+    dynMenuBar.SetDynMenu( aMenuBar );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBar, &dynMenuBar );
+
+    if ( iCustomization )
+        {
+        // Menu bar is customized after default items are decided
+        iCustomization->CustomizeMenuBarL(aResourceId, aMenuBar);
+        }
+
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleSystemEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleSystemEventL( const TWsEvent& /*aEvent*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleSystemEventL( ) ");
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleForegroundEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleForegroundEventL( TBool aForeground )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleForegroundEventL( ) ");
+    if ( !aForeground && IsNumberEntryUsedL() )
+        {
+        // Going out from foreground and number entry is open.
+        // Make sure that dtmf playing is stopped ( EEventKeyUp may be missed ).
+        iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandlePhoneForegroundEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandlePhoneForegroundEventL()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandlePhoneFocusLostEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandlePhoneFocusLostEventL()
+    {
+    // Notify that this method is called always when Idle is brought to foreground
+    // See implementation in CPhoneAppUI::HandleWsEventL
+
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneFocusLostEventL( ) ");
+    // Phone app focus lost -> close Dtmf dialer when visible
+    if ( IsOnScreenDialerSupported() && IsDTMFEditorVisibleL() )
+        {
+        CloseDTMFEditorL();
+        }
+    else if ( IsOnScreenDialerSupported() && IsCustomizedDialerVisibleL() )
+        {
+        CloseCustomizedDialerL();
+        }
+    }
+// ---------------------------------------------------------
+// CPhoneState::HandleIdleForegroundEventL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleIdleForegroundEventL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleIdleForegroundEventL( ) ");
+    // Empty implementation
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleEnvironmentChangeL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleEnvironmentChangeL( const TInt aChanges )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleEnvironmentChangeL( ) ");
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::HandleEnvironmentChangeL - Changes:  %d ", aChanges );
+    // Update the profile display if required
+    if ( aChanges &
+        ( EChangesLocale | EChangesMidnightCrossover | EChangesSystemTime ) )
+        {
+        UpdateProfileDisplayL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandlePhoneStartupL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandlePhoneStartupL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneStartupL( ) ");
+    // Empty implementation
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandlePropertyChangedL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandlePropertyChangedL(
+    const TUid& aCategory,
+    const TUint aKey,
+    const TInt aValue )
+    {
+
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePropertyChangedL( ) ");
+
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::HandlePropertyChangedL - aCategory= %d", aCategory  );
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::HandlePropertyChangedL - aKey= %d", aKey  );
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::HandlePropertyChangedL - aValue= %d", aValue  );
+    if ( aCategory == KPSUidCtsyCallInformation )
+        {
+        // Call state event
+        if ( aKey == KCTsyCallState )
+            {
+            // Update the incall indicator
+            UpdateIncallIndicatorL( aValue );
+            }
+        }
+
+    // Telephony information category
+    else if ( aCategory == KPSUidTelInformation
+              && SimState() == EPESimUsable )
+        {
+        // Telephony display event
+        if ( aKey == KTelDisplayInfo )
+            {
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneState::HandlePropertyChangedL - telephony display info received" );
+            // Update the operator and profile display
+            UpdateProfileDisplayL();
+            }
+        }
+    else if ( aCategory == KPSUidStartup && aKey == KStartupSimSecurityStatus )
+        {
+        // Show security note, SIM is not valid.
+        if ( aValue == ESimRejected ||  aValue == ESimUnaccepted )
+            {
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneStateStartup::HandlePropertyChangedL - SimSecurity status received" );
+            StartShowSecurityNoteL();
+            }
+        }
+    else if ( aCategory == KPSUidHWRM && aKey == KHWRMGripStatus )
+        {
+        UpdateCbaSwivelStateChangedL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleCenRepChangeL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleCenRepChangeL(
+    const TUid& /*aUid*/,
+    const TUint /*aId*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCenRepChangeL( ) ");
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::NeedToSendToBackgroundL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::NeedToSendToBackgroundL() const
+    {
+    return iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetNeedToSendToBackgroundStatus ) ==
+        EPhoneViewResponseSuccess;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::TopAppIsDisplayedL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::TopAppIsDisplayedL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::TopAppIsDisplayedL( ) ");
+    return iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetTopApplicationIsDisplayedStatus ) ==
+        EPhoneViewResponseSuccess;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::TitlePaneIsVisibleL
+// -----------------------------------------------------------
+//
+TBool CPhoneState::TitlePaneIsVisibleL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::TitlePaneIsVisibleL( ) ");
+    return iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetTitlePaneIsVisibleStatus ) ==
+        EPhoneViewResponseSuccess;
+    }
+
+// <---------------------------- MENU AND CBA EVENTS ------------------------->
+
+EXPORT_C TBool CPhoneState::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) ");
+    TBool commandStatus = ETrue;
+    switch( aCommand )
+        {
+        case EPhoneEmergencyCmdExit:
+            {
+            //cancel emergency mode.
+            TPhoneCmdParamBoolean booleanParam;
+            booleanParam.SetBoolean( EFalse );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRetrictedDialer,&booleanParam );
+            }
+            // this should be bypasses?
+        case EPhoneDialerCallHandling:
+        case EPhoneCmdBack:
+            BeginTransEffectLC( ENumberEntryClose );
+            // Remove number entry from screen
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+            // Do state-specific behaviour if number entry is cleared
+            HandleNumberEntryClearedL();
+            EndTransEffect();
+            break;
+
+        case EPhoneDialerCmdTouchInput:
+            OpenVkbL();
+            break;
+
+        case EPhoneNumberAcqCmdSendMessage:
+            // Open the mms editor
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewSendMessage );
+            if ( !IsOnScreenDialerSupported() )
+                {
+                // Remove number entry from screen
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+                // Do state-specific behaviour if number entry is cleared
+                HandleNumberEntryClearedL();
+                }
+            break;
+
+        case EPhoneNumberAcqCmdSave:
+            // Open Create contact
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewAddContact );
+            break;
+
+        case EPhoneNumberAcqCmdAddToName:
+            // Open the message editor
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewUpdateContact );
+            break;
+
+        case EPhoneNumberAcqCmdAddToContacts:
+            {
+            if ( IsOnScreenDialerSupported() )
+                {
+                TPhoneCmdParamQuery queryDialogParam;
+                    queryDialogParam.SetQueryType( EPhoneContactsListQuery );
+                    queryDialogParam.SetQueryResourceId(
+                    CPhoneMainResourceResolver::Instance()->
+                    ResolveResourceID( EPhoneAddtoContactsListQuery )  );
+
+                 // Display dialog
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
+                    &queryDialogParam );
+                }
+            }
+            break;
+
+        case EPhoneCmdWaitNoteOk:
+            // Remove number entry from screen
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+            if ( !IsOnScreenDialerSupported() )
+                {
+                HandleNumberEntryClearedL();
+                }
+            break;
+
+        case EPhoneInCallCmdEndThisOutgoingCall:
+            DisconnectCallL();
+            break;
+
+        case EPhoneCmdYesAlsLineChange:
+            if( IsAlsLineChangePossible() )
+                {
+                ChangeAlsLineL();
+                }
+            else
+                {
+                SendGlobalErrorNoteL( EPhoneLineBlockingNote );
+                HandleNumberEntryClearedL(); // Set back CBAs
+                }
+            break;
+
+        case EPhoneCmdNoAlsLineChange:
+            if ( !IsOnScreenDialerSupported() )
+                {
+                HandleNumberEntryClearedL();
+                }
+            break;
+
+        case EPhoneCmdYesBtDisconnectQuery:
+        case EPhoneCmdNoBtDisconnectQuery:
+            CPhoneBtaaDisconnectHandler::InstanceL()->HandleQueryDismissL( aCommand );
+            // Make sure that query is removed
+            // if there has been also another ( by Cover UI ).
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
+            break;
+
+        case EPhoneInCallCmdDeactivateIhf: // fall through
+        case EPhoneInCallCmdActivateIhf:
+            SetHandsfreeModeL( aCommand == EPhoneInCallCmdActivateIhf );
+             break;
+
+        case EPhoneInCallCmdHandset:    // fall through
+        case EPhoneInCallCmdBtHandsfree:
+            CPhoneState::SetBTHandsfreeModeL(
+                 aCommand == EPhoneInCallCmdBtHandsfree );
+            break;
+
+        case EPhoneInCallCmdActivatEPhonebook:
+            {
+            // Launch Phonebook application
+            TPhoneCmdParamAppInfo appInfoParam;
+            appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewActivateApp, &appInfoParam );
+            }
+            break;
+
+        case EPhoneNumberAcqSecurityDialer:
+            {
+            if ( IsOnScreenDialerSupported() && !IsNumberEntryUsedL() )
+                {
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+                TPhoneCmdParamBoolean visibleMode;
+                visibleMode.SetBoolean( ETrue );
+                iViewCommandHandle->ExecuteCommandL(
+                            EPhoneViewSetStatusPaneVisible, &visibleMode );
+
+
+                // Set emergency CBA, empty - exit
+                iCbaManager->SetCbaL( EPhoneEmergencyModeNoteCBA );
+
+                // Set dialer to restricted mode.
+                TPhoneCmdParamBoolean booleanParam;
+                booleanParam.SetBoolean( ETrue );
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRetrictedDialer,&booleanParam );
+
+                NumberEntryManagerL()->CreateNumberEntryL();
+                }
+            }
+            break;
+
+        case EPhoneDialerCmdContacts:
+            {
+            // Launch Phonebook application
+            TPhoneCmdParamAppInfo appInfoParam;
+            appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewActivateApp, &appInfoParam );
+            }
+            break;
+
+        case EPhoneViewYesSingleItemFetch:
+            {
+            if ( IsOnScreenDialerSupported() )
+                {
+                TBuf<KPhoneNumberEntryBufferSize> fetchContent;
+                fetchContent = iViewCommandHandle->FetchContent();
+                if ( fetchContent.Length() )
+                    {
+                    iViewCommandHandle->ExecuteCommandL(
+                                            EPhoneViewSetNumberEntryContent,
+                                            0,
+                                            fetchContent );
+
+                    CallFromNumberEntryL();
+                    }
+                }
+            }
+            break;
+        case EPhoneNumberAcqCmdToggleNeAlphaMode:
+        case EPhoneNumberAcqCmdToggleNeNumericMode:
+            {
+            // Toggle mode
+            NumberEntryManagerL()->NumberEntryToggleAlphaNumericModeL();
+            }
+            break;
+
+        case EPhoneCmdYesVideoFailedNoMemorySwitchToVoice:
+            DialVoiceCallL();
+            break;
+
+        case EPhoneCmdNoVideoFailedNoMemorySwitchToVoice:
+            if ( IsNumberEntryUsedL() )
+                {
+                // Show the number entry if it exists
+                SetNumberEntryVisibilityL(ETrue);
+                }
+            else if ( NeedToSendToBackgroundL() )
+                {
+                // Continue displaying current app but set up the
+                // idle screen in the background
+                SetupIdleScreenInBackgroundL();
+                }
+            else
+                {
+                 // Display idle screen
+                DisplayIdleScreenL();
+                }
+            break;
+
+        case EPhoneInCallCmdSetVolumeLevel:
+            {
+            // This command comes from ui control, no need to update
+            // value to control (second parameter set false).
+            ChangeAudioVolumeL( GetVolumeLevel(), EFalse );
+            }
+            break;
+
+        case EPhoneDialerCmdHelp:
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                TPtrC contextName;
+                contextName.Set( KDATA_DIALER_HLP_MAIN() );
+                iViewCommandHandle->ExecuteCommandL(
+                    EPhoneViewLaunchHelpApplication, 0, contextName );
+                }
+            break;
+
+        case EPhoneCmdVideoCallOutOfMemory:
+            ShowVideoCallOutOfMemoryNoteL();
+            DisconnectCallL();
+            break;
+            
+        case EPhoneCallComingCmdSoftReject:
+            // Open Soft reject message editor
+            OpenSoftRejectMessageEditorL();
+            break;
+            
+        case EPhoneInCallCmdContacts:
+            iViewCommandHandle->ExecuteCommand( EPhoneViewOpenContacts );
+            break;
+            
+        default:
+
+            /*if ( IsOnScreenDialerSupported() )
+                {
+                // Offer command to view.
+                TPhoneViewResponseId resId =
+                            iViewCommandHandle->HandleCommandL( aCommand );
+
+                if( resId == EPhoneViewResponseFailed )
+                    {
+                    commandStatus = EFalse;
+                    }
+                }
+            else*/
+
+                {
+                commandStatus = EFalse;
+                }
+            break;
+        }
+
+    if( !commandStatus && iCustomization )
+        {
+        commandStatus = iCustomization->HandleCommandL( aCommand );
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::ProcessCommandL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::ProcessCommandL( TInt /*aCommand*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL() ");
+    // no implementation.
+    return EFalse;
+    }
+
+// <-------------------------- REMOTE CONTROL EVENTS ------------------------->
+
+// -----------------------------------------------------------------------------
+// CPhoneState::HandleRemConCommandL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::HandleRemConCommandL(
+    TRemConCoreApiOperationId aOperationId,
+    TRemConCoreApiButtonAction /*aButtonAct*/ )
+    {
+    TBool handled = EFalse;
+
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::MrccatoCommand() ");
+    switch ( aOperationId )
+        {
+        case ERemConCoreApiVolumeUp:
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeUp" );
+            IncreaseAudioVolumeL();
+            handled = ETrue;
+            break;
+
+        case ERemConCoreApiVolumeDown:
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiVolumeDown" );
+            DecreaseAudioVolumeL();
+            handled = ETrue;
+            break;
+        case ERemConCoreApiMute:
+            {
+            __PHONELOG( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand ERemConCoreApiMute" );
+            iStateMachine->PhoneEngineInfo()->AudioMute() ?
+                iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( EFalse ):
+                iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( ETrue );
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageSetAudioMute );
+            handled = ETrue;
+            break;
+            }
+
+         default:
+             __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::MrccatoCommand MrccatoCmd.Other(%d)", aOperationId );
+            // Other commands ignored.
+            break;
+        }
+
+    return handled;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DecreaseAudioVolume()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DecreaseAudioVolumeL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DecreaceAudioVolumeL( ) ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    TPEAudioOutput output( iStateMachine->PhoneEngineInfo()->AudioOutput() );
+     __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::DecreaseAudioVolumeL - audio output =%d", output );
+    if( output == EPETTY )
+        {
+        SendGlobalInfoNoteL( EPhoneNoteTTYNoAudioControl );
+        }
+    else
+        {
+        TInt audioVolume( iStateMachine->PhoneEngineInfo()->AudioVolume() );
+        audioVolume--;
+        ChangeAudioVolumeL( audioVolume, ETrue );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IncreaceAudioVolume()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::IncreaseAudioVolumeL()
+    {
+     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IncreaceAudioVolumeL( ) ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    TPEAudioOutput output( iStateMachine->PhoneEngineInfo()->AudioOutput() );
+     __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IncreaseAudioVolumeL - audio output =%d", output );
+    if( output == EPETTY )
+        {
+        SendGlobalInfoNoteL( EPhoneNoteTTYNoAudioControl );
+        }
+    else
+        {
+        TInt audioVolume( iStateMachine->PhoneEngineInfo()->AudioVolume() );
+        audioVolume++;
+        ChangeAudioVolumeL( audioVolume, ETrue );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::ChangeAudioVolumeL()
+// -----------------------------------------------------------
+//
+void CPhoneState::ChangeAudioVolumeL( TInt aLevel, TBool aUpdateControl )
+    {
+     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ChangeAudioVolumeL( ) ");
+     __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::ChangeAudioVolumeL - set volume =%d", aLevel );
+
+    TInt valueToControl = aLevel;
+
+    // sets value between 1 -10
+    if ( aLevel>=KPhoneVolumeMinValue && aLevel<=KPhoneVolumeMaxValue )
+        {
+        iStateMachine->PhoneEngineInfo()->SetAudioVolumeCommand( aLevel );
+        // Syncronizes audio volume level between engine and ui
+        // causes EPEMessageAudioVolumeChanged message to phoneUI
+        iStateMachine->SendPhoneEngineMessage(
+            MPEPhoneModel::EPEMessageSetAudioVolume );
+        }
+        
+    if ( aUpdateControl )        
+        {
+        // Update the volume display.
+        // Upper max (11) and under min (-1)
+        // values are also updated to volume popup.
+        TPhoneCmdParamInteger volumeParam;
+        volumeParam.SetInteger( valueToControl );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetNaviPaneAudioVolume,
+            &volumeParam );
+        }
+    }
+
+// <-------------------------- COMMON STATE FUNCTIONS ------------------------>
+
+// -----------------------------------------------------------
+// CPhoneState::DialMultimediaCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DialMultimediaCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialMultimediaCall() ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeVideo );
+    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DialVoiceCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DialVoiceCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    // Disable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+   iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice );
+    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DisconnectCallL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::DisconnectCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) ");
+    TPhoneCmdParamInteger callIdParam;
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewGetExpandedBubbleCallId, &callIdParam );
+
+    TBool ret = EFalse;
+    if( callIdParam.Integer() > KErrNotFound )
+        {
+        // Release the call
+        iStateMachine->SetCallId( callIdParam.Integer() );
+
+        if( IsVideoCall( callIdParam.Integer() ) )
+            {
+            // Video call can be released only after we get response to VT Shutdown Command
+            CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
+                                                                                 KCatPhoneToVideotelCommands,
+                                                                                 EVtCmdReleaseDataport,
+                                                                       TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                                                 KPhoneToVideotelCmdVersionMinor,
+                                                                                 KPhoneToVideotelCmdVersionBuild ),
+                                                                       KNullDesC8,
+                                                                       CPhoneReleaseCommand::NewL( *iStateMachine ) );
+            }
+        else
+            {
+            // Release the call
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageRelease );
+            }
+        ret = ETrue;
+        }
+    else
+        {
+        __PHONELOG( EOnlyFatal, EPhoneControl,
+            "CPhoneState::DisconnectCallL has negative call id!" );
+        }
+
+    return ret;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DisplayIdleScreenL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DisplayIdleScreenL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayIdleScreenL( ) ");
+
+    // Don't remove reconnect query if it's shown
+    if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() )
+        {
+        // Remove dialogs if necessary
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+        }
+
+    // Set Empty CBA
+    iCbaManager->SetCbaL( EPhoneEmptyCBA );
+    // Bring Idle app to the foreground
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::SetupIdleScreenInBackgroundL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetupIdleScreenInBackgroundL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetupIdleScreenInBackgroundL( ) ");
+    // Don't remove reconnect query if it's shown
+    if( !CPhoneReconnectQuery::InstanceL()->IsDisplayingQuery() )
+        {
+        // Remove dialogs if necessary
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+        }
+    // Return phone to the background
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+
+    // Set Idle app as the top app
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );
+
+    // Set Empty CBA
+    iCbaManager->SetCbaL( EPhoneEmptyCBA );
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::CallFromNumberEntryL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CallFromNumberEntryL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CallFromNumberEntryL( ) ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    if ( IsOnScreenDialerSupported() )
+        {
+        if ( IsDTMFEditorVisibleL() ||
+             IsCustomizedDialerVisibleL() )
+            {
+            return;
+            }
+
+        else if( IsNumberEntryUsedL() )
+            {
+            // Query on top of dialer
+            if ( IsAnyQueryActiveL() )
+                {
+                return;
+                }
+            else if ( IsMenuBarVisibleL() )
+                {
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+                return;
+                }
+            // Open recent calls list when the number entry is empty
+            TPhoneCmdParamInteger numberEntryCountParam;
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
+            &numberEntryCountParam );
+            TInt neLength( numberEntryCountParam.Integer() );
+            TBool startLogs = neLength == 0 ? ETrue : EFalse;
+
+            if ( startLogs )
+                {
+                iViewCommandHandle->HandleCommandL(
+                EPhoneDialerCmdLog );
+                return;
+                }
+            }
+        }
+
+    // Get the number entry contents
+    HBufC* phoneNumber = PhoneNumberFromEntryLC();
+
+    // Call the number
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
+
+    if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
+        {
+        // Closing effect is shown when dialer exist.
+        BeginTransEffectLC( ENumberEntryClose );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        EndTransEffect();
+
+        HandleNumberEntryClearedL();
+        }
+
+    CleanupStack::PopAndDestroy( phoneNumber );
+
+    if ( !iCustomization ||
+         !iCustomization->HandleCallFromNumberEntryL() )
+        {
+        // Customization didn't handle call. Dial voice call
+        // as normally
+        DialVoiceCallL();
+        }
+
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DisplayHeaderForCallComingInL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DisplayHeaderForCallComingInL(
+    TInt aCallId,
+    TBool aWaitingCall )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForCallComingInL( ) ");
+    CallheaderManagerL()->DisplayHeaderForCallComingInL( aCallId, aWaitingCall );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::SetCallHeaderTextsForCallComingInL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetCallHeaderTextsForCallComingInL(
+        TInt aCallId,
+        TBool aWaitingCall,
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetCallHeaderTextsForCallComingInL( ) ");
+    CallheaderManagerL()->SetCallHeaderTextsForCallComingIn( aCallId, aWaitingCall, aCallHeaderData );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DisplayHeaderForOutgoingCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DisplayHeaderForOutgoingCallL(
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayHeaderForOutgoingCallL( ) ");
+    CallheaderManagerL()->DisplayHeaderForOutgoingCallL(aCallId);
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::UpdateSingleActiveCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::UpdateSingleActiveCallL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateSingleActiveCallL( ) ");
+
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+
+    BeginUiUpdateLC();
+
+    // Update call state
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
+        &callHeaderParam );
+
+    // Update remote info data
+    UpdateRemoteInfoDataL( aCallId );
+
+    // Create call duration label if enabled
+    // This key will be moved to some other area, but since key
+    // is supported we can still use it.
+    TBool callDuration( EFalse );
+    CPhoneCenRepProxy::Instance()->GetInt(
+            KCRUidLogs, KLogsShowCallDuration, callDuration );
+
+    if ( callDuration )
+        {
+        HandleChangedCallDurationL( aCallId );
+        }
+
+    EndUiUpdate();
+
+     // Go to current state implementation
+    iCbaManager->UpdateInCallCbaL();
+
+    //Update state of switch to video or voice call touch button.
+    TPECallType type = iStateMachine->PhoneEngineInfo()->CallType( aCallId );
+
+    if( type == EPECallTypeVideo )
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam );
+        }
+    else
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam );
+        }
+
+    // Go to background if necessary
+    if ( NeedToSendToBackgroundL() ||  IsAutoLockOn() )
+        {
+        // If number entry is used set control and visibility.
+        if ( IsNumberEntryUsedL() )
+           {
+           iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+           }
+        }
+    // If there is no need to send back ground and number entry is used then
+    // we must show number entry.
+    else if ( !NeedToSendToBackgroundL() && IsNumberEntryUsedL() )
+        {
+        SetNumberEntryVisibilityL(ETrue);
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::CaptureKeysDuringCallNotificationL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CaptureKeysDuringCallNotificationL(
+    TBool aCaptured )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CaptureKeysDuringCallNotificationL( ) ");
+    // Determine which view command to execute based on the capture status
+    const TInt viewCommandId = aCaptured ?
+        EPhoneViewStartCapturingKey :
+        EPhoneViewStopCapturingKey;
+
+    // Capture the App key
+    TPhoneCmdParamKeyCapture appKeyCaptureParam;
+    appKeyCaptureParam.SetKey( EStdKeyApplication0 );
+    appKeyCaptureParam.SetKeyCode( EKeyApplication0 );
+    appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
+    iViewCommandHandle->ExecuteCommandL( viewCommandId, &appKeyCaptureParam );
+
+    // Capture the Camera key, if it exists
+    if ( FeatureManager::FeatureSupported( KFeatureIdCamera ) )
+        {
+        TPhoneCmdParamKeyCapture cameraKeyCaptureParam;
+        cameraKeyCaptureParam.SetKey( EStdKeyDevice7 );
+        cameraKeyCaptureParam.SetKeyCode( EKeyDevice7 );
+        cameraKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
+        iViewCommandHandle->ExecuteCommandL( viewCommandId,
+            &cameraKeyCaptureParam );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsWaitingCallL
+// -----------------------------------------------------------
+//
+TBool CPhoneState::IsWaitingCallL( const TInt aCallId  )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsWaitingCallL( ) ");
+    return CallheaderManagerL()->IsWaitingCallL( aCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::UpdateCallHeaderInfoL
+// -----------------------------------------------------------
+//
+TPhoneCmdParamCallHeaderData CPhoneState::UpdateCallHeaderInfoL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateCallHeaderInfoL( ) ");
+    return CallheaderManagerL()->UpdateCallHeaderInfoL( aCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::UpdateRemoteInfoDataL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::UpdateRemoteInfoDataL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::UpdateRemoteInfoDataL() ");
+    TPhoneCmdParamCallHeaderData callHeaderParam = UpdateCallHeaderInfoL( aCallId );
+
+    if( iCustomization )
+        {
+        TBuf<KCntMaxTextFieldLength> inCallNumberText( KNullDesC );
+        // incall number text could be 'Call 1', 'Call 2', ...
+        CallheaderManagerL()->GetInCallNumberTextL( aCallId, inCallNumberText );
+        // to check if we have VoIP call in question and fix
+        // parameters if needed
+        iCustomization->ModifyCallHeaderTexts( aCallId, &callHeaderParam,
+            inCallNumberText );
+        }
+
+
+    // Update the remote info data in the call header
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewUpdateCallHeaderRemoteInfoData,
+        aCallId,
+        &callHeaderParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::SetCallHeaderType
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetCallHeaderType(
+    TInt aCallHeaderType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetCallHeaderType() ");
+    TRAP_IGNORE( CallheaderManagerL()->SetCallHeaderType( aCallHeaderType ) );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::GetRemoteInfoDataL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::GetRemoteInfoDataL(
+    TInt aCallId,
+    TDes& aData )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::GetRemoteInfoDataL() ");
+    CallheaderManagerL()->GetRemoteInfoDataL( aCallId, aData );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::UpdateCbaSwivelStateChangedL
+// -----------------------------------------------------------
+//
+void CPhoneState::UpdateCbaSwivelStateChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,"CPhoneState::UpdateCbaSwivelStateChangedL()" );
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    TInt incomingCall = callStateData.CallId();
+
+    TPhoneCmdParamInteger activeCallCount;
+    iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+
+    if ( incomingCall > KErrNotFound )
+        {
+       if( activeCallCount.Integer() == ENoActiveCalls )
+            {
+            iCbaManager->UpdateIncomingCbaL( incomingCall );
+            UpdateSilenceButtonDimming();
+            }
+        else
+            {
+            iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+            }
+        }
+    else if ( activeCallCount.Integer() != ENoActiveCalls )
+        {
+        iCbaManager->UpdateInCallCbaL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsSwivelClosed
+// This function checks from PubSubProxy that is
+// Swivel closed or not in product.
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsSwivelClosed() const
+    {
+    if( CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagSwivelInDevice ))
+        {
+        return CPhonePubSubProxy::Instance()->
+            Value( KPSUidHWRM, KHWRMGripStatus ) == EPSHWRMGripClosed;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// <-------------------------- CONTEXT MENU ------------------------->
+
+// -----------------------------------------------------------------------------
+// CPhoneState::SetContextMenu
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetContextMenuL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetContextMenuL() ");
+
+    TPhoneCmdParamInteger integerParam;
+    TInt resId( CPhoneMainResourceResolver::Instance()->
+                            ResolveResourceID( aResourceId ) );
+    integerParam.SetInteger( resId );
+    __PHONELOG1( EBasic, EPhoneControl,
+                  "CPhoneState::SetContextMenuL : resId =%d",resId );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateContextMenu,
+                                      &integerParam );
+    }
+// -----------------------------------------------------------------------------
+// CPhoneState::UpdateInCallContextMenuL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::UpdateInCallContextMenuL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateInCallContextMenuL() ");
+
+    SetContextMenuL( EPhoneNumberAcqMenubar );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::UpdateIncomingContextMenuL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::UpdateIncomingContextMenuL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateIncomingContextMenuL() ");
+
+    if( CPhoneState::IsVideoCall ( aCallId ) )
+        {
+        SetContextMenuL( EPhoneIncomingVideoCallMenubar );
+        }
+    else
+        {
+        SetContextMenuL( EPhoneIncomingCallMenubar );
+        }
+
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::ShowNoteL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::ShowNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNoteL( ) ");
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNotePermanent );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( aResourceId ) );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::ShowQueryL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::ShowQueryL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowQueryL( ) ");
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    TPhoneCmdParamQuery queryParam;
+    queryParam.SetQueryType( EPhoneQueryDialog );
+    queryParam.SetQueryResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( aResourceId ) );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::ShowTextQueryL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::ShowTextQueryL(
+    TInt aDialogResourceId,
+    TInt aDefaultCbaResourceId,
+    TInt aContentCbaResourceId,
+    TDes* aDataText,
+    TBool aSendKeyEnabled )
+    {
+    __ASSERT_DEBUG( aDialogResourceId &&
+        aDefaultCbaResourceId &&
+        aContentCbaResourceId &&
+        aDataText,
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+    TPhoneCmdParamQuery queryDialogParam;
+    queryDialogParam.SetQueryType( EPhoneTextQueryDialog );
+    queryDialogParam.SetQueryResourceId( aDialogResourceId );
+    queryDialogParam.SetDefaultCba( aDefaultCbaResourceId );
+    queryDialogParam.SetContentCba( aContentCbaResourceId );
+    queryDialogParam.SetDataText( aDataText );
+    queryDialogParam.SetSendKeyEnabled( aSendKeyEnabled );
+
+    // Display dialog
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
+        &queryDialogParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DisplayCallTerminationNoteL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DisplayCallTerminationNoteL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisplayCallTerminationNoteL( ) ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    if ( CheckIfShowCallTerminationNote() )
+        {
+        TBuf<KPhoneMaxCharsInNote> noteText;
+        TBuf<KPhoneMaxCharsInNote> postCallLineText;
+
+        // Post call Line 1: Call Summary
+        LoadResource( postCallLineText, EPhoneNoteTextCallSummary );
+        noteText.Append( postCallLineText );
+        noteText.Append( KPhoneLineFeed );
+
+        // Post call Line 2: Duration
+        LoadResource( postCallLineText, EPhoneNoteTextCallDuration );
+        noteText.Append( postCallLineText );
+        noteText.Append( KPhoneLineFeed );
+
+        // Post call Line 3: Time, get the format for last call time.
+        LoadResource( postCallLineText, EPhoneCallDurationFormatString );
+        TPtrC durationFormat( postCallLineText );
+
+        // Get the last call duration
+        TTime time( 0 );
+        TTimeIntervalSeconds timeInterval =
+            iStateMachine->PhoneEngineInfo()->CallDuration();
+        time += timeInterval;
+
+        // Format the time
+        TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC );
+        time.FormatL( timeString, durationFormat );
+
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( timeString );
+
+        noteText.Append( timeString );
+
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetType( EAknGlobalInformationNote );
+        globalNoteParam.SetText( noteText );
+        globalNoteParam.SetTone( CAknNoteDialog::ENoTone );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SendGlobalInfoNoteL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SendGlobalInfoNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalInfoNoteL( ) ");
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    if ( CPhonePubSubProxy::Instance()->Value(
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+
+        TPhoneCmdParamGlobalNote globalNoteParam;
+
+        globalNoteParam.SetType( EAknGlobalInformationNote );
+        globalNoteParam.SetTextResourceId(
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( EAvkonSIDInformationTone );
+
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    }
+
+// ---------------------------------------------------------
+//  CPhoneUIController::SendGlobalWarningNoteL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SendGlobalWarningNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalWarningNoteL( ) ");
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    if ( CPhonePubSubProxy::Instance()->Value(
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 ||
+            SimState() == EPESimReadable )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetType( EAknGlobalWarningNote );
+        globalNoteParam.SetTextResourceId(
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( EAvkonSIDWarningTone );
+
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    }
+
+// ---------------------------------------------------------
+//  CPhoneUIController::SendGlobalErrorNoteL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SendGlobalErrorNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SendGlobalErrorNoteL( ) ");
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    if ( CPhonePubSubProxy::Instance()->Value(
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetType( EAknGlobalErrorNote );
+        globalNoteParam.SetTextResourceId(
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
+
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SetHandsfreeModeL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetHandsfreeModeL( TBool aHandsfreeMode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetHandsfreeModeL( ) ");
+    CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC(
+        iViewCommandHandle, iStateMachine, this );
+    if ( !bt->SetHandsfreeModeL( aHandsfreeMode ))
+        {
+        SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+        }
+    CleanupStack::PopAndDestroy( bt );
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SetBTHandsfreeModeL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetBTHandsfreeModeL( TBool aHandsfreeMode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetBTHandsfreeModeL( ) ");
+    CPhoneAccessoryBTHandler* bt = CPhoneAccessoryBTHandler::NewLC(
+        iViewCommandHandle, iStateMachine, this );
+    if ( !bt->SetBTHandsfreeModeL( aHandsfreeMode ))
+        {
+        SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+        }
+    CleanupStack::PopAndDestroy( bt );
+    }
+
+// <-------------------------- INTERNAL FUNCTIONS ------------------------>
+
+// -----------------------------------------------------------
+// CPhoneState::UpdateIncallIndicatorL
+// -----------------------------------------------------------
+//
+void CPhoneState::UpdateIncallIndicatorL( TInt aCallState )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateIncallIndicatorL( ) ");
+    TPhoneCmdParamIncallIndicatorData incallIndicatorParam;
+
+    // Set the state
+    incallIndicatorParam.SetCallState( aCallState );
+
+    // Set mode
+    incallIndicatorParam.SetMode(
+       CPhonePubSubProxy::Instance()->Value(
+            KPSUidCtsyCallInformation,
+            KCTsyCallType ) );
+
+    TInt activeCallId = GetActiveCallIdL();
+    if ( activeCallId > KErrNotFound )
+        {
+        if ( iStateMachine->PhoneEngineInfo()->CallALSLine( activeCallId )
+             == CCCECallParameters::ECCELineTypeAux )
+            {
+            incallIndicatorParam.SetLine2( ETrue );
+            }
+        }
+
+    // Set the mute status
+    const TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute();
+    incallIndicatorParam.SetMute( audioMute );
+
+    // Set the voice privacy status
+    if ( activeCallId > KErrNotFound &&
+         activeCallId != KConferenceCallId  )
+        {
+        incallIndicatorParam.SetCiphering(
+            iStateMachine->PhoneEngineInfo()->IsSecureCall( activeCallId ) );
+        }
+    else
+        {
+        incallIndicatorParam.SetCiphering( ETrue );
+        }
+
+    incallIndicatorParam.SetCipheringIndicatorAllowed(
+        iStateMachine->PhoneEngineInfo()->SecureSpecified() );
+
+    // Set the emergency status
+    if( EPEStateIdle != iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) )
+        {
+        incallIndicatorParam.SetEmergency( ETrue );
+        }
+
+    if( aCallState == EPSCTsyCallStateDisconnecting )
+        {
+        if ( TopAppIsDisplayedL() )
+            {
+            if ( ( !IsOnScreenDialerSupported() ) ||
+                 ( IsOnScreenDialerSupported() && !IsNumberEntryVisibleL() ) )
+                {
+                // Phone application is in the foreground so we don't need to
+                // display the little bubble. If we don't hide it here then
+                // it will appear for a short time. We don't want that.
+                incallIndicatorParam.SetLittleBubbleVisible( EFalse );
+                }
+            }
+        }
+
+    // Update the in-call indicator
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateIncallIndicator,
+        &incallIndicatorParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::UpdateProfileDisplayL
+// -----------------------------------------------------------
+//
+void CPhoneState::UpdateProfileDisplayL()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::UpdateOperatorDisplayL
+// -----------------------------------------------------------
+//
+void CPhoneState::UpdateOperatorDisplayL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateOperatorDisplayL( ) ");
+    __PHONELOG( EBasic, EPhoneControl, "CPhoneState::UpdateOperatorDisplayL" );
+    // Get current title pane content.
+    TTelTitleDisplay titleContent;
+    titleContent.iDisplayTag.Zero();
+    titleContent.iLogoHandle = 0;
+    TPckg<TTelTitleDisplay> titlePckg( titleContent );
+
+    RProperty::Get(
+        KPSUidTelInformation,
+        KTelDisplayInfo,
+        titlePckg );
+
+    if ( TitlePaneIsVisibleL() )
+        {
+        // There is a title pane icon.
+        if ( titleContent.iLogoHandle != 0 )
+            {
+            // Set new logo.
+            __PHONELOG( EBasic, EPhoneControl,
+                "CPhoneState::UpdateOperatorDisplayL - logo found" );
+
+            if( iLogoHandle != titleContent.iLogoHandle )
+                {
+                 __PHONELOG( EBasic, EPhoneControl,
+                  "CPhoneState::UpdateOperatorDisplayL - set new logo" );
+
+                 TPhoneCmdParamBitmap bitmapParam;
+
+                 // Duplicate bitmap from handle.
+                 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+                 CleanupStack::PushL( bitmap );
+                 User::LeaveIfError(
+                         bitmap->Duplicate( titleContent.iLogoHandle ) );
+                 bitmapParam.SetBitmap( bitmap );
+
+                 // Duplicate and set bitmap mask if needed
+                 CFbsBitmap* maskBitmap = NULL;
+                 if( titleContent.iLogoMaskHandle != 0 )
+                     {
+                     maskBitmap = new( ELeave )CFbsBitmap;
+                     CleanupStack::PushL( maskBitmap );
+                     User::LeaveIfError( maskBitmap->Duplicate(
+                             titleContent.iLogoMaskHandle ) );
+                     bitmapParam.SetMaskBitmap( maskBitmap );
+                     }
+
+                 iViewCommandHandle->ExecuteCommandL(
+                         EPhoneViewSetTitlePanePicture,
+                         &bitmapParam );
+
+                 // The title pane takes ownership of the bitmaps so no need
+                 // to destroy it here.
+                 if( maskBitmap )
+                     {
+                     // Pop maskBitmap only, if it has been created
+                     CleanupStack::Pop( maskBitmap );
+                     }
+                 CleanupStack::Pop( bitmap );
+                }
+            }
+        else
+            {
+            __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::UpdateOperatorDisplayL - set text=%S", &titleContent.iDisplayTag );
+            iLogoHandle = titleContent.iLogoHandle;
+
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewSetTitlePaneContent,
+                0,
+                titleContent.iDisplayTag );
+            }
+        }
+
+    // Check background image.
+    TPhoneCmdParamBitmap savedBitmapParam;
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewGetBackgroundImageBitmap,
+        &savedBitmapParam );
+
+    if ( titleContent.iBackgroundImageHandle !=
+        savedBitmapParam.Bitmap()->Handle() )
+        {
+        __PHONELOG2( EBasic, EPhoneControl,
+        "CPhoneState::UpdateOperatorDisplayL - update background image since different titleContent(%d), saved(%d)",
+            titleContent.iBackgroundImageHandle, savedBitmapParam.Bitmap()->Handle() );
+        // Background image has changed. Duplicate bitmap from handle if
+        // available; otherwise reset the background image
+        CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+        CleanupStack::PushL( bitmap );
+        TInt err = KErrNone;
+        if ( titleContent.iBackgroundImageHandle != 0 )
+            {
+            err = bitmap->Duplicate( titleContent.iBackgroundImageHandle );
+            }
+        else
+            {
+            bitmap->Reset();
+            }
+
+        if ( err == KErrNone )
+            {
+            iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter;
+            TPhoneCmdParamBitmap bitmapParam;
+            bitmapParam.SetBitmap( bitmap );
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewSetBackgroundImageBitmap,
+                &bitmapParam );
+            }
+
+        CleanupStack::PopAndDestroy( bitmap );
+        }
+    else if ( titleContent.iBackgroundImageRedrawCounter !=
+                  iBitmapRedrawCounter  )
+        {
+        iBitmapRedrawCounter = titleContent.iBackgroundImageRedrawCounter;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateView );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleInitiatedEmergencyCallL
+// Default handling for EPEMessageInitiatedEmergencyCallL message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleInitiatedEmergencyCallL( TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyCallL( ) ");
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    // Stop tone playing, if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+
+    // Reset Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    // Undim Answer button for sure.
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+
+    // Go to emergency call state
+    // No need update cba
+    iStateMachine->ChangeState( EPhoneStateEmergency );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) ");
+
+    // We have existing video call so need to release dataport before continuing
+    // emergency call. Otherwise we will face problems with dataport use later.
+    CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
+                                                                     KCatPhoneToVideotelCommands,
+                                                                     EVtCmdReleaseDataport,
+                                                               TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                                         KPhoneToVideotelCmdVersionMinor,
+                                                                         KPhoneToVideotelCmdVersionBuild ),
+                                                               KNullDesC8,
+                                                               CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleShowImeiL
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleShowImeiL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleShowImeiL( ) ");
+    
+    // Fetch IMEI
+    TBuf<RMobilePhone::KPhoneSerialNumberSize> serialNumber;
+    TPEPhoneIdentityParameters phoneIdentityParameters = 
+        iStateMachine->PhoneEngineInfo()->PhoneIdentityParameters();
+    serialNumber = phoneIdentityParameters.iSerialNumber;
+    
+    HBufC* imeiNoteText = StringLoader::LoadLC(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID(
+        EPhonePhoneImeiString ), serialNumber );
+    
+    TPhoneCmdParamGlobalNote noteParam;
+    noteParam.SetType( EAknGlobalInformationNote );
+    noteParam.SetTone( EAvkonSIDInformationTone );
+    noteParam.SetText( *imeiNoteText );
+    noteParam.SetTimeout( KPhoneNoteNoTimeout );
+    
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewShowGlobalNote, 
+        &noteParam );
+    
+    CleanupStack::PopAndDestroy( imeiNoteText );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleCallSecureStatusChangeL
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleCallSecureStatusChangeL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCallSecureStatusChangeL( ) ");
+
+    TBool ciphering( ETrue );
+    TBool secureSpecified( ETrue );
+
+    if ( aCallId > KErrNotFound )
+        {
+        ciphering = iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId );
+        secureSpecified = iStateMachine->PhoneEngineInfo()->SecureSpecified();
+        }
+
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+
+    callHeaderParam.SetCiphering( ciphering );
+    callHeaderParam.SetCipheringIndicatorAllowed( secureSpecified );
+
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewCipheringInfoChange,
+        aCallId,
+        &callHeaderParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleShowLifeTimerL
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleShowLifeTimerL()
+   {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleShowLifeTimerL( ) ");
+    
+    // Fetch LifeTime
+    TPELifeTimeData lifeTimeData = 
+        iStateMachine->PhoneEngineInfo()->LifeTimerData();
+    
+    TLocale locale;
+    TBuf<KTimerTextLength> lifetimerText;
+    lifetimerText.NumFixedWidth(
+        lifeTimeData.iHours,
+        EDecimal,
+        KPhoneLifeTimerHoursLength );
+    
+    lifetimerText.Append(locale.TimeSeparator( KTimerMinuteSeparator ) );
+    
+    TBuf<KPhoneLifeTimerMinutesLength> mins;
+    mins.NumFixedWidth(
+        lifeTimeData.iMinutes,
+        EDecimal,
+        KPhoneLifeTimerMinutesLength );
+    
+    lifetimerText.Append(mins);
+    
+    HBufC* buf = StringLoader::LoadLC(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID(
+        EPhoneLifeTimeFormat ), lifetimerText );
+    
+    TPhoneCmdParamGlobalNote noteParam;
+    noteParam.SetType( EAknGlobalInformationNote );
+    noteParam.SetTone( EAvkonSIDInformationTone );
+    noteParam.SetText( *buf );
+    noteParam.SetTimeout( KPhoneNoteNoTimeout );
+    
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewShowGlobalNote, 
+        &noteParam );
+    
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::IsVideoCall
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsVideoCall( const TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsVideoCall( ) ");
+    TBool isVideoCall( EFalse );
+    TRAP_IGNORE( isVideoCall = CallheaderManagerL()->IsVideoCall( aCallId ) );
+    __PHONELOG1( EBasic, EPhoneControl, 
+        "CPhoneState::IsVideoCall isVideoCall(%d)",
+        isVideoCall );
+    return isVideoCall;
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::ChangeAlsLineL
+// ---------------------------------------------------------
+//
+void CPhoneState::ChangeAlsLineL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ChangeAlsLineL( ) ");
+
+    if ( !IsOnScreenDialerSupported() )
+        {
+        // Do state-specific operation when number entry is cleared
+        HandleNumberEntryClearedL();
+        }
+
+    CCCECallParameters::TCCELineType currentLine;
+    TSSSettingsAlsValue newLine( ESSSettingsAlsPrimary );
+
+    currentLine = iStateMachine->PhoneEngineInfo()->ALSLine();
+
+    if ( currentLine == CCCECallParameters::ECCELineTypePrimary )
+        {
+        newLine = ESSSettingsAlsAlternate;
+        }
+    else if ( currentLine == CCCECallParameters::ECCELineTypeAux )
+        {
+        newLine = ESSSettingsAlsPrimary;
+        }
+
+    RSSSettings ssSettings;
+    TInt retValue = ssSettings.Open();
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::ChangeAlsLineL : Open %d", retValue );
+    if ( retValue == KErrNone )
+        {
+        retValue = ssSettings.Set( ESSSettingsAls, newLine );
+        __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::ChangeAlsLineL : Set %d", retValue );
+        ssSettings.Close();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::GetActiveCallIdL()
+// ---------------------------------------------------------
+//
+TInt CPhoneState::GetActiveCallIdL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::GetActiveCallId()( ) ");
+
+    // Fetch active call's id from view
+    TPhoneViewResponseId response;
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+    response = iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+
+    if ( response == EPhoneViewResponseSuccess &&
+         callStateData.CallId() < 0 )  // no connected calls
+        {
+        // check for held call
+        callStateData.SetCallState( EPEStateHeld );
+        response = iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+        }
+
+    return callStateData.CallId();
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SimState()
+// ---------------------------------------------------------
+//
+EXPORT_C TPESimState CPhoneState::SimState() const
+    {
+
+    /*
+    SIM states:
+
+    EPESimStatusUninitialized = KPEStartupEnumerationFirstValue =100,
+    EPESimUsable,       // The Sim card is fully usable.
+    EPESimReadable,     // The SIM card is not fully usable, but the emergency number can be read.
+    EPESimNotReady,     // The Sim card is present but not ready or usable.
+    EPESimNotPresent,   // The Sim card is not present.
+    EPESimNotSupported  // SIM/RUIM is not supported. Some CDMA phones do not support a SIM/RUIM at all.
+    */
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimState()");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    TPESimState simState = iStateMachine->PhoneEngineInfo()->SimState();
+
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::SimState - value= %d", simState );
+    return simState;
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::IsSimOk()
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsSimOk()
+    {
+
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsSimOk()");
+    // Phone is interested on Sim state and sim security statuses
+    // Check first Sim state status:
+    TBool retVal( ETrue );
+    switch ( SimState() )
+        {
+        case EPESimNotSupported:
+            retVal = EFalse;
+            break;
+
+        case EPESimNotPresent:
+            {
+            if ( !FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ||
+                 !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) )
+                {
+                retVal = EFalse;
+                }
+            break;
+            }
+
+        default:
+            break;
+        }
+    if ( retVal != EFalse )
+        {
+        // Sim state is valid, check also Sim security status
+        switch ( SimSecurityStatus() )
+            {
+            case ESimRejected:
+            case ESimUnaccepted:
+                retVal = EFalse;
+                break;
+
+            default:
+                break;
+            }
+        }
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneState::IsSimOK - value= %d", retVal );
+    return retVal;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled()
+    {
+    TPhoneCmdParamBoolean isSecurityMode;
+    TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ) );
+    if ( SimState() == EPESimNotPresent && isSecurityMode.Boolean() )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SetDivertIndication
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetDivertIndication( const TBool aDivertIndication )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetDivertIndication()");
+    TRAP_IGNORE( CallheaderManagerL()->SetDivertIndication( aDivertIndication ) );
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::StartAlsLineChangeTimerL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::StartAlsLineChangeTimerL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartAlsLineChangeTimerL()");
+    TBool alsLineAvailable = iStateMachine->PhoneEngineInfo()->ALSLineSupport();
+
+    if( alsLineAvailable )
+        {
+        if( !iAlsLineChangeKeyPressTimer )
+            {
+            iAlsLineChangeKeyPressTimer = CPhoneTimer::NewL();
+            }
+
+        iAlsLineChangeKeyPressTimer->After( KAlsLineChangeTimerValue,
+            TCallBack( AlsLineChangeTimerCallbackL, this ) );
+        }
+    else
+        {
+         // Don't bother launching the timer. ALS not supported.
+        __PHONELOG( EBasic, EPhoneControl,
+            "CPhoneState::StartAlsLineChangeTimerL - ALS not supported " );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::StartShowSecurityNoteL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::StartShowSecurityNoteL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartShowSecurityNoteL ");
+
+    // Set security mode on.
+    TPhoneCmdParamBoolean securityMode;
+    securityMode.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
+
+    // Remove number entry from screen
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+
+    TPhoneCmdParamBoolean visibleMode;
+    visibleMode.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetStatusPaneVisible, &visibleMode );
+    
+    iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
+
+    TPhoneCmdParamInteger uidParam;
+    // Bring Phone app in the foreground
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+
+    TInt resourceId ( KErrNone );
+
+    if ( SimSecurityStatus() == ESimRejected )
+        {
+        resourceId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSimRejected );
+        }
+    else if ( SimState() == EPESimNotPresent )
+        {
+        // insert sim card -note
+        resourceId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSimRemoved );
+        }
+    else if ( SimSecurityStatus() == ESimUnaccepted )
+        {
+        resourceId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSimUnaccepted );
+        }
+
+    if ( resourceId != KErrNone )
+        {
+        // Add it to the resource string
+        HBufC* buf = StringLoader::LoadLC( resourceId );
+
+        TPhoneCmdParamNote noteParam;
+
+        noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+           ResolveResourceID( EPhoneSecurityInformationNote ) );
+
+        noteParam.SetText( *buf );
+        noteParam.SetTone( CAknNoteDialog::EConfirmationTone );
+        noteParam.SetType( EPhoneNoteSecurity );
+        // Display note
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+
+        CleanupStack::PopAndDestroy( buf );
+           
+           
+        // Capture the App key
+        TPhoneCmdParamKeyCapture appKeyCaptureParam;
+        appKeyCaptureParam.SetKey( EStdKeyApplication0 );
+        appKeyCaptureParam.SetKeyCode( EKeyApplication0 );
+        appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
+        iViewCommandHandle->ExecuteCommandL( 
+               EPhoneViewStartCapturingKey, &appKeyCaptureParam );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::AlsLineChangeTimerCallbackL
+// ---------------------------------------------------------
+//
+TInt CPhoneState::AlsLineChangeTimerCallbackL( TAny* aAny )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::AlsLineChangeTimerCallbackL()");
+
+    // Send a key up event for stopping keypad tone
+    reinterpret_cast<CPhoneState*>( aAny )->
+        iStateMachine->SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageEndDTMF );
+
+    if ( !( reinterpret_cast<CPhoneState*>( aAny )->
+            IsOnScreenDialerSupported() ) )
+        {
+        // If dialer is undefined remove the number entry.
+        reinterpret_cast<CPhoneState*>( aAny )->
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    else
+        {
+        // If on screen dialer is in use just clear entry
+        // do not remove dialer.
+        reinterpret_cast<CPhoneState*>( aAny )->
+            NumberEntryClearL();
+        }
+
+    // Show the als line changing confirmation query
+    reinterpret_cast<CPhoneState*>( aAny )->
+        ShowQueryL( EPhoneAlsLineChangeConfirmationQuery );
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::ShowWlanMacAddressL
+// ---------------------------------------------------------
+//
+void CPhoneState::ShowWlanMacAddressL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::ShowWlanMacAddressL()");
+    if ( IsOnScreenDialerSupported() )
+        {
+        NumberEntryClearL();
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+
+    // Fetch WLAN MAC address
+    TBuf8<KPhoneWlanMacAddressLength> address;
+    RProperty::Get(
+        KPSUidWlan,
+        KPSWlanMacAddress,
+        address );
+
+    // Format fetched address
+    TBuf<KPhoneWlanMacAddressLength> wlanMACAddress;
+    for ( TInt i( 0 ); i < address.Length(); i++ )
+        {
+        // Set separator
+        if( i > 0 )
+            {
+            wlanMACAddress.Append( KPhoneWlanSeparator );
+            }
+        // Set data
+        TBuf<10> tmp;
+        tmp.Format( KWLanMACDataFormat, address[i] );
+        wlanMACAddress.Append( tmp );
+        }
+
+    // Now we need the localised text
+    HBufC* wlanMacAddress = StringLoader::LoadLC(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneWlanMacAddress ), wlanMACAddress );
+
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteCustom );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInformationWaitNote ) );
+    noteParam.SetText( *wlanMacAddress );
+    noteParam.SetTone( CAknNoteDialog::EConfirmationTone );
+
+    // Display note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+
+    CleanupStack::PopAndDestroy( wlanMacAddress );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleAudioAvailableOutputChangedL
+// Default handling for EPEMessageAvailableAudioOutputsChanged message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleAudioAvailableOutputChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleAudioAvailableOutputChangedL() ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    TPhoneCmdParamAudioAvailability outputParam;
+
+    // Output
+    const TPEAudioOutput audioOutput =
+        iStateMachine->PhoneEngineInfo()->AudioOutput();
+
+    // BT availability
+    TBool btAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable(
+            EPEBTAudioAccessory );
+    outputParam.SetBTAccAvailable( btAvailable );
+
+    // Wired availability
+    TBool wiredAvailable = iStateMachine->PhoneEngineInfo()->AudioOutputAvailable(
+            EPEWiredAudioAccessory );
+    outputParam.SetWiredAccAvailable( wiredAvailable );
+
+    // BTA disconnect handler check
+    if( btAvailable )
+        {
+        CPhoneBtaaDisconnectHandler::InstanceL()->Cancel();
+        }
+
+    // view update
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioAvailabilityUIChanges,
+        &outputParam );
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneState::IsAlsLineChangePossible
+// ---------------------------------------------------------
+//
+TBool CPhoneState::IsAlsLineChangePossible()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsAlsLineChangePossible( ) ");
+
+    TBool isAlsLineChangePossible( ETrue );
+    TSSSettingsAlsBlockingValue AlsBlockingValue( ESSSettingsAlsBlockingNotSupported );
+    TInt value( 0 );
+
+    RSSSettings ssSettings;
+    TInt retValue = ssSettings.Open();
+
+    if ( retValue == KErrNone )
+        {
+        ssSettings.Get( ESSSettingsAlsBlocking, value );
+        ssSettings.Close();
+
+        AlsBlockingValue = static_cast< TSSSettingsAlsBlockingValue > ( value );
+
+        if( AlsBlockingValue == ESSSettingsAlsAlternate )
+            {
+            isAlsLineChangePossible = EFalse;
+            }
+        }
+
+    return isAlsLineChangePossible;
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::ShowNumberBusyNoteL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::ShowNumberBusyNoteL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::ShowNumberBusyNoteL( ) ");
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    TInt resource( EPhoneNumberBusy );
+
+    if( iCustomization )
+        {
+        // Get customized text resource for busy note
+        resource = iCustomization->CustomizeBusyNoteText();
+        }
+
+    // Show number busy note
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    globalNoteParam.SetType( EAknGlobalInformationNote );
+    globalNoteParam.SetTextResourceId(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resource ) );
+    globalNoteParam.SetTone( EAvkonSIDInformationTone );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowGlobalNote,
+        &globalNoteParam );
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::IsAutoLockOn
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsAutoLockOn() const
+    {
+    // Check if phone is locked
+    const TBool phoneIsLocked =
+                CPhonePubSubProxy::Instance()->Value(
+                KPSUidCoreApplicationUIs,
+                KCoreAppUIsAutolockStatus ) > EAutolockOff;
+
+    return phoneIsLocked;
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::IsKeyLockOn
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsKeyLockOn() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsKeyLockOn( ) ");
+    TPhoneCmdParamBoolean keyLockStatus;
+    keyLockStatus.SetBoolean( EFalse );
+
+    iViewCommandHandle->ExecuteCommand(
+            EPhoneViewGetKeyLockStatus,
+            &keyLockStatus );
+
+    __PHONELOG1( EBasic,
+            EPhoneControl,
+            "CPhoneState::IsKeyLockOn() Lock Status: %d",
+            keyLockStatus.Boolean() );
+    return keyLockStatus.Boolean();
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::CompleteSatRequestL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CompleteSatRequestL( const TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CompleteSatRequestL( ) ");
+    iStateMachine->SetCallId( aCallId );
+    iStateMachine->SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageSatCallRequestCompleted );
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SetTouchPaneButtons
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt /*aResourceId*/ )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TBool emergency( EPEStateIdle != 
+            iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) );
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( emergency );
+
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
+                     EPhoneViewSetTouchPaneButtons,
+                     &booleanParam ) );
+        SetTouchPaneVisible( ETrue );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::DeleteTouchPaneButtons
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DeleteTouchPaneButtons()
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamBoolean boolParam;
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
+                        EPhoneViewSetTouchPaneButtons,
+                        &boolParam ) );
+        SetTouchPaneVisible( EFalse );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SetTouchPaneVisible
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetTouchPaneVisible( TBool aVisible )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( aVisible );
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
+                        EPhoneViewSetTouchPaneVisible,
+                        &booleanParam ) );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneState::SetTouchButtonEnabled
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetTouchPaneButtonEnabled( TInt aCommandId )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamInteger commandParam;
+        commandParam.SetInteger( aCommandId );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewEnableTouchButton,
+                                            &commandParam );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneState::SetTouchButtonDisabled
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetTouchPaneButtonDisabled( TInt aCommandId )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamInteger commandParam;
+        commandParam.SetInteger( aCommandId );
+
+        iViewCommandHandle->ExecuteCommand( EPhoneViewDisableTouchButton,
+                                            &commandParam );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::HandleLongHashL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleLongHashL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleLongHashL() ");
+
+    TPhoneCmdParamInteger numberEntryCountParam;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
+            &numberEntryCountParam );
+    TInt neLength( numberEntryCountParam.Integer() );
+
+    if( iCustomization && iCustomization->AllowAlphaNumericMode() )
+        {
+        if ( NumberEntryManagerL()->NumberEntryInNumericModeL() )
+            {
+            if ( neLength == 0 )
+                {
+                OnlyHashInNumberEntryL();
+                }
+
+            if ( neLength == 1 )
+                {
+                NumberEntryClearL();
+                }
+            }
+        NumberEntryManagerL()->NumberEntryToggleAlphaNumericModeL();
+        }
+    else
+        {
+        if( neLength == 1 )
+            {
+            TPhoneCmdParamBoolean isSecurityMode;
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+
+            if ( !isSecurityMode.Boolean() )
+                {
+                OnlyHashInNumberEntryL();
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::OpenVKBL
+// -----------------------------------------------------------
+//
+void CPhoneState::OpenVkbL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OpenVKB() ");
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenVirtualKeyBoard );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::BeginUiUpdateLC
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::BeginUiUpdateLC()
+    {
+
+    iViewCommandHandle->ExecuteCommand( EPhoneViewBeginUpdate );
+
+    TCleanupItem operation( UiUpdateCleanup, this );
+    CleanupStack::PushL( operation );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::BeginTransEffectLC
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::BeginTransEffectLC(  TStateTransEffectType aType )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::BeginTransEffectLC( ) ");
+    TPhoneCmdParamTransEffect effectParam;
+
+    switch ( aType )
+        {
+        case ENumberEntryOpen:
+            effectParam.SetType( EPhoneTransEffectDialerOpen );
+            break;
+        case ENumberEntryClose:
+            effectParam.SetType( EPhoneTransEffectDialerClose );
+            break;
+        case ENumberEntryCreate:
+            effectParam.SetType( EPhoneTransEffectDialerCreate );
+            break;
+        default:
+            effectParam.SetType( EPhoneTransEffectNone );
+        }
+
+    iViewCommandHandle->ExecuteCommand( EPhoneViewBeginTransEffect,  &effectParam );
+
+    TCleanupItem operation( EffectCleanup, this );
+    CleanupStack::PushL( operation );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::EndUiUpdate
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::EndUiUpdate()
+    {
+    CleanupStack::PopAndDestroy(); // Call UiUpdateCleanup
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::EndTransEffect
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::EndTransEffect()
+    {
+    CleanupStack::PopAndDestroy(); // Call EffectCleanup
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::CheckIfShowTerminationNote
+// This method is intended to be overridden in states
+// that contain more info about decision.
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::CheckIfShowCallTerminationNote( )
+    {
+    TBool show = EFalse;
+    TInt callSummaryActivated = 0;
+    const TInt err = CPhoneCenRepProxy::Instance()->GetInt(
+        KCRUidCommonTelephonySettings,
+        KSettingsSummaryAfterCall,
+        callSummaryActivated );
+
+    if ( err == KErrNone && callSummaryActivated )
+        {
+          show = ETrue;
+        }
+
+    return show;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::HandleDtmfKeyTone
+// Called from KeyEventForwarder
+// Allow only special characters to pass from
+// keyEventForwarder to phoneEngine
+// -----------------------------------------------------------------------------
+//
+
+EXPORT_C void CPhoneState::HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode )
+    {
+    SendDtmfKeyEventL( aKeyEvent, aEventCode );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::UiUpdateCleanup
+// -----------------------------------------------------------------------------
+//
+void CPhoneState::UiUpdateCleanup(TAny* aThis )
+    {
+    static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand(
+        EPhoneViewEndUpdate );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::EffectCleanup
+// -----------------------------------------------------------------------------
+//
+void CPhoneState::EffectCleanup(TAny* aThis )
+    {
+    TPhoneCmdParamTransEffect effectParam;
+    effectParam.SetType( EPhoneTransEffectStop );
+
+    static_cast<CPhoneState*>( aThis )->iViewCommandHandle->ExecuteCommand(
+        EPhoneViewEndTransEffect, &effectParam );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsDTMFEditorVisibleL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsDTMFEditorVisibleL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsDTMFEditorVisibleL( ) ");
+    return iViewCommandHandle->HandleCommandL(
+        EPhoneViewIsDTMFEditorVisible ) ==
+        EPhoneViewResponseSuccess;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::CloseDTMFEditorL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CloseDTMFEditorL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseDTMFEditorL()");
+    if ( iOnScreenDialer ) // Touch
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( EFalse );
+        // Disable dialer DTMF mode
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible,
+                                             &booleanParam );
+
+        // Closing effect is shown when DTMF dialer exist.
+        BeginTransEffectLC( ENumberEntryClose );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        EndTransEffect();
+        }
+    else // Non-Touch
+        {
+        // If dtmf query is visible then remove number entry
+        // because it should not be shown if user has pressed end key.
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
+        }
+
+    // Do state-specific behaviour if number entry is cleared
+    HandleNumberEntryClearedL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::SetDefaultFlagsL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetDefaultFlagsL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetDefaultFlagsL()");
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
+
+    // Reset Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    // Update FSW
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
+
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
+        &globalNotifierParam );
+
+    // uncapture App and Camera keys if not security mode
+    TPhoneCmdParamBoolean isSecurityMode;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+    if ( !isSecurityMode.Boolean() )
+        {
+        CaptureKeysDuringCallNotificationL( EFalse );
+        }
+
+    // Restore keylock if phone has been locked before call.
+    if ( iStateMachine->PhoneStorage()->NeedToEnableKeylock() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLock );
+        iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::GetVolumeLevel
+// -----------------------------------------------------------
+//
+TInt CPhoneState::GetVolumeLevel()
+    {
+    TPhoneCmdParamInteger integerParam;
+
+    iViewCommandHandle->ExecuteCommand( EPhoneViewGetAudioVolumeLevel,
+                                        &integerParam );
+    return integerParam.Integer();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::ShowVideoCallOutOfMemoryNoteL
+// -----------------------------------------------------------
+//
+void CPhoneState::ShowVideoCallOutOfMemoryNoteL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneState::ShowVideoCallOutOfMemoryNoteL()" );
+
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+
+    // Display error note
+    SExtendedError ext;
+    ext.iComponent = KUidPhoneApplication;
+    ext.iErrorNumber = KErrNoMemory;
+    ext.iInformation = EFalse;
+    TBuf<1> ignore;
+    iAvkonAppUi->HandleError( KErrNoMemory, ext, ignore, ignore );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::SimSecurityStatus
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneState::SimSecurityStatus() const
+    {
+    /*
+    Sim security statuses:
+
+    ESimSecurityStatusUninitialized = KStartupEnumerationFirstValue,
+    ESimRejected,   // The PUK code has been entered incorrectly, so the card is rejected.
+    ESimUnaccepted  // The SIM lock is on, so the card is unaccepted.
+    */
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SimSecurityStatus()" );
+    return CPhonePubSubProxy::Instance()->Value(
+                    KPSUidStartup, KStartupSimSecurityStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::CallWaitingNoteL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CallWaitingNoteL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CallWaitingNoteL()" );
+
+    TBuf< KPhoneContactNameMaxLength > callText( KNullDesC );
+
+    // Set CLI text for the call header
+    const TBool contactInfoAvailable =
+        iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() ||
+        iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length();
+
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneState::CallWaitingNoteL - contactInfoAvailable(%d)", contactInfoAvailable );
+
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneState::CallWaitingNoteL - remote name(%S)",
+        &iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ) );
+
+    __PHONELOG1( EBasic, EPhoneControl,
+        "CPhoneState::CallWaitingNoteL - company name(%S)",
+        &iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
+
+    if ( contactInfoAvailable )
+        {
+        // Set Call Text flag to waiting note
+        callText = iStateMachine->PhoneEngineInfo()->RemoteName( aCallId );
+
+        // if no remote name available then set company name
+        if ( callText == KNullDesC )
+            {
+            callText = iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId );
+            }
+
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetText( callText );
+        globalNoteParam.SetType( EAknGlobalInformationNote );
+        globalNoteParam.SetTone( EAvkonSIDInformationTone );
+        globalNoteParam.SetTextResourceId(
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCallWaitingWithLabel ) );
+
+        iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    else
+        {
+        SendGlobalInfoNoteL( EPhoneCallWaitingWithoutLabel );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneState::SetRingingTonePlaybackL()
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetRingingTonePlaybackL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneState::SetRingingTonePlaybackL()" );
+
+    TPhoneCmdParamRingTone ringToneParam;
+    ringToneParam.SetVolume(
+        iStateMachine->PhoneEngineInfo()->RingingVolume() );
+
+    TArray< TContactItemId > alertGroups =
+        iStateMachine->PhoneEngineInfo()->AlertForGroup();
+
+    TInt alertGroupCount = alertGroups.Count();
+    TInt contactGroupCount =
+        iStateMachine->PhoneEngineInfo()->ContactGroups( aCallId ).Count();
+    TBool alertingGroupFound( EFalse );
+
+    // Check contents of both the alerting groups array and call contact group
+    // array, if any of the group ids match then allow playing.
+    if ( alertGroupCount > 0 )
+        {
+        for ( TInt i = 0 ; i < alertGroupCount ; i++ )
+            {
+            for ( TInt j = 0 ; j < contactGroupCount ; j++ )
+                {
+                if ( alertGroups[ i ] ==
+                     ( iStateMachine->PhoneEngineInfo()->ContactGroups(
+                           aCallId ) )[ j ] )
+                    {
+                    alertingGroupFound = ETrue;
+                    }
+                }
+            }
+        if ( alertingGroupFound == EFalse )
+            {
+            ringToneParam.SetRingingType( EProfileRingingTypeSilent );
+            }
+        else
+            {
+            ringToneParam.SetRingingType(
+                iStateMachine->PhoneEngineInfo()->RingingType() );
+            }
+        }
+    else // no alerting groups set
+        {
+        ringToneParam.SetRingingType(
+            iStateMachine->PhoneEngineInfo()->RingingType() );
+        }
+
+    // Set ring tone
+    if ( iStateMachine->PhoneEngineInfo()->PersonalRingingTone(
+             aCallId ).Length() )
+        {
+        // Set the personal ring tone
+        ringToneParam.SetRingTone(
+            iStateMachine->PhoneEngineInfo()->PersonalRingingTone( aCallId ) );
+        ringToneParam.SetType( EPhoneRingTonePersonal );
+        }
+    else if ( iStateMachine->PhoneEngineInfo()->RingingTone(
+                  aCallId ).Length() )
+        {
+        // Set the profile ring tone
+        ringToneParam.SetRingTone(
+            iStateMachine->PhoneEngineInfo()->RingingTone( aCallId ) );
+        ringToneParam.SetType( EPhoneRingToneProfile );
+
+        if ( ( iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ).Length() > 0 &&
+                BaflUtils::FileExists( CCoeEnv::Static()->FsSession(),
+                        iStateMachine->PhoneEngineInfo()->CallerImage( aCallId ) ) ) ||
+               iStateMachine->PhoneEngineInfo()->HasCallerThumbnail( aCallId ) )
+            {
+            // Caller image set
+            ringToneParam.SetCallerImageStatus( ETrue );
+            }
+        }
+
+    // Set text to say, if enabled
+    if ( iStateMachine->PhoneEngineInfo()->TextToSpeech() )
+        {
+        ringToneParam.SetTextToSay(
+            iStateMachine->PhoneEngineInfo()->RemoteTextToSpeechText(
+                aCallId ) );
+        }
+
+    if ( iStateMachine->PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 )
+        {
+        ringToneParam.SetCallerTextStatus( ETrue );
+        }
+
+    // Play the ring tone
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewPlayRingTone, &ringToneParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleCugNoteL
+// -----------------------------------------------------------
+//
+void CPhoneState::HandleCugInUseNoteL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCugInUseNoteL() ");
+
+    TInt cugIndex( 0 );
+
+    RSSSettings ssSettings;
+    TInt retValue = ssSettings.Open();
+
+    if ( retValue == KErrNone )
+        {
+        ssSettings.Get( ESSSettingsCug, cugIndex  );
+        }
+    ssSettings.Close();
+
+    if ( cugIndex )
+        {
+        // Add it to the resource string
+        HBufC* buf = StringLoader::LoadLC(
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID(
+            EPhoneInfoCugInUse ), cugIndex );
+
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetText( *buf );
+        globalNoteParam.SetType( EAknGlobalInformationNote );
+        globalNoteParam.SetTone( EAvkonSIDInformationTone );
+
+        iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewShowGlobalNote, &globalNoteParam );
+
+        CleanupStack::PopAndDestroy( buf );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::CallheaderManagerL
+// -----------------------------------------------------------
+//
+CPhoneCallHeaderManager* CPhoneState::CallheaderManagerL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::CallheaderManagerL() ");
+    if ( !iCallHeaderManager )
+        {
+        iCallHeaderManager = CPhoneCallHeaderManager::NewL(
+                *iViewCommandHandle,
+                *iStateMachine,
+                iCustomization );
+        }
+    return iCallHeaderManager;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::CloseCustomizedDialerL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CloseCustomizedDialerL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CloseCustomizedDialerL( ) ");
+
+    // Set dialer back to default mode.
+    iViewCommandHandle->HandleCommandL( EPhoneViewHideCustomizedDialer );
+
+    // Closing effect is shown when customized dialer exist.
+    BeginTransEffectLC( ENumberEntryClose );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+
+    EndTransEffect();
+    // Do state-specific behaviour if number entry is cleared
+    HandleNumberEntryClearedL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::CustomizedDialerMenuResourceId
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneState::CustomizedDialerMenuResourceIdL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneState::CustomizedDialerMenuResourceId( ) ");
+    // Get and return customized dialer menu resource id
+    TPhoneCmdParamInteger integerParam;
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCustomizedDialerMenuResourceId,
+        &integerParam );
+    return integerParam.Integer();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::CustomizedDialerCbaResourceId
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneState::CustomizedDialerCbaResourceIdL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+           "CPhoneState::CustomizedDialerCbaResourceId( ) ");
+    // Get and return customized dialer CBA resource id
+    TPhoneCmdParamInteger integerParam;
+    iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCustomizedDialerCbaResourceId,
+        &integerParam );
+    return integerParam.Integer();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::ShowDtmfDialerL
+// -----------------------------------------------------------
+//
+void CPhoneState::ShowDtmfDialerL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneState::ShowDtmfDialerL()" );
+
+    // Set dialer to DTMF mode.
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfDialerViewVisible,
+                                         &booleanParam );
+
+    BeginTransEffectLC( ENumberEntryCreate );
+
+    if ( IsNumberEntryUsedL() )
+        {
+        // Store the number entry content to cache
+        if ( !IsNumberEntryContentStored() )
+            {
+            StoreNumberEntryContentL();
+            }
+        // Clear and display DTMF dialer
+        NumberEntryClearL();
+        SetNumberEntryVisibilityL(ETrue);
+        }
+    else
+        {
+        // Create and display DTMF dialer
+        NumberEntryManagerL()->CreateNumberEntryL();
+        }
+
+    EndTransEffect();
+
+    // Update CBA
+    iCbaManager->UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CheckIfRestoreNEContentAfterDtmfDialer()
+    {
+    if ( IsOnScreenDialerSupported() )
+        {
+        TBool isDialerVisible( EFalse );
+        TRAP_IGNORE( isDialerVisible = IsDTMFEditorVisibleL() );
+
+         if ( isDialerVisible )
+             {
+             TRAP_IGNORE( CloseDTMFEditorL() );
+             }
+
+         // if the DTMF dialer is used before the idle message, we have to
+         // restore the original content of the number entry
+         if ( IsNumberEntryContentStored() )
+             {
+             TBool isNumberEntryUsed( EFalse );
+             TRAP_IGNORE( isNumberEntryUsed = IsNumberEntryUsedL() );
+
+             if ( !isNumberEntryUsed )
+                 {
+                 TRAP_IGNORE( NumberEntryManagerL()->CreateNumberEntryL() );
+                 }
+             // Restore the number entry content from cache
+             TRAP_IGNORE( RestoreNumberEntryContentL() );
+             }
+         }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsOnScreenDialerSupported
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsOnScreenDialerSupported() const
+    {
+    return iOnScreenDialer;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneState::LoadResource
+// ---------------------------------------------------------------------------
+//
+void CPhoneState::LoadResource( TDes& aData, const TInt aResource ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::LoadResource() ");
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::LoadResource - aResource: %d", aResource );
+    StringLoader::Load(  aData,
+                         CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ),
+                         &iEnv  );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsAnyConnectedCalls
+// -----------------------------------------------------------
+//
+TBool CPhoneState::IsAnyConnectedCalls()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAnyConnectedCalls() ");
+    TBool connectedCall(EFalse);
+    if ( iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnected ) ||
+        iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnecting ) ||
+        iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnectedConference ) )
+        {
+        connectedCall = ETrue;
+        }
+    __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyConnectedCalls: (%d)", connectedCall );
+    return connectedCall;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::NumberEntryContentL
+// -----------------------------------------------------------
+//
+CPhoneNumberEntryManager* CPhoneState::NumberEntryManagerL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::NumberEntryContentL() ");
+    if ( !iNumberEntryManager )
+        {
+        iNumberEntryManager = CPhoneNumberEntryManager::NewL(
+                this,
+                *iViewCommandHandle,
+                *iStateMachine,
+                iCustomization,
+                *iCbaManager );
+        }
+    return iNumberEntryManager;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::PhoneNumberFromEntryLC()
+// -----------------------------------------------------------
+//
+EXPORT_C HBufC* CPhoneState::PhoneNumberFromEntryLC()
+    {
+    return NumberEntryManagerL()->PhoneNumberFromEntryLC();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsNumberEntryUsedL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsNumberEntryUsedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryUsedL( ) ");
+    return NumberEntryManagerL()->IsNumberEntryUsedL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsNumberEntryVisibleL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsNumberEntryVisibleL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsNumberEntryVisibleL( ) ");
+    return NumberEntryManagerL()->IsNumberEntryVisibleL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::KeyEventForExistingNumberEntryL
+// -----------------------------------------------------------
+//
+void CPhoneState::KeyEventForExistingNumberEntryL( const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::KeyEventForExistingNumberEntryL( ) ");
+    NumberEntryManagerL()->KeyEventForExistingNumberEntryL( aKeyEvent, aEventCode );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleNumberEntryClearedL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleNumberEntryClearedL( ) ");
+    NumberEntryManagerL()->HandleNumberEntryClearedL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::SetNumberEntryVisibilityL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetNumberEntryVisibilityL( const TBool aVisible )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::SetNumberEntryVisibilityL( ) ");
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    if ( !aVisible )
+        {
+        booleanParam.SetBoolean( EFalse );
+        }
+    NumberEntryManagerL()->SetNumberEntryVisibilityL( booleanParam );
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::HandleCreateNumberEntryL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleCreateNumberEntryL(
+        const TKeyEvent& /*aKeyEvent*/,
+        TEventCode /*aEventCode*/ )
+    {
+    NumberEntryManagerL()->HandleCreateNumberEntryL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::IsNumberEntryContentStored
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsNumberEntryContentStored()
+    {
+    TBool isNumberEntryContentStored( EFalse );
+    TRAP_IGNORE( isNumberEntryContentStored = NumberEntryManagerL()->IsNumberEntryContentStored() );
+    return isNumberEntryContentStored;
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::StoreNumberEntryContentL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::StoreNumberEntryContentL()
+    {
+    NumberEntryManagerL()->StoreNumberEntryContentL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::RestoreNumberEntryContentL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::RestoreNumberEntryContentL()
+    {
+    NumberEntryManagerL()->RestoreNumberEntryContentL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::ClearNumberEntryContentCache
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::ClearNumberEntryContentCache()
+    {
+    TRAP_IGNORE( NumberEntryManagerL()->ClearNumberEntryContentCache() );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleNumberEntryEdited
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleNumberEntryEdited()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::HandleNumberEntryEdited() ");
+    TRAP_IGNORE( NumberEntryManagerL()->HandleNumberEntryEdited() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneState::IsAlphanumericSupportedAndCharInput
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::IsAlphanumericSupportedAndCharInput(
+        const TKeyEvent& aKeyEvent )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAlphanumericSupportedAndCharInput() ");
+    TBool alphaNumericSupport(EFalse);
+    TRAP_IGNORE( alphaNumericSupport = NumberEntryManagerL()->IsAlphanumericSupportedAndCharInput( aKeyEvent ) );
+    return alphaNumericSupport;
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::OnlyHashInNumberEntryL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::OnlyHashInNumberEntryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::OnlyHashInNumberEntryL( ) ");
+    // 0.8 seconds has passed, start ALS line change timer
+    StartAlsLineChangeTimerL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::NumberEntryClearL
+// -----------------------------------------------------------
+//
+void CPhoneState::NumberEntryClearL()
+    {
+    NumberEntryManagerL()->NumberEntryClearL();
+    }
+    
+// -----------------------------------------------------------
+// CPhoneState::UpdateSilenceButtonDimming
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::UpdateSilenceButtonDimming()
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        const TProfileRingingType ringingType =
+            iStateMachine->PhoneEngineInfo()->RingingType();
+        
+        TBool callIsAlerting =
+                !(( ringingType == EProfileRingingTypeSilent ) ||
+                  ( ringingType == EProfileRingingTypeBeepOnce ));
+
+        if ( !callIsAlerting )
+            {
+            SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::GetBlockedKeyList
+// -----------------------------------------------------------
+//
+EXPORT_C const RArray<TInt>& CPhoneState::GetBlockedKeyList() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::GetBlockedKeyList( ) ");
+    return iStateMachine->PhoneStorage()->GetBlockedKeyList();
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DisableHWKeysL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DisableHWKeysL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableHWKeysL( ) ");
+
+    if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() )
+        {
+        __PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableHWKeysL HW Keys Disabled " );
+
+        iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyNo );
+        iStateMachine->PhoneStorage()->AppendBlockedKeysListL( EStdKeyYes );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::DisableCallUIL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::DisableCallUIL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisableCallUIL( ) ");
+
+    // Set Call UI state to storage
+    if( !iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        __PHONELOG( EBasic, EPhoneControl, " CPhoneState::DisableCallUIL CallUI Disabled " );
+
+        // Show keys locked note
+        TPhoneCmdParamNote noteParam;
+        noteParam.SetType( EPhoneNoteUIDisabled );
+        noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneInformationNote ) );
+    
+        HBufC* noteText = StringLoader::LoadLC( 
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneIncomingCallKeysLocked ) );
+        noteParam.SetText( *noteText );
+    
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+        CleanupStack::PopAndDestroy( noteText );
+    
+        // Start capturing the key guard key
+        TPhoneCmdParamKeyCapture appKeyCaptureParam;
+        appKeyCaptureParam.SetKey( EStdKeyDevice7 );
+        appKeyCaptureParam.SetKeyCode( EKeyDeviceF );
+        appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewStartCapturingKey, &appKeyCaptureParam );
+        
+        // Set Call UI state to storage
+        iStateMachine->PhoneStorage()->SetScreenLocked( ETrue );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::EnableCallUIL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::EnableCallUIL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::EnableCallUIL( ) ");
+
+    if( iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        __PHONELOG( EBasic, EPhoneControl, " CPhoneState::EnableCallUIL CallUI Enabled " );
+
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
+
+        // Stop capturing the key guard key
+        TPhoneCmdParamKeyCapture appKeyCaptureParam;
+        appKeyCaptureParam.SetKey( EStdKeyDevice7 );
+        appKeyCaptureParam.SetKeyCode( EKeyDeviceF );
+        appKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewStopCapturingKey, &appKeyCaptureParam );
+        
+        iStateMachine->PhoneStorage()->SetScreenLocked( EFalse );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::CheckDisableHWKeysAndCallUIL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::CheckDisableHWKeysAndCallUIL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::CheckDisableHWKeysAndCallUIL( ) ");
+
+    if( IsKeyLockOn() || IsAutoLockOn() )
+        {
+        // Disable HW keys if needed
+        if( CPhoneCenRepProxy::Instance()->
+                IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) )
+            {
+            DisableHWKeysL();
+            }
+
+        // Disable Call UI if needed
+        if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
+                && !CPhoneCenRepProxy::Instance()->
+                IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) )
+            {
+            DisableCallUIL();
+            iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( ETrue );
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::HandleHoldSwitchL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleHoldSwitchL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneState::HandleHoldSwitchL( ) ");
+
+    if( CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) )
+        {
+        if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() )
+            {
+            // Disable HW Keys if needed
+            DisableHWKeysL();
+            }
+        else
+            {
+            // Reset blocked keys list
+            iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+            }
+        }
+    
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+            && !CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) )
+        {
+        if( iStateMachine->PhoneStorage()->IsScreenLocked() )
+            {
+            // Enable Call
+            EnableCallUIL();
+            }
+        else
+            {
+            // Set keylock enabled
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote );
+            // Disable Call
+            DisableCallUIL();
+            }
+        }
+        
+        // Stop ringingtone
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::RetainPreviousKeylockStateL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::RetainPreviousKeylockStateL()
+    {
+    // Lock keypad, if keylock was enabled before incoming call.
+    // Also reset PhoneStorage keylock status.
+    if ( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) &&
+        iStateMachine->PhoneStorage()->NeedToEnableKeylock() )
+        {
+        iStateMachine->PhoneStorage()->SetNeedToEnableKeylock( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLockWithoutNote ); 
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::HandleKeyLockEnabledL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::HandleKeyLockEnabled( TBool aKeylockEnabled )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleKeyLockEnabledL( ) ");
+    if( !FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
+        && CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) )
+        {
+        if( !aKeylockEnabled )
+            {
+            // Keylock disabled
+            // Reset blocked keys list
+            iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+            }
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneState::SetToolbarDimming
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetToolbarDimming( TBool aDimmed )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( aDimmed );
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetToolbarDimming, &booleanParam ));
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SetToolbarButtonLoudspeakerEnabled
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetToolbarButtonLoudspeakerEnabled()
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamInteger integerParam;
+        integerParam.SetInteger( EPhoneInCallCmdActivateIhf );
+        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewEnableToolbarButton, &integerParam ));
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::SetToolbarDimming
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( aActive );
+        iViewCommandHandle->ExecuteCommand(
+            EPhoneViewBackButtonActive, &booleanParam );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneState::OpenSoftRejectMessageEditorL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneState::OpenSoftRejectMessageEditorL ()" );
+
+    // Fetch incoming call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+
+    TInt ringingCallId( KErrNotFound );
+    // Do nothing if negative incoming call id
+    if( callStateData.CallId() > KErrNotFound  )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
+        
+        ringingCallId = callStateData.CallId();
+        }
+    
+    
+    TPhoneCmdParamSfiData sfiDataParam;
+
+    if (KErrNotFound != ringingCallId) 
+        {
+        if ( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ).Length() )
+            {
+            // store both the name and the number
+            sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) );
+            sfiDataParam.SetName( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ) );
+            }
+        else
+            {
+            // store the number
+            sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) );
+            }
+        }
+
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestatecallsetup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,732 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateCallSetup class.
+*
+*/
+
+
+// INCLUDES
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <AknUtils.h>
+#include <mpeengineinfo.h>
+#include <mpeclientinformation.h>
+
+#include "cphonepubsubproxy.h"
+#include "cphonestatecallsetup.h"
+#include "cphonestateincall.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamkeyevent.h"
+#include "tphonecmdparamnote.h"
+#include "tphonecmdparamquery.h"
+#include "phonestatedefinitions.h"
+#include "phoneui.hrh"
+#include "phonerssbase.h"
+#include "cphonemainresourceresolver.h"
+#include "phonelogger.h"
+#include "phoneui.pan"
+#include "cphonedtmfwaitchartimer.h"
+#include "tphonecmdparamaudiooutput.h"
+#include "cphonekeys.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneStateCallSetup::CPhoneStateCallSetup( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aCustomization ) : 
+    CPhoneState( aStateMachine, aViewCommandHandle, aCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::~CPhoneStateCallSetup()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneStateCallSetup::~CPhoneStateCallSetup()
+    {
+    delete iDtmfWaitCharTimer;    
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::ConstructL()
+    {
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    
+    CPhoneState::BaseConstructL();
+    
+    // Enable the volume display
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );   
+    HandleAudioOutputChangedL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateCallSetup* CPhoneStateCallSetup::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneStateCallSetup* self = new (ELeave) CPhoneStateCallSetup( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleCommandL()
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateCallSetup::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,  
+        "CPhoneStateCallSetup::HandleCommandL()" );
+    TBool commandStatus = ETrue;
+    
+    switch( aCommand )
+        {
+        case EPhoneInCallCmdDialer:
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer );
+            break;
+            
+        case EPhoneNumberAcqCmdAddToContacts:
+            {
+            // If call setup is ongoing then add to contacts query should
+            // not be opened -> do nothing here.
+            }
+            break;
+         
+        // DTMF entry - Ok          
+        case EPhoneCmdDtmfOk:
+            SendDtmfL();
+            break;
+         
+        // DTMF sending - Cancel
+        case EPhoneInCallCmdCancelSendingDtmfString:
+            // Stop the asynchronous sending operation the 
+            // PhoneEngine may be performing.
+            iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageStopDTMFSending );
+            // Remove DTMF sending from screen
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+            break; 
+        
+        // DTMF wait - Ok
+        case EPhoneInCallCmdContinueSendingDtmfString:
+            // Continue sending the DTMF string
+            if( !iDtmfWaitCharTimer )
+                {
+                iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( 
+                    iStateMachine );                    
+                }
+            iDtmfWaitCharTimer->ButtonPressedL();
+            break;
+                
+        case EPhoneDialerCmdHelpDtmf:
+            {
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {                
+                TPtrC contextName( KDATA_DIALER_HLP_SEND_DTMF );
+                iViewCommandHandle->ExecuteCommandL( 
+                    EPhoneViewLaunchHelpApplication,
+                    0,
+                    contextName );
+                }
+            }
+            break;
+        
+        case EPhoneCmdOptions:
+            OpenMenuBarL();
+            break;
+        
+        case EPhoneInCallCmdDtmfManualQuery:
+             if ( iOnScreenDialer )
+                 {
+                 ShowDtmfDialerL();
+                 }
+              break;    
+            
+        case EPhoneDtmfDialerExit:      // fall through
+        case EPhoneDtmfDialerCancel:
+            CloseDTMFEditorL();
+            break;
+
+        case EPhoneInCallCmdMute: // fall through
+        case EPhoneInCallCmdUnmute:
+            iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( 
+                ( aCommand == EPhoneInCallCmdMute ) );
+            iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageSetAudioMute );
+            break;
+                                   
+        default:
+            commandStatus = CPhoneState::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::OpenMenuBarL   
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateCallSetup::OpenMenuBarL()" );
+
+    if ( iOnScreenDialer )
+        {
+        if ( IsDTMFEditorVisibleL() && IsNumberEntryVisibleL() )
+            {
+            TInt resourceId = EPhoneDtmfDialerMenubar;
+            
+            TPhoneCmdParamInteger integerParam;
+            integerParam.SetInteger( 
+                CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resourceId ) );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+                &integerParam );
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateCallSetup::HandleNumberEntryClearedL()" );
+         
+    // Update call setup CBA when number entry is cleared
+    UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleCreateNumberEntryL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::HandleCreateNumberEntryL( 
+        const TKeyEvent& /*aKeyEvent*/,
+        TEventCode /*aEventCode*/)
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateCallSetup::HandleCreateNumberEntryL()" );
+    
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateInCallCbaL() ");
+    UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::UpdateCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::UpdateCbaL( TInt aResource )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateCbaL() ");
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        iCbaManager->SetCbaL( EPhoneDtmfDialerCBA );        
+        }
+    else
+        {
+        iCbaManager->UpdateCbaL( aResource );   
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleKeyEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::HandleKeyEventL( 
+    const TKeyEvent& aKeyEvent, 
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleKeyEventL( ) ");
+   
+    if ( iOnScreenDialer && IsNumberEntryVisibleL() )
+        {
+        HandleNumericKeyEventL( aKeyEvent, aEventCode );
+        }
+    else
+        {
+        // Send the key events to the phone engine
+        switch( aEventCode )
+            {
+            case EEventKey:
+                {
+                PlayKeySpecificDTMF( aKeyEvent.iCode );
+                    
+                if ( aKeyEvent.iScanCode == EStdKeyUpArrow && 
+                        !OnlySideVolumeKeySupported() )
+                    {
+                    // Increace audio volume
+                    CPhoneState::IncreaseAudioVolumeL();            
+                    }
+                else if ( aKeyEvent.iScanCode == EStdKeyDownArrow && 
+                        !OnlySideVolumeKeySupported() )
+                    {
+                    // Decreace audio volume
+                    CPhoneState::DecreaseAudioVolumeL();     
+                    }
+                }
+                break;
+                
+            case EEventKeyUp:
+                // Send a key up event for the last key code sent to
+                // the phone engine
+                iStateMachine->SendPhoneEngineMessage( 
+                    MPEPhoneModel::EPEMessageEndDTMF );
+                break;
+                
+            default:
+                break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::PlayKeySpecificDTMF
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetup::PlayKeySpecificDTMF( const TUint aCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::PlayKeySpecificDTMF( ) ");
+    TBuf<1> buffer; // one character
+    buffer.Append( aCode );
+    __PHONELOG1( EBasic, EPhoneControl, "HandleKeyEventL(%S)", &buffer );
+    // Convert key code to western.
+    AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern );
+    __PHONELOG1( EBasic, EPhoneControl, "ConvertDigitsTo(%S)", &buffer );
+    TLex code( buffer ); 
+    // Send the key press to the phone engine, if applicable
+    iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() );
+    iStateMachine->SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessagePlayDTMF );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // end-key
+        case EKeyNo:
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                // Close all connections
+                iStateMachine->SendPhoneEngineMessage(
+                    MPEPhoneModel::EPEMessageTerminateAllConnections );
+                
+                // Remove number entry if long press
+                if ( IsNumberEntryUsedL() )
+                    {
+                    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+                        {
+                        CloseDTMFEditorL();
+                        } 
+                    else
+                        {
+                        iViewCommandHandle->ExecuteCommandL( 
+                            EPhoneViewRemoveNumberEntry );
+                        }
+                    }
+                }
+            else
+                {                
+                // handle end key
+                CPhoneState::DisconnectCallL();             
+                }
+            break;
+        
+        // Voice key
+        case EKeyDevice6:
+            if ( aMessage == EPhoneKeyShortPress )
+                {
+                // Toggle the handsfree mode
+                const TBool handsfreeMode = 
+                    iStateMachine->PhoneEngineInfo()->AudioOutput() ==
+                        EPELoudspeaker;
+                CPhoneState::SetHandsfreeModeL( !handsfreeMode );
+                }
+            else // aMessage == EPhoneKeyLongPress
+                {
+                // Display call in progress information note
+                CPhoneState::SendGlobalInfoNoteL( EPhoneCallInProgress );
+                }
+            break;
+
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateCallSetup::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandlePhoneEngineMessageL()");
+
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageRemoteTerminated:
+            if ( IsVideoCall( aCallId ) )
+                {
+                HandleRemoteTerminatedL( aCallId );
+                }
+            break;
+
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageAudioOutputChanged:
+            HandleAudioOutputChangedL();
+            break;
+            
+        case MEngineMonitor::EPEMessageSendingDTMF:   // fall through
+        case MEngineMonitor::EPEMessageContinuingDTMFSending:
+            HandleSendingDTMFL();
+            break;
+         
+        case MEngineMonitor::EPEMessageStoppedDTMF:
+            HandleStoppedDTMFL();
+            break;
+
+        case MEngineMonitor::EPEMessageSentDTMF:    // fall through
+        case MEngineMonitor::EPEMessageDTMFSendingAborted:
+            CancelDTMFSendingL();
+            break;
+            
+         default:
+            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleSendingDTMFL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetup::HandleSendingDTMFL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateCallSetup::HandleSendingDTMFL()" );
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteDtmfSending );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneSendingDtmfWaitNote ) );
+
+    // Show the "Sending..." Wait Note, and pre-populate it 
+    // with the PhoneEngine's current DTMF String.
+    // Set the text for the wait-note.
+    TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString();
+    HBufC* noteText = StringLoader::LoadLC( 
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSendingDtmfWaitNoteText ), 
+        dtmfString );
+    noteParam.SetText( *noteText );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+
+    CleanupStack::PopAndDestroy( noteText );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleStoppedDTMFL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetup::HandleStoppedDTMFL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateCallSetup::HandleStoppedDTMFL()" );
+    // Remove the Sending... note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+
+    // Fetch the remaining (unparsed) portion of the DTMF String 
+    // from PhoneEngine
+    TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString();
+
+    if ( dtmfString.Length() )
+        {
+        // Show the DTMF Wait Character confirmation query
+        TPhoneCmdParamQuery queryParam;
+        queryParam.SetQueryType( EPhoneQueryDialog );
+        queryParam.SetQueryResourceId( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                EPhoneDtmfWaitCharacterConfirmationQuery ) );
+
+        // Append the PhoneEngine's current DTMF String to the query's prompt
+        HBufC* queryPrompt = StringLoader::LoadLC( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                EPhoneDtmfWaitCharacterConfirmationQueryText ), 
+            dtmfString );
+        queryParam.SetQueryPrompt( *queryPrompt );
+
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, 
+            &queryParam );
+
+        CleanupStack::PopAndDestroy( queryPrompt );
+        }
+    else
+        {
+        // Stop the asynchronous sending operation the 
+        // PhoneEngine may be performing.
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageStopDTMFSending );
+
+        // Prompt for more characters by showing DTMF query with empty string
+        HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+        TPtr ptr( emptyString->Des() );
+
+        CPhoneState::ShowTextQueryL( 
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneDtmfNumberQuery ),
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ),
+            &ptr );
+
+        CleanupStack::PopAndDestroy( emptyString );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::CancelDTMFSendingL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetup::CancelDTMFSendingL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateCallSetup::CancelDTMFSendingL()" );
+    // Remove the Sending... note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetup::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleConnectedL()");
+    // Keep Phone in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+        
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    
+    BeginUiUpdateLC();
+        
+    // Remove the number entry if it isn't DTMF dialer
+    /*if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }*/
+    
+    // Update the single call
+    CPhoneState::UpdateSingleActiveCallL( aCallId );
+            
+    // Update touch buttons
+    SetTouchPaneButtons( EPhoneIncallButtons );        
+
+    SetToolbarDimming( EFalse );
+
+    EndUiUpdate();
+    
+    // Go to single state
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );    
+
+    iStateMachine->ChangeState( EPhoneStateSingle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetup::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleIdleL()");
+    
+    BeginTransEffectLC ( ENumberEntryOpen );
+    BeginUiUpdateLC ();
+    
+    // Disable the volume display
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
+
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+    SetDefaultFlagsL();
+       
+    CheckIfRestoreNEContentAfterDtmfDialer();
+      
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);    
+        }    
+    else if ( NeedToSendToBackgroundL() )
+        {
+        __PHONELOG( EBasic,EPhoneControl,"CPhoneStateCallSetup::elseif1");
+        // Continue displaying current app but set up the 
+        // idle screen in the background
+        SetupIdleScreenInBackgroundL();
+        }
+    else
+        {
+        __PHONELOG( EBasic,EPhoneControl,"CPhoneStateCallSetup::elseif2");
+         // Display idle screen
+        DisplayIdleScreenL();
+        }
+        
+    EndUiUpdate();
+    EndTransEffect(); 
+    // Go to idle state
+    // No need update cba
+    iStateMachine->ChangeState( EPhoneStateIdle );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateCallSetup::HandleRemoteTerminatedL
+// -----------------------------------------------------------------------------
+//
+void CPhoneStateCallSetup::HandleRemoteTerminatedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleRemoteTerminatedL( ) ");
+
+    // Remove call header
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+    
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetGlobalNotifiersDisabled, &globalNotifierParam );
+
+    // Video call not possible note is shown by 
+    // CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL method,
+    // if error ECCPErrorCCResourceNotAvailable occured.
+    }    
+    
+// -----------------------------------------------------------------------------
+// CPhoneStateCallSetup::HandleAudioOutputChangedL
+// -----------------------------------------------------------------------------
+//    
+void CPhoneStateCallSetup::HandleAudioOutputChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleAudioOutputChangedL( ) ");
+   
+    // Update the call setup CBA
+    UpdateInCallCbaL();
+    
+    CPhoneState::HandleAudioOutputChangedL();
+    }
+ 
+// -----------------------------------------------------------
+// CPhoneStateCallSetup::SendDtmfL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetup::SendDtmfL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateCallSetup::SendDtmfL()" );
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );    
+
+    // First get the DTMF sequence from dialog
+    TPhoneCmdParamString dtmfSequence;
+    HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
+    TPtr ptr( content->Des() );
+    dtmfSequence.SetString( &ptr );
+    
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommand(
+            EPhoneViewGetNumberFromEntry,
+            &dtmfSequence );  
+                    
+        CloseDTMFEditorL();
+        }
+    else
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
+                                             &dtmfSequence );
+        }        
+
+    // Send the DTMF
+    if ( ptr.Length() )
+        {
+        iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
+        iStateMachine->SendPhoneEngineMessage(
+            MPEPhoneModel::EPEMessageSendDTMF );    
+        }
+    
+    CleanupStack::PopAndDestroy( content );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestatehandle.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateHandle class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <pevirtualengine.h>
+
+#include "phoneui.pan"
+#include "phoneconstants.h"
+#include "cphonestatehandle.h"
+#include "mphonestate.h"
+#include "phonelogger.h"
+#include "cphoneerrormessageshandler.h"
+
+// Constant defines state singleton priority which must be lower
+// than KUidNoteControllerSingleton priority(which is default 100) 
+// this ensures that NoteControl is destructed before iFactoryLibrary 
+// is closed.
+const TInt SingletonDestructionPriority(99);
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// -----------------------------------------------------------------------------
+// CPhoneStateHandle::CPhoneStateHandle
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneStateHandle::CPhoneStateHandle(
+    MPhoneViewCommandHandle* aViewCommandHandle) : 
+    CCoeStatic( KUidStateHandleSingleton, SingletonDestructionPriority ),
+    iViewCommandHandle( aViewCommandHandle )
+    {
+    }
+
+// Destructor
+CPhoneStateHandle::~CPhoneStateHandle()
+    {   
+    if ( iFactoryLibrary.Handle() )
+        {
+        delete iPhoneErrorMessagesHandler; 
+        delete iPhoneResourceResolver;
+        delete iPhoneStateMachine;
+        delete iStateMachineFactory;
+        iFactoryLibrary.Close();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateHandle::CreateL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneStateHandle* CPhoneStateHandle::CreateL( 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    const TDesC& aFileName, 
+    const TUid aFactoryUid )
+    {
+    CPhoneStateHandle* instance = static_cast<CPhoneStateHandle*>(
+        CCoeEnv::Static( KUidStateHandleSingleton ) );
+    if ( !instance )
+        {
+        instance = new( ELeave ) CPhoneStateHandle( aViewCommandHandle );
+        CleanupStack::PushL( instance );
+        instance->ConstructL( aFileName, aFactoryUid );
+        CleanupStack::Pop( instance );
+        }
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateHandle::InstanceL
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneStateHandle* CPhoneStateHandle::Instance()
+    {
+    CPhoneStateHandle* instance = static_cast<CPhoneStateHandle*>(
+        CCoeEnv::Static( KUidStateHandleSingleton ) );
+    __ASSERT_DEBUG( instance, Panic( EPhoneCtrlSingletonNotInitialized ) );
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateHandle::StateMachine
+// ---------------------------------------------------------
+//
+EXPORT_C MPhoneStateMachine* CPhoneStateHandle::StateMachine()
+    {   
+    __ASSERT_DEBUG( Instance(), Panic( EPhoneCtrlSingletonNotInitialized ) );
+    return iPhoneStateMachine;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateHandle::ViewCommandHandle
+// ---------------------------------------------------------
+//
+EXPORT_C MPhoneViewCommandHandle* CPhoneStateHandle::ViewCommandHandle()
+    {
+    return iViewCommandHandle;        
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneStateHandle::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneStateHandle::ConstructL( 
+    const TDesC& aFileName,
+    const TUid aFactoryUid )
+    {
+    TFileName fileName( KDriveZ );
+    fileName.Append( KDC_SHARED_LIB_DIR );
+    fileName.Append( aFileName );   
+    LoadLibraryHandleL( fileName, aFactoryUid );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateHandle::LoadLibraryHandleL
+// ---------------------------------------------------------
+void CPhoneStateHandle::LoadLibraryHandleL( 
+    const TDesC& aFileName,
+    const TUid aFactoryUid )
+    {
+
+    TBool factoryFound = EFalse;
+    TParse fullentry;
+    fullentry.Set( aFileName, NULL, NULL );
+
+    if ( iFactoryLibrary.Load( fullentry.Name(), fullentry.DriveAndPath() ) 
+        == KErrNone )
+        {
+        if ( iFactoryLibrary.Type()[1] == aFactoryUid )
+            {
+            factoryFound = ETrue;
+            }
+        else
+            {
+            iFactoryLibrary.Close();
+            }
+        }
+
+    // If Factory not found:
+    if ( !factoryFound )
+        {
+        Panic( EPhoneCtrlFactoryLibraryNotFound );
+        }
+    // Look for the 1st exported function
+    iEntry = iFactoryLibrary.Lookup( KPhoneUiStateMachineOrdinal ); 
+
+    // Create the state machine factory
+    iStateMachineFactory = (CPhoneUIStateMachineFactoryBase*) iEntry();
+
+    // Create the state machine
+    iPhoneStateMachine = iStateMachineFactory->CreatePhoneStateMachineL(
+        iViewCommandHandle );
+
+    // Create the phone resource resolver
+    iPhoneResourceResolver = 
+        iStateMachineFactory->CreatePhoneResourceResolverL();
+    
+    // Create the phone error messages handler    
+    iPhoneErrorMessagesHandler = 
+        iStateMachineFactory->CreatePhoneErrorMessagesHandlerL( 
+                            iViewCommandHandle, iPhoneStateMachine );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestateidle.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1394 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateIdle class.
+*
+*/
+
+
+// INCLUDES
+#include <eikenv.h>
+#include <e32property.h>
+#include <connect/sbdefs.h>
+#include <w32std.h>
+#include <StringLoader.h>
+#include <aknnotedialog.h> // For CAknNoteDialog::EErrorTone
+#include <apgcli.h>
+#include <telephonyvariant.hrh>
+#include <featmgr.h>
+#include <settingsinternalcrkeys.h>
+#include <mpeengineinfo.h>
+#include <activeidle2domainpskeys.h>
+#include <mpeclientinformation.h>
+#include <bldvariant.hrh>
+
+#include "cphonepubsubproxy.h"
+#include "cphonecenrepproxy.h"
+#include "cphonestateidle.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamspeeddial.h"
+#include "tphonecmdparamboolean.h"
+#include "mphonestatemachine.h"
+#include "phonestatedefinitions.h"
+#include "tphonecmdparamappinfo.h"
+#include "cphonekeys.h"
+
+#include "tphonecmdparamcallstatedata.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "phonerssbase.h"
+#include "cphonemainresourceresolver.h"
+#include "cphonecenrepproxy.h"
+#include "cphonepubsubproxy.h"
+#include "phonelogger.h"
+#include "phoneui.pan"
+#include "mphonecustomization.h"
+
+//CONSTANTS
+const TInt  KMaxParamLength = 1024;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneStateIdle::CPhoneStateIdle( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aCustomization ) : 
+    CPhoneState( aStateMachine, aViewCommandHandle, aCustomization )
+    {
+    }
+
+// Destructor
+EXPORT_C CPhoneStateIdle::~CPhoneStateIdle()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::ConstructL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() ");
+    CPhoneState::BaseConstructL();
+    
+    // Set send key activation on.
+    TPhoneCmdParamBoolean boolean;
+    boolean.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSendKeyDialerActivationFlag, 
+                &boolean );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCreatePhoneBookServices );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::NewL()
+// -----------------------------------------------------------
+//
+CPhoneStateIdle* CPhoneStateIdle::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneStateIdle* self = new (ELeave) CPhoneStateIdle( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleKeyEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandleKeyEventL( 
+    const TKeyEvent& aKeyEvent, 
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) ");
+    // Security mode check
+    TPhoneCmdParamBoolean isSecurityMode;      
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );  
+    // Number entry is blocked, if active Query
+    if ( !IsAnyQueryActiveL() )
+        {
+        // Handle numeric keys when key events are received in idle state
+        HandleNumericKeyEventL( aKeyEvent, aEventCode );  
+        }
+    else if ( isSecurityMode.Boolean() && CPhoneKeys::IsNumericKey( 
+        aKeyEvent, aEventCode ) )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+        // Handle numeric keys when key events are received in single state
+        HandleNumericKeyEventL( aKeyEvent, aEventCode );  
+        }
+    else if ( aEventCode == EEventKeyUp )
+        {
+        // Provide up event to engine. 
+        // Otherwise DTMF tone keeps playing.    
+           iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageEndDTMF );
+         __PHONELOG( EBasic, EPhoneControl,
+                "PhoneUIControl: CPhoneStateIdle::HandleKeyEventL" );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleNumberEntryClearedL( ) ");
+    
+    if ( IsSimOk() && !IsSimStateNotPresentWithSecurityModeEnabled() )
+        {
+        //  if still idle ( f.e not incoming call arrived when rfs )
+        if ( iStateMachine->State() == this )
+            {
+            DisplayIdleScreenL();
+            }
+        }
+   else
+        {
+        StartShowSecurityNoteL(); 
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) ");
+
+    if( aMessage == EPhoneKeyLongPress && CheckAppLaunchingL( aCode ) )
+        {
+        return;
+        }
+
+    switch ( aCode )
+        {
+        case EKeyEnd:
+            // This key even occur only in idle state, behaviour for this should
+            // be same as long end-key press. (Bug in window server)
+            HandleEndKeyPressL( EPhoneKeyLongPress );
+            break;
+            
+        // end-key
+        case EKeyNo:
+            HandleEndKeyPressL( aMessage );            
+            break;
+
+        // send-key
+        case EKeyYes:
+            
+            if ( iOnScreenDialer )
+                {
+                if ( IsNumberEntryUsedL() )
+                    {
+                    // Security mode check
+                    TPhoneCmdParamBoolean isSecurityMode;      
+                    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+
+                    TPhoneCmdParamInteger numberEntryCountParam;
+                    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
+                    &numberEntryCountParam );
+                    TInt neLength( numberEntryCountParam.Integer() );
+                    
+                    // Query on top of dialer
+                    if ( IsAnyQueryActiveL() )
+                        {
+                        return;
+                        }
+                    else if ( IsMenuBarVisibleL() )
+                        {
+                        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+                        return;
+                        }
+                    
+                    else if ( neLength == 0 && !isSecurityMode.Boolean())
+                        {
+                        // start logs
+                        iViewCommandHandle->HandleCommandL( 
+                        EPhoneDialerCmdLog );
+                        return;
+                        }
+                    HandleSendCommandL();
+                    }
+                // If dialer is not open but phone is in foreground and phone receives
+                // send-key event we have to check if security mode is true and if it
+                // is then open emergency dialer.
+                else if ( !IsNumberEntryUsedL() )
+                    {
+                    // Security mode check
+                    TPhoneCmdParamBoolean isSecurityMode;      
+                    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+
+                    if ( isSecurityMode.Boolean())
+                        {
+                        // launch dialer.
+                        HandleCommandL(EPhoneNumberAcqSecurityDialer);
+                        }
+                    }           
+                }
+            else // iOnScreenDialer false, non-touch.
+                {
+                HandleSendCommandL();
+                }
+            break;
+            
+        case EKeyApplication0:
+            {
+            // If dialer is not open but phone is in foreground and phone receives
+            // applicaion-key event we have to open emergency dialer. No need own
+            // securitymode check because Applicationkey only captured in securitymode.
+            if ( !IsNumberEntryUsedL() )
+                {
+                HandleCommandL(EPhoneNumberAcqSecurityDialer);
+                }           
+            }
+            break;
+            
+        // "O" key
+        case KPhoneDtmf0Character:
+            if ( aMessage == EPhoneKeyLongPress && IsSimOk() )
+                {
+                LaunchApplicationL();
+                }
+            break;
+            
+        // number key
+        case KPhoneDtmf1Character:
+        case KPhoneDtmf2Character:
+        case KPhoneDtmf3Character:
+        case KPhoneDtmf4Character:
+        case KPhoneDtmf5Character:
+        case KPhoneDtmf6Character:
+        case KPhoneDtmf7Character:
+        case KPhoneDtmf8Character:
+        case KPhoneDtmf9Character:
+            if ( aMessage == EPhoneKeyLongPress && IsSimOk() )
+                {
+                HandleNumberLongKeyPressL();
+                }
+            break;
+
+#ifdef RD_INTELLIGENT_TEXT_INPUT   
+        case EKeyEnter:
+            if ( IsNumberEntryVisibleL() )
+                {
+                HandleCommandL( EPhoneCmdOptions );
+                }
+            break;
+#endif
+            
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIncoming:
+            HandleIncomingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageDialing:
+            HandleDialingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageIssuedUSSDRequest:
+            // Note that after the sending of SS 
+            // strings the view stays in Dialer.
+            if ( !iOnScreenDialer )  
+                {
+                if ( IsNumberEntryUsedL() )
+                    {
+                    // Show the number entry if it exists
+                    SetNumberEntryVisibilityL(ETrue);    
+                    }    
+                else if ( NeedToSendToBackgroundL() )
+                    {
+                    // Continue displaying current app but set up the 
+                    // idle screen in the background
+                    SetupIdleScreenInBackgroundL();
+                    }
+                else
+                    {
+                     // Display idle screen
+                    DisplayIdleScreenL();
+                    }
+                }
+            break;
+            
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageInValidEmergencyNumber:                
+            SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly );                           
+            break;
+            
+        case MEngineMonitor::EPEMessageValidEmergencyNumber:
+            DialVoiceCallL();
+            break; 
+                        
+        default:
+            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleIncomingL( TInt aCallId )
+// Default handling for incoming message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
+
+    HandleAudioAvailableOutputChangedL();
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
+
+    SetRingingTonePlaybackL( aCallId );
+
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC();
+    
+    // Hide the number entry if it exists
+    if ( IsNumberEntryUsedL() )
+        {
+        SetNumberEntryVisibilityL(EFalse);    
+        }
+     
+    // Display incoming call
+    DisplayIncomingCallL( aCallId );
+    
+    // Show incoming call buttons
+    SetTouchPaneButtons( EPhoneIncomingCallButtons );
+    
+    // Disable HW keys and Call UI if needed
+    CheckDisableHWKeysAndCallUIL();
+    
+    SetBackButtonActive(EFalse);
+    
+    EndUiUpdate();
+    
+    EndTransEffect();
+    
+    // Go to incoming state
+    iCbaManager->UpdateIncomingCbaL( aCallId );
+    UpdateSilenceButtonDimming();
+    UpdateIncomingContextMenuL( aCallId );
+    //Dim toolbar items
+    SetToolbarDimming( ETrue );
+    //request that dimmed toolbar is visible.
+    iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar );
+    iStateMachine->ChangeState( EPhoneStateIncoming );
+         
+    // Reset divert indication
+    SetDivertIndication( EFalse );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleDiallingL
+// Default handling for dialling message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) ");
+
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC();
+    
+    SetNumberEntryVisibilityL(EFalse);
+
+    // Display call setup 
+    DisplayCallSetupL( aCallId );  
+    
+    // Show call setup buttons
+    SetTouchPaneButtons( EPhoneCallSetupButtons );          
+    
+    EndUiUpdate();
+    
+    // Remove any phone dialogs if they are displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+            
+    // Go to call setup state
+    iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+
+    SetToolbarDimming( ETrue );
+    
+    EndTransEffect();
+    
+    iStateMachine->ChangeState( EPhoneStateCallSetup );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleConnectedL
+// Message Handling function for message EPEMessageConnected
+// This could happen during transaction from Emergency mode
+// to Normal mode where a network status change is received
+// from PE after PE initiates an MO call. Since PE messages
+// are asynchronous, this sequence can occur in any order.
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) ");
+    // Keep Phone app in the foreground if it is external
+    if ( !TopAppIsDisplayedL() )
+        {
+        TPhoneCmdParamInteger uidParam;
+        uidParam.SetInteger( KUidPhoneApplication.iUid );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, 
+            &uidParam );
+        }
+ 
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC();
+            
+    // Remove the number entry
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+ 
+    // Display call setup header
+    DisplayCallSetupL( aCallId );
+
+    // Update single active call
+    UpdateSingleActiveCallL( aCallId );
+    
+    // Update touch buttons
+    SetTouchPaneButtons( EPhoneIncallButtons );
+    SetToolbarDimming( EFalse );
+    
+    EndUiUpdate();
+    EndTransEffect();
+  
+    // Go to single state
+    iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    iStateMachine->ChangeState( EPhoneStateSingle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleCommandL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateIdle::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleCommandL( ) ");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneCmdOptions:
+            {
+            // Open number entry menubar
+            TPhoneCmdParamInteger integerParam;  
+                      
+            integerParam.SetInteger( 
+             CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneNumberAcqMenubar ) );               
+
+            iViewCommandHandle->ExecuteCommandL( 
+                EPhoneViewMenuBarOpen, &integerParam );
+            break;
+            }
+        
+        case EPhoneNumberAcqCmdCall:
+            HandleVoiceCallCommandL( EFalse );
+            break;
+        case EPhoneNumberAcqCmdSendCommand:
+            HandleSendCommandL();
+            break;
+            
+        case EPhoneNumberAcqCmdVideoCall:
+            DialVideoCallL();
+            break;
+            
+        case EPhoneCmdBack:
+            HandleBackCommandL();
+            break;            
+            
+        default:
+            commandStatus = CPhoneState::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateIdle::ProcessCommandL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateIdle::ProcessCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL( ) ");
+    TBool commandStatus = EFalse;
+    switch( aCommand )
+       {
+       case EAknSoftkeyContextOptions:
+           {
+           // Open number entry OK menubar
+           TPhoneCmdParamInteger integerParam;
+           integerParam.SetInteger( 
+               CPhoneMainResourceResolver::Instance()->
+               ResolveResourceID( EPhoneNumberAcqOkMenubar ) );
+           iViewCommandHandle->ExecuteCommandL( 
+               EPhoneViewMenuBarOpen, &integerParam );
+           commandStatus = ETrue;
+           }
+           break;       
+           
+       default:
+           commandStatus = CPhoneState::ProcessCommandL( aCommand );
+           break;
+       }
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateIdle::HandleRemConCommandL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateIdle::HandleRemConCommandL(
+    TRemConCoreApiOperationId /*aOperationId */, 
+    TRemConCoreApiButtonAction /*aButtonAct*/ )
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::DialL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::DialL( 
+        const TDesC& aNumber, 
+        TPhoneNumberType aNumberType,
+        TDialInitiationMethod /*aDialMethod*/ )
+    {
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aNumber );
+    
+    if ( aNumberType == EPhoneNumberTypeVideo &&
+        FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+        {
+        DialMultimediaCallL();
+        }
+    else if ( EPhoneNumberTypeVoip == aNumberType &&
+              iCustomization )
+        {
+        iCustomization->HandleDialL( aNumber );
+        }
+    else
+        {
+        DialVoiceCallL();                
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleBackCommandL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::HandleBackCommandL()
+    {
+    TBool previousApp(EFalse);
+    // If previous app activation is true then open
+    // previous application.
+    if ( iOnScreenDialer && 
+        IsSimOk() )
+        {
+        TPhoneCmdParamBoolean booleanParam;
+        iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewGetActivatePreviousApp, &booleanParam );
+        
+        if ( booleanParam.Boolean() )
+            {
+            // Open previous app.
+            iViewCommandHandle->ExecuteCommandL( 
+                EPhoneViewActivatePreviousApp );
+
+            // Remove number entry from screen
+            iViewCommandHandle->ExecuteCommandL( 
+                EPhoneViewRemoveNumberEntry ); 
+
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); 
+            previousApp = ETrue;   
+            }
+        }
+        
+    if ( !previousApp )
+        {
+        // Remove number entry from screen
+        iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewRemoveNumberEntry );
+        // Do state-specific operation when number entry is cleared
+        HandleNumberEntryClearedL();
+        }    
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::DialVideoCallL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::DialVideoCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVideoCallL( ) ");
+    if ( IsNumberEntryUsedL() )
+        {
+        // get the number entry contents
+        HBufC* phoneNumber = PhoneNumberFromEntryLC();
+#ifdef _DEBUG
+        if ( (*phoneNumber).Compare( KExit ) == 0 )
+            {
+            CleanupStack::PopAndDestroy( phoneNumber );
+            SendExitCommandL();
+            }
+        else
+#endif // _DEBUG
+            {
+            if ( IsSpeedDialNumber( (*phoneNumber) ) )
+                {
+                // Handle speed dial
+                SpeedDialL( (*phoneNumber)[0], EDialMethodMenuSelection );
+                }
+            else
+                {
+                // call the number
+                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
+                DialMultimediaCallL();
+                }
+
+            CleanupStack::PopAndDestroy( phoneNumber );
+            }
+        }       
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::DisplayIncomingCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0,
+        Panic( EPhoneCtrlInvariant ) );
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Remove any phone dialogs if they are displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    // Capture keys when there is an incoming call
+    CaptureKeysDuringCallNotificationL( ETrue );
+
+    // Indicate that the Phone needs to be sent to the background if
+    // an application other than the top application is in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        &booleanParam );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+        
+    // Disable global notes when there is an incoming call
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
+        &globalNotifierParam );
+    
+    DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::DisplayCallSetupL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::DisplayCallSetupL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayCallSetupL( ) ");
+    __ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) );
+    
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Capture keys when the phone is dialling
+    CaptureKeysDuringCallNotificationL( ETrue );
+
+    // Indicate that the Phone needs to be sent to the background if
+    // an application other than the top application is in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+    
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        &booleanParam );
+    
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam ); 
+    
+    // Display call setup header
+    DisplayHeaderForOutgoingCallL( aCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleIdleForegroundEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) ");
+    
+    if ( IsNumberEntryUsedL() )
+        {
+        // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible 
+        // to ensure that numberentry/dialler is drawn to UI.
+        TPhoneViewResponseId respond = 
+            iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible );
+        
+        if ( respond && IsNumberEntryVisibleL() )
+            {
+            // Set Number Entry CBA
+            iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
+            }
+        }
+    else if ( !IsAnyQueryActiveL() )
+        {
+        // Set idle as top application
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );            
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandlePhoneForegroundEventL
+// -----------------------------------------------------------
+
+EXPORT_C void CPhoneStateIdle::HandlePhoneForegroundEventL()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandlePhoneFocusLostEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandlePhoneFocusLostEventL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneFocusLostEventL( ) ");
+    if ( !IsNumberEntryUsedL() )
+         {
+         // If NE/dialer is open add icon to FSW list.
+         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
+         }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateIdle::HandleIdleL()" );
+        
+    // Remove all call headers
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
+    
+    // Close number entry
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );    
+
+    // Remove all notes and dialogs
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );    
+    }
+ 
+// -----------------------------------------------------------
+// CPhoneStateIdle::SpeedDialL
+// -----------------------------------------------------------
+//   
+EXPORT_C void CPhoneStateIdle::SpeedDialL( const TUint& aDigit, 
+        TDialInitiationMethod aDialMethod )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialL( ) ");
+    
+    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+    
+    TPhoneCmdParamSpeedDial speedDialParam;
+    HBufC* phoneNumber = NumberForSpeedDialLocationL( aDigit, speedDialParam );
+
+    // Store serviceId received from vmbx handler
+    iStateMachine->PhoneEngineInfo()->SetServiceIdCommand( speedDialParam.ServiceId() );
+    CleanupStack::PushL( phoneNumber );
+    
+    if ( NULL != phoneNumber && KNullDesC() != *phoneNumber )
+        {
+
+
+        DialL( *phoneNumber, speedDialParam.NumberType(), aDialMethod );
+        
+        if ( IsNumberEntryUsedL()  ) 
+            {
+            BeginTransEffectLC( ENumberEntryClose ); 
+            
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+            
+            // Set Idle background, if still idle
+            if ( iStateMachine->State() == this )
+                {
+                SetupIdleScreenInBackgroundL();
+                }
+            
+            EndTransEffect();
+            }
+        }
+    else
+        {
+        // User cancelled dialog or didn't give a valid number
+        SpeedDialCanceledL( aDigit );
+        }
+    
+    CleanupStack::PopAndDestroy( phoneNumber );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle:SpeedDialCanceledL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::SpeedDialCanceledL( const TUint& aDigit )
+
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialCanceledL( ) ");
+    if ( IsNumberEntryUsedL() )
+        {
+        if ( aDigit == KPhoneDtmf1Character || 
+                  ( aDigit == KPhoneDtmf2Character && 
+                    iViewCommandHandle->HandleCommandL( 
+                     EPhoneViewIsStraightCallToVideoMailBox ) == EPhoneViewResponseSuccess ) ) 
+            {
+            // Remove number entry and set idle background on non-touch products
+            if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+                {
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+                
+                // Set Idle background, if still idle ( f.e not incoming call arrived )
+                if ( iStateMachine->State() == this )
+                    {
+                    // idle screen in the background
+                    SetupIdleScreenInBackgroundL();
+                    }
+                }
+            }
+        }        
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleNumberLongKeyPressL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandleNumberLongKeyPressL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateIdle::HandleNumberLongKeyPressL( ) ");
+    
+    HBufC* phoneNumber = PhoneNumberFromEntryLC();
+    
+    if ( phoneNumber && IsSpeedDialNumber ( *phoneNumber ) )
+        {
+        SpeedDialL( (*phoneNumber)[0], EDialMethodOneKeyDialing );
+        }
+    
+    CleanupStack::PopAndDestroy( phoneNumber );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::IsSpeedDialNumber()
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateIdle::IsSpeedDialNumber( 
+        const TDesC& aNumber ) const
+    {
+    return ( aNumber.Length() == KPhoneDtmfSpeedDialPrefixLength 
+            && aNumber[0] >= KPhoneDtmf1Character 
+            && aNumber[0] <= KPhoneDtmf9Character );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleSendCommandL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::HandleSendCommandL()
+    {
+    __LOGMETHODSTARTEND(
+        EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" );
+    
+    HandleVoiceCallCommandL( ETrue );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::LaunchApplicationL()
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::LaunchApplicationL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchApplicationL( ) ");
+    // Check if only one number exists in the number
+    // entry
+    TPhoneCmdParamInteger numberEntryCountParam;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
+        &numberEntryCountParam );
+
+    if ( numberEntryCountParam.Integer() == 1 )
+        {
+        // Remove the number entry window
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        
+        iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageEndDTMF );
+
+        // Launch application.
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewLaunchApplication );
+
+        // Continue displaying current app but set up the 
+        // idle screen in the background
+        SetupIdleScreenInBackgroundL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle:SendExitCommandL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::SendExitCommandL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) ");
+    // Remove number entry from screen
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+
+    // Simulate exit command
+    CEikonEnv& eikEnv = *CEikonEnv::Static();
+    CCoeEnv& coeEnv = eikEnv;
+    RWsSession& wsSession=coeEnv.WsSession();
+    TKeyEvent keyEvent;
+    keyEvent.iCode = EEikCmdExit;
+    keyEvent.iScanCode = EEikCmdExit;
+    keyEvent.iModifiers = 0;
+    keyEvent.iRepeats = 0;
+    wsSession.SimulateKeyEvent( keyEvent );
+    wsSession.Flush();  
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleEndKeyPressL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) ");
+
+    // End key not handled also in phone startup when pressed during country/time/date query
+    RWsSession sess = CCoeEnv::Static()->WsSession();
+    TApaTaskList appList( sess );
+    TApaTask startup = appList.FindApp( KUidStartupApplication );
+    
+    if ( !IsAutoLockOn() && !IsKeyLockOn() && !startup.Exists() )
+        {
+        //Cancels e.g. USB notifier and Audio notifier.
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewExitApplications );
+        // If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not
+        // remove security note from screen.
+        if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && 
+                !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) )
+            {
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+            }
+        
+        if ( IsSimOk() )
+            {
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                // Close all connections
+                iStateMachine->SendPhoneEngineMessage(
+                        MPEPhoneModel::EPEMessageTerminateAllConnections );   
+
+                if ( IsNumberEntryUsedL() )
+                    {
+                    // Remove number entry from screen
+                    iViewCommandHandle->ExecuteCommandL( 
+                        EPhoneViewRemoveNumberEntry );
+                    // Do state-specific operation when number entry is cleared
+                    HandleNumberEntryClearedL();
+                    
+                    // If long end key event occures then all calls are terminated and
+                    // dialer is closed, therefore tel.icon must be removed from FSW.
+                    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW );
+                    }
+                if ( !TopAppIsDisplayedL() )
+                    {
+                    // Display idle screen
+                    DisplayIdleScreenL();
+                    }
+                }
+            else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() )
+                {
+                // Remove number entry from screen
+                iViewCommandHandle->ExecuteCommandL( 
+                    EPhoneViewRemoveNumberEntry );
+                // Do state-specific operation when number entry is cleared
+                HandleNumberEntryClearedL();
+                }
+            else if ( !TopAppIsDisplayedL() )
+                {
+                // Phone might not be the topmost app since it has
+                // some dialog/query open therefore we need to check this
+                // and remove dialog/phone.
+                if ( IsAnyQueryActiveL()  )
+                    {
+                    if ( !IsSimStateNotPresentWithSecurityModeEnabled() )
+                        {
+                        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+                        }
+                    
+                    // Remove number entry from screen
+                    iViewCommandHandle->ExecuteCommandL( 
+                        EPhoneViewRemoveNumberEntry );
+                    } 
+                // Bring Idle app to the foreground
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
+                }
+            }
+        else if ( IsNumberEntryUsedL() )
+            {
+            // Remove number entry from screen
+            iViewCommandHandle->ExecuteCommandL( 
+                EPhoneViewRemoveNumberEntry );
+            StartShowSecurityNoteL();    
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateIdle::OnlyHashInNumberEntryL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::OnlyHashInNumberEntryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::OnlyHashInNumberEntryL( ) ");
+    
+    if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( 
+        KTelephonyLVFlagMannerMode ) )
+        {
+        ChangeMannerModeL();
+        }            
+    else
+        {
+        StartAlsLineChangeTimerL();
+        }
+
+    // Check if any application launch functionality
+    // is configured for pressing hash for a long time
+    // the return value of CheckAppLaunchingL ignored.
+    CheckAppLaunchingL( TKeyCode( KPhoneDtmfHashCharacter ) );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateIdle::ChangeMannerModeL
+// ---------------------------------------------------------
+//
+void CPhoneStateIdle::ChangeMannerModeL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) ");
+
+    // Get the profile information
+    const TInt profileId = 
+        iStateMachine->PhoneEngineInfo()->ProfileId();
+    TInt newProfile;
+    
+    if ( profileId == EProfileSilentId )
+        {
+        newProfile = EProfileGeneralId;
+        }
+    else
+        {
+        newProfile = EProfileSilentId;    
+        }
+        
+    if ( !iEngine )
+        {
+        iEngine = CreateProfileEngineL();
+        }
+
+    iEngine->SetActiveProfileL( newProfile );
+    
+    // Stop playing DTMF tone
+    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); 
+    
+    if ( !iOnScreenDialer )
+        {
+        // Remove the number entry
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );        
+        }
+    else
+        {
+        NumberEntryClearL();
+        }
+    
+    iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
+ 
+     // Bring Idle app to the top app
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication );            
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::DialMultimediaCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::DialMultimediaCallL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::DialMultimediaCall() ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    
+    if ( RestoreOngoing() )
+        {
+        CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
+        }
+    else
+        {
+        CPhoneState::DialMultimediaCallL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::DialVoiceCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIdle::DialVoiceCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() ");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+        
+    // Disable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    
+    CPhoneState::DialVoiceCallL();
+ 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateIdle::RestoreOngoing
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneStateIdle::RestoreOngoing()
+    {
+    TInt restoreValue;
+    
+    RProperty::Get( KUidSystemCategory, 
+                    conn::KUidBackupRestoreKey,
+                    restoreValue );
+        
+    return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ));
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateIdle::CheckAppLaunchingL
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneStateIdle::CheckAppLaunchingL( const TKeyCode aCode )
+    {
+    TBool valuesFetched( EFalse );
+    
+    if( !IsSimOk() )
+        {
+        return valuesFetched;
+        }
+    
+    TPhoneCmdParamAppInfo appInfo;
+    HBufC8* appParam = HBufC8::NewL( KMaxParamLength );
+    CleanupStack::PushL( appParam );
+
+    TPhoneCmdParamInteger numberEntryCount;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
+        &numberEntryCount );
+    
+    TBool isValidAppLaunchingKeyEvent = EFalse;
+    if ( iCustomization && iCustomization->AllowAlphaNumericMode() &&
+         TKeyCode( KPhoneDtmfHashCharacter ) == aCode )
+        {
+        // If alphanumeric mode is supported FEP changes text input mode with
+        // long hash and removes hash from number entry.
+        isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 0 );
+        }
+    else
+        {
+        isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 1 );
+        }
+    
+    if ( isValidAppLaunchingKeyEvent )
+        {
+        TRAPD( err, 
+            CPhoneCenRepProxy::Instance()->FetchValuesFromCenRepL( 
+            appInfo, aCode, appParam, valuesFetched ) );
+        
+        if ( KErrNone == err && valuesFetched )
+            {
+            // Remove the number entry window
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+
+            // Stop playing DTMF tone
+            iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+
+            TPhoneCommandParam* phoneCommandParam = 
+                static_cast<TPhoneCommandParam*>( &appInfo );
+            iViewCommandHandle->ExecuteCommandL( 
+                        EPhoneViewActivateAppViewConventional,
+                        phoneCommandParam ); 
+            
+            // Continue displaying current app but set up the 
+            // idle screen in the background
+            SetupIdleScreenInBackgroundL();
+            }
+        }
+    CleanupStack::PopAndDestroy( appParam );
+    return valuesFetched;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::NumberForSpeedDialLocationL
+// -----------------------------------------------------------
+// 
+HBufC* CPhoneStateIdle::NumberForSpeedDialLocationL( 
+        const TUint& aDigit,
+        TPhoneCmdParamSpeedDial& aSpeedDialParam ) const
+    {
+    // Set the speed dial location from the digit in buffer. Character
+    // '1' means location 1, and so on.
+    const TInt location = aDigit - KPhoneDtmf1Character + 1;
+    aSpeedDialParam.SetLocation( location );
+    
+    // Get the number and type from the speed dial location.
+    HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    
+    TPtr ptr( phoneNumber->Des() );
+    aSpeedDialParam.SetPhoneNumber( &ptr );
+    iViewCommandHandle->HandleCommandL( 
+        EPhoneViewGetNumberFromSpeedDialLocation, &aSpeedDialParam );
+
+    CleanupStack::Pop( phoneNumber );
+    return phoneNumber;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIdle::HandleVoiceCallCommandL()
+// -----------------------------------------------------------
+//
+void CPhoneStateIdle::HandleVoiceCallCommandL( TBool aSendKey )
+    {
+    __LOGMETHODSTARTEND(
+        EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" );
+    
+    if ( IsNumberEntryUsedL() )
+        {
+        // Handle send key short press, get the number entry contents.
+        HBufC* phoneNumber = PhoneNumberFromEntryLC();
+        
+        if ( !IsSimOk() )
+            {
+            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ) ;
+            iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageCheckEmergencyNumber );
+            CleanupStack::PopAndDestroy( phoneNumber );
+            return;
+            }
+            
+#ifdef _DEBUG
+        if ( (*phoneNumber).Compare( KExit ) == 0 )
+            {
+            CleanupStack::PopAndDestroy( phoneNumber );
+            SendExitCommandL();
+            }
+        else
+#endif // _DEBUG
+            {
+            if ( IsSpeedDialNumber( *phoneNumber ) )
+                {
+                // Handle speed dial
+                SpeedDialL( (*phoneNumber)[0], aSendKey ? EDialMethodSendCommand : EDialMethodMenuSelection );
+                }
+            else
+                {
+                // call the number
+                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
+                DialVoiceCallL();
+                }
+            
+            CleanupStack::PopAndDestroy( phoneNumber );
+            }
+        }    
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestateincall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1586 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateInCall class.
+*
+*/
+
+
+// INCLUDES
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <PSVariables.h>
+#include <hwrmdomainpskeys.h>
+#include <UikonInternalPSKeys.h>
+#include <mpeengineinfo.h>
+#include <videotelcontrolmediatorapi.h>
+#include <MediatorDomainUIDs.h>
+#include <bldvariant.hrh>
+
+#include "cphonestateincall.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamnote.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamsfidata.h"
+#include "mphonestatemachine.h"
+#include "phonestatedefinitions.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "phonerssbase.h"
+#include "cphonemainresourceresolver.h"
+#include "phonelogger.h"
+#include "phoneui.pan"
+#include "cphonepubsubproxy.h"
+#include "cphonedtmfwaitchartimer.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "cphonemediatorfactory.h"
+#include "cphonemediatorsender.h"
+#include "cphoneterminateallconnectionscommand.h"
+#include "mphonecustomization.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneStateInCall::CPhoneStateInCall( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aCustomization ) : 
+    CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ),
+    iDtmfWaitCharTimer( NULL )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::~CPhoneStateInCall()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneStateInCall::~CPhoneStateInCall()
+    {
+    if( iDtmfWaitCharTimer )
+        {
+        delete iDtmfWaitCharTimer;            
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::ConstructL()
+    {
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    CPhoneState::BaseConstructL();
+    // Enable the volume display
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateInCall* CPhoneStateInCall::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneStateInCall* self = new (ELeave) CPhoneStateInCall( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleKeyMessageL()" ); 
+    switch ( aCode )
+        {
+        // end-key
+        case EKeyNo:
+            HandleEndKeyPressL( aMessage );
+            break;
+
+        // Voice key
+        case EKeyDevice6:
+            HandleVoiceKeyPressL( aMessage ); 
+            break;
+            
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+        case EKeyEnter:
+            if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+                {
+                SendDtmfL();    
+                }
+            else if ( IsNumberEntryVisibleL() )
+                {
+                HandleCommandL( EPhoneCmdOptions );
+                }
+            break;
+#endif            
+          
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleNumberEntryClearedL()" );
+    // Update single call CBA when number entry is cleared
+     UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandlePhoneEngineMessageL()" );
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageAudioMuteChanged:
+            HandleAudioMuteChangedL();
+            break;
+            
+        case MEngineMonitor::EPEMessageAudioOutputChanged:
+            HandleAudioOutputChangedL();
+            break;
+        
+        case MEngineMonitor::EPEMessageSendingDTMF:
+        case MEngineMonitor::EPEMessageContinuingDTMFSending:
+            HandleSendingDTMFL();
+            break;
+
+        case MEngineMonitor::EPEMessageStoppedDTMF:
+            HandleStoppedDTMFL();
+            break;
+
+        case MEngineMonitor::EPEMessageSentDTMF:
+        case MEngineMonitor::EPEMessageDTMFSendingAborted:
+            CancelDTMFSendingL();
+            break;
+
+        case MEngineMonitor::EPEMessagePromptSpeedDial:
+            HandleDTMFPromptSpeedDialL();
+            break;
+
+        case MEngineMonitor::EPEMessageSpeedDialNotAssigned:
+            CPhoneState::SendGlobalErrorNoteL( 
+                EPhoneDtmfSpeedDialNotAssigned );
+            break;
+
+        case MEngineMonitor::EPEMessageInvalidSpeedDial:
+            CPhoneState::SendGlobalErrorNoteL( EPhoneDtmfInvalidSpeedDial );
+            break;
+            
+        case MEngineMonitor::EPEMessageAudioVolumeChanged:
+            HandleAudioVolumeChangedL();
+            break;
+            
+        case MEngineMonitor::EPEMessageDisconnecting:
+            CancelDTMFSendingL();
+            if ( !CPhoneState::IsAnyConnectedCalls() )
+                {
+                CloseDtmfQueryL();
+                }            
+            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break; 
+            
+        case MEngineMonitor::EPEMessageInValidEmergencyNumber:
+            SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+            break;
+            
+        case MEngineMonitor::EPEMessageValidEmergencyNumber:
+            DialVoiceCallL();
+            break;    
+        
+        case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
+            // If there is a waiting call then update header and label
+            // else forward message to CPhoneState.
+            if ( IsWaitingCallL( aCallId ) )
+                {
+                // Update remote info data and label.
+                UpdateRemoteInfoDataAndLabelL( aCallId, UpdateCallHeaderInfoL( aCallId ) );
+                }
+            else
+                {
+                CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+                }
+            break;
+            
+        default:
+            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL( 
+        TInt aCallId, 
+        TPhoneCmdParamCallHeaderData aCallHeaderParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+            "CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL ()" );
+    // Update the remote info data in the call header
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, 
+        aCallId,
+        &aCallHeaderParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleIdleL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleIdleL()" );
+    __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+  
+    //Make sure that toolbar is not shown
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
+    BeginTransEffectLC( ENumberEntryOpen );  
+    BeginUiUpdateLC();
+    SetDefaultFlagsL();
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists and update cba's.
+        SetNumberEntryVisibilityL( ETrue );
+        
+        // Close dtmf dialer when call is disconnected.
+        if ( IsDTMFEditorVisibleL() )
+            {      
+            CloseDTMFEditorL();
+            
+            // Display idle screen and update CBA's
+            DisplayIdleScreenL();
+            }
+        else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
+            {            
+            CloseCustomizedDialerL();
+            // Display idle screen and update CBA's
+            DisplayIdleScreenL();
+            }          
+        }
+    else
+        {
+        // Close menu bar, if it is displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        
+        if ( !TopAppIsDisplayedL() || IsAutoLockOn() )
+            {        
+            // Continue displaying current app but set up the 
+            // idle screen in the background
+            SetupIdleScreenInBackgroundL();
+            }
+        else
+            {
+            // Display idle screen and update CBAs
+            DisplayIdleScreenL();
+            }
+        }
+        
+    DeleteTouchPaneButtons();        
+    EndUiUpdate();
+    EndTransEffect();
+    // Display call termination note, if necessary
+    DisplayCallTerminationNoteL();
+
+    // Go to idle state
+    iStateMachine->ChangeState( EPhoneStateIdle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateInCallCbaL() ");
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::UpdateCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() ");
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        iCbaManager->SetCbaL( EPhoneDtmfDialerCBA );        
+        }
+    else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
+        {
+        iCbaManager->SetCbaL( CustomizedDialerCbaResourceIdL() );
+        }
+    else
+        {
+        iCbaManager->UpdateCbaL( aResource );   
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleAudioMuteChangedL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::HandleAudioMuteChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleAudioMuteChangedL()" );
+    CPhoneState::HandleAudioMuteChangedL();
+
+    // Update the single call CBA only if the number entry is not
+    // used
+    if ( !IsNumberEntryUsedL() )
+        {
+        // Go to current state implementation
+        UpdateInCallCbaL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleAudioOutputChangedL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::HandleAudioOutputChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleAudioOutputChangedL()" );
+    // Handle the handsfree mode change
+    CPhoneState::HandleAudioOutputChangedL();
+
+    // Update the single call CBA only if the number entry is not
+    // used
+    if ( !IsNumberEntryVisibleL() )
+        {
+        // Go to current state implementation
+        UpdateInCallCbaL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleAudioVolumeChangedL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::HandleAudioVolumeChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleAudioVolumeChangedL()" );
+    // Update the volume display
+    TInt audioVolume = iStateMachine->PhoneEngineInfo()->AudioVolume();
+    TPhoneCmdParamInteger volumeParam;
+    volumeParam.SetInteger( audioVolume );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNaviPaneAudioVolume,
+        &volumeParam );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleSendingDTMFL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::HandleSendingDTMFL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleSendingDTMFL()" );
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteDtmfSending );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneSendingDtmfWaitNote ) );
+
+    // Show the "Sending..." Wait Note, and pre-populate it 
+    // with the PhoneEngine's current DTMF String.
+    // Set the text for the wait-note.
+    TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString();
+    HBufC* noteText = StringLoader::LoadLC( 
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSendingDtmfWaitNoteText ), 
+        dtmfString );
+    noteParam.SetText( *noteText );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+
+    CleanupStack::PopAndDestroy( noteText );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleStoppedDTMFL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::HandleStoppedDTMFL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleStoppedDTMFL()" );
+    // Remove the Sending... note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+
+    // Fetch the remaining (unparsed) portion of the DTMF String 
+    // from PhoneEngine
+    TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString();
+
+    if ( dtmfString.Length() )
+        {
+        // Show the DTMF Wait Character confirmation query
+        TPhoneCmdParamQuery queryParam;
+        queryParam.SetQueryType( EPhoneQueryDialog );
+        queryParam.SetQueryResourceId( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                EPhoneDtmfWaitCharacterConfirmationQuery ) );
+
+        // Append the PhoneEngine's current DTMF String to the query's prompt
+        HBufC* queryPrompt = StringLoader::LoadLC( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                EPhoneDtmfWaitCharacterConfirmationQueryText ), 
+            dtmfString );
+        queryParam.SetQueryPrompt( *queryPrompt );
+
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, 
+            &queryParam );
+
+        CleanupStack::PopAndDestroy( queryPrompt );
+        }
+    else
+        {
+        // Stop the asynchronous sending operation the 
+        // PhoneEngine may be performing.
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageStopDTMFSending );
+
+        // Prompt for more characters by showing DTMF query with empty string
+        HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+        TPtr ptr( emptyString->Des() );
+
+        ShowDtmfTextQueryL( 
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneDtmfNumberQuery ),
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ),
+            &ptr );
+
+        CleanupStack::PopAndDestroy( emptyString );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::CancelDTMFSendingL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::CancelDTMFSendingL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::CancelDTMFSendingL()" );
+    // Remove the Sending... note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleDtmfPromptSpeedDialL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::HandleDTMFPromptSpeedDialL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::HandleDTMFPromptSpeedDialL()" );
+    // Remove the Sending... note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+
+    // Prompt for speed dial number
+    HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( emptyString->Des() );
+
+    // If the Search softkey is selected before a speed dial number is entered,
+    // revert back to the DTMF query   
+    ShowDtmfTextQueryL( 
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneDtmfSpeedDialNumberQuery ),
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneDtmfSpeedDialNormalEditBoxCBA ),
+        &ptr );
+
+    CleanupStack::PopAndDestroy( emptyString );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::HandleCommandL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,  
+        "CPhoneStateInCall::HandleCommandL()" );
+    __PHONELOG1 ( EBasic, EPhoneControl,
+        "CPhoneStateInCall::HandleCommandL() - aCommand  = %d ", aCommand );
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneInCallCmdDialer:
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer );
+            break;
+        case EPhoneCmdOptions:
+            OpenMenuBarL();
+            break;
+            
+        case EPhoneDtmfDialerCancel:
+            {
+            CloseDTMFEditorL();
+            
+            // Activate DTMF list query when cancel is pressed.
+            // Forwards command to the framework 
+            HandleCommandL( EPhoneInCallCmdDtmfListQuery );
+            }
+            break;  
+        case EPhoneDtmfDialerExit:
+            {
+            CloseDTMFEditorL();   
+            }
+            break;
+            
+        case EPhoneInCallCmdEndThisActiveCall:
+            CPhoneState::DisconnectCallL();
+            break;
+            
+        case EPhoneCallComingCmdReject: // fall through
+        case EPhoneInCallCmdReject:
+            iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageReject );
+            break;
+                     
+        case EPhoneInCallCmdMute: // fall through
+        case EPhoneInCallCmdUnmute:
+            iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( 
+                ( aCommand == EPhoneInCallCmdMute ) );
+            iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageSetAudioMute );
+            break;
+        //DTMF list query - dialog   
+        case EPhoneInCallCmdDtmfListQuery:
+            LaunchDtmfListQueryL();
+            break;
+            
+        //DTMF list query - Search   
+        case EPhoneInCallCmdDtmfListViewSearch:
+            LaunchDtmfListViewSearchDialogL();
+            break;
+            
+        //DTMF manual entry 
+        case EPhoneInCallCmdDtmfManualQuery:
+            if ( iOnScreenDialer )
+                {
+                ShowDtmfDialerL();
+                }
+            else
+                {
+                LaunchDtmfManualQueryL();
+                }
+            break;
+            
+        // DTMF manual entry - Search          
+        case EPhoneCmdDtmfSearch:
+            LaunchDtmfSearchDialogL();
+            break;
+            
+        // DTMF entry - Ok          
+        case EPhoneCmdDtmfOk:
+            SendDtmfL();
+            break;
+
+        // DTMF Speed entry - Ok
+        case EPhoneCmdDtmfSpeedDialOk:
+            SendDtmfSpeedDialNumberL();
+            break;
+
+        // DTMF sending - Cancel
+        case EPhoneInCallCmdCancelSendingDtmfString:
+            // Stop the asynchronous sending operation the 
+            // PhoneEngine may be performing.
+            iStateMachine->SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageStopDTMFSending );
+            // Remove DTMF sending from screen
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+            break;    
+            
+        // DTMF wait - Ok
+        case EPhoneInCallCmdContinueSendingDtmfString:
+            // Continue sending the DTMF string
+            if( !iDtmfWaitCharTimer )
+                {
+                iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( 
+                    iStateMachine );                    
+                }
+            iDtmfWaitCharTimer->ButtonPressedL();
+            break;
+            
+        case  EPhoneDialerCmdHelpDtmf:
+            {
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {                
+                TPtrC contextName( KDATA_DIALER_HLP_SEND_DTMF );
+                iViewCommandHandle->ExecuteCommandL( 
+                    EPhoneViewLaunchHelpApplication,
+                    0,
+                    contextName );
+                }
+            }
+            break;
+
+        // New Call - Search
+        case EPhoneInCallCmdNewCallFind:
+            LaunchNewCallSearchDialogL();
+            break;
+            
+        // New Call - Dialog     
+        case EPhoneInCallCmdNewCall:
+            LaunchNewCallQueryL();
+            break;
+            
+        case EPhoneViewYesSingleItemFetch:       
+            HandleSuccessFetchedNumberL();                          
+            break;
+            
+        case EPhoneViewNoSingleItemFetch:
+            if ( !iOnScreenDialer )
+                {   
+                HandleFailedFetchedNumberL();
+                }
+            break;
+            
+        case EPhoneNumberAcqCmdCall:
+        case EPhoneNumberAcqCmdSendCommand:
+            if ( IsVideoCallActiveL() )
+                {
+                // Get the number entry contents
+                HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+                TPtr ptr( phoneNumber->Des() );
+                TPhoneCmdParamString stringParam;
+                stringParam.SetString( &ptr );
+                iViewCommandHandle->ExecuteCommand(
+                    EPhoneViewGetNumberFromEntry,
+                    &stringParam );
+                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
+                                        
+                if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ||
+                     phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
+                    {  
+                    // Send a manual control sequence by providing number 
+                    // information with dial command
+                    CallFromNumberEntryL();
+                    }
+                else
+                    {
+                    iStateMachine->SendPhoneEngineMessage( 
+                        MPEPhoneModel::EPEMessageCheckEmergencyNumber );
+                    }
+                CleanupStack::PopAndDestroy( phoneNumber );               
+                }
+            else
+                {
+                // Provide number information with dial command
+                CallFromNumberEntryL();
+                }
+            break;
+
+        case EPhoneInCallCmdHelp:
+            if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {                
+                TPtrC contextName;
+                if ( IsVideoCallActiveL() )
+                    {
+                    contextName.Set( KINCAL_HLP_VIDEOCALL() );    
+                    }     
+                else
+                    {
+                    contextName.Set( KINCAL_HLP_CALL_HANDLING() );
+                    }
+                iViewCommandHandle->ExecuteCommandL(
+                    EPhoneViewLaunchHelpApplication, 0, contextName );
+                }
+            break;
+
+        case EPhoneCmdEnd:
+            CloseDtmfQueryL();
+            CPhoneState::DisconnectCallL();
+            break;
+            
+        // 'End all calls' from menu
+        case EPhoneInCallCmdEndAllCalls:
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageReleaseAll );
+            break;
+            
+        case EPhoneInCallCmdEndThisOutgoingCall:
+            DisconnectOutgoingCallL();
+            break;
+
+        case EPhoneInCallCmdGoToIdle:
+            {
+            // Bring Idle app to foreground
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );    
+            break;                   
+            }
+            
+        case EPhoneNumberAcqCmdVideoCall:
+            {// Create normal voice call, if number is emergency number.
+            // Get the number entry contents
+            HBufC* phoneNumber = PhoneNumberFromEntryLC();
+            iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageCheckEmergencyNumber );
+            CleanupStack::PopAndDestroy( phoneNumber );}
+            break;
+            
+        case EPhoneInCallCmdLockKeypad:
+        case EPhoneInCallCmdLockScreen:
+            LockKeypadL();          
+            break;
+
+       case EPhoneViewOpenCallHandling:
+            if ( iOnScreenDialer && IsNumberEntryUsedL() )
+                {
+                // Remove number entry from screen
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+                HandleNumberEntryClearedL();
+                }
+            commandStatus = CPhoneState::HandleCommandL( aCommand );        
+            break;
+ 
+       default:
+            commandStatus = CPhoneState::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateInCall::CreateNumberEntryL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::CreateNumberEntryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::CreateNumberEntryL( ) ");
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateNumberEntry );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::OpenMenuBarL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::OpenMenuBarL()" );
+    TInt resourceId;
+    
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
+        {
+        resourceId = CustomizedDialerMenuResourceIdL();
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneCallHandlingMenubarWithNumberEntry;
+        }
+    else
+        {
+        resourceId = EPhoneCallHandlingMenubar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateInCall::LaunchNewCallQueryL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::LaunchNewCallQueryL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::LaunchNewCallQueryL()" );
+    
+    if ( iOnScreenDialer )
+        {
+        //In touch, just activate dialer
+        BeginTransEffectLC( ENumberEntryCreate );
+        if ( IsNumberEntryUsedL() )
+            {
+            SetNumberEntryVisibilityL(ETrue);   
+            }
+        else
+            {
+            CreateNumberEntryL();
+            SetNumberEntryVisibilityL(ETrue); 
+            }
+        EndTransEffect();
+        }
+    else
+        {
+        HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+        TPtr ptr( text->Des() );
+
+        // Pre-populate the query with the number entry contents,
+        // if it exists
+        if ( IsNumberEntryUsedL() )
+            {
+            // get the number entry contents
+            TPhoneCmdParamString stringParam;
+            stringParam.SetString( &ptr );
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewGetLocalizedNumberFromEntry,
+                &stringParam );
+            }
+
+        // Show text query with send key enabled
+        const TBool enableSendKey = ETrue;
+
+        CPhoneState::ShowTextQueryL( 
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneNewCallPhoneNumberEditor ),
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneCallHandlingNewCallFindCBA ),
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneCallHandlingNewCallCallCBA ),
+            &ptr,
+            enableSendKey );
+
+        CleanupStack::PopAndDestroy( text );        
+        }
+
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::CallFetchedNumberL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::CallFetchedNumberL( 
+    const TDesC& aFetchedNumber )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::CallFetchedNumberL()" );
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );    
+        
+    // Store the phone number
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aFetchedNumber );
+
+    DialVoiceCallL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::SendDtmfL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::SendDtmfL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::SendDtmfL()" );
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );    
+
+    // First get the DTMF sequence from dialog
+    TPhoneCmdParamString dtmfSequence;
+    HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
+    TPtr ptr( content->Des() );
+    dtmfSequence.SetString( &ptr );
+    
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommand(
+            EPhoneViewGetNumberFromEntry,
+            &dtmfSequence );  
+                    
+        CloseDTMFEditorL();   
+        }
+    else
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
+                                             &dtmfSequence );
+        }        
+
+    // Send the DTMF
+    if ( ptr.Length() )
+        {
+        iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
+        iStateMachine->SendPhoneEngineMessage(
+            MPEPhoneModel::EPEMessageSendDTMF );    
+        }
+    
+    CleanupStack::PopAndDestroy( content );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateInCall::SendDtmfSpeedDialNumberL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::SendDtmfSpeedDialNumberL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::SendDtmfSpeedDialNumberL()" );
+    // First get the DTMF sequence from dialog
+    TPhoneCmdParamString dtmfSequence;
+    HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
+    TPtr ptr( content->Des() );
+    dtmfSequence.SetString( &ptr );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
+        &dtmfSequence );
+
+    // Prefix the query content string with the speed dial character '+'
+    _LIT( KSpeedDialPrefix, "+" );
+    ptr.Insert( 0, KSpeedDialPrefix );
+
+    // Send the DTMF
+    iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
+    iStateMachine->SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageSendDTMF );    
+
+    CleanupStack::PopAndDestroy( content );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::LaunchDtmfManualQueryL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::LaunchDtmfManualQueryL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::LaunchDtmfManualQueryL()" );
+    
+    HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( text->Des() );
+    // Pre-populate the query with the number entry contents, if it exists
+    if ( IsNumberEntryUsedL() )
+        {
+        // get the number entry contents
+        TPhoneCmdParamString stringParam;
+        stringParam.SetString( &ptr );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewGetLocalizedNumberFromEntry,
+            &stringParam );
+        }
+
+    ShowDtmfTextQueryL( 
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneDtmfNumberQuery ),
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ),
+        &ptr );
+    CleanupStack::PopAndDestroy( text );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::LaunchDtmfListQueryL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::LaunchDtmfListQueryL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::LaunchDtmfListQueryL()" );   
+         
+    // Fetch active call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+   
+    if ( callStateData.CallId() == KErrNotFound )
+        {
+        callStateData.SetCallState( EPEStateConnecting );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );    
+        }
+        
+    if ( callStateData.CallId() > KErrNotFound )
+        {
+        //Get Array of DTMF strings from PhoneEngine           
+        const CDesCArray& dtmfArray = 
+        iStateMachine->PhoneEngineInfo()->
+        RemotePredefinedDtmfStrings( callStateData.CallId() );              
+        
+        TInt itemCount = dtmfArray.Count();  
+        if ( itemCount )
+            {
+     
+            TPhoneCmdParamString stringParam;                 
+            //Go through the array and send each dtmf string
+            //to view.
+            for ( TInt i=0; i<itemCount; i++ )
+                {
+                TPtrC16 ptrC16 = dtmfArray.MdcaPoint( i );
+                HBufC* string = ptrC16.AllocL();
+                CleanupStack::PushL( string );
+                TPtr ptr( string->Des() );
+                
+                stringParam.SetString( &ptr ); 
+                iViewCommandHandle->ExecuteCommandL(
+                    EPhoneViewSetListQueryString,
+                    &stringParam );     
+                CleanupStack::PopAndDestroy( string );
+                string = NULL;
+                }           
+            }
+        }
+    else
+        {
+        __PHONELOG( EOnlyFatal, EPhoneControl, 
+            "CPhoneStateInCall::LaunchDtmfListQueryL() No found valid call id" );    
+        }  
+    
+    // if there is a connected call only then open DtmfListQuery.
+    if ( IsAnyConnectedCalls() )
+       {
+       TPhoneCmdParamQuery queryDialogParam;
+       queryDialogParam.SetQueryType( EPhoneDtmfListQueryDialog );
+       queryDialogParam.SetQueryResourceId(
+               CPhoneMainResourceResolver::Instance()->
+               ResolveResourceID( EPhoneDtmfNumberListQuery )  );
+       
+       // Display dialog        
+       iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
+           &queryDialogParam );
+       }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::LaunchDtmfSearchDialogL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::LaunchDtmfSearchDialogL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::LaunchDtmfSearchDialogL()" );
+    
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( EPhoneDtmfNumberQuery ); 
+    iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateInCall::LaunchDtmfListViewSearchDialogL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::LaunchDtmfListViewSearchDialogL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::LaunchDtmfListViewSearchDialogL()" );
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( EPhoneDtmfFetchTitle ); 
+    iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
+    }    
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::LaunchNewCallSearchDialogL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::LaunchNewCallSearchDialogL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::LaunchNewCallSearchDialogL()" );
+    
+    TPhoneCmdParamBoolean blockingDialogStatus;
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus, 
+            &blockingDialogStatus ); 
+    // Prevents unlegal use of singleitem fetch       
+    if ( !blockingDialogStatus.Boolean() )     
+        {             
+                    
+        TPhoneCmdParamInteger integerParam;
+        integerParam.SetInteger( EPhoneNewCallFetchTitle ); 
+        iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPhoneStateInCall::IsVideoCallActiveL
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateInCall::IsVideoCallActiveL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::IsVideoCallActive()" );
+    TBool retVal = EFalse;
+    // Fetch active call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+        
+    if ( callStateData.CallId() > KErrNotFound )
+        {
+        retVal = IsVideoCall( callStateData.CallId() );
+        }
+        
+    return retVal;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneStateInCall::IsVideoCallRingingL
+// ---------------------------------------------------------
+//
+
+EXPORT_C TBool CPhoneStateInCall::IsVideoCallRingingL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::IsVideoCallRingingL()" );
+    TBool retVal = EFalse;
+    // Fetch ringing call id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+        
+    if ( callStateData.CallId() > KErrNotFound )
+        {
+        retVal = IsVideoCall( callStateData.CallId() );
+        }
+        
+    return retVal;
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateInCall::GetRingingCallL
+// ---------------------------------------------------------
+//
+
+EXPORT_C TInt CPhoneStateInCall::GetRingingCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,  
+        "CPhoneStateInCall::GetRingingCallL()" );
+    
+    // Fetch ringing call id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+         
+    return callStateData.CallId();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::DisconnectOutgoingCallL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::DisconnectOutgoingCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::DisconnectOutgoingCallL()");
+    // Fetch alerting call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+        
+    if( callStateData.CallId() == KErrNotFound )
+        {
+        // No connecting call, find the dialing call
+        callStateData.SetCallState( EPEStateDialing );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+        
+        if( callStateData.CallId() == KErrNotFound )
+            {
+            // No dialing call, find the disconnectinging call
+            callStateData.SetCallState( EPEStateDisconnecting );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+            }
+        else
+            {
+            if ( IsNumberEntryUsedL() )
+                {
+                SetNumberEntryVisibilityL(ETrue);   
+                }
+            }
+        }
+
+    if( callStateData.CallId() > KErrNotFound )
+        {
+        // Release the call
+        iStateMachine->SetCallId( callStateData.CallId() );
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageRelease );
+        }
+     else
+        {
+        __PHONELOG( EOnlyFatal, EPhoneControl, 
+            "CPhoneStateInCall::DisconnectOutgoingCallL() has negative call id!" );   
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlIndexOutOfBounds ) );
+        }       
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateInCall::LockKeysL
+// -----------------------------------------------------------------------------
+//
+void CPhoneStateInCall::LockKeypadL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::LockKeypadL()");
+
+    if ( !FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) )
+        {
+        TInt state = KErrNone; 
+        TInt err = RProperty::Get(
+            KPSUidHWRM,
+            KHWRMGripStatus,
+            state );
+        if ( state == EPSHWRMGripOpen )
+            {
+            SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+            }
+        else
+            {
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewEnableKeyLock );    
+            }
+        }
+    else
+        {
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewEnableKeyLock ); 
+        }
+    }    
+     
+// -----------------------------------------------------------------------------
+// CPhoneStateInCall::HandleSuccessFetchedNumberL
+// -----------------------------------------------------------------------------
+//    
+void CPhoneStateInCall::HandleSuccessFetchedNumberL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::HandleSuccessFetchedNumberL()");
+    TBuf<KPhoneNumberEntryBufferSize> fetchContent;    
+    fetchContent = iViewCommandHandle->FetchContent();
+
+    TPhoneCmdParamInteger fetchTypeParam;
+    iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
+        &fetchTypeParam );
+    TInt fetchType( fetchTypeParam.Integer() );
+    
+    if ( fetchType == EPhoneNewCallFetchTitle )
+        {
+        if ( iOnScreenDialer )
+            {
+            iViewCommandHandle->ExecuteCommandL(
+                            EPhoneViewSetNumberEntryContent,
+                            0,
+                            fetchContent );              
+            }
+        // Call the fetched number
+        CallFetchedNumberL( fetchContent );
+        }
+    else if ( fetchType == EPhoneDtmfFetchTitle )
+        {
+        // Send the DTMF
+        iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent );
+        iStateMachine->SendPhoneEngineMessage(
+            MPEPhoneModel::EPEMessageSendDTMF ); 
+        }
+    else if( iCustomization && fetchType > EPhoneRssBaseLast )
+        {
+        // Handle unattended transfer contact fetch
+        iCustomization->HandleCommandL( fetchType );
+        }
+    else // EPhoneCmdDtmfSearch
+        {
+        // Send the DTMF
+        iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent );
+        iStateMachine->SendPhoneEngineMessage(
+            MPEPhoneModel::EPEMessageSendDTMF ); 
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneStateInCall::HandleFailedFetchedNumberL
+// -----------------------------------------------------------------------------
+//    
+void CPhoneStateInCall::HandleFailedFetchedNumberL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::HandleFailedFetchedNumberL()");
+    
+    TPhoneCmdParamInteger fetchTypeParam;
+    iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
+        &fetchTypeParam );
+    TInt fetchType( fetchTypeParam.Integer() );
+    
+    if ( fetchType == EPhoneNewCallFetchTitle )
+        {
+        HandleCommandL( EPhoneInCallCmdNewCall );
+        }
+    else if ( fetchType ==  EPhoneDtmfFetchTitle )
+        {
+        HandleCommandL( EPhoneInCallCmdDtmfListQuery );
+        }
+    else // EPhoneCmdDtmfSearch
+        {
+        HandleCommandL( EPhoneDtmfFetchTitle ); 
+        }
+    }  
+
+
+// -----------------------------------------------------------------------------
+// CPhoneStateInCall::CloseDtmfQueryL
+// -----------------------------------------------------------------------------
+//    
+EXPORT_C void CPhoneStateInCall::CloseDtmfQueryL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::CloseDtmfQueryL()");
+    TPhoneCmdParamInteger fetchTypeParam;
+        iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
+            &fetchTypeParam );
+        TInt fetchType( fetchTypeParam.Integer() );
+     
+    // If DTMF fetch is active then remove numberentry because it is considered
+    // to be a part of DTMF fetch operation.
+    if ( fetchType ==  EPhoneDtmfFetchTitle )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewCloseSingleItemFetchDialog ); 
+        }
+    
+    // Close dtmf dialer or dtmf query if exist.
+    if ( IsDTMFEditorVisibleL() )
+        {
+        CloseDTMFEditorL();
+        }
+    }  
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL() ");
+    TPhoneCmdParamBoolean phoneNumberAvailable;
+    
+    const TBool contactInfoAvailable = 
+        iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() ||
+        iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length();
+    
+    if( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ||
+        contactInfoAvailable )
+        {
+        // Phone number is available straight or via contact info
+        // so switch to video/voice call is possible
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is available" );
+        phoneNumberAvailable.SetBoolean( ETrue );
+        }
+    else
+        {
+        __PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is not available" );
+        phoneNumberAvailable.SetBoolean( EFalse );
+        }
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetPhoneNumberAvailableInPhoneEngine,
+        &phoneNumberAvailable );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneStateInCall::HandleEndKeyPressL
+// -----------------------------------------------------------------------------
+//    
+void CPhoneStateInCall::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::HandleEndKeyPressL()");        
+    // handle long press of end key
+    if ( aMessage == EPhoneKeyLongPress )
+        {
+        // Fetch active call's id from view
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateConnected );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+
+        if( IsVideoCall( callStateData.CallId() ) )
+            {
+            // Video call can be released only after we get response to VT Shutdown Command 
+            CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( 
+                KMediatorVideoTelephonyDomain,
+                KCatPhoneToVideotelCommands, 
+                EVtCmdReleaseDataport,
+                TVersion( KPhoneToVideotelCmdVersionMajor,
+                    KPhoneToVideotelCmdVersionMinor, 
+                    KPhoneToVideotelCmdVersionBuild ),
+                KNullDesC8,
+                CPhoneTerminateAllConnectionsCommand::NewL( *iStateMachine ) );
+            }
+        else
+            {
+            // Close all connections
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageTerminateAllConnections );
+            
+            if ( IsNumberEntryContentStored() )
+                {
+                ClearNumberEntryContentCache();
+                }
+            }
+
+        if ( IsNumberEntryUsedL() )
+            {
+            if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+                {
+                CloseDTMFEditorL();
+                }
+            else
+                {
+                BeginTransEffectLC( ENumberEntryClose );
+                // Remove number entry from screen
+                iViewCommandHandle->ExecuteCommandL( 
+                    EPhoneViewRemoveNumberEntry );
+                EndTransEffect();
+                // Do state-specific operation when number entry is cleared
+                HandleNumberEntryClearedL();         
+                }
+            }
+
+        if ( !TopAppIsDisplayedL() )
+            {
+            // Bring app to foreground
+            TPhoneCmdParamInteger uidParam;
+            uidParam.SetInteger( KUidPhoneApplication.iUid );
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewBringAppToForeground, &uidParam );
+            }
+        }
+    else
+        {  
+        if ( IsNumberEntryUsedL() )
+            {
+            if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+                {
+                CloseDTMFEditorL();
+                }
+            }
+      
+        // handle short end key
+        CPhoneState::DisconnectCallL();    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateInCall::HandleVoiceKeyPressL
+// -----------------------------------------------------------------------------
+//    
+void CPhoneStateInCall::HandleVoiceKeyPressL( TPhoneKeyEventMessages aMessage )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::HandleVoiceKeyPressL()");
+    if ( aMessage == EPhoneKeyShortPress )
+        {
+        // Toggle the handsfree mode
+        const TBool handsfreeMode = 
+            iStateMachine->PhoneEngineInfo()->AudioOutput() ==
+                EPELoudspeaker;
+        SetHandsfreeModeL( !handsfreeMode );
+        }
+    else // aMessage == EPhoneKeyLongPress
+        {
+        // Display call in progress information note
+        SendGlobalInfoNoteL( EPhoneCallInProgress );
+        }        
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateInCall::ShowDtmfTextQueryL
+// -----------------------------------------------------------
+//
+void CPhoneStateInCall::ShowDtmfTextQueryL(
+    TInt aDialogResourceId,
+    TInt aDefaultCbaResourceId,
+    TInt aContentCbaResourceId,
+    TDes* aDataText,
+    TBool aSendKeyEnabled )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneStateInCall::ShowDtmfTextQueryL()");
+
+    __ASSERT_DEBUG( aDialogResourceId &&
+        aDefaultCbaResourceId &&
+        aContentCbaResourceId &&
+        aDataText, 
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+    TPhoneCmdParamQuery queryDialogParam;
+    queryDialogParam.SetQueryType( EPhoneDtmfTextQuery );
+    queryDialogParam.SetQueryResourceId( aDialogResourceId );
+    queryDialogParam.SetDefaultCba( aDefaultCbaResourceId );
+    queryDialogParam.SetContentCba( aContentCbaResourceId );
+    queryDialogParam.SetDataText( aDataText );
+    queryDialogParam.SetSendKeyEnabled( aSendKeyEnabled );
+    
+    // Display dialog        
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
+        &queryDialogParam );    
+    }
+  
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestateincoming.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,905 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateIncoming class.
+*
+*/
+
+
+// INCLUDES
+#include <cntdef.h>
+#include <e32base.h>
+#include <eikenv.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <dundomainpskeys.h>
+#include <telephonyvariant.hrh>
+#include <mpeengineinfo.h>
+#include <MediatorDomainUIDs.h>
+#include <videotelcontrolmediatorapi.h>
+
+#include "cphonepubsubproxy.h"
+#include "phoneui.pan"
+#include "cphonestateincoming.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamringtone.h"
+#include "tphonecmdparamsfidata.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamdynmenu.h"
+#include "mphonestatemachine.h"
+#include "phonestatedefinitions.h"
+#include "phoneui.hrh"
+#include "phonerssbase.h"
+#include "cphonemainresourceresolver.h"
+#include "phonelogger.h"
+#include "cphonecenrepproxy.h"
+#include "cphonepubsubproxy.h"
+#include "tphonecmdparamquery.h"
+#include "cphonemediatorfactory.h"
+#include "cphonemediatorsender.h"
+#include "cphonereleasecommand.h"
+#include "mphonecustomization.h"
+#include "mphonestorage.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneStateIncoming::CPhoneStateIncoming(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) :
+    CPhoneState( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::~CPhoneStateIncoming()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneStateIncoming::~CPhoneStateIncoming()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::ConstructL()
+    {
+    CPhoneState::BaseConstructL();
+    
+    // Fetch incoming call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+
+    // Do nothing if negative incoming call id
+    if( callStateData.CallId() > KErrNotFound  )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
+        
+        iRingingCallId = callStateData.CallId();
+        }
+    else
+        {
+        __PHONELOG( EOnlyFatal, EPhoneControl,
+            "CPhoneStateIncoming::ConstructL - incoming call already in disconnecting state!");
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateIncoming* CPhoneStateIncoming::NewL(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneStateIncoming* self = new (ELeave) CPhoneStateIncoming(
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleKeyEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandleKeyEventL ()" );
+    // Handle numeric keys when key events are received in incoming state
+    CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandleNumberEntryClearedL ()" );
+    // Set incoming call CBA when number entry is cleared
+    iCbaManager->UpdateIncomingCbaL( iRingingCallId );
+    UpdateSilenceButtonDimming();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandleKeyMessageL(
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneStateIncoming::HandleKeyMessageL ()" );
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+
+    switch ( aCode )
+        {
+        // end-key
+        case EKeyNo:
+            {
+            // handle long press
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                // Close all connections
+                iStateMachine->SendPhoneEngineMessage(
+                    MPEPhoneModel::EPEMessageTerminateAllConnections );
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewCloseFSW );
+
+                if ( CPhoneState::IsNumberEntryUsedL() )
+                    {
+                    // Remove number entry from screen
+                    iViewCommandHandle->ExecuteCommandL(
+                        EPhoneViewRemoveNumberEntry );
+                    // Do state-specific operation when number entry is cleared
+                    HandleNumberEntryClearedL();
+                    }
+                }
+            else
+                {
+                // handle end key
+                DisconnectWaitingCallL();
+                }
+            }
+            break;
+
+        // send-key
+        case EKeyYes:
+            if( CPhoneState::IsNumberEntryVisibleL() )
+                {
+                HandleSendL();
+                }
+            else
+                {
+                // Answer the call
+                AnswerCallL();
+                }
+            break;
+
+        // OK key
+        case EKeyDevice3:
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                // Answer the call if long press of selection key
+                AnswerCallL();
+                }
+            else if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported(
+                        KTelephonyLVFlagCoverHideSendEndKey ))
+                {
+                // Open number entry OK menubar
+                OpenMenuBarL();
+                }
+            break;
+
+        case EKeyDeviceF:
+                {
+                __PHONELOG( EBasic, EPhoneUIStates,
+                    "CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL-deviceF" );
+                HandleHoldSwitchL();
+                }
+            break;
+            
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleSendL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::HandleSendL()
+    {
+    // Get the number entry contents
+    HBufC* phoneNumber = PhoneNumberFromEntryLC();
+    TPtr ptr( phoneNumber->Des() );
+
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
+    iStateMachine->SendPhoneEngineMessage(
+            MPEPhoneModel::EPEMessagePhoneNumberEdited );
+    
+    if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength 
+            && iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ) 
+        {
+        // Send a manual control sequence by providing number
+        // information with dial command
+        CPhoneState::CallFromNumberEntryL();
+        }
+    else
+        {
+        iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageCheckEmergencyNumber );
+        }
+    CleanupStack::PopAndDestroy( phoneNumber );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleKeyPressDurationL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandleKeyPressDurationL(
+    TKeyCode /*aCode*/,
+    TTimeIntervalMicroSeconds /*aKeyPressDuration*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandleKeyPressDurationL ()" );
+ 
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandlePhoneEngineMessageL(
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandlePhoneEngineMessageL ()" );
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageInValidEmergencyNumber:
+            // Answer the call
+            AnswerCallL();
+            break;
+
+        case MEngineMonitor::EPEMessageValidEmergencyNumber:
+            DialVoiceCallL();
+            break;
+
+        case MEngineMonitor::EPEMessageAnswering:
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+            break;
+
+        case MEngineMonitor::EPEMessageAudioOutputChanged:
+            HandleAudioOutputChangedL();
+            break;
+
+        case MEngineMonitor::EPEMessageMuteRingingTone:
+            // Silence the ringer. And stop vibrating, if it is active.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+            HandleAudioPlayStoppedL();
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageStopTonePlay );
+            break;
+         
+        case MEngineMonitor::EPEMessageAvailableAudioOutputsChanged:
+            HandleAudioAvailableOutputChangedL();
+            // Need to avoid CBA update
+            break;
+        
+        case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
+            // Update remote info data
+            UpdateRemoteInfoDataAndLabelL( aCallId, UpdateCallHeaderInfoL( aCallId ) );
+            break;
+            
+        default:
+            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::UpdateRemoteInfoDataAndLabelL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::UpdateRemoteInfoDataAndLabelL( 
+        TInt aCallId, 
+        TPhoneCmdParamCallHeaderData aCallHeaderParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+            "CPhoneStateIncoming::UpdateRemoteInfoDataAndLabelL ()" );
+    // Update the remote info data in the call header
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, 
+        aCallId,
+        &aCallHeaderParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandleConnectedL ()" );
+
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
+        &globalNotifierParam );
+    // Stop tone playing, if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+    
+    if( IsVideoCall( aCallId ) && !IsAutoLockOn() )
+        {
+        // For keeping video call on top
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+        }
+    
+    BeginTransEffectLC( ENumberEntryOpen );
+
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+         && iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        EnableCallUIL();
+        }
+    
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+
+    BeginUiUpdateLC();
+    
+    // Update single call
+    UpdateSingleActiveCallL( aCallId );
+
+    SetTouchPaneButtons( EPhoneIncallButtons );
+    SetToolbarDimming( EFalse );
+    SetBackButtonActive(ETrue);
+            
+    EndUiUpdate();
+    EndTransEffect();
+
+    // Go to single state
+    iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
+
+    iStateMachine->ChangeState( EPhoneStateSingle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleAudioPlayStoppedL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandleAudioPlayStoppedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandleAudioPlayStoppedL ()" );
+    // Update the CBA
+    
+    // Set the ringtone silenced status
+    iCbaManager->SetRingtoneSilencedStatus( ETrue );
+    TInt resourceId = EPhoneCallHandlingIncomingRejectCBA;
+    // Get the soft reject flag status
+    TPhoneCmdParamBoolean softRejectParam;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSoftRejectFlag,
+        &softRejectParam );
+
+    if ( IsNumberEntryVisibleL() && !iOnScreenDialer )
+        {
+        resourceId = EPhoneNumberAcqCBA;
+        }
+    else if ( softRejectParam.Boolean() )
+        {
+        resourceId = EPhoneCallHandlingIncomingSoftRejectCBA;
+        }
+    iCbaManager->SetCbaL( resourceId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandleIdleL ()" );
+
+    BeginTransEffectLC( ENumberEntryOpen );
+    BeginUiUpdateLC();
+
+    // Enable call UI
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+        && iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        EnableCallUIL();
+        }
+
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+    
+    // Remove call
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    // Stop tone playing, if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+    
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
+        &globalNotifierParam );
+    
+    SetDefaultFlagsL();
+    
+     if ( IsNumberEntryUsedL() )
+        {
+        if ( NeedToSendToBackgroundL() )
+            {
+            // Return phone to the background if send to background is needed.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+
+            // Set Number Entry CBA
+            iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
+            }
+        else
+            {
+            // Show the number entry if it exists.
+            SetNumberEntryVisibilityL(ETrue);
+            }
+        }
+    else if ( NeedToSendToBackgroundL() ||
+        SoftRejectMessageEditorIsDisplayedL() )
+        {
+        // Continue displaying current app but set up the
+        // idle screen in the background
+        SetupIdleScreenInBackgroundL();
+        }
+    else
+        {
+        // Display idle screen
+        DisplayIdleScreenL();
+        }
+ 
+    DeleteTouchPaneButtons();
+    SetBackButtonActive(ETrue);
+    
+    EndUiUpdate();
+    EndTransEffect();
+    // Go to idle state   
+    iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
+    iStateMachine->ChangeState( EPhoneStateIdle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::HandleCommandL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStateIncoming::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::HandleCommandL ()" );
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneCmdOptions:
+            // Stop tone playing, if necessary.
+            // And stop vibrating, if it is active.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+            // Open the menu bar
+            OpenMenuBarL();
+            break;
+
+        case EPhoneCallComingCmdAnswer:
+            AnswerCallL();
+            break;
+
+        case EPhoneCallComingCmdAnswerHandPortableVideo:
+        case EPhoneCallComingCmdAnswerHandPortable:
+            iStateMachine->PhoneEngineInfo()->SetAudioOutputCommand(
+                EPEHandset, ETrue );
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageSetAudioOutput );
+            AnswerCallL();
+            break;
+
+        case EPhoneCallComingCmdReject:
+            DisconnectWaitingCallL();
+            break;
+
+        case EPhoneCallComingCmdSilent:
+            // Silence the ringer. And stop vibrating, if it is active.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewMuteRingTone );
+            // Dim silence button
+            SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
+            HandleAudioPlayStoppedL();
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageStopTonePlay );
+            break;
+
+        case EPhoneCallComingCmdSoftReject:
+            // Open Soft reject message editor
+            OpenSoftRejectMessageL();
+            break;
+
+        case EPhoneNumberAcqCmdSendCommand:
+            HandleSendL();
+            break;
+
+        case EPhoneInCallCmdHelp:
+            {
+            TPtrC contextName;
+            if( IsVideoCall( iRingingCallId ) )
+                {
+                contextName.Set( KINCAL_HLP_VIDEOCALL() );
+                }
+            else
+                {
+                contextName.Set( KINCAL_HLP_CALL_HANDLING() );
+                }
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewLaunchHelpApplication, 0, contextName );
+            }
+            break;
+
+        default:
+            commandStatus = CPhoneState::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::AnswerCallL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::AnswerCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::AnswerCallL ()" );
+    // Mute the ring tone
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMuteRingToneOnAnswer );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCloseFSW );
+    // Answer the call
+    iStateMachine->SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageAnswer );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::DisconnectWaitingCallL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::DisconnectWaitingCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::DisconnectWaitingCallL ()" );
+
+    // Stop tone playing, if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCloseFSW );
+
+    // The ringing call might have changed
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    
+    if ( callStateData.CallId() > KErrNotFound )
+        {
+        iRingingCallId = callStateData.CallId();
+        }
+    
+    iStateMachine->SetCallId( iRingingCallId );
+
+    if( IsVideoCall( iRingingCallId ) )
+        {
+        // Video call can be released only after we get response to VT Shutdown Command
+        CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
+                                                                             KCatPhoneToVideotelCommands, 
+                                                                             EVtCmdReleaseDataport,
+                                                                   TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                                             KPhoneToVideotelCmdVersionMinor, 
+                                                                             KPhoneToVideotelCmdVersionBuild ),
+                                                                   KNullDesC8,
+                                                                   CPhoneReleaseCommand::NewL( *iStateMachine ) );
+        }
+    else
+        {
+        // Release the call
+        iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageRelease );
+        }
+    
+    ShowDisconnectingL( iRingingCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::OpenSoftRejectMessageEditorL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::OpenSoftRejectMessageL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::OpenSoftRejectMessageEditorL ()" );
+    // Clear the soft reject flag
+    TPhoneCmdParamBoolean softRejectParam;
+    softRejectParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSoftRejectFlag,
+        &softRejectParam );
+
+    // Dim silence button
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
+    
+    // Silence the vibrating
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+    iStateMachine->SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageStopTonePlay );
+    
+    // Re-enable global notes. Otherwise message editor is not opened.
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Change the CBA to Options..Reject
+    iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA );
+
+    TPhoneCmdParamSfiData sfiDataParam;
+
+    if ( iStateMachine->PhoneEngineInfo()->RemoteName( iRingingCallId ).Length() )
+        {
+        // store both the name and the number
+        sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( iRingingCallId ) );
+        sfiDataParam.SetName( iStateMachine->PhoneEngineInfo()->RemoteName( iRingingCallId ) );
+        }
+    else
+        {
+        // store the number
+        sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( iRingingCallId ) );
+        }
+
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL
+// -----------------------------------------------------------
+//
+TBool CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL () ");
+    // Get the foreground application window group id
+    TPhoneCmdParamInteger foregroundAppParam;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetForegroundApplication,
+        &foregroundAppParam );
+
+    // Get the soft reject message editor window group id
+    TPhoneCmdParamInteger softRejectMessageEditorWgId;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSoftRejectWindowGroupId,
+        &softRejectMessageEditorWgId );
+
+    __PHONELOG1(
+        EBasic,
+        EPhoneControl,
+        "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() SoftRejectGroupId %d",
+        softRejectMessageEditorWgId.Integer() );
+    __PHONELOG1(
+        EBasic,
+        EPhoneControl,
+        "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() ForegroundAppGroupId %d",
+        foregroundAppParam.Integer() );
+    // Return ETrue if soft reject message editor is displayed
+    return softRejectMessageEditorWgId.Integer() == foregroundAppParam.Integer();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncoming::OpenMenuBarL ()" );
+    TInt resourceId;
+
+    // Determine the correct menu bar to display
+    if ( CPhoneState::IsNumberEntryVisibleL() )
+        {
+        resourceId = GetNumberEntryVisibleMenuBar();
+        }
+    else
+        {
+        resourceId = GetNumberEntryNotVisibleMenuBar();
+        }
+
+    // Silence the ringer. And stop vibrating, if it is active.
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+    iStateMachine->SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageStopTonePlay );
+
+    //Set correct cba
+    HandleAudioPlayStoppedL();
+    
+    // Dim button
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
+
+    // Open the menu bar
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::GetNumberEntryVisibleMenuBar
+// -----------------------------------------------------------
+//
+TInt CPhoneStateIncoming::GetNumberEntryVisibleMenuBar()
+    {
+    if( CPhoneState::IsVideoCall ( iRingingCallId ) )
+        {
+        return EPhoneIncomingVideoCallMenubarWithNumberEntry;
+        }
+    else
+        {
+        return EPhoneIncomingCallMenubarWithNumberEntry;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar
+// -----------------------------------------------------------
+//
+TInt CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar()
+    {
+    if( CPhoneState::IsVideoCall ( iRingingCallId ) )
+        {
+        return EPhoneIncomingVideoCallMenubar;
+        }
+    else
+        {
+        return EPhoneIncomingCallMenubar;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::DynInitMenuPaneL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::DynInitMenuPaneL(
+    TInt aResourceId,
+    CEikMenuPane* aMenuPane )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::DynInitMenuPaneL() ");
+    __ASSERT_DEBUG( aMenuPane && aResourceId,
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+
+    // Save the number of digits in the number entry before processing
+    // the menu pane
+    if ( IsNumberEntryUsedL() )
+        {
+        TPhoneCmdParamBoolean serviceCodeParam;
+        serviceCodeParam.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetServiceCodeFlag,
+            &serviceCodeParam );
+        }
+
+    if ( iCustomization )
+        {
+        iCustomization->CustomizeMenuPaneL(aResourceId, aMenuPane);
+        }
+    // Process the menu pane
+    TPhoneCmdParamDynMenu dynMenuPane;
+    dynMenuPane.SetResourceId( aResourceId );
+    dynMenuPane.SetDynMenu( aMenuPane );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuPane, &dynMenuPane );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateIncoming::ShowDisconnectingL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncoming::ShowDisconnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::ShowDisconnectingL( ) ");
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateDisconnecting );
+
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    TInt callLabelId = CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInCallDisconnected );
+
+    StringLoader::Load( labelText, callLabelId, CCoeEnv::Static() );
+    callHeaderParam.SetLabelText( labelText );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
+        &callHeaderParam );
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateIncoming::HandleKeyLockEnabledL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandleKeyLockEnabled( TBool aKeylockEnabled )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::HandleKeyLockEnabledL( ) ");
+    if( !FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
+        && CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) )
+        {
+        if( aKeylockEnabled )
+            {
+            // Keylock enabled
+            if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() )
+                {
+                // Disable HW Keys if needed
+                DisableHWKeysL();
+                }
+            }
+        else
+            {
+            // Keylock disabled
+            // Reset blocked keys list
+            iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestatemachine.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateMachine class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <pevirtualengine.h>
+#include <mpeengineinfo.h>
+
+#include "phoneui.pan"
+#include "cphonestatemachine.h"
+#include "cphonestatestartup.h"
+#include "cphonestateidle.h"
+#include "cphonestateincoming.h"
+#include "cphonestatecallsetup.h"
+#include "cphonestateincall.h"
+#include "phonestatedefinitions.h"
+#include "phonelogger.h"
+#include "cphonestorage.h"
+#include "mphonestorage.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneStateMachine::CPhoneStateMachine(
+    MPhoneViewCommandHandle* aViewCommandHandle ) :
+    iOldStateId( EPhoneStateNull ),
+    iNewStateId( EPhoneStateNull ),
+    iViewCommandHandle( aViewCommandHandle )
+    {
+    __ASSERT_ALWAYS( aViewCommandHandle,
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachine::~CPhoneStateMachine()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneStateMachine::~CPhoneStateMachine()
+    {
+    if( iState == iIdleState )
+        {
+        delete iState;
+        iState = NULL;
+        iIdleState = NULL;          
+        }
+    else
+        {
+        if( iState )
+            {
+            delete iState;
+            iState = NULL;          
+            }
+        if( iIdleState )
+            {
+            delete iIdleState;
+            iIdleState = NULL;          
+            }           
+        }
+    if( iPhoneEngine )
+        {
+        delete iPhoneEngine;
+        iPhoneEngine = NULL;            
+        }
+    if( iPhoneStorage )
+        {
+        delete iPhoneStorage;
+        iPhoneStorage = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateMachine::SetPhoneEngine
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneStateMachine::SetPhoneEngine( 
+    MPEPhoneModel* aPhoneEngine )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateMachine::SetPhoneEngine ");
+    __ASSERT_ALWAYS( aPhoneEngine, 
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+    
+    iPhoneEngine = aPhoneEngine;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachine::PhoneEngine
+// -----------------------------------------------------------
+//
+EXPORT_C MPEPhoneModel* CPhoneStateMachine::PhoneEngine()
+    {
+    __ASSERT_DEBUG( iPhoneEngine, Panic( EPhoneCtrlInvariant ) );
+    return iPhoneEngine;
+    }
+// -----------------------------------------------------------
+// CPhoneStateMachine::PhoneEngineInfo
+// -----------------------------------------------------------
+//
+EXPORT_C MPEEngineInfo* CPhoneStateMachine::PhoneEngineInfo()
+    {
+    if ( iPhoneEngine )
+        {
+        return iPhoneEngine->EngineInfo();
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachine::ChangeState()
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateMachine::ChangeState( TInt aState )
+    {
+    __PHONELOGSTATECHANGE( iNewStateId, aState );
+    iNewStateId = aState;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachine::State()
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C MPhoneState* CPhoneStateMachine::State()
+    {
+    return iState;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachine::CreatePhoneEngineL
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C MPEPhoneModel* CPhoneStateMachine::CreatePhoneEngineL(
+    MEngineMonitor& /*aEngineMonitor*/ )
+    {
+    return NULL;        
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateMachine::SendPhoneEngineMessage
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateMachine::SendPhoneEngineMessage( 
+    TInt aMessage )
+    {
+    __PHONELOGENGINECMD( aMessage );
+    PhoneEngine()->HandleMessage( aMessage );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateMachine::SetCallId
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateMachine::SetCallId( 
+    TInt aCallId )
+    {
+    __PHONELOG1(
+        EBasic, 
+        EPhoneControl,
+        "CALL ID: CPhoneStateMachine::SetCallId (%d)",
+        aCallId);     
+    PhoneEngineInfo()->SetCallId( aCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachine::PhoneStorage
+// -----------------------------------------------------------
+//
+EXPORT_C MPhoneStorage* CPhoneStateMachine::PhoneStorage()
+    {
+    if ( iPhoneStorage == NULL )
+        {
+        TInt err( KErrNone );
+        TRAP( err, iPhoneStorage = CPhoneStorage::NewL());
+        __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+        }
+    return iPhoneStorage;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonestatestartup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateStartup class.
+*
+*/
+
+
+// INCLUDES
+#include "cphonestatestartup.h"
+#include "phonestatedefinitions.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamkeycapture.h"
+#include "tphonecmdparamboolean.h"
+#include "phonelogger.h"
+#include "phonerssbase.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneStateStartup::CPhoneStateStartup( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization
+     ) : 
+    CPhoneState( aStateMachine, aViewCommandHandle, aPhoneCustomization ),
+    iPEReady( EFalse ),
+    iPhoneReady( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::~CPhoneStateStartup()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneStateStartup::~CPhoneStateStartup()
+    {
+    delete iCreateNote;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::ConstructL() ");
+    CPhoneState::BaseConstructL();
+    
+    // Set send key activation off.
+    TPhoneCmdParamBoolean boolean;
+    boolean.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSendKeyDialerActivationFlag, 
+            &boolean );
+
+    // CAPTURE KEY EVENTS PERMANENTLY
+        
+    // Capture the up and down events for the No key
+    TPhoneCmdParamKeyCapture noKeyCaptureParam;
+    noKeyCaptureParam.SetKey( EStdKeyNo );
+    noKeyCaptureParam.SetKeyCode( EKeyNo );
+    noKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStartCapturingKey, 
+        &noKeyCaptureParam );
+          
+    // Capture the up and down events for the EStdKeyEnd key
+    TPhoneCmdParamKeyCapture endKeyCaptureParam;
+    endKeyCaptureParam.SetKey( EStdKeyEnd );
+    endKeyCaptureParam.SetKeyCode( EKeyEnd );
+    endKeyCaptureParam.SetCaptureType( EPhoneKeyAllEvents );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewStartCapturingKey, 
+        &endKeyCaptureParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneStateStartup* CPhoneStateStartup::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneStateStartup* self = new (ELeave) CPhoneStateStartup( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessagePEConstructionReady:
+            HandlePEConstructionReadyL( aCallId );
+            break;
+            
+        default:
+            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::HandlePEConstructionReadyL
+// -----------------------------------------------------------
+//
+void CPhoneStateStartup::HandlePEConstructionReadyL( TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::HandlePEConstructionReadyL() ");
+    // Indicate that phone engine construction is ready
+    iPEReady = ETrue;
+
+    // Only go to the idle state if phone is also ready
+    if ( iPhoneReady )
+        {
+        // Security mode check. 
+        TPhoneCmdParamBoolean isSecurityMode;      
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );        
+        if ( !isSecurityMode.Boolean() && !IsSimOk() )
+            {
+            TPhoneCmdParamBoolean securityMode;
+            securityMode.SetBoolean( ETrue );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
+            iCreateNote = CIdle::NewL( CActive::EPriorityHigh );
+            
+            CreateAndShowNoteAfterIdle(); 
+            }
+        // Go to idle state
+        SetDefaultFlagsL();
+        iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
+        
+        iViewCommandHandle->ExecuteCommand( EPhoneViewPrepareIcons );
+        
+        iStateMachine->ChangeState( EPhoneStateIdle );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::HandleKeyMessageL( 
+    TPhoneKeyEventMessages /*aMessage*/,
+    TKeyCode /*aCode*/ )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::HandleKeyMessageL( ) ");
+
+    // TBD: Panic if PE Construction fails
+    // For Debug use only
+    // If a key event is received in this state, either the phone engine
+    // is not ready or the phone has not started up yet. Display an error note
+    // if the phone engine is not ready.
+    if ( iPhoneReady && !iPEReady )
+        {
+        SendGlobalErrorNoteL( EPhoneNoteTextPEFailedAtStartup );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::HandleKeyEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::HandleKeyEventL(
+        const TKeyEvent& /*aKeyEvent*/, TEventCode /*aEventCode*/ )
+    {
+    // Empty implementation
+    }
+
+// CPhoneStateStartup::HandleCreateNumberEntryL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::HandleCreateNumberEntryL( 
+        const TKeyEvent& /* aKeyEvent */ ,
+        TEventCode /* aEventCode */ )
+    {
+    // Empty implementation
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::HandleCreateNumberEntryL() ");   
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateStartup::HandleDtmfKeyToneL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::HandleDtmfKeyToneL( 
+        const TKeyEvent& /* aKeyEvent */,
+        TEventCode /* aEventCode */ )
+    {
+    // Empty implementation
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::HandleDtmfKeyToneL() ");
+    }
+    
+// -----------------------------------------------------------
+// CPhoneStateStartup::HandlePhoneStartupL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::HandlePhoneStartupL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::HandlePhoneStartupL() ");
+    // Indicate that the phone is ready
+    iPhoneReady = ETrue;
+
+    // Only go to idle state when Phone engine is also ready
+    if ( iPEReady )
+        {
+        // Security mode check.
+        TPhoneCmdParamBoolean isSecurityMode;      
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
+        if ( !isSecurityMode.Boolean() && !IsSimOk() )
+            {
+            TPhoneCmdParamBoolean securityMode;
+            securityMode.SetBoolean( ETrue );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
+            iCreateNote = CIdle::NewL( CActive::EPriorityHigh );
+            
+            CreateAndShowNoteAfterIdle(); 
+            }
+        // Go to idle state
+        SetDefaultFlagsL();
+        iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
+        
+        iViewCommandHandle->ExecuteCommand( EPhoneViewPrepareIcons );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewLoadPlugins );
+        
+        iStateMachine->ChangeState( EPhoneStateIdle );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateStartup::HandleIdleForegroundEventL
+// Phone should show security note asap. 
+// Active idle might be in front quite early if f.e. rejected SIM 
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneStateStartup::HandleIdleForegroundEventL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateStartup::HandleIdleForegroundEventL( ) ");
+    // Security mode check. 
+    TPhoneCmdParamBoolean isSecurityMode;      
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );        
+    if ( !isSecurityMode.Boolean() && !IsSimOk() )
+        {
+        TPhoneCmdParamBoolean securityMode;
+        securityMode.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
+        iCreateNote = CIdle::NewL( CActive::EPriorityHigh );
+        
+        CreateAndShowNoteAfterIdle(); 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateStartup::CreateAndShowNoteAfterIdle
+//
+// Callback function.
+// -----------------------------------------------------------------------------
+//
+void CPhoneStateStartup::CreateAndShowNoteAfterIdle()
+    {
+ __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateStartup::CreateAndShowNoteAfterIdle ");
+        
+    if ( !iCreateNote->IsActive() )
+        {
+        iCreateNote->Start( 
+            TCallBack( DoShowNoteL, this ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneStateStartup::DoShowNoteL
+//
+// Callback function.
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneStateStartup::DoShowNoteL( TAny* aAny )
+    {        
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateStartup::DoShowNoteL ");
+    static_cast< CPhoneStateStartup* >( aAny )->
+        StartShowSecurityNoteL();
+
+    return KErrNone;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonesystemeventhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneSystemEventHandler class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <telinformationpskeys.h>
+#include <telephonyvariant.hrh>
+#include <UikonInternalPSKeys.h>
+#include <startupdomainpskeys.h>
+#include <hwrmdomainpskeys.h>
+
+#include "cphonesystemeventhandler.h"
+#include "mphonestate.h"
+#include "mphonestatemachine.h"
+#include "cphonecenrepproxy.h"
+#include "cphonepubsubproxy.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::CPhoneSystemEventHandler
+// C++ default constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneSystemEventHandler::CPhoneSystemEventHandler(
+    MPhoneStateMachine* aStateMachine ) :
+    iStateMachine( aStateMachine )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSystemEventHandler::NewL()
+// Two-phased constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSystemEventHandler* CPhoneSystemEventHandler::NewL(
+    MPhoneStateMachine* aStateMachine )
+    {
+    CPhoneSystemEventHandler* self =
+        new (ELeave) CPhoneSystemEventHandler( aStateMachine );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::ConstructL()
+// EPOC default constructor can leave.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::ConstructL()
+    {
+    // Set up notifications for call state values
+    CPhonePubSubProxy::Instance()->NotifyChangeL(
+        KPSUidCtsyCallInformation,
+        KCTsyCallState,
+        this );
+
+    // Set up notifications for displaying Telephony info on the title pane
+    CPhonePubSubProxy::Instance()->NotifyChangeL(
+        KPSUidTelInformation,
+        KTelDisplayInfo,
+        this );
+
+    // Set up notifications for Sim security state values.
+    CPhonePubSubProxy::Instance()->NotifyChangeL(
+        KPSUidStartup,
+        KStartupSimSecurityStatus,
+        this );
+
+    if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported(
+            KTelephonyLVFlagSwivelInDevice ))
+        {
+        // Set up notifications for Swivel state.
+        CPhonePubSubProxy::Instance()->NotifyChangeL(
+            KPSUidHWRM,
+            KHWRMGripStatus,
+            this );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::CPhoneSystemEventHandler
+// C++ default constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneSystemEventHandler::~CPhoneSystemEventHandler()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::DynInitMenuPaneL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::DynInitMenuPaneL(
+    TInt aResourceId,
+    CEikMenuPane* aMenuPane )
+    {
+    iStateMachine->State()->DynInitMenuPaneL( aResourceId, aMenuPane );
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::DynInitMenuBarL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::DynInitMenuBarL(
+    TInt aResourceId,
+    CEikMenuBar* aMenuBar )
+    {
+    iStateMachine->State()->DynInitMenuBarL( aResourceId, aMenuBar );
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::HandleSystemEventL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandleSystemEventL( const TWsEvent& aEvent )
+    {
+    iStateMachine->State()->HandleSystemEventL( aEvent );
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::HandleForegroundEventL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandleForegroundEventL( TBool aForeground )
+    {
+    iStateMachine->State()->HandleForegroundEventL( aForeground );
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::HandlePhoneForegroundEventL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandlePhoneForegroundEventL()
+    {
+    iStateMachine->State()->HandlePhoneForegroundEventL();
+    }
+
+ // ---------------------------------------------------------
+// CPhoneSystemEventHandler::HandlePhoneFocusLostEventL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandlePhoneFocusLostEventL()
+    {
+    iStateMachine->State()->HandlePhoneFocusLostEventL();
+    }
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::HandleIdleForegroundEventL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandleIdleForegroundEventL()
+    {
+    iStateMachine->State()->HandleIdleForegroundEventL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::HandleKeyLockEnabled
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandleKeyLockEnabled( TBool aKeylockEnabled )
+    {
+    iStateMachine->State()->HandleKeyLockEnabled( aKeylockEnabled );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSystemEventHandler::HandleEnvironmentChangeL
+// -----------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandleEnvironmentChangeL( const TInt aChanges )
+    {
+    iStateMachine->State()->HandleEnvironmentChangeL( aChanges );
+    }
+
+// ---------------------------------------------------------
+// CPhoneSystemEventHandler::HandlePhoneStartupL
+// ---------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandlePhoneStartupL()
+    {
+    iStateMachine->State()->HandlePhoneStartupL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSystemEventHandler::HandlePropertyChangedL
+// -----------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandlePropertyChangedL(
+    const TUid& aCategory,
+    const TUint aKey,
+    const TInt aValue )
+    {
+    iStateMachine->State()->HandlePropertyChangedL( aCategory, aKey, aValue );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSystemEventHandler::HandleCenRepChangeL
+// -----------------------------------------------------------
+//
+void CPhoneSystemEventHandler::HandleCenRepChangeL(
+    const TUid& aUid,
+    const TUint aId )
+    {
+    iStateMachine->State()->HandleCenRepChangeL( aUid, aId );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/cphoneuicontroller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,428 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneUIController class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <featmgr.h>        // for FeatureManager
+#include <settingsinternalcrkeys.h>
+
+#include "cphoneuicontroller.h"
+#include "pevirtualengine.h"
+#include "cphonestatehandle.h"
+#include "cphoneenginehandler.h"
+#include "cphonesystemeventhandler.h"
+#include "cphoneremotecontrolhandler.h"
+#include "mphoneviewcommandhandle.h"
+#include "phonestatedefinitions.h"
+#include "phonelogger.h"
+#include "phoneconstants.h"
+#include "phoneui.pan"
+#include "cphonekeyeventforwarder.h"
+#include "cphonecenrepproxy.h"
+#include "cphonemediatorfactory.h"
+#include "tphonecmdparamnumberentryobserver.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------
+// CPhoneUIController::CPhoneUIController
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------
+//
+CPhoneUIController::CPhoneUIController()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneUIController::ConstructL()
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneUIController::ConstructL( 
+    MPhoneViewCommandHandle* aViewCommandHandle )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneUIController::ConstructL()");
+    // Creates correct protocol DLL
+    CreateProtocolDllL( aViewCommandHandle );
+
+    // Reference the phone state machine
+    iStateMachine = CPhoneStateHandle::Instance()->StateMachine();
+
+    // Create the phone engine handler
+    iEngineHandler = CPhoneEngineHandler::NewL( iStateMachine );
+    // Create the system event handler
+    iSystemEventHandler = CPhoneSystemEventHandler::NewL( iStateMachine );
+     // Create the remote control handler
+    iRemoteControlHandler = CPhoneRemoteControlHandler::NewL( iStateMachine );
+
+    TInt leaveCode( 0 );
+    TInt retry( 0 );
+    RTimer timer;
+    TRequestStatus timerReady;
+    timer.CreateLocal();
+    // Phone Engine is tried to start for KPeRetryCount times
+    do
+        {
+        // Handle the message and trap leaves from message handling functions
+        TRAP( leaveCode, iPhoneEngine = iStateMachine->CreatePhoneEngineL( 
+            *this ) );
+            
+        if ( leaveCode )
+            {
+            // This thread is suspended for KPeRetryDelay
+            timer.After( timerReady, KPeRetryDelay );
+            User::WaitForRequest( timerReady );
+            retry++;
+            }
+        }while ( leaveCode && retry < KPeRetryCount );
+    timer.Close();
+    
+    if ( leaveCode )
+        {
+        // If Phone Engine didn't start
+        User::Leave( leaveCode );
+        }
+    
+    // Get the engine info
+    iEngineInfo = iPhoneEngine->EngineInfo();
+
+    // Store the phone engine information in the logger
+    CPhoneLogger* phoneLogger = static_cast<CPhoneLogger*>
+        ( CCoeEnv::Static( KUidPhoneUILoggerSingleton ) );
+    phoneLogger->SetPhoneEngine( iPhoneEngine );
+
+    // Store the phone engine information in the state machine
+    iStateMachine->SetPhoneEngine( iPhoneEngine );
+
+    // Set Number Entry observer
+    TPhoneCmdParamNumberEntryObserver cmdParamNumberEntryObserver;
+    cmdParamNumberEntryObserver.SetObserver( TCallBack( HandlePhoneNumberEditorCallBack, this ) );
+    aViewCommandHandle->ExecuteCommand( EPhoneViewSetNumberEntryObserver, 
+                                            &cmdParamNumberEntryObserver);
+    
+    // Go to the startup state
+    iStateMachine->ChangeState( EPhoneStateStartup );
+
+      CPhoneMediatorFactory::Instance()->CommandListener( this, iStateMachine,
+            iStateMachine->PhoneEngineInfo() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneUIController::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneUIController* CPhoneUIController::NewL( 
+    MPhoneViewCommandHandle* aViewCommandHandle )
+    {
+    __ASSERT_DEBUG( aViewCommandHandle,
+        Panic( EPhoneCtrlParameterNotInitialized ) );
+    
+    CPhoneUIController* self = new( ELeave ) CPhoneUIController;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aViewCommandHandle );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------
+// Destructor
+// 
+// -----------------------------------------------------------
+
+EXPORT_C CPhoneUIController::~CPhoneUIController()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneUIController::~CPhoneUIController()");
+    delete iRemoteControlHandler;
+    delete iSystemEventHandler;
+    delete iEngineHandler;
+    delete iKeyEventForwarder;
+    delete iStateHandle;
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleMessage( TInt aMessage, TInt aCallId ) 
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandleMessage( 
+    const TInt aMessage, 
+    const TInt aCallId ) 
+    {
+    __PHONELOGENGINEMSG( aMessage, aCallId );
+    TRAPD( err, iEngineHandler->DoHandleMessageL( aMessage, aCallId ) );
+
+    if ( err != KErrNone )
+        {
+        __PHONELOG2(
+            EOnlyFatal, 
+            EPhoneControl,
+            "PHONEUI_ERROR: CPhoneUIController::HandleMessage - Message received in unexpected state (aMessage=%d, err=%d)",
+            aMessage,
+            err);
+        }
+
+    __PHONELOGENGINEMSGEND( aMessage );
+    }
+    
+// ---------------------------------------------------------
+// CPhoneUIController::HandleError( const TPEErrorInfo& aErrorInfo )
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandleError( 
+    const TPEErrorInfo& aErrorInfo ) 
+    {
+    TInt err( KErrNone );
+    
+       TRAP( err, iStateMachine->State()->HandleErrorL( aErrorInfo ) );            
+    
+    if( err != KErrNone )
+        {
+        __PHONELOG1(
+            EOnlyFatal, 
+            EPhoneControl,
+            "PHONEUI_ERROR: CPhoneUIController::HandleError -  leave (err=%d)",
+            err);
+           __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlUnknownPanic ) );
+        }
+    }    
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleKeyEventL
+// ---------------------------------------------------------
+//
+EXPORT_C TKeyResponse CPhoneUIController::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    if ( aEventCode == EEventKey )
+        {
+        iStateMachine->State()->HandleKeyMessageL( 
+                        MPhoneKeyEvents::EPhoneKeyShortPress, 
+                        TKeyCode( aKeyEvent.iCode ) );
+        
+        iStateMachine->State()->HandleDtmfKeyToneL( aKeyEvent, aEventCode );
+        }
+    else if ( aEventCode == EEventLongPress )
+        {
+        iStateMachine->State()->HandleKeyMessageL( 
+                        MPhoneKeyEvents::EPhoneKeyLongPress, 
+                        TKeyCode( aKeyEvent.iCode ) );    
+        }
+    else 
+        {
+        iStateMachine->State()->HandleDtmfKeyToneL( aKeyEvent, aEventCode );
+        }
+    
+    
+        
+    return EKeyWasNotConsumed;
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::DynInitMenuPaneL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::DynInitMenuPaneL( 
+    TInt aResourceId, 
+    CEikMenuPane* aMenuPane )
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->DynInitMenuPaneL( aResourceId, aMenuPane );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::DynInitMenuBarL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::DynInitMenuBarL( 
+    TInt aResourceId, 
+    CEikMenuBar* aMenuBar )
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->DynInitMenuBarL( aResourceId, aMenuBar );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleSystemEventL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandleSystemEventL( const TWsEvent& aEvent )
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->HandleSystemEventL( aEvent );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleForegroundEventL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandleForegroundEventL( TBool aForeground )
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->HandleForegroundEventL( aForeground );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandlePhoneForegroundEventL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandlePhoneForegroundEventL()
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->HandlePhoneForegroundEventL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandlePhoneFocusLostEventL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandlePhoneFocusLostEventL()
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->HandlePhoneFocusLostEventL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleIdleForegroundEventL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandleIdleForegroundEventL()
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->HandleIdleForegroundEventL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleEnvironmentChangeL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandleEnvironmentChangeL( 
+    const TInt aChanges )
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->HandleEnvironmentChangeL( aChanges );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandlePhoneStartupL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandlePhoneStartupL()
+    {
+    __ASSERT_DEBUG( iSystemEventHandler, Panic( EPhoneCtrlInvariant ) );
+    iSystemEventHandler->HandlePhoneStartupL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleCommandL
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneUIController::HandleCommandL( TInt aCommand )
+    {
+    __ASSERT_DEBUG( iStateMachine->State(), Panic( EPhoneCtrlInvariant ) );
+
+    // Send key up message to engine so that we wouldn't accidentally play
+    // any DTMF tone.
+    iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+
+    return iStateMachine->State()->HandleCommandL( aCommand );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::ProcessCommandL
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneUIController::ProcessCommandL( TInt aCommand )
+    {
+    __ASSERT_DEBUG( iStateMachine->State(), Panic( EPhoneCtrlInvariant ) );
+    return iStateMachine->State()->ProcessCommandL( aCommand );
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandleKeyLockEnabled
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneUIController::HandleKeyLockEnabled( TBool aKeylockEnabled )
+    {
+    iSystemEventHandler->HandleKeyLockEnabled( aKeylockEnabled );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::CreateProtocolDllL
+// ---------------------------------------------------------
+//
+void CPhoneUIController::CreateProtocolDllL( 
+    MPhoneViewCommandHandle* aViewCommandHandle )
+    {
+    TBool voipSupported( EFalse );
+
+    if( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        TInt dynamicVoIP( KDynamicVoIPOff );
+        CPhoneCenRepProxy::Instance()->GetInt( 
+            KCRUidTelephonySettings, KDynamicVoIP, dynamicVoIP );
+            
+        if( dynamicVoIP == KDynamicVoIPOn )
+            {
+            voipSupported = ETrue;                
+            }
+        }
+
+    if( voipSupported )
+        {
+        iStateHandle = CPhoneStateHandle::CreateL(
+            aViewCommandHandle,
+            KVoIPExtension,
+            KUidAppVoIPExtensionStates );                        
+        }
+    else
+        {
+        iStateHandle = CPhoneStateHandle::CreateL(
+            aViewCommandHandle,
+            KGSMProtocol,
+            KUidAppGSMStates );            
+        }        
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::HandlePhoneNumberEditorCallBack
+// ---------------------------------------------------------
+//
+TInt CPhoneUIController::HandlePhoneNumberEditorCallBack( TAny* aAny )
+    {
+    CPhoneUIController* aPhoneUiController =
+        static_cast< CPhoneUIController* >( aAny );
+        
+    aPhoneUiController->DoHandlePhoneNumberEditorCallBack();
+    
+    return 0;
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIController::DoHandlePhoneNumberEditorCallBack
+// ---------------------------------------------------------
+//
+void CPhoneUIController::DoHandlePhoneNumberEditorCallBack()
+    {
+    iStateMachine->State()->HandleNumberEntryEdited();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuicontrol/src/tphonecallheaderparam.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,745 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A parameter class for setting call header information
+*
+*/
+
+
+#include <mpeclientinformation.h>
+#include <StringLoader.h>
+#include <bautils.h>
+
+#include "tphonecallheaderparam.h"
+#include "tphonecmdparamboolean.h"
+#include "mphonestatemachine.h"
+#include "mphonecallheadermanagerutility.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phoneui.pan"
+#include "cphonecenrepproxy.h"
+#include "telephonyvariant.hrh"
+#include "phoneviewcommanddefinitions.h"
+#include "phonelogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// -----------------------------------------------------------------------------
+// TPhoneCallHeaderParam::TPhoneCallHeaderParam
+// -----------------------------------------------------------------------------
+//  
+TPhoneCallHeaderParam::TPhoneCallHeaderParam(
+        MPhoneCallHeaderManagerUtility& aManagerUtility,
+        MPhoneStateMachine& aStateMachine ) 
+        : iManagerUtility ( aManagerUtility ),
+          iStateMachine ( aStateMachine ),
+          iCallHeaderType ( EPECallTypeUninitialized ),
+          iSetDivertIndication ( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------
+// TPhoneCallHeaderParam::SetCallHeaderTexts
+// -----------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetCallHeaderTexts(
+    const TInt aCallId, 
+    const TBool aWaitingCall,
+    const TBool aVideoCall,
+    TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts( ) ");
+    
+    TInt labelId(KPhoneRssCommonFirst);
+    TInt shortLabelId( KPhoneRssCommonFirst );
+    
+    // Fetch engine info parameters.
+    const TBool auxLine( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) == CCCECallParameters::ECCELineTypeAux );
+    const TBool cli( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length());
+    const TBool cnap( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length());
+    const TInt numberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ));
+    
+    __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - NumberType(%d), CLI(%d)", numberType, cli );
+    __PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - CNAP(%d), AuxLine(%d)", cnap, auxLine );
+    
+    if ( !cli && !cnap && ( numberType != EPEPrivateNumber ) )
+        {
+        if ( auxLine )
+            {
+            if ( aWaitingCall )
+                {
+                labelId = EPhoneIncomingLine2WaitingText; // waiting, line 2
+                shortLabelId = EPhoneIncomingLine2Text; // on line 2
+                }
+            else
+                {
+                labelId = EPhoneIncomingLine2Text; // on line 2
+                }
+            }
+        // If CLIR, but also network limitation(e.g. EPEUnknownNumber), then second line 
+        // should be empty in call bubble.
+        else
+            {
+            labelId = KPhoneRssCommonFirst; // No second line in call bubble
+            }
+        }
+    else  // Voice or video call with CLI or with CNAP.
+        {
+        if ( aWaitingCall )
+            {
+            if ( auxLine  )
+                {
+                labelId = EPhoneIncomingLine2WaitingText; // waiting, line 2
+                shortLabelId = EPhoneIncomingLine2Text; // on line 2
+                }
+            else
+                {
+                labelId = EPhoneCallWaitingLabel; // waiting
+                shortLabelId = EPhoneCallWaitingLabelShort; // waiting
+                }
+            }
+        else // Mo other calls
+            {
+            if ( auxLine )
+                {
+                labelId = EPhoneIncomingLine2CallingText; // calling, line 2
+                shortLabelId = EPhoneIncomingLine2Text; // on line 2
+                }
+            else
+                {
+                // If CLIR, but not network limitation, then second line 
+                // (calling or video call) should be shown in call bubble.
+                if ( aVideoCall )
+                    {
+                    labelId = EPhoneVideoCallIncoming; // video call
+                    shortLabelId = EPhoneVideoCallIncomingShort; // video call
+                    }
+                else
+                    {
+                    labelId = EPhoneIncomingCallLabel; // calling
+                    shortLabelId = EPhoneIncomingCallLabelShort; // calling
+                    }
+                }
+            }
+        }
+    __PHONELOG2( EBasic, EPhoneControl, 
+            "TPhoneCallHeaderParam::SetCallHeaderTexts - labelId(%d) , shortLabelId(%d)",
+            labelId, shortLabelId );
+    iManagerUtility.LoadCallHeaderTexts( labelId, shortLabelId, aCallHeaderData );
+    }
+    
+// -----------------------------------------------------------------------------
+// TPhoneCallHeaderParam::SetCliParamatersL
+// -----------------------------------------------------------------------------
+// 
+void TPhoneCallHeaderParam::SetCliParamatersL(
+        const TInt aCallId, 
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCliParamatersL( ) ");
+    
+    // Set call header number type
+    aCallHeaderData->SetNumberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) );
+    
+    if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && 
+         ( !ContactInfoAvailable( aCallId ) ) )
+        {
+        // Set phonenumber/URI as the CLI text for the call header      
+       aCallHeaderData->SetCLIText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
+                 TPhoneCmdParamCallHeaderData::ELeft );
+            
+        // No contact name, use phonenumber when available.
+        aCallHeaderData->SetParticipantListCLI(
+                TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
+        }
+    else
+        {
+        TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection = TPhoneCmdParamCallHeaderData::ERight;
+        TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
+ 
+        /*If call is Private/PayPhone call then IsCallPrivateOrPayPhone
+        * will set SetIdentitySpecificCallHeaderData parameters therefore
+        * there is no need to call GetRemoteInfoDataL.*/  
+        if ( !IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
+            {
+            GetRemoteInfoDataL( aCallId, remoteInfoText );
+            cnapClippingDirection = TPhoneCmdParamCallHeaderData::ELeft;
+            }
+        aCallHeaderData->SetCLIText( remoteInfoText,  TPhoneCmdParamCallHeaderData::ERight );
+        aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), 
+                cnapClippingDirection );
+        }
+    
+    SetCallerImage( aCallId, aCallHeaderData );
+
+    // Set the Caller text
+    if ( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 )
+        {
+        aCallHeaderData->SetCallerText( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TPhoneCallHeaderParam::SetCallerImage
+// -----------------------------------------------------------------------------
+//     
+void TPhoneCallHeaderParam::SetCallerImage( 
+        const TInt aCallId, 
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallerImage( ) ");
+    // Set the call header picture data if it is available
+    if ( ( iStateMachine.PhoneEngineInfo()->CallerImage( aCallId ).Length() > 0 )  && 
+         ( BaflUtils::FileExists( CCoeEnv::Static()->FsSession(), 
+                                  iStateMachine.PhoneEngineInfo()->CallerImage( aCallId ) ) ) )
+        {
+        aCallHeaderData->SetPicture( iStateMachine.PhoneEngineInfo()->CallerImage( aCallId ) );
+        }
+    else
+        {
+        // Set the thumbnail picture data if it is available
+        aCallHeaderData->SetHasThumbnail( iStateMachine.PhoneEngineInfo()->HasCallerThumbnail( aCallId ) );
+        CFbsBitmap* picture = iStateMachine.PhoneEngineInfo()->CallerThumbnail( aCallId );
+        if ( picture )
+            {
+            aCallHeaderData->SetThumbnail( picture );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::SetBasicCallHeaderParamsL
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetBasicCallHeaderParamsL(
+        const TInt aCallId, 
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetBasicCallHeaderParamsL( ) ");
+    // Set call header call state
+    aCallHeaderData->SetCallState( 
+        iStateMachine.PhoneEngineInfo()->CallState( aCallId ) );
+
+    // Set call header type            
+    aCallHeaderData->SetCallType( GetCallType( aCallId, aCallHeaderData ) );
+    
+    // Set call header voice privacy status
+    aCallHeaderData->SetCiphering( 
+        iStateMachine.PhoneEngineInfo()->IsSecureCall( aCallId ) );
+    aCallHeaderData->SetCipheringIndicatorAllowed( 
+        iStateMachine.PhoneEngineInfo()->SecureSpecified() );
+    
+    iManagerUtility.SetPhoneNumberAvailabilityL( 
+            iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length(),
+            ContactInfoAvailable( aCallId ) );
+    
+    //see service provider settings API
+    aCallHeaderData->SetServiceId(
+       iStateMachine.PhoneEngineInfo()->ServiceId( aCallId ) );
+       
+    // Set contact link, see virtual phonebook API
+    aCallHeaderData->SetContactLink(
+       iStateMachine.PhoneEngineInfo()->ContactLink( aCallId ) );
+       
+    // Set remote phone number
+    aCallHeaderData->SetRemotePhoneNumber(
+       iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) );
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::GetCallType
+// ---------------------------------------------------------------------------
+//
+TPECallType TPhoneCallHeaderParam::GetCallType( 
+        const TInt aCallId,
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCallType( ) ");
+    // Set call header type.
+    TPECallType callType = 
+        iStateMachine.PhoneEngineInfo()->CallType( aCallId );
+    SetCallHeaderType( callType );
+    
+    if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) 
+         == CCCECallParameters::ECCELineTypeAux )
+        {
+        aCallHeaderData->SetLine2( ETrue );
+        }
+
+    __PHONELOG1( EBasic, EPhoneControl, 
+                "TPhoneCallHeaderParam::GetCallType() - callType: %d ", 
+                callType )
+    return callType;
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::SetCallHeaderType
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetCallHeaderType( 
+    TInt aCallHeaderType )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderType( ) ");
+    iCallHeaderType = aCallHeaderType;
+    __PHONELOG1( EBasic, EPhoneControl, 
+                    "TPhoneCallHeaderParam::SetCallHeaderType() - iCallHeaderType: %d ", 
+                    iCallHeaderType )
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::CallHeaderType
+// ---------------------------------------------------------------------------
+//
+TInt TPhoneCallHeaderParam::CallHeaderType() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::CallHeaderType( ) ");
+    __PHONELOG1( EBasic, EPhoneControl, 
+                        "TPhoneCallHeaderParam::CallHeaderType() - iCallHeaderType: %d ", 
+                        iCallHeaderType )
+    return iCallHeaderType;            
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::ContactInfoAvailable
+// ---------------------------------------------------------------------------
+//
+TBool TPhoneCallHeaderParam::ContactInfoAvailable( const TInt aCallId ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::ContactInfoAvailable( ) ");
+    TBool contactAvailable = EFalse;
+    if ( ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() ) || 
+         ( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() ) )
+        {
+        contactAvailable = ETrue;
+        }
+    return contactAvailable;
+    }
+
+// -----------------------------------------------------------------------------
+// TPhoneCallHeaderParam::SetCliAndCnapParamatersL
+// -----------------------------------------------------------------------------
+// 
+void TPhoneCallHeaderParam::SetCliAndCnapParamatersL(
+        const TInt aCallId, 
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCliAndCnapParamatersL( ) ");
+    TBuf<KCntMaxTextFieldLength> cnapText( KNullDesC );
+
+    // Set call header number type
+    aCallHeaderData->SetNumberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) );
+        
+    const MPEClientInformation& info = 
+        iStateMachine.PhoneEngineInfo()->CallClientInformation( aCallId );
+
+    if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && 
+         ( !ContactInfoAvailable( aCallId ) ) && 
+         ( !info.ShowNumber() ) )
+        {
+        // No contact info data available; use the phone number
+        aCallHeaderData->SetCLIText(
+                iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
+                TPhoneCmdParamCallHeaderData::ELeft);
+        
+        // No contact name, use phonenumber when available.
+        aCallHeaderData->SetParticipantListCLI( 
+                TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText );
+        }
+    else
+        {
+        TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
+        
+        /*If call is Private/PayPhone call then IsCallPrivateOrPayPhone
+        * will set SetIdentitySpecificCallHeaderData parameters therefore
+        * there is no need to call GetRemoteInfoDataL.*/        
+        if ( !IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
+            {
+            GetRemoteInfoDataL( aCallId, remoteInfoText );
+            }
+        aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
+        }
+
+    // Fetch CNAP text and clipping direction
+    TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection;
+    GetCNAPText( aCallId, cnapText, cnapClippingDirection );
+    
+    // Set CNAP data 
+    aCallHeaderData->SetCNAPText( cnapText, cnapClippingDirection );
+    
+    // Set caller image 
+    SetCallerImage( aCallId, aCallHeaderData );
+
+    // Set the Caller text
+    if ( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 )
+        {
+        aCallHeaderData->SetCallerText( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ) );
+        }        
+    
+    // Set the call header CNAP data ( Contains possible CNAP name or received skype identification ).
+    if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) )
+        {
+        aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ), 
+                TPhoneCmdParamCallHeaderData::ERight );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::GetCNAPText
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::GetCNAPText( 
+    const TInt aCallId,
+       TDes& aData, 
+       TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection& aDirection ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCNAPText( ) ");
+    
+    // Set clipping direction  
+    aDirection = TPhoneCmdParamCallHeaderData::ERight;
+    
+    // If it's not a private number show further info
+    if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) != 
+        EPEPrivateNumber )
+        {
+        if ( ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() ||
+            iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() || 
+            iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() ) &&
+            iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() )
+            {
+            // Use the phone number for the CNAP display
+            aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) );
+            
+            // Clipping direction for non-private number
+            aDirection = TPhoneCmdParamCallHeaderData::ELeft;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::IsFeatureSupported
+// ---------------------------------------------------------------------------
+//
+TBool TPhoneCallHeaderParam::IsFeatureSupported( 
+        const TInt aFeatureKey, 
+        const TInt aCallId ) const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::IsFeatureSupported( ) ");
+    TBool featureSupport(EFalse);
+    switch( aFeatureKey )
+        {
+        case KTelephonyLVFlagUUS:
+            {
+            if( ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( aFeatureKey ) ) &&
+                ( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() ) )
+                {
+                featureSupport = ETrue;
+                }
+            }
+            break;
+        default:
+            //Do nothing.
+            break;
+        }
+    __PHONELOG1( EBasic, EPhoneControl, 
+            "TPhoneCallHeaderParam::IsFeatureSupported() - featureSupport: %d ", 
+            featureSupport )
+    
+    return featureSupport;
+    }
+
+// ---------------------------------------------------------------------------
+// TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( 
+    const TInt aCallId, 
+    TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( ) ");
+    if( iSetDivertIndication )
+        {
+        aCallHeaderData->SetDiverted( ETrue );
+        }
+    
+    if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) == CCCECallParameters::ECCELineTypeAux )
+        {
+        __PHONELOG( EBasic, EPhoneControl, 
+                "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader - CallALSLine() == CCCECallParameters::ECCELineTypeAux");
+        aCallHeaderData->SetLine2( ETrue );    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// TPhoneCallHeaderParam::SetDivertIndication
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetDivertIndication( const TBool aDivertIndication )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndication( ) ");
+    iSetDivertIndication = aDivertIndication;           
+    __PHONELOG1( EBasic, EPhoneControl, 
+                "TPhoneCallHeaderParam::SetDivertIndication() - iSetDivertIndication: %d ", 
+                iSetDivertIndication )
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL(
+        const TInt aCallId, 
+        const TBool aWaitingCall,
+        const TBool aVideoCall,
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL( ) ");
+    // Set basic params must be called before update is called.
+    SetBasicCallHeaderParamsL( aCallId, aCallHeaderData );
+    
+    // Set call header labels
+    SetCallHeaderTexts( 
+            aCallId, 
+            aWaitingCall, 
+            aVideoCall, 
+            aCallHeaderData );
+    
+    SetCliAndCnapParamatersL( aCallId, aCallHeaderData );
+    
+    // Set divert indication to call header if needed.
+    SetDivertIndicatorToCallHeader( aCallId, aCallHeaderData );
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL(
+        const TInt aCallId,
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL( ) ");
+    // Set basic params must be called before update is called.
+    SetBasicCallHeaderParamsL( aCallId, aCallHeaderData );
+    
+    // Set call header labels
+    if ( aCallHeaderData->CallType() == EPECallTypeVideo )
+        {
+        iManagerUtility.LoadCallHeaderTexts( 
+                EPhoneOutgoingVideoCallLabel, 
+                EPhoneOutgoingVideoCallLabelShort, 
+                aCallHeaderData );
+        }
+    else
+        {
+        iManagerUtility.LoadCallHeaderTexts( 
+                EPhoneOutgoingCallLabel, 
+                EPhoneOutgoingCallLabelShort, 
+                aCallHeaderData );
+        }
+    
+    SetCliParamatersL( aCallId, aCallHeaderData );
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::UpdateCallHeaderInfoL
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::UpdateCallHeaderInfoL( 
+        const TInt aCallId,
+        const TBool aWaitingCall,
+        const TBool aVideoCall,
+        TPhoneCmdParamCallHeaderData* aCallHeaderData )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::UpdateCallHeaderInfoL( ) ");
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
+    
+    // Set call header type
+    GetCallType( aCallId, aCallHeaderData );
+    
+    // Set CLI text for the call header
+    GetRemoteInfoDataL( aCallId, remoteInfoText );
+    if ( remoteInfoText != KNullDesC )
+        {
+        aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
+        if ( IsCallPrivateOrPayPhone( aCallId, remoteInfoText ) )
+            {
+            aCallHeaderData->SetCNAPText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight );
+            }
+        else
+            {
+            aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->
+                RemotePhoneNumber( aCallId ), TPhoneCmdParamCallHeaderData::ELeft );       
+            }
+        }
+    else
+        {
+        aCallHeaderData->SetCLIText( 
+            iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ),
+            TPhoneCmdParamCallHeaderData::ERight );
+        }
+
+    // If KTelephonyLVFlagUUS is enabled it will over write RemotePartyName setting.
+    // Contains possible CNAP name or received skype identification
+    if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) )
+        {
+        TBuf<KCntMaxTextFieldLength> remotePartyName( KNullDesC );
+        remotePartyName.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
+       
+        if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging )
+            {
+            // Set CNAP text  
+            aCallHeaderData->SetCNAPText( remotePartyName, TPhoneCmdParamCallHeaderData::ERight );
+            }
+        else
+            {
+            aCallHeaderData->SetCLIText( remotePartyName, TPhoneCmdParamCallHeaderData::ERight );
+            }
+        }   
+    
+    // Set call header labels
+    SetCallHeaderTexts( 
+            aCallId, 
+            aWaitingCall, 
+            aVideoCall, 
+            aCallHeaderData );
+            
+    // Update caller image
+    SetCallerImage( 
+            aCallId, 
+            aCallHeaderData ); 
+    }
+
+// ---------------------------------------------------------------------------
+// TPhoneCallHeaderParam::IsCallPrivateOrPayPhone
+// ---------------------------------------------------------------------------
+//
+TBool TPhoneCallHeaderParam::IsCallPrivateOrPayPhone( const TInt aCallId, TDes& aData ) const 
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::IsCallPrivateOrPayPhone() ");
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    TBool ret( EFalse );
+    const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
+    if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) == EPEPrivateNumber ) ||
+            identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone || 
+            identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone )
+        {
+        SetIdentitySpecificCallHeaderData( aCallId, aData );
+        ret = ETrue;
+        }
+    
+    __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::IsCallPrivateOrPayPhone() - returns = %d ", ret);
+    return ret;  
+    }
+
+// ---------------------------------------------------------------------------
+//  TPhoneCallHeaderParam::GetRemoteInfoDataL
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::GetRemoteInfoDataL( 
+        const TInt aCallId, 
+        TDes& aData ) const 
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() ");
+    __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() - call id =%d ", aCallId);
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    if ( aCallId == KEmergencyCallId )
+        {
+        // Set emergency label text
+        iManagerUtility.LoadResource( aData, EPhoneEmergencyCallHeader );
+        }
+    else
+        {
+        // Note next if-statements are in priority order so be careful if you change order
+        // or add new if-statements.
+        if ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() )
+            {
+            // Display the contact name if it is available
+            aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ) );
+            }
+        else if ( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() )
+            {
+            // Display the CNAP or UUS info if it is available.
+            aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) );
+            }
+        else if ( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() )
+            {
+            // Display the company name if it is available
+            aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
+            }
+        else if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging  )
+            {
+            SetIdentitySpecificCallHeaderData( aCallId, aData );
+           }
+        else
+            {
+            if ( ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateDialing ) && 
+                 ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateRinging ) &&
+                 ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) != EPEStateAnswering ) )
+                {
+                iManagerUtility.GetInCallNumberTextL( aCallId, aData );
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData
+// ---------------------------------------------------------------------------
+//
+void TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData( const TInt aCallId,  TDes& aData ) const 
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() ")
+    __ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    
+    const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId );
+    const TPEPhoneNumberIdType idType = iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId );
+    
+    __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() - RemoteIdentity: %d ", 
+            identity )
+    __PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetIdentitySpecificCallHeaderData() - idType: %d ", 
+            idType )
+    // If ringing call is emergency call then do not set identity specific info to call header
+    // because emergency call header doesnt contain identity specific information.
+    if ( aCallId == KEmergencyCallId )
+            {
+            // do nothing.
+            }
+    else if ( idType == EPEPrivateNumber )
+        {
+        // If call header has customized items and callheadertype is voip
+        // then load customized text.
+        if ( ( iManagerUtility.Customization() ) && ( CallHeaderType() == EPECallTypeVoIP ) )
+            {
+            // Display private address
+            iManagerUtility.LoadResource( aData, iManagerUtility.Customization()->CustomizeCallHeaderText() );
+            }
+        else
+            {
+            // Display "private number".
+            iManagerUtility.LoadResource( aData, EPhoneCLIWithheld );  
+            }       
+        }
+    else if( ( identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone ) ||
+             ( identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone ) )
+        {
+        // Display "Payphone".
+        iManagerUtility.LoadResource( aData, EPhoneCLIPayphone );
+        }
+    else if ( identity == RMobileCall::ERemoteIdentityUnknown  )
+        {
+        // Display "Call".
+        iManagerUtility.LoadResource( aData, EPhoneCall );
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/bwins/phoneuiqtviewadapteru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,98 @@
+EXPORTS
+	?removeDialpad@PhoneUIQtViewAdapter@@AAEXXZ @ 1 NONAME ; void PhoneUIQtViewAdapter::removeDialpad(void)
+	?defaultToolbarResourceId@PhoneResourceAdapter@@QBEHXZ @ 2 NONAME ; int PhoneResourceAdapter::defaultToolbarResourceId(void) const
+	??1PhoneUIQtViewAdapter@@UAE@XZ @ 3 NONAME ; PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter(void)
+	?createEmergencyCallHeader@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 4 NONAME ; void PhoneUIQtViewAdapter::createEmergencyCallHeader(int, class TPhoneCommandParam *)
+	??0PhoneResourceAdapter@@IAE@PAVQObject@@@Z @ 5 NONAME ; PhoneResourceAdapter::PhoneResourceAdapter(class QObject *)
+	?convertToString@PhoneResourceAdapter@@QBE?AVQString@@H@Z @ 6 NONAME ; class QString PhoneResourceAdapter::convertToString(int) const
+	?addToConference@PhoneUIQtViewAdapter@@AAEXXZ @ 7 NONAME ; void PhoneUIQtViewAdapter::addToConference(void)
+	?createConferenceBubble@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 8 NONAME ; void PhoneUIQtViewAdapter::createConferenceBubble(int, class TPhoneCommandParam *)
+	?callsExists@PhoneUIQtViewAdapter@@AAE_NHH@Z @ 9 NONAME ; bool PhoneUIQtViewAdapter::callsExists(int, int)
+	?ExecuteCommandL@PhoneUIQtViewAdapter@@UAEXHHAAVTDesC16@@@Z @ 10 NONAME ; void PhoneUIQtViewAdapter::ExecuteCommandL(int, int, class TDesC16 &)
+	?tr@PhoneResourceAdapter@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString PhoneResourceAdapter::tr(char const *, char const *, int)
+	?convert@PhoneResourceAdapter@@QAA?AV?$QMap@W4ActionType@PhoneAction@@PAV2@@@HZZ @ 12 NONAME ; class QMap<enum PhoneAction::ActionType, class PhoneAction *> PhoneResourceAdapter::convert(int, ...)
+	?ExecuteCommandL@PhoneUIQtViewAdapter@@UAEXHH@Z @ 13 NONAME ; void PhoneUIQtViewAdapter::ExecuteCommandL(int, int)
+	?noteController@PhoneUIQtViewAdapter@@QBEPAVPhoneNoteController@@XZ @ 14 NONAME ; class PhoneNoteController * PhoneUIQtViewAdapter::noteController(void) const
+	??_EPhoneResourceAdapter@@UAE@I@Z @ 15 NONAME ; PhoneResourceAdapter::~PhoneResourceAdapter(unsigned int)
+	?tr@PhoneResourceAdapter@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString PhoneResourceAdapter::tr(char const *, char const *)
+	?trUtf8@PhoneResourceAdapter@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString PhoneResourceAdapter::trUtf8(char const *, char const *)
+	?getStaticMetaObject@PhoneResourceAdapter@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & PhoneResourceAdapter::getStaticMetaObject(void)
+	?getDialpadStringLength@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 19 NONAME ; void PhoneUIQtViewAdapter::getDialpadStringLength(class TPhoneCommandParam *)
+	?trUtf8@PhoneResourceAdapter@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString PhoneResourceAdapter::trUtf8(char const *, char const *, int)
+	?convertCommandToString@PhoneResourceAdapter@@QBE?AVQString@@H@Z @ 21 NONAME ; class QString PhoneResourceAdapter::convertCommandToString(int) const
+	?activeCallCount@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 22 NONAME ; void PhoneUIQtViewAdapter::activeCallCount(class TPhoneCommandParam *)
+	?setTouchButtons@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 23 NONAME ; void PhoneUIQtViewAdapter::setTouchButtons(class TPhoneCommandParam *)
+	?setExpandActions@PhoneUIQtViewAdapter@@AAEXXZ @ 24 NONAME ; void PhoneUIQtViewAdapter::setExpandActions(void)
+	?qt_metacast@PhoneUIQtViewAdapter@@UAEPAXPBD@Z @ 25 NONAME ; void * PhoneUIQtViewAdapter::qt_metacast(char const *)
+	?Instance@PhoneResourceAdapter@@SAPAV1@PAVQObject@@@Z @ 26 NONAME ; class PhoneResourceAdapter * PhoneResourceAdapter::Instance(class QObject *)
+	?setTopApplication@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 27 NONAME ; void PhoneUIQtViewAdapter::setTopApplication(class TPhoneCommandParam *)
+	?getNumberFromDialpad@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 28 NONAME ; void PhoneUIQtViewAdapter::getNumberFromDialpad(class TPhoneCommandParam *)
+	?isConference@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 29 NONAME ; void PhoneUIQtViewAdapter::isConference(class TPhoneCommandParam *)
+	?convertToString@PhoneResourceAdapter@@QBE?AVQString@@HABV2@@Z @ 30 NONAME ; class QString PhoneResourceAdapter::convertToString(int, class QString const &) const
+	?qt_metacast@PhoneResourceAdapter@@UAEPAXPBD@Z @ 31 NONAME ; void * PhoneResourceAdapter::qt_metacast(char const *)
+	??0PhoneUIQtViewAdapter@@QAE@AAVPhoneUIQtViewIF@@PAVQObject@@@Z @ 32 NONAME ; PhoneUIQtViewAdapter::PhoneUIQtViewAdapter(class PhoneUIQtViewIF &, class QObject *)
+	?ExecuteCommand@PhoneUIQtViewAdapter@@UAEXHPAVTPhoneCommandParam@@@Z @ 33 NONAME ; void PhoneUIQtViewAdapter::ExecuteCommand(int, class TPhoneCommandParam *)
+	?keyReleased@PhoneUIQtViewAdapter@@AAEXPAVQKeyEvent@@@Z @ 34 NONAME ; void PhoneUIQtViewAdapter::keyReleased(class QKeyEvent *)
+	?bringToForeground@PhoneUIQtViewAdapter@@AAEXXZ @ 35 NONAME ; void PhoneUIQtViewAdapter::bringToForeground(void)
+	??_EPhoneUIQtViewAdapter@@UAE@I@Z @ 36 NONAME ; PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter(unsigned int)
+	?buttonsController@PhoneResourceAdapter@@QAEPAVPhoneUIQtButtonsController@@XZ @ 37 NONAME ; class PhoneUIQtButtonsController * PhoneResourceAdapter::buttonsController(void)
+	?updateCallHeaderState@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 38 NONAME ; void PhoneUIQtViewAdapter::updateCallHeaderState(int, class TPhoneCommandParam *)
+	?setExpandedConferenceCallHeader@PhoneUIQtViewAdapter@@AAEXXZ @ 39 NONAME ; void PhoneUIQtViewAdapter::setExpandedConferenceCallHeader(void)
+	?HandleCommandL@PhoneUIQtViewAdapter@@UAEHHPAVTPhoneCommandParam@@@Z @ 40 NONAME ; int PhoneUIQtViewAdapter::HandleCommandL(int, class TPhoneCommandParam *)
+	?setDialpadMenu@PhoneUIQtViewAdapter@@AAEXXZ @ 41 NONAME ; void PhoneUIQtViewAdapter::setDialpadMenu(void)
+	?callIdByState@PhoneUIQtViewAdapter@@AAEHPAVTPhoneCommandParam@@@Z @ 42 NONAME ; int PhoneUIQtViewAdapter::callIdByState(class TPhoneCommandParam *)
+	?ExecuteCommandL@PhoneUIQtViewAdapter@@UAEXHPAVTPhoneCommandParam@@@Z @ 43 NONAME ; void PhoneUIQtViewAdapter::ExecuteCommandL(int, class TPhoneCommandParam *)
+	?setDialpadVisibility@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 44 NONAME ; void PhoneUIQtViewAdapter::setDialpadVisibility(class TPhoneCommandParam *)
+	?ExecuteCommandL@PhoneUIQtViewAdapter@@UAEXHHPAVTPhoneCommandParam@@@Z @ 45 NONAME ; void PhoneUIQtViewAdapter::ExecuteCommandL(int, int, class TPhoneCommandParam *)
+	?removeConferenceBubble@PhoneUIQtViewAdapter@@AAEXXZ @ 46 NONAME ; void PhoneUIQtViewAdapter::removeConferenceBubble(void)
+	?showGlobalNote@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 47 NONAME ; void PhoneUIQtViewAdapter::showGlobalNote(class TPhoneCommandParam *)
+	?getSelectedConferenceMember@PhoneUIQtViewAdapter@@AAEHPAVTPhoneCommandParam@@@Z @ 48 NONAME ; int PhoneUIQtViewAdapter::getSelectedConferenceMember(class TPhoneCommandParam *)
+	?metaObject@PhoneUIQtViewAdapter@@UBEPBUQMetaObject@@XZ @ 49 NONAME ; struct QMetaObject const * PhoneUIQtViewAdapter::metaObject(void) const
+	?dialpadClosed@PhoneUIQtViewAdapter@@AAEXXZ @ 50 NONAME ; void PhoneUIQtViewAdapter::dialpadClosed(void)
+	?removeAllCallHeaders@PhoneUIQtViewAdapter@@AAEXXZ @ 51 NONAME ; void PhoneUIQtViewAdapter::removeAllCallHeaders(void)
+	?idleAppUid@PhoneUIQtViewAdapter@@AAEHXZ @ 52 NONAME ; int PhoneUIQtViewAdapter::idleAppUid(void)
+	?setCallHoldFlag@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 53 NONAME ; void PhoneUIQtViewAdapter::setCallHoldFlag(class TPhoneCommandParam *)
+	?setPrivateFromConference@PhoneUIQtViewAdapter@@AAEXH@Z @ 54 NONAME ; void PhoneUIQtViewAdapter::setPrivateFromConference(int)
+	?setCallMenu@PhoneUIQtViewAdapter@@AAEXXZ @ 55 NONAME ; void PhoneUIQtViewAdapter::setCallMenu(void)
+	?setAudioVolumeSliderValue@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 56 NONAME ; void PhoneUIQtViewAdapter::setAudioVolumeSliderValue(class TPhoneCommandParam *)
+	?qt_metacall@PhoneUIQtViewAdapter@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 57 NONAME ; int PhoneUIQtViewAdapter::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1PhoneResourceAdapter@@UAE@XZ @ 58 NONAME ; PhoneResourceAdapter::~PhoneResourceAdapter(void)
+	?removeCallFromConference@PhoneUIQtViewAdapter@@AAEXH@Z @ 59 NONAME ; void PhoneUIQtViewAdapter::removeCallFromConference(int)
+	?tr@PhoneUIQtViewAdapter@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString PhoneUIQtViewAdapter::tr(char const *, char const *, int)
+	?staticMetaObject@PhoneResourceAdapter@@2UQMetaObject@@B @ 61 NONAME ; struct QMetaObject const PhoneResourceAdapter::staticMetaObject
+	?staticMetaObject@PhoneUIQtViewAdapter@@2UQMetaObject@@B @ 62 NONAME ; struct QMetaObject const PhoneUIQtViewAdapter::staticMetaObject
+	?ExecuteCommandL@PhoneUIQtViewAdapter@@UAEXH@Z @ 63 NONAME ; void PhoneUIQtViewAdapter::ExecuteCommandL(int)
+	?trUtf8@PhoneUIQtViewAdapter@@SA?AVQString@@PBD0H@Z @ 64 NONAME ; class QString PhoneUIQtViewAdapter::trUtf8(char const *, char const *, int)
+	?setMuteIndication@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 65 NONAME ; void PhoneUIQtViewAdapter::setMuteIndication(class TPhoneCommandParam *)
+	?HandleCommandL@PhoneUIQtViewAdapter@@UAEHH@Z @ 66 NONAME ; int PhoneUIQtViewAdapter::HandleCommandL(int)
+	?showNote@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 67 NONAME ; void PhoneUIQtViewAdapter::showNote(class TPhoneCommandParam *)
+	?FetchContent@PhoneUIQtViewAdapter@@UAEABVTDesC16@@XZ @ 68 NONAME ; class TDesC16 const & PhoneUIQtViewAdapter::FetchContent(void)
+	?writeAudioVolumeLevel@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 69 NONAME ; void PhoneUIQtViewAdapter::writeAudioVolumeLevel(class TPhoneCommandParam *)
+	?conferenceCallId@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 70 NONAME ; void PhoneUIQtViewAdapter::conferenceCallId(int, class TPhoneCommandParam *)
+	?setMenu@PhoneUIQtViewAdapter@@AAEXXZ @ 71 NONAME ; void PhoneUIQtViewAdapter::setMenu(void)
+	?trUtf8@PhoneUIQtViewAdapter@@SA?AVQString@@PBD0@Z @ 72 NONAME ; class QString PhoneUIQtViewAdapter::trUtf8(char const *, char const *)
+	?tr@PhoneUIQtViewAdapter@@SA?AVQString@@PBD0@Z @ 73 NONAME ; class QString PhoneUIQtViewAdapter::tr(char const *, char const *)
+	?getStaticMetaObject@PhoneUIQtViewAdapter@@SAABUQMetaObject@@XZ @ 74 NONAME ; struct QMetaObject const & PhoneUIQtViewAdapter::getStaticMetaObject(void)
+	?updateCallHeaderRemoteInfoAndLabel@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 75 NONAME ; void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfoAndLabel(int, class TPhoneCommandParam *)
+	?updateCallHeaderRemoteInfo@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 76 NONAME ; void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo(int, class TPhoneCommandParam *)
+	?qt_metacall@PhoneResourceAdapter@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 77 NONAME ; int PhoneResourceAdapter::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?callHoldFlag@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 78 NONAME ; void PhoneUIQtViewAdapter::callHoldFlag(class TPhoneCommandParam *)
+	?setToolbarButtons@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 79 NONAME ; void PhoneUIQtViewAdapter::setToolbarButtons(class TPhoneCommandParam *)
+	?setAudioPath@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 80 NONAME ; void PhoneUIQtViewAdapter::setAudioPath(class TPhoneCommandParam *)
+	?expandedBubbleCallId@PhoneUIQtViewAdapter@@AAEXPAVTPhoneCommandParam@@@Z @ 81 NONAME ; void PhoneUIQtViewAdapter::expandedBubbleCallId(class TPhoneCommandParam *)
+	?openDialpad@PhoneUIQtViewAdapter@@AAEXXZ @ 82 NONAME ; void PhoneUIQtViewAdapter::openDialpad(void)
+	?createCallHeader@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 83 NONAME ; void PhoneUIQtViewAdapter::createCallHeader(int, class TPhoneCommandParam *)
+	?ExecuteCommand@PhoneUIQtViewAdapter@@UAEXH@Z @ 84 NONAME ; void PhoneUIQtViewAdapter::ExecuteCommand(int)
+	?metaObject@PhoneResourceAdapter@@UBEPBUQMetaObject@@XZ @ 85 NONAME ; struct QMetaObject const * PhoneResourceAdapter::metaObject(void) const
+	?setParticipantListActions@PhoneUIQtViewAdapter@@AAEXXZ @ 86 NONAME ; void PhoneUIQtViewAdapter::setParticipantListActions(void)
+	?convertToHbActions@PhoneResourceAdapter@@QBE?AV?$QList@PAVHbAction@@@@H@Z @ 87 NONAME ; class QList<class HbAction *> PhoneResourceAdapter::convertToHbActions(int) const
+	?convertDuration@PhoneUIQtViewAdapter@@AAE?AVQString@@H@Z @ 88 NONAME ; class QString PhoneUIQtViewAdapter::convertDuration(int)
+	?setBubbleSelectionFlag@PhoneUIQtViewAdapter@@AAEXXZ @ 89 NONAME ; void PhoneUIQtViewAdapter::setBubbleSelectionFlag(void)
+	?handleCipheringInfoChange@PhoneUIQtViewAdapter@@AAEXHPAVTPhoneCommandParam@@@Z @ 90 NONAME ; void PhoneUIQtViewAdapter::handleCipheringInfoChange(int, class TPhoneCommandParam *)
+	?HandlePropertyChangedL@PhoneUIQtViewAdapter@@UAEXABVTUid@@IH@Z @ 91 NONAME ; void PhoneUIQtViewAdapter::HandlePropertyChangedL(class TUid const &, unsigned int, int)
+	?setHidden@PhoneUIQtViewAdapter@@AAEX_N@Z @ 92 NONAME ; void PhoneUIQtViewAdapter::setHidden(bool)
+	?SetHiddenL@PhoneUIQtViewAdapter@@AAEX_N@Z @ 93 NONAME ; void PhoneUIQtViewAdapter::SetHiddenL(bool)
+	?openContacts@PhoneUIQtViewAdapter@@AAEXXZ @ 94 NONAME ; void PhoneUIQtViewAdapter::openContacts(void)
+	?handleWindowDeactivated@PhoneUIQtViewAdapter@@AAEXXZ @ 95 NONAME ; void PhoneUIQtViewAdapter::handleWindowDeactivated(void)
+	?handleWindowActivated@PhoneUIQtViewAdapter@@AAEXXZ @ 96 NONAME ; void PhoneUIQtViewAdapter::handleWindowActivated(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/eabi/phoneuiqtviewadapteru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+EXPORTS
+	_ZN20PhoneResourceAdapter11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN20PhoneResourceAdapter11qt_metacastEPKc @ 2 NONAME
+	_ZN20PhoneResourceAdapter16staticMetaObjectE @ 3 NONAME DATA 16
+	_ZN20PhoneResourceAdapter17buttonsControllerEv @ 4 NONAME
+	_ZN20PhoneResourceAdapter19getStaticMetaObjectEv @ 5 NONAME
+	_ZN20PhoneResourceAdapter7convertEiz @ 6 NONAME
+	_ZN20PhoneResourceAdapter8InstanceEP7QObject @ 7 NONAME
+	_ZN20PhoneResourceAdapterC1EP7QObject @ 8 NONAME
+	_ZN20PhoneResourceAdapterC2EP7QObject @ 9 NONAME
+	_ZN20PhoneResourceAdapterD0Ev @ 10 NONAME
+	_ZN20PhoneResourceAdapterD1Ev @ 11 NONAME
+	_ZN20PhoneResourceAdapterD2Ev @ 12 NONAME
+	_ZN20PhoneUIQtViewAdapter10idleAppUidEv @ 13 NONAME
+	_ZN20PhoneUIQtViewAdapter11callsExistsEii @ 14 NONAME
+	_ZN20PhoneUIQtViewAdapter11keyReleasedEP9QKeyEvent @ 15 NONAME
+	_ZN20PhoneUIQtViewAdapter11openDialpadEv @ 16 NONAME
+	_ZN20PhoneUIQtViewAdapter11qt_metacallEN11QMetaObject4CallEiPPv @ 17 NONAME
+	_ZN20PhoneUIQtViewAdapter11qt_metacastEPKc @ 18 NONAME
+	_ZN20PhoneUIQtViewAdapter11setCallMenuEv @ 19 NONAME
+	_ZN20PhoneUIQtViewAdapter12FetchContentEv @ 20 NONAME
+	_ZN20PhoneUIQtViewAdapter12callHoldFlagEP18TPhoneCommandParam @ 21 NONAME
+	_ZN20PhoneUIQtViewAdapter12isConferenceEP18TPhoneCommandParam @ 22 NONAME
+	_ZN20PhoneUIQtViewAdapter12setAudioPathEP18TPhoneCommandParam @ 23 NONAME
+	_ZN20PhoneUIQtViewAdapter13callIdByStateEP18TPhoneCommandParam @ 24 NONAME
+	_ZN20PhoneUIQtViewAdapter13dialpadClosedEv @ 25 NONAME
+	_ZN20PhoneUIQtViewAdapter13removeDialpadEv @ 26 NONAME
+	_ZN20PhoneUIQtViewAdapter14ExecuteCommandEi @ 27 NONAME
+	_ZN20PhoneUIQtViewAdapter14ExecuteCommandEiP18TPhoneCommandParam @ 28 NONAME
+	_ZN20PhoneUIQtViewAdapter14HandleCommandLEi @ 29 NONAME
+	_ZN20PhoneUIQtViewAdapter14HandleCommandLEiP18TPhoneCommandParam @ 30 NONAME
+	_ZN20PhoneUIQtViewAdapter14setDialpadMenuEv @ 31 NONAME
+	_ZN20PhoneUIQtViewAdapter14showGlobalNoteEP18TPhoneCommandParam @ 32 NONAME
+	_ZN20PhoneUIQtViewAdapter15ExecuteCommandLEi @ 33 NONAME
+	_ZN20PhoneUIQtViewAdapter15ExecuteCommandLEiP18TPhoneCommandParam @ 34 NONAME
+	_ZN20PhoneUIQtViewAdapter15ExecuteCommandLEii @ 35 NONAME
+	_ZN20PhoneUIQtViewAdapter15ExecuteCommandLEiiP18TPhoneCommandParam @ 36 NONAME
+	_ZN20PhoneUIQtViewAdapter15ExecuteCommandLEiiR7TDesC16 @ 37 NONAME
+	_ZN20PhoneUIQtViewAdapter15activeCallCountEP18TPhoneCommandParam @ 38 NONAME
+	_ZN20PhoneUIQtViewAdapter15addToConferenceEv @ 39 NONAME
+	_ZN20PhoneUIQtViewAdapter15setCallHoldFlagEP18TPhoneCommandParam @ 40 NONAME
+	_ZN20PhoneUIQtViewAdapter15setTouchButtonsEP18TPhoneCommandParam @ 41 NONAME
+	_ZN20PhoneUIQtViewAdapter16conferenceCallIdEiP18TPhoneCommandParam @ 42 NONAME
+	_ZN20PhoneUIQtViewAdapter16createCallHeaderEiP18TPhoneCommandParam @ 43 NONAME
+	_ZN20PhoneUIQtViewAdapter16setExpandActionsEv @ 44 NONAME
+	_ZN20PhoneUIQtViewAdapter16staticMetaObjectE @ 45 NONAME DATA 16
+	_ZN20PhoneUIQtViewAdapter17bringToForegroundEv @ 46 NONAME
+	_ZN20PhoneUIQtViewAdapter17setMuteIndicationEP18TPhoneCommandParam @ 47 NONAME
+	_ZN20PhoneUIQtViewAdapter17setToolbarButtonsEP18TPhoneCommandParam @ 48 NONAME
+	_ZN20PhoneUIQtViewAdapter17setTopApplicationEP18TPhoneCommandParam @ 49 NONAME
+	_ZN20PhoneUIQtViewAdapter19getStaticMetaObjectEv @ 50 NONAME
+	_ZN20PhoneUIQtViewAdapter20expandedBubbleCallIdEP18TPhoneCommandParam @ 51 NONAME
+	_ZN20PhoneUIQtViewAdapter20getNumberFromDialpadEP18TPhoneCommandParam @ 52 NONAME
+	_ZN20PhoneUIQtViewAdapter20removeAllCallHeadersEv @ 53 NONAME
+	_ZN20PhoneUIQtViewAdapter20setDialpadVisibilityEP18TPhoneCommandParam @ 54 NONAME
+	_ZN20PhoneUIQtViewAdapter21updateCallHeaderStateEiP18TPhoneCommandParam @ 55 NONAME
+	_ZN20PhoneUIQtViewAdapter21writeAudioVolumeLevelEP18TPhoneCommandParam @ 56 NONAME
+	_ZN20PhoneUIQtViewAdapter22createConferenceBubbleEiP18TPhoneCommandParam @ 57 NONAME
+	_ZN20PhoneUIQtViewAdapter22getDialpadStringLengthEP18TPhoneCommandParam @ 58 NONAME
+	_ZN20PhoneUIQtViewAdapter22removeConferenceBubbleEv @ 59 NONAME
+	_ZN20PhoneUIQtViewAdapter24removeCallFromConferenceEi @ 60 NONAME
+	_ZN20PhoneUIQtViewAdapter24setPrivateFromConferenceEi @ 61 NONAME
+	_ZN20PhoneUIQtViewAdapter25createEmergencyCallHeaderEiP18TPhoneCommandParam @ 62 NONAME
+	_ZN20PhoneUIQtViewAdapter25setAudioVolumeSliderValueEP18TPhoneCommandParam @ 63 NONAME
+	_ZN20PhoneUIQtViewAdapter25setParticipantListActionsEv @ 64 NONAME
+	_ZN20PhoneUIQtViewAdapter26updateCallHeaderRemoteInfoEiP18TPhoneCommandParam @ 65 NONAME
+	_ZN20PhoneUIQtViewAdapter27getSelectedConferenceMemberEP18TPhoneCommandParam @ 66 NONAME
+	_ZN20PhoneUIQtViewAdapter31setExpandedConferenceCallHeaderEv @ 67 NONAME
+	_ZN20PhoneUIQtViewAdapter34updateCallHeaderRemoteInfoAndLabelEiP18TPhoneCommandParam @ 68 NONAME
+	_ZN20PhoneUIQtViewAdapter7setMenuEv @ 69 NONAME
+	_ZN20PhoneUIQtViewAdapter8showNoteEP18TPhoneCommandParam @ 70 NONAME
+	_ZN20PhoneUIQtViewAdapterC1ER15PhoneUIQtViewIFP7QObject @ 71 NONAME
+	_ZN20PhoneUIQtViewAdapterC2ER15PhoneUIQtViewIFP7QObject @ 72 NONAME
+	_ZN20PhoneUIQtViewAdapterD0Ev @ 73 NONAME
+	_ZN20PhoneUIQtViewAdapterD1Ev @ 74 NONAME
+	_ZN20PhoneUIQtViewAdapterD2Ev @ 75 NONAME
+	_ZNK20PhoneResourceAdapter10metaObjectEv @ 76 NONAME
+	_ZNK20PhoneResourceAdapter15convertToStringEi @ 77 NONAME
+	_ZNK20PhoneResourceAdapter15convertToStringEiRK7QString @ 78 NONAME
+	_ZNK20PhoneResourceAdapter22convertCommandToStringEi @ 79 NONAME
+	_ZNK20PhoneResourceAdapter24defaultToolbarResourceIdEv @ 80 NONAME
+	_ZNK20PhoneUIQtViewAdapter10metaObjectEv @ 81 NONAME
+	_ZNK20PhoneUIQtViewAdapter14noteControllerEv @ 82 NONAME
+	_ZTI20PhoneResourceAdapter @ 83 NONAME
+	_ZTI20PhoneUIQtViewAdapter @ 84 NONAME
+	_ZTV20PhoneResourceAdapter @ 85 NONAME
+	_ZTV20PhoneUIQtViewAdapter @ 86 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter12FetchContentEv @ 87 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter14ExecuteCommandEi @ 88 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter14ExecuteCommandEiP18TPhoneCommandParam @ 89 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter14HandleCommandLEi @ 90 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter14HandleCommandLEiP18TPhoneCommandParam @ 91 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter15ExecuteCommandLEi @ 92 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter15ExecuteCommandLEiP18TPhoneCommandParam @ 93 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter15ExecuteCommandLEii @ 94 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter15ExecuteCommandLEiiP18TPhoneCommandParam @ 95 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapter15ExecuteCommandLEiiR7TDesC16 @ 96 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapterD0Ev @ 97 NONAME
+	_ZThn8_N20PhoneUIQtViewAdapterD1Ev @ 98 NONAME
+	_ZNK20PhoneResourceAdapter18convertToHbActionsEi @ 99 NONAME
+	_ZN20PhoneUIQtViewAdapter15convertDurationEi @ 100 NONAME
+	_ZN20PhoneUIQtViewAdapter22setBubbleSelectionFlagEv @ 101 NONAME
+	_ZN20PhoneUIQtViewAdapter25handleCipheringInfoChangeEiP18TPhoneCommandParam @ 102 NONAME
+	_ZN20PhoneUIQtViewAdapter22HandlePropertyChangedLERK4TUidji @ 103 NONAME
+	_ZThn12_N20PhoneUIQtViewAdapter22HandlePropertyChangedLERK4TUidji @ 104 NONAME
+	_ZN20PhoneUIQtViewAdapter10SetHiddenLEb @ 105 NONAME
+	_ZN20PhoneUIQtViewAdapter9setHiddenEb @ 106 NONAME
+	_ZN20PhoneUIQtViewAdapter12openContactsEv @ 107 NONAME
+	_ZN20PhoneUIQtViewAdapter21handleWindowActivatedEv @ 108 NONAME
+	_ZN20PhoneUIQtViewAdapter23handleWindowDeactivatedEv @ 109 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/mphonebuttoncustomization.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class for touch button customization.
+*
+*/
+
+#ifndef MPHONEBUTTONCUSTOMIZATION_H
+#define MPHONEBUTTONCUSTOMIZATION_H
+
+// CLASS DECLARATION
+/**
+*  Interface class for touch button customization.
+*/
+class MPhoneButtonCustomization
+    {
+    
+public:
+    /**
+    * Customizes touch pane buttons.
+    * @param aTouchPane Interface to add and dimm
+    *                   bubble touch pane buttons.
+    */
+    virtual void CustomizeTouchPaneButtons() = 0;
+    };
+    
+#endif // MPHONEBUTTONCUSTOMIZATION_H
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/mphonedialercontroller.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of MPhoneDialerController class.
+*
+*/
+
+#ifndef MPHONEDIALERCONTROLLER_H_
+#define MPHONEDIALERCONTROLLER_H_
+
+// Forward declarations
+class CAknToolbar;
+
+/**
+ *  Abstract custom dialer interface.
+ *
+ *
+ *  @lib PhoneUiView.lib
+ *  @since S60 v5.0
+ */
+class MPhoneDialerController
+    {
+
+public:
+
+    /**
+    * Initializes the controller. 
+    * @param    aToolbar    CAknToolbar instance.
+    * @since    S60 v5.1
+    */
+    virtual void InitializeL( CAknToolbar& aToolbar ) = 0;
+    
+    /**
+    * Returns Cba resource id
+    * @return Resource Id of the softkeys
+    * @since S60 v5.1
+    */
+    virtual TInt CbaResourceId() const = 0;
+    
+    /**
+    * Returns Menu resource id
+    * @return Id of the menu resource
+    * @since S60 v5.1
+    */
+    virtual TInt MenuResourceId() const = 0;
+    
+    /**
+    * Returns number entry prompt text
+    * @return Reference to text to be shown on number entry
+    * @since S60 v5.1
+    */
+    virtual const TDesC& NumberEntryPromptTextL() = 0;
+    
+    /**
+    * Handles the number entry empty event
+    * @param aEmpty ETrue if numberentry is empty
+    * @since S60 v5.1
+    */
+    virtual void HandleNumberEntryIsEmpty( TBool aEmpty ) = 0;
+
+    /**
+    * Sets visibility of buttons created by the implementation
+    * @param aShow ETrue if numberentry is empty
+    * @since S60 v5.1
+    */
+    virtual void ShowButtons( TBool aShow ) = 0;
+    };
+
+#endif /*MDIALERCONTROLLER_H_*/
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/mphoneviewblockingdialogobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class for view blocking dialogs.
+*
+*/
+
+
+#ifndef MPHONEVIEWBLOCKINGDIALOGOBSERVER_H
+#define MPHONEVIEWBLOCKINGDIALOGOBSERVER_H
+
+
+// CLASS DECLARATION
+/**
+*  Interface class for view blocking dialogs.
+*/
+class MPhoneViewBlockingDialogObserver
+    {
+public:
+    /**
+    * Sets the value is blocking dialogs in screen.
+    * @param aBlockingDialog ETrue if blocking dialog is
+    *                        displayed.
+    */
+    virtual void SetBlockingDialogIsDisplayed( TBool aBlockingDialog ) = 0;
+    
+
+    };
+    
+#endif // MPHONEVIEWBLOCKINGDIALOGOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/mphoneviewcommandhandle.h	Fri Jun 04 10:19:18 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:  Phone view command handle
+*
+*/
+
+#ifndef MPHONEVIEWCOMMANDHANDLE_H
+#define MPHONEVIEWCOMMANDHANDLE_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "phoneviewcommanddefinitions.h"
+
+// DATA TYPES
+
+// FORWARD DECLARATION
+class TPhoneCommandParam;
+
+// CLASS DECLARATION
+/**
+*  Interface class for executing UI commands
+*
+*/
+class MPhoneViewCommandHandle
+    {
+    public:  // Constructors and destructor
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneViewCommandHandle(){};
+
+    public: // New functions
+        
+        /**
+        * Execute Command with given Command Id
+        * @param aCmdId Command Id
+        * @return None
+        */
+        virtual void ExecuteCommandL( 
+            TPhoneViewCommandId aCmdId ) = 0;
+
+        /**
+        * Execute Command with given Command Id  and Call Id
+        * @param aCmdId Command Id
+        * @param aCallId Call Id
+        * @return None
+        */
+        virtual void ExecuteCommandL( 
+            TPhoneViewCommandId aCmdId, 
+            TInt aCallId ) = 0;
+
+         /**
+        * Execute Command with given command id, call id and command parameter.
+        * @param aCmdId Command Id
+        * @param aCommandParam Command parameter
+        * @return None
+        */
+        virtual void ExecuteCommandL( 
+            TPhoneViewCommandId aCmdId, 
+            TPhoneCommandParam* aCommandParam ) = 0;
+
+         /**
+        * Execute Command with given command id, call id and command parameter.
+        * @param aCmdId Command Id
+        * @param aCallId Call Id
+        * @param aCommandParam Command parameter
+        * @return None
+        */
+        virtual void ExecuteCommandL( 
+            TPhoneViewCommandId aCmdId, 
+            TInt aCallId, 
+            TPhoneCommandParam* aCommandParam ) = 0;
+
+        /**
+        * Execute Command with given command id, call id and message.
+        * @param aCmdId Command Id
+        * @param aCallId Call Id
+        * @param aMessage Command message
+        */
+        virtual void ExecuteCommandL( 
+            TPhoneViewCommandId aCmdId, 
+            TInt aCallId, 
+            TDesC& aMessage ) = 0;
+
+        /**
+        * Handle Command with given Command Id
+        * @param aCmdId Command Id
+        * @return TPhoneViewResponseId
+        */
+        virtual TPhoneViewResponseId HandleCommandL( 
+            TPhoneViewCommandId aCmdId ) = 0;
+
+        /**
+        * Handle Command with given command id and command parameter.
+        * @param aCmdId Command Id
+        * @param aCommandParam Command parameter
+        * @return TPhoneViewResponseId
+        */
+        virtual TPhoneViewResponseId HandleCommandL( 
+            TPhoneViewCommandId aCmdId, 
+            TPhoneCommandParam* aCommandParam ) = 0;
+            
+        /**
+        * Execute Command with given Command Id
+        * @param aCmdId Command Id
+        * @return None
+        */
+        virtual void ExecuteCommand( 
+            TPhoneViewCommandId aCmdId ) = 0;
+            
+        /**
+        * Execute Command with given command id and command parameter.
+        * @param aCmdId Command Id
+        * @param aCommandParam Command parameter
+        * @return None
+        */
+        virtual void ExecuteCommand( 
+            TPhoneViewCommandId aCmdId, 
+            TPhoneCommandParam* aCommandParam ) = 0;                        
+       
+        /**
+        * Execute Command with given Command Id
+        */     
+        virtual const TDesC& FetchContent() = 0;          
+    };
+
+#endif // MPHONEVIEWCOMMANDHANDLE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/mphoneviewcustomization.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class for view control customization.
+*
+*/
+
+
+#ifndef MPHONEVIEWCUSTOMIZATION_H
+#define MPHONEVIEWCUSTOMIZATION_H
+
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecommandparam.h"
+#include "mphoneviewblockingdialogobserver.h"
+
+// CLASS DECLARATION
+/**
+*  Interface class for view control customization.
+*/
+class MPhoneViewCustomization
+    {
+public:
+    /**
+    * Handles custom view commands.
+    * @param aBlockingObserver Blocking dialog observer. Sets blocking dialog 
+    *                          value (by this param) for view controller when
+    *                          handle command needs to show blocking
+    *                          dialogs on the screen.
+    * @param aCmdId Command id.
+    * @param aCommandParam Command param.
+    * @return ETrue if command handled.
+    */
+    virtual TBool HandleCommandL(
+                    MPhoneViewBlockingDialogObserver& aBlockingObserver,
+                    TPhoneViewCommandId aCmdId,
+                    TPhoneCommandParam* aCommandParam ) = 0;
+    
+
+    /**
+    * Removes dialogs.
+    */
+    virtual void RemoveDialog() = 0;
+
+    };
+    
+#endif // MPHONEVIEWCUSTOMIZATION_H
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phonebubblewrapper.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,125 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bubble wrapper.
+*
+*/
+
+#ifndef PHONEBUBBLEWRAPPER_H
+#define PHONEBUBBLEWRAPPER_H
+
+#include <exception> // must be before e32base.h so uncaught_exception gets defined
+#include <e32base.h>
+#include <QObject>
+#include <QMap>
+
+class BubbleManagerIF;
+class HbAction;
+
+class PhoneBubbleWrapper : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    /**
+     * Constructor
+     */
+    PhoneBubbleWrapper (BubbleManagerIF& bubble, QObject *parent = 0);
+    
+    /**
+     * Destructor
+     */
+    virtual ~PhoneBubbleWrapper ();
+    
+    void updateCallState (int callId, int newState);
+    
+    int callId (int state);
+    
+    int createCallHeader (int callId);
+
+    void removeCallHeader (int callId);
+    
+    void setState (int callId, int bubble, int callState);
+    
+    void setLabel (int bubble, const TDesC &text);
+    
+    void setCli (int bubble, const TDesC &cliText);
+    
+    void setSecondaryCli (int bubble, const TDesC &cliText);
+    
+    void setCallType (int bubble, int callType);
+
+    BubbleManagerIF& bubbleManager ();
+    
+    int bubbleId (int callId);
+    
+    void setDivert (int bubble, bool enabled);
+    
+    void setCiphering(int bubble, bool indicatorAllowed, bool enabled);
+
+    int activeCallCount();    
+    
+    QMap<int, int> callStates() const;
+    
+    QMap<int, int> bubbles() const;
+    
+    int createConferenceBubble(int callId, int callState,
+            const TDesC &labelText, const TDesC &cliText);
+    
+    void setConferenceCallId(int callId);
+    
+    QList<int> conferenceCallList() const;
+    
+    void removeConferenceCallId(int callId);
+    
+    bool conferenceCallId(int callId) const;
+    
+    void removeCallFromConference(int callId);
+    
+    void removeConferenceBubble();
+    
+    int callIdByBubbleId(int bubbleId);
+    
+    void addToConferenceBubble();
+    
+    void setServiceId(int callId, int serviceId);
+    
+    int serviceIdByCallId(int callId) const;
+    
+    QMap<int,int> serviceIds() const;
+    
+private:
+
+    int callIdForConference();
+    
+    bool getCallIdsForConference(int &first, int &second);
+    
+private:
+
+    BubbleManagerIF& m_bubbleManager;
+    
+    // Call id - call state map
+    QMap<int, int> m_callStates;
+    
+    // Call id - bubble id map
+    QMap<int, int> m_bubbles;
+    
+    // Call id - service id map
+    QMap<int, int> m_services;
+    
+    // Conference call id list
+    QList<int>     m_conferenceList;
+};
+
+#endif // PHONEBUBBLEWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phonecommandextensionwrapper.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,136 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Wraps phone menu extensions.
+*
+*/
+
+#ifndef PHONECOMMANDEXTENSIONWRAPPER_H
+#define PHONECOMMANDEXTENSIONWRAPPER_H
+
+#include <QObject>
+#include <QString>
+#include <hbaction.h>
+#include <xqteluicommandextension.h>
+
+
+class PhoneCommandExtensionWrapper : public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    /*!
+        \fn PhoneMenuExtensionWrapper (QObject *parent)
+    */
+    PhoneCommandExtensionWrapper(int pluginUid);
+        
+    /*!
+        Destructor
+     */
+    virtual ~PhoneCommandExtensionWrapper();
+    
+    /*!
+        \fn void showGlobalNote ()
+        
+        This method shows global note.
+
+    */
+    int pluginUid();
+
+    /*!
+        \fn void modifyMenuItemList(QList<int> &menuCmdList)
+        
+        Modifies menu command list. List contains current list
+        of menu commands. Interface can add new commands which should be hanled
+        by call handling or remove commands if list contains unsupported call
+        commands.
+    */
+    void modifyMenuCommandList(
+            const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+            QList<int> &menuCmdList);
+
+    /*!
+        \fn void modifyButtonCommandList(QList<int> &menuCmdList)
+        
+        Modifies push button command list. CallInfo contains current call 
+        information and buttonCmdList contains current list of push 
+        button commands. 
+        Interface can remove commands if list contains unsupported call
+        commands (For example if service doesn't support conference call)
+        or add commads which should be handled by telephony call 
+        handling (maximum amount of push button commands is two).
+    */
+    void modifyPushButtonCommandList(
+            const QList<XQTelUiCommandExtension::CallInfo> &callInfo, 
+            QList<int> &buttonCmdList);
+    
+    /*!
+        \fn void addMenuActions(QList<HbAction*> &menuActions)
+        
+        Adds actions to menu. Interface adds own actions to the list which
+        should be added to the call menu. 
+        Interface is the responsible for handling action triggers.
+        Ownership of the actions in not transferred.
+    */
+    void addMenuActions(
+            const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+            QList<HbAction*> &menuActions);
+    
+    /*!
+        \fn void releaseMenu()
+        
+        Releases menu actions. Method is called when menu is not needed
+        anymore and interface can release own menu actions.
+    */
+    void releaseMenu();
+    
+    /*!
+        \fn void release()
+        
+        Releases plugin. Method is called when menu plugin is not needed
+        anymore and interface can release all resources.
+    */
+    void release();
+
+    /*!
+        \fn void getCallInfoList()
+        
+        Gets call list information by call state and
+        service id map.
+    */
+    void getCallInfoList( QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+                          QMap<int,int> callStates, 
+                          QMap<int,int> serviceIds, 
+                          int expandedCall);
+    
+private:
+        
+    /*!
+        \fn void mapCallState()
+        
+        Converts phoneengine call state to ui command extension
+        call state.
+        
+        returns converted call state.
+    */
+    XQTelUiCommandExtension::CallState mapCallState( int callState );
+    
+private:
+
+    XQTelUiCommandExtension *m_plugin;
+    int m_pluginUid;
+    
+};
+
+#endif // PHONECOMMANDEXTENSIONWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phoneindicatorcontroller.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*!
+* 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:  Handles phone indicators.
+*/
+
+#ifndef PHONEINDICATORCONTROLLER_H_
+#define PHONEINDICATORCONTROLLER_H_
+
+
+#include <QObject>
+#include <xqsettingsmanager.h>
+#include <hbindicator.h>
+
+// FORWARD DECLARATION
+class LogsModel;
+class LogsFilter;
+class PhoneIndicatorController : public QObject
+    {
+    Q_OBJECT
+public:
+    PhoneIndicatorController(QObject *parent = 0);
+    virtual ~PhoneIndicatorController();
+    
+    void setActiveCallData( const TDesC &text, const TDesC &icon );
+    void clearActiveCallData();
+    void enableActiveCallIndicator();
+    void disableActiveCallIndicator();
+    
+private slots:
+    void updateMissedCallIndicator(const XQSettingsKey &key, const QVariant &value);
+    void setMissedallIndicatorData();
+    
+private:
+    HbIndicator m_indicator;
+    LogsModel  *m_logsModel;
+    LogsFilter *m_missedCallsFilter;
+    XQSettingsManager * m_setManager;
+    
+    QString m_cli;
+    QString m_callImage;
+    };
+
+#endif /* PHONEINDICATORCONTROLLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phonemessagecontroller.h	Fri Jun 04 10:19:18 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:  Handles message editor.
+*
+*/
+
+#ifndef PHONEMESSAGECONTROLLER_H
+#define PHONEMESSAGECONTROLLER_H
+
+#include <QObject>
+#include <QString>
+#include "tphonecmdparamnote.h"
+
+// FORWARD DECLARATION
+class TPhoneCommandParam;
+
+class PhoneMessageController : public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    /*!
+        \fn PhoneMessageController (QObject *parent)
+    */
+    PhoneMessageController(QObject *parent = 0);
+        
+    /*!
+        Destructor
+     */
+    virtual ~PhoneMessageController();
+    
+    /*!
+        \fn void openSoftRejectMessageEditor()
+        
+        This method opens soft reject message editor.
+
+    */
+    void openSoftRejectMessageEditor(TPhoneCommandParam *commandParam);
+ 
+private:
+    
+    /*!
+        \fn void showNote ()
+        
+        This method opens message editor.
+
+    */
+    void openEditor(QString toField, QString name, QString messageBody = QString());
+    
+};
+
+#endif // PHONEMESSAGECONTROLLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phonenotecontroller.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,198 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Handles phone notes.
+*
+*/
+
+#ifndef PHONENOTECONTROLLER_H
+#define PHONENOTECONTROLLER_H
+
+#include <QObject>
+#include <QString>
+#include "tphonecmdparamnote.h"
+#include "phoneaction.h"
+
+// FORWARD DECLARATION
+class TPhoneCommandParam;
+class TPhoneCmdParamQuery;
+class HbDeviceMessageBox;
+class HbDeviceProgressDialog;
+class HbProgressDialog;
+class HbMessageBox;
+class HbAction;
+class QSignalMapper;
+class QTimer;
+
+
+class PhoneNoteController : public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    /*!
+        \fn PhoneNoteController (QObject *parent)
+    */
+    PhoneNoteController(QObject *parent = 0);
+        
+    /*!
+        Destructor
+     */
+    virtual ~PhoneNoteController ();
+    
+    /*!
+        \fn void showGlobalNote ()
+        
+        This method shows global note.
+
+    */
+    void showGlobalNote(TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn void showNote ()
+        
+        This method shows a note.
+
+    */
+    void showNote(TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void showNote ()
+        
+        This method shows a query.
+
+    */
+    void showQuery(TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void removeDtmfNote ()
+        
+        This method removes dtmf note.
+
+    */
+    void removeDtmfNote();
+    
+    /*!
+        \fn void removeNote()
+        
+        This method removes notes.
+
+    */
+    void removeNote();
+    
+    /*!
+        \fn void removeQuery()
+        
+        This method removes queries.
+
+    */
+    void removeQuery();
+    
+    /*!
+        \fn void removeGlobalWaitNote()
+        
+        This method removes global wait note.
+
+    */
+    void removeGlobalWaitNote();
+    
+signals:
+
+    /*!
+        \fn void command(int command)
+        
+        This signal is emitted when note action is handled.
+    */
+    void command (int command);
+    
+private slots:
+
+    /*!
+        \fn void destroyDialog ()
+        
+        Slot is called when global note is closed.
+    
+    */
+    void destroyDialog();
+
+    /*!
+        \fn void removeMappings ()
+        
+        Slot is called when note or query is closed.
+    
+    */
+    void removeMappings();
+    
+    /*!
+        \fn void queryCancelled ()
+        
+        Slot is called when query is canceled.
+    
+    */
+    void queryCancelled();
+  
+    /*!
+        \fn void queryTimeout ()
+        
+        Slot is called when query timeout expires.
+    
+    */
+    void queryTimeout();
+    
+private:
+
+    /*!
+        \fn QString globalNoteText()
+        
+        This method returns text for global note.
+    */
+    QString globalNoteText(TPhoneCommandParam *commandParam);
+    
+    
+    /*!
+        \fn void showDtmfNote()
+        
+        This method shows dtmf sending note.
+    */
+    void showDtmfNote(TPhoneCmdParamNote* noteParam);
+    
+    /*!
+        \fn void showDefaultQuery()
+        
+        This method shows default query.
+    */
+    void showDefaultQuery(TPhoneCmdParamQuery* params);
+
+    /*!
+        \fn void showDefaultQuery()
+        
+        This method shows global wait note.
+    */
+    void showGlobalWaitNote(TPhoneCmdParamQuery* params);
+    
+private:
+
+    QTimer *m_timer;
+    QList<HbDeviceMessageBox *> m_messageBoxList;
+    HbDeviceProgressDialog *m_progressDialog;
+    HbProgressDialog *m_dtmfNote;
+    HbMessageBox *m_queryNote;
+    QSignalMapper *m_signalMapper;
+    QList<HbAction*> m_actions;
+    int m_queryCanceledCommand;
+    int m_timeoutCommand;
+    
+};
+
+#endif // PHONENOTECONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phoneresourceadapter.h	Fri Jun 04 10:19:18 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:  Converts Symbian resources PhoneAction objects.
+*
+*/
+
+#ifndef PHONERESOURCEADAPTER_H
+#define PHONERESOURCEADAPTER_H
+
+#include <QObject>
+#include <QMap>
+#include "phoneaction.h"
+
+#ifdef BUILD_PHONEUIQTVIEWADAPTER
+#define PHONEURESOURCEADAPTER_EXPORT Q_DECL_EXPORT
+#else
+#define PHONEURESOURCEADAPTER_EXPORT Q_DECL_IMPORT
+#endif
+
+class PhoneUIQtButtonsController;
+class HbAction;
+
+class PHONEURESOURCEADAPTER_EXPORT PhoneResourceAdapter : public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    /*!
+        \fn Instance (QObject *parent)
+        
+        This method is a Singleton Design Pattern's way to get
+        instance of this class.
+    */
+    static PhoneResourceAdapter* Instance (QObject *parent = 0);
+        
+    /*!
+        Destructor
+     */
+    virtual ~PhoneResourceAdapter ();
+    
+    /*!
+        \fn PhoneUIQtButtonsController* buttonsController ()
+        
+        This method returns the pointer to buttons controller object
+        
+        Returns pointer to buttons controller.
+    */
+    PhoneUIQtButtonsController* buttonsController ();
+    
+    /*!
+        \fn QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId)
+        
+        This method converts given Symbian resource id to mapping of translated
+        texts, actions etc.
+        
+        Returns map of actions.
+    */
+    QMap<PhoneAction::ActionType, PhoneAction *> convert (int symbianResourceId, ...);
+ 
+    /*!
+        \fn QString PhoneResourceAdapter::convert (int symbianResourceId)
+        
+        This method converts given Symbian resource id to QString.
+        
+        Returns QString.
+    */
+    QString convertToString(int symbianResourceId) const;
+
+    /*!
+        \fn QString PhoneResourceAdapter::convert (int symbianResourceId, QString text )
+        
+        Converts given Symbian resource id to QString and formats given text to
+        resource converted text.
+        
+        Returns QString.
+    */   
+    QString convertToString(int symbianResourceId, const QString &text) const;
+    
+    /*!
+        \fn int PhoneResourceAdapter::defaultToolbarResourceId ()
+        
+        Returns default toolbar resource id.
+    */    
+    int defaultToolbarResourceId() const;
+    
+    /*!
+        \fn QString PhoneResourceAdapter::convertCommandToString()
+        
+        Converts given Symbian command id to QString.
+        
+        Returns QString.
+    */ 
+    QString convertCommandToString(int symbianCommandId) const;
+
+    /*!
+        \fn QString PhoneResourceAdapter::convertToHbActions()
+        
+        Converts given Symbian command id to HbAction list.
+        
+        Returns HbAction list.
+    */ 
+    QList<HbAction*> convertToHbActions(int symbianResourceId) const;
+    
+protected:    
+
+    /*!
+        Constructor
+     */
+    PhoneResourceAdapter (QObject *parent = 0);
+
+private:
+
+    PhoneUIQtButtonsController* m_buttonsCtrl; // Own
+    
+};
+
+#endif // PHONERESOURCEADAPTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phoneuicommandcontroller.h	Fri Jun 04 10:19:18 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:  Handles phone ui commands.
+*
+*/
+
+#ifndef PHONEUICOMMANDCONTROLLER_H
+#define PHONEUICOMMANDCONTROLLER_H
+
+#include <QObject>
+#include <QString>
+#include <hbmenu.h>
+#include <spdefinitions.h>
+#include "phonecommandextensionwrapper.h"
+#include "phoneuiqtviewif.h"
+#include "phoneaction.h"
+
+// FORWARD DECLARATION
+class HbAction;
+
+class PhoneUiCommandController : public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    /*!
+        \fn PhoneUiCommandController(
+            PhoneUIQtViewIF &m_view, QObject *parent)
+    */
+    PhoneUiCommandController(PhoneUIQtViewIF &view, QObject *parent = 0);
+        
+    /*!
+        Destructor
+     */
+    virtual ~PhoneUiCommandController();
+    
+    /*!
+        \fn void showGlobalNote()
+        
+        Sets call menu actions.
+
+    */
+    void setCallMenuActions(QMap<int,int> callStates,
+                            QMap<int,int> serviceIds,
+                            int serviceId,
+                            int expandedCallId);
+
+    /*!
+        \fn void setDialpadMenuActions ()
+        
+        Sets dialpad menu actions.
+
+    */
+    void setDialpadMenuActions();
+    
+    /*!
+        \fn void pushButtonActionsForCall ()
+        
+        Returns push button actions actions for call.
+
+    */
+    QMap<PhoneAction::ActionType, PhoneAction *> pushButtonActionsForCall( 
+            int callState,
+            bool emergencyCall,
+            QMap<int,int> callStates,
+            QMap<int,int> serviceIds,
+            int serviceId,
+            int callId);
+    
+private:
+
+    /*!
+        \fn QList<int> menuCommands()
+        
+        Returns list of current menu commands.
+
+    */
+    QList<int> menuCommands(
+            QMap<int,int> callStates, QMap<int,int> serviceIds );
+    
+    /*!
+        \fn void addMenuItems()
+        
+        Adds menu commands to menu.
+    */
+    void addMenuItems(QList<int> menuCmdList);
+    
+    /*!
+        \fn int mapCommand()
+        
+        Maps ui command extension commands to
+        phone app commands.
+    */
+    int mapCommand(int command);
+    
+    /*!
+        \fn void commandExtension()
+        
+        Returns command extension by service id (null if
+        extension not available).
+    */
+    PhoneCommandExtensionWrapper *commandExtension(int serviceId);
+
+    /*!
+        \fn void ResolveImplementationUidL()
+        
+        Returns service's plugin uid by service id.
+    */
+    TUid ResolveImplementationUidL( 
+            TUint32 aServiceId, TServicePropertyName aPropertyName );
+    
+    /*!
+        \fn void MenuExtensionL()
+        
+        Returns command extension by service id (null if
+        extension not available).
+    */
+    PhoneCommandExtensionWrapper *CommandExtensionL( TUint aServiceId );
+    
+    /*!
+        \fn void releaseMenu()
+        
+        Releases extensions menu.
+    */
+    void releaseMenu();
+       
+    /*!
+        \fn void areServicesSame()
+        
+        Checks are all calls made by same service (id).
+        Returns true when same service used.
+    */
+    bool areServicesSame(QMap<int,int> callStates, QMap<int,int> serviceIds);
+    
+    /*!
+        \fn void buttonCommandList()
+        
+        Returns push button command list.
+    */    
+    QList<int> buttonCommandList(int callState,
+            bool emergencyCall,
+            bool sameServices,
+            QList<int> callStates);
+    
+    /*!
+        \fn void buttonCommandList()
+        
+        Maps push button command to phone action.
+    */
+    PhoneAction *mapCommandToAction(int callState);
+    
+    
+    
+private:
+
+    PhoneUIQtViewIF &m_view;
+    QList<HbAction *> m_customMenuActions;
+    QList<PhoneCommandExtensionWrapper *> m_commandExtensions;
+    PhoneCommandExtensionWrapper *m_lastCommandExtension;
+    
+};
+
+#endif // PHONEUICOMMANDCONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phoneuiqtbuttonscontroller.h	Fri Jun 04 10:19:18 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:  Buttons controller for storing and getting
+*               buttons' states
+*
+*/
+
+#ifndef PHONEUIQTBUTTONSCONTROLLER_H
+#define PHONEUIQTBUTTONSCONTROLLER_H
+
+#include <QObject>
+
+class PhoneUIQtButtonsController : public QObject
+{
+    Q_OBJECT
+
+public:
+    
+    enum PhoneButtonFlag
+    {
+        Hold            = 0x02, // Hold
+        Ihf             = 0x04, // Ihf
+        Wired           = 0x08, // Wired
+        Btaa            = 0x10, // Btaa
+        DisableJoin     = 0x20  // Should join option be disabled
+    };
+    Q_DECLARE_FLAGS(PhoneButtonFlags, PhoneButtonFlag)
+
+    /**
+     * Constructor
+     */
+    PhoneUIQtButtonsController ();
+
+    /**
+     * Destructor
+     */
+    virtual ~PhoneUIQtButtonsController ();
+
+    /*!
+        \fn void PhoneUIQtButtonsController::setButtonFlags (PhoneButtonFlags flag,bool set)
+        
+        This method is called when audio path or hold status is changed
+    */
+    void setButtonFlags (PhoneButtonFlags flag,bool set);
+
+    /*!
+        \fn bool PhoneUIQtButtonsController::getButtonFlags (PhoneButtonFlags flag)
+        
+        This method is called when audio path or hold status is enquired
+    */
+    inline bool getButtonFlags (PhoneButtonFlags flag) {return m_buttonFlags & flag;};
+
+private:
+    PhoneButtonFlags m_buttonFlags;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(PhoneUIQtButtonsController::PhoneButtonFlags)
+
+#endif // PHONEUIQTBUTTONSCONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phoneuiqtviewadapter.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,558 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone UI's symbian adapter for Qt view.
+*
+*/
+
+#ifndef PHONEUIQTVIEWADAPTER_H
+#define PHONEUIQTVIEWADAPTER_H
+
+#ifdef BUILD_PHONEUIQTVIEWADAPTER
+#define PHONEUIQTVIEWADAPTER_EXPORT Q_DECL_EXPORT
+#else
+#define PHONEUIQTVIEWADAPTER_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <QMap>
+#include <apgwgnam.h>
+#include "mphoneviewcommandhandle.h"
+#include "mphonepubsubobserver.h"
+#include "phoneaction.h"
+
+class PhoneUIQtViewIF;
+class PhoneBubbleWrapper;
+class CPhoneRingingToneController;
+class PhoneResourceAdapter;
+class PhoneUIQtButtonsController;
+class PhoneNoteController;
+class PhoneMessageController;
+class PhoneUiCommandController;
+class TelephonyService;
+class QKeyEvent;
+class PhoneIndicatorController;
+
+class PHONEUIQTVIEWADAPTER_EXPORT PhoneUIQtViewAdapter : 
+    public QObject, 
+    public MPhoneViewCommandHandle,
+    public MPhonePubSubObserver
+{
+    Q_OBJECT
+
+public:
+
+    /**
+     * Constructor
+     */
+    explicit PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent = 0);
+    
+    /**
+     * Destructor
+     */
+    virtual ~PhoneUIQtViewAdapter();
+
+    
+public: // From MPhoneViewCommandHandle
+
+    /**
+    * Execute Command with given Command Id
+    * @param aCmdId Command Id
+    * @return None
+    */
+    void ExecuteCommandL (TPhoneViewCommandId aCmdId);
+
+    /**
+    * Execute Command with given Command Id  and Call Id
+    * @param aCmdId Command Id
+    * @param aCallId Call Id
+    * @return None
+    */
+    void ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId);
+
+     /**
+    * Execute Command with given command id, call id and command parameter.
+    * @param aCmdId Command Id
+    * @param aCommandParam Command parameter
+    * @return None
+    */
+    void ExecuteCommandL (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam);
+
+     /**
+    * Execute Command with given command id, call id and command parameter.
+    * @param aCmdId Command Id
+    * @param aCallId Call Id
+    * @param aCommandParam Command parameter
+    * @return None
+    */
+    void ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
+        TPhoneCommandParam* aCommandParam);
+
+    /**
+    * Execute Command with given command id, call id and message.
+    * @param aCmdId Command Id
+    * @param aCallId Call Id
+    * @param aMessage Command message
+    */
+    void ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId, TDesC& aMessage);
+
+    /**
+    * Handle Command with given Command Id
+    * @param aCmdId Command Id
+    * @return TPhoneViewResponseId
+    */
+    TPhoneViewResponseId HandleCommandL (TPhoneViewCommandId aCmdId);
+
+    /**
+    * Handle Command with given command id and command parameter.
+    * @param aCmdId Command Id
+    * @param aCommandParam Command parameter
+    * @return TPhoneViewResponseId
+    */
+    TPhoneViewResponseId HandleCommandL (TPhoneViewCommandId aCmdId, 
+        TPhoneCommandParam* aCommandParam);
+        
+    /**
+    * Execute Command with given Command Id
+    * @param aCmdId Command Id
+    * @return None
+    */
+    void ExecuteCommand (TPhoneViewCommandId aCmdId);
+        
+    /**
+    * Execute Command with given command id and command parameter.
+    * @param aCmdId Command Id
+    * @param aCommandParam Command parameter
+    * @return None
+    */
+    void ExecuteCommand (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam);
+   
+    /**
+    * Execute Command with given Command Id
+    */     
+    const TDesC& FetchContent ();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::noteController ()
+        
+        Returns pointer to PhoneNoteController
+    */
+    PhoneNoteController* noteController() const;
+    
+public: // from MPhonePubSubObserver
+
+        /**
+        * This function is called when there is property value change.
+        * @param aCategory Category of the property
+        * @param aKey Property key that is changed
+        * @param aValue New property value
+        */
+        void HandlePropertyChangedL( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue);
+    
+
+private slots:
+
+    /*!
+        \fn void PhoneUIQtViewAdapter::dialpadClosed ()
+        
+        PhoneView calls this method when dialpad
+        is going to be closed.
+    */
+    void dialpadClosed();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::keyPressed ()
+        
+        PhoneView calls this method when key press is released.
+    */
+    void keyReleased(QKeyEvent *event);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::handleWindowActivated ()
+        
+        PhoneView calls this method when window is activated;
+    */
+    void handleWindowActivated();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::handleWindowDeactivated ()
+        
+        PhoneView calls this method when window is deactivated.
+    */
+    void handleWindowDeactivated();
+    
+private:
+
+    /*!
+        \fn void PhoneUIQtViewAdapter::setTopApplication (TPhoneCommandParam *)
+        
+        This method is called when EPhoneViewSetTopApplication or
+        EPhoneViewSetIdleTopApplication command is received.
+    */
+    void setTopApplication (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn int PhoneUIQtViewAdapter::idleAppUid()
+        
+        This method fetches Idle application's Id from PubSub and returns it.
+    */
+    int idleAppUid();
+
+    /*!
+        \fn int PhoneUIQtViewAdapter::createCallHeader()
+        
+        This method creates new call header.
+    */
+    void createCallHeader (int callId, TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn int PhoneUIQtViewAdapter::createCallHeader()
+        
+        This method creates new call header.
+    */
+    void createEmergencyCallHeader (int callId, TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn int PhoneUIQtViewAdapter::updateCallHeader()
+        
+        This method updates call state information in call header.
+    */
+    void updateCallHeaderState (int callId, TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn int PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo()
+        
+        This method updates remote information in call header.
+    */
+    void updateCallHeaderRemoteInfo (int callId, TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn int PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo()
+        
+        This method updates remote information in call header and label.
+    */
+    void updateCallHeaderRemoteInfoAndLabel (int callId, TPhoneCommandParam *commandParam);    
+
+    /*!
+        \fn int PhoneUIQtViewAdapter::handleCipheringInfoChange()
+        
+        This method updates ciphering indicators.
+    */
+    void handleCipheringInfoChange(int callId, TPhoneCommandParam *commandParam);    
+    
+    /*!
+        \fn int PhoneUIQtViewAdapter::callIdByState()
+        
+        This method writes to commandParam the call id matching
+        given call state.
+        
+        Returns EPhoneViewResponseSuccess operation is succesful
+        otherwise EPhoneViewResponseFailed.
+    */
+    TPhoneViewResponseId callIdByState (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setTouchButtons (TPhoneCmdParam *commandParam)
+        
+        This method sets buttons to call bubble.        
+    */
+    void setTouchButtons (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setToolbarButtons (TPhoneCmdParam *commandParam)
+        
+        This method sets buttons to toolbar.        
+    */
+    void setToolbarButtons (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setCallHoldFlag (TPhoneCmdParam *commandParam)
+        
+        This method sets flag telling is the call hold or not.
+    */
+    void setCallHoldFlag (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::callHoldFlag (TPhoneCmdParam *commandParam)
+        
+        This method retrieves flag telling is the call hold or not and writes
+        it into given command parameter.
+    */
+    void callHoldFlag (TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn void PhoneUIQtViewAdapter::writeAudioVolumeLevel (TPhoneCmdParam *commandParam)
+        
+        This method writes audio volume value into given command parameter.
+    */
+    void writeAudioVolumeLevel (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setAudioVolumeSliderValue (TPhoneCmdParam *commandParam)
+        
+        This method sets volume value to view.
+    */
+    void setAudioVolumeSliderValue (TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn void PhoneUIQtViewAdapter::setMuteIndication (TPhoneCmdParam *commandParam)
+        
+        This method sets muted indication to view.
+    */
+    void setMuteIndication (TPhoneCommandParam *commandParam);
+    
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::callHoldFlag (TPhoneCmdParam *commandParam)
+        
+        This method retrieves number of calls. Conference call counts one call, 
+        participant calls are not count.
+    */
+    void activeCallCount (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setAudioPath (TPhoneCommandParam *commandParam)
+        
+        This method sets audio paths
+    */
+    void setAudioPath (TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::expandedBubbleCallId(TPhoneCommandParam *commandParam)
+        
+        This method gets call id of the expanded call bubble.
+    */
+    void expandedBubbleCallId(TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn void openDialpad()
+        
+        This method opens dialpad.
+    */
+    void openDialpad();
+    
+    /*!
+        \fn int PhoneUIQtViewAdapter::createConference()
+        
+        This method creates conference bubble.
+    */
+    void createConferenceBubble(int callId, TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn int PhoneUIQtViewAdapter::conferenceCallId()
+        
+        This method checks if call id belongs to conference call.
+    */
+    void conferenceCallId(int callId, TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn int PhoneUIQtViewAdapter::removeConferenceBubble()
+        
+        This method removes conference bubble.
+    */
+    void removeConferenceBubble();
+
+    /*!
+        \fn int PhoneUIQtViewAdapter::isConference()
+        
+        This method checks is conference bubble active.
+    */
+    void isConference(TPhoneCommandParam *commandParam);
+
+    /*!
+        \fn int PhoneUIQtViewAdapter::removeCallFromConference()
+        
+        This method removes a call from conference.
+    */
+    void removeCallFromConference(int callId);
+
+    /*!
+        \fn TPhoneViewResponseId PhoneUIQtViewAdapter::getSelectedConferenceMember()
+        
+        This method gets call id of selected conference member.
+        Used in drop and private commands. 
+    */
+    TPhoneViewResponseId getSelectedConferenceMember(
+            TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setPrivateFromConference()
+        
+        This method removes call from converence bubble.
+        Used in private command. 
+    */   
+    void setPrivateFromConference(int callId);
+
+    /*!
+        \fn void PhoneUIQtViewAdapter::setExpandActions()
+        
+        This method sets expand action if needed. 
+    */ 
+    void setExpandActions();
+
+    /*!
+        \fn void PhoneUIQtViewAdapter::setParticipantListActions()
+        
+        This method sets participant list actions if needed. 
+    */
+    void setParticipantListActions();
+
+    /*!
+        \fn void PhoneUIQtViewAdapter::setExpandedConferenceCallHeader()
+        
+        This method sets conference call header expanded if needed. 
+    */
+    void setExpandedConferenceCallHeader();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::bringToForeground()
+        
+        This method brings application to foreground.
+    */
+    void bringToForeground();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::showGlobalNote()
+        
+        This method shows global note.
+    */
+    void showGlobalNote(TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::callsExists()
+        
+        This method checks if there are calls in given states.
+    */
+    bool callsExists(int call1State, int call2State);
+ 
+    /*!
+        \fn void PhoneUIQtViewAdapter::setDialpadVisibility()
+        
+        This method sets dialpad visibility.
+    */
+    void setDialpadVisibility(TPhoneCommandParam *commandParam);
+ 
+    /*!
+        \fn void PhoneUIQtViewAdapter::removeAllCallHeaders()
+        
+        This method removes all call headers.
+    */
+    void removeAllCallHeaders();
+ 
+    /*!
+        \fn void PhoneUIQtViewAdapter::getNumberFromDialpad()
+        
+        This method gets number from dialpad.
+    */
+    void getNumberFromDialpad(TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::getNumberEntryStringLength()
+        
+        This method gets text length from the dialpad.
+    */
+    void getDialpadStringLength(TPhoneCommandParam *commandParam);
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::getNumberEntryStringLength()
+        
+        This method clears and removes dialpad from the view.
+    */
+    void removeDialpad();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::addToConference()
+        
+        This method adds call to conference.
+    */
+    void addToConference();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setMenu()
+        
+        This method sets actions for menu.
+    */
+    void setMenu();
+  
+    /*!
+        \fn void PhoneUIQtViewAdapter::setMenu()
+        
+        This method sets actions for menu in call handling view.
+    */
+    void setCallMenu();
+    
+    /*!
+        \fn void PhoneUIQtViewAdapter::setMenu()
+        
+        This method sets actions for menu in dialpad view.
+    */
+    void setDialpadMenu();
+    
+    /*!
+        \fn int PhoneUIQtViewAdapter::showNote()
+        
+        This method shows a note by command params.
+    */
+    void showNote(TPhoneCommandParam *commandParam);
+    
+	/*!
+	    /fn QString convertDuration(int)
+		This method returns the localized call duration
+    */
+    QString convertDuration(int seconds);
+ 
+    /*!
+        /fn void setBubbleSelectionFlag()
+        This method sets bubble selection flag.
+    */
+    void setBubbleSelectionFlag();
+    
+    /*!
+        /fn void setHidden()
+        This method sets hidden status.
+    */    
+    void setHidden(bool hidden);
+    
+    /*!
+        /fn void SetHiddenL()
+        This method sets hidden status.
+    */
+    void SetHiddenL(bool hidden);
+    
+    /*!
+        /fn void openContacts()
+        This method opens contacts application.
+    */    
+    void openContacts();
+    
+private:
+
+    PhoneUIQtViewIF &m_view;
+    int m_idleUid;
+    PhoneBubbleWrapper *m_bubbleWrapper;
+    CPhoneRingingToneController *m_ringingtonecontroller;
+    PhoneResourceAdapter *m_resourceAdapter;
+    PhoneNoteController *m_noteController;
+    TelephonyService *m_telephonyService;
+    PhoneUiCommandController *m_uiCommandController;
+    PhoneMessageController *m_messageController;
+    PhoneIndicatorController *m_indicatorController;
+    bool m_dialpadAboutToClose;
+    bool m_homeScreenToForeground;
+    bool m_carModeEnabled;
+};
+
+#endif // PHONEUIQTVIEWADAPTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/phoneviewcommanddefinitions.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,254 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   Common phone view command definitions.
+*
+*/
+
+
+#ifndef PHONEVIEWCOMMANDDEFINITIONS_H
+#define PHONEVIEWCOMMANDDEFINITIONS_H
+
+// INCLUDES
+
+#include "phoneconstants.h"
+
+// DATA TYPES
+
+typedef TInt TPhoneViewCommandId;
+
+enum
+{
+    EPhoneViewCreateNumberEntry = KPhoneViewCommandCommonFirst,
+    EPhoneViewSetNumberEntryContent,
+    EPhoneViewSendKeyEventToNumberEntry,
+    EPhoneViewRemoveNumberEntry,
+    EPhoneViewSetNumberEntryVisible,
+    EPhoneViewGetNumberFromEntry,
+    EPhoneViewGetNumberEntryCount,
+    EPhoneViewGetNumberEntryIsUsedStatus,
+    EPhoneViewGetNumberEntryIsVisibleStatus,
+    EPhoneViewToggleNumberEntryAlphaNumericMode, // 10
+    EPhoneViewIsNumberEntryNumericMode,
+    EPhoneViewClearNumberEntryContent,
+    EPhoneViewCreateCallHeader,
+    EPhoneViewCreateEmergencyCallHeader,
+    EPhoneViewUpdateCallHeaderRemoteInfoData,
+    EPhoneViewUpdateCallHeaderCallDuration,
+    EPhoneViewRemoveCallHeader,
+    EPhoneViewMenuBarOpen, //20
+    EPhoneViewMenuBarClose,
+    EPhoneViewDimCbaCommand,
+    EPhoneViewUpdateCba,
+    EPhoneViewUpdateBubble,
+    EPhoneViewMenuPane,
+    EPhoneViewMenuBar,
+    EPhoneViewSetTitlePaneContent,
+    EPhoneViewSetNaviPaneContent,
+    EPhoneViewSetTitlePanePicture,
+    EPhoneViewGetTitlePaneIsVisibleStatus, //30
+    EPhoneViewActivateAudioPathUIChanges,
+    EPhoneViewActivateAudioAvailabilityUIChanges,
+    EPhoneViewActivateMuteUIChanges,
+    EPhoneViewShowNote,
+    EPhoneViewShowGlobalNote,
+    EPhoneViewShowProgressNote,
+    EPhoneViewRemoveNote,
+    EPhoneViewRemoveProgressNote,
+    EPhoneViewRemoveGlobalNote,
+    EPhoneViewGetIsNoteVisible, // 40
+    EPhoneViewGetIsProgressNoteVisible,
+    EPhoneViewShowQuery,
+    EPhoneViewSetListQueryString,
+    EPhoneViewRemoveQuery,
+    EPhoneViewGetTextQueryContent,
+    EPhoneViewSetTopApplication,
+    EPhoneViewBringAppToForeground,
+    EPhoneViewSendToBackground,
+    EPhoneViewSetNeedToSendToBackgroundStatus,
+    EPhoneViewGetNeedToSendToBackgroundStatus, // 50
+    EPhoneViewGetTopApplicationIsDisplayedStatus,
+    EPhoneViewGetForegroundApplication,
+    EPhoneViewSetBackgroundImageBitmap,
+    EPhoneViewGetBackgroundImageBitmap,
+    EPhoneViewActivateApp,
+    EPhoneViewActivateAppView,
+    EPhoneViewActivateAppViewWithCustomMessage,
+    EPhoneViewActivateAppViewConventional,
+    EPhoneViewLaunchApplication,
+    EPhoneViewLaunchHelpApplication,  // 60
+    EPhoneViewOpenMessageEditor,
+    EPhoneViewExitApplications,
+    EPhoneViewUpdateIncallIndicator,
+    EPhoneViewStartCapturingKey,
+    EPhoneViewStopCapturingKey,
+    EPhoneViewSetGlobalNotifiersDisabled,
+    EPhoneViewSetSpeedDialLocation, 
+    EPhoneViewGetNumberFromSpeedDialLocation,
+    EPhoneViewAssignSpeedDialLocation,
+    EPhoneViewGetHoldFlag,
+    EPhoneViewSetHoldFlag,
+    EPhoneViewSetSoftRejectFlag,
+    EPhoneViewGetSoftRejectFlag,
+    EPhoneViewSetServiceCodeFlag,
+    EPhoneViewUpdateContact, // 80
+    EPhoneViewAddContact,
+    EPhoneViewOpenSingleItemFetchDialog,
+    EPhoneViewRemovePhoneDialogs,
+    EPhoneViewCreateConference,
+    EPhoneViewAddToConference,
+    EPhoneViewRemoveFromConference,
+    EPhoneViewPrivateFromConference,
+    EPhoneViewSelectedConfMember,
+    EPhoneViewGetConferenceListVisibleFlag, 
+    EPhoneViewOpenConferenceList, // 90
+    EPhoneViewGetCallState,
+    EPhoneViewGetCallIdByState,
+    EPhoneViewMoveHighLightInList,
+    EPhoneViewGetCountOfActiveCalls,
+    EPhoneViewSetNaviPaneAudioVolume,
+    EPhoneViewShowNaviPaneAudioVolume,
+    EPhoneViewHideNaviPaneAudioVolume,
+    EPhoneViewGetIsConference,
+    EPhoneViewGetCallExistsInConference,
+    EPhoneViewRemoveAllCallHeaders,
+    EPhoneViewPlayRingTone,
+    EPhoneViewMuteRingTone,
+    EPhoneViewStopRingTone,
+    EPhoneViewMuteRingToneOnAnswer,
+    EPhoneViewCipheringInfoChange,
+    EPhoneViewUpdateMaxConfMemberFlag, // 110
+    EPhoneViewCloseFSW, 
+    EPhoneViewLaunchRfsDeep,
+    EPhoneViewLaunchRfsNormal,
+    EPhoneViewUpdateView,
+    EPhoneViewOpenSoftRejectEditor,
+    EPhoneViewSendMessage,
+    EPhoneViewSetBlockingDialogStatus,
+    EPhoneViewSetPhoneNumberAvailableInPhoneEngine,
+    EPhoneViewSetSecurityMode,
+    EPhoneViewGetSecurityModeStatus, // 120
+    EPhoneViewSetStatusPaneVisible, 
+    EPhoneViewEnableKeyLock,
+    EPhoneViewEnableKeyLockWithoutNote,
+    EPhoneViewLaunchFaxModem,
+    EPhoneViewUpdateFSW,
+    EPhoneViewIsQuery,
+    EPhoneViewBringIdleToForeground, 
+    EPhoneViewSetIdleTopApplication,  
+    EPhoneViewBeginUpdate,
+    EPhoneViewEndUpdate,   // 130
+    EPhoneViewSetConfrenceOptionsFlag,
+    EPhoneViewRemoveConferenceBubble,
+    EPhoneViewGetSoftRejectWindowGroupId,
+    EPhoneViewSetTouchPaneButtons,
+    EPhoneViewSetTouchPaneVisible,
+    EPhoneViewEnableTouchButton,
+    EPhoneViewDisableTouchButton, 
+    EPhoneResetTouchButtons, 
+    EPhoneViewGetIsConferenceInSelectionMode,
+    EPhoneViewIsStraightCallToVideoMailBox, // 140
+    EPhoneViewSetDtmfDialerViewVisible,
+    EPhoneViewSetRetrictedDialer,
+    EPhoneViewIsConferenceInExpandedMode,
+    EPhoneViewIsMenuBarVisible,
+    EPhoneViewGetBlockingDialogStatus,
+    EPhoneViewYesSingleItemFetch,
+    EPhoneViewNoSingleItemFetch, 
+    EPhoneViewGetLocalizedNumberFromEntry,
+    EPhoneViewIsNoteActive,
+    EPhoneViewOpenNumberEntry, //150
+    EPhoneViewOpenCallHandling,
+    EPhoneViewGetConferenceAndSingleFlag,
+    EPhoneViewSetConferenceAndSingleFlag,
+    EPhoneViewSetVideoCallFlag,
+    EPhoneViewSetDtmfOptionsFlag,
+    EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery,
+    EPhoneViewGetAudioVolumeLevel, 
+    EPhoneViewIsIdleTopApp,
+    EPhoneViewUpdateToolbar,
+    EPhoneViewSetControlAndVisibility, //160
+    EPhoneViewAllowWaitingCallHeader,
+    EPhoneViewBeginTransEffect,
+    EPhoneViewEndTransEffect,
+    EPhoneViewSetDialerControlVisible,
+    EPhoneViewCloseSingleItemFetchDialog,
+    EPhoneViewGetActivatePreviousApp,
+    EPhoneViewActivatePreviousApp, 
+    EPhoneViewSetPointerCapture,
+    EPhoneViewSetSendKeyDialerActivationFlag,
+    EPhoneViewPrepareIcons, //170
+    EPhoneViewKeypadAudioEnabled,
+    EPhoneViewKeypadAudioDisabled,
+    EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel,
+    EPhoneViewRemoveDtmfNote,
+    EPhoneViewUpdatePhoneIconToFSW,
+    EPhoneViewSetEikonNotifiersDisabled, 
+    EPhoneViewCancelAllNotications, 
+    EPhoneViewSetVideoCallDTMFVisibilityFlag,
+    EPhoneViewIsKeyLockEnabled,
+    EPhoneViewDisableKeyLock,
+    EPhoneViewLoadPlugins, // 170
+    EPhoneViewOpenVirtualKeyBoard,
+    EPhoneViewUpdateNoteSoftkeys,
+
+    EPhoneViewSendAiwCommand,
+    EPhoneViewShowCustomizedDialer,
+    EPhoneViewHideCustomizedDialer,
+    EPhoneViewGetCustomizedDialerMenuResourceId,
+    EPhoneViewGetCustomizedDialerCbaResourceId,
+    EPhoneViewCipheringInfoChangePlayTone,
+    EPhoneViewCreatePhoneBookServices,
+    EPhoneViewDisableKeyLockWithoutNote,
+    EPhoneViewGetKeyLockStatus,
+    EPhoneViewSetNumberEntryObserver,
+    EPhoneViewGetSingleItemFetchType,
+    EPhoneViewRemoveGlobalWaitNote,
+    EPhoneViewSetPhoneCustomization,
+    EPhoneViewSetViewCustomization,
+    EPhoneViewSetButtonCustomization,
+    EPhoneViewUpdateContactByString,
+    EPhoneViewAddContactByString,
+    EPhoneViewIsActiveNoteDissmissableByKeyEvent,
+    EPhoneViewUpdateContextMenu,
+    EPhoneViewSetNoConnectedCalls,
+    EPhoneViewIsDTMFEditorVisible,
+    EPhoneViewSetToolbarDimming,
+    EPhoneViewEnableToolbarButton,
+    EPhoneViewHideToolbar,
+    EPhoneViewShowToolbar,
+    EPhoneViewGetExpandedBubbleCallId,
+    EPhoneViewOpenDialer,
+    EPhoneSetConferenceExpanded,
+    EPhoneAppShutDown,
+    EPhoneViewBackButtonActive,
+    EPhoneViewHsToForegroundAfterCall,
+    EPhoneViewOpenContacts,
+    EPhoneAmountOfCommands, // Don't remove this, this should always be the last in list.
+};
+
+
+typedef TInt TPhoneViewResponseId;
+
+enum
+{
+    EPhoneViewResponseFailed = KPhoneViewResponseCommonFirst,
+    EPhoneViewResponseSuccess,
+    EPhoneViewResponseNumberEntryCleared
+
+};
+
+#endif // PHONEVIEWCOMMANDDEFINITIONS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/inc/telephonyservice.h	Fri Jun 04 10:19:18 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:  Telephony Service API to be used through Qt Highway.
+*
+*/
+
+#ifndef TELEPHONYSERVICE_H
+#define TELEPHONYSERVICE_H
+
+#include <QObject>
+#include <QString>
+#include <xqserviceprovider.h>
+
+class PhoneUIQtViewAdapter;
+
+
+class TelephonyService : public XQServiceProvider
+{
+    Q_OBJECT
+public:
+    TelephonyService(PhoneUIQtViewAdapter *phoneView, QObject *parent = 0);
+    ~TelephonyService();
+    
+public slots:
+
+    /*!
+        \fn void start()
+        
+        Start launches telephony UI service.
+        serviceId '0': Brings phoneapp to foreground.
+        serviceId '1': Starts incall dialer, note if there is no ongoing calls and client uses value '1'
+                       then dialer launches on top of empty call handling.
+        
+        Usage example:
+        int inCallDialer(1);
+        XQServiceRequest snd("com.nokia.services.telephonyservices.starter", "start(int)", false);
+        snd << inCallDialer;
+        QVariant err;
+        snd.send(err);
+    */
+    void start(const int serviceId);
+    
+private:
+    
+    PhoneUIQtViewAdapter *m_viewAdapter;
+};
+
+#endif // TELEPHONYSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pri	Fri Jun 04 10:19:18 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: 
+#
+
+HEADERS += ./inc/phoneuiqtviewadapter.h
+HEADERS += ./inc/phoneuiqtbuttonscontroller.h
+HEADERS += ./inc/mphoneviewcommandhandle.h
+HEADERS += ./inc/phoneviewcommanddefinitions.h
+HEADERS += ./inc/phonebubblewrapper.h
+HEADERS += ./inc/phoneresourceadapter.h
+HEADERS += ./inc/phonenotecontroller.h
+HEADERS += ./inc/telephonyservice.h
+HEADERS += ./inc/phoneuicommandcontroller.h
+HEADERS += ./inc/phonecommandextensionwrapper.h
+HEADERS += ./inc/phonemessagecontroller.h
+HEADERS += ./inc/phoneindicatorcontroller.h
+
+
+SOURCES += ./src/phoneuiqtviewadapter.cpp
+SOURCES += ./src/phoneuiqtbuttonscontroller.cpp
+SOURCES += ./src/phonebubblewrapper.cpp
+SOURCES += ./src/phoneresourceadapter.cpp
+SOURCES += ./src/phonenotecontroller.cpp
+SOURCES += ./src/telephonyservice.cpp
+SOURCES += ./src/phoneuicommandcontroller.cpp
+SOURCES += ./src/phonecommandextensionwrapper.cpp
+SOURCES += ./src/phonemessagecontroller.cpp
+SOURCES += ./src/phoneindicatorcontroller.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/phoneuiqtviewadapter.pro	Fri Jun 04 10:19:18 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: Project file for building qt view adapter component
+#
+#
+
+TEMPLATE = lib
+TARGET = phoneuiqtviewadapter
+CONFIG += hb
+
+symbian {
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.UID3 = 0x20029F86
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+    
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    INCLUDEPATH += ../../inc \
+                   ../phoneuiutils/inc \
+                   ../phoneuiview2/inc \
+                   ../phoneui2/srcdata \
+                   ../phoneringingtoneplayer/inc \
+                   ../phonemediatorcenter/inc
+
+    LIBS += -lphoneuiutils \
+        -lbubblemanager2 \
+        -lphoneringingtoneplayer \
+        -lphoneuiqtview \
+        -lphonemediatorcenter \
+        -lxqservice \
+        -lxqserviceutil \
+        -lserviceprovidersettings \
+        -lxqsettingsmanager \
+        -llogsengine \
+        -lxqplugins \
+        -lakncapserverclient
+    defFiles = "$${LITERAL_HASH}ifdef WINS" \
+        "DEFFILE bwins/phoneuiqtviewadapter.def" \
+        "$${LITERAL_HASH}else" \
+            "DEFFILE eabi/phoneuiqtviewadapter.def" \
+        "$${LITERAL_HASH}endif"
+    
+    MMP_RULES += defFiles    
+}
+
+# Input
+include(phoneuiqtviewadapter.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phonebubblewrapper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,411 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Bubble Wrapper.
+*
+*/
+
+#include <hbaction.h>
+#include <pevirtualengine.h>
+
+#include "bubblemanagerif.h"
+#include "phonebubblewrapper.h"
+#include "phoneconstants.h"
+#include "qtphonelog.h"
+
+PhoneBubbleWrapper::PhoneBubbleWrapper (BubbleManagerIF& bubble, QObject *parent) :
+    QObject (parent), m_bubbleManager (bubble)
+{
+}
+
+PhoneBubbleWrapper::~PhoneBubbleWrapper ()
+{
+    
+}
+
+void PhoneBubbleWrapper::updateCallState (int callId, int newState)
+{
+    // TODO: +1 callId because value 0 causes problems
+    //       when using QMap. Bug in S60 Qt?
+    m_callStates [callId] = newState;
+}
+
+int PhoneBubbleWrapper::callId (int state)
+{
+    // Returns call id or -1 if not found
+    // TODO: callId -1 because we +1 callId when inserted
+    //       This is because callId 0 causes problems in QMap.
+    int callId = m_callStates.key (state, -1);
+    return callId;
+}
+
+int PhoneBubbleWrapper::createCallHeader (int callId)
+{
+    int bubble;
+
+    if (!m_bubbles.contains (callId)) {
+        bubble = m_bubbleManager.createCallHeader ();
+        m_bubbles.insert (callId, bubble);
+    }
+    else {
+        bubble = m_bubbles [callId];    
+    }
+    
+    return bubble;
+}
+
+void PhoneBubbleWrapper::removeCallHeader (int callId)
+{
+    if (m_bubbles.contains (callId)) {
+        m_bubbleManager.removeCallHeader (m_bubbles [callId]);
+        m_bubbles.remove (callId);       
+    }
+}
+
+BubbleManagerIF& PhoneBubbleWrapper::bubbleManager ()
+{
+    return m_bubbleManager;
+}
+
+void PhoneBubbleWrapper::setState (int callId, int bubble, int callState)
+{
+    BubbleManagerIF::PhoneCallState state = BubbleManagerIF::None;
+    
+    switch (callState) {
+        case EPEStateIdle:
+            state = BubbleManagerIF::Disconnected;
+            break;
+        case EPEStateDialing:
+            state = BubbleManagerIF::Outgoing;
+            break;
+        case EPEStateRinging:
+            if ( m_bubbles.count() > 1 ) {
+                state = BubbleManagerIF::Waiting;
+            }
+            else {
+                state = BubbleManagerIF::Incoming;
+            }
+            break;
+        case EPEStateConnecting:
+            state = BubbleManagerIF::Alerting;
+            break;
+        case EPEStateConnected:
+            state = BubbleManagerIF::Active;
+            break;
+        case EPEStateHeld:
+            state = BubbleManagerIF::OnHold;
+            break;
+        case EPEStateDisconnecting:
+            state = BubbleManagerIF::Disconnected;
+            break;
+        case EPEStateConferenceIdle:
+            state = BubbleManagerIF::Disconnected;
+            break;
+        case EPEStateConnectedConference:
+            state = BubbleManagerIF::Active;
+            break;
+        case EPEStateHeldConference:
+            state = BubbleManagerIF::OnHold;
+            break;
+        case EPEStateUnknown:
+            state = BubbleManagerIF::None;
+            break;
+        default:
+            break;
+    }
+    
+    updateCallState (callId, callState);
+    m_bubbleManager.setState (bubble, state);
+
+}
+
+void PhoneBubbleWrapper::setLabel (int bubble, const TDesC &text)
+{
+    QString labelText = QString::fromUtf16 (text.Ptr (), text.Length ());
+    PHONE_DEBUG2("PhoneBubbleWrapper::setLabel, label:", labelText); 
+    m_bubbleManager.setLabel (bubble, labelText, Qt::ElideRight);
+}
+
+void PhoneBubbleWrapper::setCli (int bubble, const TDesC &cliText)
+{
+    QString text = QString::fromUtf16 (cliText.Ptr (), cliText.Length ());
+    PHONE_DEBUG2("PhoneBubbleWrapper::setCli, cli:", text); 
+    m_bubbleManager.setCli (bubble, text, Qt::ElideRight);
+}
+
+void PhoneBubbleWrapper::setSecondaryCli (int bubble, const TDesC &cliText)
+{
+    QString text = QString::fromUtf16 (cliText.Ptr (), cliText.Length ());
+    PHONE_DEBUG2("PhoneBubbleWrapper::setSecondaryCli, SecondaryCli:", text); 
+    m_bubbleManager.setSecondaryCli (bubble, text);
+}
+
+void PhoneBubbleWrapper::setCallType (int bubble, int callType)
+{
+    BubbleManagerIF::PhoneCallFlags callflag = BubbleManagerIF::Normal;
+
+    switch (callType) {
+        case EPECallTypeCSVoice:
+            callflag = BubbleManagerIF::Normal;
+            break;
+        case EPECallTypeVideo:
+            callflag = BubbleManagerIF::Video;
+            break;
+        case EPECallTypeVoIP:
+            callflag = BubbleManagerIF::VoIPCall;
+            break;
+        default:
+            break;
+    }
+
+    m_bubbleManager.setCallFlag (bubble, callflag, true);
+}
+
+int PhoneBubbleWrapper::bubbleId (int callId)
+{
+    return m_bubbles.value (callId, -1);
+}
+
+void PhoneBubbleWrapper::setDivert (int bubble, bool enabled)
+{
+    if (enabled) {
+        BubbleManagerIF::PhoneCallFlags divertedFlag = BubbleManagerIF::Diverted;
+        m_bubbleManager.setCallFlag (bubble, divertedFlag, true);
+    }
+}
+
+void PhoneBubbleWrapper::setCiphering(int bubble, bool indicatorAllowed, bool enabled)
+{
+    if (indicatorAllowed && !enabled) {
+        m_bubbleManager.setCallFlag (bubble, BubbleManagerIF::NoCiphering, true);
+    } else {
+        m_bubbleManager.setCallFlag (bubble, BubbleManagerIF::NoCiphering, false);
+    }
+}
+
+int PhoneBubbleWrapper::activeCallCount()
+{
+    int count(0);
+    QMap<int, int> callStateList = callStates();
+    
+    for (int i=0; i<callStateList.size(); ++i) {
+        if ( callStateList.values().at(i) == EPEStateConnected ||
+             callStateList.values().at(i) == EPEStateConnectedConference || 
+             callStateList.values().at(i) == EPEStateDisconnecting ||
+             callStateList.values().at(i) == EPEStateHeld ||
+             callStateList.values().at(i) == EPEStateHeldConference ) {
+             count++;
+         }
+    }
+    
+    return count;
+}
+
+QMap<int, int> PhoneBubbleWrapper::callStates() const 
+{
+    QMap<int, int> ret;
+    
+    for (int i=0; i<m_callStates.size(); ++i) {
+        if ( false == m_conferenceList.contains(m_callStates.keys().at(i)) 
+             && m_bubbles.keys().contains(m_callStates.keys().at(i)) ) {
+            ret.insert(m_callStates.keys().at(i), 
+                       m_callStates.value(m_callStates.keys().at(i)));
+        }
+    }
+    
+    return ret;
+}
+
+QMap<int, int> PhoneBubbleWrapper::bubbles() const
+{
+    QMap<int, int> ret;
+    
+    for (int i=0; i<m_bubbles.size(); ++i) {
+        if ( false == m_conferenceList.contains(m_bubbles.keys().at(i)) ) {
+            ret.insert(m_bubbles.keys().at(i), m_bubbles.value(m_bubbles.keys().at(i)));
+        }
+    }
+    
+    return ret;
+}
+
+int PhoneBubbleWrapper::createConferenceBubble(
+        int callId,
+        int callState,
+        const TDesC &labelText, 
+        const TDesC &cliText)
+{
+    int callId1;
+    int callId2;
+    int bubble = -1;
+    if (getCallIdsForConference(callId1, callId2)) {
+        m_bubbleManager.startChanges();
+        bubble = m_bubbleManager.createConference( 
+                bubbleId(callId1), 
+                bubbleId(callId2) );
+        
+        setConferenceCallId(callId1);
+        setConferenceCallId(callId2);
+        
+        m_bubbles.insert(callId,bubble);
+        setState(callId, bubble, callState );
+        setLabel(bubble, labelText);
+        setCli (bubble, cliText);
+        
+        //Set conference bubble expanded if no other
+        //bubbles (like waiting bubble).
+        m_bubbleManager.setExpandedConferenceCallHeader(
+                (1==bubbles().size()));
+        
+        m_bubbleManager.endChanges();
+    }
+    
+    return bubble;
+}
+
+void PhoneBubbleWrapper::setConferenceCallId(int callId) 
+{
+    if ( false == m_conferenceList.contains(callId) ) {
+        m_conferenceList.append(callId);
+    }
+}
+
+void PhoneBubbleWrapper::removeConferenceCallId(int callId) 
+{
+    if ( m_conferenceList.contains(callId) ) {
+        m_conferenceList.removeOne(callId);
+    }
+}
+
+bool PhoneBubbleWrapper::conferenceCallId(int callId) const
+{
+    return m_conferenceList.contains(callId);
+}
+
+void PhoneBubbleWrapper::removeCallFromConference(int callId)
+{
+    if (m_conferenceList.contains(callId)) {
+        m_bubbleManager.startChanges();
+        if(1<m_conferenceList.size()) {
+            m_bubbleManager.removeRowFromConference(m_bubbles.value(callId));
+            m_conferenceList.removeOne(callId);
+            }
+        else {
+            m_bubbleManager.removeConference();
+
+            if (m_bubbles.contains(KConferenceCallId)) {
+                m_bubbles.remove(KConferenceCallId);
+            } 
+            m_conferenceList.clear();
+        }
+        
+        m_bubbleManager.endChanges();        
+    }
+}
+
+QList<int> PhoneBubbleWrapper::conferenceCallList() const
+    {
+    return m_conferenceList;
+    }
+
+void PhoneBubbleWrapper::removeConferenceBubble()
+{
+    if (0 < m_conferenceList.size()) {
+        m_bubbleManager.removeConference();
+        m_bubbleManager.setExpandedConferenceCallHeader(false);
+        
+        if (m_bubbles.contains(KConferenceCallId)) {
+            m_bubbles.remove(KConferenceCallId);
+        }        
+        m_conferenceList.clear();  
+    }
+}
+
+int PhoneBubbleWrapper::callIdByBubbleId(int bubbleId)
+{
+    return m_bubbles.key(bubbleId, -1);
+}
+
+void PhoneBubbleWrapper::addToConferenceBubble()
+{
+    if (m_conferenceList.size()) {
+        int callId = callIdForConference();
+        if (-1 != callId && 
+                false == m_conferenceList.contains(callId)) {
+            m_bubbleManager.startChanges();
+            setConferenceCallId(callId);
+            m_bubbleManager.addRowToConference(bubbleId(callId));
+            m_bubbleManager.endChanges();
+        }        
+    }
+}
+ 
+int PhoneBubbleWrapper::callIdForConference()
+{
+    int callId = -1;
+    QMap<int, int> bubblelist = bubbles();
+    for (int i=0; i<bubblelist.size() && callId == -1; ++i) {
+        if (KConferenceCallId != bubblelist.keys().at(i)) {
+            if ( bubblelist.size() > 2 ) {
+                if (EPEStateRinging != 
+                        m_callStates.value(bubblelist.keys().at(i))) {
+                    callId = bubblelist.keys().at(i);
+                }
+            } else {
+                callId = bubblelist.keys().at(i);
+            }
+        }
+    }
+    
+    return callId;
+}
+
+bool PhoneBubbleWrapper::getCallIdsForConference(int &first, int &second)
+{
+    first = -1;
+    second = -1;
+    
+    if (2==m_bubbles.values().size()) {
+        first = m_bubbles.keys().first();
+        second = m_bubbles.keys().at(1);
+    } else if (2<=m_bubbles.values().size()) {
+        for (int i=0;i<m_callStates.values().size();++i) {
+            if ( m_callStates.values().at(i) != EPEStateRinging ) {
+                if (first==-1) {
+                    first = m_callStates.keys().at(i);
+                } else {
+                    second = m_callStates.keys().at(i);
+                    break;
+                }
+            }
+        } // For
+    }
+        
+    return (first!=-1 && second!=-1);
+}
+
+void PhoneBubbleWrapper::setServiceId(int callId, int serviceId)
+{
+    m_services[callId] = serviceId;
+}
+
+int PhoneBubbleWrapper::serviceIdByCallId(int callId) const
+{
+    return m_services.value(callId, -1);
+}
+
+QMap<int, int> PhoneBubbleWrapper::serviceIds() const 
+{    
+    return m_services;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phonecommandextensionwrapper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,152 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Wraps phone command extensions.
+*/
+
+#include "phonecommandextensionwrapper.h"
+#include "qtphonelog.h"
+#include <xqplugin.h>
+#include <xqpluginloader.h>
+#include <pevirtualengine.h>
+
+
+PhoneCommandExtensionWrapper::PhoneCommandExtensionWrapper(int pluginUid) :
+    m_plugin(0),m_pluginUid(pluginUid)
+{
+    PHONE_DEBUG("PhoneCommandExtensionWrapper::PhoneMenuExtensionWrapper");
+    XQPluginLoader pluginLoader;
+    pluginLoader.setUid(m_pluginUid);
+
+    QObject *plugin = pluginLoader.instance();
+
+    if (plugin) {
+        m_plugin = qobject_cast<XQTelUiCommandExtension*>(plugin);
+    }
+}
+
+PhoneCommandExtensionWrapper::~PhoneCommandExtensionWrapper()
+{
+    PHONE_DEBUG("PhoneCommandExtensionWrapper::~PhoneCommandExtensionWrapper");
+    release();
+}
+
+int PhoneCommandExtensionWrapper::pluginUid()
+{
+    return m_pluginUid;
+}
+
+void PhoneCommandExtensionWrapper::modifyMenuCommandList(
+        const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+        QList<int> &menuCmdList)
+{
+    if (m_plugin) {
+        m_plugin->modifyMenuCommandList(callInfo, menuCmdList);
+    }
+}
+
+void PhoneCommandExtensionWrapper::modifyPushButtonCommandList(
+        const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+        QList<int> &buttonCmdList)
+{
+    if (m_plugin) {
+        m_plugin->modifyPushButtonCommandList(callInfo, buttonCmdList);
+    }
+}
+
+void PhoneCommandExtensionWrapper::addMenuActions(
+        const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+        QList<HbAction*> &menuActions)
+{
+    if (m_plugin) {
+        m_plugin->addMenuActions(callInfo,menuActions);
+    }
+}
+
+void PhoneCommandExtensionWrapper::releaseMenu()
+{
+    if (m_plugin) {
+        m_plugin->releaseMenu();
+    }
+}
+
+void PhoneCommandExtensionWrapper::release()
+{
+    if (m_plugin) {
+        m_plugin->release();
+        m_plugin = 0;
+    }
+}
+
+void PhoneCommandExtensionWrapper::getCallInfoList(
+        QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+        QMap<int,int> callStates,
+        QMap<int,int> serviceIds,
+        int expandedCall )
+{
+    for (int i=0;i<callStates.keys().count();++i) {
+        XQTelUiCommandExtension::CallInfo info;
+        info.mCallState = mapCallState(callStates.values().at(i));
+        info.mServiceId = serviceIds.value(callStates.keys().at(i));
+        info.mIsExpanded = (expandedCall == callStates.keys().at(i));
+        callInfo.append(info);
+    }
+}
+
+XQTelUiCommandExtension::CallState PhoneCommandExtensionWrapper::mapCallState(
+        int callState )
+{
+    XQTelUiCommandExtension::CallState state(XQTelUiCommandExtension::None);
+
+    switch( callState ) {
+    case EPEStateDisconnecting: {
+        state = XQTelUiCommandExtension::Disconnecting;
+    }
+    break;
+
+    case EPEStateRinging: {
+        state = XQTelUiCommandExtension::Incoming;
+    }
+    break;
+
+    case EPEStateDialing:
+    case EPEStateConnecting: {
+        state = XQTelUiCommandExtension::Outgoing;
+    }
+    break;
+
+    case EPEStateConnected:
+    case EPEStateConnectedConference: {
+        state = XQTelUiCommandExtension::Active;
+    }
+    break;
+
+    case EPEStateHeld:
+    case EPEStateHeldConference: {
+        state = XQTelUiCommandExtension::OnHold;
+    }
+    break;
+
+    case EPEStateUnknown:
+    case EPEStateIdle:
+    case EPEStateConferenceIdle:
+    break;
+
+    default:
+    break;
+    }
+
+    return state;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phoneindicatorcontroller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,189 @@
+/*!
+* 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:  Handles phone indicators.
+*
+*/
+
+#include "phoneindicatorcontroller.h"
+#include "phoneindicators.h"
+
+#include <QList>
+#include <QPair>
+
+#ifdef Q_OS_SYMBIAN
+#include <logsmodel.h>
+#include <logsfilter.h>
+#include <logsdomaincrkeys.h>
+#include <hbicon.h>
+#endif
+
+PhoneIndicatorController::PhoneIndicatorController(QObject *parent):
+    QObject(parent), m_logsModel(0), m_missedCallsFilter(0)
+{
+#ifdef Q_OS_SYMBIAN
+    m_setManager = new XQSettingsManager(this);
+ 
+    XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository, 
+            KCRUidLogs.iUid, KLogsNewMissedCalls );
+    
+    bool ok = connect( m_setManager, 
+            SIGNAL( valueChanged(const XQSettingsKey & ,const QVariant &)),
+                this, SLOT(updateMissedCallIndicator(XQSettingsKey, 
+                        QVariant)));
+    ASSERT( ok );
+    ok = false;
+    ok = m_setManager->startMonitoring( settingsKey );
+    ASSERT(ok);
+    
+    qRegisterMetaType<PhoneIndicatorInfo>("PhoneIndicatorInfo");
+
+#endif
+}
+
+PhoneIndicatorController::~PhoneIndicatorController()
+{   
+#ifdef Q_OS_SYMBIAN
+    XQPublishAndSubscribeSettingsKey missedCallCountKey(
+                    (qint32)KCRUidLogs.iUid, (quint32)KLogsNewMissedCalls );
+    m_setManager->stopMonitoring(missedCallCountKey);
+    delete m_setManager;
+    delete m_missedCallsFilter;
+    delete m_logsModel;
+#endif
+}
+
+void PhoneIndicatorController::setActiveCallData( 
+        const TDesC &text, const TDesC &icon )
+{
+    m_cli = QString::fromUtf16 (text.Ptr (), text.Length ());
+    m_callImage = QString::fromUtf16 (icon.Ptr (), icon.Length ());
+}
+
+void PhoneIndicatorController::clearActiveCallData()
+{
+    m_cli.clear();
+    m_callImage.clear();
+    disableActiveCallIndicator();
+}
+
+void PhoneIndicatorController::enableActiveCallIndicator()
+{
+    if (!m_cli.isEmpty()){
+        QString indicatorType(indicatorName(PhoneActiveCallIndicator));
+        QVariantMap parameters;
+        
+        parameters.insert(
+                QVariant(HbIndicatorInterface::PrimaryTextRole ).toString(),
+                m_cli);
+        
+        parameters.insert(QVariant( HbIndicatorInterface::DecorationNameRole).toString(),
+                m_callImage);
+        
+        m_indicator.activate(indicatorType, parameters);
+    }
+}
+void PhoneIndicatorController::disableActiveCallIndicator()
+{
+    QString indicatorType(indicatorName(PhoneActiveCallIndicator));
+    m_indicator.deactivate(indicatorType);
+}
+
+void PhoneIndicatorController::updateMissedCallIndicator(
+        const XQSettingsKey &key, const QVariant &value)
+{ 
+#ifdef Q_OS_SYMBIAN
+    if ( key.key() == (quint32)KLogsNewMissedCalls ){
+        if ( value.toInt() == 0 ){
+            QString indicatorType(indicatorName(PhoneMissedCallIndicator));
+            m_indicator.deactivate(indicatorType);
+            delete m_missedCallsFilter;
+            m_missedCallsFilter = NULL;
+            delete m_logsModel;
+            m_logsModel = NULL;
+        } else {
+            m_logsModel = new LogsModel(LogsModel::LogsFullModel);
+            m_missedCallsFilter = new LogsFilter(LogsFilter::Missed);
+            connect( m_missedCallsFilter, 
+                    SIGNAL(rowsInserted(const QModelIndex &, int, int )),
+                    this, SLOT(setMissedallIndicatorData()));
+            m_missedCallsFilter->setMaxSize(value.toInt() + 1);
+            m_missedCallsFilter->setSourceModel(m_logsModel);
+        }
+    }
+#endif  
+}
+
+void PhoneIndicatorController::setMissedallIndicatorData()
+{
+#ifdef Q_OS_SYMBIAN
+
+    XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository, 
+            KCRUidLogs.iUid, KLogsNewMissedCalls );
+    QString indicatorType(indicatorName(PhoneMissedCallIndicator));
+    
+    int missedCallCount = m_setManager->readItemValue( settingsKey,
+            XQSettingsManager::TypeInt ).toInt();
+    
+    if ( missedCallCount > 0 ) {
+        QVariantMap parameters;
+        QString lastMissedCallFrom;
+        int repeatedMissedCalls(0);
+        
+        if ( m_missedCallsFilter->rowCount() > 0 ){
+                lastMissedCallFrom = m_missedCallsFilter->data(
+                        m_missedCallsFilter->index(0,0),
+                        Qt::DisplayRole).toStringList().takeFirst();
+                repeatedMissedCalls = 1;
+            }
+        for( int i = 1; i < missedCallCount && i 
+                < m_missedCallsFilter->rowCount(); i++ ){
+            QStringList displayData = m_missedCallsFilter->data(
+                    m_missedCallsFilter->index(i,0),
+                    Qt::DisplayRole).toStringList();
+            if ( lastMissedCallFrom == displayData.at(0) ){
+                repeatedMissedCalls++;
+            } else {
+                i = missedCallCount; // Break
+            }
+        }
+        // First row
+        parameters.insert( 
+                QVariant( HbIndicatorInterface::PrimaryTextRole ).toString(),
+                ( hbTrId("txt_phone_dblist_ln_missed_calls", 
+                        missedCallCount)));
+        
+        // Second row
+        if ( missedCallCount >= repeatedMissedCalls )
+            {
+            parameters.insert( 
+                    QVariant( HbIndicatorInterface::SecondaryTextRole ).toString(), 
+                    lastMissedCallFrom );
+            }
+        
+        // icon
+        //QList<QVariant> icons = m_missedCallsFilter->data( 
+        //        m_missedCallsFilter->index(0,0), 
+        //        Qt::DecorationRole).value<QList<QVariant> >();
+        //QString iconName = icons.first().value<HbIcon>().iconName();
+        QString iconName = "qtg_mono_missed_call_unseen";
+        parameters.insert(
+                QVariant( HbIndicatorInterface::DecorationNameRole ).toString(),
+                iconName );
+        
+        m_indicator.activate(indicatorType, parameters);
+    } else {
+        m_indicator.deactivate( indicatorType );
+    }
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phonemessagecontroller.cpp	Fri Jun 04 10:19:18 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:  Handles message editor.
+*/
+
+#include "phonemessagecontroller.h"
+#include "tphonecmdparamsfidata.h"
+#include "phoneconstants.h"
+#include "cphonecenrepproxy.h"
+#include "cphonepubsubproxy.h"
+#include <settingsinternalcrkeys.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <hbglobal.h>
+#include <xqservicerequest.h>
+
+
+PhoneMessageController::PhoneMessageController(QObject *parent) : 
+    QObject(parent)
+{
+
+}
+
+PhoneMessageController::~PhoneMessageController()
+{
+
+}
+
+void PhoneMessageController::openSoftRejectMessageEditor(
+        TPhoneCommandParam *commandParam)
+{
+    TPhoneCmdParamSfiData* sfiParam =
+        static_cast<TPhoneCmdParamSfiData*>( commandParam );
+    
+    QString toField;
+    QString alias;
+    QString messageBody;
+    
+    
+    // Get message body
+    TInt softRejectDefaultInUseValue = 0;
+    const TInt err = CPhoneCenRepProxy::Instance()->GetInt(
+        KCRUidTelephonySettings,
+        KSettingsSoftRejectDefaultInUse,
+        softRejectDefaultInUseValue );
+    
+    if (softRejectDefaultInUseValue) {
+        HBufC* softRejectTxt = NULL;
+        TRAP_IGNORE( softRejectTxt = HBufC::NewL( KPhoneSMSLength ) );
+        
+        if (softRejectTxt) {
+            TPtr string( softRejectTxt->Des() );
+        
+            // Default txt used or not
+            CPhoneCenRepProxy::Instance()->GetString(
+                KCRUidTelephonySettings,
+                KSettingsSoftRejectText,
+                string );
+            
+            messageBody = QString::fromUtf16(string.Ptr(), string.Length());
+            delete softRejectTxt;
+        }
+    } else {
+        messageBody = hbTrId("txt_phone_setlabel_soft_reject_val_default_text");
+    }
+    
+    // store the remote caller's info
+    alias = QString::fromUtf16(sfiParam->Name().Ptr(), 
+            sfiParam->Name().Length());
+    
+    toField = QString::fromUtf16(sfiParam->Number().Ptr(), 
+            sfiParam->Number().Length());
+
+    
+    // open message editor
+    openEditor(toField, alias, messageBody );
+}
+
+void PhoneMessageController::openEditor(
+        QString /*toField*/, QString /*name*/, QString /*messageBody*/)
+{
+    //TODO
+    /*XQServiceRequest snd(QLatin1String("com.nokia.services.hbserviceprovider.imessage.send"), QLatin1String("send(QVariant)"));
+    QVariant data;
+    snd << data;
+    snd.send();*/
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,381 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Handles phone notes.
+*/
+
+#include "phonenotecontroller.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamquery.h"
+#include "phoneresourceadapter.h"
+#include "qtphonelog.h"
+#include <QSignalMapper>
+#include <QTimer>
+#include <hbdevicemessagebox.h>
+#include <hbdeviceprogressdialog.h>
+#include <hbmessagebox.h>
+#include <hbprogressdialog.h>
+#include <hbaction.h>
+#include <phoneappcommands.hrh>
+  
+PhoneNoteController::PhoneNoteController(QObject *parent) : 
+    QObject(parent), m_timer(0), m_progressDialog(0), m_dtmfNote(0), 
+    m_queryNote(0), m_queryCanceledCommand(-1), m_timeoutCommand(-1)
+{
+    PHONE_DEBUG("PhoneNoteController::PhoneNoteController");
+    m_signalMapper = new QSignalMapper(this);
+    connect(m_signalMapper, SIGNAL(mapped(int)), this, SIGNAL(command (int)));
+}
+
+PhoneNoteController::~PhoneNoteController()
+{
+    PHONE_DEBUG("PhoneNoteController::~PhoneNoteController");
+    if (m_timer) {
+        delete m_timer;
+    }
+}
+
+void PhoneNoteController::showGlobalNote(TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneNoteController::showGlobalNote");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdGlobalNote);
+
+    TPhoneCmdParamGlobalNote* globalNoteParam = 
+        static_cast<TPhoneCmdParamGlobalNote*>( commandParam );
+    
+        
+    HbMessageBox::MessageBoxType type;
+    
+    switch( globalNoteParam->Type() ) {
+    case EAknGlobalInformationNote:
+        type = HbMessageBox::MessageTypeInformation;
+        break;
+    case EAknGlobalWarningNote:
+    default:
+        type = HbMessageBox::MessageTypeWarning;
+        break;
+    }
+    
+    QString noteString = globalNoteText(globalNoteParam);
+    
+    if (false == noteString.isNull()) {
+        bool showNote(true);
+        for (int i = 0; i < m_messageBoxList.count(); ++i) {
+            // Do not show same note/text several times, e.g when user hits
+            // the end button several times we should show only one "not allowed"
+            // note.
+            if (noteString == m_messageBoxList.at(i)->text()) {
+                showNote = false;
+                break;
+            }
+        }
+        
+        if (showNote) {
+            QScopedPointer<HbDeviceMessageBox> messageBox( 
+                new HbDeviceMessageBox(noteString, type));
+            
+            int timeout = globalNoteParam->Timeout();
+            if (timeout == 0) {
+                messageBox->setTimeout(HbDialog::StandardTimeout);
+            } else {
+                messageBox->setTimeout(timeout);
+            }
+            
+            HbDeviceMessageBox *messageBoxPtr = messageBox.data();
+            m_messageBoxList.append(messageBoxPtr);
+            messageBox.take();
+            
+            if (1 == m_messageBoxList.size()) {
+                QObject::connect(messageBoxPtr, SIGNAL(aboutToClose()), 
+                                 this, SLOT(destroyDialog()));
+                messageBoxPtr->show();
+            }
+        }
+    }
+}
+
+void PhoneNoteController::showNote(TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneNoteController::showNote");
+
+    TPhoneCmdParamNote* noteParam = static_cast<TPhoneCmdParamNote*>(
+            commandParam );
+    
+    if ( noteParam->Type() == EPhoneNoteDtmfSending ) {
+        showDtmfNote(noteParam);
+    }
+        
+}
+
+void PhoneNoteController::showQuery(TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneNoteController::showQuery");
+    TPhoneCmdParamQuery& params = *static_cast<TPhoneCmdParamQuery*>( commandParam );
+
+    if ( EPhoneQueryDialog == params.QueryType() && 
+         params.QueryPrompt().Length() ) {
+        showDefaultQuery(&params);
+       
+    } else if ( EPhoneGlobalWaitNote == params.QueryType() ) {
+        showGlobalWaitNote(&params);
+        
+    }
+
+        
+}
+
+void PhoneNoteController::removeDtmfNote()
+{
+    PHONE_DEBUG("PhoneNoteController::removeDtmfNote"); 
+    if (m_dtmfNote) {
+        m_dtmfNote->close();
+    }
+}
+
+void PhoneNoteController::removeNote()
+{
+    PHONE_DEBUG("PhoneNoteController::removeNote"); 
+    removeDtmfNote();
+}
+
+void PhoneNoteController::removeQuery()
+{
+    PHONE_DEBUG("PhoneNoteController::removeQuery"); 
+    if (m_queryNote) {
+        m_queryNote->close();
+    }
+}
+
+void PhoneNoteController::removeGlobalWaitNote()
+{
+    PHONE_DEBUG("PhoneNoteController::removeGlobalWaitNote"); 
+    if (m_timer) {
+        m_timeoutCommand = -1;
+        m_timer->stop();
+    }
+    
+    if (m_progressDialog) {
+        m_queryCanceledCommand = -1;
+        m_progressDialog->close();
+    }
+}
+
+void PhoneNoteController::destroyDialog()
+{
+    PHONE_DEBUG("PhoneNoteController::destroyDialog"); 
+    HbDeviceMessageBox *messageBox = m_messageBoxList.takeFirst();
+    messageBox->deleteLater();
+    messageBox = 0;
+    
+    if ( 0 < m_messageBoxList.size() ) {
+        PHONE_DEBUG("PhoneNoteController::show pending note");
+        HbDeviceMessageBox *messageBoxTemp = m_messageBoxList[0];
+        QObject::connect(messageBoxTemp, SIGNAL(aboutToClose()), 
+                         this, SLOT(destroyDialog()));
+        messageBoxTemp->show();
+    }
+}
+
+void PhoneNoteController::removeMappings()
+{
+    foreach (HbAction *action, m_actions ) {
+        m_signalMapper->removeMappings(action);
+    }
+    m_actions.clear();
+    
+    if (m_dtmfNote) {
+        m_dtmfNote->deleteLater();
+        m_dtmfNote = 0;
+    }
+    if (m_queryNote) {
+        m_queryNote->deleteLater();
+        m_queryNote = 0;
+    }
+    if (m_progressDialog) {
+        m_progressDialog->deleteLater();
+        m_progressDialog = 0;
+    }
+}
+
+void PhoneNoteController::queryCancelled()
+{
+    if (m_timer) {
+        m_timer->stop();
+    }
+    
+    if (m_queryCanceledCommand != -1) {
+        emit command(m_queryCanceledCommand);
+    }
+    m_queryCanceledCommand = -1;
+    m_timeoutCommand = -1;
+}
+
+void PhoneNoteController::queryTimeout()
+{
+    int sendCommand = m_timeoutCommand;
+    if (m_progressDialog) {
+        m_queryCanceledCommand = -1;
+        m_progressDialog->close();
+    }
+    if (sendCommand != -1) {        
+        emit command(sendCommand);
+    }
+}
+
+QString PhoneNoteController::globalNoteText(
+        TPhoneCommandParam *commandParam)
+{
+    TPhoneCmdParamGlobalNote* globalNoteParam = 
+        static_cast<TPhoneCmdParamGlobalNote*>( commandParam );
+    
+    QString ret;    
+    
+    if ( globalNoteParam->TextResourceId() && 
+         KErrNone != globalNoteParam->Text().Compare( KNullDesC() ) ) {
+         // resource and text exists
+         ret = PhoneResourceAdapter::Instance()->convertToString(
+                     globalNoteParam->TextResourceId(),
+                     QString::fromUtf16(globalNoteParam->Text().Ptr(), 
+                                     globalNoteParam->Text().Length()) );         
+    } else if ( globalNoteParam->TextResourceId() ) {
+        // resource exists
+        ret = PhoneResourceAdapter::Instance()->convertToString(
+                    globalNoteParam->TextResourceId());
+
+    } else if ( KErrNone != globalNoteParam->Text().Compare( KNullDesC() ) ) {
+        // text exists
+        ret = QString::fromUtf16(globalNoteParam->Text().Ptr(), 
+                globalNoteParam->Text().Length());
+    }
+    
+    return ret;
+}
+
+void PhoneNoteController::showDtmfNote(TPhoneCmdParamNote* noteParam)
+{    
+    if (m_dtmfNote) {
+        m_dtmfNote->setText( QString::fromUtf16(noteParam->Text().Ptr(), 
+                noteParam->Text().Length()) );
+        m_dtmfNote->update();
+    } else {
+        QList<HbAction*> hbactions = PhoneResourceAdapter::Instance()->
+            convertToHbActions(noteParam->ResourceId());
+
+        if (hbactions.count() > 0) {
+            m_dtmfNote = new HbProgressDialog(HbProgressDialog::ProgressDialog);
+            m_dtmfNote->setText( QString::fromUtf16(noteParam->Text().Ptr(), 
+                    noteParam->Text().Length()) ); 
+                  
+            connect(hbactions.at(0), SIGNAL(triggered()), m_signalMapper, SLOT(map()));
+
+            int count = m_dtmfNote->actions().count();
+            for (int i=count;0<i;i--) {
+                QAction *action = m_dtmfNote->actions().at(i-1);
+                m_dtmfNote->removeAction(action);
+                //TODO
+                //delete action;
+            }
+            m_dtmfNote->addAction(hbactions.at(0));
+            m_signalMapper->setMapping(hbactions.at(0), hbactions.at(0)->data().toInt());
+            
+            QObject::connect(m_dtmfNote, SIGNAL(aboutToClose()), 
+                             this, SLOT(removeMappings())); 
+            
+            m_actions.append(hbactions.at(0));
+      
+            m_dtmfNote->show();
+        }
+    }
+}
+
+void PhoneNoteController::showDefaultQuery(TPhoneCmdParamQuery* params)
+{    
+    if (!m_queryNote) {
+        QList<HbAction*> hbactions = PhoneResourceAdapter::Instance()->
+            convertToHbActions(params->QueryResourceId());
+        
+        if (hbactions.count() > 0) {
+            m_queryNote = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+            m_queryNote->setTimeout(HbPopup::NoTimeout);
+            m_queryNote->setDismissPolicy(HbPopup::NoDismiss);
+            m_queryNote->setText(QString::fromUtf16(params->QueryPrompt().Ptr(), 
+                    params->QueryPrompt().Length()));
+            
+            QObject::connect(m_queryNote, SIGNAL(aboutToClose()), 
+                             this, SLOT(removeMappings())); 
+                            
+            for (int i = 0; i < hbactions.count(); ++i) {
+                connect(hbactions.at(i), SIGNAL(triggered()), m_signalMapper, SLOT(map()));
+                m_signalMapper->setMapping(hbactions.at(i), hbactions.at(i)->data().toInt());
+                m_actions.append(hbactions.at(i));
+            }
+            
+            int count = m_queryNote->actions().count();
+            for (int i=count;0<i;i--) {
+                QAction *action = m_queryNote->actions().at(i-1);
+                m_queryNote->removeAction(action);
+                //TODO
+                //delete action;
+            }
+            
+            for (int i=0;i<hbactions.count();i++) {
+                m_queryNote->addAction(hbactions.at(i));
+            }
+            
+            m_queryNote->show();
+        }
+    }
+}
+
+void PhoneNoteController::showGlobalWaitNote(TPhoneCmdParamQuery* params)
+{    
+    if (!m_progressDialog) {        
+        m_queryCanceledCommand = params->CbaCommandMapping(EAknSoftkeyCancel);
+
+        m_progressDialog = new HbDeviceProgressDialog(HbProgressDialog::WaitDialog);
+        
+        if (params->QueryPrompt().Length()) {
+            m_progressDialog->setText(QString::fromUtf16(params->QueryPrompt().Ptr(), 
+                    params->QueryPrompt().Length()));
+        } else if (0 != params->DataText()) {
+            m_progressDialog->setText(QString::fromUtf16(params->DataText()->Ptr(), 
+                    params->DataText()->Length()));
+        }
+        
+        QObject::connect(m_progressDialog, SIGNAL(aboutToClose()), 
+                         this, SLOT(removeMappings())); 
+        
+        QObject::connect(m_progressDialog, SIGNAL(cancelled()), 
+                         this, SLOT(queryCancelled())); 
+        
+        if (params->TimeOut() != 0) {
+            if (!m_timer) {
+                m_timer = new QTimer();
+                m_timer->setSingleShot(true);
+                connect(m_timer, SIGNAL(timeout()), SLOT(queryTimeout()));
+            }           
+            
+            m_timeoutCommand = -1;
+            int customCommand;
+            if (-1 != params->GetCustomCommandForTimeOut(customCommand)) {
+                m_timeoutCommand = customCommand;
+            }
+            
+            m_timer->start(params->TimeOut());
+        }
+        
+        m_progressDialog->show();
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phoneresourceadapter.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,614 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Converts Symbian resources to PhoneAction objects.
+*/
+
+#include "phoneresourceadapter.h"
+#include "phoneresourceids.h"
+#include "phoneui.hrh"
+#include "phoneuiqtbuttonscontroller.h"
+#include <phoneappvoipcommands.hrh>
+#include <QApplication>
+#include <QLocale>
+#include <QTranslator>
+#include <QtDebug>
+#include <QVariant>
+#include <hbaction.h>
+
+PhoneResourceAdapter *pinstance = 0;// initialize pointer
+
+PhoneResourceAdapter* PhoneResourceAdapter::Instance (QObject *parent) 
+{
+    if (pinstance == 0)  // is it the first call?
+    {  
+        pinstance = new PhoneResourceAdapter (parent); // create sole instance
+    }
+    return pinstance; // address of sole instance
+}
+  
+PhoneResourceAdapter::PhoneResourceAdapter (QObject *parent) : QObject (parent)
+{
+    m_buttonsCtrl = new PhoneUIQtButtonsController();
+    
+}
+
+PhoneResourceAdapter::~PhoneResourceAdapter ()
+{
+    delete m_buttonsCtrl;
+}
+
+PhoneUIQtButtonsController* PhoneResourceAdapter::buttonsController ()
+{
+    PhoneUIQtButtonsController* retValue = 0;
+    
+    if (m_buttonsCtrl) 
+        {
+        retValue = m_buttonsCtrl;
+        }
+    
+    return retValue;
+}
+
+QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId, ...)
+{
+    QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
+    
+    switch (symbianResourceId) {
+    
+    case R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA:
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_send"));
+        leftButton->setCommand(EPhoneCallComingCmdSoftReject);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;       
+        
+        PhoneAction *rightButton = new PhoneAction;
+        rightButton->setIcon (HbIcon("qtg_mono_speaker_off"));
+        rightButton->setCommand (EPhoneCallComingCmdSilent);
+        translatedActions [PhoneAction::ToolbarButton2] = rightButton;            
+        }
+        break;
+
+    case R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA:
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_send"));
+        leftButton->setCommand(EPhoneCallComingCmdSoftReject);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;
+               
+        PhoneAction *rightButton = new PhoneAction;
+        rightButton->setIcon (HbIcon("qtg_mono_reject_call"));
+        rightButton->setCommand (EPhoneCallComingCmdReject);
+        translatedActions [PhoneAction::ToolbarButton2] = rightButton;      
+        }
+        break;
+        
+    case R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA:
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_send"));
+        leftButton->setCommand(EPhoneCallComingCmdSoftReject);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;    
+        
+        PhoneAction *rightButton = new PhoneAction;
+        rightButton->setIcon (HbIcon("qtg_mono_speaker_off"));
+        rightButton->setDisabled(true);
+        translatedActions [PhoneAction::ToolbarButton2] = rightButton;        
+        }
+        break;
+        
+    case R_PHONEUI_CALLHANDLING_CALLWAITING_CBA:        
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_send"));
+        leftButton->setCommand(EPhoneCallComingCmdSoftReject);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;       
+        
+        PhoneAction *rightButton = new PhoneAction;
+        rightButton->setIcon (HbIcon("qtg_mono_join_call"));
+        rightButton->setCommand (EPhoneInCallCmdJoin);
+        rightButton->setDisabled(true);
+        translatedActions [PhoneAction::ToolbarButton2] = rightButton;            
+        }
+        break;        
+        
+    case R_PHONEUI_DIALER_CBA:
+    case R_PHONEUI_INCALL_DIALER_CBA:
+    case R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA:
+    case R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA:
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_dialer"));
+        leftButton->setCommand(EPhoneInCallCmdDialer);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;
+        
+        PhoneAction *centerButton = new PhoneAction;
+        centerButton->setIcon (HbIcon("qtg_mono_mic_mute"));
+        centerButton->setCommand (EPhoneInCallCmdMute);
+        translatedActions [PhoneAction::ToolbarButton2] = centerButton;        
+
+        PhoneAction *centerButton2 = new PhoneAction;
+        if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
+            {
+            centerButton2->setIcon (HbIcon("qtg_mono_speaker"));
+            centerButton2->setCommand (EPhoneInCallCmdActivateIhf);
+            }
+        else
+            {
+            centerButton2->setIcon (HbIcon("qtg_mono_mobile"));
+            centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
+            }
+        translatedActions [PhoneAction::ToolbarButton3] = centerButton2; 
+        
+        PhoneAction *rightButton = new PhoneAction;
+        rightButton->setIcon(HbIcon("qtg_mono_contacts"));
+        rightButton->setDisabled( 
+                (symbianResourceId==
+                 R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA));        
+        rightButton->setCommand(EPhoneInCallCmdContacts);
+        
+        translatedActions[PhoneAction::ToolbarButton4] = rightButton;
+        }
+        break;
+        
+    case R_PHONEUI_CALLHANDLING_EMERGENCY_CBA:
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_dialer"));
+        leftButton->setCommand(EPhoneInCallCmdDialer);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;
+        
+        PhoneAction *rightButton = new PhoneAction;
+        if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
+            {
+            rightButton->setIcon (HbIcon("qtg_mono_speaker"));
+            rightButton->setCommand (EPhoneInCallCmdActivateIhf);
+            }
+        else
+            {
+            rightButton->setIcon (HbIcon("qtg_mono_mobile"));
+            rightButton->setCommand (EPhoneInCallCmdDeactivateIhf);
+            }
+        translatedActions [PhoneAction::ToolbarButton2] = rightButton;                    
+        }
+        break;
+        
+    case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA:
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_dialer"));
+        leftButton->setCommand(EPhoneInCallCmdDialer);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;
+        
+        PhoneAction *centerButton = new PhoneAction;
+        centerButton->setIcon (HbIcon("qtg_mono_mic_unmute"));
+        centerButton->setCommand (EPhoneInCallCmdUnmute);
+        translatedActions [PhoneAction::ToolbarButton2] = centerButton;        
+
+        PhoneAction *centerButton2 = new PhoneAction;
+        if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf))
+            {
+            centerButton2->setIcon (HbIcon("qtg_mono_speaker"));
+            centerButton2->setCommand (EPhoneInCallCmdActivateIhf);
+            }
+        else
+            {
+            centerButton2->setIcon (HbIcon("qtg_mono_mobile"));
+            centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
+            }
+        translatedActions [PhoneAction::ToolbarButton3] = centerButton2;     
+        
+        PhoneAction *rightButton = new PhoneAction;
+        rightButton->setIcon(HbIcon("qtg_mono_contacts"));
+        rightButton->setCommand(EPhoneInCallCmdContacts);
+        translatedActions[PhoneAction::ToolbarButton4] = rightButton;   
+        }
+        break;
+        
+    case R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA:
+        {
+        PhoneAction *leftButton = new PhoneAction;
+        leftButton->setIcon (HbIcon("qtg_mono_dialer"));
+        leftButton->setCommand(EPhoneInCallCmdDialer);
+        translatedActions [PhoneAction::ToolbarButton1] = leftButton;
+        
+        PhoneAction *centerButton1 = new PhoneAction;
+        if (!m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold))
+            {
+            centerButton1->setIcon (HbIcon("qtg_mono_mic_mute"));
+            centerButton1->setCommand (EPhoneInCallCmdMute);
+            }
+        else
+            {
+            centerButton1->setIcon (HbIcon("qtg_mono_mic_unmute"));
+            centerButton1->setCommand (EPhoneInCallCmdUnmute);
+            }
+        translatedActions [PhoneAction::ToolbarButton2] = centerButton1;
+
+        PhoneAction *centerButton2 = new PhoneAction;
+        centerButton2->setIcon (HbIcon("qtg_mono_mobile"));
+        centerButton2->setCommand (EPhoneInCallCmdDeactivateIhf);
+        translatedActions [PhoneAction::ToolbarButton3] = centerButton2;
+        
+        PhoneAction *rightButton = new PhoneAction;
+        rightButton->setIcon(HbIcon("qtg_mono_contacts"));
+        rightButton->setCommand(EPhoneInCallCmdContacts);
+        translatedActions[PhoneAction::ToolbarButton4] = rightButton;
+        }
+        break;
+
+    case R_PHONEUI_MTCAL_INCOMING_CALL:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_incoming_call"));
+        translatedActions [PhoneAction::Text] = text;
+        }
+        break;
+        
+    case R_PHONEUI_INCALL_CALL_DISCONNECTED:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_disconnected"));
+        translatedActions [PhoneAction::Text] = text;
+        }
+        break;      
+        
+    case R_PHONEUI_INCALL_CALL_HELD:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_on_hold"));
+        translatedActions [PhoneAction::Text] = text;    
+        break;
+        }
+
+    case R_PHONEUI_MULTC_WAITING:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_waiting"));
+        translatedActions [PhoneAction::Text] = text;
+        }
+        break; 
+
+    case R_PHONEUI_INCALL_CALL_NUMBER:
+        {
+        PhoneAction *text = new PhoneAction;
+        VA_LIST list;
+        VA_START (list, symbianResourceId);
+        int intValue = VA_ARG (list, int);
+        text->setText(hbTrId("txt_phone_other_call_ln").arg(intValue));
+        translatedActions [PhoneAction::Text] = text;
+        VA_END (list);
+        }
+        break;
+        
+    case R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO:
+        {
+        PhoneAction *text = new PhoneAction;
+        // Symbian modifier used here: %:0%H%:1%T%:2%S%:3
+        // This is because this text is used by Symbian localization
+        // for formatting later on.
+        text->setText ("%:0%H%:1%T%:2%S%:3");
+        translatedActions [PhoneAction::Text] = text;
+        break;
+        }
+        
+    case R_PHONEUI_OUT_GOING_CALL:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_calling"));
+        translatedActions [PhoneAction::Text] = text;
+        break;
+        }
+        
+    case R_PHONEUI_MTCAL_CLI_WITHHELD:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_private_number"));
+        translatedActions [PhoneAction::Text] = text;
+        break;
+        }
+    case R_PHONEUI_MTCAL_CALL:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_common_button_call")); //Call
+        translatedActions [PhoneAction::Text] = text;
+        break;
+        }
+
+    case R_PHONEUI_EMERGENCY_CALL_HEADER:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_emergency_call"));
+        translatedActions [PhoneAction::Text] = text;            
+        break;            
+        }
+        
+    case R_PHONEUI_EMERGENCY_CALL_BUTTONS:
+        {
+        PhoneAction *button = new PhoneAction;
+        button->setText (hbTrId("txt_phone_button_end_call"));
+        button->setIcon (HbIcon("qtg_mono_end_call"));
+        button->setCommand (EPhoneCmdEnd);
+        translatedActions [PhoneAction::LeftButton] = button;
+        }
+        break;
+        
+    case R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_attempting"));
+        translatedActions [PhoneAction::Text] = text;            
+        }
+        break;
+
+    case R_PHONEUI_CONFERENCE_CALL:
+        {
+        PhoneAction *text = new PhoneAction;
+        text->setText (hbTrId("txt_phone_other_conference_call"));
+        translatedActions [PhoneAction::Text] = text; 
+        }
+        break;
+    case R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT:
+        {
+        PhoneAction *text = new PhoneAction;
+        VA_LIST list;
+        VA_START (list, symbianResourceId);
+        const TDesC *string = (TDesC*)VA_ARG(list, TDesC*);
+        text->setText (hbTrId("txt_phone_info_sending").arg(QString::fromUtf16(string->Ptr(), 
+                string->Length())));
+        translatedActions [PhoneAction::Text] = text;
+        VA_END (list);
+        }
+        break;
+    case R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT:
+        {
+        PhoneAction *text = new PhoneAction;
+        VA_LIST list;
+        VA_START (list, symbianResourceId);
+        const TDesC *string = (TDesC*)VA_ARG(list, TDesC*);
+        text->setText (hbTrId("txt_phone_info_send_string").arg(QString::fromUtf16(string->Ptr(), 
+                string->Length())));
+        translatedActions [PhoneAction::Text] = text;
+        VA_END (list);
+        }
+        break;
+    case R_PHONE_IMEI_STRING:
+        {
+        QScopedPointer<PhoneAction> text(new PhoneAction);
+        VA_LIST list;
+        VA_START(list, symbianResourceId);
+        const TDesC *string = static_cast<TDesC*>(VA_ARG(list, TDesC*));
+        QString serialNumber = 
+            QString::fromUtf16(string->Ptr(), string->Length());
+        text->setText(hbTrId("txt_phone_info_serial_no").arg(serialNumber));
+        translatedActions[PhoneAction::Text] = text.take();
+        VA_END(list);
+        }
+        break;
+    case R_PHONEUI_LIFE_TIMER_STRING:
+        {
+        QScopedPointer<PhoneAction> text(new PhoneAction);
+        VA_LIST list;
+        VA_START(list, symbianResourceId);
+        const TDesC *string = static_cast<TDesC*>(VA_ARG(list, TDesC*));
+        QString lifeTimerText =
+            QString::fromUtf16(string->Ptr(), string->Length());
+        text->setText(hbTrId("txt_phone_info_life_timer").arg(lifeTimerText));
+        translatedActions[PhoneAction::Text] = text.take();
+        VA_END(list);
+        }
+        break;
+    default:
+        break;
+    }
+    
+    return translatedActions;
+}
+
+QString PhoneResourceAdapter::convertToString(int symbianResourceId) const
+{
+    QString ret;
+    
+    switch (symbianResourceId) {
+        case R_PHONE_ERROR_CALL_NOT_ALLOWED:
+            {
+            ret = hbTrId("txt_phone_dpopinfo_not_allowed");      
+            }
+            break;
+            
+        case R_ERROR_NOTE_NOT_ALLOWED:
+            {
+            ret =  hbTrId("txt_phone_dpopinfo_not_allowed");  
+            }
+            break;
+            
+        case R_NOTETEXT_INVALID_PHONENUMBER:
+            {
+            ret = hbTrId("txt_phone_info_invalid_phone_number"); 
+            }
+            break;
+            
+        case R_NOTETEXT_NO_ANSWER:
+            {
+            ret = hbTrId("txt_phone_info_no_answer"); 
+            }
+            break;
+        
+        case R_PHONE_ERROR_NUMBER_BUSY:
+            {
+            ret = hbTrId("txt_phone_info_number_busy"); 
+            }
+            break;
+            
+        case R_PHONE_SS_NOTIFICATION_MOCAL_WAITING_TEXT:
+            {
+            ret = hbTrId("txt_phone_other_waiting");
+            }
+            break;
+            
+        case R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT:
+            {
+            ret = hbTrId("txt_phone_other_on_hold");
+            }
+            break;
+            
+        case R_INCAL_INFO_HOLD_TEXT:
+            {
+            ret = hbTrId("txt_phone_other_on_hold");
+            }
+            break;
+            
+        case R_INCAL_REMOTE_ACTIVE_TEXT:
+            {
+            ret = hbTrId("txt_phone_info_connected");
+            }
+            break;
+            
+        case R_INCAL_INFO_CONF_HOLD_TEXT:
+            {
+            ret = hbTrId("Conference on hold");
+            }
+            break;
+        case R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT:
+            {
+            ret = hbTrId("txt_phone_info_no_network_support_for_video_call");
+            }
+            break;
+        case R_PHONE_ERROR_EMERGENCY_CALLS_ONLY:
+            {
+            ret = hbTrId("txt_phone_info_emergency_calls_only");         
+            }
+            break;
+        case R_NOTETEXT_NUMBER_NOT_IN_USE:
+            {
+            ret = hbTrId("txt_phone_info_number_not_in_use");         
+            }
+            break;
+        case R_NOTETEXT_NETWORK_BUSY:
+            {
+            ret = hbTrId("txt_phone_info_network_busy");         
+            }
+            break;
+        case R_NOTETEXT_ERROR_IN_CONNECTION:
+            {
+            ret = hbTrId("txt_phone_info_error_in_connection");         
+            }
+            break;
+        case R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED:
+            {
+            ret = hbTrId("txt_phone_info_emergency_call_failed");         
+            }
+            break;
+        case R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT:
+            {
+            ret = hbTrId("txt_phone_info_transferred");         
+            }
+            break;
+        case R_PHONE_ERROR_NO_SERVICE:
+            {
+            ret = hbTrId("txt_phone_dpopinfo_no_network_coverage");         
+            }
+            break;
+        default:
+            break;
+    }
+
+    return ret;
+}
+
+QString PhoneResourceAdapter::convertToString(
+        int symbianResourceId, const QString &text) const
+{
+    QString ret;
+    
+    switch (symbianResourceId) {
+
+        case R_PHONE_TEXT_COLP_CONNECTED:
+            {
+            ret = hbTrId("txt_phone_info_connected_to_1").arg(text);
+            }
+            break;
+        default:
+            break;
+    }
+
+    return ret;
+}
+
+int PhoneResourceAdapter::defaultToolbarResourceId() const
+{
+    return R_PHONEUI_INCALL_DIALER_CBA; //R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA;
+}
+
+QString PhoneResourceAdapter::convertCommandToString(
+        int symbianCommandId ) const
+{
+    QString ret;
+    
+    switch(symbianCommandId) {
+    case EPhoneInCallCmdEndAllCalls:
+        ret = hbTrId("txt_phone_opt_end_all_calls");
+        break;     
+    case EPhoneInCallCmdTransfer:
+        ret = hbTrId("txt_phone_opt_transfer");
+        break;    
+    case EPhoneInCallCmdSwitchToVideo:
+        ret = hbTrId("Call back with video call");
+        break;  
+    case EPhoneCmdHandoverToWlan:
+        ret = hbTrId("Handover to WLAN");
+        break;  
+    case EPhoneCmdHandoverToGsm:
+        ret = hbTrId("Handover to GSM");
+        break;  
+        
+    // TODO
+    default:
+        break;
+    }
+
+    return ret;
+}
+
+QList<HbAction*> PhoneResourceAdapter::convertToHbActions(
+        int symbianResourceId ) const
+{
+    QList<HbAction*> ret;
+    
+    switch(symbianResourceId) {
+        case R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY:
+            {
+            HbAction *leftButton = new HbAction(hbTrId("txt_common_button_send"));
+            leftButton->setData(QVariant(EPhoneInCallCmdContinueSendingDtmfString));
+            ret.append(leftButton);
+    
+            HbAction *rightButton = new HbAction(hbTrId("txt_common_button_cancel"));
+            rightButton->setData(QVariant(EPhoneInCallCmdCancelSendingDtmfString));
+            ret.append(rightButton);
+            }
+            break;
+        case R_PHONEUI_SENDING_DTMF_WAIT_NOTE:
+            {     
+            HbAction *button = new HbAction(hbTrId("txt_common_button_cancel"));
+            button->setData(QVariant(EPhoneInCallCmdCancelSendingDtmfString));
+            ret.append(button); 
+            }
+            break;
+        default:
+            break;
+    }
+
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,496 @@
+/*!
+* 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:  Handles phone ui commands.
+*/
+
+#include "phoneuicommandcontroller.h"
+#include "phoneresourceadapter.h"
+#include "phoneuiqtbuttonscontroller.h"
+#include "qtphonelog.h"
+#include <hbaction.h>
+#include <spsettings.h>
+#include <spentry.h>
+#include <spproperty.h>
+#include <xqphoneappcommands.h>
+#include <phoneappcommands.hrh>
+#include <phoneappvoipcommands.hrh>
+#include <pevirtualengine.h>
+#include <xqteluicommandextension.h>
+
+  
+PhoneUiCommandController::PhoneUiCommandController(
+        PhoneUIQtViewIF &view, QObject *parent) 
+: QObject (parent), m_view(view), m_lastCommandExtension(0)
+{
+    PHONE_DEBUG("PhoneMenuController::PhoneMenuController");
+}
+
+PhoneUiCommandController::~PhoneUiCommandController()
+{
+    PHONE_DEBUG("PhoneMenuController::~PhoneMenuController");
+    for (int i=0;i<m_commandExtensions.count();++i) {
+        m_commandExtensions.at(i)->release();
+    }
+}
+
+void PhoneUiCommandController::setCallMenuActions(
+        QMap<int,int> callStates, QMap<int,int> serviceIds, 
+        int serviceId, int expandedCallId )
+{
+    PHONE_DEBUG("PhoneMenuController::setCallMenuActions");
+    releaseMenu();
+    
+    PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
+    QList<int> menuCmdList = menuCommands(callStates, serviceIds);
+    
+    if (extension) {
+        QList<XQTelUiCommandExtension::CallInfo> callInfo;
+        extension->getCallInfoList(
+                callInfo,callStates,serviceIds,expandedCallId);
+        
+        //Modify command list by extension
+        extension->modifyMenuCommandList(callInfo,menuCmdList);
+        addMenuItems(menuCmdList);
+        
+        extension->addMenuActions(callInfo,m_customMenuActions);        
+        for (int i=0;i<m_customMenuActions.count();++i) {
+            m_view.menuReference().addAction(m_customMenuActions.at(i));
+        }
+    } else {
+        addMenuItems(menuCmdList);
+    }
+        
+    
+}
+
+void PhoneUiCommandController::setDialpadMenuActions()
+{
+    PHONE_DEBUG("PhoneMenuController::setDialpadMenuActions");
+    releaseMenu();
+    QList<PhoneAction*> values;
+    m_view.setMenuActions(values);
+    qDeleteAll(values);
+}
+
+QMap<PhoneAction::ActionType, PhoneAction *> 
+    PhoneUiCommandController::pushButtonActionsForCall( 
+        int callState,
+        bool emergencyCall,
+        QMap<int,int> callStates,
+        QMap<int,int> serviceIds,
+        int serviceId,
+        int callId)
+{
+    QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
+    bool sameServices = areServicesSame(callStates, serviceIds);
+    QList<int> commands = buttonCommandList(
+            callState, emergencyCall, sameServices, callStates.values());
+
+    PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
+    
+    if (extension) {
+        QList<XQTelUiCommandExtension::CallInfo> callInfo;
+        extension->getCallInfoList(
+                callInfo,callStates,serviceIds,callId);
+        
+        //Modify command list by extension
+        extension->modifyPushButtonCommandList(callInfo,commands);
+    }
+    
+    if (1 == commands.count()) {
+        PhoneAction *action = mapCommandToAction(commands.at(0));
+        if (action) {
+            translatedActions[PhoneAction::LeftButton] = action;
+        }
+    } else if (1 < commands.count()){
+        PhoneAction *action = mapCommandToAction(commands.at(0));
+        PhoneAction *action2 = mapCommandToAction(commands.at(1));
+        if (action) {
+            translatedActions[PhoneAction::LeftButton] = action;
+        }
+        if (action2) {
+            translatedActions[PhoneAction::RightButton] = action2;
+        }
+    }
+    
+    return translatedActions;
+}
+
+QList<int> PhoneUiCommandController::menuCommands(
+        QMap<int,int> callStates, QMap<int,int> serviceIds )
+{
+    PHONE_DEBUG("PhoneMenuController::menuCommands");
+    QList<int> commands;
+    bool sameServices = areServicesSame(callStates,serviceIds);
+
+    switch(callStates.values().count()) {
+    case 1: {
+        // No logical string for switch to video option	
+        /*if (callStates.values().contains(EPEStateConnected)) {
+            commands.append(PhoneInCallCmdSwitchToVideo);
+        }*/
+    }
+    break;
+    case 2: {
+        if (!callStates.values().contains(EPEStateRinging) &&
+            !callStates.values().contains(EPEStateDisconnecting) &&
+            !callStates.values().contains(EPEStateDialing)) {
+            commands.append(PhoneInCallCmdEndAllCalls);
+        }
+        if (callStates.values().contains(EPEStateConnected) &&
+            callStates.values().contains(EPEStateHeld)) {
+            if (sameServices) {
+                commands.append(PhoneInCallCmdTransfer);
+            }
+        }
+    }
+    break;
+    case 3: {
+        commands.append(PhoneInCallCmdEndAllCalls);    
+    }
+    break;
+    default:
+        break;
+    }
+    
+    return commands;
+}
+
+void PhoneUiCommandController::addMenuItems(QList<int> menuCmdList)
+{
+    QList<PhoneAction*> values;
+    
+    for (int i=0;i<menuCmdList.count();++i) {
+        int command = mapCommand(menuCmdList.at(i));
+        if (-1 != command) {
+            PhoneAction* phoneAction = new PhoneAction();
+            phoneAction->setCommand(command);
+            phoneAction->setText(
+                    PhoneResourceAdapter::Instance()->
+                        convertCommandToString(command));
+            
+            values.append(phoneAction);
+        }
+    }
+    
+    m_view.setMenuActions(values);
+    qDeleteAll(values);
+}
+
+int PhoneUiCommandController::mapCommand(int command)
+{
+    int ret(-1);
+    
+    switch(command) {
+    case PhoneInCallCmdEndAllCalls:
+        ret = EPhoneInCallCmdEndAllCalls;
+        break;     
+    case PhoneInCallCmdTransfer:
+        ret = EPhoneInCallCmdTransfer;
+        break;    
+    case PhoneInCallCmdSwitchToVideo:
+        ret = EPhoneInCallCmdSwitchToVideo;
+        break;  
+    case PhoneInCallCmdSendMessage:
+        //TODO
+        break;    
+    case PhoneInCallShareVideo:
+        //TODO
+        break;
+    case PhoneInCallCmdHandoverToWlan:
+        ret = EPhoneCmdHandoverToWlan;
+        break;
+    case PhoneInCallCmdHandoverToGsm:
+        ret = EPhoneCmdHandoverToGsm;
+        break;
+    default:
+        break;
+    }
+    
+    return ret;
+}
+
+PhoneCommandExtensionWrapper *PhoneUiCommandController::commandExtension(
+        int serviceId)
+{
+    PhoneCommandExtensionWrapper *extension = 0;
+    TRAP_IGNORE( extension = CommandExtensionL(serviceId) );
+    return extension;
+}
+
+TUid PhoneUiCommandController::ResolveImplementationUidL( 
+        TUint32 aServiceId, TServicePropertyName aPropertyName )
+    {
+    TUid implUid = { 0 };
+    CSPEntry* entry = CSPEntry::NewLC();
+
+    CSPSettings* spSettings = CSPSettings::NewLC(); 
+    
+    User::LeaveIfError(
+        spSettings->FindEntryL( aServiceId, *entry ) ); 
+
+    CleanupStack::PopAndDestroy( spSettings ); 
+
+    const CSPProperty* property = NULL;
+    User::LeaveIfError( entry->GetProperty( property, aPropertyName ) );
+    
+    if ( property ) 
+        {
+        TInt temp(0);
+        User::LeaveIfError( property->GetValue( temp ) );
+        implUid.iUid = temp;
+        }
+
+    CleanupStack::PopAndDestroy( entry );
+    return implUid;   
+    }
+
+PhoneCommandExtensionWrapper 
+    *PhoneUiCommandController::CommandExtensionL( TUint aServiceId )
+{
+    TUid pluginUid = ResolveImplementationUidL( aServiceId, 
+        EPropertyCallMenuHandlerPluginId );
+    
+    int pluginInd(-1);
+    PhoneCommandExtensionWrapper* wrapper = NULL;
+    
+    for (int i=0; i<m_commandExtensions.count();++i) {
+        if (pluginUid.iUid==m_commandExtensions.at(i)->pluginUid()) {
+            pluginInd = i;
+            break;
+        }
+    }
+    
+    if ( -1 == pluginInd )
+        {
+        wrapper = new PhoneCommandExtensionWrapper( pluginUid.iUid );
+        if (wrapper)
+            m_commandExtensions.append( wrapper );
+        }
+    else
+        {
+        wrapper = m_commandExtensions[pluginInd];
+        }
+    
+    m_lastCommandExtension = wrapper;
+    return wrapper;
+}
+
+void PhoneUiCommandController::releaseMenu()
+{
+    PHONE_DEBUG("PhoneMenuController::setDialpadMenuActions");
+    for (int i=0;i<m_customMenuActions.count();i++) {
+        m_view.menuReference().removeAction(m_customMenuActions.at(i));
+    }
+    m_customMenuActions.clear();
+    
+    if (m_lastCommandExtension) {
+        m_lastCommandExtension->releaseMenu();
+        m_lastCommandExtension = 0;
+    }
+}
+
+bool PhoneUiCommandController::areServicesSame(
+        QMap<int,int> callStates, QMap<int,int> serviceIds)
+{
+    bool ret(true);
+    int serviceId(-1);
+    for(int i=0;i<callStates.count()&&ret;++i) {
+        if (-1==serviceId) {
+            serviceId = serviceIds.value(callStates.keys().at(i));
+        } else if (serviceId!=serviceIds.value(callStates.keys().at(i))) {
+            ret = false;
+        }
+    }
+    
+    return ret;
+}
+
+QList<int> PhoneUiCommandController::buttonCommandList(
+        int callState,
+        bool emergencyCall,
+        bool sameServices,
+        QList<int> callStates)
+{
+    QList<int> ret;
+    
+    switch( callState ) {
+    case EPEStateIdle:
+    case EPEStateDisconnecting:
+    case EPEStateConferenceIdle:    
+    break;
+    
+    case EPEStateDialing:
+    case EPEStateConnecting: {
+        ret.append(PhoneInCallCmdEndOutgoingCall);  
+    }
+    break;
+    case EPEStateRinging: {
+        if (callStates.size()<3){
+            ret.append(PhoneInCallCmdAnswer);
+            ret.append(PhoneInCallCmdReject); 
+        } else {
+            ret.append(PhoneInCallCmdReplace); 
+        }
+    }
+    break;
+    
+    case EPEStateConnected:
+    case EPEStateConnectedConference: {
+        if (!emergencyCall) {
+            if ( 1 == callStates.size() || 
+                 (2 == callStates.size() && 
+                  callStates.contains(EPEStateRinging)) ) {
+                ret.append(PhoneInCallCmdHold);
+            } else {
+                
+                if (EPEStateConnectedConference == callState) {
+                    ret.append(PhoneInCallCmdSwap);
+                } else if (sameServices && 
+                    false == PhoneResourceAdapter::Instance()->buttonsController()->
+                        getButtonFlags(PhoneUIQtButtonsController::DisableJoin)) {
+                    if ( callStates.contains(EPEStateHeldConference) ) {
+                        ret.append(PhoneInCallCmdJoinToConference);                  
+                    } else {
+                        ret.append(PhoneInCallCmdCreateConference);
+                    }
+                }
+            }            
+        }
+        
+        ret.append(PhoneInCallCmdEndActive); 
+    }
+    break;
+    
+    case EPEStateHeld:
+    case EPEStateHeldConference: {
+        if (1 == callStates.size() || 
+            (2 == callStates.size() && 
+             callStates.contains(EPEStateRinging))) {
+             
+            ret.append(PhoneInCallCmdUnhold);
+        } else {
+            if (EPEStateHeldConference == callState) {
+                ret.append(PhoneInCallCmdSwap);
+            } else if (sameServices && 
+                    false == PhoneResourceAdapter::Instance()->buttonsController()->
+                        getButtonFlags(PhoneUIQtButtonsController::DisableJoin)) {
+                if ( callStates.contains(EPEStateConnectedConference)) {
+                    ret.append(PhoneInCallCmdJoinToConference);
+                } else {
+                    ret.append(PhoneInCallCmdCreateConference);
+                }
+            }
+        }
+
+        ret.append(PhoneInCallCmdEndActive);
+    }
+    break;
+    
+    case EPEStateUnknown:
+    break;
+    
+    default:
+    break;    
+    }
+    
+    return ret;
+}
+
+PhoneAction *PhoneUiCommandController::mapCommandToAction(int command)
+{
+    PhoneAction *action=0;
+    
+    switch( command ) {
+    case PhoneInCallCmdJoinToConference: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_join_call"));
+        action->setCommand(EPhoneInCallCmdJoin);
+    }
+    break;
+
+    case PhoneInCallCmdCreateConference: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_join_call"));
+        action->setCommand(EPhoneInCallCmdCreateConference);
+    }
+    break;
+        
+    case PhoneInCallCmdAnswer: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_call"));
+        action->setCommand (EPhoneCallComingCmdAnswer);
+        action->setActionRole(PhoneAction::Accept);
+    }
+    break;
+    
+    case PhoneInCallCmdReject: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_reject_call"));
+        action->setCommand (EPhoneCallComingCmdReject);
+        action->setActionRole(PhoneAction::Decline);
+    }
+    break;
+    
+    case PhoneInCallCmdHold: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_hold_call"));
+        action->setCommand(EPhoneInCallCmdHold);
+    }
+    break;
+    
+    case PhoneInCallCmdUnhold: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_call"));
+        action->setCommand(EPhoneInCallCmdUnhold);
+    }
+    break;
+    
+    case PhoneInCallCmdEndActive: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_end_call"));
+        action->setCommand(EPhoneInCallCmdEndThisActiveCall);
+        action->setActionRole(PhoneAction::Decline);
+    }
+    break;
+    
+    case PhoneInCallCmdEndOutgoingCall: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_end_call"));
+        action->setCommand(EPhoneInCallCmdEndThisOutgoingCall);
+        action->setActionRole(PhoneAction::Decline);
+    }
+    break;
+
+    case PhoneInCallCmdReplace: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_replace_call"));
+        action->setCommand(EPhoneInCallCmdReplace);
+        action->setActionRole(PhoneAction::Accept);
+    }
+    break;
+    
+    case PhoneInCallCmdSwap: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_swap"));
+        action->setCommand(EPhoneInCallCmdSwap); 
+    }
+    break;
+    
+    default:
+    break;
+    }
+            
+    return action;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phoneuiqtbuttonscontroller.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include "phoneuiqtbuttonscontroller.h"
+#include <QtDebug>
+
+PhoneUIQtButtonsController::PhoneUIQtButtonsController() : m_buttonFlags(0)
+{
+}
+
+PhoneUIQtButtonsController::~PhoneUIQtButtonsController ()
+{
+}
+
+void PhoneUIQtButtonsController::setButtonFlags (PhoneButtonFlags flag,bool set)
+{
+    if (set) 
+        {
+        // Set the flag on (=1)
+        m_buttonFlags |= flag; 
+        }
+    else 
+        {
+        // Set the flag off (=0)
+        m_buttonFlags &= (~flag);     
+        }
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/phoneuiqtviewadapter.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1181 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone UI's symbian adapter for Qt view.
+*
+*/
+
+#include "phoneuiqtviewadapter.h"
+#include "phoneuiqtviewif.h"
+#include "phonebubblewrapper.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamaudioavailability.h"
+#include "tphonecmdparamaudiooutput.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamemergencycallheaderdata.h"
+#include "tphonecmdparamstring.h"
+#include "cphonepubsubproxy.h"
+#include "pevirtualengine.h"
+#include "cphonepubsubproxy.h"
+#include "cphoneringingtonecontroller.h"
+#include "phoneresourceadapter.h"
+#include "phoneui.hrh"
+#include "cphonemediatorfactory.h"
+#include "phoneuiqtbuttonscontroller.h"
+#include "phoneconstants.h"
+#include "phonenotecontroller.h"
+#include "telephonyservice.h"
+#include "phoneuicommandcontroller.h"
+#include "phonemessagecontroller.h"
+#include "phoneindicatorcontroller.h"
+#include "qtphonelog.h"
+#include <UikonInternalPSKeys.h>
+#include <bubblemanagerif.h>
+#include <hbaction.h>
+#include <pevirtualengine.h>
+#include <xqservicerequest.h>
+#include <QtGlobal>
+#include <xqserviceutil.h>
+#include <hbinstance.h>
+#include <QKeyEvent>
+#include <hbextendedlocale.h>
+#include <hbi18ndef.h>
+#include <eikenv.h>
+#include <w32std.h>
+#include <apgtask.h>
+#include <hbstringutil.h>
+#include <telinformationpskeys.h>
+#include <AknSgcc.h>
+#include <AknCapServerClient.h>
+
+
+//CONSTANTS
+static const int PHONE_CALL_NOT_FOUND = -1;
+
+PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) :
+    QObject (parent), m_view (view), m_idleUid(-1),
+    m_dialpadAboutToClose(false), m_homeScreenToForeground(false),
+    m_carModeEnabled(false)
+{
+    m_bubbleWrapper = new PhoneBubbleWrapper(m_view.bubbleManager (), this);
+    m_noteController = new PhoneNoteController(this);
+    m_uiCommandController = new PhoneUiCommandController(view, this);
+    m_messageController = new PhoneMessageController(this);
+
+    TRAPD( error, m_ringingtonecontroller = CPhoneRingingToneController::NewL () );
+    qt_symbian_throwIfError(error);
+    m_resourceAdapter = PhoneResourceAdapter::Instance(this);
+
+    // display initial toolbar to make client area size correct
+    TPhoneCmdParamInteger intParam;
+    intParam.SetInteger(m_resourceAdapter->defaultToolbarResourceId());
+    setToolbarButtons(&intParam);
+
+    m_telephonyService = new TelephonyService (this, this);
+	m_indicatorController = new PhoneIndicatorController(this);
+
+    // Define car mode pub sub key
+    int err = RProperty::Define(
+        KPSUidTelCarMode,
+        KTelCarMode,
+        RProperty::EInt,
+        KPhoneReadPolicy,
+        KPhoneWritePolicy);
+    
+    // Start listening to car mode changes
+    if(err == KErrNone) {
+        CPhonePubSubProxy::Instance()->NotifyChangeL(KPSUidTelCarMode,
+            KTelCarMode, this);
+    }
+}
+
+PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter ()
+{
+    delete m_ringingtonecontroller;
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId)
+{
+    switch (aCmdId) {
+    case EPhoneAppShutDown:
+        {
+        m_view.shutdownPhoneApp();
+        }
+        break;
+
+    case EPhoneViewSetIdleTopApplication:
+        {
+            TPhoneCmdParamInteger uidParam;
+            uidParam.SetInteger (idleAppUid());
+            setTopApplication (&uidParam);
+        }
+        break;
+
+    case EPhoneViewMuteRingToneOnAnswer:
+        m_ringingtonecontroller->MuteRingingToneOnAnswer();
+        break;
+
+    case EPhoneViewStopRingTone:
+        m_ringingtonecontroller->StopPlaying();
+        break;
+
+    case EPhoneViewMuteRingTone:
+        m_ringingtonecontroller->MuteRingingTone();
+        break;
+
+    case EPhoneViewHideNaviPaneAudioVolume:
+        m_view.removeVolumeSlider ();
+        break;
+
+    case EPhoneViewOpenDialer:
+        openDialpad();
+        break;
+
+    case EPhoneViewRemoveConferenceBubble:
+        removeConferenceBubble();
+        break;
+
+    case EPhoneViewSendToBackground:
+    case EPhoneViewBringIdleToForeground:
+        if (m_homeScreenToForeground) {
+            RWsSession& wsSession = CEikonEnv::Static()->WsSession();
+
+            TApaTaskList taskList( wsSession );
+            _LIT(KPhoneHsAppName,"hsapplication");
+            TApaTask task = taskList.FindApp(KPhoneHsAppName);
+            task.BringToForeground();
+        } else {
+            XQServiceUtil::toBackground(true);
+        }
+
+        m_homeScreenToForeground = false;
+        break;
+    case EPhoneViewRemoveAllCallHeaders:
+        removeAllCallHeaders();
+        break;
+    case EPhoneViewRemoveNumberEntry:
+    case EPhoneViewClearNumberEntryContent: // Fall through
+        removeDialpad();
+        break;
+    case EPhoneViewAddToConference:
+        addToConference();
+        break;
+    case EPhoneViewRemoveDtmfNote:
+        m_noteController->removeDtmfNote();
+        break;
+    case EPhoneViewRemoveNote:
+        m_noteController->removeNote();
+        break;
+    case EPhoneViewRemoveQuery:
+        m_noteController->removeQuery();
+        break;
+    case EPhoneViewRemovePhoneDialogs:
+        m_noteController->removeNote();
+        m_noteController->removeQuery();
+        break;
+    case EPhoneViewRemoveGlobalNote:
+    case EPhoneViewRemoveGlobalWaitNote:
+        m_noteController->removeGlobalWaitNote();
+        break;
+    case EPhoneViewUpdateFSW:
+        setHidden(true);
+        break;
+    default:
+        break;
+    }
+ CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId );
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId)
+{
+    switch (aCmdId) {
+    case EPhoneViewRemoveCallHeader:
+        {
+        m_bubbleWrapper->bubbleManager().startChanges();
+        int bubble = m_bubbleWrapper->bubbles().value(aCallId);
+        m_view.clearBubbleCommands(bubble);
+        m_view.removeExpandAction(bubble);
+        m_bubbleWrapper->removeCallHeader (aCallId);
+        m_bubbleWrapper->bubbleManager().endChanges();
+        m_indicatorController->clearActiveCallData();
+        }
+        break;
+    case EPhoneViewRemoveFromConference:
+        removeCallFromConference(aCallId);
+        break;
+    case EPhoneViewPrivateFromConference:
+        setPrivateFromConference(aCallId);
+        break;
+    default:
+        break;
+    }
+   CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId );
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam)
+{
+    switch (aCmdId) {
+    case EPhoneViewSetTopApplication:
+        setTopApplication (aCommandParam);
+        break;
+    case EPhoneViewPlayRingTone:
+        m_ringingtonecontroller->PlayRingToneL( aCommandParam );
+        break;
+    case EPhoneViewSetTouchPaneButtons:
+        setTouchButtons (aCommandParam);
+        setExpandActions();
+        break;
+    case EPhoneViewUpdateCba:
+        setToolbarButtons (aCommandParam);
+        break;
+    case EPhoneViewSetHoldFlag:
+        setCallHoldFlag (aCommandParam);
+        break;
+    case EPhoneViewGetHoldFlag:
+        callHoldFlag (aCommandParam);
+        break;
+    case EPhoneViewSetNaviPaneAudioVolume:
+        setAudioVolumeSliderValue (aCommandParam);
+        break;
+    case EPhoneViewActivateMuteUIChanges:
+        setMuteIndication(aCommandParam);
+        break;
+    case EPhoneViewGetCountOfActiveCalls:
+        activeCallCount(aCommandParam);
+        break;
+    case EPhoneViewActivateAudioPathUIChanges:
+        setAudioPath(aCommandParam);
+        break;
+    case EPhoneViewGetExpandedBubbleCallId:
+        expandedBubbleCallId(aCommandParam);
+        break;
+    case EPhoneViewGetIsConference:
+        isConference(aCommandParam);
+        break;
+    case EPhoneViewBringAppToForeground:
+        bringToForeground();
+        break;
+    case EPhoneViewShowGlobalNote:
+        showGlobalNote(aCommandParam);
+        break;
+    case EPhoneViewSetNumberEntryVisible:
+        setDialpadVisibility(aCommandParam);
+        break;
+    case EPhoneViewGetNumberEntryCount:
+        getDialpadStringLength(aCommandParam);
+        break;
+    case EPhoneViewGetNumberFromEntry:
+        getNumberFromDialpad(aCommandParam);
+        break;
+    case EPhoneViewShowNote:
+        showNote(aCommandParam);
+        break;
+    case EPhoneViewShowQuery:
+        m_noteController->showQuery(aCommandParam);
+        break;
+    case EPhoneViewOpenSoftRejectEditor:
+        m_messageController->openSoftRejectMessageEditor(aCommandParam);
+        break;
+    default:
+        break;
+    }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, *aCommandParam );
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
+    TPhoneCommandParam *aCommandParam)
+{
+    switch (aCmdId) {
+    case EPhoneViewCreateCallHeader:
+        createCallHeader (aCallId, aCommandParam);
+        break;
+    case EPhoneViewCreateEmergencyCallHeader:
+        createEmergencyCallHeader (aCallId, aCommandParam);
+        break;
+    case EPhoneViewUpdateBubble:
+        updateCallHeaderState (aCallId, aCommandParam);
+        setExpandActions();
+        break;
+    case EPhoneViewUpdateCallHeaderRemoteInfoData:
+        updateCallHeaderRemoteInfo (aCallId, aCommandParam);
+        break;
+    case EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel:
+        updateCallHeaderRemoteInfoAndLabel(aCallId, aCommandParam);
+        break;
+    case EPhoneViewCreateConference:
+        createConferenceBubble(aCallId, aCommandParam);
+        break;
+    case EPhoneViewGetCallExistsInConference:
+        conferenceCallId(aCallId, aCommandParam);
+        break;
+    case EPhoneViewUpdateCallHeaderCallDuration:
+    {
+        TPhoneCmdParamInteger *time = static_cast<TPhoneCmdParamInteger *>(aCommandParam);
+        QString duration = convertDuration(time->Integer());
+        PHONE_DEBUG2("call duration:", duration);
+        int bubbleId = m_bubbleWrapper->bubbleId(aCallId);
+        
+        if (-1 != bubbleId) {
+            m_bubbleWrapper->bubbleManager().updateCallTime(bubbleId, duration);
+        }
+        break;
+    }
+
+    case EPhoneViewCipheringInfoChange:
+    {
+        handleCipheringInfoChange(aCallId, aCommandParam);
+        break;
+    }
+
+    default:
+        break;
+    }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId, *aCommandParam );
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
+    TDesC &aMessage)
+{
+    switch (aCmdId) {
+
+    default:
+        break;
+    }
+    CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId, &aMessage );
+}
+
+TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId)
+{
+    TPhoneViewResponseId response = EPhoneViewResponseSuccess;
+
+    switch (aCmdId) {
+    case EPhoneIsDTMFDialerVisible:
+    case EPhoneViewIsDTMFEditorVisible: //TODO
+    case EPhoneIsCustomizedDialerVisible:
+    case EPhoneViewGetNeedToSendToBackgroundStatus:
+        // TODO: currently not supported
+        response = EPhoneViewResponseFailed;
+        break;
+    case EPhoneViewIsMenuBarVisible:
+        {
+        //TODO
+        response = EPhoneViewResponseFailed;
+        break;
+        }
+    case EPhoneViewGetNumberEntryIsVisibleStatus:
+    case EPhoneViewGetNumberEntryIsUsedStatus: // Fall through
+        {
+        response = (m_view.isDialpadVisible() && !m_dialpadAboutToClose) ?
+                        EPhoneViewResponseSuccess :
+                        EPhoneViewResponseFailed;
+        break;
+        }
+    default:
+        break;
+    }
+
+    return response;
+}
+
+TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId,
+    TPhoneCommandParam *aCommandParam)
+{
+    TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess;
+
+    switch (aCmdId) {
+    case EPhoneViewGetCallIdByState:
+        viewResponse = callIdByState (aCommandParam);
+        break;
+    case EPhoneViewSelectedConfMember:
+        viewResponse = getSelectedConferenceMember (aCommandParam);
+        break;
+    default:
+        break;
+    }
+
+    return viewResponse;
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId)
+{
+    switch (aCmdId) {
+    case EPhoneSetConferenceExpanded:
+        m_bubbleWrapper->bubbleManager ().startChanges ();
+        m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(
+                m_bubbleWrapper->conferenceCallList().size());
+        m_bubbleWrapper->bubbleManager ().endChanges ();
+        break;
+    case EPhoneViewBeginUpdate:
+        m_bubbleWrapper->bubbleManager ().startChanges ();
+        break;
+    case EPhoneViewEndUpdate:
+        m_bubbleWrapper->bubbleManager ().endChanges ();
+        break;
+    case EPhoneViewOpenContacts:
+        openContacts();
+        break;
+    default:
+        break;
+    }
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId, TPhoneCommandParam *aCommandParam)
+{
+    switch (aCmdId) {
+    case EPhoneViewGetAudioVolumeLevel:
+        writeAudioVolumeLevel (aCommandParam);
+        break;
+    case EPhoneViewGetNumberFromEntry:
+        getNumberFromDialpad(aCommandParam);
+        break;
+    case EPhoneViewSetDtmfOptionsFlag:
+        //TODO
+        break;
+    case EPhoneViewSetVideoCallDTMFVisibilityFlag:
+        //TODO
+        break;
+    case EPhoneViewBackButtonActive: {
+        TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
+        m_view.setBackButtonVisible(param->Boolean());
+		}
+        break;
+    case EPhoneViewHsToForegroundAfterCall: {
+        TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam);
+        m_homeScreenToForeground = param->Boolean();
+        }
+        break;
+    default:
+        break;
+    }
+}
+
+const TDesC& PhoneUIQtViewAdapter::FetchContent ()
+{
+    return KNullDesC;
+}
+
+void PhoneUIQtViewAdapter::dialpadClosed()
+{
+    m_dialpadAboutToClose = true;
+    setCallMenu();
+}
+
+PhoneNoteController* PhoneUIQtViewAdapter::noteController() const
+{
+    return m_noteController;
+}
+
+void PhoneUIQtViewAdapter::keyReleased(QKeyEvent */*event*/)
+{
+    if (m_view.isDialpadVisible() &&
+        false == m_dialpadAboutToClose ) {
+        setDialpadMenu();
+    }
+}
+
+void PhoneUIQtViewAdapter::handleWindowActivated()
+{
+    m_indicatorController->disableActiveCallIndicator();
+}
+
+void PhoneUIQtViewAdapter::handleWindowDeactivated()
+{
+    m_indicatorController->enableActiveCallIndicator();
+}
+
+void PhoneUIQtViewAdapter::setTopApplication (TPhoneCommandParam *commandParam)
+{
+    TPhoneCmdParamInteger *integerParam = static_cast<TPhoneCmdParamInteger *> (commandParam);
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(
+        KPSUidUikon,
+        KUikVideoCallTopApp,
+        integerParam->Integer() );
+
+    // Hide the Phone icon if it is not the top application
+    // TODO: how to do this?
+}
+
+int PhoneUIQtViewAdapter::idleAppUid ()
+{
+// <-- QT HS START -->
+   /* if ( m_idleUid == -1 ) {
+        // Get Idle's UID from PubSub.
+        m_idleUid = CPhonePubSubProxy::Instance()->Value (KPSUidAiInformation,
+            KActiveIdleUid );
+    }*/
+    m_idleUid=0x20022F35;
+// <-- QT HS END -->
+    return m_idleUid;
+}
+
+void PhoneUIQtViewAdapter::createCallHeader(
+    int callId,
+    TPhoneCommandParam *commandParam )
+{
+    PHONE_DEBUG("PhoneUIQtViewAdapter::createCallHeader");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData);
+
+    TPhoneCmdParamCallHeaderData &data =
+        static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam);
+
+    m_bubbleWrapper->bubbleManager ().startChanges ();
+
+    if (m_bubbleWrapper->bubbleManager().isConferenceExpanded())
+        {
+        m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(false);
+        }
+
+    int bubble = m_bubbleWrapper->createCallHeader (callId);
+    m_bubbleWrapper->setState (callId, bubble, data.CallState ());
+    m_bubbleWrapper->setCli (bubble, data.CLIText ());
+    m_bubbleWrapper->setServiceId(callId, data.ServiceId());
+    m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ());
+    m_bubbleWrapper->setLabel (bubble, data.LabelText ());
+    m_bubbleWrapper->setCallType (bubble, data.CallType ());
+    m_bubbleWrapper->setDivert (bubble, data.Diverted ());
+    m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering());
+
+    if (data.Picture().Length()) {
+        QString imagePath =
+            QString::fromUtf16(data.Picture().Ptr(),data.Picture().Length());
+        m_bubbleWrapper->bubbleManager().setCallObjectImage(bubble,imagePath);
+    } else {
+        m_bubbleWrapper->bubbleManager().setCallObjectFromTheme(bubble);
+    }
+    m_bubbleWrapper->bubbleManager ().endChanges ();
+    
+    if (1 == m_bubbleWrapper->bubbles().keys().count()) {
+        setHidden(false);
+    }
+    m_indicatorController->setActiveCallData( data.CLIText(), KNullDesC );
+}
+
+void PhoneUIQtViewAdapter::createEmergencyCallHeader(
+    int callId,
+    TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneUIQtViewAdapter::createEmergencyCallHeader");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdEmergencyCallHeaderData);
+
+    TPhoneCmdParamEmergencyCallHeaderData &data =
+        static_cast<TPhoneCmdParamEmergencyCallHeaderData &> (*commandParam);
+
+    m_bubbleWrapper->bubbleManager ().startChanges ();
+    int bubble = m_bubbleWrapper->createCallHeader (callId);
+    m_bubbleWrapper->setLabel (bubble, data.LabelText ());
+    m_bubbleWrapper->setCli (bubble, data.HeaderText ());
+    m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering());
+    m_bubbleWrapper->bubbleManager ().endChanges ();
+}
+
+void PhoneUIQtViewAdapter::updateCallHeaderState (
+    int callId,
+    TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneUIQtViewAdapter::updateCallHeaderState");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData);
+
+    TPhoneCmdParamCallHeaderData &data =
+            static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam);
+
+    int bubble = m_bubbleWrapper->bubbleId (callId);
+    if ( -1 != bubble ) {
+        m_bubbleWrapper->bubbleManager ().startChanges ();
+        m_bubbleWrapper->setState (callId, bubble, data.CallState ());
+        m_bubbleWrapper->setLabel (bubble, data.LabelText ());
+        m_bubbleWrapper->setDivert (bubble, data.Diverted ());
+        m_bubbleWrapper->bubbleManager ().endChanges ();
+    }
+}
+
+void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo (int callId, TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData);
+
+    TPhoneCmdParamCallHeaderData &data =
+         static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam);
+
+
+     int bubble = m_bubbleWrapper->bubbleId (callId);
+     if ( -1 != bubble ) {
+         m_bubbleWrapper->bubbleManager ().startChanges ();
+         m_bubbleWrapper->setCli (bubble, data.CLIText ());
+         m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ());
+         m_bubbleWrapper->setDivert (bubble, data.Diverted ());
+         m_bubbleWrapper->bubbleManager ().endChanges ();
+     }
+
+}
+
+void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfoAndLabel (int callId, TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneUIQtViewAdapter::updateCallHeaderRemoteInfoAndLabel");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData);
+
+    TPhoneCmdParamCallHeaderData &data =
+         static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam);
+
+     int bubble = m_bubbleWrapper->bubbleId (callId);
+     if ( -1 != bubble ) {
+         m_bubbleWrapper->bubbleManager ().startChanges ();
+         m_bubbleWrapper->setCli (bubble, data.CLIText ());
+         m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ());
+         m_bubbleWrapper->setLabel (bubble, data.LabelText ());
+         m_bubbleWrapper->setDivert (bubble, data.Diverted ());
+         m_bubbleWrapper->bubbleManager ().endChanges ();
+     }
+}
+
+void PhoneUIQtViewAdapter::handleCipheringInfoChange(int callId, TPhoneCommandParam *commandParam)
+{
+    TPhoneCmdParamCallHeaderData *param =
+        static_cast<TPhoneCmdParamCallHeaderData*>(commandParam);
+
+    int bubble = m_bubbleWrapper->bubbleId(callId);        
+    if ( -1 != bubble ) {        
+        m_bubbleWrapper->bubbleManager().startChanges();
+        m_bubbleWrapper->setCiphering(m_bubbleWrapper->bubbleId(callId),
+                                      param->CipheringIndicatorAllowed(),
+                                      param->Ciphering());
+        m_bubbleWrapper->bubbleManager().endChanges();
+    }
+}
+
+TPhoneViewResponseId PhoneUIQtViewAdapter::callIdByState (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallStateData);
+
+    TPhoneCmdParamCallStateData &stateParam =
+        static_cast<TPhoneCmdParamCallStateData &>(*commandParam);
+
+    stateParam.SetCallId (m_bubbleWrapper->callId (stateParam.CallState ()));
+    return EPhoneViewResponseSuccess;
+}
+
+void PhoneUIQtViewAdapter::setTouchButtons (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean);
+
+    TPhoneCmdParamBoolean &param =
+        static_cast<TPhoneCmdParamBoolean &>(*commandParam);
+    bool emergencyCall = param.Boolean();
+
+    m_bubbleWrapper->bubbleManager ().startChanges ();
+    m_view.clearParticipantListActions();
+
+    QList<int> bubbles = m_bubbleWrapper->bubbles().keys();
+
+    m_resourceAdapter->buttonsController()->setButtonFlags(
+            PhoneUIQtButtonsController::DisableJoin,
+            (5 <= m_bubbleWrapper->conferenceCallList().count()));
+
+    for (int j = 0; j < bubbles.size(); ++j){
+        int callId = bubbles.at(j);
+        // Clear bubble
+        m_view.clearBubbleCommands(m_bubbleWrapper->bubbles().value(callId));
+
+		// Get bubble actions by call type
+        QMap<PhoneAction::ActionType, PhoneAction *> actions =
+            m_uiCommandController->pushButtonActionsForCall(
+                               m_bubbleWrapper->callStates().value(callId),
+                               emergencyCall,
+                               m_bubbleWrapper->callStates(),
+                               m_bubbleWrapper->serviceIds(),
+                               m_bubbleWrapper->serviceIdByCallId(callId),
+                               callId);
+
+        QList<PhoneAction *> values = actions.values();
+        for (int i = 0; i < values.size (); ++i) {
+            PhoneAction *action = values.at (i);
+            m_view.addBubbleCommand(m_bubbleWrapper->bubbles().value(callId),
+                                    *action);
+            delete action;
+        }
+    }
+
+    setParticipantListActions();
+    setExpandedConferenceCallHeader();
+    setBubbleSelectionFlag();
+    setMenu();
+
+    m_bubbleWrapper->bubbleManager ().endChanges ();
+}
+
+void PhoneUIQtViewAdapter::setToolbarButtons (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
+
+    TPhoneCmdParamInteger &intParam =
+        static_cast<TPhoneCmdParamInteger &>(*commandParam);
+
+    m_resourceAdapter->buttonsController()->setButtonFlags(
+            PhoneUIQtButtonsController::DisableJoin,
+            (5 <= m_bubbleWrapper->conferenceCallList().count()));
+
+    QMap<PhoneAction::ActionType, PhoneAction *> actions = m_resourceAdapter->convert (intParam.Integer ());
+    QList<PhoneAction*> values = actions.values();
+
+    if (actions.count()) {
+        m_view.setToolbarActions(values);
+    }
+
+    qDeleteAll(actions);
+}
+
+void PhoneUIQtViewAdapter::setCallHoldFlag (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean);
+
+    TPhoneCmdParamBoolean &boolParam =
+        static_cast<TPhoneCmdParamBoolean &>(*commandParam);
+
+    m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Hold,
+                                                           boolParam.Boolean ());
+}
+
+void PhoneUIQtViewAdapter::callHoldFlag (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean);
+
+    TPhoneCmdParamBoolean &boolParam =
+        static_cast<TPhoneCmdParamBoolean &>(*commandParam);
+    boolParam.SetBoolean (m_resourceAdapter->buttonsController()->getButtonFlags(PhoneUIQtButtonsController::Hold));
+}
+
+void PhoneUIQtViewAdapter::writeAudioVolumeLevel (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
+
+    TPhoneCmdParamInteger &intParam =
+        static_cast<TPhoneCmdParamInteger &>(*commandParam);
+    intParam.SetInteger (m_view.volumeSliderValue ());
+}
+
+void PhoneUIQtViewAdapter::setAudioVolumeSliderValue (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
+
+    TPhoneCmdParamInteger &intParam =
+        static_cast<TPhoneCmdParamInteger &>(*commandParam);
+
+    m_view.setVolumeSliderValue(intParam.Integer(),
+                                EPhoneInCallCmdSetVolumeLevel,
+                                KPhoneVolumeMaxValue,
+                                KPhoneVolumeMinValue );
+}
+
+void PhoneUIQtViewAdapter::setMuteIndication (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean);
+    TPhoneCmdParamBoolean &boolParam =
+            static_cast<TPhoneCmdParamBoolean &>(*commandParam);
+    m_bubbleWrapper->bubbleManager().setPhoneMuted(boolParam.Boolean());
+}
+
+void PhoneUIQtViewAdapter::activeCallCount (TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
+
+    TPhoneCmdParamInteger &integerParam =
+        static_cast<TPhoneCmdParamInteger&>(*commandParam);
+    integerParam.SetInteger (m_bubbleWrapper->activeCallCount());
+}
+
+void PhoneUIQtViewAdapter::setAudioPath (TPhoneCommandParam *commandParam)
+    {
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdAudioOutput);
+
+    TPhoneCmdParamAudioOutput &outputParam =
+        static_cast<TPhoneCmdParamAudioOutput &>(*commandParam);
+
+    m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Ihf,
+                              outputParam.AudioOutput() == EPELoudspeaker);
+    m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Wired,
+                              outputParam.AudioOutput() == EPEWiredAudioAccessory);
+    m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Btaa,
+                              outputParam.AudioOutput() == EPEBTAudioAccessory);
+    }
+
+void PhoneUIQtViewAdapter::expandedBubbleCallId(TPhoneCommandParam *commandParam)
+    {
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
+
+    TPhoneCmdParamInteger &outputParam =
+            static_cast<TPhoneCmdParamInteger &>(*commandParam);
+    int callId = PHONE_CALL_NOT_FOUND;
+
+    if ( 0<m_bubbleWrapper->callStates().keys().size() ) {
+        int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble();
+        callId = m_bubbleWrapper->callIdByBubbleId(bubbleId);
+    }
+
+    outputParam.SetInteger( callId );
+    }
+
+void PhoneUIQtViewAdapter::openDialpad()
+    {
+    m_dialpadAboutToClose = false;
+    m_view.showDialpad();
+    setDialpadMenu();
+    }
+
+void PhoneUIQtViewAdapter::createConferenceBubble(int callId, TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneUIQtViewAdapter::createConferenceBubble");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData);
+
+    TPhoneCmdParamCallHeaderData &data =
+         static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam);
+
+    int bubble = m_bubbleWrapper->createConferenceBubble(
+            callId, data.CallState(), data.LabelText(), data.CLIText());
+
+    m_bubbleWrapper->setServiceId(callId,data.ServiceId());
+    m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering());
+}
+
+void PhoneUIQtViewAdapter::conferenceCallId(int callId, TPhoneCommandParam *commandParam)
+{
+    PHONE_DEBUG("PhoneUIQtViewAdapter::conferenceCallId");
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean);
+
+    TPhoneCmdParamBoolean*  conferenceDataValue =
+        static_cast<TPhoneCmdParamBoolean*>(
+                commandParam );
+
+    conferenceDataValue->SetBoolean(m_bubbleWrapper->conferenceCallId(callId));
+}
+
+void PhoneUIQtViewAdapter::removeConferenceBubble()
+{
+    m_bubbleWrapper->bubbleManager().startChanges();
+    m_view.removeExpandAction(m_bubbleWrapper->bubbleId(KConferenceCallId));
+    m_bubbleWrapper->removeConferenceBubble();
+    m_bubbleWrapper->bubbleManager().endChanges();
+}
+
+void PhoneUIQtViewAdapter::isConference(TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean);
+
+    TPhoneCmdParamBoolean*  conferenceDataValue =
+        static_cast<TPhoneCmdParamBoolean*>(
+                commandParam );
+
+    conferenceDataValue->SetBoolean(0<m_bubbleWrapper->conferenceCallList().size());
+}
+
+void PhoneUIQtViewAdapter::removeCallFromConference(int callId)
+{
+    m_bubbleWrapper->bubbleManager().startChanges();
+    m_bubbleWrapper->removeCallFromConference(callId);
+    int bubbleId = m_bubbleWrapper->bubbles().value(callId);
+    m_view.clearBubbleCommands(bubbleId);
+    m_view.removeExpandAction(bubbleId);
+    m_bubbleWrapper->removeCallHeader(callId);
+    m_bubbleWrapper->bubbleManager().endChanges();
+}
+
+TPhoneViewResponseId PhoneUIQtViewAdapter::getSelectedConferenceMember(
+        TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger);
+    TPhoneViewResponseId ret = EPhoneViewResponseSuccess;
+    TPhoneCmdParamInteger*  integerValue =
+        static_cast<TPhoneCmdParamInteger*>(
+                commandParam );
+
+    int bubbleId = m_bubbleWrapper->bubbleManager().selectionIdInConference();
+    int callId = m_bubbleWrapper->callIdByBubbleId(bubbleId);
+
+    if (callId == -1) {
+        ret = EPhoneViewResponseFailed;
+    } else {
+        integerValue->SetInteger(callId);
+    }
+
+    return ret;
+}
+
+void PhoneUIQtViewAdapter::setPrivateFromConference(int callId)
+{
+    m_bubbleWrapper->bubbleManager().startChanges();
+    m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(false);
+    m_bubbleWrapper->removeCallFromConference(callId);
+    m_view.clearBubbleCommands(m_bubbleWrapper->bubbles().value(callId));
+    m_bubbleWrapper->bubbleManager().endChanges();
+}
+
+void PhoneUIQtViewAdapter::setExpandActions()
+{
+    /* If there is 2 or more calls ongoing then we should
+     * enable expancion swap*/
+    int heldBubble = -1;
+
+    if ( 2 <= m_bubbleWrapper->callStates().values().size() ) {
+        if (callsExists(EPEStateConnected,EPEStateHeld)) {
+            heldBubble =
+                m_bubbleWrapper->bubbleId(m_bubbleWrapper->callId(EPEStateHeld));
+            m_view.setExpandAction(heldBubble, EPhoneInCallCmdSwap);
+        } else if (callsExists(EPEStateConnected,EPEStateHeldConference)) {
+            heldBubble =
+                m_bubbleWrapper->bubbleId(m_bubbleWrapper->callId(EPEStateHeldConference));
+            m_view.setExpandAction(heldBubble, EPhoneInCallCmdSwap);
+        } else if (callsExists(EPEStateRinging,EPEStateHeld)) {
+            heldBubble =
+                m_bubbleWrapper->bubbleId(m_bubbleWrapper->callId(EPEStateHeld));
+            m_view.setExpandAction(heldBubble, EPhoneInCallCmdUnhold);
+        }
+
+        QList<int> calls = m_bubbleWrapper->bubbles().keys();
+        foreach (int call, calls) {
+            int bubbleId = m_bubbleWrapper->bubbleId(call);
+            if ( bubbleId != heldBubble ) {
+                 m_view.setExpandAction(bubbleId, EPhoneCmdUpdateUiControls);
+            }
+        }
+    }
+}
+
+bool PhoneUIQtViewAdapter::callsExists(int call1State, int call2State)
+{
+    bool callsExist(false);
+    if ( m_bubbleWrapper->callStates().values().contains(call1State) &&
+         m_bubbleWrapper->callStates().values().contains(call2State) ) {
+        callsExist = true;
+    }
+    return callsExist;
+}
+
+void PhoneUIQtViewAdapter::setParticipantListActions()
+{
+    if ( 0<m_bubbleWrapper->conferenceCallList().size() ) {
+        m_view.addParticipantListAction(
+                EPhoneInCallCmdPrivate,
+                hbTrId("txt_phone_button_private"),
+                HbIcon("qtg_mono_private_call"));
+        m_view.addParticipantListAction(
+                EPhoneInCallCmdDrop,
+                hbTrId("txt_phone_button_drop"),
+                HbIcon("qtg_mono_drop_call"));
+    }
+}
+
+void PhoneUIQtViewAdapter::setExpandedConferenceCallHeader()
+{
+    int callId = PHONE_CALL_NOT_FOUND;
+
+    if ( 1==m_bubbleWrapper->bubbles().keys().size()
+         || (1<m_bubbleWrapper->bubbles().keys().size()
+         && false == m_bubbleWrapper->callStates().values().contains(EPEStateRinging)
+         && false == m_bubbleWrapper->callStates().values().contains(EPEStateDialing)
+         && false == m_bubbleWrapper->callStates().values().contains(EPEStateConnecting)
+         && false == m_bubbleWrapper->callStates().values().contains(EPEStateHeldConference))) {
+
+        int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble();
+        callId = m_bubbleWrapper->callIdByBubbleId(bubbleId);
+    }
+
+    m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(
+            (KConferenceCallId == callId));
+}
+
+void PhoneUIQtViewAdapter::bringToForeground()
+{
+    if(!m_carModeEnabled) {
+        m_view.bringToForeground();
+    }
+}
+
+void PhoneUIQtViewAdapter::showGlobalNote(
+        TPhoneCommandParam *commandParam)
+{
+    m_noteController->showGlobalNote(commandParam);
+}
+
+void PhoneUIQtViewAdapter::setDialpadVisibility(
+        TPhoneCommandParam *commandParam)
+{
+    Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean);
+    TPhoneCmdParamBoolean* booleanParam =
+        static_cast<TPhoneCmdParamBoolean*>(commandParam);
+
+    if (booleanParam->Boolean()) {
+        m_dialpadAboutToClose = false;
+        m_view.showDialpad();
+    } else {
+        m_view.hideDialpad();
+    }
+}
+
+void PhoneUIQtViewAdapter::removeAllCallHeaders()
+{
+    if (m_bubbleWrapper->conferenceCallList().size()) {
+        removeConferenceBubble();
+    }
+
+    QList<int> callIds = m_bubbleWrapper->bubbles().keys();
+
+    for (int i=0; i<callIds.size(); ++i) {
+        int callId = callIds.at(i);
+        if (KEmergencyCallId != callId) {
+            m_bubbleWrapper->bubbleManager().startChanges();
+            int bubble = m_bubbleWrapper->bubbles().value(callId);
+            m_view.clearBubbleCommands(bubble);
+            m_view.removeExpandAction(bubble);
+            m_bubbleWrapper->removeCallHeader (callId);
+            m_bubbleWrapper->bubbleManager().endChanges();
+        }
+    }
+    m_indicatorController->clearActiveCallData();
+}
+
+void PhoneUIQtViewAdapter::getNumberFromDialpad(
+        TPhoneCommandParam *commandParam)
+{
+
+    TPhoneCmdParamString* entryContent =
+        static_cast<TPhoneCmdParamString*>(commandParam);
+    
+    QString westernNumber = 
+        HbStringUtil::convertDigitsTo(m_view.dialpadText(), WesternDigit);
+    
+    (*entryContent->String()).Copy(westernNumber.utf16());         
+}
+
+void PhoneUIQtViewAdapter::getDialpadStringLength(
+        TPhoneCommandParam *commandParam)
+{
+
+    TPhoneCmdParamInteger* integerParam =
+        static_cast<TPhoneCmdParamInteger*>(commandParam);
+
+    integerParam->SetInteger(m_view.dialpadText().length());
+}
+
+void PhoneUIQtViewAdapter::removeDialpad()
+{
+    m_view.clearAndHideDialpad();
+}
+
+void PhoneUIQtViewAdapter::addToConference()
+{
+    m_bubbleWrapper->addToConferenceBubble();
+}
+
+void PhoneUIQtViewAdapter::setMenu()
+{
+    if (m_view.isDialpadVisible() && false == m_dialpadAboutToClose) {
+        setDialpadMenu();
+    } else {
+        setCallMenu();
+    }
+}
+
+void PhoneUIQtViewAdapter::setCallMenu()
+{
+    if ( 0<m_bubbleWrapper->callStates().keys().size() ) {
+        int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble();
+        int callId = m_bubbleWrapper->callIdByBubbleId(bubbleId);
+        m_uiCommandController->setCallMenuActions(
+                m_bubbleWrapper->callStates(),
+                m_bubbleWrapper->serviceIds(),
+                m_bubbleWrapper->serviceIdByCallId(callId),
+                callId );
+    }
+
+}
+
+void PhoneUIQtViewAdapter::setDialpadMenu()
+{
+    m_uiCommandController->setDialpadMenuActions();
+}
+
+void PhoneUIQtViewAdapter::showNote(TPhoneCommandParam *commandParam)
+{
+    m_noteController->showNote(commandParam);
+}
+
+QString PhoneUIQtViewAdapter::convertDuration(TInt secs)
+    {
+    QTime init(0,0,0);
+    QTime duration = init.addSecs(secs);
+    HbExtendedLocale locale = HbExtendedLocale::system();
+    QString durationString = locale.format(duration, QString(r_qtn_time_durat_long));
+    return HbStringUtil::convertDigits(durationString); 
+} 
+
+void PhoneUIQtViewAdapter::setBubbleSelectionFlag()
+{
+    bool selectionFlag = ((m_bubbleWrapper->callStates().
+                              values().contains(EPEStateRinging) &&
+                           m_bubbleWrapper->conferenceCallList().count())||
+                          m_bubbleWrapper->callStates().
+                              values().contains(EPEStateDialing) ||
+                          m_bubbleWrapper->callStates().
+                              values().contains(EPEStateConnecting));
+
+    m_bubbleWrapper->bubbleManager().setBubbleSelectionDisabled(selectionFlag);
+}
+
+void PhoneUIQtViewAdapter::HandlePropertyChangedL(const TUid& aCategory, 
+    const TUint aKey, const TInt aValue)
+{
+    if((aCategory == KPSUidTelCarMode) && (aKey == KTelCarMode)) {
+        if(aValue == EPSCarModeOff) {
+            m_carModeEnabled = false;
+        } else if(aValue == EPSCarModeOn) {
+            m_carModeEnabled = true;
+        } else {
+            Q_ASSERT(false);
+        }
+    }
+}
+
+void PhoneUIQtViewAdapter::setHidden(bool hidden)
+{
+    TRAP_IGNORE(SetHiddenL(hidden));
+}
+
+void PhoneUIQtViewAdapter::SetHiddenL(bool hidden)
+{
+    CEikonEnv* env = CEikonEnv::Static();
+    
+    if (env) {
+        CApaWindowGroupName* windowGroupName =
+            CApaWindowGroupName::NewLC(
+                    env->WsSession(),
+                    env->RootWin().Identifier() );
+        
+        windowGroupName->SetHidden( hidden );
+        User::LeaveIfError(
+                windowGroupName->SetWindowGroupName(
+                        env->RootWin() ) );
+        
+        CleanupStack::PopAndDestroy( windowGroupName );
+
+        CAknSgcClient::AknSrv()->UpdateTaskList();
+    }
+}
+
+void PhoneUIQtViewAdapter::openContacts()
+{
+    XQServiceRequest snd("com.nokia.services.phonebookappservices.Launch","launch()", false);
+    int retValue;
+    snd.send(retValue);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/src/telephonyservice.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: telephony service
+*
+*/
+
+#include <xqserviceutil.h>
+#include "telephonyservice.h"
+#include "phoneuiqtviewadapter.h"
+#include "tphonecmdparaminteger.h"
+#include "qtphonelog.h"
+
+TelephonyService::TelephonyService( PhoneUIQtViewAdapter *viewAdapter, QObject* parent) :
+    XQServiceProvider(QLatin1String("com.nokia.services.telephony.uistarter"), parent),
+    m_viewAdapter (viewAdapter)
+{
+    PHONE_DEBUG("TelephonyService::TelephonyService");
+    publishAll();
+}
+
+TelephonyService::~TelephonyService()
+{
+    PHONE_DEBUG("TelephonyService::~TelephonyService");
+}
+
+void TelephonyService::start(const int serviceId)
+{
+    PHONE_DEBUG2("TelephonyService::start:", serviceId);
+    switch (serviceId) {
+        case 0: {
+            TPhoneCmdParamInteger uidParam;
+            uidParam.SetInteger( KUidPhoneApplication.iUid );
+            m_viewAdapter->ExecuteCommandL(EPhoneViewBringAppToForeground, &uidParam);
+            break;
+        }
+        case 1: {
+            m_viewAdapter->ExecuteCommandL( EPhoneViewOpenDialer );
+
+            /*TODO: remove this as soon as QT Highway brings in call dialer to foreground*/
+            TPhoneCmdParamInteger uidParam;
+            uidParam.SetInteger( KUidPhoneApplication.iUid );
+            m_viewAdapter->ExecuteCommandL(EPhoneViewBringAppToForeground, &uidParam);
+            break;
+        }
+        default: {
+            // do nothing
+            break;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/runtests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,37 @@
+@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
+
+del \epoc32\winscw\c\private\e37686c5\ut_phoneuiqtbuttonscontroller.log
+\epoc32\release\winscw\udeb\ut_phoneuiqtbuttonscontroller.exe -o ut_phoneuiqtbuttonscontroller.log
+type \epoc32\winscw\c\private\e37686c5\ut_phoneuiqtbuttonscontroller.log
+
+del \epoc32\winscw\c\private\eff8fea2\ut_phoneuiqtviewadapter.log
+\epoc32\release\winscw\udeb\ut_phoneuiqtviewadapter.exe -o ut_phoneuiqtviewadapter.log
+type \epoc32\winscw\c\private\eff8fea2\ut_phoneuiqtviewadapter.log
+
+del \epoc32\winscw\c\private\eacf41fe\ut_phonebubblewrapper.log
+\epoc32\release\winscw\udeb\ut_phonebubblewrapper.exe -o ut_phonebubblewrapper.log
+type \epoc32\winscw\c\private\eacf41fe\ut_phonebubblewrapper.log
+
+del \epoc32\winscw\c\private\eda69235\ut_phoneresourceadapter.log
+\epoc32\release\winscw\udeb\ut_phoneresourceadapter.exe -o ut_phoneresourceadapter.log
+type \epoc32\winscw\c\private\eda69235\ut_phoneresourceadapter.log
+
+del \epoc32\winscw\c\private\e37686c5\ut_telephonyservice.log
+\epoc32\release\winscw\udeb\ut_telephonyservice.exe -o ut_telephonyservice.log
+type \epoc32\winscw\c\private\e37686c5\ut_telephonyservice.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/main.cpp	Fri Jun 04 10:19:18 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: 
+*
+*/
+#include <QtGui>
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbview.h>
+#include <hbpushbutton.h>
+#include <hblabel.h>
+#include <telinformationpskeys.h>
+#include "cphonepubsubproxy.h"
+
+class CarModeTester : public HbWidget
+{
+    Q_OBJECT
+
+public:
+    CarModeTester();
+
+private slots:
+    void setCarModeOn();
+    void setCarModeOff();
+};
+
+int main(int argc, char *argv[])
+{
+    // Initialization
+    HbApplication app(argc, argv);
+
+    // Main window widget. 
+    // Includes decorators such as signal strength and battery life indicator.
+    HbMainWindow mainWindow;
+
+    CarModeTester* cmt = new CarModeTester;
+    mainWindow.addView(cmt);
+
+    // Show widget
+    mainWindow.show();
+
+    // Enter event loop
+    return app.exec();
+}
+
+CarModeTester::CarModeTester() {
+    HbPushButton* button = new HbPushButton("Set Car Mode ON", this);
+    button->setMaximumHeight(50);
+    connect(button,SIGNAL(clicked()),SLOT(setCarModeOn()));
+
+    HbPushButton* button2 = new HbPushButton("Set Car Mode OFF", this);
+    button2->setMaximumHeight(50);
+    connect(button2,SIGNAL(clicked()),SLOT(setCarModeOff()));
+
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+    layout->addItem(button);
+    layout->addItem(button2);
+    setLayout(layout);
+}
+
+void CarModeTester::setCarModeOn()
+{
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(KPSUidTelCarMode, KTelCarMode, EPSCarModeOn);
+}
+
+void CarModeTester::setCarModeOff()
+{
+    CPhonePubSubProxy::Instance()->ChangePropertyValue(KPSUidTelCarMode, KTelCarMode, EPSCarModeOff);
+}
+
+#include "main.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/u_carmodetester/u_carmodetester.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+#
+# 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEFF8FEA8
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+	                 \epoc32\include\mw \
+                   \sf\app\phone\inc \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phonemediatorcenter/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneringingtoneplayer/inc \
+                   ../../../phoneui2/srcdata
+
+
+    LIBS += -lphoneuiutils
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+}
+
+# Input
+SOURCES += main.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/unit.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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
+SUBDIRS += ut_phoneuiqtbuttonscontroller
+SUBDIRS += ut_phoneuiqtviewadapter
+SUBDIRS += ut_phonebubblewrapper
+SUBDIRS += ut_phoneresourceadapter
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonebubblewrapper/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,555 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneBubbleWrapper.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <hbapplication.h>
+#include <QSignalSpy>
+#include <hbmainwindow.h>
+//#include <hbglobal_p.h>
+#include "phonebubblewrapper.h"
+#include "bubblemanagerif.h"
+#include "pevirtualengine.h"
+
+class TestPhoneBubbleWrapper : public QObject, public BubbleManagerIF
+{
+    Q_OBJECT
+public:
+    TestPhoneBubbleWrapper();
+    virtual ~TestPhoneBubbleWrapper();
+    QString sayTestPhoneBubbleWrapper ();
+
+    // From BubbleManagerIF
+    void startChanges () { m_startChangesCalled=true; };
+    void endChanges () { m_endChangesCalled=true; };
+    int createCallHeader () { return 5; };
+    void removeCallHeader (int bubbleId) { m_removeCallHeaderCalled=true; m_int=bubbleId; };
+    void setState (int bubbleId, PhoneCallState state) { m_int=bubbleId; m_bubbleState=state; };
+    void setLabel ( 
+        int bubbleId, 
+        const QString& text, 
+        Qt::TextElideMode clipDirection) { m_int=bubbleId; m_string=text; m_elideMode=clipDirection; };
+    void setCli (int bubbleId, 
+                 const QString& cliText, 
+                 Qt::TextElideMode clipDirection) { m_int=bubbleId; m_string=cliText; m_elideMode=clipDirection; };
+    void updateCLI ( 
+        int bubbleId, 
+        const QString& cliText, 
+        Qt::TextElideMode clipDirection) {};
+    void setSecondaryCli ( 
+        int bubbleId, 
+        const QString& cliText, 
+        Qt::TextElideMode clipDirection = Qt::ElideLeft) { m_int=bubbleId; m_string=cliText; m_elideMode=clipDirection; };
+    void setCallTime (int bubbleId, const QString& callTime) {};
+    void updateCallTime (int bubbleId, const QString& callTime) {};
+    void setCallObjectImage (int bubbleId, const QString &fileName) {};
+    void setCallObjectFromTheme (int bubbleId) {};
+    void setCallObjectText (int bubbleId, const QString &text) {};
+    void setCallFlags (int bubbleId, int flags) {};
+    void setCallFlag (int bubbleId, PhoneCallFlags flag, bool set) { m_setCallFlagCalled=true; m_int=bubbleId; m_callFlags=flag; m_set=set; };
+    void setNumberType (int bubbleId, PhoneNumberType type) {};
+    void updateCallHeaderText( 
+        int bubbleId, 
+        const QString &longText, 
+        const QString &shortText, 
+        Qt::TextElideMode clipDirection) {};
+    void setPhoneMuted (bool muted) {};
+    int createConference (int bubble1, int bubble2) { return 1; };
+    void removeConference () {};
+    void addRowToConference (int bubbleId) {};
+    void removeRowFromConference (int bubbleId) {};
+    int conferenceRowCount () const { return 2; };
+    void setSelectionInConference (int rowNumber) {};
+    void setSelectionIdInConference (int bubbleId) {};
+    int selectionInConference () const { return 0; };
+    int selectionIdInConference () const { return 0; };
+    void moveHighlightOneUpInConference () {};
+    void moveHighlightOneDownInConference () {};
+    void setExpandedConferenceCallHeader (bool expanded) {};
+    bool isConferenceExpanded () const { return false; };
+    int shownHeaderCount () const { return 1; };
+    void setParticipantListCli (int aBubbleId, ParticipantListCli aParticipantCli) {};
+    void addAction (int bubble, HbAction *action) {};
+    void clearActions (int bubble) {};
+    QGraphicsWidget* graphicsWidgetForAction (HbAction *action) const { return 0;};
+    void addParticipantListAction (HbAction *action) {};
+    void clearParticipantListActions () {};
+    int expandedBubble() const { return 0; };
+    void setExpandAction(int bubbleId, HbAction* action) {};
+    void setBubbleSelectionDisabled(bool b) {};
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup (); 
+    
+private slots:
+    void testBubbleManager ();
+    void testSetLabel ();
+    void testSetCli ();
+    void testSetSecondaryCli ();
+    void testSetCallType ();
+    void testCreateCallHeader ();
+    void testRemoveCallHeader ();
+    void testSetState ();
+    void testBubbleId ();
+    void testSetDivert();
+    void testSetCiphering();
+    void testActiveCallCount();
+    void testCallStates ();
+    void testBubbles ();
+    void testSetConferenceCallId ();
+    void testRemoveConferenceCallId ();
+    void testCreateConferenceBubble ();
+    void testRemoveCallFromConference ();
+    void testRemoveConferenceBubble ();
+    void testCallIdByBubbleId ();
+    void testAddToConferenceBubble();
+    void testSetServiceId();
+
+private:
+    PhoneBubbleWrapper *m_wrapper; // class under test
+    QString m_string;
+    int m_int;
+    Qt::TextElideMode m_elideMode;
+    bool m_startChangesCalled;
+    bool m_endChangesCalled;
+    bool m_removeCallHeaderCalled;
+    bool m_setCallFlagCalled;
+    bool m_set;
+    PhoneCallState m_bubbleState;
+    PhoneCallFlags m_callFlags;
+};
+
+TestPhoneBubbleWrapper::TestPhoneBubbleWrapper ()
+{
+}
+
+TestPhoneBubbleWrapper::~TestPhoneBubbleWrapper ()
+{
+}
+
+void TestPhoneBubbleWrapper::initTestCase ()
+{
+                    
+}
+
+void TestPhoneBubbleWrapper::cleanupTestCase ()
+{
+//    delete m_wrapper;
+    
+}
+
+void TestPhoneBubbleWrapper::init ()
+{
+    m_wrapper = new PhoneBubbleWrapper (*this);
+    m_string = "";
+    m_int = -1;
+    m_elideMode = Qt::ElideNone;
+    m_startChangesCalled = false;
+    m_endChangesCalled = false;
+    m_removeCallHeaderCalled = false;
+    m_setCallFlagCalled = false;
+    m_set = false;
+    m_callFlags = BubbleManagerIF::Normal;
+}
+
+void TestPhoneBubbleWrapper::cleanup ()
+{
+    delete m_wrapper;
+    m_wrapper = 0;
+}
+
+QString TestPhoneBubbleWrapper::sayTestPhoneBubbleWrapper ()
+{
+    QString say ("TestPhoneBubbleWrapper");
+    return say;
+}
+
+void TestPhoneBubbleWrapper::testBubbleManager ()
+{
+    TestPhoneBubbleWrapper &fetched = reinterpret_cast<TestPhoneBubbleWrapper&>(m_wrapper-> bubbleManager ());
+	
+    // Comparing two references not possible so we circumvent it this way
+    // to be sure we are dealing with same object.
+    // fetched should be this object so calling sayTestPhoneBubbleWrapper should
+    // return a QString - if it's not this object it should simply crash.
+    QCOMPARE (fetched.sayTestPhoneBubbleWrapper (), sayTestPhoneBubbleWrapper () );
+}
+
+void TestPhoneBubbleWrapper::testSetLabel ()
+{
+    _LIT (KTestText, "Test Name");
+    m_wrapper->setLabel (2, KTestText);
+    QCOMPARE (m_int, 2);
+    QCOMPARE (m_string, QString ("Test Name"));
+    QCOMPARE (m_elideMode, Qt::ElideRight);
+}
+
+void TestPhoneBubbleWrapper::testSetCli ()
+{
+    _LIT (KTestText, "Test Name");
+    m_wrapper->setCli (3, KTestText);
+    QCOMPARE (m_int, 3);
+    QCOMPARE (m_string, QString ("Test Name"));
+    QCOMPARE (m_elideMode, Qt::ElideRight);	
+}
+
+void TestPhoneBubbleWrapper::testSetSecondaryCli ()
+{
+    _LIT (KTestText, "Test Name");
+    m_wrapper->setSecondaryCli (4, KTestText);
+    QCOMPARE (m_int, 4);
+    QCOMPARE (m_string, QString ("Test Name"));
+    QCOMPARE (m_elideMode, Qt::ElideLeft);	
+}
+
+void TestPhoneBubbleWrapper::testSetCallType ()
+{
+    m_wrapper->setCallType(0, EPECallTypeVideo);
+    m_wrapper->setCallType(0, EPECallTypeVoIP);
+    m_wrapper->setCallType(0, 100);
+    
+    m_wrapper->setCallType(1, EPECallTypeCSVoice);
+    
+    QVERIFY(m_setCallFlagCalled);
+    QCOMPARE(m_int, 1);
+    QCOMPARE(m_callFlags, BubbleManagerIF::Normal);
+}
+
+void TestPhoneBubbleWrapper::testCreateCallHeader ()
+{
+    QCOMPARE (m_wrapper->createCallHeader (1), 5);
+    QCOMPARE (m_wrapper->createCallHeader (1), 5);
+    m_wrapper->removeCallHeader(1);
+}
+
+void TestPhoneBubbleWrapper::testRemoveCallHeader ()
+{
+    m_wrapper->removeCallHeader (3);
+    QVERIFY (m_startChangesCalled == false);
+    QVERIFY (m_removeCallHeaderCalled == false);
+    QVERIFY (m_endChangesCalled == false);
+    
+    m_wrapper->createCallHeader (2);
+    m_wrapper->removeCallHeader (2);
+
+    QVERIFY (m_removeCallHeaderCalled == true);
+    QCOMPARE (m_int, 5);
+}
+
+void TestPhoneBubbleWrapper::testSetState ()
+{
+    m_wrapper->setState (0, 1, EPEStateIdle);
+    QCOMPARE(m_int, 1);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Disconnected);
+    QCOMPARE(m_wrapper->callId (EPEStateIdle), 0);
+    
+    m_wrapper->setState (0, 2, EPEStateDialing);
+    QCOMPARE(m_int, 2);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Outgoing);
+    QCOMPARE(m_wrapper->callId (EPEStateDialing), 0);
+
+    m_wrapper->setState (0, 3, EPEStateRinging);
+    QCOMPARE(m_int, 3);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Incoming);
+    QCOMPARE(m_wrapper->callId (EPEStateRinging), 0);
+
+    m_wrapper->setState (0, 4, EPEStateConnecting);
+    QCOMPARE(m_int, 4);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Alerting);
+    QCOMPARE(m_wrapper->callId (EPEStateConnecting), 0);
+
+    m_wrapper->setState (0, 5, EPEStateConnected);
+    QCOMPARE(m_int, 5);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Active);
+    QCOMPARE(m_wrapper->callId (EPEStateConnected), 0);
+
+    m_wrapper->setState (0, 6, EPEStateHeld);
+    QCOMPARE(m_int, 6);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::OnHold);
+    QCOMPARE(m_wrapper->callId (EPEStateHeld), 0);
+
+    m_wrapper->setState (0, 7, EPEStateDisconnecting);
+    QCOMPARE(m_int, 7);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Disconnected);
+    QCOMPARE(m_wrapper->callId (EPEStateDisconnecting), 0);
+
+    m_wrapper->setState (0, 8, EPEStateConferenceIdle);
+    QCOMPARE(m_int, 8);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Disconnected);
+    QCOMPARE(m_wrapper->callId (EPEStateConferenceIdle), 0);
+
+    m_wrapper->setState (0, 9, EPEStateConnectedConference);
+    QCOMPARE(m_int, 9);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::Active);
+    QCOMPARE(m_wrapper->callId (EPEStateConnectedConference), 0);
+
+    m_wrapper->setState (0, 10, EPEStateHeldConference);
+    QCOMPARE(m_int, 10);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::OnHold);
+    QCOMPARE(m_wrapper->callId (EPEStateHeldConference), 0);
+    
+    m_wrapper->setState (0, 11, EPEStateUnknown);
+    QCOMPARE(m_int, 11);	
+    QCOMPARE(m_bubbleState, BubbleManagerIF::None);
+    QCOMPARE(m_wrapper->callId (EPEStateUnknown), 0);
+
+    m_wrapper->createCallHeader (0);
+    int bubble = m_wrapper->createCallHeader (1);
+    m_wrapper->setState (1, bubble, EPEStateRinging);
+    QCOMPARE (m_int, bubble);	
+    QCOMPARE (m_bubbleState, BubbleManagerIF::Waiting);    
+    QCOMPARE (m_wrapper->callId (EPEStateRinging), 1);
+    m_wrapper->removeCallHeader (1);
+    m_wrapper->removeCallHeader (0);
+    
+    m_wrapper->setState (0, 11, 100);
+}
+
+void TestPhoneBubbleWrapper::testBubbleId ()
+{
+    QCOMPARE (m_wrapper->bubbleId (0), -1);
+    int bubble = m_wrapper->createCallHeader (0);
+    QCOMPARE (m_wrapper->bubbleId (0), bubble);
+    m_wrapper->removeCallHeader (0);
+    QCOMPARE (m_wrapper->bubbleId (0), -1);    	
+}
+
+void TestPhoneBubbleWrapper::testSetDivert ()
+{
+    m_wrapper->setDivert (2, false);
+    QVERIFY (m_setCallFlagCalled == false);
+    QCOMPARE (m_int, -1);
+    QCOMPARE (m_callFlags, (int)BubbleManagerIF::None);
+    QVERIFY (m_set == false);
+
+    m_wrapper->setDivert (1, true);
+    QVERIFY (m_setCallFlagCalled == true);
+    QCOMPARE (m_int, 1);
+    QCOMPARE (m_callFlags, BubbleManagerIF::Diverted);
+    QVERIFY (m_set == true);    
+}
+
+void TestPhoneBubbleWrapper::testSetCiphering()
+{
+    m_wrapper->setCiphering(2, false, false);
+    QVERIFY(m_setCallFlagCalled == true);
+    QCOMPARE(m_callFlags, (int)BubbleManagerIF::NoCiphering);
+    QVERIFY(m_int == 2);
+    QVERIFY(m_set == false);        
+    
+    m_wrapper->setCiphering(2, true, true);
+    QVERIFY(m_setCallFlagCalled == true);
+    QCOMPARE(m_callFlags, (int)BubbleManagerIF::NoCiphering);
+    QVERIFY(m_int == 2);
+    QVERIFY(m_set == false);    
+
+    m_wrapper->setCiphering(2, true, false);
+    QVERIFY(m_setCallFlagCalled == true);
+    QCOMPARE(m_callFlags,  (int)BubbleManagerIF::NoCiphering);
+    QVERIFY(m_int == 2);
+    QVERIFY(m_set == true);        
+}
+
+void TestPhoneBubbleWrapper::testActiveCallCount ()
+{
+    QCOMPARE (m_wrapper->activeCallCount(), 0);
+    int bubble = m_wrapper->createCallHeader (0);
+    m_wrapper->setState(0,bubble,EPEStateConnected);
+    QCOMPARE (m_wrapper->activeCallCount(), 1);
+    m_wrapper->removeCallHeader (0);
+    QCOMPARE (m_wrapper->activeCallCount(), 0);     
+}
+
+void TestPhoneBubbleWrapper::testCallStates ()
+{
+    QCOMPARE( 0, m_wrapper->callStates().size() );
+    
+    m_wrapper->createCallHeader (0);
+    m_wrapper->createCallHeader (1);
+    
+    
+    m_wrapper->updateCallState(0, 2);
+    m_wrapper->updateCallState(1, 3);
+    m_wrapper->updateCallState(2, 4);
+    
+    QCOMPARE( 2, m_wrapper->callStates().size() );
+    
+    m_wrapper->createCallHeader (2);
+    QCOMPARE( 3, m_wrapper->callStates().size() );
+    
+    m_wrapper->setConferenceCallId(0);
+    m_wrapper->setConferenceCallId(1);
+    m_wrapper->updateCallState(8, 5);
+    
+    QCOMPARE( 1, m_wrapper->callStates().size() );
+ 
+}
+
+void TestPhoneBubbleWrapper::testBubbles ()
+{
+    QCOMPARE( 0, m_wrapper->bubbles().size() );
+    
+    m_wrapper->createCallHeader (0);
+    m_wrapper->createCallHeader (1);
+    m_wrapper->createCallHeader (3);
+    
+    QCOMPARE( 3, m_wrapper->bubbles().size() );
+    
+    m_wrapper->setConferenceCallId(0);
+    
+    QCOMPARE( 2, m_wrapper->bubbles().size() );  
+}
+
+void TestPhoneBubbleWrapper::testSetConferenceCallId ()
+{
+    m_wrapper->setConferenceCallId(0);
+    m_wrapper->setConferenceCallId(1);
+    
+    QCOMPARE( 2, m_wrapper->conferenceCallList().size() );
+    
+    //set same call id
+    m_wrapper->setConferenceCallId(1);
+    QCOMPARE( 2, m_wrapper->conferenceCallList().size() );
+    
+    QCOMPARE( true, m_wrapper->conferenceCallId(0) );
+    QCOMPARE( false, m_wrapper->conferenceCallId(3) );
+}
+
+void TestPhoneBubbleWrapper::testRemoveConferenceCallId ()
+{
+    m_wrapper->setConferenceCallId(0);
+    m_wrapper->setConferenceCallId(1);
+    
+    QCOMPARE( 2, m_wrapper->conferenceCallList().size() );
+    m_wrapper->removeConferenceCallId(3);
+    QCOMPARE( 2, m_wrapper->conferenceCallList().size() );
+    m_wrapper->removeConferenceCallId(1);
+    QCOMPARE( 1, m_wrapper->conferenceCallList().size() );
+    QCOMPARE( true, m_wrapper->conferenceCallId(0) );
+    QCOMPARE( false, m_wrapper->conferenceCallId(1) );
+    m_wrapper->removeConferenceCallId(0);
+    QCOMPARE( 0, m_wrapper->conferenceCallList().size() );
+}
+
+void TestPhoneBubbleWrapper::testCreateConferenceBubble ()
+{
+    m_wrapper->createConferenceBubble(8,EPEStateConnectedConference,_L("conference"),_L("conference"));
+    QVERIFY( 0 == m_wrapper->conferenceCallList().size() );
+    
+    m_wrapper->createCallHeader(0);
+    m_wrapper->createCallHeader(1);
+    
+    m_wrapper->createConferenceBubble(0,EPEStateConnectedConference,_L("conference"),_L("conference"));
+    
+    QVERIFY( 2 == m_wrapper->conferenceCallList().size() );
+    
+}
+
+void TestPhoneBubbleWrapper::testRemoveCallFromConference ()
+{
+    m_wrapper->createCallHeader(0);
+    m_wrapper->createCallHeader(1);
+    
+    m_wrapper->createConferenceBubble(0,EPEStateConnectedConference,_L("conference"),_L("conference"));
+
+    m_wrapper->removeCallFromConference(0);
+
+    QVERIFY( 1 == m_wrapper->conferenceCallList().size() );
+    
+    m_wrapper->removeConferenceCallId(1);
+    
+    QVERIFY( 0 == m_wrapper->conferenceCallList().size() );
+}
+
+void TestPhoneBubbleWrapper::testRemoveConferenceBubble ()
+{
+    m_wrapper->createCallHeader(0);
+    m_wrapper->createCallHeader(1);
+    
+    m_wrapper->createConferenceBubble(0,EPEStateConnectedConference,_L("conference"),_L("conference"));
+    m_wrapper->removeConferenceBubble();
+    
+    QVERIFY( 0 == m_wrapper->conferenceCallList().size() );
+}
+
+void TestPhoneBubbleWrapper::testAddToConferenceBubble ()
+{
+    m_wrapper->addToConferenceBubble();
+
+    int bubbleId = m_wrapper->createCallHeader(0);
+    m_wrapper->setState(0, bubbleId, EPEStateRinging);
+    int bubbleId2 = m_wrapper->createCallHeader(1);
+    m_wrapper->setState(1, bubbleId2, EPEStateConnected);
+    int bubbleId3 = m_wrapper->createCallHeader(2);
+    m_wrapper->setState(2, bubbleId3, EPEStateHeld);
+    
+    m_wrapper->createConferenceBubble(8,EPEStateConnectedConference,_L("conference"),_L("conference"));
+    
+    m_wrapper->addToConferenceBubble();
+    
+    QCOMPARE( 3, m_wrapper->conferenceCallList().size() );
+    
+    m_wrapper->removeCallFromConference(0);
+    QCOMPARE( 2, m_wrapper->conferenceCallList().size() );
+    
+    int bubbleId4 = m_wrapper->createCallHeader(3);
+    m_wrapper->setState(3, bubbleId4, EPEStateHeld);
+    
+    m_wrapper->addToConferenceBubble();
+    QCOMPARE( 3, m_wrapper->conferenceCallList().size() );
+    
+    m_wrapper->removeCallFromConference(0);
+    m_wrapper->removeCallHeader(0);
+    QCOMPARE( 3, m_wrapper->conferenceCallList().size() );
+    
+    m_wrapper->removeCallFromConference(1);
+    m_wrapper->removeCallHeader(1);
+    m_wrapper->removeCallFromConference(2);
+    m_wrapper->removeCallHeader(2);
+    m_wrapper->removeCallFromConference(3);
+    m_wrapper->removeCallHeader(3);
+    
+    QCOMPARE( 0, m_wrapper->conferenceCallList().size() );
+}
+
+void TestPhoneBubbleWrapper::testCallIdByBubbleId ()
+{
+		int callId = 1;
+    int bubbleId = m_wrapper->createCallHeader(callId);
+    
+    QVERIFY( callId == m_wrapper->callIdByBubbleId(bubbleId) );
+}
+
+void TestPhoneBubbleWrapper::testSetServiceId()
+{
+    int serviceId(1);
+    int callId(2);
+    int callId2(3);
+    
+    m_wrapper->setServiceId(callId, serviceId);
+    
+    QVERIFY(serviceId == m_wrapper->serviceIdByCallId(callId));
+    QVERIFY(-1 == m_wrapper->serviceIdByCallId(callId2));
+    QVERIFY(1 == m_wrapper->serviceIds().keys().count());
+    
+}
+
+QTEST_MAIN(TestPhoneBubbleWrapper)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonebubblewrapper/ut_phonebubblewrapper.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEACF41FE
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\mw \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc
+
+    LIBS += -lphoneuiutils
+
+    TARGET.CAPABILITY = ALL -TCB
+}
+
+# Input
+HEADERS += ../../inc/phonebubblewrapper.h
+SOURCES += ../../src/phonebubblewrapper.cpp
+SOURCES += unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/menuextension_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,69 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Stub class.
+*
+*/
+
+
+#include "menuextension_stub.h"
+
+//#include "xqplugin.h"
+#include <xqphoneappcommands.h>
+
+bool m_modifyMenuCommandListCalled;
+bool m_modifyPushButtonCommandListCalled;
+bool m_addMenuActionsCalled;
+bool m_releaseMenuCalled;
+bool m_releaseCalled;
+
+SvtMenu::SvtMenu() 
+:
+QObject()
+{ 
+
+}
+	
+SvtMenu::~SvtMenu()
+{ 
+
+}
+    
+void SvtMenu::modifyMenuCommandList(const QList<CallInfo> &callInfo,QList<int> &menuCmdList)
+{
+    m_modifyMenuCommandListCalled = true;
+}
+
+void SvtMenu::modifyPushButtonCommandList(const QList<CallInfo> &callInfo,QList<int> &buttonCmdList)
+{
+    m_modifyPushButtonCommandListCalled = true;
+}
+
+void SvtMenu::addMenuActions(const QList<CallInfo> &callInfo,QList<HbAction*> &menuActions)
+{
+    m_addMenuActionsCalled = true;
+}
+
+void SvtMenu::releaseMenu()
+{
+    m_releaseMenuCalled = true;
+}
+
+void SvtMenu::release()
+{
+    m_releaseCalled = true;
+    delete this;
+}
+
+
+//XQ_EXPORT_PLUGIN2(testplugin, SvtMenu);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/menuextension_stub.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* ============================================================================
+*  Name        : 
+*  Part of     : 
+*  Description : 
+*  Version     : %version:  2 % 
+*
+*  Copyright 2008 Nokia.  All rights reserved.
+*  This material, including documentation and any related computer
+*  programs, is protected by copyright controlled by Nokia.  All
+*  rights are reserved.  Copying, including reproducing, storing,
+*  adapting or translating, any or all of this material requires the
+*  prior written consent of Nokia.  This material also contains
+*  confidential information which may not be disclosed to others
+*  without the prior written consent of Nokia.
+* ============================================================================
+*/
+
+#ifndef MENUEXTENSION_STUB_H_
+#define MENUEXTENSION_STUB_H_
+
+#include <QObject>
+#include <hbaction.h>
+
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <xqteluicommandextension.h>
+
+
+#ifdef BUILD_DLL
+#define DLL_EXPORT Q_DECL_EXPORT
+#else
+#define DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+class SvtMenu : public QObject, public XQTelUiCommandExtension
+    {
+    Q_OBJECT
+    Q_INTERFACES(XQTelUiCommandExtension)
+
+public:
+	SvtMenu();
+	
+	virtual ~SvtMenu();
+
+    /*!
+        \fn void modifyMenuItemList(QList<int> &menuCmdList)
+        
+        Modifies menu command list. List contains current list
+        of menu commands. Interface can add new commands which should be hanled
+        by call handling or remove commands if list contains unsupported call
+        commands.
+    */
+    virtual void modifyMenuCommandList(const QList<CallInfo> &callInfo,
+            QList<int> &menuCmdList);
+    
+    /*!
+        \fn void modifyButtonCommandList(QList<int> &menuCmdList)
+        
+        Modifies push button command list. CallInfo contains current call 
+        information and buttonCmdList contains current list of push 
+        button commands. 
+        Interface can remove commands if list contains unsupported call
+        commands (For example if service doesn't support conference call).
+    */
+    virtual void modifyPushButtonCommandList(const QList<CallInfo> &callInfo,
+                                             QList<int> &buttonCmdList);
+    
+    /*!
+        \fn void addMenuActions(QList<HbAction*> &menuActions)
+        
+        Adds actions to menu. Interface adds own actions to the list which
+        should be added to the call menu. 
+        Interface is the responsible for handling action triggers.
+        Ownership of the actions in not transferred.
+    */
+    virtual void addMenuActions(const QList<CallInfo> &callInfo,QList<HbAction*> &menuActions);
+    
+        /*!
+        \fn void getCallsL(QList<CallInfo> &calls)
+        
+        Releases menu actions. Method is called when menu is not needed
+        anymore and interface can release own menu actions.
+    */
+    virtual void releaseMenu();
+    
+    /*!
+        \fn void release()
+        
+        Releases plugin. Method is called when menu plugin is not needed
+        anymore and interface can release all resources.
+    */
+    virtual void release();
+    
+
+
+    };
+
+#endif /* MENUEXTENSION_STUB_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,261 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneCommandExtensionWrapper.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QList>
+#include <QMap>
+#include <hbapplication.h>
+#include <phoneappcommands.hrh>
+#include "phonecommandextensionwrapper.h"
+#include "pevirtualengine.h"
+#include "menuextension_stub.h"
+
+extern bool m_modifyMenuCommandListCalled;
+extern bool m_modifyPushButtonCommandListCalled;
+extern bool m_addMenuActionsCalled;
+extern bool m_releaseMenuCalled;
+extern bool m_releaseCalled;
+extern bool m_useExtensionStub;
+
+#define PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+    { \
+        HbApplication app(argc, argv); \
+        TestObject tc; \
+        QResource::registerResource("../hbcore.rcc"); \
+        int ret = QTest::qExec(&tc, argc, argv); \
+        /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+        /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+        /* app.exec() where the signal is normally emitted is not called here. */ \
+        /* So, invoking the signal explicitly. */ \
+        QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+        return ret; \
+    }
+
+
+class TestPhoneCommandExtensionWrapper : public QObject
+{
+    Q_OBJECT
+public:
+    TestPhoneCommandExtensionWrapper();
+    virtual ~TestPhoneCommandExtensionWrapper();
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup ();
+    
+private slots:
+    void testNullPlugin();
+    void testPlugin();
+    void testGetCallInfo();
+
+private:
+    PhoneCommandExtensionWrapper *m_wrapper; // class under test
+
+};
+
+TestPhoneCommandExtensionWrapper::TestPhoneCommandExtensionWrapper()
+{
+}
+
+TestPhoneCommandExtensionWrapper::~TestPhoneCommandExtensionWrapper()
+{
+}
+
+void TestPhoneCommandExtensionWrapper::initTestCase()
+{
+    
+}
+
+void TestPhoneCommandExtensionWrapper::cleanupTestCase()
+{
+    
+}
+
+void TestPhoneCommandExtensionWrapper::init()
+{
+
+}
+
+void TestPhoneCommandExtensionWrapper::cleanup()
+{
+}
+
+
+
+void TestPhoneCommandExtensionWrapper::testNullPlugin()
+{
+    QList<XQTelUiCommandExtension::CallInfo> callInfo; 
+    QList<int> menuCmdList;
+    QList<HbAction*> menuActions;
+    m_useExtensionStub = false;
+    m_wrapper = new PhoneCommandExtensionWrapper(123456);
+    
+    m_wrapper->modifyMenuCommandList(callInfo, menuCmdList);
+    QVERIFY( false == m_modifyMenuCommandListCalled );
+    
+    m_wrapper->modifyPushButtonCommandList(callInfo, menuCmdList);
+    QVERIFY( false == m_modifyPushButtonCommandListCalled );
+    
+    m_wrapper->addMenuActions(callInfo, menuActions);
+    QVERIFY( false == m_addMenuActionsCalled );
+    
+    m_wrapper->releaseMenu();
+    QVERIFY( false == m_releaseMenuCalled );
+    
+    delete m_wrapper;
+    
+    QVERIFY( false == m_releaseCalled );
+}
+
+void TestPhoneCommandExtensionWrapper::testPlugin()
+{
+    QList<XQTelUiCommandExtension::CallInfo> callInfo; 
+    QList<int> menuCmdList;
+    QList<HbAction*> menuActions;
+    m_useExtensionStub = true;
+    m_wrapper = new PhoneCommandExtensionWrapper(123456);
+    
+    QVERIFY( 123456 == m_wrapper->pluginUid() );
+    
+    m_wrapper->modifyMenuCommandList(callInfo, menuCmdList);
+    QVERIFY( m_modifyMenuCommandListCalled );
+    
+    m_wrapper->modifyPushButtonCommandList(callInfo, menuCmdList);
+    QVERIFY( m_modifyPushButtonCommandListCalled );
+    
+    m_wrapper->addMenuActions(callInfo, menuActions);
+    QVERIFY( m_addMenuActionsCalled );
+    
+    m_wrapper->releaseMenu();
+    QVERIFY( m_releaseMenuCalled );
+    
+    delete m_wrapper;
+
+    QVERIFY( m_releaseCalled );
+}
+
+void TestPhoneCommandExtensionWrapper::testGetCallInfo()
+{
+    m_wrapper = new PhoneCommandExtensionWrapper(123456);
+    QList<XQTelUiCommandExtension::CallInfo> callInfo; 
+    QMap<int,int> callStates;
+    QMap<int,int> serviceIds;
+    int expandedCall(0);
+    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(0, callInfo.count());
+    
+    callStates[0] = EPEStateDisconnecting; 
+    serviceIds[0] = 3;   
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::Disconnecting == callInfo.at(0).mCallState);
+    QVERIFY(true == callInfo.at(0).mIsExpanded);
+    QVERIFY(3 == callInfo.at(0).mServiceId);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateRinging;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::Incoming == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateDialing;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::Outgoing == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateConnecting;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::Outgoing == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateConnected;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::Active == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateConnectedConference;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::Active == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateHeld;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::OnHold == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateHeldConference;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::OnHold == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateUnknown;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::None == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateIdle;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::None == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateConferenceIdle;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::None == callInfo.at(0).mCallState);
+    
+    callInfo.clear();
+    callStates[0] = EPEStateMaximumState;    
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(1, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::None == callInfo.at(0).mCallState);
+    
+    //////////////////////////////////////////////////////////////////////////
+    // Two calls
+    //////////////////////////////////////////////////////////////////////////
+    callInfo.clear();
+    callStates[0] = EPEStateConnected;
+    callStates[1] = EPEStateHeld;
+    serviceIds[1] = 2;
+    m_wrapper->getCallInfoList(callInfo, callStates, serviceIds, expandedCall);
+    QCOMPARE(2, callInfo.count());
+    QVERIFY(XQTelUiCommandExtension::Active == callInfo.at(0).mCallState);
+    QVERIFY(true == callInfo.at(0).mIsExpanded);
+    QVERIFY(3 == callInfo.at(0).mServiceId);
+    QVERIFY(XQTelUiCommandExtension::OnHold == callInfo.at(1).mCallState);
+    QVERIFY(false == callInfo.at(1).mIsExpanded);
+    QVERIFY(2 == callInfo.at(1).mServiceId);
+    
+    delete m_wrapper;
+}
+
+
+PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestPhoneCommandExtensionWrapper)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/ut_phonecommandextensionwrapper.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEFF8FEA4
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+	                 \epoc32\include\mw \
+                   \sf\app\phone\inc \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phonemediatorcenter/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneui2/srcdata
+
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+}
+
+# Input
+HEADERS += ../../inc/phonecommandextensionwrapper.h
+SOURCES += ../../src/phonecommandextensionwrapper.cpp
+HEADERS += menuextension_stub.h
+SOURCES += menuextension_stub.cpp
+SOURCES += xqpluginloader_stub.cpp
+SOURCES += unit_tests.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/xqpluginloader_stub.cpp	Fri Jun 04 10:19:18 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 <xqpluginloader.h>
+#include <QtDebug>
+#include <QList>
+#include <QString>
+#include "menuextension_stub.h"
+
+int m_phoneButtonFlags;
+int m_pluginUid;
+bool m_useExtensionStub;
+
+XQPluginLoader::XQPluginLoader(QObject* parent) :
+    QObject(parent)
+{
+}
+
+XQPluginLoader::XQPluginLoader(int uid, QObject* parent) :
+    QObject(parent)
+{
+    m_pluginUid = uid;	
+}
+
+XQPluginLoader::~XQPluginLoader ()
+{
+}
+
+int XQPluginLoader::uid()const
+{
+    return m_pluginUid;
+}
+
+QObject* XQPluginLoader::instance()
+{
+    if (m_useExtensionStub) {
+        return new SvtMenu();
+    }
+    return 0;
+}
+
+void XQPluginLoader::setUid( int uid )
+{
+    m_pluginUid = uid;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonemessagecontroller/unit_tests.cpp	Fri Jun 04 10:19:18 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:  Unit tests for PhoneNoteController.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <hbapplication.h>
+#include <QSignalSpy>
+//#include <hbglobal_p.h>
+#include "phonemessagecontroller.h"
+#include "tphonecmdparamsfidata.h"
+
+#define PHONE_QT_MESSAGE_CONTROLLER_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestPhoneMessageController : public QObject
+{
+    Q_OBJECT
+public:
+    TestPhoneMessageController();
+    virtual ~TestPhoneMessageController();
+
+public slots:
+    void initTestCase();
+    void cleanupTestCase();
+    void init();
+    void cleanup(); 
+    
+private slots:
+    void testOpenSoftRejectEditor();
+
+
+    
+private:
+    PhoneMessageController *m_messageController; // class under test
+};
+
+TestPhoneMessageController::TestPhoneMessageController()
+{
+}
+
+TestPhoneMessageController::~TestPhoneMessageController()
+{
+}
+
+void TestPhoneMessageController::initTestCase()
+{
+    m_messageController = new PhoneMessageController();
+}
+
+void TestPhoneMessageController::cleanupTestCase()
+{
+    delete m_messageController;
+}
+
+void TestPhoneMessageController::init()
+{
+}
+
+void TestPhoneMessageController::cleanup()
+{
+}
+
+void TestPhoneMessageController::testOpenSoftRejectEditor()
+{
+    TPhoneCmdParamSfiData sfiParam;
+    sfiParam.SetNumber(_L("1234567"));
+    sfiParam.SetName(_L("Tester"));
+    
+    m_messageController->openSoftRejectMessageEditor(&sfiParam);
+}
+
+PHONE_QT_MESSAGE_CONTROLLER_TEST_MAIN(TestPhoneMessageController)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonemessagecontroller/ut_phonemessagecontroller.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+#
+# 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEDA69234
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneui2/srcdata
+
+    LIBS += -lphoneuiutils
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+}
+
+# Input
+HEADERS += ../../inc/phonemessagecontroller.h
+SOURCES += ../../src/phonemessagecontroller.cpp
+SOURCES += unit_tests.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,267 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneNoteController.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <hbapplication.h>
+#include <QSignalSpy>
+//#include <hbglobal_p.h>
+#include "phonenotecontroller.h"
+#include "phoneresourceids.h"
+#include "phoneui.hrh"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamquery.h"
+#include "phoneresourceadapter.h"
+#include "phoneconstants.h"
+
+#define PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestPhoneNoteController : public QObject
+{
+    Q_OBJECT
+public:
+    TestPhoneNoteController();
+    virtual ~TestPhoneNoteController();
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup (); 
+    
+private slots:
+    void testShowGlobalNoteDefault ();
+    void testShowGlobalInfoNoteWithResourceId ();
+    void testShowGlobalWarningNoteWithText ();
+    void testShowGlobalNoteWithTextAndResourceId ();
+    void testShowGlobalNoteTwoTimes ();
+    void testShowGlobalNoteThreeTimes ();
+    void testShowNote();
+    void testShowQuery();
+    void testShowClobalWaitNote();
+
+    
+private:
+    PhoneNoteController *m_noteController; // class under test
+};
+
+TestPhoneNoteController::TestPhoneNoteController ()
+{
+}
+
+TestPhoneNoteController::~TestPhoneNoteController ()
+{
+}
+
+void TestPhoneNoteController::initTestCase ()
+{
+    m_noteController = new PhoneNoteController();
+}
+
+void TestPhoneNoteController::cleanupTestCase ()
+{
+    delete m_noteController;
+}
+
+void TestPhoneNoteController::init ()
+{
+}
+
+void TestPhoneNoteController::cleanup ()
+{
+}
+
+void TestPhoneNoteController::testShowGlobalNoteDefault ()
+{
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    globalNoteParam.SetTimeout(0);
+    globalNoteParam.SetWaitForReady(ETrue);
+    m_noteController->showGlobalNote(&globalNoteParam);
+    QTest::qWait(2500);
+    
+    globalNoteParam.SetTimeout(KPhoneNoteNoTimeout);
+    m_noteController->showGlobalNote(&globalNoteParam);
+    QTest::qWait(2500);
+}
+
+void TestPhoneNoteController::testShowGlobalInfoNoteWithResourceId ()
+{
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
+    globalNoteParam.SetWaitForReady(EFalse);
+    globalNoteParam.SetType( EAknGlobalInformationNote );
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+    
+    QTest::qWait(5000);
+}
+
+void TestPhoneNoteController::testShowGlobalWarningNoteWithText ()
+{
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    globalNoteParam.SetWaitForReady(ETrue);
+    globalNoteParam.SetType( EAknGlobalWarningNote );
+    globalNoteParam.SetText(_L("Test note 1"));
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+}
+
+void TestPhoneNoteController::testShowGlobalNoteWithTextAndResourceId ()
+{
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    globalNoteParam.SetTextResourceId(R_PHONE_TEXT_COLP_CONNECTED);
+    globalNoteParam.SetWaitForReady(EFalse);
+    globalNoteParam.SetType( EAknGlobalInformationNote );
+    globalNoteParam.SetText(_L("Test number"));
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+    
+    QTest::qWait(5000);
+}
+
+void TestPhoneNoteController::testShowGlobalNoteTwoTimes ()
+{
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
+    globalNoteParam.SetWaitForReady(EFalse);
+    globalNoteParam.SetType( EAknGlobalInformationNote );
+    globalNoteParam.SetText(_L("Test note 2"));
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+    
+    globalNoteParam.SetText(_L("Test note 3"));
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+    
+    QTest::qWait(10000);
+
+}
+
+void TestPhoneNoteController::testShowGlobalNoteThreeTimes ()
+{
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
+    globalNoteParam.SetWaitForReady(EFalse);
+    globalNoteParam.SetType( EAknGlobalInformationNote );
+    globalNoteParam.SetText(_L("Test note 4"));
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+    
+    globalNoteParam.SetText(_L("Test note 5"));
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+    
+    globalNoteParam.SetText(_L("Test note 6"));
+    
+    m_noteController->showGlobalNote(&globalNoteParam);
+    
+    QTest::qWait(20000);
+}
+
+void TestPhoneNoteController::testShowNote()
+{
+    TPhoneCmdParamNote noteParam;
+    
+    m_noteController->showNote(&noteParam);
+    m_noteController->removeDtmfNote();
+    m_noteController->removeNote();
+    
+    noteParam.SetType(EPhoneNoteDtmfSending);
+    m_noteController->showNote(&noteParam);
+    
+    noteParam.SetResourceId(R_PHONEUI_SENDING_DTMF_WAIT_NOTE);
+    noteParam.SetText(_L("Sending:\n123p456"));
+    
+    m_noteController->showNote(&noteParam);
+    QTest::qWait(20000);
+    
+    noteParam.SetText(_L("Sending:\n123p456"));
+    m_noteController->showNote(&noteParam);
+    
+    QTest::qWait(20000);
+    
+    m_noteController->removeNote();
+    
+    QTest::qWait(20000);
+}
+
+void TestPhoneNoteController::testShowQuery()
+{
+    TPhoneCmdParamQuery queryParam;    
+    m_noteController->showQuery(&queryParam);
+    
+    queryParam.SetQueryType(EPhoneQueryDialog);
+    m_noteController->showQuery(&queryParam);
+    
+    queryParam.SetQueryPrompt(_L("TestQuery"));
+    m_noteController->showQuery(&queryParam);
+    m_noteController->removeQuery();
+
+    queryParam.SetQueryResourceId(R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY);
+    m_noteController->showQuery(&queryParam);
+    
+    QTest::qWait(20000);
+    m_noteController->showQuery(&queryParam);
+    
+    m_noteController->removeQuery();
+    
+    QTest::qWait(20000);
+}
+
+void TestPhoneNoteController::testShowClobalWaitNote()
+{
+    TPhoneCmdParamQuery queryParam;    
+    
+    queryParam.SetQueryType(EPhoneGlobalWaitNote);
+    m_noteController->showQuery(&queryParam);
+    QTest::qWait(5000);
+    m_noteController->removeGlobalWaitNote();
+    QTest::qWait(5000);
+    
+    queryParam.SetQueryPrompt(_L("TestQuery"));
+    m_noteController->showQuery(&queryParam);
+    QTest::qWait(5000);
+    m_noteController->removeGlobalWaitNote();
+    QTest::qWait(5000);
+    
+    queryParam.SetQueryPrompt(KNullDesC);
+    TBuf<4> buf(_L("test"));
+    queryParam.SetDataText(&buf);
+    queryParam.SetTimeOut(2000);
+    m_noteController->showQuery(&queryParam);
+    QTest::qWait(10000);
+     
+    queryParam.SetCustomCommandForTimeOut(10);
+    m_noteController->showQuery(&queryParam);
+    QTest::qWait(10000);
+}
+
+PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestPhoneNoteController)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/ut_phonenotecontroller.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEDA69234
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneui2/srcdata
+
+    LIBS += -lphoneuiutils
+    LIBS += -lphoneuiqtview
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+}
+
+# Input
+HEADERS += ../../inc/phoneresourceadapter.h
+SOURCES += ../../src/phoneresourceadapter.cpp
+HEADERS += ../../inc/phoneuiqtbuttonscontroller.h
+SOURCES += ../../src/phoneuiqtbuttonscontroller.cpp
+HEADERS += ../../inc/phonenotecontroller.h
+SOURCES += ../../src/phonenotecontroller.cpp
+SOURCES += unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,418 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneResourceAdapter.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <hbapplication.h>
+#include <QSignalSpy>
+#include <QVariant>
+#include <hbaction.h>
+//#include <hbglobal_p.h>
+#include <phoneappvoipcommands.hrh>
+#include "phoneresourceadapter.h"
+#include "phoneresourceids.h"
+#include "phoneui.hrh"
+
+#define PHONE_QT_RESOURCE_ADAPTER_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestPhoneResourceAdapter : public QObject
+{
+    Q_OBJECT
+public:
+    TestPhoneResourceAdapter();
+    virtual ~TestPhoneResourceAdapter();
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup (); 
+    
+private slots:
+    void testConvert ();
+    void testConvertToString ();
+    void testConvertToString2 ();
+    void testDefaultToolbarResourceId();
+    void testConvertCommandToString();
+    void testConvertToHbActions();
+
+private:
+    void testIncallToolbar (int id); // helper function
+    
+private:
+    PhoneResourceAdapter *m_resourceAdapter; // class under test
+};
+
+TestPhoneResourceAdapter::TestPhoneResourceAdapter ()
+{
+}
+
+TestPhoneResourceAdapter::~TestPhoneResourceAdapter ()
+{
+}
+
+void TestPhoneResourceAdapter::initTestCase ()
+{
+    m_resourceAdapter = PhoneResourceAdapter::Instance (this);
+}
+
+void TestPhoneResourceAdapter::cleanupTestCase ()
+{
+    delete m_resourceAdapter;
+}
+
+void TestPhoneResourceAdapter::init ()
+{
+}
+
+void TestPhoneResourceAdapter::cleanup ()
+{
+}
+
+void TestPhoneResourceAdapter::testConvert ()
+{
+    // For coverage
+    m_resourceAdapter = PhoneResourceAdapter::Instance (this);
+    PhoneUIQtButtonsController* buttonsController = 
+        m_resourceAdapter->buttonsController ();
+    
+
+    QMap<PhoneAction::ActionType, PhoneAction *> map;
+    PhoneAction *action = map [PhoneAction::LeftButton];
+
+    map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA);
+    QCOMPARE (map.size (), 2);
+    action = map [PhoneAction::ToolbarButton1];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
+    action = map [PhoneAction::ToolbarButton2];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker_off"));
+    QCOMPARE (action->command (), (int)EPhoneCallComingCmdSilent);    
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA);
+    QCOMPARE (map.size (), 2);
+    action = map [PhoneAction::ToolbarButton1];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
+    action = map [PhoneAction::ToolbarButton2];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_reject_call"));
+    //Command is disabled
+    //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject);    
+     
+    map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA);
+    QCOMPARE (map.size (), 2);
+    action = map [PhoneAction::ToolbarButton1];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
+    action = map [PhoneAction::ToolbarButton2];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker_off"));
+    //Command is disabled
+    //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); 
+
+    map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_CALLWAITING_CBA);
+    QCOMPARE (map.size (), 2);
+    action = map [PhoneAction::ToolbarButton1];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
+    action = map [PhoneAction::ToolbarButton2];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_join_call"));
+    QCOMPARE (action->command (), (int)EPhoneInCallCmdJoin);    
+    
+    testIncallToolbar( R_PHONEUI_DIALER_CBA );
+    testIncallToolbar( R_PHONEUI_INCALL_DIALER_CBA );
+    testIncallToolbar( R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA );
+    testIncallToolbar( R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA );
+    testIncallToolbar( R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA );
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_INCOMING_CALL);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+
+    map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_DISCONNECTED);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_HELD);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+
+    map = m_resourceAdapter->convert (R_PHONEUI_MULTC_WAITING);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+
+    map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_NUMBER, 3);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_OUT_GOING_CALL);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+
+    map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_CLI_WITHHELD);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_CALL);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_EMERGENCY_CALL_HEADER);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+
+    map = m_resourceAdapter->convert (R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_EMERGENCY_CALL_BUTTONS);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::LeftButton];
+    QVERIFY( false == action->text().isEmpty() );
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_end_call"));
+    QCOMPARE (action->command (), (int)EPhoneCmdEnd);
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_EMERGENCY_CBA);
+    QCOMPARE (map.size (), 2);
+    action = map [PhoneAction::ToolbarButton1];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
+    action = map [PhoneAction::ToolbarButton2];
+    QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker"));
+    QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);        
+    
+    map = m_resourceAdapter->convert (R_PHONEUI_CONFERENCE_CALL);
+    QCOMPARE (map.size (), 1);
+    action = map [PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    TBuf<10> buffer(_L("123"));
+    map = m_resourceAdapter->convert (R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT, &buffer);
+    QCOMPARE (map.size(), 1);
+    action = map[PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert(R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT, &buffer);
+    QCOMPARE(map.size(), 1);
+    action = map[PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    map = m_resourceAdapter->convert(R_PHONE_IMEI_STRING, &buffer);
+    QCOMPARE(map.size(), 1);
+    action = map[PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+
+    map = m_resourceAdapter->convert(R_PHONEUI_LIFE_TIMER_STRING, &buffer);
+    QCOMPARE(map.size(), 1);
+    action = map[PhoneAction::Text];
+    QVERIFY( false == action->text().isEmpty() );
+    
+    // TODO
+    map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA);
+    
+    map = m_resourceAdapter->convert (0);
+    QCOMPARE (map.size (), 0);
+}
+
+void TestPhoneResourceAdapter::testConvertToString ()
+{
+    m_resourceAdapter = PhoneResourceAdapter::Instance (this);
+        
+    QString testString = m_resourceAdapter->convertToString(R_PHONE_ERROR_CALL_NOT_ALLOWED); 
+    QVERIFY( false == testString.isEmpty() );
+    
+    QString testString2 = m_resourceAdapter->convertToString(R_ERROR_NOTE_NOT_ALLOWED); 
+    QVERIFY( false == testString2.isEmpty() );
+    
+    QString testString3 = m_resourceAdapter->convertToString(R_NOTETEXT_INVALID_PHONENUMBER); 
+    QVERIFY( false == testString3.isEmpty() );
+    
+    QString testString4 = m_resourceAdapter->convertToString(R_NOTETEXT_NO_ANSWER); 
+    QVERIFY( false == testString4.isEmpty() );
+    
+    QString testString5 = m_resourceAdapter->convertToString(R_PHONE_ERROR_NUMBER_BUSY); 
+    QVERIFY( false == testString5.isEmpty() );
+    
+    QString testString6 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_MOCAL_WAITING_TEXT); 
+    QVERIFY( false == testString6.isEmpty() );
+    
+    QString testString7 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT); 
+    QVERIFY( false == testString7.isEmpty() );
+    
+    QString testString8 = m_resourceAdapter->convertToString(R_INCAL_INFO_HOLD_TEXT); 
+    QVERIFY( false == testString8.isEmpty() );
+    
+    QString testString9 = m_resourceAdapter->convertToString(R_INCAL_REMOTE_ACTIVE_TEXT); 
+    QVERIFY( false == testString9.isEmpty() );
+    
+    QString testString10 = m_resourceAdapter->convertToString(R_INCAL_INFO_CONF_HOLD_TEXT); 
+    QVERIFY( false == testString10.isEmpty() );
+    
+    QString testString11 = m_resourceAdapter->convertToString(R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT); 
+    QVERIFY( false == testString11.isEmpty() );
+    
+    QString testString12 = m_resourceAdapter->convertToString(R_PHONE_ERROR_EMERGENCY_CALLS_ONLY); 
+    QVERIFY( false == testString12.isEmpty() );
+    
+    QString testString13 = m_resourceAdapter->convertToString(R_NOTETEXT_NUMBER_NOT_IN_USE); 
+    QVERIFY( false == testString13.isEmpty() );
+    
+    QString testString14 = m_resourceAdapter->convertToString(R_NOTETEXT_NETWORK_BUSY); 
+    QVERIFY( false == testString14.isEmpty() );
+    
+    QString testString15 = m_resourceAdapter->convertToString(R_NOTETEXT_ERROR_IN_CONNECTION); 
+    QVERIFY( false == testString15.isEmpty() );
+    
+    QString testString16 = m_resourceAdapter->convertToString(R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED); 
+    QVERIFY( false == testString16.isEmpty() );   
+    
+    QString testString17 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT); 
+    QVERIFY( false == testString17.isEmpty() );    
+ 
+    QString testString18 = m_resourceAdapter->convertToString(R_PHONE_ERROR_NO_SERVICE); 
+    QVERIFY( false == testString18.isEmpty() ); 
+    
+    QString testString99 = m_resourceAdapter->convertToString(0); 
+    QCOMPARE( testString99, QString ("") );
+}
+
+void TestPhoneResourceAdapter::testConvertToString2 ()
+{
+    m_resourceAdapter = PhoneResourceAdapter::Instance (this);
+        
+    QString testString = m_resourceAdapter->convertToString(
+            R_PHONE_TEXT_COLP_CONNECTED, QString("123456"));
+    
+    QVERIFY( false == testString.isEmpty() );
+       
+    QString testString2 = m_resourceAdapter->convertToString(0, QString()); 
+    QCOMPARE( testString2, QString ("") );
+}
+
+void TestPhoneResourceAdapter::testIncallToolbar (int id)
+{
+    QMap<PhoneAction::ActionType, PhoneAction *> map;
+    PhoneAction *action;
+    map = m_resourceAdapter->convert (id);
+    QCOMPARE (map.size (), 4);
+    
+    switch(id) {
+    case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA:
+        action = map [PhoneAction::ToolbarButton1];
+        QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
+        action = map [PhoneAction::ToolbarButton2];
+        QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_unmute"));
+        QCOMPARE (action->command (), (int)EPhoneInCallCmdUnmute);    
+        action = map [PhoneAction::ToolbarButton3];
+        QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker"));
+        QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);        
+        break;
+    default:    
+        action = map [PhoneAction::ToolbarButton1];
+        QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
+        action = map [PhoneAction::ToolbarButton2];
+        QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_mute"));
+        QCOMPARE (action->command (), (int)EPhoneInCallCmdMute);    
+        action = map [PhoneAction::ToolbarButton3];
+        QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker"));
+        QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);
+        break;
+    }
+}
+
+void TestPhoneResourceAdapter::testDefaultToolbarResourceId()
+{
+    QVERIFY(m_resourceAdapter->defaultToolbarResourceId()==
+            R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA);
+}
+
+void TestPhoneResourceAdapter::testConvertCommandToString ()
+{
+    m_resourceAdapter = PhoneResourceAdapter::Instance (this);
+    
+    QString testString = m_resourceAdapter->convertCommandToString(
+            EPhoneInCallCmdEndAllCalls);    
+    QVERIFY( false == testString.isEmpty() );
+    
+    testString = m_resourceAdapter->convertCommandToString(
+            EPhoneInCallCmdTransfer);    
+    QVERIFY( false == testString.isEmpty() );
+    
+    testString = m_resourceAdapter->convertCommandToString(
+            EPhoneInCallCmdSwitchToVideo);    
+    QVERIFY( false == testString.isEmpty() );
+    
+    testString = m_resourceAdapter->convertCommandToString(
+            EPhoneCmdHandoverToWlan);    
+    QVERIFY( false == testString.isEmpty() );
+    
+    testString = m_resourceAdapter->convertCommandToString(
+            EPhoneCmdHandoverToGsm);    
+    QVERIFY( false == testString.isEmpty() );
+    
+    testString = m_resourceAdapter->convertCommandToString(0); 
+    QCOMPARE( testString, QString ("") );
+}
+
+void TestPhoneResourceAdapter::testConvertToHbActions()
+{
+    m_resourceAdapter = PhoneResourceAdapter::Instance (this);
+    
+    QList<HbAction*> testList = m_resourceAdapter->convertToHbActions(R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY);    
+    QCOMPARE( testList.count(), 2 );
+    QCOMPARE( (int)EPhoneInCallCmdContinueSendingDtmfString, 
+              testList.at(0)->data().toInt());
+    QCOMPARE( (int)EPhoneInCallCmdCancelSendingDtmfString, 
+              testList.at(1)->data().toInt());
+    qDeleteAll(testList);
+    testList.clear();
+    
+    testList = m_resourceAdapter->convertToHbActions(R_PHONEUI_SENDING_DTMF_WAIT_NOTE);    
+    QCOMPARE( testList.count(), 1 );
+    QCOMPARE( (int)EPhoneInCallCmdCancelSendingDtmfString, 
+              testList.at(0)->data().toInt());
+    qDeleteAll(testList);
+    testList.clear();
+    
+    testList = m_resourceAdapter->convertToHbActions(0);    
+    QCOMPARE( testList.count(), 0 );
+}
+
+PHONE_QT_RESOURCE_ADAPTER_TEST_MAIN(TestPhoneResourceAdapter)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/ut_phoneresourceadapter.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEDA69235
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneui2/srcdata
+
+    LIBS += -lphoneuiutils
+    LIBS += -lphoneuiqtview
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+}
+
+# Input
+HEADERS += ../../inc/phoneresourceadapter.h
+SOURCES += ../../src/phoneresourceadapter.cpp
+HEADERS += ../../inc/phoneuiqtbuttonscontroller.h
+SOURCES += ../../src/phoneuiqtbuttonscontroller.cpp
+SOURCES += unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/phonecommandextensionwrapper_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,147 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Wraps phone command extensions.
+*/
+
+#include "phonecommandextensionwrapper.h"
+#include <QtDebug>
+#include <pevirtualengine.h>
+#include <hbaction.h>
+
+bool m_setActions;
+bool m_setInvalidCommand;
+bool m_setInvalidButtonCommands;
+QList<HbAction*> m_menuActions;
+
+  
+PhoneCommandExtensionWrapper::PhoneCommandExtensionWrapper(int pluginUid) :
+    m_pluginUid(pluginUid)
+{
+
+}
+
+PhoneCommandExtensionWrapper::~PhoneCommandExtensionWrapper()
+{
+
+}
+
+int PhoneCommandExtensionWrapper::pluginUid()
+{
+    return m_pluginUid;
+}
+
+void PhoneCommandExtensionWrapper::modifyMenuCommandList(
+        const QList<XQTelUiCommandExtension::CallInfo> &callInfo, 
+        QList<int> &menuCmdList)
+{    
+    if (m_setInvalidCommand) {
+        menuCmdList.append(-1);
+    }
+}
+
+void PhoneCommandExtensionWrapper::modifyPushButtonCommandList(
+        const QList<XQTelUiCommandExtension::CallInfo> &callInfo, 
+        QList<int> &buttonCmdList)
+{    
+    if (m_setInvalidButtonCommands) {
+        buttonCmdList.clear();
+        buttonCmdList.append(-1);
+        buttonCmdList.append(-2);
+    }
+}
+
+void PhoneCommandExtensionWrapper::addMenuActions(
+        const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+        QList<HbAction*> &menuActions)
+{
+    if (m_setActions) {
+        HbAction *action = new HbAction;
+        action->setText(QString("Test"));
+        m_menuActions.append(action);
+        menuActions.append(action);
+    }
+}
+
+void PhoneCommandExtensionWrapper::releaseMenu()
+{
+    qDeleteAll(m_menuActions);
+    m_menuActions.clear();
+}
+
+void PhoneCommandExtensionWrapper::release()
+{
+
+}
+
+void PhoneCommandExtensionWrapper::getCallInfoList(
+        QList<XQTelUiCommandExtension::CallInfo> &callInfo,
+        QMap<int,int> callStates, 
+        QMap<int,int> serviceIds,
+        int expandedCall )
+{
+    for (int i=0;i<callStates.keys().count();++i) {
+        XQTelUiCommandExtension::CallInfo info;
+        info.mCallState = mapCallState(callStates.values().at(i));
+        info.mServiceId = serviceIds.value(callStates.keys().at(i));
+        info.mIsExpanded = (expandedCall == callStates.keys().at(i));
+        callInfo.append(info);
+    }
+}
+
+XQTelUiCommandExtension::CallState PhoneCommandExtensionWrapper::mapCallState(
+        int callState )
+{
+    XQTelUiCommandExtension::CallState state(XQTelUiCommandExtension::None);
+    
+    switch( callState ) {
+    case EPEStateDisconnecting:
+        {
+        state = XQTelUiCommandExtension::Disconnecting;
+        }
+        break;
+    case EPEStateRinging:
+        {
+        state = XQTelUiCommandExtension::Incoming;
+        }
+        break;
+    case EPEStateDialing:
+    case EPEStateConnecting: 
+        {
+        state = XQTelUiCommandExtension::Outgoing;
+        }
+        break;
+    case EPEStateConnected:
+    case EPEStateConnectedConference:
+        {
+        state = XQTelUiCommandExtension::Active;
+        }
+        break;
+    case EPEStateHeld:
+    case EPEStateHeldConference:
+        {
+        state = XQTelUiCommandExtension::OnHold;
+        }
+        break;
+    case EPEStateUnknown:
+    case EPEStateIdle:
+    case EPEStateConferenceIdle:   
+        break;
+    default:
+        break;
+    }
+    
+    return state;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/phoneuiqtbuttonscontroller_stub.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include "phoneuiqtbuttonscontroller.h"
+#include <QtDebug>
+
+int m_phoneButtonFlags;
+
+PhoneUIQtButtonsController::PhoneUIQtButtonsController() : m_buttonFlags(0)
+{
+}
+
+PhoneUIQtButtonsController::~PhoneUIQtButtonsController ()
+{
+}
+
+void PhoneUIQtButtonsController::setButtonFlags (PhoneButtonFlags flag,bool set)
+{
+    if (set) 
+        {
+        // Set the flag on (=1)
+        m_buttonFlags |= flag; 
+        }
+    else 
+        {
+        // Set the flag off (=0)
+        m_buttonFlags &= (~flag);     
+        }
+    
+    m_phoneButtonFlags = m_buttonFlags;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,680 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneUIQtViewAdapter.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QList>
+#include <hbapplication.h>
+#include <phoneappcommands.hrh>
+#include "phoneuiqtviewif.h"
+#include "pevirtualengine.h"
+#include "bubblemanagerif.h"
+#include "phonebubblewrapper.h"
+#include "phoneuicommandcontroller.h"
+
+extern bool m_setActions;
+extern bool m_setInvalidCommand;
+extern QList<HbAction*> m_menuActions;
+extern bool m_setInvalidButtonCommands;
+
+#define PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+    { \
+        HbApplication app(argc, argv); \
+        TestObject tc; \
+        QResource::registerResource("../hbcore.rcc"); \
+        int ret = QTest::qExec(&tc, argc, argv); \
+        /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+        /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+        /* app.exec() where the signal is normally emitted is not called here. */ \
+        /* So, invoking the signal explicitly. */ \
+        QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+        return ret; \
+    }
+
+
+class TestPhoneUiCommandController : public QObject, public PhoneUIQtViewIF, public BubbleManagerIF
+{
+    Q_OBJECT
+public:
+    TestPhoneUiCommandController();
+    virtual ~TestPhoneUiCommandController();
+
+    // From PhoneUIQtViewIF
+    BubbleManagerIF& bubbleManager ();
+    void addBubbleCommand (int bubbleId, const PhoneAction& action);
+    void clearBubbleCommands (int bubbleId);
+    void addParticipantListAction(
+            int commandId,  
+            const QString &text, 
+            const HbIcon &icon);
+    void clearParticipantListActions();
+    void hideToolbar () { };
+    void showToolbar () { m_showToolbarCalled = true; };
+    void setToolbarActions (const QList<PhoneAction*>& actions) {m_toolbarActionCount = actions.count(); };
+    int volumeSliderValue () { m_volumeSliderValueCalled = true; return 5; };
+    void removeVolumeSlider () { m_removeVolumeSliderCalled = true; };
+    void setVolumeSliderValue (
+            int value, 
+            int commandId, 
+            int maxVolumeValue, 
+            int minVolumeValue ) { m_setVolumeSliderValueCalled = true; m_volumeSliderValue = value; };
+
+    void setExpandAction(int bubbleId, int commandId) {m_expandAction[bubbleId]=commandId;};
+    void removeExpandAction(int bubbleId) {};
+    void showDialpad() {m_showDialpadCalled = true;};  
+    void hideDialpad() {m_hideDialpadCalled = true;};  
+    bool isDialpadVisible() 
+        {m_dialpadVisibilityCalled = true;
+    return m_isDialpadVisible; }
+    QString dialpadText() {return m_dialpadText;};
+    void clearAndHideDialpad() { m_clearAndHideDialpadCalled = true;};
+    void bringToForeground() {;};
+    void setMenuActions(const QList<PhoneAction*>& actions) { m_setMenuActionsCalled = true;};
+    void shutdownPhoneApp() {;};
+    void setBackButtonVisible(bool visible) {;};
+    HbMenu &menuReference(){return m_menu;};
+    
+    // From BubbleManagerIF
+    void startChanges () { m_startChangesCalled=true; };
+    void endChanges () { m_endChangesCalled=true; };
+    int createCallHeader () { return 0; };
+    void removeCallHeader (int bubbleId) {};
+    void setState (int bubbleId, PhoneCallState state) {};
+    void setLabel ( 
+        int bubbleId, 
+        const QString& text, 
+        Qt::TextElideMode clipDirection) {};
+    void setCli (int bubbleId, 
+                 const QString& cliText, 
+                 Qt::TextElideMode clipDirection) {};
+    void updateCLI ( 
+        int bubbleId, 
+        const QString& cliText, 
+        Qt::TextElideMode clipDirection) {};
+    void setSecondaryCli ( 
+        int bubbleId, 
+        const QString& cliText, 
+        Qt::TextElideMode clipDirection = Qt::ElideLeft) {};
+    void setCallTime (int bubbleId, const QString& callTime) {};
+    void updateCallTime (int bubbleId, const QString& callTime) { m_updateCallTimeCalled=true; m_int=bubbleId; m_string=callTime; };
+    void setCallObjectImage (int bubbleId, const QString &fileName) {};
+    void setCallObjectFromTheme (int bubbleId) {};
+    void setCallObjectText (int bubbleId, const QString &text) {};
+    void setCallFlags (int bubbleId, int flags) {};
+    void setCallFlag (int bubbleId, PhoneCallFlags flag, bool set) {};
+    void setNumberType (int bubbleId, PhoneNumberType type) {};
+    void updateCallHeaderText( 
+        int bubbleId, 
+        const QString &longText, 
+        const QString &shortText, 
+        Qt::TextElideMode clipDirection) {};
+    void setPhoneMuted (bool muted) { m_setPhoneMutedCalled = muted; };
+    int createConference (int bubble1, int bubble2) { return 1; };
+    void removeConference () {};
+    void addRowToConference (int bubbleId) {};
+    void removeRowFromConference (int bubbleId) {};
+    int conferenceRowCount () const { return 2; };
+    void setSelectionInConference (int rowNumber) {};
+    void setSelectionIdInConference (int bubbleId) {};
+    int selectionInConference () const { return 0; };
+    int selectionIdInConference () const { return 0; };
+    void moveHighlightOneUpInConference () {};
+    void moveHighlightOneDownInConference () {};
+    void setExpandedConferenceCallHeader (bool expanded) { m_ExpandConferenceCalled = true; };
+    bool isConferenceExpanded () const { return false; };
+    int shownHeaderCount () const { return 1; };
+    void setParticipantListCli (int aBubbleId, ParticipantListCli aParticipantCli) {};
+    void addAction (int bubble, HbAction *action) {};
+    void clearActions (int bubble) {};
+    QGraphicsWidget* graphicsWidgetForAction (HbAction *action) const { return 0;};
+    void addParticipantListAction (HbAction *action) {};
+    int expandedBubble() const { return 1; };
+    void setExpandAction(int bubbleId, HbAction* action) {};
+    void setBubbleSelectionDisabled(bool b) {};
+    
+signals:
+    void dialpadAboutToClose();
+    void keyPressReleased(QKeyEvent *event);
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup ();
+    
+private slots:
+    void testSetCallMenuActions();
+    void testSetDialpadMenuActions();
+    void testPushButtonActionsForCall();
+
+
+private:
+    PhoneUiCommandController *m_commandController; // class under test
+
+    bool m_showToolbarCalled;
+    bool m_updateCallTimeCalled;
+    int m_int;
+    QString m_string;
+    HbAction *m_action;
+    int  m_toolbarActionCount;
+    bool m_startChangesCalled;
+    bool m_endChangesCalled;
+    bool m_volumeSliderValueCalled;
+    bool m_removeVolumeSliderCalled;
+    bool m_setVolumeSliderValueCalled;
+    int m_volumeSliderValue;
+    bool m_setPhoneMutedCalled;
+    QMap<int, QList<int> *> m_actionMap;
+    QMap<int,int> m_expandAction;
+    bool m_showDialpadCalled;
+    bool m_hideDialpadCalled;
+    bool m_dialpadVisibilityCalled;
+    bool m_clearAndHideDialpadCalled;
+    bool m_ExpandConferenceCalled;
+    bool m_setMenuActionsCalled;
+    bool m_isDialpadVisible;
+    QString m_dialpadText;
+    HbMenu m_menu;
+
+};
+
+TestPhoneUiCommandController::TestPhoneUiCommandController ()
+{
+}
+
+TestPhoneUiCommandController::~TestPhoneUiCommandController ()
+{
+}
+
+void TestPhoneUiCommandController::initTestCase ()
+{
+    m_commandController = new PhoneUiCommandController (*this);
+}
+
+void TestPhoneUiCommandController::cleanupTestCase ()
+{
+    delete m_commandController;
+}
+
+void TestPhoneUiCommandController::init ()
+{
+    m_startChangesCalled = false;
+    m_endChangesCalled = false;
+}
+
+void TestPhoneUiCommandController::cleanup ()
+{
+}
+
+BubbleManagerIF& TestPhoneUiCommandController::bubbleManager ()
+{
+    return *this;
+}
+
+void TestPhoneUiCommandController::addBubbleCommand (
+        int bubbleId, const PhoneAction& action)
+{
+
+}
+
+void TestPhoneUiCommandController::clearBubbleCommands (int bubbleId)
+{
+
+}
+
+void TestPhoneUiCommandController::addParticipantListAction(
+    int commandId,
+    const QString& text, 
+    const HbIcon& icon)
+{
+
+}
+
+void TestPhoneUiCommandController::clearParticipantListActions()
+{
+
+}
+
+void TestPhoneUiCommandController::testSetCallMenuActions()
+{
+    QMap<int,int> callStates;
+    QMap<int,int> serviceIds;
+    int serviceId(2);
+    int expandedCallId(1);
+    callStates[expandedCallId] = EPEStateConnected;
+    serviceIds[expandedCallId] = serviceId;
+    
+    
+    m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+    
+    m_setActions = true;
+    m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+    m_setActions = false;
+    
+    m_setInvalidCommand = true;
+    callStates[expandedCallId] = EPEStateHeld;
+    m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+    m_setInvalidCommand = false;
+    
+    callStates[0] = EPEStateConnected;
+    serviceIds[0] = serviceId;
+    
+    m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+    
+    callStates[0] = EPEStateRinging;
+    
+    m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+    
+    serviceIds[0] = 3;
+    callStates[0] = EPEStateConnected;
+    
+    m_commandController->setCallMenuActions(callStates,serviceIds,3,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+    
+    callStates[2] = EPEStateRinging;
+    serviceIds[2] = 3;
+    
+    m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+    
+    callStates[3] = EPEStateDisconnecting;
+    serviceIds[3] = 3;
+    
+    m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId);
+    QVERIFY(m_setMenuActionsCalled);
+    m_setMenuActionsCalled = false;
+}
+
+void TestPhoneUiCommandController::testSetDialpadMenuActions()
+{
+    m_setMenuActionsCalled = false;
+    m_commandController->setDialpadMenuActions();
+    QVERIFY(m_setMenuActionsCalled);
+}
+
+void TestPhoneUiCommandController::testPushButtonActionsForCall()
+{
+    int callState = EPEStateConnected;
+    bool emergencyCall = false;
+    QMap<int,int> callStates;
+    QMap<int,int> serviceIds;
+    int serviceId(2);
+    int callId(1);
+    callStates[callId] = EPEStateConnected;
+    serviceIds[callId] = serviceId;
+    
+    QMap<PhoneAction::ActionType, PhoneAction *> actions = 
+        m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    m_setInvalidButtonCommands = true;
+    actions =  m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0==actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();  
+    m_setInvalidButtonCommands = false;
+    
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            true,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateHeld;
+    callState = EPEStateHeld;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateRinging;
+    callState = EPEStateRinging;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateIdle;
+    callState = EPEStateIdle;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0==actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+
+    callStates[callId] = EPEStateDisconnecting;
+    callState = EPEStateDisconnecting;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0==actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateConferenceIdle;
+    callState = EPEStateConferenceIdle;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0==actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateUnknown;
+    callState = EPEStateUnknown;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0==actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateDialing;
+    callState = EPEStateDialing;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateConnecting;
+    callState = EPEStateConnecting;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateConnectedConference;
+    callState = EPEStateConnectedConference;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateHeldConference;
+    callState = EPEStateHeldConference;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+ 
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    //////////////////////////////////////////////////////////////////////////
+    //2 calls
+    //////////////////////////////////////////////////////////////////////////
+    
+    callStates[2] = EPEStateHeldConference;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[2] = EPEStateHeldConference;
+    callState = EPEStateHeldConference;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    serviceId = 3;
+    serviceIds[callId] = serviceId;
+    callStates[2] = EPEStateHeld;
+    serviceIds[2] = serviceId;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            true,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[2] = EPEStateHeldConference;
+    callState = EPEStateHeldConference;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[2] = EPEStateConnectedConference;
+    callState = EPEStateHeld;
+    callStates[callId] = EPEStateHeld;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callState = EPEStateConnectedConference;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateConnected;
+    callStates[2] = EPEStateHeldConference;
+    callState = EPEStateConnected;
+    
+    callState = EPEStateConnectedConference;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    callStates[callId] = EPEStateConnected;
+    callStates[2] = EPEStateHeldConference;
+    callState = EPEStateHeldConference;
+    
+    //////////////////////////////////////////////////////////////////////////
+    //3 calls
+    //////////////////////////////////////////////////////////////////////////
+    callStates[3] = EPEStateRinging;
+    serviceIds[3] = serviceId;
+    actions = m_commandController->pushButtonActionsForCall(
+            callState,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            callId);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    actions = m_commandController->pushButtonActionsForCall(
+            EPEStateRinging,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            3);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+    actions = m_commandController->pushButtonActionsForCall(
+            EPEStateHeld,
+            emergencyCall,
+            callStates,
+            serviceIds,
+            serviceId,
+            2);
+    
+    QVERIFY(0<actions.values().count());
+    qDeleteAll(actions.values());
+    actions.clear();
+    
+}
+
+
+PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestPhoneUiCommandController)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuicommandcontroller/ut_phoneuicommandcontroller.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEFF8FEA9
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+	                 \epoc32\include\mw \
+                   \sf\app\phone\inc \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phonemediatorcenter/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneui2/srcdata
+
+
+    LIBS += -lphoneuiutils
+    LIBS += -lphoneuiqtview
+    LIBS += -lserviceprovidersettings
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+}
+
+# Input
+HEADERS += ../../inc/phoneuicommandcontroller.h
+SOURCES += ../../src/phoneuicommandcontroller.cpp
+HEADERS += ../../inc/phoneresourceadapter.h
+SOURCES += ../../src/phoneresourceadapter.cpp
+HEADERS += ../../inc/phoneuiqtbuttonscontroller.h
+HEADERS += ../../inc/phonecommandextensionwrapper.h
+SOURCES += phoneuiqtbuttonscontroller_stub.cpp
+SOURCES += phonecommandextensionwrapper_stub.cpp
+SOURCES += unit_tests.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtbuttonscontroller/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,282 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneUIQtButtonsController.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <hbapplication.h>
+#include <QSignalSpy>
+//#include <hbglobal_p.h>
+#include "phoneuiqtbuttonscontroller.h"
+
+class TestPhoneUIQtButtonsController : public QObject
+{
+    Q_OBJECT
+public:
+    TestPhoneUIQtButtonsController();
+    virtual ~TestPhoneUIQtButtonsController();
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup (); 
+    
+private slots:
+    void testSetButtonFlags();
+    void testUnsetButtonFlags();
+    void testGetButtonFlags();
+
+private:
+    // Helper functions
+    bool checkFlags(bool hold, bool ihf, bool wired, bool btaa);
+    void setFlags(bool hold, bool ihf, bool wired, bool btaa);
+    
+private:
+    PhoneUIQtButtonsController *m_buttonsCtrl; // class under test
+};
+
+TestPhoneUIQtButtonsController::TestPhoneUIQtButtonsController ()
+{
+}
+
+TestPhoneUIQtButtonsController::~TestPhoneUIQtButtonsController ()
+{
+}
+
+void TestPhoneUIQtButtonsController::initTestCase ()
+{
+
+}
+
+void TestPhoneUIQtButtonsController::cleanupTestCase ()
+{
+
+}
+
+void TestPhoneUIQtButtonsController::init ()
+{
+    m_buttonsCtrl = new PhoneUIQtButtonsController ();
+}
+
+void TestPhoneUIQtButtonsController::cleanup ()
+{
+    delete m_buttonsCtrl;
+}
+
+void TestPhoneUIQtButtonsController::testSetButtonFlags()
+{
+    // Set one flag
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    QVERIFY(checkFlags(true,false,false,false) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);
+    QVERIFY(checkFlags(false,true,false,false) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,true);
+    QVERIFY(checkFlags(false,false,true,false) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,true);
+    QVERIFY(checkFlags(false,false,false,true) == true);
+    
+    // Two flags combinations
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);
+    QVERIFY(checkFlags(true,true,false,false) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,true);
+    QVERIFY(checkFlags(true,false,true,false) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,true);
+    QVERIFY(checkFlags(true,false,false,true) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,true);
+    QVERIFY(checkFlags(false,true,true,false) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,true);
+    QVERIFY(checkFlags(false,true,false,true) == true);
+    
+    // Three flags combinations
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);    
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,true);
+    QVERIFY(checkFlags(true,true,true,false) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);        
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,true);
+    QVERIFY(checkFlags(true,true,false,true) == true);
+
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,true);
+    QVERIFY(checkFlags(true,false,true,true) == true);
+    
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,true);
+    QVERIFY(checkFlags(false,true,true,true) == true);
+    
+    // All flags set
+    setFlags(false,false,false,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,true);
+    QVERIFY(checkFlags(true,true,true,true) == true);    
+}
+
+void TestPhoneUIQtButtonsController::testUnsetButtonFlags()
+{
+    // Unset one flag
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    QVERIFY(checkFlags(false,true,true,true) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);
+    QVERIFY(checkFlags(true,false,true,true) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,false);
+    QVERIFY(checkFlags(true,true,false,true) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,false);
+    QVERIFY(checkFlags(true,true,true,false) == true);
+    
+    // Two flags combinations
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);
+    QVERIFY(checkFlags(false,false,true,true) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,false);
+    QVERIFY(checkFlags(false,true,false,true) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,false);
+    QVERIFY(checkFlags(false,true,true,false) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,false);
+    QVERIFY(checkFlags(true,false,false,true) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,false);
+    QVERIFY(checkFlags(true,false,true,false) == true);
+    
+    // Three flags combinations
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);    
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,false);
+    QVERIFY(checkFlags(false,false,false,true) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);        
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,false);
+    QVERIFY(checkFlags(false,false,true,false) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,false);
+    QVERIFY(checkFlags(false,true,false,false) == true);
+    
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,false);
+    QVERIFY(checkFlags(true,false,false,false) == true);
+    
+    // All flags unset
+    setFlags(true,true,true,true);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,false);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,false);
+    QVERIFY(checkFlags(false,false,false,false) == true);    
+}
+
+void TestPhoneUIQtButtonsController::testGetButtonFlags()
+{
+    setFlags(true,false,false,false);
+    QVERIFY((m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold) == true &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Wired) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Btaa) == false) == true);
+    
+    setFlags(false,true,false,false);
+    QVERIFY((m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf) == true &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Wired) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Btaa) == false) == true);
+    
+    setFlags(false,false,true,false);
+    QVERIFY((m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Wired) == true &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Btaa) == false) == true);
+
+    setFlags(false,false,false,true);
+    QVERIFY((m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Wired) == false &&
+    m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Btaa) == true) == true);
+}
+
+bool TestPhoneUIQtButtonsController::checkFlags(bool hold, bool ihf, bool wired, bool btaa)
+{
+    return (hold == m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Hold) &&
+             ihf == m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Ihf) &&
+           wired == m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Wired) &&
+            btaa == m_buttonsCtrl->getButtonFlags(PhoneUIQtButtonsController::Btaa) );
+}
+
+void TestPhoneUIQtButtonsController::setFlags(bool hold, bool ihf, bool wired, bool btaa)
+{
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Hold,hold);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Ihf,ihf);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Wired,wired);
+    m_buttonsCtrl->setButtonFlags(PhoneUIQtButtonsController::Btaa,btaa);    
+}
+
+QTEST_MAIN(TestPhoneUIQtButtonsController)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtbuttonscontroller/ut_phoneuiqtbuttonscontroller.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xE37686c5
+DEPENDPATH += . \
+    ../../src
+INCLUDEPATH += . \
+    ../../inc
+CONFIG += hb
+CONFIG += qtestlib
+symbian:
+else:win32:DESTDIR = ./
+
+# CONFIG(debug,debug|release)
+# {
+# QMAKE_CXX = ctc -i d g++
+# LIBS += $$(CTCHOME)\lib\ctcmsnt.lib
+# }
+SOURCES += unit_tests.cpp \
+    ../../src/phoneuiqtbuttonscontroller.cpp
+HEADERS += ../../inc/phoneuiqtbuttonscontroller.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/cphonemediatorfactory_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMediatorFactory class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CPhoneMediatorFactory.h"
+#include "PhoneLogger.h"
+#include "PhoneConstants.h"
+#include "phoneui.pan"
+#include "cphonemediatorsender.h"
+#include "cphonemediatorcommandlistener.h"
+#include "cphonemediatormessagefactory.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneMediatorFactory::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorFactory* CPhoneMediatorFactory::Instance()
+    {
+    CPhoneMediatorFactory* instance = static_cast<CPhoneMediatorFactory*> 
+        ( CCoeEnv::Static ( KUidMediatorFactorySingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneMediatorFactory::NewL() );
+        if ( err )
+	        {
+	        Panic( EPhoneMediatorCenterCouldNotCreateSingleton );	
+	        }
+        }
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::CPhoneMediatorFactory
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMediatorFactory::CPhoneMediatorFactory() :
+    CCoeStatic( KUidMediatorFactorySingleton )
+    {
+    }
+
+// Destructor
+CPhoneMediatorFactory::~CPhoneMediatorFactory()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorFactory::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::ConstructL( ) ");
+    }
+
+// -----------------------------------------------------------
+// CPhoneMediatorFactory::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneMediatorFactory* CPhoneMediatorFactory::NewL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::NewL( ) ");
+    
+    CPhoneMediatorFactory* self = new ( ELeave ) CPhoneMediatorFactory;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::Sender
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorSender* CPhoneMediatorFactory::Sender()
+	{
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::Sender( ) ");
+    return CPhoneMediatorSender::Instance();
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::CommandListener
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorCommandListener* CPhoneMediatorFactory::CommandListener( 
+	MPhoneMenuAndCbaEvents* aMenuAndCbaEventHandler, 
+	MPhoneEngineMessageSender* aMessageSender,
+	MPEEngineInfo* aEngineInfo )
+	{
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::CommandListener( ) ");
+    CPhoneMediatorCommandListener* list = NULL;
+	return list;
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorFactory::MediatorMessage
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPhoneMediatorMessage* CPhoneMediatorFactory::MediatorMessage(
+    const TInt aMessage, TInt aCallId )
+	{
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorFactory::MediatorMessage( ) ");
+	__ASSERT_DEBUG( iEngineInfo, Panic( EPhoneMediatorCenterParameterNotInitialized ) );
+
+	CPhoneMediatorMessageFactory* messageFactory = NULL;
+    MPhoneMediatorMessage* message = NULL;
+
+	return message;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/cphonemediatorsender_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,332 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMediatorSender class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <MediatorDomainUIDs.h>
+#include "PhoneUI.hrh"
+#include "CPhoneMediatorSender.h"
+#include "PhoneLogger.h"
+#include "PhoneConstants.h"
+#include "PhoneMediatorPackageTypes.h"
+#include "phoneui.pan"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamboolean.h"
+//#include "mphoneenginemessagesender.h"
+#include "pevirtualengine.h"
+#include "mphoneshutdowncommand.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneMediatorSender::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneMediatorSender* CPhoneMediatorSender::Instance()
+    {
+    CPhoneMediatorSender* instance = static_cast<CPhoneMediatorSender*> 
+        ( CCoeEnv::Static ( KUidMediatorSenderSingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneMediatorSender::NewL() );
+        if ( err )
+	        {
+	        Panic( EPhoneMediatorCenterCouldNotCreateSingleton );	
+	        }
+        }
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::CPhoneMediatorSender
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMediatorSender::CPhoneMediatorSender() :
+    CCoeStatic( KUidMediatorSenderSingleton )
+    {
+    }
+
+// Destructor
+CPhoneMediatorSender::~CPhoneMediatorSender()
+    {
+    delete iCommandInitiator;
+    iEvents.Close();
+    iGenericEvents.Close(); 
+    delete iEventSender;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::ConstructL( ) ");
+   
+    }
+
+// -----------------------------------------------------------
+// CPhoneMediatorSender::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneMediatorSender* CPhoneMediatorSender::NewL()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::NewL( ) ");
+    
+    CPhoneMediatorSender* self = new ( ELeave ) CPhoneMediatorSender;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::RegisterGenericEvents
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::RegisterGenericEvents()
+	{
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::RegisterGenericEvents( ) ");
+
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( 
+    const TPhoneViewCommandId /*aCommandId*/ ) const
+    {
+    // No one yet intereseted this event.
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( const TPhoneViewCommandId aCommandId, 
+	const TInt aCallId ) const
+	{
+
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( const TPhoneViewCommandId aCommandId, 
+	TPhoneCommandParam& aCommandParam )
+	{
+
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( const TPhoneViewCommandId aCommandId, 
+ 	const TInt aCallId, TPhoneCommandParam& aCommandParam ) const
+	{
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::SendEvent
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneMediatorSender::SendEvent( 
+    const TPhoneViewCommandId /*aCommandId*/, 
+    const TInt /*aCallId*/, const TDesC* /*aMessage*/ ) const
+    {
+    // No one interested yet from these events.
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::IssueCommand
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneMediatorSender::IssueCommand( const TUid aDomain, const TUid aCategory, 
+    const TInt aCommandId, const TVersion aVersion, const TDesC8& aData, 
+    MPhoneShutdownCommand* aShutdownCommand  )
+    {
+	return KErrNone;	
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::CommandResponseL
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::CommandResponseL( TUid aDomain, TUid aCategory, 
+	TInt aCommandId, TInt /*aStatus*/, const TDesC8& /*aData*/ )
+	{
+    // First check for buffered command
+	if( iCommandBuffer.iCommandId != KErrNotFound )
+		{
+		// We have a buffered command waiting
+        __PHONELOG( EBasic, EPhoneMediatorCenter, 
+            "CPhoneMediatorSender::VideoTelephonyCommandResponse - Buffered Command waiting" );
+		if( iCommandBuffer.iCommandId != aCommandId )
+			{
+			// And it's not identical to the command which response we now received
+			// so it's necessary to re-send it
+	        __PHONELOG1( EBasic, EPhoneMediatorCenter, 
+	            "CPhoneMediatorSender::VideoTelephonyCommandResponse - Resending command %d", iCommandBuffer.iCommandId );
+			IssueCommand( iCommandBuffer.iDomainUid,
+			              iCommandBuffer.iCategoryUid, 
+			              iCommandBuffer.iCommandId,
+                          iCommandBuffer.iVersion,
+                          KNullDesC8 );
+                          
+			ResetCommandBuffer();
+			}
+		}
+
+	}
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::VideoTelephonyCommandResponse
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::VideoTelephonyCommandResponse( TInt aCommandId )
+    {
+ 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::MapCallState
+// -----------------------------------------------------------------------------
+//
+TCallState CPhoneMediatorSender::MapCallState( const TInt aCallState ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::MapCallState( ) ");
+    TCallState callState( ECallStateUnknown );
+    
+    switch( aCallState )
+        {
+        case EPEStateUnknown:
+            callState = ECallStateUnknown;
+            break;
+            
+        case EPEStateIdle:
+            callState = ECallStateIdle;
+            break;
+            
+        case EPEStateDialing:
+            callState = ECallStateDialling;
+            break;
+            
+        case EPEStateEmergencyDialing:
+            callState = ECallStateEmergencyDialling;
+            break;
+            
+        case EPEStateRinging:
+            callState = ECallStateRinging;
+            break;
+            
+        case EPEStateConnecting:
+            callState = ECallStateConnecting;
+            break;
+            
+        case EPEStateConnected:
+            callState = ECallStateConnected;
+            break;
+            
+        case EPEStateHangingUp:
+            callState = ECallStateHangingUp;
+            break;
+            
+        case EPEStateHeld:
+            callState = ECallStateHeld;
+            break;
+            
+        case EPEStateAnswering:
+            callState = ECallStateAnswering;
+            break;
+            
+        case EPEStateRejecting:
+            callState = ECallStateRejecting;
+            break;
+            
+        case EPEStateDisconnecting:
+            callState = ECallStateDisconnecting;
+            break;
+            
+        default:
+            break;
+        }
+        
+    return callState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::MapCallType
+// -----------------------------------------------------------------------------
+//
+TCallType CPhoneMediatorSender::MapCallType( const TInt aCallType ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::MapCallType( ) ");
+    TCallType callType( ECallTypeUninitialized );
+    
+    switch( aCallType )
+        {
+        case EPECallTypeUninitialized:
+            callType = ECallTypeUninitialized;
+            break;
+            
+        case EPECallTypeCSVoice:
+            callType = ECallTypeCSVoice;
+            break;
+            
+        case EPECallTypeVideo:
+            callType = ECallTypeVideo;
+            break;
+            
+        case EPECallTypeVoIP:
+            callType = ECallTypeVoIP;
+            break;
+            
+        default:
+            break;
+        }
+        
+    return callType;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMediatorSender::ResetCommandBuffer
+// -----------------------------------------------------------------------------
+//
+void CPhoneMediatorSender::ResetCommandBuffer()
+    {
+    __LOGMETHODSTARTEND( EPhoneMediatorCenter, "CPhoneMediatorSender::ResetCommandBuffer( ) ");
+    TUid nullUid = TUid::Null();
+    iCommandBuffer.iCommandId = KErrNotFound;
+    iCommandBuffer.iDomainUid = nullUid;
+    iCommandBuffer.iCategoryUid = nullUid;
+    iCommandBuffer.iVersion = TVersion( KErrNotFound, KErrNotFound, KErrNotFound );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/cphoneringingtonecontroller_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,275 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <telephonyvariant.hrh>
+#include "cphoneringingtonecontroller.h"
+#include "phonelogger.h"
+#include "cphoneringingtone.h"
+#include "tphonecmdparamringtone.h"
+#include "cphonecenrepproxy.h"
+#include "cphoneringingtoneplayer.h"
+#include "cphonettsplayer.h"
+
+
+bool m_EPhoneViewMuteRingToneOnAnswer_called;
+bool m_EPhoneViewStopRingTone_called;
+bool m_EPhoneViewMuteRingTone_called;
+bool m_EPhoneViewPlayRingTone_called;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneRingingToneController* CPhoneRingingToneController::NewL()
+    {
+    CPhoneRingingToneController* self = 
+        new ( ELeave ) CPhoneRingingToneController();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::CPhoneRingingToneController
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingToneController::CPhoneRingingToneController()
+    {
+    m_EPhoneViewMuteRingToneOnAnswer_called = false;
+    m_EPhoneViewStopRingTone_called = false;
+    m_EPhoneViewMuteRingTone_called = false;
+    m_EPhoneViewPlayRingTone_called = false;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::ConstructL()
+    {
+
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::~CPhoneRingingToneController
+// -----------------------------------------------------------------------------
+//
+CPhoneRingingToneController::~CPhoneRingingToneController()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayRingToneL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::PlayRingToneL( 
+                                         TPhoneCommandParam* aCommandParam )
+    {
+
+    if ( aCommandParam->ParamId() == TPhoneCommandParam::EPhoneParamIdRingTone )
+        {
+        m_EPhoneViewPlayRingTone_called = true;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayAudioRingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::PlayAudioRingTone( 
+    TInt aVolume, 
+    TProfileRingingType aRingingType )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::MuteRingingToneOnAnswer
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::MuteRingingToneOnAnswer()
+    {
+    m_EPhoneViewMuteRingToneOnAnswer_called = true;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::MuteRingingTone
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::MuteRingingTone()
+    {
+    m_EPhoneViewMuteRingTone_called = true;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::StopPlaying
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRingingToneController::StopPlaying()
+    {
+    m_EPhoneViewStopRingTone_called = true;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::DoMuteRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::DoMuteRingingTone()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ConvertVideoRingingType
+// -----------------------------------------------------------------------------
+//
+MPhoneVideoPlayer::TPlayMode CPhoneRingingToneController::ConvertVideoRingingType(
+    TProfileRingingType aRingingType )
+    {
+    MPhoneVideoPlayer::TPlayMode playMode;
+        
+    
+    return playMode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::SetVideoPlayer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::SetVideoPlayer( 
+    MPhoneVideoPlayer* aVideoPlayer )
+    {
+    iVideoPlayer = aVideoPlayer;    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayVideoRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::PlayVideoRingingTone( 
+    const CPhoneRingingTone& aRingingTone, 
+    TInt aVolume, 
+    TProfileRingingType aRingingType,
+    TBool aPersonalTone )
+    {
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::HandleVideoPlayerError
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::HandleVideoPlayerError( 
+    TPhoneVideoPlayerErrorEvent /*aEvent*/,
+    TInt aError )
+    {
+ 
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::HandleVideoPlayerInitComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::HandleVideoPlayerInitComplete()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::HandleVideoPlayerInitComplete()" );
+    
+    // cancel guarding timer
+    //iTimer->Cancel();
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::HandleVideoPlayerPlayingComplete
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::HandleVideoPlayerPlayingComplete()
+    {
+    //__LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::HandleVideoPlayerPlayingComplete()" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::PlayDefaultVideoAsync
+// -----------------------------------------------------------------------------
+//
+void CPhoneRingingToneController::PlayDefaultVideoAsync()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ExtendedSecurity
+// -----------------------------------------------------------------------------
+//    
+TBool CPhoneRingingToneController::ExtendedSecurity() const
+    {
+    //__LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::ExtendedSecurity()" );
+    return EFalse;
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::CoverUIPlayVideoRingingToneL
+// -----------------------------------------------------------------------------
+//   
+TBool CPhoneRingingToneController::CoverUIPlayVideoRingingToneL( 
+    const CPhoneRingingTone& aRingingTone )
+    {
+    //__LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::CoverUIPlayVideoRingingToneL()" );
+
+    TBool showVideo( EFalse );
+
+    RBuf8 data;
+    CleanupClosePushL( data );
+    data.CreateL( aRingingTone.FileName().Length() );
+    data.Copy( aRingingTone.FileName() );
+    /*TInt err = iMediatorSender->IssueCommand( 
+    	EPhoneCmdCoverUiShowMultimediaRingingTone, 
+	    data );
+    if ( err == KErrNone )
+        {
+        showVideo = ETrue;
+        iActiveCoverUICommand = ETrue;
+        }*/
+    CleanupStack::PopAndDestroy(); //data 
+
+    return showVideo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRingingToneController::ShowMultimediaRingingToneResponseL
+// -----------------------------------------------------------------------------
+//   
+void CPhoneRingingToneController::ShowMultimediaRingingToneResponseL( 
+	TInt aStatus )
+	{
+    //__LOGMETHODSTARTEND( EPhoneControl, "CPhoneRingingToneController::ShowMultimediaRingingToneResponseL()" );
+
+	}
+
+
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phonebubblewrapper.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 PHONEBUBBLEWRAPPERMOCK_H
+#define PHONEBUBBLEWRAPPERMOCK_H
+
+#include <QObject>
+#include <QMap>
+#include <e32cmn.h>
+#include "bubblemanagerif.h"
+
+extern bool m_setDivertCalled;
+extern bool m_bubblewrapperbool;
+extern int m_bubblewrapperint;
+extern bool m_setStateCalled;
+extern bool m_setLabelCalled;
+extern bool m_setCliCalled;
+extern bool m_setSecondaryCliCalled;
+extern bool m_setCallTypeCalled;
+extern bool m_createCallHeaderCalled;
+extern int m_createCallHeaderInt;
+extern int m_setStateCallId;
+extern int m_setStateBubbleId;
+extern int m_setStateCallState;
+extern const TDesC *m_setLabelText;
+extern int m_setLabelBubbleId;
+extern int m_setCliBubbleId;
+extern const TDesC *m_setCliText;
+extern int m_setSecondaryCliBubbleId;
+extern const TDesC *m_setSecondaryCliText;
+extern int m_setCallTypeBubbleId;
+extern int m_setCallTypeType;
+extern bool m_bubbleIdCalled;
+extern int m_bubbleIdCallId;
+extern bool m_activeCallCountCalled;
+extern QMap<int, int> m_callStateMap;
+extern QMap<int, int> m_bubblesMap;
+extern QList<int> m_conferenceCallList;
+extern bool m_creataConferenceCalled;
+extern bool m_removeConferenceCalled;
+extern bool m_removeCallFromConference;
+extern int m_bubble_id;
+extern QMap<int,int> m_services;
+extern bool m_setCipheringCalled;
+
+
+class PhoneBubbleWrapper : public QObject
+{
+    Q_OBJECT
+    
+public:
+    PhoneBubbleWrapper (BubbleManagerIF& bubble, QObject *parent = 0);
+    virtual ~PhoneBubbleWrapper ();
+    void updateCallState (int callId, int newState);
+    int callId (int state);
+    int createCallHeader (int callId);
+    void removeCallHeader (int callId);
+    void setState (int callId, int bubble, int callState);
+    void setLabel (int bubble, const TDesC &text);
+    void setCli (int bubble, const TDesC &cliText);
+    void setSecondaryCli (int bubble, const TDesC &cliText);
+    void setCallType (int bubble, int callType);
+    BubbleManagerIF& bubbleManager ();
+    int bubbleId (int callId);
+    void setDivert (int bubble, bool enabled);
+    void setCiphering(int bubble, bool indicatorAllowed, bool enabled);
+    int activeCallCount ();
+    
+    const QMap<int, int> callStates() const;
+    
+    QMap<int, int> bubbles();
+    
+    int createConferenceBubble(int callId, int callState, 
+            const TDesC &labelText, const TDesC &cliText);
+    
+    void setConferenceCallId(int callId);
+    
+    QList<int> conferenceCallList();
+    
+    void removeConferenceCallId(int callId);
+    
+    bool conferenceCallId(int callId);
+    
+    void removeCallFromConference(int callId);
+    
+    void removeConferenceBubble();
+    
+    int callIdByBubbleId(int bubbleId);
+    
+    void addToConferenceBubble();
+    
+    void setServiceId(int callId, int serviceId);
+    
+    int serviceIdByCallId(int callId) const;
+    
+    QMap<int,int> serviceIds() const;
+    
+private:
+    BubbleManagerIF& m_bubble;
+};
+
+#endif // PHONEBUBBLEWRAPPERMOCK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phonebubblewrapper_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "phonebubblewrapper.h"
+
+bool m_setDivertCalled;
+bool m_bubblewrapperbool;
+int m_bubblewrapperint;
+bool m_setStateCalled;
+bool m_setLabelCalled;
+bool m_setCliCalled;
+bool m_setSecondaryCliCalled;
+bool m_setCallTypeCalled;
+bool m_createCallHeaderCalled;
+int m_createCallHeaderInt;
+int m_setStateCallId;
+int m_setStateBubbleId;
+int m_setStateCallState;
+const TDesC *m_setLabelText;
+int m_setLabelBubbleId;
+int m_setCliBubbleId;
+const TDesC *m_setCliText;
+int m_setSecondaryCliBubbleId;
+const TDesC *m_setSecondaryCliText;
+int m_setCallTypeBubbleId;
+int m_setCallTypeType;
+bool m_bubbleIdCalled;
+int m_bubbleIdCallId;
+bool m_activeCallCountCalled;
+QMap<int, int> m_callStateMap;
+QMap<int, int> m_bubblesMap;
+QList<int> m_conferenceCallList;
+bool m_creataConferenceCalled;
+bool m_removeConferenceCalled;
+bool m_removeCallFromConference;
+bool m_removeCallHeaderCalled;
+int m_bubble_id;
+bool m_addToConferenceBubbleCalled;
+QMap<int,int> m_services;
+bool m_setCipheringCalled;
+
+PhoneBubbleWrapper::PhoneBubbleWrapper (BubbleManagerIF& bubble, QObject *parent) : m_bubble(bubble)
+{
+    m_setDivertCalled = false;
+    m_bubblewrapperbool = false;
+    m_bubblewrapperint = -1;
+    m_setStateCalled = false;
+    m_setLabelCalled = false;
+    m_setCliCalled = false;
+    m_setSecondaryCliCalled = false;
+    m_setCallTypeCalled = false;
+    m_createCallHeaderCalled = false;
+    m_createCallHeaderInt = false;
+    m_setStateCallId = -1;
+    m_setStateBubbleId = -1;
+    m_setStateCallState = -1;
+    m_setLabelBubbleId = -1;
+    m_setCliBubbleId = -1;
+    m_setSecondaryCliBubbleId = -1;
+    m_setCallTypeBubbleId = -1;
+    m_setCallTypeType = -1;
+    m_bubbleIdCalled = false;
+    m_bubbleIdCallId = -1;
+    m_activeCallCountCalled = false;
+    m_creataConferenceCalled = false;
+    m_removeCallFromConference = false;
+    m_removeCallHeaderCalled = false;
+    m_bubble_id = -2;
+    m_addToConferenceBubbleCalled = false;
+    m_setCipheringCalled = false;
+}
+
+PhoneBubbleWrapper::~PhoneBubbleWrapper () 
+{
+}
+
+void PhoneBubbleWrapper::updateCallState (int callId, int newState) 
+{
+}
+
+int PhoneBubbleWrapper::callId (int state) 
+{ 
+    return m_callStateMap.key(state, 0);
+}
+
+int PhoneBubbleWrapper::createCallHeader (int callId) 
+{
+    m_createCallHeaderCalled = true;
+    m_createCallHeaderInt = callId;
+    return 1; 
+}
+
+void PhoneBubbleWrapper::removeCallHeader (int callId) 
+{
+    m_removeCallHeaderCalled = true;
+}
+
+void PhoneBubbleWrapper::setState (int callId, int bubble, int callState) 
+{
+    m_setStateCalled = true;
+    m_setStateCallId = callId;
+    m_setStateBubbleId = bubble;
+    m_setStateCallState = callState;
+}
+
+void PhoneBubbleWrapper::setLabel (int bubble, const TDesC &text) 
+{
+    m_setLabelCalled = true;
+    m_setLabelBubbleId = bubble;
+    m_setLabelText = &text;
+}
+
+void PhoneBubbleWrapper::setCli (int bubble, const TDesC &cliText) 
+{
+    m_setCliCalled = true;
+    m_setCliBubbleId = bubble;
+    m_setCliText = &cliText;
+}
+
+void PhoneBubbleWrapper::setSecondaryCli (int bubble, const TDesC &cliText) 
+{
+    m_setSecondaryCliCalled = true;
+    m_setSecondaryCliBubbleId = bubble;
+    m_setSecondaryCliText = &cliText;
+}
+
+void PhoneBubbleWrapper::setCallType (int bubble, int callType) 
+{
+    m_setCallTypeCalled = true;
+    m_setCallTypeBubbleId = bubble;
+    m_setCallTypeType = callType;
+}
+
+BubbleManagerIF& PhoneBubbleWrapper::bubbleManager () 
+{ 
+    return m_bubble;
+}
+
+int PhoneBubbleWrapper::bubbleId (int callId) 
+{ 
+    m_bubbleIdCalled = true;
+    m_bubbleIdCallId = callId;
+
+    if (m_bubblesMap.contains(callId)) {
+        return m_bubblesMap.value(callId);
+    }
+    
+    if (-2 != m_bubble_id)
+        return m_bubble_id;
+        
+    return 2; 
+}
+
+void PhoneBubbleWrapper::setDivert (int bubble, bool enabled)
+{
+    m_setDivertCalled = true;	
+    m_bubblewrapperint = bubble;
+    m_bubblewrapperbool = enabled;
+}
+
+void PhoneBubbleWrapper::setCiphering(int bubble, bool indicatorAllowed, bool enabled)
+{
+    m_setCipheringCalled = true;
+}
+
+int PhoneBubbleWrapper::activeCallCount ()
+{
+    m_activeCallCountCalled = true;
+    return 0;
+}
+
+const QMap<int, int> PhoneBubbleWrapper::callStates() const 
+{
+    return m_callStateMap;
+}
+
+QMap<int, int> PhoneBubbleWrapper::bubbles() 
+{
+    return m_bubblesMap;
+}
+
+int PhoneBubbleWrapper::createConferenceBubble(
+        int callId, int callState, const TDesC &labelText, const TDesC &cliText)
+{
+    m_creataConferenceCalled = true;
+    for (int i=0; i<m_bubblesMap.size(); ++i) {
+        setConferenceCallId( m_bubblesMap.keys()[i] );
+    }
+}
+
+void PhoneBubbleWrapper::setConferenceCallId(int callId) 
+{
+    m_conferenceCallList.append(callId);
+}
+
+void PhoneBubbleWrapper::removeConferenceCallId(int callId) 
+{
+    if (m_conferenceCallList.contains(callId))
+        m_conferenceCallList.removeOne(callId);
+}
+
+bool PhoneBubbleWrapper::conferenceCallId(int callId)
+{
+    return m_conferenceCallList.contains(callId);
+}
+
+void PhoneBubbleWrapper::removeCallFromConference(int callId)
+{
+    m_removeCallFromConference = true;
+    removeConferenceCallId(callId);
+}
+
+QList<int> PhoneBubbleWrapper::conferenceCallList()
+    {
+    return m_conferenceCallList;
+    }
+
+void PhoneBubbleWrapper::removeConferenceBubble()
+{
+    m_removeConferenceCalled = true;
+    m_conferenceCallList.clear();
+}
+
+int PhoneBubbleWrapper::callIdByBubbleId(int bubbleId)
+{
+    return m_bubblesMap.key(bubbleId, -1);
+}
+
+void PhoneBubbleWrapper::addToConferenceBubble()
+{
+    m_addToConferenceBubbleCalled = true;
+}
+
+void PhoneBubbleWrapper::setServiceId(int callId, int serviceId)
+{
+    m_services[callId] = serviceId;
+}
+
+int PhoneBubbleWrapper::serviceIdByCallId(int callId) const
+{
+    return m_services.value(callId, -1);
+}
+
+QMap<int, int> PhoneBubbleWrapper::serviceIds() const 
+{    
+    return m_services;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phonenotecontroller_stub.cpp	Fri Jun 04 10:19:18 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:  Handles phone notes.
+*/
+
+#include "phonenotecontroller.h"
+#include "tphonecmdparamglobalnote.h"
+#include "phoneresourceadapter.h"
+#include <QtDebug>
+#include <hbdevicemessagebox.h>
+
+bool m_showGlobalNoteCalled;
+bool m_showQueryCalled;
+bool m_showNoteCalled;
+bool m_removeDtmfNoteCalled;
+bool m_removeNoteCalled;
+bool m_removeQueryCalled;
+bool m_removeGlobalWaitNoteCalled;
+
+PhoneNoteController::PhoneNoteController(QObject *parent) : QObject (parent)
+{
+    m_showGlobalNoteCalled = false;
+}
+
+PhoneNoteController::~PhoneNoteController()
+{
+
+}
+
+void PhoneNoteController::showGlobalNote(TPhoneCommandParam */*commandParam*/)
+{
+    m_showGlobalNoteCalled = true;
+}
+
+void PhoneNoteController::showNote(TPhoneCommandParam */*commandParam*/)
+{
+    m_showNoteCalled = true;
+}
+
+void PhoneNoteController::showQuery(TPhoneCommandParam */*commandParam*/)
+{
+    m_showQueryCalled = true;
+}
+
+void PhoneNoteController::removeDtmfNote()
+{
+    m_removeDtmfNoteCalled = true;
+}
+
+void PhoneNoteController::removeNote()
+{
+    m_removeNoteCalled = true;
+}
+
+void PhoneNoteController::removeQuery()
+{
+    m_removeQueryCalled = true;
+}
+
+void PhoneNoteController::removeGlobalWaitNote()
+{
+    m_removeGlobalWaitNoteCalled = true;
+}
+
+QString PhoneNoteController::globalNoteText(
+        TPhoneCommandParam *commandParam)
+{   
+    QString ret;    
+    
+    return ret;
+}
+
+void PhoneNoteController::destroyDialog()
+{
+}
+
+void PhoneNoteController::removeMappings()
+{
+}
+
+void PhoneNoteController::queryCancelled()
+{
+}
+
+void PhoneNoteController::queryTimeout()
+{
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/phoneuiqtbuttonscontroller_stub.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include "phoneuiqtbuttonscontroller.h"
+#include <QtDebug>
+
+int m_phoneButtonFlags;
+
+PhoneUIQtButtonsController::PhoneUIQtButtonsController() : m_buttonFlags(0)
+{
+}
+
+PhoneUIQtButtonsController::~PhoneUIQtButtonsController ()
+{
+}
+
+void PhoneUIQtButtonsController::setButtonFlags (PhoneButtonFlags flag,bool set)
+{
+    if (set) 
+        {
+        // Set the flag on (=1)
+        m_buttonFlags |= flag; 
+        }
+    else 
+        {
+        // Set the flag off (=0)
+        m_buttonFlags &= (~flag);     
+        }
+    
+    m_phoneButtonFlags = m_buttonFlags;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1273 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneUIQtViewAdapter.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QList>
+#include <QKeyEvent>
+#include <hbapplication.h>
+#include <QSignalSpy>
+#include <hbmainwindow.h>
+#include <phoneappcommands.hrh>
+#include <hbmenu.h>
+//#include <hbglobal_p.h>
+#include "phoneuiqtviewadapter.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamaudiooutput.h"
+#include "phoneuiqtviewif.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamemergencycallheaderdata.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamringtone.h"
+#include "pevirtualengine.h"
+#include "bubblemanagerif.h"
+#include "phoneresourceids.h"
+#include "phonebubblewrapper.h"
+#include "phoneuiqtbuttonscontroller.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamstring.h"
+
+extern int m_phoneButtonFlags;
+extern bool m_EPhoneViewMuteRingToneOnAnswer_called;
+extern bool m_EPhoneViewStopRingTone_called;
+extern bool m_EPhoneViewMuteRingTone_called;
+extern bool m_EPhoneViewPlayRingTone_called;
+extern bool m_showGlobalNoteCalled;
+extern bool m_removeCallHeaderCalled;
+extern bool m_addToConferenceBubbleCalled;
+extern bool m_showQueryCalled;
+extern bool m_removeDtmfNoteCalled;
+extern bool m_removeNoteCalled;
+extern bool m_removeQueryCalled;
+extern bool m_showNoteCalled;
+extern bool m_removeGlobalWaitNoteCalled;
+
+
+#define PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+    { \
+        HbApplication app(argc, argv); \
+        TestObject tc; \
+        QResource::registerResource("../hbcore.rcc"); \
+        int ret = QTest::qExec(&tc, argc, argv); \
+        /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+        /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+        /* app.exec() where the signal is normally emitted is not called here. */ \
+        /* So, invoking the signal explicitly. */ \
+        QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+        return ret; \
+    }
+
+// Own assert initialization  
+/*void qt_assert(const char *assertion, const char *file, int line)
+{
+    qDebug () << "View test assert FAIL";
+}*/
+
+class TestPhoneUIQtViewAdapter : public QObject, public PhoneUIQtViewIF, public BubbleManagerIF
+{
+    Q_OBJECT
+public:
+    TestPhoneUIQtViewAdapter();
+    virtual ~TestPhoneUIQtViewAdapter();
+
+    // From PhoneUIQtViewIF
+    BubbleManagerIF& bubbleManager ();
+    void addBubbleCommand (int bubbleId, const PhoneAction& action);
+    void clearBubbleCommands (int bubbleId);
+    void addParticipantListAction(
+            int commandId,  
+            const QString &text, 
+            const HbIcon &icon);
+    void clearParticipantListActions();
+    void hideToolbar () { };
+    void showToolbar () { m_showToolbarCalled = true; };
+    void setToolbarActions (const QList<PhoneAction*>& actions) {m_toolbarActionCount = actions.count(); };
+    int volumeSliderValue () { m_volumeSliderValueCalled = true; return 5; };
+    void removeVolumeSlider () { m_removeVolumeSliderCalled = true; };
+    void setVolumeSliderValue (
+            int value, 
+            int commandId, 
+            int maxVolumeValue, 
+            int minVolumeValue ) { m_setVolumeSliderValueCalled = true; m_volumeSliderValue = value; };
+
+    void setExpandAction(int bubbleId, int commandId) {m_expandAction[bubbleId]=commandId;};
+    void removeExpandAction(int bubbleId) {};
+    void showDialpad() {m_showDialpadCalled = true;};  
+    void hideDialpad() {m_hideDialpadCalled = true;};  
+    bool isDialpadVisible() 
+        {m_dialpadVisibilityCalled = true;
+    return m_isDialpadVisible; }
+    QString dialpadText() {return m_dialpadText;};
+    void clearAndHideDialpad() { m_clearAndHideDialpadCalled = true;};
+    void bringToForeground() {;};
+    void setMenuActions(const QList<PhoneAction*>& actions) { m_setMenuActionsCalled = true;};
+    void shutdownPhoneApp() {;};
+    void setBackButtonVisible(bool visible) {;};
+    HbMenu &menuReference(){return m_menu;};
+    
+    // From BubbleManagerIF
+    void startChanges () { m_startChangesCalled=true; };
+    void endChanges () { m_endChangesCalled=true; };
+    int createCallHeader () { return 0; };
+    void removeCallHeader (int bubbleId) {};
+    void setState (int bubbleId, PhoneCallState state) {};
+    void setLabel ( 
+        int bubbleId, 
+        const QString& text, 
+        Qt::TextElideMode clipDirection) {};
+    void setCli (int bubbleId, 
+                 const QString& cliText, 
+                 Qt::TextElideMode clipDirection) {};
+    void updateCLI ( 
+        int bubbleId, 
+        const QString& cliText, 
+        Qt::TextElideMode clipDirection) {};
+    void setSecondaryCli ( 
+        int bubbleId, 
+        const QString& cliText, 
+        Qt::TextElideMode clipDirection = Qt::ElideLeft) {};
+    void setCallTime (int bubbleId, const QString& callTime) {};
+    void updateCallTime (int bubbleId, const QString& callTime) { m_updateCallTimeCalled=true; m_int=bubbleId; m_string=callTime; };
+    void setCallObjectImage (int bubbleId, const QString &fileName) {};
+    void setCallObjectFromTheme (int bubbleId) {};
+    void setCallObjectText (int bubbleId, const QString &text) {};
+    void setCallFlags (int bubbleId, int flags) {};
+    void setCallFlag (int bubbleId, PhoneCallFlags flag, bool set) {};
+    void setNumberType (int bubbleId, PhoneNumberType type) {};
+    void updateCallHeaderText( 
+        int bubbleId, 
+        const QString &longText, 
+        const QString &shortText, 
+        Qt::TextElideMode clipDirection) {};
+    void setPhoneMuted (bool muted) { m_setPhoneMutedCalled = muted; };
+    int createConference (int bubble1, int bubble2) { return 1; };
+    void removeConference () {};
+    void addRowToConference (int bubbleId) {};
+    void removeRowFromConference (int bubbleId) {};
+    int conferenceRowCount () const { return 2; };
+    void setSelectionInConference (int rowNumber) {};
+    void setSelectionIdInConference (int bubbleId) {};
+    int selectionInConference () const { return 0; };
+    int selectionIdInConference () const { return 0; };
+    void moveHighlightOneUpInConference () {};
+    void moveHighlightOneDownInConference () {};
+    void setExpandedConferenceCallHeader (bool expanded) { m_ExpandConferenceCalled = true; };
+    bool isConferenceExpanded () const { return false; };
+    int shownHeaderCount () const { return 1; };
+    void setParticipantListCli (int aBubbleId, ParticipantListCli aParticipantCli) {};
+    void addAction (int bubble, HbAction *action) {};
+    void clearActions (int bubble) {};
+    QGraphicsWidget* graphicsWidgetForAction (HbAction *action) const { return 0;};
+    void addParticipantListAction (HbAction *action) {};
+    int expandedBubble() const { return 1; };
+    void setExpandAction(int bubbleId, HbAction* action) {};
+    void setBubbleSelectionDisabled(bool b) {};
+    
+signals:
+    void dialpadAboutToClose();
+    void keyPressReleased(QKeyEvent *event);
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup ();
+    
+private slots:
+    void testEPhoneViewSetTopApplicationCommand ();
+    void testEPhoneViewSetIdleTopApplicationCommand ();
+    void testEPhoneViewUpdateCallHeaderCallDurationCommand ();
+    void testEPhoneViewCreateCallHeaderCommand ();
+    void testEPhoneViewCreateEmergencyCallHeader ();
+    void testEPhoneViewUpdateBubble ();
+    void testEPhoneViewUpdateCallHeaderRemoteInfoData ();
+    void testEPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel();
+    void testCallIdByState ();
+    void testSetToolbarButtons ();
+    void testHoldFlag ();
+    void testEPhoneViewHideNaviPaneAudioVolume ();
+    void testEPhoneViewSetNaviPaneAudioVolume ();
+    void testEPhoneViewGetAudioVolumeLevel ();
+    void testEPhoneViewActivateMuteUIChanges ();
+    void testEPhoneViewGetCountOfActiveCallss ();
+    void testExecuteCommandLwithCmdId ();
+    void testExecuteCommandLwithCmdIdAndCallId ();
+    void testExecuteCommandLwithCmdIdAndCmdParam ();
+    void testSetTouchButtons ();
+    void testCreateConferenceBubble ();
+    void testHandleCommandL ();
+    void testGetSelectedConferenceMember ();
+    void testSetAudioPath ();
+    void testMuteRingToneOnAnswer ();
+    void testStopRingTone ();
+    void testMuteRingTone ();
+    void testPlayRingTone ();
+    void testShowGlobalNote ();
+    void testSetExpandActions();
+    void testShowDialpad ();
+    void testDialpadVisibility ();
+    void removeAllCallHeaders ();
+    void testRemoveDialpad();
+    void testGetDialpadStringLength();
+    void testGetDialpadString();
+    void testAddToConference();
+    void testSetConferenceExpanded();
+    void testSetMenuActions();
+    void testNoteController();
+    void testHsToForegroundAfterCall();
+    void testCipheringInfoChange();
+    void testSetHidden();
+    void testBeginEndUiUpdate();
+
+private:
+    PhoneUIQtViewAdapter *m_adapter; // class under test
+    bool m_showToolbarCalled;
+    bool m_updateCallTimeCalled;
+    int m_int;
+    QString m_string;
+    HbAction *m_action;
+    int  m_toolbarActionCount;
+    bool m_startChangesCalled;
+    bool m_endChangesCalled;
+    bool m_volumeSliderValueCalled;
+    bool m_removeVolumeSliderCalled;
+    bool m_setVolumeSliderValueCalled;
+    int m_volumeSliderValue;
+    bool m_setPhoneMutedCalled;
+    QMap<int, QList<int> *> m_actionMap;
+    QMap<int,int> m_expandAction;
+    bool m_showDialpadCalled;
+    bool m_hideDialpadCalled;
+    bool m_dialpadVisibilityCalled;
+    bool m_clearAndHideDialpadCalled;
+    bool m_ExpandConferenceCalled;
+    bool m_setMenuActionsCalled;
+    bool m_isDialpadVisible;
+    QString m_dialpadText;
+    HbMenu m_menu;
+
+};
+
+TestPhoneUIQtViewAdapter::TestPhoneUIQtViewAdapter () :
+    m_isDialpadVisible(false),
+    m_dialpadText("1234567")
+{
+}
+
+TestPhoneUIQtViewAdapter::~TestPhoneUIQtViewAdapter ()
+{
+}
+
+void TestPhoneUIQtViewAdapter::initTestCase ()
+{
+    m_adapter = new PhoneUIQtViewAdapter (*this);
+}
+
+void TestPhoneUIQtViewAdapter::cleanupTestCase ()
+{
+    delete m_adapter;
+}
+
+void TestPhoneUIQtViewAdapter::init ()
+{
+    m_startChangesCalled = false;
+    m_endChangesCalled = false;
+    m_setCipheringCalled = false;
+}
+
+void TestPhoneUIQtViewAdapter::cleanup ()
+{
+}
+
+BubbleManagerIF& TestPhoneUIQtViewAdapter::bubbleManager ()
+{
+    return *this;
+}
+
+void TestPhoneUIQtViewAdapter::addBubbleCommand (
+        int bubbleId, const PhoneAction& action)
+{
+    if (m_actionMap.keys().contains(bubbleId)) {
+        m_actionMap.value(bubbleId)->append(action.command());
+    } else {
+        QList<int> *list = new QList<int>();
+        list->append(action.command());
+        m_actionMap.insert( bubbleId, list);
+    }
+}
+
+void TestPhoneUIQtViewAdapter::clearBubbleCommands (int bubbleId)
+{
+    if (m_actionMap.keys().contains(bubbleId)) {
+        QList<int> *list = m_actionMap.value(bubbleId);
+        list->clear();
+        delete list;
+        m_actionMap.remove(bubbleId);
+    }
+}
+
+void TestPhoneUIQtViewAdapter::addParticipantListAction(
+    int commandId,
+    const QString& text, 
+    const HbIcon& icon)
+{
+
+}
+
+void TestPhoneUIQtViewAdapter::clearParticipantListActions()
+{
+
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewSetTopApplicationCommand ()
+{
+    TPhoneCmdParamInteger intParam;
+    intParam.SetInteger (12345);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTopApplication, &intParam);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewSetIdleTopApplicationCommand ()
+{
+    m_adapter->ExecuteCommandL (EPhoneViewSetIdleTopApplication);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateCallHeaderCallDurationCommand ()
+{
+    TPhoneCmdParamInteger time;
+    time.SetInteger(73);
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderCallDuration, 1, &time);	
+    QCOMPARE (m_updateCallTimeCalled, true);
+    QCOMPARE (m_int, 2);
+    QVERIFY (m_string == "0:01:13");
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewCreateCallHeaderCommand ()
+{
+    TPhoneCmdParamCallHeaderData callHeader;
+    callHeader.SetDiverted (ETrue);
+    callHeader.SetCallState (3);
+    callHeader.SetLabelText (_L("Foo"));
+    callHeader.SetCLIText (_L("Bar"), TPhoneCmdParamCallHeaderData::ERight);
+    callHeader.SetCNAPText (_L("CNAP"), TPhoneCmdParamCallHeaderData::ERight);
+    callHeader.SetCallType (3);
+    callHeader.SetCipheringIndicatorAllowed(true);
+    callHeader.SetCiphering(false);
+    m_adapter->ExecuteCommandL (EPhoneViewCreateCallHeader, 2, &callHeader);
+
+    QVERIFY (m_startChangesCalled == true);
+
+    QVERIFY (m_createCallHeaderCalled == true);
+    QCOMPARE (m_createCallHeaderInt, 2);
+
+    QVERIFY (m_setStateCalled == true); 
+    QCOMPARE (m_setStateCallId, 2);
+    QCOMPARE (m_setStateBubbleId, 1);
+    QCOMPARE (m_setStateCallState, 3); 
+    
+    QVERIFY (m_setLabelCalled == true);
+    QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ());
+    QCOMPARE (m_setLabelBubbleId, 1);
+    QCOMPARE (labelText, QString("Foo"));
+
+    QVERIFY (m_setCliCalled == true);
+    QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ());
+    QCOMPARE (m_setCliBubbleId, 1);
+    QCOMPARE (cliText, QString("Bar"));
+    
+    QVERIFY (m_setSecondaryCliCalled == true);
+    QString cnapText = QString::fromUtf16 (m_setSecondaryCliText->Ptr (), m_setSecondaryCliText->Length ());
+    QCOMPARE (m_setSecondaryCliBubbleId, 1);
+    QCOMPARE (cnapText, QString("CNAP"));
+    
+    QVERIFY (m_setCallTypeCalled == true);
+    QCOMPARE (m_setCallTypeBubbleId, 1);
+    QCOMPARE (m_setCallTypeType, 3);
+    
+    QVERIFY (m_setDivertCalled == true);
+    QVERIFY (m_bubblewrapperbool == true);
+    QCOMPARE (m_bubblewrapperint, 1);
+    
+    QVERIFY (m_setCipheringCalled == true);
+    
+    QVERIFY (m_endChangesCalled == true);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewCreateEmergencyCallHeader ()
+{
+    TPhoneCmdParamEmergencyCallHeaderData callHeader;
+    callHeader.SetLabelText (_L("Attempting"));
+    callHeader.SetHeaderText (_L("emergency") );
+    m_adapter->ExecuteCommandL (EPhoneViewCreateEmergencyCallHeader, 2, &callHeader);
+    callHeader.SetCipheringIndicatorAllowed(true);
+    callHeader.SetCiphering(false);    
+
+    QVERIFY (m_startChangesCalled == true);
+
+    QVERIFY (m_createCallHeaderCalled == true);
+    QCOMPARE (m_createCallHeaderInt, 2);
+
+    QVERIFY (m_setLabelCalled == true);
+    QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ());
+    QCOMPARE (m_setLabelBubbleId, 1);
+    QCOMPARE (labelText, QString("Attempting"));
+
+    QVERIFY (m_setCliCalled == true);
+    QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ());
+    QCOMPARE (m_setCliBubbleId, 1);
+    QCOMPARE (cliText, QString("emergency"));
+    
+    QVERIFY (m_setCipheringCalled == true);
+    
+    QVERIFY (m_endChangesCalled == true);    
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateBubble ()
+{
+    // Bubble id will return -1
+    m_bubble_id = -1;
+    
+    TPhoneCmdParamCallHeaderData callHeader;
+    callHeader.SetCallState (2);
+    callHeader.SetLabelText (_L("Foo2"));
+    callHeader.SetDiverted (EFalse);
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateBubble, 3, &callHeader);
+    QVERIFY (m_startChangesCalled == false);
+    
+    //Test with available bubble id
+    m_bubble_id = -2;
+    
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateBubble, 3, &callHeader);
+    
+    QVERIFY (m_startChangesCalled == true);
+    
+    QVERIFY (m_bubbleIdCalled == true);
+    QCOMPARE (m_bubbleIdCallId, 3);
+
+    QVERIFY (m_setStateCalled == true); 
+    QCOMPARE (m_setStateCallId, 3);
+    QCOMPARE (m_setStateBubbleId, 2);
+    QCOMPARE (m_setStateCallState, 2); 
+
+    QVERIFY (m_setLabelCalled == true);
+    QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ());
+    QCOMPARE (m_setLabelBubbleId, 2);
+    QCOMPARE (labelText, QString("Foo2"));
+
+    QVERIFY (m_setDivertCalled == true);
+    QVERIFY (m_bubblewrapperbool == false);
+    QCOMPARE (m_bubblewrapperint, 2);
+
+    QVERIFY (m_endChangesCalled == true);	
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateCallHeaderRemoteInfoData ()
+{
+    // Bubble id will return -1
+    m_bubble_id = -1;
+    TPhoneCmdParamCallHeaderData callHeader;
+    callHeader.SetCLIText (_L("Bar3"), TPhoneCmdParamCallHeaderData::ERight);
+    callHeader.SetCNAPText (_L("CNAP3"), TPhoneCmdParamCallHeaderData::ERight);
+    callHeader.SetDiverted (ETrue);
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoData, 4, &callHeader);
+    QVERIFY (m_startChangesCalled == false);
+    
+    //Test with available bubble id
+    m_bubble_id = -2;
+    
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoData, 4, &callHeader);
+    
+    QVERIFY (m_startChangesCalled == true);
+
+    QVERIFY (m_bubbleIdCalled == true);
+    QCOMPARE (m_bubbleIdCallId, 4);
+
+    QVERIFY (m_setCliCalled == true);
+    QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ());
+    QCOMPARE (m_setCliBubbleId, 2);
+    QCOMPARE (cliText, QString("Bar3"));
+
+    QVERIFY (m_setSecondaryCliCalled == true);
+    QString cnapText = QString::fromUtf16 (m_setSecondaryCliText->Ptr (), m_setSecondaryCliText->Length ());
+    QCOMPARE (m_setSecondaryCliBubbleId, 2);
+    QCOMPARE (cnapText, QString("CNAP3"));
+
+    QVERIFY (m_setDivertCalled == true);
+    QVERIFY (m_bubblewrapperbool == true);
+    QCOMPARE (m_bubblewrapperint, 2);
+
+    QVERIFY (m_endChangesCalled == true);	
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel ()
+{
+    // Bubble id will return -1
+    m_bubble_id = -1;
+    TPhoneCmdParamCallHeaderData callHeader;
+    callHeader.SetLabelText (_L("Foo4"));
+    callHeader.SetCLIText (_L("Bar4"), TPhoneCmdParamCallHeaderData::ERight);
+    callHeader.SetCNAPText (_L("CNAP4"), TPhoneCmdParamCallHeaderData::ERight);
+    callHeader.SetDiverted (ETrue);
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, 4, &callHeader);
+
+    QVERIFY (m_startChangesCalled == false);
+    
+    
+    //Test with available bubble id
+    m_bubble_id = -2;    
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, 4, &callHeader);
+
+    QVERIFY (m_startChangesCalled == true);
+
+    QVERIFY (m_bubbleIdCalled == true);
+    QCOMPARE (m_bubbleIdCallId, 4);
+
+    QVERIFY (m_setLabelCalled == true);
+    QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ());
+    QCOMPARE (m_setLabelBubbleId, 2);
+    QCOMPARE (labelText, QString("Foo4"));
+
+    QVERIFY (m_setCliCalled == true);
+    QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ());
+    QCOMPARE (m_setCliBubbleId, 2);
+    QCOMPARE (cliText, QString("Bar4"));
+
+    QVERIFY (m_setSecondaryCliCalled == true);
+    QString cnapText = QString::fromUtf16 (m_setSecondaryCliText->Ptr (), m_setSecondaryCliText->Length ());
+    QCOMPARE (m_setSecondaryCliBubbleId, 2);
+    QCOMPARE (cnapText, QString("CNAP4"));
+
+    QVERIFY (m_setDivertCalled == true);
+    QVERIFY (m_bubblewrapperbool == true);
+    QCOMPARE (m_bubblewrapperint, 2);
+
+    QVERIFY (m_endChangesCalled == true);   
+}
+
+void TestPhoneUIQtViewAdapter::testCallIdByState ()
+{
+    TPhoneCmdParamCallHeaderData callHeader;
+    TPhoneCmdParamCallStateData data;
+    callHeader.SetCallState (EPEStateConnected);
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateBubble, 0, &callHeader);
+    data.SetCallState (EPEStateConnected);
+    m_adapter->HandleCommandL (EPhoneViewGetCallIdByState, &data);
+    QCOMPARE (data.CallId(), 0);
+}
+
+void TestPhoneUIQtViewAdapter::testSetToolbarButtons ()
+{
+    m_toolbarActionCount = 0;
+    TPhoneCmdParamInteger intParam;
+    intParam.SetInteger (R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA);
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateCba, &intParam);
+    QCOMPARE(m_toolbarActionCount,2);
+
+    m_toolbarActionCount = 0;
+    intParam.SetInteger (R_PHONEUI_DIALER_CBA);
+    m_adapter->ExecuteCommandL (EPhoneViewUpdateCba, &intParam);
+    QCOMPARE(m_toolbarActionCount,4);
+}
+
+void TestPhoneUIQtViewAdapter::testHoldFlag ()
+{
+    TPhoneCmdParamBoolean boolParam;
+    m_adapter->ExecuteCommandL (EPhoneViewGetHoldFlag, &boolParam);
+    QCOMPARE ((bool)boolParam.Boolean (), false);
+
+    boolParam.SetBoolean (ETrue);
+    m_adapter->ExecuteCommandL (EPhoneViewSetHoldFlag, &boolParam);
+    m_adapter->ExecuteCommandL (EPhoneViewGetHoldFlag, &boolParam);
+    QCOMPARE ((bool)boolParam.Boolean (), true);
+    
+    boolParam.SetBoolean (EFalse);
+    m_adapter->ExecuteCommandL (EPhoneViewSetHoldFlag, &boolParam);
+    m_adapter->ExecuteCommandL (EPhoneViewGetHoldFlag, &boolParam);
+    QCOMPARE ((bool)boolParam.Boolean (), false);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewHideNaviPaneAudioVolume ()
+{
+    m_adapter->ExecuteCommandL (EPhoneViewHideNaviPaneAudioVolume);
+    QCOMPARE (m_removeVolumeSliderCalled, true);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewSetNaviPaneAudioVolume ()
+{
+    TPhoneCmdParamInteger intParam;
+    intParam.SetInteger (3);
+    m_adapter->ExecuteCommandL (EPhoneViewSetNaviPaneAudioVolume, &intParam);
+    QCOMPARE (m_setVolumeSliderValueCalled, true);
+    QCOMPARE (m_volumeSliderValue, 3);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewGetAudioVolumeLevel ()
+{
+    TPhoneCmdParamInteger intParam;
+    m_adapter->ExecuteCommand (EPhoneViewGetAudioVolumeLevel, &intParam);
+    QCOMPARE (m_volumeSliderValueCalled, true);
+    QCOMPARE (intParam.Integer (), 5);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewActivateMuteUIChanges ()
+{
+    TPhoneCmdParamBoolean boolParam;
+    boolParam.SetBoolean (true);
+    m_adapter->ExecuteCommandL (EPhoneViewActivateMuteUIChanges, &boolParam);
+    QCOMPARE (m_setPhoneMutedCalled, true);
+}
+
+void TestPhoneUIQtViewAdapter::testEPhoneViewGetCountOfActiveCallss ()
+{
+    TPhoneCmdParamInteger intParam;
+    m_adapter->ExecuteCommandL (EPhoneViewGetCountOfActiveCalls, &intParam);
+    QVERIFY (m_activeCallCountCalled == true);
+}
+
+void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdId ()
+{
+    // Default
+    m_adapter->ExecuteCommandL (0);    
+}
+
+void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdIdAndCallId ()
+{
+    // Default
+    m_adapter->ExecuteCommandL (0, 0);
+
+    m_adapter->ExecuteCommandL (EPhoneViewRemoveCallHeader, 0);
+    QVERIFY (m_startChangesCalled == true);
+    QVERIFY (m_endChangesCalled == true);
+    
+    m_removeCallFromConference = false;
+    m_adapter->ExecuteCommandL (EPhoneViewRemoveFromConference, 0);   
+    QVERIFY (m_startChangesCalled == true);
+    QVERIFY (m_endChangesCalled == true);
+    QVERIFY (m_removeCallFromConference == true);
+    
+    m_removeCallFromConference = false;
+    m_adapter->ExecuteCommandL (EPhoneViewPrivateFromConference, 0);   
+    QVERIFY (m_startChangesCalled == true);
+    QVERIFY (m_endChangesCalled == true); 
+    QVERIFY (m_removeCallFromConference == true);      
+}
+
+void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdIdAndCmdParam ()
+{
+    TPhoneCmdParamBoolean boolParam;
+    // Default
+    m_adapter->ExecuteCommandL (0, &boolParam);
+    
+    
+    // Is conference
+    m_adapter->ExecuteCommandL (EPhoneViewGetIsConference, &boolParam);
+    QCOMPARE ((bool)boolParam.Boolean (), false);
+    
+    
+    // Get expand bubble call id
+    TPhoneCmdParamInteger intParam;
+    m_adapter->ExecuteCommandL (EPhoneViewGetExpandedBubbleCallId, &intParam);
+    QCOMPARE ((int)intParam.Integer(), -1);
+    
+    m_callStateMap.insert(0, EPEStateConnected);
+    m_bubblesMap.insert(0, 0); 
+    m_callStateMap.insert(1, EPEStateHeld);
+    m_bubblesMap.insert(1, 1);  
+    
+    m_adapter->ExecuteCommandL (EPhoneViewGetExpandedBubbleCallId, &intParam);
+    QCOMPARE ((int)intParam.Integer(), 1);
+    
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+}
+
+void TestPhoneUIQtViewAdapter::testSetTouchButtons ()
+{
+    TPhoneCmdParamBoolean boolParam;
+    boolParam.SetBoolean( false );
+    
+    
+    
+    //Connected call
+    m_callStateMap.insert(0, EPEStateConnected);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);    
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdHold));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+    
+    //Emergency
+    boolParam.SetBoolean(true);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(false == m_actionMap.value(0)->contains(EPhoneInCallCmdHold));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+    
+    //Held and active
+    boolParam.SetBoolean(false);
+    m_callStateMap.insert(1, EPEStateHeld);
+    m_bubblesMap.insert(1, 1);    
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdCreateConference));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+    QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdCreateConference));
+    QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdEndThisActiveCall));
+    clearBubbleCommands(0);
+    clearBubbleCommands(1);
+
+    //Connected call and waiting
+    m_callStateMap.insert(0, EPEStateConnected);
+    m_bubblesMap.insert(0, 0);
+   
+    boolParam.SetBoolean(false);
+    m_callStateMap.insert(1, EPEStateRinging);
+    m_bubblesMap.insert(1, 1);    
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdHold));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+    QVERIFY(m_actionMap.value(1)->contains(EPhoneCallComingCmdReject));
+    clearBubbleCommands(0);
+    clearBubbleCommands(1);
+
+    //Held call and waiting
+    m_callStateMap.insert(0, EPEStateHeld);
+    m_bubblesMap.insert(0, 0);
+   
+    boolParam.SetBoolean(false);
+    m_callStateMap.insert(1, EPEStateRinging);
+    m_bubblesMap.insert(1, 1);    
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdUnhold));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+    QVERIFY(m_actionMap.value(1)->contains(EPhoneCallComingCmdReject));
+    clearBubbleCommands(0);
+    clearBubbleCommands(1);    
+    
+    //Idle
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateIdle);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(0==m_actionMap.keys().size());
+    clearBubbleCommands(0);
+    
+    //Conference Idle
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateConferenceIdle);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(0==m_actionMap.keys().size());
+    clearBubbleCommands(0);
+    
+    //Disconnecting
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateDisconnecting);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(0==m_actionMap.keys().size());
+    clearBubbleCommands(0);
+    
+    //Dialling
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateDialing);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(1==m_actionMap.value(0)->size());
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisOutgoingCall));
+    clearBubbleCommands(0);
+    
+    //Ringing
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateRinging);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(2==m_actionMap.value(0)->size());
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneCallComingCmdAnswer));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneCallComingCmdReject));
+    clearBubbleCommands(0);
+    
+    //Connecting
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateConnecting);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(1==m_actionMap.value(0)->size());
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisOutgoingCall));
+    clearBubbleCommands(0);
+
+    //Connected Conference
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateConnectedConference);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(2==m_actionMap.value(0)->size());
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdHold));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+
+    // Conference and held
+    m_callStateMap.insert(1, EPEStateHeld);
+    m_bubblesMap.insert(1, 1);    
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdSwap));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+    QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdJoin));
+    QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdEndThisActiveCall));
+    clearBubbleCommands(0);
+    clearBubbleCommands(1);
+    
+    //Held conference
+    m_conferenceCallList.append(1); //for coverage
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateHeldConference);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(2==m_actionMap.value(0)->size());
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall));
+    QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdUnhold));
+    clearBubbleCommands(0);
+    m_conferenceCallList.clear();
+    
+    //Unknown state
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateUnknown);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(0==m_actionMap.keys().size());
+    clearBubbleCommands(0);
+    
+    //Default case
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, 100);
+    m_bubblesMap.insert(0, 0);
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(0==m_actionMap.keys().size());
+    clearBubbleCommands(0);
+}
+
+void TestPhoneUIQtViewAdapter::testCreateConferenceBubble ()
+{
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateConnected);
+    m_bubblesMap.insert(0, 0);
+    m_callStateMap.insert(1, EPEStateHeld);
+    m_bubblesMap.insert(1, 1);  
+ 
+    //Create conference
+    TPhoneCmdParamCallHeaderData callHeader;
+    callHeader.SetCallState (2);
+    callHeader.SetLabelText (_L("Foo2"));
+    callHeader.SetDiverted (EFalse);
+    callHeader.SetCipheringIndicatorAllowed(true);
+    callHeader.SetCiphering(false);
+    
+    m_adapter->ExecuteCommandL (EPhoneViewCreateConference, 3, &callHeader);    
+    QVERIFY (m_creataConferenceCalled == true);
+    
+    //
+    TPhoneCmdParamBoolean  conferenceDataValue;
+    m_adapter->ExecuteCommandL (EPhoneViewGetCallExistsInConference, 0, &conferenceDataValue);
+    QVERIFY (conferenceDataValue.Boolean() == true);
+    
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveConferenceBubble);
+    QVERIFY (m_removeConferenceCalled == true);
+    
+    m_adapter->ExecuteCommandL (EPhoneViewGetCallExistsInConference, 0, &conferenceDataValue);
+    QVERIFY (conferenceDataValue.Boolean() == false);
+    
+    QVERIFY (m_setCipheringCalled == true);
+}
+
+void TestPhoneUIQtViewAdapter::testHandleCommandL ()
+{
+    QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL (
+            EPhoneIsDTMFDialerVisible) );    
+    QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL (
+            EPhoneViewIsDTMFEditorVisible) ); 
+    QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL (
+            EPhoneViewGetNumberEntryIsVisibleStatus) ); 
+    /*QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL (
+            EPhoneViewGetNumberEntryIsUsedStatus) );*/ 
+    QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL (
+            EPhoneIsCustomizedDialerVisible) ); 
+    QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL (
+            EPhoneViewGetNeedToSendToBackgroundStatus) );
+    
+    //Default handling for coverage
+    QVERIFY( EPhoneViewResponseSuccess == m_adapter->HandleCommandL (0) ); 
+    TPhoneCmdParamBoolean boolean;
+    QVERIFY( EPhoneViewResponseSuccess == m_adapter->HandleCommandL (0, &boolean) );
+    
+    m_adapter->ExecuteCommand(0);
+    m_adapter->ExecuteCommand(EPhoneViewSetDtmfOptionsFlag, &boolean);
+    m_adapter->ExecuteCommand(EPhoneViewSetVideoCallDTMFVisibilityFlag, &boolean);
+    m_adapter->ExecuteCommand(0, &boolean);
+    m_adapter->ExecuteCommandL(0, 0, &boolean);
+    _LIT (KText, "test");
+    TBufC<8> textBuf (KText);
+    m_adapter->ExecuteCommandL(0, 0, textBuf);
+    m_adapter->FetchContent();
+    
+}
+
+void TestPhoneUIQtViewAdapter::testGetSelectedConferenceMember ()
+{
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+
+    TPhoneCmdParamInteger  integerParam;
+    QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL(
+            EPhoneViewSelectedConfMember, &integerParam) );    
+    
+    m_callStateMap.insert(1, EPEStateConnected);
+    m_bubblesMap.insert(1, 0);
+    
+    QVERIFY( EPhoneViewResponseSuccess == m_adapter->HandleCommandL(
+            EPhoneViewSelectedConfMember, &integerParam) ); 
+    
+    QVERIFY( integerParam.Integer() == 1 );    
+}
+
+void TestPhoneUIQtViewAdapter::testSetAudioPath ()
+{
+    TPhoneCmdParamAudioOutput audioOutput;
+    audioOutput.SetAudioOutput( EPELoudspeaker );
+    m_adapter->ExecuteCommandL(EPhoneViewActivateAudioPathUIChanges, &audioOutput);
+    QVERIFY( m_phoneButtonFlags == PhoneUIQtButtonsController::Ihf );
+    
+    audioOutput.SetAudioOutput( EPEWiredAudioAccessory );
+    m_adapter->ExecuteCommandL(EPhoneViewActivateAudioPathUIChanges, &audioOutput);
+    QVERIFY( m_phoneButtonFlags == PhoneUIQtButtonsController::Wired );
+    
+    audioOutput.SetAudioOutput( EPEBTAudioAccessory );
+    m_adapter->ExecuteCommandL(EPhoneViewActivateAudioPathUIChanges, &audioOutput);
+    QVERIFY( m_phoneButtonFlags == PhoneUIQtButtonsController::Btaa );
+
+}
+
+void TestPhoneUIQtViewAdapter::testMuteRingToneOnAnswer ()
+{
+    m_adapter->ExecuteCommandL(EPhoneViewMuteRingToneOnAnswer);
+    QVERIFY( m_EPhoneViewMuteRingToneOnAnswer_called == true );
+}
+
+void TestPhoneUIQtViewAdapter::testStopRingTone ()
+{
+    m_adapter->ExecuteCommandL(EPhoneViewStopRingTone);
+    QVERIFY( m_EPhoneViewStopRingTone_called == true );
+}
+
+void TestPhoneUIQtViewAdapter::testMuteRingTone ()
+{
+    m_adapter->ExecuteCommandL(EPhoneViewMuteRingTone);
+    QVERIFY( m_EPhoneViewMuteRingTone_called == true );
+}
+
+void TestPhoneUIQtViewAdapter::testPlayRingTone ()
+{
+    TPhoneCmdParamRingTone ringToneParam;
+    m_adapter->ExecuteCommandL(EPhoneViewPlayRingTone, &ringToneParam);
+    QVERIFY( m_EPhoneViewPlayRingTone_called == true );
+}
+
+void TestPhoneUIQtViewAdapter::testShowGlobalNote ()
+{
+    TPhoneCmdParamGlobalNote param;
+    m_adapter->ExecuteCommandL(EPhoneViewShowGlobalNote, &param);
+    QVERIFY( m_showGlobalNoteCalled == true );
+}
+
+void TestPhoneUIQtViewAdapter::testSetExpandActions()
+{
+    TPhoneCmdParamBoolean boolParam;
+    boolParam.SetBoolean( false );
+
+    m_callStateMap.clear();
+    m_bubblesMap.clear();
+    m_callStateMap.insert(0, EPEStateConnected);
+    m_callStateMap.insert(1, EPEStateHeld);
+    m_bubblesMap.insert(0, 0);
+    m_bubblesMap.insert(1, 1);
+    m_expandAction.clear();
+    
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(m_expandAction.contains(0));        
+    QVERIFY(m_expandAction[0]==EPhoneCmdUpdateUiControls);
+    QVERIFY(m_expandAction.contains(1));        
+    QVERIFY(m_expandAction[1]==EPhoneInCallCmdSwap);
+} 
+
+void TestPhoneUIQtViewAdapter::testShowDialpad ()
+{
+    m_adapter->ExecuteCommandL(EPhoneViewOpenDialer);
+    QVERIFY( m_showDialpadCalled == true );
+}
+
+void TestPhoneUIQtViewAdapter::testDialpadVisibility ()
+{
+    m_showDialpadCalled = false;
+    m_hideDialpadCalled = false;
+    
+    TPhoneCmdParamBoolean param;
+    param.SetBoolean(ETrue);
+    m_adapter->ExecuteCommandL(EPhoneViewSetNumberEntryVisible, &param);
+    QVERIFY( m_showDialpadCalled == true );
+    QVERIFY( m_hideDialpadCalled == false );
+    
+    m_showDialpadCalled = false;
+    m_hideDialpadCalled = false;
+    
+    param.SetBoolean(EFalse);
+    m_adapter->ExecuteCommandL(EPhoneViewSetNumberEntryVisible, &param);
+    QVERIFY( m_showDialpadCalled == false );
+    QVERIFY( m_hideDialpadCalled == true );
+}
+
+void TestPhoneUIQtViewAdapter::removeAllCallHeaders()
+{
+    m_removeConferenceCalled = false;
+    m_removeCallHeaderCalled = false;
+    m_conferenceCallList.clear();
+    m_conferenceCallList.append(0);
+    m_conferenceCallList.append(1);
+    
+    m_bubblesMap.clear();
+    m_bubblesMap.insert(0,0);
+    m_bubblesMap.insert(1,1);
+    m_bubblesMap.insert(2,2);
+    m_bubblesMap.insert(7,3);
+    
+    m_callStateMap.clear();
+    m_callStateMap.insert(0,0);
+    m_callStateMap.insert(1,1);
+    m_callStateMap.insert(2,2);
+    m_callStateMap.insert(7,3);
+    
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveAllCallHeaders);
+    
+    QVERIFY(m_removeConferenceCalled);
+    QVERIFY(m_removeCallHeaderCalled);
+}
+
+void TestPhoneUIQtViewAdapter::testRemoveDialpad ()
+{
+    m_clearAndHideDialpadCalled = false;
+
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveNumberEntry);
+    QVERIFY( m_clearAndHideDialpadCalled == true );
+    
+    m_clearAndHideDialpadCalled = false;
+
+    m_adapter->ExecuteCommandL(EPhoneViewClearNumberEntryContent);
+    QVERIFY( m_clearAndHideDialpadCalled == true );
+}
+
+void TestPhoneUIQtViewAdapter::testGetDialpadStringLength ()
+{
+    TPhoneCmdParamInteger integerParam;
+
+    m_adapter->ExecuteCommandL(EPhoneViewGetNumberEntryCount, &integerParam );
+    QVERIFY( integerParam.Integer() == 7 );
+    
+}
+
+void TestPhoneUIQtViewAdapter::testGetDialpadString ()
+{
+    HBufC *numberEntryContent = 0;
+    
+    TRAP_IGNORE( numberEntryContent = HBufC::NewL( KPhoneNumberEntryBufferSize ) );
+    if (numberEntryContent) {    
+        TPtr ptr( numberEntryContent->Des() );
+        ptr.Zero();   
+                       
+        TPhoneCmdParamString stringParam;
+        stringParam.SetString( &ptr );
+        m_adapter->ExecuteCommand(
+                EPhoneViewGetNumberFromEntry,
+                &stringParam );  
+    
+        QVERIFY( 0 == numberEntryContent->Des().Compare(_L("1234567")) );
+        
+        TPtr ptr2( numberEntryContent->Des() );
+        ptr2.Zero();
+        TPhoneCmdParamString stringParam2;
+        stringParam2.SetString( &ptr2 );
+        m_adapter->ExecuteCommandL(
+                EPhoneViewGetNumberFromEntry,
+                &stringParam2 );  
+    
+        QVERIFY( 0 == numberEntryContent->Des().Compare(_L("1234567")) );
+    }
+}
+
+void TestPhoneUIQtViewAdapter::testAddToConference()
+{
+    m_adapter->ExecuteCommandL(EPhoneViewAddToConference);
+    QVERIFY( m_addToConferenceBubbleCalled == true );
+    
+}
+
+void TestPhoneUIQtViewAdapter::testSetConferenceExpanded()
+{
+    m_adapter->ExecuteCommand(EPhoneSetConferenceExpanded);
+    QVERIFY( m_ExpandConferenceCalled == true );
+    
+}
+
+void TestPhoneUIQtViewAdapter::testSetMenuActions()
+{
+    m_setMenuActionsCalled = false;
+    m_isDialpadVisible = false;
+    TPhoneCmdParamBoolean boolParam;
+    boolParam.SetBoolean( false );
+    
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); 
+    
+    QVERIFY(m_setMenuActionsCalled);
+    
+    m_setMenuActionsCalled = false;
+    m_isDialpadVisible = true;
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(m_setMenuActionsCalled);
+    
+    m_dialpadText = QString("");
+    m_setMenuActionsCalled = false;
+    m_isDialpadVisible = true;
+    m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam);
+    QVERIFY(m_setMenuActionsCalled);
+    
+    connect(this, SIGNAL(dialpadAboutToClose()), m_adapter, SLOT(dialpadClosed()));
+    connect(this, SIGNAL(keyPressReleased(QKeyEvent*)), 
+            m_adapter, SLOT(keyReleased(QKeyEvent*)));
+    
+    m_setMenuActionsCalled = false;
+    m_isDialpadVisible = true;
+    QKeyEvent keyEvent(QEvent::MouseButtonPress, 0, Qt::NoModifier);
+    
+    emit keyPressReleased(&keyEvent);
+    QVERIFY(m_setMenuActionsCalled);
+    
+    m_setMenuActionsCalled = false;
+    m_isDialpadVisible = false;
+    emit keyPressReleased(&keyEvent);
+    QVERIFY(false == m_setMenuActionsCalled);
+    
+    m_setMenuActionsCalled = false;
+    m_isDialpadVisible = true;
+    emit dialpadAboutToClose();
+    QVERIFY(m_setMenuActionsCalled);
+    
+    m_setMenuActionsCalled = false;
+    emit keyPressReleased(&keyEvent);
+    QVERIFY(false == m_setMenuActionsCalled);
+}
+
+void TestPhoneUIQtViewAdapter::testNoteController()
+{
+    m_showQueryCalled = false;
+    m_removeDtmfNoteCalled = false;
+    m_removeNoteCalled = false;
+    m_removeQueryCalled = false;
+    m_showNoteCalled = false;
+    m_removeGlobalWaitNoteCalled = false;
+    
+    QVERIFY( (0 != m_adapter->noteController()) );
+    
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveDtmfNote);
+    QVERIFY( m_removeDtmfNoteCalled == true );
+    
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveNote);
+    QVERIFY( m_removeNoteCalled == true );
+    
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveQuery);
+    QVERIFY( m_removeQueryCalled == true );
+    
+    TPhoneCmdParamGlobalNote param;
+    m_adapter->ExecuteCommandL(EPhoneViewShowQuery, &param);
+    QVERIFY( m_showQueryCalled == true );
+    
+    m_adapter->ExecuteCommandL(EPhoneViewShowNote, &param);
+    QVERIFY( m_showNoteCalled == true );
+    
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveGlobalNote);
+    QVERIFY( m_removeGlobalWaitNoteCalled == true );
+    
+    m_removeGlobalWaitNoteCalled = false;
+    m_adapter->ExecuteCommandL(EPhoneViewRemoveGlobalWaitNote);
+    QVERIFY( m_removeGlobalWaitNoteCalled == true );
+    
+    m_showQueryCalled = false;
+    m_removeDtmfNoteCalled = false;
+    m_removeNoteCalled = false;
+    m_removeQueryCalled = false;
+    m_showNoteCalled = false;
+    
+    m_adapter->ExecuteCommandL(EPhoneViewRemovePhoneDialogs);
+    QVERIFY( m_removeQueryCalled == true );
+    QVERIFY( m_removeNoteCalled == true );
+    
+}
+
+void TestPhoneUIQtViewAdapter::testHsToForegroundAfterCall()
+{
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    m_adapter->ExecuteCommand( EPhoneViewHsToForegroundAfterCall,
+        &booleanParam );
+}
+
+void TestPhoneUIQtViewAdapter::testCipheringInfoChange()
+{
+	m_bubble_id = 1;
+    TPhoneCmdParamCallHeaderData callHeader;
+    callHeader.SetCipheringIndicatorAllowed(true);
+    callHeader.SetCiphering(false);
+    m_adapter->ExecuteCommandL (EPhoneViewCipheringInfoChange, 1, &callHeader);
+    QVERIFY (m_startChangesCalled == true);
+    QVERIFY (m_setCipheringCalled == true);
+    QVERIFY (m_endChangesCalled == true);
+    m_setCipheringCalled = false;
+	m_bubble_id = -1;
+    m_adapter->ExecuteCommandL (EPhoneViewCipheringInfoChange, -1, &callHeader);
+    QVERIFY (m_setCipheringCalled == false);
+}
+
+void TestPhoneUIQtViewAdapter::testSetHidden()
+{
+    m_adapter->ExecuteCommandL(EPhoneViewUpdateFSW);
+}
+
+void TestPhoneUIQtViewAdapter::testBeginEndUiUpdate()
+{
+    m_adapter->ExecuteCommand(EPhoneViewBeginUpdate);
+    QVERIFY (m_startChangesCalled == true);
+    
+    m_adapter->ExecuteCommand(EPhoneViewEndUpdate);
+    QVERIFY (m_endChangesCalled == true);
+}
+
+PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestPhoneUIQtViewAdapter)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneuiqtviewadapter/ut_phoneuiqtviewadapter.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEFF8FEA2
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+	                 \epoc32\include\mw \
+                   \sf\app\phone\inc \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phonemediatorcenter/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneringingtoneplayer/inc \
+                   ../../../phoneui2/srcdata
+
+
+    LIBS += -lphoneuiutils
+    LIBS += -lPhoneRingingtonePlayer
+    LIBS += -lphoneuiqtview
+    LIBS += -lxqservice
+    LIBS += -lxqserviceutil
+    LIBS += -lxqplugins
+    LIBS += -lserviceprovidersettings
+    LIBS += -lakncapserverclient
+    LIBS += -lxqsettingsmanager
+    LIBS += -llogsengine
+    
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+}
+
+# Input
+HEADERS += ../../inc/phoneuiqtviewadapter.h
+SOURCES += ../../src/phoneuiqtviewadapter.cpp
+HEADERS += ../../inc/phoneresourceadapter.h
+SOURCES += ../../src/phoneresourceadapter.cpp
+HEADERS += ../../inc/phoneuiqtbuttonscontroller.h
+HEADERS += ../../inc/phonenotecontroller.h
+HEADERS += ../../inc/telephonyservice.h
+SOURCES += ../../src/telephonyservice.cpp
+HEADERS += ../../inc/phoneuicommandcontroller.h
+SOURCES += ../../src/phoneuicommandcontroller.cpp
+HEADERS += ../../inc/phonecommandextensionwrapper.h
+SOURCES += ../../src/phonecommandextensionwrapper.cpp
+HEADERS += ../../inc/phonemessagecontroller.h
+SOURCES += ../../src/phonemessagecontroller.cpp
+HEADERS += ../../inc/phoneindicatorcontroller.h
+SOURCES += ../../src/phoneindicatorcontroller.cpp
+SOURCES += phoneuiqtbuttonscontroller_stub.cpp
+HEADERS += phonebubblewrapper.h
+SOURCES += phonebubblewrapper_stub.cpp
+SOURCES += cphoneringingtonecontroller_stub.cpp
+SOURCES += cphonemediatorfactory_stub.cpp
+SOURCES += cphonemediatorsender_stub.cpp
+SOURCES += phonenotecontroller_stub.cpp
+SOURCES += unit_tests.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/phoneuiqtviewadapter_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,174 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 !!!!
+*
+*/
+
+#include "phoneuiqtviewadapter.h"
+#include "phoneuiqtviewif.h"
+
+//CONSTANTS
+bool phoneAppStart;
+bool inCallDialerStart;
+static const int PHONE_CALL_NOT_FOUND = -1;
+
+PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) : 
+    QObject (parent), m_view (view), m_idleUid(-1)
+{}
+
+PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter ()
+{}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId)
+{
+switch (aCmdId) {
+case EPhoneViewOpenDialer:
+        inCallDialerStart = true;
+        break;
+default:
+        break;
+    }
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam)
+{
+switch (aCmdId) {
+case EPhoneViewBringAppToForeground:
+        phoneAppStart = true;
+        break;
+default:
+        break;
+    }
+}
+
+int PhoneUIQtViewAdapter::idleAppUid ()
+{
+// <-- QT HS START -->);
+    m_idleUid=0x20022F35;
+// <-- QT HS END -->
+    return m_idleUid;
+}
+
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId)
+{}
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId,
+    TPhoneCommandParam *aCommandParam)
+{}
+void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId, 
+    TDesC &aMessage)
+{}
+TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId)
+{}
+TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId, 
+    TPhoneCommandParam *aCommandParam)
+{}
+void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId)
+{    Q_UNUSED (aCmdId);    }
+void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId, TPhoneCommandParam *aCommandParam)
+{}
+const TDesC& PhoneUIQtViewAdapter::FetchContent ()
+{    return KNullDesC;}
+void PhoneUIQtViewAdapter::setTopApplication (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::createCallHeader( 
+    int callId, 
+    TPhoneCommandParam *commandParam )
+{}
+void PhoneUIQtViewAdapter::createEmergencyCallHeader(
+    int callId, 
+    TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::updateCallHeaderState (
+    int callId, 
+    TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo (int callId, TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfoAndLabel (int callId, TPhoneCommandParam *commandParam)
+{}
+TPhoneViewResponseId PhoneUIQtViewAdapter::callIdByState (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::setTouchButtons (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::setToolbarButtons (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::callHoldFlag (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::writeAudioVolumeLevel (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::setAudioVolumeSliderValue (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::setMuteIndication (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::activeCallCount (TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::setAudioPath (TPhoneCommandParam *commandParam)
+    {    }
+void PhoneUIQtViewAdapter::expandedBubbleCallId(TPhoneCommandParam *commandParam)
+    {    }
+void PhoneUIQtViewAdapter::openDialpad()
+    {    }
+void PhoneUIQtViewAdapter::createConferenceBubble(int callId, TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::conferenceCallId(int callId, TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::removeConferenceBubble()
+{}
+void PhoneUIQtViewAdapter::isConference(TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::removeCallFromConference(int callId)
+{}
+TPhoneViewResponseId PhoneUIQtViewAdapter::getSelectedConferenceMember(
+        TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::setPrivateFromConference(int callId)
+{}
+void PhoneUIQtViewAdapter::setExpandActions()
+{}
+bool PhoneUIQtViewAdapter::callsExists(int call1State, int call2State)
+{}
+void PhoneUIQtViewAdapter::setParticipantListActions()
+{}
+void PhoneUIQtViewAdapter::setExpandedConferenceCallHeader()
+{}
+void PhoneUIQtViewAdapter::bringToForeground()
+{}
+void PhoneUIQtViewAdapter::showGlobalNote(
+        TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::setDialpadVisibility(
+        TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::removeAllCallHeaders()
+{}
+void PhoneUIQtViewAdapter::getNumberFromDialpad(
+        TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::getDialpadStringLength(
+        TPhoneCommandParam *commandParam)
+{}
+void PhoneUIQtViewAdapter::removeDialpad()
+{}
+
+void PhoneUIQtViewAdapter::dialpadClosed()
+{}
+
+void PhoneUIQtViewAdapter::keyReleased(QKeyEvent */*event*/)
+{}
+
+void PhoneUIQtViewAdapter::HandlePropertyChangedL( 
+    const TUid& aCategory,
+    const TUint aKey,
+    const TInt aValue)
+{}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,166 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for telephonyservice.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <hbapplication.h>
+#include <QSignalSpy>
+#include <xqservicerequest.h>
+#include <hbmenu.h>
+
+#include "telephonyservice.h"
+#include "phoneuiqtviewif.h"
+#include "phoneuiqtviewadapter.h"
+
+extern bool phoneAppStart;
+extern bool inCallDialerStart;
+
+#define PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestTelephonyService : public QObject,  public PhoneUIQtViewIF
+{
+    Q_OBJECT
+public:
+    TestTelephonyService();
+    virtual ~TestTelephonyService();
+    
+public: // PhoneUIQtViewIF
+    
+        BubbleManagerIF& bubbleManager (){};
+        void addBubbleCommand ( 
+                int bubbleId,
+                const PhoneAction& action ){};
+        void clearBubbleCommands (int bubbleId){};
+        void addParticipantListAction(
+                int commandId,  
+                const QString &text, 
+                const HbIcon &icon){};
+        void clearParticipantListActions(){};
+        void hideToolbar () {};
+        void showToolbar () {};
+        void setToolbarActions (const QList<PhoneAction*>& actions){};
+        int volumeSliderValue () {};
+        void removeVolumeSlider () {};
+        void setVolumeSliderValue (
+                int value, 
+                int commandId, 
+                int maxVolumeValue, 
+                int minVolumeValue ) { };
+
+        void setExpandAction(int bubbleId, int commandId) {};
+        void removeExpandAction(int bubbleId) {};
+        void showDialpad() {};
+        void hideDialpad() {};
+        bool isDialpadVisible() {};
+        QString dialpadText() {return QString("1234567");};
+        void clearAndHideDialpad(){};
+        void bringToForeground() {;};
+        void setMenuActions(const QList<PhoneAction*>& actions){;};
+        void shutdownPhoneApp() {;};
+        void setBackButtonVisible(bool visible) {;};        
+        HbMenu &menuReference() { return mMenu; };
+        
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup (); 
+    
+private slots:
+    void testConstructionDestruction ();
+    void startPhoneApp ();
+    void startInCallDialer ();
+    
+private:
+    TelephonyService *m_service; // class under test
+    PhoneUIQtViewAdapter *m_viewstub; // stub test
+    HbMenu mMenu;
+};
+
+TestTelephonyService::TestTelephonyService ()
+{
+}
+
+TestTelephonyService::~TestTelephonyService ()
+{
+}
+
+void TestTelephonyService::initTestCase ()
+{
+    m_viewstub = new PhoneUIQtViewAdapter (*this);
+    m_service = new TelephonyService(m_viewstub, this);
+}
+
+void TestTelephonyService::cleanupTestCase ()
+{
+    if (m_viewstub) {
+    delete m_viewstub;
+    }
+    
+    if (m_service) {
+    delete m_service;
+    }
+}
+
+void TestTelephonyService::init ()
+{
+}
+
+void TestTelephonyService::cleanup ()
+{
+}
+
+void TestTelephonyService::testConstructionDestruction ()
+{
+// empty
+}
+
+void TestTelephonyService::startPhoneApp ()
+{
+    phoneAppStart = false;
+    inCallDialerStart = false;
+    int phoneApp(0);
+    m_service->start(phoneApp);
+    QVERIFY (phoneAppStart == true);
+    QVERIFY (inCallDialerStart == false);
+}
+
+void TestTelephonyService::startInCallDialer ()
+{
+    phoneAppStart = false;
+    inCallDialerStart = false;
+    int dialer(1);
+    m_service->start(dialer);
+    QVERIFY (phoneAppStart == true);
+    QVERIFY (inCallDialerStart == true);
+}
+
+PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestTelephonyService)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiqtviewadapter/tsrc/ut_telephonyservice/ut_telephonyservice.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEDA69234
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+                   ../../../phoneuiutils/inc/ \
+                   ../../../phoneuiview2/inc \
+                   ../../../../inc \
+                   ../../../phoneui2/srcdata
+
+   
+    LIBS += -lphoneuiutils \
+            -lxqservice \
+            -lxqserviceutil 
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEWADAPTER
+}
+
+# Input
+HEADERS += ../../inc/telephonyservice.h
+SOURCES += ../../src/telephonyservice.cpp
+HEADERS += ../../inc/phoneuiqtviewadapter.h
+SOURCES += phoneuiqtviewadapter_stub.cpp
+SOURCES += unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/bwins/phoneuistatesu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,65 @@
+EXPORTS
+	??1CPhoneResourceResolverGSM@@UAE@XZ @ 1 NONAME ; CPhoneResourceResolverGSM::~CPhoneResourceResolverGSM(void)
+	?HandleKeyMessageL@CPhoneSingleCall@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 2 NONAME ; void CPhoneSingleCall::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?ConstructL@CPhoneTwoSingles@@MAEXXZ @ 3 NONAME ; void CPhoneTwoSingles::ConstructL(void)
+	??0CPhoneCallSetup@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 4 NONAME ; CPhoneCallSetup::CPhoneCallSetup(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?NewPhoneUIStateMachineFactoryL@@YAPAVCPhoneUIStateMachineFactoryBase@@XZ @ 5 NONAME ; class CPhoneUIStateMachineFactoryBase * NewPhoneUIStateMachineFactoryL(void)
+	?SendGlobalErrorNoteL@CPhoneErrorMessagesHandler@@IAEXH@Z @ 6 NONAME ; void CPhoneErrorMessagesHandler::SendGlobalErrorNoteL(int)
+	?HandlePhoneEngineMessageL@CPhoneCallSetup@@UAEXHH@Z @ 7 NONAME ; void CPhoneCallSetup::HandlePhoneEngineMessageL(int, int)
+	?HandleKeyMessageL@CPhoneAlerting@@MAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 8 NONAME ; void CPhoneAlerting::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?HandleCommandL@CPhoneAlerting@@MAEHH@Z @ 9 NONAME ; int CPhoneAlerting::HandleCommandL(int)
+	?HandleKeyMessageL@CPhoneTwoSingles@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 10 NONAME ; void CPhoneTwoSingles::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	??1CPhoneSingleCall@@UAE@XZ @ 11 NONAME ; CPhoneSingleCall::~CPhoneSingleCall(void)
+	??1CPhoneAlerting@@UAE@XZ @ 12 NONAME ; CPhoneAlerting::~CPhoneAlerting(void)
+	??0CPhoneIncoming@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 13 NONAME ; CPhoneIncoming::CPhoneIncoming(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?HandleConnectedL@CPhoneAlerting@@IAEXH@Z @ 14 NONAME ; void CPhoneAlerting::HandleConnectedL(int)
+	?ConstructL@CPhoneAlerting@@MAEXXZ @ 15 NONAME ; void CPhoneAlerting::ConstructL(void)
+	??0CPhoneSingleCall@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 16 NONAME ; CPhoneSingleCall::CPhoneSingleCall(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	??1CPhoneIncoming@@UAE@XZ @ 17 NONAME ; CPhoneIncoming::~CPhoneIncoming(void)
+	?HandleCommandL@CPhoneSingleCall@@UAEHH@Z @ 18 NONAME ; int CPhoneSingleCall::HandleCommandL(int)
+	?ConstructL@CPhoneIncoming@@MAEXXZ @ 19 NONAME ; void CPhoneIncoming::ConstructL(void)
+	?HandlePhoneEngineMessageL@CPhoneSingleCall@@UAEXHH@Z @ 20 NONAME ; void CPhoneSingleCall::HandlePhoneEngineMessageL(int, int)
+	??1CPhoneErrorMessagesHandler@@UAE@XZ @ 21 NONAME ; CPhoneErrorMessagesHandler::~CPhoneErrorMessagesHandler(void)
+	?ConstructL@CPhoneCallSetup@@MAEXXZ @ 22 NONAME ; void CPhoneCallSetup::ConstructL(void)
+	??0CPhoneErrorMessagesHandler@@IAE@PAVMPhoneViewCommandHandle@@PAVMPhoneStateMachine@@@Z @ 23 NONAME ; CPhoneErrorMessagesHandler::CPhoneErrorMessagesHandler(class MPhoneViewCommandHandle *, class MPhoneStateMachine *)
+	?HandleErrorL@CPhoneTwoSinglesAndWaiting@@UAEXABUTPEErrorInfo@@@Z @ 24 NONAME ; void CPhoneTwoSinglesAndWaiting::HandleErrorL(struct TPEErrorInfo const &)
+	??1CPhoneTwoSingles@@UAE@XZ @ 25 NONAME ; CPhoneTwoSingles::~CPhoneTwoSingles(void)
+	?HandleDisconnectingL@CPhoneAlerting@@IAEXH@Z @ 26 NONAME ; void CPhoneAlerting::HandleDisconnectingL(int)
+	?HandleCommandL@CPhoneGsmInCall@@MAEHH@Z @ 27 NONAME ; int CPhoneGsmInCall::HandleCommandL(int)
+	?CreatePhoneEngineL@CPhoneStateMachineGSM@@UAEPAVMPEPhoneModel@@AAVMEngineMonitor@@@Z @ 28 NONAME ; class MPEPhoneModel * CPhoneStateMachineGSM::CreatePhoneEngineL(class MEngineMonitor &)
+	?ResolveResourceID@CPhoneResourceResolverGSM@@UBEHABH@Z @ 29 NONAME ; int CPhoneResourceResolverGSM::ResolveResourceID(int const &) const
+	?HandleErrorL@CPhoneIncoming@@UAEXABUTPEErrorInfo@@@Z @ 30 NONAME ; void CPhoneIncoming::HandleErrorL(struct TPEErrorInfo const &)
+	??0CPhoneIdle@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 31 NONAME ; CPhoneIdle::CPhoneIdle(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?ShowErrorSpecificNoteL@CPhoneErrorMessagesHandler@@UAEXABUTPEErrorInfo@@@Z @ 32 NONAME ; void CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL(struct TPEErrorInfo const &)
+	??1CPhoneStateMachineGSM@@UAE@XZ @ 33 NONAME ; CPhoneStateMachineGSM::~CPhoneStateMachineGSM(void)
+	?OpenMenuBarL@CPhoneSingleCall@@MAEXXZ @ 34 NONAME ; void CPhoneSingleCall::OpenMenuBarL(void)
+	??0CPhoneStateMachineGSM@@IAE@PAVMPhoneViewCommandHandle@@@Z @ 35 NONAME ; CPhoneStateMachineGSM::CPhoneStateMachineGSM(class MPhoneViewCommandHandle *)
+	?SetDivertIndication@CPhoneGsmInCall@@MAEXH@Z @ 36 NONAME ; void CPhoneGsmInCall::SetDivertIndication(int)
+	?HandlePhoneEngineMessageL@CPhoneTwoSingles@@UAEXHH@Z @ 37 NONAME ; void CPhoneTwoSingles::HandlePhoneEngineMessageL(int, int)
+	?HandlePhoneEngineMessageL@CPhoneAlerting@@UAEXHH@Z @ 38 NONAME ; void CPhoneAlerting::HandlePhoneEngineMessageL(int, int)
+	?HandleRemConCommandL@CPhoneEmergency@@MAEHW4TRemConCoreApiOperationId@@W4TRemConCoreApiButtonAction@@@Z @ 39 NONAME ; int CPhoneEmergency::HandleRemConCommandL(enum TRemConCoreApiOperationId, enum TRemConCoreApiButtonAction)
+	?ConstructL@CPhoneSingleCall@@MAEXXZ @ 40 NONAME ; void CPhoneSingleCall::ConstructL(void)
+	?HandlePhoneEngineMessageL@CPhoneIncoming@@UAEXHH@Z @ 41 NONAME ; void CPhoneIncoming::HandlePhoneEngineMessageL(int, int)
+	?State@CPhoneStateMachineGSM@@UAEPAVMPhoneState@@XZ @ 42 NONAME ; class MPhoneState * CPhoneStateMachineGSM::State(void)
+	?HandleErrorL@CPhoneIdle@@MAEXABUTPEErrorInfo@@@Z @ 43 NONAME ; void CPhoneIdle::HandleErrorL(struct TPEErrorInfo const &)
+	?HandleConnectingL@CPhoneCallSetup@@MAEXH@Z @ 44 NONAME ; void CPhoneCallSetup::HandleConnectingL(int)
+	?UpdateInCallCbaL@CPhoneTwoSingles@@MAEXXZ @ 45 NONAME ; void CPhoneTwoSingles::UpdateInCallCbaL(void)
+	?HandleErrorL@CPhoneSingleAndWaiting@@MAEXABUTPEErrorInfo@@@Z @ 46 NONAME ; void CPhoneSingleAndWaiting::HandleErrorL(struct TPEErrorInfo const &)
+	??0CPhoneResourceResolverGSM@@IAE@XZ @ 47 NONAME ; CPhoneResourceResolverGSM::CPhoneResourceResolverGSM(void)
+	?ConstructL@CPhoneResourceResolverGSM@@IAEXXZ @ 48 NONAME ; void CPhoneResourceResolverGSM::ConstructL(void)
+	?HandlePhoneForegroundEventL@CPhoneGsmInCall@@MAEXXZ @ 49 NONAME ; void CPhoneGsmInCall::HandlePhoneForegroundEventL(void)
+	?HandlePhoneEngineMessageL@CPhoneIdle@@UAEXHH@Z @ 50 NONAME ; void CPhoneIdle::HandlePhoneEngineMessageL(int, int)
+	??1CPhoneIdle@@UAE@XZ @ 51 NONAME ; CPhoneIdle::~CPhoneIdle(void)
+	??1CPhoneCallSetup@@UAE@XZ @ 52 NONAME ; CPhoneCallSetup::~CPhoneCallSetup(void)
+	?ConstructL@CPhoneIdle@@MAEXXZ @ 53 NONAME ; void CPhoneIdle::ConstructL(void)
+	??0CPhoneAlerting@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 54 NONAME ; CPhoneAlerting::CPhoneAlerting(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?OpenMenuBarL@CPhoneAlerting@@MAEXXZ @ 55 NONAME ; void CPhoneAlerting::OpenMenuBarL(void)
+	?SendGlobalWarningNoteL@CPhoneErrorMessagesHandler@@IAEXH@Z @ 56 NONAME ; void CPhoneErrorMessagesHandler::SendGlobalWarningNoteL(int)
+	?SendGlobalInfoNoteL@CPhoneErrorMessagesHandler@@IAEXH@Z @ 57 NONAME ; void CPhoneErrorMessagesHandler::SendGlobalInfoNoteL(int)
+	?HandleNumberEntryClearedL@CPhoneTwoSingles@@MAEXXZ @ 58 NONAME ; void CPhoneTwoSingles::HandleNumberEntryClearedL(void)
+	?CheckIfShowCallTerminationNote@CPhoneAlerting@@MAEHXZ @ 59 NONAME ; int CPhoneAlerting::CheckIfShowCallTerminationNote(void)
+	?OpenMenuBarL@CPhoneTwoSingles@@MAEXXZ @ 60 NONAME ; void CPhoneTwoSingles::OpenMenuBarL(void)
+	??0CPhoneTwoSingles@@IAE@PAVMPhoneStateMachine@@PAVMPhoneViewCommandHandle@@PAVMPhoneCustomization@@@Z @ 61 NONAME ; CPhoneTwoSingles::CPhoneTwoSingles(class MPhoneStateMachine *, class MPhoneViewCommandHandle *, class MPhoneCustomization *)
+	?CallId@CPhoneSingleCall@@IBEHXZ @ 62 NONAME ; int CPhoneSingleCall::CallId(void) const
+	?HandleConnectedConferenceL@CPhoneTwoSingles@@MAEXH@Z @ 63 NONAME ; void CPhoneTwoSingles::HandleConnectedConferenceL(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/eabi/phoneuistatesu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,258 @@
+EXPORTS
+	_Z30NewPhoneUIStateMachineFactoryLv @ 1 NONAME
+	_ZN10CPhoneIdle10ConstructLEv @ 2 NONAME
+	_ZN10CPhoneIdle12HandleErrorLERK12TPEErrorInfo @ 3 NONAME
+	_ZN10CPhoneIdle25HandlePhoneEngineMessageLEii @ 4 NONAME
+	_ZN10CPhoneIdleC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 5 NONAME
+	_ZN10CPhoneIdleC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 6 NONAME
+	_ZN10CPhoneIdleD0Ev @ 7 NONAME
+	_ZN10CPhoneIdleD1Ev @ 8 NONAME
+	_ZN10CPhoneIdleD2Ev @ 9 NONAME
+	_ZN14CPhoneAlerting10ConstructLEv @ 10 NONAME
+	_ZN14CPhoneAlerting12OpenMenuBarLEv @ 11 NONAME
+	_ZN14CPhoneAlerting14HandleCommandLEi @ 12 NONAME
+	_ZN14CPhoneAlerting16HandleConnectedLEi @ 13 NONAME
+	_ZN14CPhoneAlerting17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 14 NONAME
+	_ZN14CPhoneAlerting20HandleDisconnectingLEi @ 15 NONAME
+	_ZN14CPhoneAlerting25HandlePhoneEngineMessageLEii @ 16 NONAME
+	_ZN14CPhoneAlerting30CheckIfShowCallTerminationNoteEv @ 17 NONAME
+	_ZN14CPhoneAlertingC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 18 NONAME
+	_ZN14CPhoneAlertingC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 19 NONAME
+	_ZN14CPhoneAlertingD0Ev @ 20 NONAME
+	_ZN14CPhoneAlertingD1Ev @ 21 NONAME
+	_ZN14CPhoneAlertingD2Ev @ 22 NONAME
+	_ZN14CPhoneIncoming10ConstructLEv @ 23 NONAME
+	_ZN14CPhoneIncoming12HandleErrorLERK12TPEErrorInfo @ 24 NONAME
+	_ZN14CPhoneIncoming25HandlePhoneEngineMessageLEii @ 25 NONAME
+	_ZN14CPhoneIncomingC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 26 NONAME
+	_ZN14CPhoneIncomingC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 27 NONAME
+	_ZN14CPhoneIncomingD0Ev @ 28 NONAME
+	_ZN14CPhoneIncomingD1Ev @ 29 NONAME
+	_ZN14CPhoneIncomingD2Ev @ 30 NONAME
+	_ZN15CPhoneCallSetup10ConstructLEv @ 31 NONAME
+	_ZN15CPhoneCallSetup17HandleConnectingLEi @ 32 NONAME
+	_ZN15CPhoneCallSetup25HandlePhoneEngineMessageLEii @ 33 NONAME
+	_ZN15CPhoneCallSetupC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 34 NONAME
+	_ZN15CPhoneCallSetupC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 35 NONAME
+	_ZN15CPhoneCallSetupD0Ev @ 36 NONAME
+	_ZN15CPhoneCallSetupD1Ev @ 37 NONAME
+	_ZN15CPhoneCallSetupD2Ev @ 38 NONAME
+	_ZN15CPhoneEmergency20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 39 NONAME
+	_ZN15CPhoneGsmInCall14HandleCommandLEi @ 40 NONAME
+	_ZN15CPhoneGsmInCall19SetDivertIndicationEi @ 41 NONAME
+	_ZN15CPhoneGsmInCall27HandlePhoneForegroundEventLEv @ 42 NONAME
+	_ZN16CPhoneSingleCall10ConstructLEv @ 43 NONAME
+	_ZN16CPhoneSingleCall12OpenMenuBarLEv @ 44 NONAME
+	_ZN16CPhoneSingleCall14HandleCommandLEi @ 45 NONAME
+	_ZN16CPhoneSingleCall17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 46 NONAME
+	_ZN16CPhoneSingleCall25HandlePhoneEngineMessageLEii @ 47 NONAME
+	_ZN16CPhoneSingleCallC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 48 NONAME
+	_ZN16CPhoneSingleCallC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 49 NONAME
+	_ZN16CPhoneSingleCallD0Ev @ 50 NONAME
+	_ZN16CPhoneSingleCallD1Ev @ 51 NONAME
+	_ZN16CPhoneSingleCallD2Ev @ 52 NONAME
+	_ZN16CPhoneTwoSingles10ConstructLEv @ 53 NONAME
+	_ZN16CPhoneTwoSingles12OpenMenuBarLEv @ 54 NONAME
+	_ZN16CPhoneTwoSingles16UpdateInCallCbaLEv @ 55 NONAME
+	_ZN16CPhoneTwoSingles17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 56 NONAME
+	_ZN16CPhoneTwoSingles25HandleNumberEntryClearedLEv @ 57 NONAME
+	_ZN16CPhoneTwoSingles25HandlePhoneEngineMessageLEii @ 58 NONAME
+	_ZN16CPhoneTwoSingles26HandleConnectedConferenceLEi @ 59 NONAME
+	_ZN16CPhoneTwoSinglesC1EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 60 NONAME
+	_ZN16CPhoneTwoSinglesC2EP18MPhoneStateMachineP23MPhoneViewCommandHandleP19MPhoneCustomization @ 61 NONAME
+	_ZN16CPhoneTwoSinglesD0Ev @ 62 NONAME
+	_ZN16CPhoneTwoSinglesD1Ev @ 63 NONAME
+	_ZN16CPhoneTwoSinglesD2Ev @ 64 NONAME
+	_ZN21CPhoneStateMachineGSM18CreatePhoneEngineLER14MEngineMonitor @ 65 NONAME
+	_ZN21CPhoneStateMachineGSM5StateEv @ 66 NONAME
+	_ZN21CPhoneStateMachineGSMC1EP23MPhoneViewCommandHandle @ 67 NONAME
+	_ZN21CPhoneStateMachineGSMC2EP23MPhoneViewCommandHandle @ 68 NONAME
+	_ZN21CPhoneStateMachineGSMD0Ev @ 69 NONAME
+	_ZN21CPhoneStateMachineGSMD1Ev @ 70 NONAME
+	_ZN21CPhoneStateMachineGSMD2Ev @ 71 NONAME
+	_ZN22CPhoneSingleAndWaiting12HandleErrorLERK12TPEErrorInfo @ 72 NONAME
+	_ZN25CPhoneResourceResolverGSM10ConstructLEv @ 73 NONAME
+	_ZN25CPhoneResourceResolverGSMC1Ev @ 74 NONAME
+	_ZN25CPhoneResourceResolverGSMC2Ev @ 75 NONAME
+	_ZN25CPhoneResourceResolverGSMD0Ev @ 76 NONAME
+	_ZN25CPhoneResourceResolverGSMD1Ev @ 77 NONAME
+	_ZN25CPhoneResourceResolverGSMD2Ev @ 78 NONAME
+	_ZN26CPhoneErrorMessagesHandler19SendGlobalInfoNoteLEi @ 79 NONAME
+	_ZN26CPhoneErrorMessagesHandler20SendGlobalErrorNoteLEi @ 80 NONAME
+	_ZN26CPhoneErrorMessagesHandler22SendGlobalWarningNoteLEi @ 81 NONAME
+	_ZN26CPhoneErrorMessagesHandler22ShowErrorSpecificNoteLERK12TPEErrorInfo @ 82 NONAME
+	_ZN26CPhoneErrorMessagesHandlerC1EP23MPhoneViewCommandHandleP18MPhoneStateMachine @ 83 NONAME
+	_ZN26CPhoneErrorMessagesHandlerC2EP23MPhoneViewCommandHandleP18MPhoneStateMachine @ 84 NONAME
+	_ZN26CPhoneErrorMessagesHandlerD0Ev @ 85 NONAME
+	_ZN26CPhoneErrorMessagesHandlerD1Ev @ 86 NONAME
+	_ZN26CPhoneErrorMessagesHandlerD2Ev @ 87 NONAME
+	_ZN26CPhoneTwoSinglesAndWaiting12HandleErrorLERK12TPEErrorInfo @ 88 NONAME
+	_ZNK16CPhoneSingleCall6CallIdEv @ 89 NONAME
+	_ZNK25CPhoneResourceResolverGSM17ResolveResourceIDERKi @ 90 NONAME
+	_ZTI10CPhoneIdle @ 91 NONAME
+	_ZTI13CPhoneStartup @ 92 NONAME
+	_ZTI14CPhoneAlerting @ 93 NONAME
+	_ZTI14CPhoneIncoming @ 94 NONAME
+	_ZTI15CPhoneCallSetup @ 95 NONAME
+	_ZTI15CPhoneEmergency @ 96 NONAME
+	_ZTI15CPhoneGsmInCall @ 97 NONAME
+	_ZTI16CPhoneConference @ 98 NONAME
+	_ZTI16CPhoneSingleCall @ 99 NONAME
+	_ZTI16CPhoneTwoSingles @ 100 NONAME
+	_ZTI21CPhoneStateMachineGSM @ 101 NONAME
+	_ZTI22CPhoneSingleAndWaiting @ 102 NONAME
+	_ZTI23CPhoneSingleAndAlerting @ 103 NONAME
+	_ZTI24CPhoneSingleAndCallSetup @ 104 NONAME
+	_ZTI25CPhoneCallSetupAndWaiting @ 105 NONAME
+	_ZTI25CPhoneConferenceAndSingle @ 106 NONAME
+	_ZTI25CPhoneResourceResolverGSM @ 107 NONAME
+	_ZTI26CPhoneConferenceAndWaiting @ 108 NONAME
+	_ZTI26CPhoneErrorMessagesHandler @ 109 NONAME
+	_ZTI26CPhoneTwoSinglesAndWaiting @ 110 NONAME
+	_ZTI28CPhoneConferenceAndCallSetup @ 111 NONAME
+	_ZTI30CPhoneUIStateMachineFactoryGSM @ 112 NONAME
+	_ZTI31CPhoneGeneralGsmMessagesHandler @ 113 NONAME
+	_ZTI34CPhoneSingleAndCallSetupAndWaiting @ 114 NONAME
+	_ZTI35CPhoneConferenceAndSingleAndWaiting @ 115 NONAME
+	_ZTI38CPhoneConferenceAndWaitingAndCallSetup @ 116 NONAME
+	_ZTV10CPhoneIdle @ 117 NONAME
+	_ZTV13CPhoneStartup @ 118 NONAME
+	_ZTV14CPhoneAlerting @ 119 NONAME
+	_ZTV14CPhoneIncoming @ 120 NONAME
+	_ZTV15CPhoneCallSetup @ 121 NONAME
+	_ZTV15CPhoneEmergency @ 122 NONAME
+	_ZTV15CPhoneGsmInCall @ 123 NONAME
+	_ZTV16CPhoneConference @ 124 NONAME
+	_ZTV16CPhoneSingleCall @ 125 NONAME
+	_ZTV16CPhoneTwoSingles @ 126 NONAME
+	_ZTV21CPhoneStateMachineGSM @ 127 NONAME
+	_ZTV22CPhoneSingleAndWaiting @ 128 NONAME
+	_ZTV23CPhoneSingleAndAlerting @ 129 NONAME
+	_ZTV24CPhoneSingleAndCallSetup @ 130 NONAME
+	_ZTV25CPhoneCallSetupAndWaiting @ 131 NONAME
+	_ZTV25CPhoneConferenceAndSingle @ 132 NONAME
+	_ZTV25CPhoneResourceResolverGSM @ 133 NONAME
+	_ZTV26CPhoneConferenceAndWaiting @ 134 NONAME
+	_ZTV26CPhoneErrorMessagesHandler @ 135 NONAME
+	_ZTV26CPhoneTwoSinglesAndWaiting @ 136 NONAME
+	_ZTV28CPhoneConferenceAndCallSetup @ 137 NONAME
+	_ZTV30CPhoneUIStateMachineFactoryGSM @ 138 NONAME
+	_ZTV31CPhoneGeneralGsmMessagesHandler @ 139 NONAME
+	_ZTV34CPhoneSingleAndCallSetupAndWaiting @ 140 NONAME
+	_ZTV35CPhoneConferenceAndSingleAndWaiting @ 141 NONAME
+	_ZTV38CPhoneConferenceAndWaitingAndCallSetup @ 142 NONAME
+	_ZThn12_N10CPhoneIdleD0Ev @ 143 NONAME
+	_ZThn12_N10CPhoneIdleD1Ev @ 144 NONAME
+	_ZThn12_N14CPhoneAlertingD0Ev @ 145 NONAME
+	_ZThn12_N14CPhoneAlertingD1Ev @ 146 NONAME
+	_ZThn12_N14CPhoneIncomingD0Ev @ 147 NONAME
+	_ZThn12_N14CPhoneIncomingD1Ev @ 148 NONAME
+	_ZThn12_N15CPhoneCallSetupD0Ev @ 149 NONAME
+	_ZThn12_N15CPhoneCallSetupD1Ev @ 150 NONAME
+	_ZThn12_N15CPhoneGsmInCall27HandlePhoneForegroundEventLEv @ 151 NONAME
+	_ZThn12_N16CPhoneSingleCallD0Ev @ 152 NONAME
+	_ZThn12_N16CPhoneSingleCallD1Ev @ 153 NONAME
+	_ZThn12_N16CPhoneTwoSinglesD0Ev @ 154 NONAME
+	_ZThn12_N16CPhoneTwoSinglesD1Ev @ 155 NONAME
+	_ZThn16_N10CPhoneIdleD0Ev @ 156 NONAME
+	_ZThn16_N10CPhoneIdleD1Ev @ 157 NONAME
+	_ZThn16_N14CPhoneAlerting14HandleCommandLEi @ 158 NONAME
+	_ZThn16_N14CPhoneAlertingD0Ev @ 159 NONAME
+	_ZThn16_N14CPhoneAlertingD1Ev @ 160 NONAME
+	_ZThn16_N14CPhoneIncomingD0Ev @ 161 NONAME
+	_ZThn16_N14CPhoneIncomingD1Ev @ 162 NONAME
+	_ZThn16_N15CPhoneCallSetupD0Ev @ 163 NONAME
+	_ZThn16_N15CPhoneCallSetupD1Ev @ 164 NONAME
+	_ZThn16_N15CPhoneGsmInCall14HandleCommandLEi @ 165 NONAME
+	_ZThn16_N16CPhoneSingleCall14HandleCommandLEi @ 166 NONAME
+	_ZThn16_N16CPhoneSingleCallD0Ev @ 167 NONAME
+	_ZThn16_N16CPhoneSingleCallD1Ev @ 168 NONAME
+	_ZThn16_N16CPhoneTwoSinglesD0Ev @ 169 NONAME
+	_ZThn16_N16CPhoneTwoSinglesD1Ev @ 170 NONAME
+	_ZThn20_N10CPhoneIdleD0Ev @ 171 NONAME
+	_ZThn20_N10CPhoneIdleD1Ev @ 172 NONAME
+	_ZThn20_N14CPhoneAlertingD0Ev @ 173 NONAME
+	_ZThn20_N14CPhoneAlertingD1Ev @ 174 NONAME
+	_ZThn20_N14CPhoneIncomingD0Ev @ 175 NONAME
+	_ZThn20_N14CPhoneIncomingD1Ev @ 176 NONAME
+	_ZThn20_N15CPhoneCallSetupD0Ev @ 177 NONAME
+	_ZThn20_N15CPhoneCallSetupD1Ev @ 178 NONAME
+	_ZThn20_N15CPhoneEmergency20HandleRemConCommandLE25TRemConCoreApiOperationId26TRemConCoreApiButtonAction @ 179 NONAME
+	_ZThn20_N16CPhoneSingleCallD0Ev @ 180 NONAME
+	_ZThn20_N16CPhoneSingleCallD1Ev @ 181 NONAME
+	_ZThn20_N16CPhoneTwoSinglesD0Ev @ 182 NONAME
+	_ZThn20_N16CPhoneTwoSinglesD1Ev @ 183 NONAME
+	_ZThn24_N10CPhoneIdleD0Ev @ 184 NONAME
+	_ZThn24_N10CPhoneIdleD1Ev @ 185 NONAME
+	_ZThn24_N14CPhoneAlertingD0Ev @ 186 NONAME
+	_ZThn24_N14CPhoneAlertingD1Ev @ 187 NONAME
+	_ZThn24_N14CPhoneIncomingD0Ev @ 188 NONAME
+	_ZThn24_N14CPhoneIncomingD1Ev @ 189 NONAME
+	_ZThn24_N15CPhoneCallSetupD0Ev @ 190 NONAME
+	_ZThn24_N15CPhoneCallSetupD1Ev @ 191 NONAME
+	_ZThn24_N15CPhoneGsmInCall19SetDivertIndicationEi @ 192 NONAME
+	_ZThn24_N16CPhoneSingleCallD0Ev @ 193 NONAME
+	_ZThn24_N16CPhoneSingleCallD1Ev @ 194 NONAME
+	_ZThn24_N16CPhoneTwoSinglesD0Ev @ 195 NONAME
+	_ZThn24_N16CPhoneTwoSinglesD1Ev @ 196 NONAME
+	_ZThn32_N16CPhoneTwoSingles25HandleNumberEntryClearedLEv @ 197 NONAME
+	_ZThn36_N10CPhoneIdleD0Ev @ 198 NONAME
+	_ZThn36_N10CPhoneIdleD1Ev @ 199 NONAME
+	_ZThn36_N14CPhoneAlertingD0Ev @ 200 NONAME
+	_ZThn36_N14CPhoneAlertingD1Ev @ 201 NONAME
+	_ZThn36_N14CPhoneIncomingD0Ev @ 202 NONAME
+	_ZThn36_N14CPhoneIncomingD1Ev @ 203 NONAME
+	_ZThn36_N15CPhoneCallSetupD0Ev @ 204 NONAME
+	_ZThn36_N15CPhoneCallSetupD1Ev @ 205 NONAME
+	_ZThn36_N16CPhoneSingleCallD0Ev @ 206 NONAME
+	_ZThn36_N16CPhoneSingleCallD1Ev @ 207 NONAME
+	_ZThn36_N16CPhoneTwoSinglesD0Ev @ 208 NONAME
+	_ZThn36_N16CPhoneTwoSinglesD1Ev @ 209 NONAME
+	_ZThn4_N10CPhoneIdle12HandleErrorLERK12TPEErrorInfo @ 210 NONAME
+	_ZThn4_N10CPhoneIdle25HandlePhoneEngineMessageLEii @ 211 NONAME
+	_ZThn4_N10CPhoneIdleD0Ev @ 212 NONAME
+	_ZThn4_N10CPhoneIdleD1Ev @ 213 NONAME
+	_ZThn4_N14CPhoneAlerting25HandlePhoneEngineMessageLEii @ 214 NONAME
+	_ZThn4_N14CPhoneAlertingD0Ev @ 215 NONAME
+	_ZThn4_N14CPhoneAlertingD1Ev @ 216 NONAME
+	_ZThn4_N14CPhoneIncoming12HandleErrorLERK12TPEErrorInfo @ 217 NONAME
+	_ZThn4_N14CPhoneIncoming25HandlePhoneEngineMessageLEii @ 218 NONAME
+	_ZThn4_N14CPhoneIncomingD0Ev @ 219 NONAME
+	_ZThn4_N14CPhoneIncomingD1Ev @ 220 NONAME
+	_ZThn4_N15CPhoneCallSetup25HandlePhoneEngineMessageLEii @ 221 NONAME
+	_ZThn4_N15CPhoneCallSetupD0Ev @ 222 NONAME
+	_ZThn4_N15CPhoneCallSetupD1Ev @ 223 NONAME
+	_ZThn4_N16CPhoneSingleCall25HandlePhoneEngineMessageLEii @ 224 NONAME
+	_ZThn4_N16CPhoneSingleCallD0Ev @ 225 NONAME
+	_ZThn4_N16CPhoneSingleCallD1Ev @ 226 NONAME
+	_ZThn4_N16CPhoneTwoSingles25HandlePhoneEngineMessageLEii @ 227 NONAME
+	_ZThn4_N16CPhoneTwoSinglesD0Ev @ 228 NONAME
+	_ZThn4_N16CPhoneTwoSinglesD1Ev @ 229 NONAME
+	_ZThn4_N21CPhoneStateMachineGSM18CreatePhoneEngineLER14MEngineMonitor @ 230 NONAME
+	_ZThn4_N21CPhoneStateMachineGSM5StateEv @ 231 NONAME
+	_ZThn4_N21CPhoneStateMachineGSMD0Ev @ 232 NONAME
+	_ZThn4_N21CPhoneStateMachineGSMD1Ev @ 233 NONAME
+	_ZThn4_N22CPhoneSingleAndWaiting12HandleErrorLERK12TPEErrorInfo @ 234 NONAME
+	_ZThn4_N25CPhoneResourceResolverGSMD0Ev @ 235 NONAME
+	_ZThn4_N25CPhoneResourceResolverGSMD1Ev @ 236 NONAME
+	_ZThn4_N26CPhoneErrorMessagesHandler22ShowErrorSpecificNoteLERK12TPEErrorInfo @ 237 NONAME
+	_ZThn4_N26CPhoneErrorMessagesHandlerD0Ev @ 238 NONAME
+	_ZThn4_N26CPhoneErrorMessagesHandlerD1Ev @ 239 NONAME
+	_ZThn4_N26CPhoneTwoSinglesAndWaiting12HandleErrorLERK12TPEErrorInfo @ 240 NONAME
+	_ZThn4_NK25CPhoneResourceResolverGSM17ResolveResourceIDERKi @ 241 NONAME
+	_ZThn8_N10CPhoneIdleD0Ev @ 242 NONAME
+	_ZThn8_N10CPhoneIdleD1Ev @ 243 NONAME
+	_ZThn8_N14CPhoneAlerting17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 244 NONAME
+	_ZThn8_N14CPhoneAlertingD0Ev @ 245 NONAME
+	_ZThn8_N14CPhoneAlertingD1Ev @ 246 NONAME
+	_ZThn8_N14CPhoneIncomingD0Ev @ 247 NONAME
+	_ZThn8_N14CPhoneIncomingD1Ev @ 248 NONAME
+	_ZThn8_N15CPhoneCallSetupD0Ev @ 249 NONAME
+	_ZThn8_N15CPhoneCallSetupD1Ev @ 250 NONAME
+	_ZThn8_N16CPhoneSingleCall17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 251 NONAME
+	_ZThn8_N16CPhoneSingleCallD0Ev @ 252 NONAME
+	_ZThn8_N16CPhoneSingleCallD1Ev @ 253 NONAME
+	_ZThn8_N16CPhoneTwoSingles17HandleKeyMessageLEN15MPhoneKeyEvents22TPhoneKeyEventMessagesE8TKeyCode @ 254 NONAME
+	_ZThn8_N16CPhoneTwoSinglesD0Ev @ 255 NONAME
+	_ZThn8_N16CPhoneTwoSinglesD1Ev @ 256 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUIStates bld file
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_EXPORTS
+
+// Stub SIS files:
+../group/phoneuistates_stub.sis                 /epoc32/data/z/system/install/phoneuistates_stub.sis
+
+PRJ_MMPFILES
+phoneuistates.mmp
+
+#endif // RD_PHONE_NG
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/group/phoneuistates.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   This mmp file defines the PhoneUIStates polymorphic interface
+*   DLL module, which contains all the GSM specific implementations 
+*   of variant classes.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+// <-- QT PHONE START --> 
+CAPABILITY CAP_GENERAL_DLL
+//CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+// <-- QT PHONE END --> 
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+
+TARGET          phoneuistates.dll
+TARGETTYPE      dll
+
+UID             0x101F7CAC  0x101F7C9F
+
+//EXPORTUNFROZEN
+SOURCEPATH      ../src
+
+SOURCE          cphonealerting.cpp
+SOURCE          cphonecallsetup.cpp
+SOURCE          cphonecallsetupandwaiting.cpp
+SOURCE          cphoneconference.cpp
+SOURCE          cphoneconferenceandcallsetup.cpp
+SOURCE          cphoneconferenceandsingle.cpp
+SOURCE          cphoneconferenceandsingleandwaiting.cpp
+SOURCE          cphoneconferenceandwaiting.cpp
+SOURCE          cphoneconferenceandwaitingandcallsetup.cpp
+SOURCE          cphoneemergency.cpp
+SOURCE          cphonegeneralgsmmessageshandler.cpp
+SOURCE          cphonegsmincall.cpp
+SOURCE          cphoneidle.cpp
+SOURCE          cphoneincoming.cpp
+SOURCE          cphoneresourceresolvergsm.cpp
+SOURCE          cphoneerrormessageshandler.cpp
+SOURCE          cphonesingleandalerting.cpp
+SOURCE          cphonesingleandcallsetup.cpp
+SOURCE          cphonesingleandcallsetupandwaiting.cpp
+SOURCE          cphonesingleandwaiting.cpp
+SOURCE          cphonesinglecall.cpp
+SOURCE          cphonestartup.cpp
+SOURCE          cphonestatemachinegsm.cpp
+SOURCE          cphonetwosingles.cpp
+SOURCE          cphonetwosinglesandwaiting.cpp
+SOURCE          cphoneuistatemachinefactorygsm.cpp
+
+/* Languages */
+LANG SC
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../phoneuicontrol/inc
+// <-- QT PHONE START --> 
+USERINCLUDE     ../../phoneuiqtviewadapter/inc
+//USERINCLUDE     ../../phoneuiview/inc
+// <-- QT PHONE END --> 
+USERINCLUDE     ../../phoneui/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui2/srcdata
+USERINCLUDE     ../../phonemediatorcenter/inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+LIBRARY         avkon.lib // AknTextUtils
+LIBRARY         bafl.lib
+// <-- QT PHONE START --> 
+LIBRARY         phonestringloader.lib
+//LIBRARY       commonengine.lib //StringLoader 
+// <-- QT PHONE END -->
+LIBRARY         cone.lib
+LIBRARY         engineinfo.lib
+LIBRARY         euser.lib
+LIBRARY         featmgr.lib         // FeatureManager
+LIBRARY         phoneengine.lib
+LIBRARY         phonemediatorcenter.lib
+LIBRARY         phoneuicontrol.lib
+LIBRARY         phoneuiutils.lib
+LIBRARY         sssettings.lib
+LIBRARY         ws32.lib
+
+// RemCon
+LIBRARY         remconcoreapi.lib
+
+// Eikon Environment
+LIBRARY         eikcore.lib
+
+#ifdef __SYNCML_DM
+// Apa server
+LIBRARY         apgrfx.lib
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/group/phoneuistates_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phoneuistates component.
+;
+; Languages
+&EN
+
+; Header
+#{"phoneuistates"}, (0x101F7C9F), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+;
+;  phoneuistates
+;
+"" - "z:\sys\bin\phoneuistates.dll"
Binary file phoneapp/phoneuistates/group/phoneuistates_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonealerting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific alerting state implementation.
+*
+*/
+
+
+#ifndef CPHONEALERTING_H
+#define CPHONEALERTING_H
+
+// INCLUDES
+#include "cphonegsmincall.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  GSM-specific alerting state
+*/
+class CPhoneAlerting : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneAlerting();
+
+        /**
+        * Creates the GSM-specific Single call state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneAlerting
+        */
+        static CPhoneAlerting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );
+
+                  
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneAlerting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+
+        /**
+        * A message handling function for EPEMessageHandleConnected
+        * @param aCallId: the call id of the call
+        */
+        IMPORT_C void HandleConnectedL( TInt aCallId );
+        
+        IMPORT_C virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * Open menu bar
+        */
+        IMPORT_C virtual void OpenMenuBarL();
+        
+       /**
+        * Handles user selected UI commands.
+        * @param aCommand - selected command
+        */
+        IMPORT_C virtual TBool HandleCommandL( TInt aCommand );
+ 
+        /**
+        * Check is alerting call Video call
+        */
+        TBool IsVideoCallAlertingL();
+                
+        /**
+        * From CPhoneState.
+        * Checks if call termination note should be shown.
+        * @return ETrue show call termination note
+        */
+        IMPORT_C virtual TBool CheckIfShowCallTerminationNote();
+        
+        /**
+        * A message handling function for EPEMessageDisconnecting
+        * @param aCallId: the call id of the call
+        */
+        IMPORT_C void HandleDisconnectingL( TInt aCallId );
+        
+    private:
+        
+        /** 
+         * Call identifier for a incoming call. 
+         */
+        TInt iIncomingCallId;
+    };
+
+#endif // CPHONEALERTING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonecallsetup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific Call setup state implementation.
+*
+*/
+
+
+#ifndef CPHONECALLSETUP
+#define CPHONECALLSETUP
+
+// INCLUDES
+#include "cphonestatecallsetup.h"
+
+// CLASS DECLARATION
+/**
+*  GSM-specific Call setup state
+*/
+class CPhoneCallSetup : public CPhoneStateCallSetup
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneCallSetup();
+
+        /**
+        * Creates the Call Setup state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneCallSetup
+        */
+        static CPhoneCallSetup* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+
+          
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneCallSetup( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+
+        /**
+        * Handle EPEMessageConnecting
+        */
+        IMPORT_C virtual void HandleConnectingL( TInt aCallId ); 
+        
+    };
+
+#endif // CPHONECALLSETUP
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonecallsetupandwaiting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Call Setup And Waiting state implementation.
+*
+*/
+
+
+#ifndef CPHONECALLSETUPANDWAITING_H
+#define CPHONECALLSETUPANDWAITING_H
+
+// INCLUDES
+#include "cphonegsmincall.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Call Setup And Waiting state
+*/
+class CPhoneCallSetupAndWaiting : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneCallSetupAndWaiting();
+
+    public: // New functions
+        
+        /**
+        * Creates the Call Setup And Waiting state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneSingleAndAlerting
+        */
+        static CPhoneCallSetupAndWaiting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneCallSetupAndWaiting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+            
+        /**
+        * Open menu bar
+        */
+        virtual void OpenMenuBarL();
+        
+        virtual void UpdateInCallCbaL();
+        
+    private:
+        
+        void HandleIdleL( TInt aCallId );
+        
+        /**
+        * Handles EPEMessageConnected
+        */
+        void HandleConnectedL( TInt aCallId );
+        
+    };
+
+#endif // CPHONECALLSETUPANDWAITING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneconference.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Conference call state implementation.
+*
+*/
+
+
+#ifndef CPHONECONFERENCE_H
+#define CPHONECONFERENCE_H
+
+// INCLUDES
+#include "cphonegsmincall.h"
+#include "tphonecmdparamboolean.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Conference call state implementation.
+*/
+class CPhoneConference : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneConference();
+
+        /**
+        * Creates the Conference Call state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneConference* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );     
+
+        virtual TBool HandleCommandL( TInt aCommand );  
+        
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+            
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneConference( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        virtual void HandleKeyEventL( 
+            const TKeyEvent& aKeyEvent, 
+            TEventCode aEventCode );
+            
+        virtual void HandleNumberEntryClearedL();
+        
+        virtual void OpenMenuBarL();
+
+        virtual void HandleIdleL( TInt aCallId );
+        
+        virtual void MakeStateTransitionToSingleL();
+
+        virtual void HandleIncomingL( TInt aCallId );
+
+        virtual void DisplayIncomingCallL( 
+            TInt aCallId, 
+            const TPhoneCmdParamBoolean aCommandParam );
+        
+        virtual void HandleConferenceIdleL();
+                        
+        virtual void MakeStateTransitionToTwoSinglesL();
+
+        virtual void DisplayCallSetupL( TInt aCallId );
+        
+        virtual TBool IsConferenceBubbleInSelectionMode() const;
+        
+        virtual void UpdateInCallCbaL();
+        
+        void CloseSelectionListL();
+        
+        virtual void SetHoldFlagL();
+        
+        virtual void DefineAndSetHoldFlagL();
+  
+        virtual void HandleCreateNumberEntryL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        void UpdateConferenceSecurityStatusL( TInt aCallId );
+        
+        
+     private:
+              
+        void OpenParticipantsListL();
+     
+        void HandleHeldConferenceL( TInt aCallId );
+         
+        void HandleConnectedConferenceL();
+
+        void ToggleHoldL();
+
+        void OpenDropParticipantSelectionL();
+        
+        void DropSelectedParticipantL();
+        
+        void OpenPrivateSelectionL();
+        
+        void PrivateSelectedParticipantL();
+        
+        void MakeStateTransitionToIdleL();
+        
+        void HandleDiallingL( TInt aCallId );
+              
+        void CallFromNewCallQueryL();
+        
+        void HandleWentOneToOneL( TInt aCallId );
+        
+    };
+
+#endif // CPHONECONFERENCE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneconferenceandcallsetup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Call setup at conference state implementation.
+*
+*/
+
+
+#ifndef CPHONECONFERENCEANDCALLSETUP_H
+#define CPHONECONFERENCEANDCALLSETUP_H
+
+// INCLUDES
+#include "cphoneconference.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Call setup at conference state implementation.
+*/
+class CPhoneConferenceAndCallSetup : public CPhoneConference
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneConferenceAndCallSetup();
+
+    public:
+        
+        /**
+        * Creates the Conference And Call Setup state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneConferenceAndCallSetup* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );
+        
+        virtual TBool HandleCommandL( TInt aCommand );  
+        
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );       
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneConferenceAndCallSetup( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        virtual void OpenMenuBarL();
+        
+        virtual void UpdateInCallCbaL();
+        
+        
+     private:
+     
+        /**
+        * Handle EPEMessageConnecting
+        */
+        void HandleConnectingL( TInt aCallId );
+        
+        /**
+        * Handle EPEMessageConnected
+        */
+        void HandleConnectedL( TInt aCallId );
+        
+        /**
+        * A message handling function for EPEMessageIdle
+        * @param aCallId: the call id of the call
+        */
+        void HandleIdleL( TInt aCallId );
+        
+        /**
+        * Handle EPEMessageConferenceIdle
+        */
+        void HandleConferenceIdleL();
+       
+     private:
+         
+         /**
+         * Status of ConferenceAndCallSetup alerting
+         */
+         TBool iAlerting;
+        
+    };
+
+#endif // CPHONECONFERENCEANDCALLSETUP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneconferenceandsingle.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Conference and single call state implementation.
+*
+*/
+
+
+#ifndef CPHONECONFERENCEANDSINGLE_H
+#define CPHONECONFERENCEANDSINGLE_H
+
+// INCLUDES
+#include "cphoneconference.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Conference and single call state implementation.
+*/
+class CPhoneConferenceAndSingle : public CPhoneConference
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneConferenceAndSingle();
+
+        /**
+        * Creates the Conference And Single state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneConferenceAndSingle* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId ); 
+            
+        virtual TBool HandleCommandL( TInt aCommand );        
+
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneConferenceAndSingle( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        virtual void OpenMenuBarL();
+        
+        virtual void UpdateInCallCbaL();
+        
+        virtual void HandleIncomingL( TInt aCallId );
+        
+        virtual void HandleIdleL( TInt aCallId );
+        
+        virtual void HandleConferenceIdleL();
+        
+        
+     private:
+     
+         void HandleConnectedConferenceL();
+         
+         void HandleHeldConferenceL();
+         
+         void HandleConnectedL( TInt aCallId );
+         
+         void HandleHeldL( TInt aCallId );
+         
+         void JoinToConferenceL();
+         
+         void HandleAddedConferenceMemberL( TInt aCallId );
+         
+         void HandleSendL();
+         
+    };
+
+#endif // CPHONECONFERENCEANDSINGLE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneconferenceandsingleandwaiting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Conference and single and waiting call state implementation.
+*
+*/
+
+
+#ifndef CPHONECONFERENCEANDSINGLEANDWAITING_H
+#define CPHONECONFERENCEANDSINGLEANDWAITING_H
+
+// INCLUDES
+#include "cphoneconferenceandsingle.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Conference and single and waiting call state implementation.
+*/
+class CPhoneConferenceAndSingleAndWaiting : public CPhoneConferenceAndSingle
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneConferenceAndSingleAndWaiting();
+
+        /**
+        * Creates the Conference And Single And Waiting state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneConferenceAndSingleAndWaiting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+            
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );      
+
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        virtual void HandleKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneConferenceAndSingleAndWaiting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        virtual void OpenMenuBarL();
+        
+        virtual void HandleIdleL( TInt aCallId );
+        
+        virtual void HandleConferenceIdleL();
+        
+        virtual void HandleAddedConferenceMemberL( TInt aCallId );
+        
+        virtual void UpdateInCallCbaL();
+        
+        
+     private:
+     
+        void MakeStateTransitionToConferenceAndWaitingL( TInt aCallId );
+
+        void MakeStateTransitionToConferenceAndSingleL( TInt aCallId );
+        
+        void MakeTransitionAccordingToActiveCallsL();
+    };
+
+#endif // CPHONECONFERENCEANDSINGLEANDWAITING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneconferenceandwaiting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Conference and waiting call state implementation.
+*
+*/
+
+
+#ifndef CPHONECONFERENCEANDWAITING_H
+#define CPHONECONFERENCEANDWAITING_H
+
+// INCLUDES
+#include "cphoneconference.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Conference and waiting call state implementation.
+*/
+class CPhoneConferenceAndWaiting : public CPhoneConference
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneConferenceAndWaiting();
+
+        /**
+        * Creates the Conference And Waiting state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneConferenceAndWaiting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );   
+        
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+            
+        virtual void HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+
+        /**
+        * Handles user selected UI commands.
+        * @param aCommand - selected command
+        */    
+        TBool HandleCommandL( TInt aCommand );
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneConferenceAndWaiting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        virtual void OpenMenuBarL();
+        
+        virtual void UpdateInCallCbaL();
+        
+        
+     private:
+     
+         void HandleConnectedL( TInt aCallId );
+         
+         void HandleIdleL( TInt aCallId );
+         
+         void HandleConferenceIdleL();
+                  
+         void MakeStateTransitionToConferenceAndSingleL( TInt aCallId );
+         
+         void HandleDiallingL( TInt aCallId );
+         
+         void HandleWentOneToOneL( TInt aCallId );
+         
+         /**
+          *  Handles received EPhoneCmdUpdateUiControls command.
+          */
+         void UpdateUiControlsL();
+      
+     private:
+        TInt iRingingCallId;
+         
+    };
+
+#endif // CPHONECONFERENCEANDWAITING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneconferenceandwaitingandcallsetup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Conference and waiting and call setup state implementation.
+*
+*/
+
+
+#ifndef CPHONECONFERENCEANDWAITINGANDCALLSETUP_H
+#define CPHONECONFERENCEANDWAITINGANDCALLSETUP_H
+
+// INCLUDES
+#include "cphoneconference.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Conference and waiting and call setup state implementation.
+*/
+class CPhoneConferenceAndWaitingAndCallSetup : public CPhoneConference
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneConferenceAndWaitingAndCallSetup();
+
+        /**
+        * Creates the Conference And Waiting And Call Setup state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneConferenceAndWaitingAndCallSetup* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );   
+        
+        virtual TBool HandleCommandL( TInt aCommand );  
+        
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+     
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneConferenceAndWaitingAndCallSetup( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        virtual void OpenMenuBarL();        
+
+        virtual void UpdateInCallCbaL();
+        
+        virtual void HandleConferenceIdleL();
+        
+        virtual void HandleIdleL( TInt aCallId );
+        
+        
+     private:
+
+        void HandleConnectingL( TInt aCallId );
+        
+        void HandleConnectedL( TInt aCallId );
+        
+        void UpdateConnectingCbaL();
+        
+     private:
+         
+         /**
+         * Status of ConferenceAndWaitingAndCallSetup alerting
+         */
+         TBool iAlerting;
+        
+    };
+
+#endif // CPHONECONFERENCEANDWAITINGANDCALLSETUP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneemergency.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific emergency state implementation.
+*
+*/
+
+
+#ifndef CPHONEEMERGENCY
+#define CPHONEEMERGENCY
+
+// INCLUDES
+#include "cphonegsmincall.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  GSM-specific emergency single call state
+*/
+class CPhoneEmergency : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneEmergency();
+        
+        /**
+        * Creates the Emergency state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneEmergency
+        */
+        static CPhoneEmergency* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );    
+                        
+        /** 
+        * Set startup status for state transition
+        * @param aStartupInterrupted status
+        */ 
+        void SetStartupInterrupted( const TBool aStartupInterrupted );
+        
+    protected:
+
+        /**
+        * See CPhoneState
+        */
+        void HandleIdleL( TInt aCallId );
+
+        /**
+        * See CPhoneState
+        */
+        void HandleConnectedL( TInt aCallId );
+        
+        /**
+        * See CPhoneState
+        */
+        void HandleConnectingL( TInt aCallId );
+        
+        /**
+        * See CPhoneState
+        */
+        void HandleDialingL( TInt aCallId );
+
+        /** 
+        * Handle state-specific behaviour when number entry is cleared
+        */ 
+        virtual void HandleNumberEntryClearedL();
+        
+        /** 
+        * Handle state-specific behaviour handleErrorL
+        */ 
+        void HandleErrorL( const TPEErrorInfo& aErrorInfo );
+
+        /**
+        * Open menu bar
+        */
+        void OpenMenuBarL();
+        
+        virtual void UpdateInCallCbaL();
+        
+        TBool HandleCommandL( TInt aCommand );
+        
+        void DisconnectEmergencyCallL();
+        
+        void HandleKeyMessageL( 
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneEmergency( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+            
+        void HandleKeyEventL( 
+            const TKeyEvent& aKeyEvent, 
+            TEventCode aEventCode );
+            
+        /**
+        * Sends key events to the phone engine
+        * @param aKeyEvent a key event
+        * @param aEventCode key event code
+        */
+        void SendKeyEventL(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        /**
+        * Handle EPEMessageAudioOutputChanged
+        */
+        void HandleAudioOutputChangedL();
+        
+        /**
+        * Handle initializing cba's
+        */
+        void UpdateSetupCbaL();
+        
+        /**
+        * Passes create number entry command forward if not call setup
+        */
+        void HandleCreateNumberEntryL( 
+                const TKeyEvent& aKeyEvent,
+                TEventCode aEventCode );
+       
+        /**
+        * Handles commands from the Remote Control framework.
+        * @param aOperationId The operation ID of the command.
+        * @param aButtonAct The button action associated with the command.
+        * @return ETrue if the event was handled, EFalse otherwise.
+        */
+        IMPORT_C virtual TBool HandleRemConCommandL( 
+                    TRemConCoreApiOperationId aOperationId, 
+                    TRemConCoreApiButtonAction aButtonAct );
+        
+    private:
+        
+        /**
+        * Check whether UseEmergencyNoIhfCBA set should be used or not. 
+        * @param aAudioOutput current audio output type.
+        * @return ETrue if UseEmergencyNoIhfCBA should be used,
+        * EFalse otherwise.
+        */
+        TBool UseEmergencyNoIhfCBA( const TPEAudioOutput& aAudioOutput ) const;
+        
+        /**
+        * Check whether UseHandsetEmergencyCBA set should be used or not.
+        * @param aAudioOutput current audio output type.
+        * @return ETrue if UseHandsetEmergencyCBA should be used,
+        * EFalse otherwise.
+        */
+        TBool UseHandsetEmergencyCBA( const TPEAudioOutput& aAudioOutput ) const;
+        
+        /**
+        * Check whether the touch call handling is supported or not.
+        * @return ETrue if KFeatureIdTouchCallHandling is supported,
+        * EFalse otherwise.
+        */
+        TBool TouchCallHandlingSupported () const;
+         
+    private:
+        /**
+        * Is device lock on/off
+        */
+        TBool iDeviceLockOn;
+        
+        /**
+        * If true update emergency call wait note
+        */
+        TBool iCallSetup;
+
+        /**
+        * Status of startup
+        */
+        TBool iStartupInterrupted;
+        
+        /**
+        * If true show call summary ( termination ) note 
+        */
+        TBool iConnected;
+    };
+
+#endif // CPHONEEMERGENCY
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneerrormessageshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       Class that does processing for Phone Engine messages that are common
+*       for all GSM states. Most of the GSM states are intressed of these 
+*       messages but due to the class architecture they don't have any single
+*       state class to be put into. This class exists to minimize duplicate
+*       code so that not every GSM class need to implement these same handlings
+*       for the same messages.
+*
+*/
+
+
+#ifndef __CPHONEERRORMESSAGESHANDLER_H
+#define __CPHONEERRORMESSAGESHANDLER_H
+
+// INCLUDES
+#include <w32std.h>
+#include "mphoneerrormessageshandler.h"
+
+// FORWARD DECLARATIONS
+class MPhoneErrorMessagesHandlerRegister;
+class MPhoneViewCommandHandle;
+class MPhoneStateMachine;
+
+// CLASS DECLARATION
+
+/**
+* Class that does processing for Phone Engine error messages that are common
+* for all protocols.
+*
+*/
+class CPhoneErrorMessagesHandler : public CBase, 
+                                   public MPhoneErrorMessagesHandler
+    {
+    public:
+        /**
+        * Creates the error handler instance
+        * @return an instance of class CPhoneErrorMessagesHandler
+        */
+        static CPhoneErrorMessagesHandler* NewL( 
+                MPhoneViewCommandHandle* aViewCommandHandle,
+                MPhoneStateMachine* aStateMachine ); 
+    
+    public: //From MPhoneErrorMessagesHandler
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneErrorMessagesHandler();
+
+        /**
+        * Shows error specific notes, ie. error, warning and info notes
+        * related to the given error.
+        * @param aErrorInfo - Error info from Phone Engine
+        */
+        IMPORT_C void ShowErrorSpecificNoteL( const TPEErrorInfo& aErrorInfo );
+        
+    protected:      
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneErrorMessagesHandler( 
+                    MPhoneViewCommandHandle* aViewCommandHandle,
+                    MPhoneStateMachine* aStateMachine );
+                
+        /**
+        * Two phase construction - Second phase.
+        * @return None
+        */
+        void ConstructL();
+    
+        /**
+        * Show global InfoNote
+        * @param aResourceId resource id to be resolved
+        */
+        IMPORT_C void SendGlobalInfoNoteL( TInt aResourceId );
+ 
+        /**
+        * Show global ErrorNote
+        * @param aResourceId resource id to be resolved
+        */
+        IMPORT_C void SendGlobalErrorNoteL( TInt aResourceId );
+
+        /**
+        * Show global WarningNote
+        * @param aResourceId resource id to be resolved
+        */        
+        IMPORT_C void SendGlobalWarningNoteL( TInt aResourceId );
+        
+
+    private:        
+        /**
+        * Return SimState.
+        */
+        TPESimState SimState() const;
+        
+        /**
+        * Return ETrue if video call.
+        */
+        TBool IsVideoCall( const TInt aCallId ) const;
+ 
+    protected:
+        
+        /**
+        * Handle for sending view commands.
+        */
+        MPhoneViewCommandHandle* iViewCommandHandle;
+        
+        MPhoneStateMachine* iStateMachine;
+              
+    };
+
+#endif // __CPHONEERRORMESSAGESHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonegeneralgsmmessageshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       Class that does processing for Phone Engine messages that are common
+*       for all GSM states. Most of the GSM states are intressed of these 
+*       messages but due to the class architecture they don't have any single
+*       state class to be put into. This class exists to minimize duplicate
+*       code so that not every GSM class need to implement these same handlings
+*       for the same messages.
+*
+*/
+
+
+#ifndef CPHONEGENERALGSMMESSAGESHANDLER_H
+#define CPHONEGENERALGSMMESSAGESHANDLER_H
+
+// INCLUDES
+#include <w32std.h>
+
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+class MPhoneState;
+
+// CLASS DECLARATION
+
+/**
+* Class that does processing for Phone Engine messages that are common
+* for all GSM states. Most of the GSM states are intressed of these 
+* messages but due to the class architecture they don't have any single
+* state class to be put into. This class exists to minimize duplicate
+* code so that not every GSM class need to implement these same handlings
+* for the same messages.
+*
+*/
+class CPhoneGeneralGsmMessagesHandler : public CBase
+    {
+    public:
+
+        /**
+        * Creates the General GSM Messages Handler instance
+        * @param aPhoneState: active state
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneGeneralGsmMessagesHandler
+        */
+        static CPhoneGeneralGsmMessagesHandler* NewL( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneState& aActiveState );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneGeneralGsmMessagesHandler();
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );  
+         
+
+    private:
+        
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneGeneralGsmMessagesHandler( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneState& aActiveState );
+
+
+    private:
+    
+        /**
+        * Show global InfoNote
+        * @param aResourceId resource id to be resolved
+        */
+        void SendGlobalInfoNoteL( TInt aResourceId );
+        
+        /**
+        * Shows divert indication or sets internal divert flag
+        * depending in which order we receive Incoming and 
+        * CallForwarded messages.
+        */
+        void HandleIncomingCallForwardedL();
+
+        /**
+        * Shows software version note
+        */
+        void HandleShowVersionL();
+        
+        /**
+        * Show global ErrorNote
+        * @param aResourceId resource id to be resolved
+        */
+        void SendGlobalErrorNoteL( TInt aResourceId );
+
+
+    private:
+
+        /**
+        * Currently active state.
+        */    
+        MPhoneStateMachine& iStateMachine;
+        
+        /**
+        * Handle for sending view commands.
+        */
+        MPhoneViewCommandHandle& iViewCommandHandle;
+        
+        /**
+        * Currently active state object.
+        */
+        MPhoneState& iActiveState; 
+           
+    };
+
+#endif // CPHONEGENERALGSMMESSAGESHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonegsmincall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GSM-specific in-call handling.
+*
+*/
+
+
+#ifndef CPHONEGSMINCALL_H
+#define CPHONEGSMINCALL_H
+
+// INCLUDES
+#include "cphonestateincall.h"
+#include "tphonecmdparamboolean.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  GSM-specific in-call handling.
+*/
+class CPhoneGsmInCall : public CPhoneStateInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneGsmInCall();
+        
+        /**
+        * Creates the GSM in-call state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneEmergency
+        */
+        static CPhoneGsmInCall* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );
+
+    protected:  
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneGsmInCall( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * Handles commands.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        *          (ETrue) or not (EFalse)
+        */    
+        IMPORT_C TBool HandleCommandL( TInt aCommand );    
+
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        /**
+        * Show Colp note if necessary
+        */
+        void HandleColpNoteL( TInt aCallId );
+        
+        /**
+        * Bring call handling to foreground when moved to incoming state
+        **/        
+        void BringIncomingToForegroundL();
+       
+        /**
+        * Get allow waiting call header value.
+        */
+        void AllowShowingOfWaitingCallHeaderL( 
+            TPhoneCmdParamBoolean& aCommandParam );
+        
+        /**
+        * Indicates when the Phone app is in the foreground.
+        */    
+        IMPORT_C void HandlePhoneForegroundEventL();
+        
+        /**
+        * Show hold/connected note 
+        */
+        void HandleHoldNoteL( TInt aCallId, TBool aHold );
+        
+        
+        /**
+        * Setter for divert indication showing in bubble.
+        * @param aDivertIndication ETrue to show divert indication,
+        *        EFalse to not. Usually setting EFalse isn't necessary
+        *        as it's a default value in bubble creation.
+        */
+        IMPORT_C void SetDivertIndication(
+            const TBool aDivertIndication );
+        
+    private:
+    
+        void ReplaceCallL();
+        /**
+        * Handles divert indication 
+        */
+        void HandeDivertIndicationL();
+    };
+
+#endif // CPHONEGSMINCALL_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneidle.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific idle state implementation.
+*
+*/
+
+
+#ifndef CPHONEIDLE_H
+#define CPHONEIDLE_H
+
+// INCLUDES
+#include "cphonestateidle.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  GSM-specific idle state implementation.
+*/
+class CPhoneIdle : public CPhoneStateIdle
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneIdle();
+        
+        /**
+        * Creates the Idle state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneEmergency
+        */
+        static CPhoneIdle* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );    
+                        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneIdle( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+                    
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+        
+        /**
+        * HandleError
+        * Implements error handling framework
+        * @param aErrorInfo: the error info
+        */
+        IMPORT_C virtual void HandleErrorL( 
+            const TPEErrorInfo& aErrorInfo );    
+        
+    };
+
+#endif // CPHONEIDLE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneincoming.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific incoming state implementation.
+*
+*/
+
+
+#ifndef CPHONEINCOMING_H
+#define CPHONEINCOMING_H
+
+// INCLUDES
+#include "cphonestateincoming.h"
+
+// FORWARD DECLARATIONS
+class CPhoneState;
+class TPhoneCmdParamBoolean;
+
+// CLASS DECLARATION
+/**
+*  GSM-specific incoming state implementation.
+*/
+class CPhoneIncoming : public CPhoneStateIncoming
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneIncoming();
+        
+        /**
+        * Creates the Incoming state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneEmergency
+        */
+        static CPhoneIncoming* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );    
+
+        /**
+        * HandleError
+        * Implements error handling framework
+        * @param aErrorInfo: the error info
+        */
+        IMPORT_C virtual void HandleErrorL( 
+            const TPEErrorInfo& aErrorInfo ); 
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneIncoming( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+                    
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+        
+        /**
+        * Handles long hash key
+        */
+        virtual void HandleLongHashL();
+
+    private:
+        
+        /**
+        * A message handling function for EPEMessageIncoming
+        * @param aCallId: the call id of the call
+        */
+        void HandleIncomingL( TInt aCallId );
+        
+        /**
+        * Display Incoming Call
+        * @param aCallid call id
+        * @param aCommandParam
+        */
+        void DisplayIncomingCallL( 
+            TInt aCallId, 
+            const TPhoneCmdParamBoolean aCommandParam );
+        
+        /**
+        * Get allow waiting call header value.
+        * @param aCommandParam
+        */
+        void AllowShowingOfWaitingCallHeaderL( 
+            TPhoneCmdParamBoolean& aCommandParam );
+    private:
+        
+        // call id of new waiting call
+        TInt iWaitingCallId;
+    };
+
+#endif // CPHONEINCOMING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneresourceresolvergsm.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Concrete resource resolver for GSM specific PhoneUi resources.
+*
+*/
+
+
+#ifndef __CPHONERESOURCERESOLVERGSM_H
+#define __CPHONERESOURCERESOLVERGSM_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "cphoneresourceresolverbase.h"
+
+
+// FORWARD DECLARATIONS
+class MPhoneResourceResolverRegister;
+class CEikonEnv;
+
+// CLASS DECLARATION
+/**
+*  Concrete resource resolver for GSM spesific phoneapp resources.
+*/
+class CPhoneResourceResolverGSM : public CPhoneResourceResolverBase
+
+    {
+    public: // Constructors and destructor
+        /**
+        * Virtual Destructor
+        * @param None
+        * @return None
+        */
+        IMPORT_C virtual ~CPhoneResourceResolverGSM();
+
+        /**
+        * NewL function for creating the resolver.
+        * @param aMainResourceResolver: Pointer to the main resolver.
+        * @return CPhoneResourceResolver*
+        */
+        static CPhoneResourceResolverGSM* NewL();
+    
+    public: // From MPhoneResourceResolver
+        /**
+        * Resolve resource id of given resource.
+        * @param aEnumUid: Uid of enumeration which contains needed 
+        *                  resource definition.
+        * @param aResource: ID of needed resource ( from enumeration ).
+        * @return Resource id.
+        */
+        IMPORT_C TInt ResolveResourceID( const TInt& aResource ) const;       
+
+    protected:    // Constructors and destructor        
+        /**
+        * Protected constructor.
+        * @param None
+        * @return None
+        */
+        IMPORT_C CPhoneResourceResolverGSM();
+        
+        /**
+        * Two phase construction - Second phase.
+        * @param aMainResourceResolver: Pointer to the main resolver.
+        * @return None
+        */
+        IMPORT_C void ConstructL();
+        
+    protected: // Data
+
+        CEikonEnv& iEnv;
+    };
+
+#endif      // CPHONERESOURCERESOLVERGSM_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonesingleandalerting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific Single and Alerting state implementation.
+*
+*/
+
+
+#ifndef CPHONESINGLEANDALERTING_H
+#define CPHONESINGLEANDALERTING_H
+
+// INCLUDES
+#include "cphonealerting.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  GSM-specific Single and Alerting state
+*/
+class CPhoneSingleAndAlerting : public CPhoneAlerting
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneSingleAndAlerting();
+
+        /**
+        * Creates the GSM-specific Single call state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneSingleAndAlerting
+        */
+        static CPhoneSingleAndAlerting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+        
+        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneSingleAndAlerting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+            
+        /**
+        * A message handling function for EPEMessageHandleConnected
+        * @param aCallId: the call id of the call
+        */
+        void HandleConnectedL( TInt aCallId );
+        
+        /**
+        * Handle EPEMessageIdle
+        */
+        void HandleIdleL( TInt aCallId );
+        
+        /**
+        * Open menu bar
+        */
+        virtual void OpenMenuBarL();
+        /**
+        * Update InCallCba 
+        */
+        virtual void UpdateInCallCbaL();
+        
+    };
+
+#endif // CPhoneSingleAndAlerting_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonesingleandcallsetup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Call setup at single state implementation.
+*
+*/
+
+
+#ifndef CPHONESINGLEANDCALLSETUP_H
+#define CPHONESINGLEANDCALLSETUP_H
+
+// INCLUDES
+#include "cphonecallsetup.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Call setup at single state implementation.
+*/
+class CPhoneSingleAndCallSetup : public CPhoneCallSetup
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneSingleAndCallSetup();
+
+    public:
+        
+        /**
+        * Creates the Call Setup In Single state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneSingleAndCallSetup* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );
+            
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );       
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneSingleAndCallSetup( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+     private:
+          
+        /**
+        * Handle EPEMessageConnecting
+        */
+        void HandleConnectingL( TInt aCallId );
+        
+        /**
+        * Handle EPEMessageConnected
+        */
+        void HandleConnectedL( TInt aCallId );
+        
+        /**
+        * A message handling function for EPEMessageIdle
+        * @param aCallId: the call id of the call
+        */
+        void HandleIdleL( TInt aCallId );
+        
+        TBool HandleCommandL( TInt aCommand );
+        
+    };
+
+#endif // CPHONESINGLEANDCALLSETUP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonesingleandcallsetupandwaiting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Active single call with call setup and waiting calls state implementation
+*
+*/
+
+
+#ifndef CPHONESINGLEANDCALLSETUPANDWAITING_H
+#define CPHONESINGLEANDCALLSETUPANDWAITING_H
+
+// INCLUDES
+#include "cphonegsmincall.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Active single call with call setup and waiting calls state implementation.
+*/
+class CPhoneSingleAndCallSetupAndWaiting : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneSingleAndCallSetupAndWaiting();
+
+        /**
+        * Creates the Single And Call Setup And Waiting state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneSingleAndCallSetupAndWaiting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );     
+            
+        TBool HandleCommandL( TInt aCommand );  
+
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+            
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneSingleAndCallSetupAndWaiting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        /**
+        * Open menu bar
+        */
+        virtual void OpenMenuBarL();
+        
+        virtual void UpdateInCallCbaL();
+            
+     private:
+     
+        /**
+        * Handles EPEMessageIdle
+        */
+        void HandleIdleL( TInt aCallId );
+
+        /**
+        * Handles EPEMessageConnecting
+        */
+        void HandleConnectingL( TInt aCallId );
+                
+        /**
+        * Handles EPEMessageConnected
+        */
+        void HandleConnectedL( TInt aCallId );
+
+        /**
+        * State transition to state Call Setup and Waiting  
+        */        
+        void StateChangeToCallSetupAndWaitingL( TInt aCallId );
+
+        /**
+        * State transition to state Single and Waiting
+        */        
+        void StateChangeToSingleAndWaitingL( TInt aCallId );
+
+        /**
+        * State transition to state Single and Alerting
+        */        
+        void StateChangeToSingleAndAlertingL( TInt aCallId );
+
+        /**
+        * State transition to state Two Singles. 
+        */        
+        void StateChangeToTwoSinglesL( TInt aCallId );
+        
+        /**
+        * State transition to state Two Singles and Waiting   
+        */        
+        void StateChangeToTwoSinglesAndWaitingL( TInt aCallId ); 
+        
+        void HandleAudioMuteChangedL();
+        
+      private:
+      
+        /**
+        * Status of SingleAndCallSetupAndWaiting alerting
+        */
+        TBool iAlerting;
+        
+        /**
+        * Waiting call id
+        */
+        TInt iWaitingCallId; 
+
+    };
+
+#endif // CPHONESINGLEANDCALLSETUPANDWAITING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonesingleandwaiting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Single And Waiting state implementation.
+*
+*/
+
+
+#ifndef CPHONESINGLEANDWAITING_H
+#define CPHONESINGLEANDWAITING_H
+
+// INCLUDES
+#include "cphonegsmincall.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Incoming call at single state implementation.
+*/
+class CPhoneSingleAndWaiting : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneSingleAndWaiting();
+        
+        /**
+        * Creates the Single And Waiting state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneSingleAndWaiting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );     
+        
+        /**
+        * Handles user selected UI commands.
+        * @param aCommand - selected command
+        */    
+        TBool HandleCommandL( TInt aCommand );  
+            
+    protected:
+
+        /**
+        * By default constructor is private.
+        */
+        CPhoneSingleAndWaiting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+            
+        /**
+        * HandleError
+        * Implements error handling framework
+        * @param aErrorInfo: the error info
+        */
+        IMPORT_C virtual void HandleErrorL( 
+            const TPEErrorInfo& aErrorInfo );    
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+        /**
+        * Handles key messages.
+        * @param aMessage - key event message
+        * @param aScanCode - standard Symbian scan code
+        */
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        virtual void HandleKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+        
+        /**
+        * Opens menu bar.
+        */    
+        virtual void OpenMenuBarL();
+        
+        /**
+        * Sets correct in call CBAs.
+        */
+        virtual void UpdateInCallCbaL();
+        
+            
+     private:
+     
+        /**
+        * Unholds the call.
+        * @param aCallId - call id to unhold
+        */
+        void HandleUnholdL( TInt aCallId );
+     
+        /**
+        * Performs a state transition to Two Singles.
+        * @param aCallId - call id that got connected
+        */
+        void MakeStateTransitionToTwoSinglesL( TInt aCallId );
+        
+        /**
+        * Handles received idle message from Phone Engine.
+        * @param aCallId - call id that received the event
+        */
+        void HandleIdleL( TInt aCallId );
+        
+        /**
+        * Handles received held message from Phone Engine.
+        * @param aCallId - call id that received the event
+        */ 
+        void HandleHeldL( TInt aCallId );
+        
+        /**
+        * Handles received connected message from Phone Engine.
+        * @param aCallId - call id that received the event
+        */ 
+        void HandleConnectedL( TInt aCallId );
+        
+        /**
+        * Fetches phone number from new call quoery and dials that number.
+        */ 
+        void CallFromNewCallQueryL();
+        
+        /**
+        * Handles received dialing message from Phone Engine.
+        * @param aCallId - call id that received the event
+        */ 
+        void HandleDiallingL( TInt aCallId );
+        
+        /**
+        * Sets up all call setup to display.
+        * @param aCallId - call id to set up
+        */ 
+        void DisplayCallSetupL( TInt aCallId );
+        
+        /**
+        *  Handles received EPEMessageDisconnecting message from Phone Engine.
+        * @param aCallId: the call id of the call
+        */
+        void HandleDisconnectingL( TInt aCallId );
+
+        /**
+        *  Handles received EPhoneCmdUpdateUiControls command.
+        */
+        void UpdateUiControlsL();
+        
+    private: //Data
+            
+        // Store single call id
+        TInt iSingleCallId;
+                           
+    };
+
+#endif // CPHONESINGLEANDWAITING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonesinglecall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific single call state implementation.
+*
+*/
+
+
+#ifndef CPHONESINGLECALL_H
+#define CPHONESINGLECALL_H
+
+// INCLUDES
+#include "cphonegsmincall.h"
+#include "tphonecmdparamboolean.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  GSM-specific single call state
+*/
+class CPhoneSingleCall : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneSingleCall();
+        
+        /**
+        * Creates the GSM-specific Single call state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneSingleCall
+        */
+        static CPhoneSingleCall* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        IMPORT_C virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+            
+        IMPORT_C virtual TBool HandleCommandL( TInt aCommand );
+
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneSingleCall( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+
+        /**
+        * Open menu bar
+        */
+        IMPORT_C virtual void OpenMenuBarL();
+
+        /**
+        * Returns call identifier of the call this state is associated with.
+        * @return   Call identifier.
+        */
+        IMPORT_C TInt CallId() const;
+    private:
+    
+        void OpenVideoCallMenuBarL();
+    
+        void HandleHeldL( TInt aCallId );
+        
+        void HandleConnectedL( TInt aCallId );
+        
+        void ToggleHoldL();
+        
+        void HandleIncomingL( TInt aCallId );
+        
+        void DisplayIncomingCallL( 
+            TInt aCallId, 
+            const TPhoneCmdParamBoolean aCommandParam );
+
+        void CallFromNewCallQueryL();
+        
+        void HandleDiallingL( TInt aCallId );
+                
+        void DisplayCallSetupL( TInt aCallId );
+        
+        void SetCallResumeL();
+        
+        void SetCallHoldL();
+        
+        void SwitchToVideoL();
+        
+        void SwitchToVoiceL();
+    
+    private:
+    
+        // Call id information.
+        TInt iCallId;
+        
+        // Status of query
+        TBool iSwitchToVideoQuery;
+        
+    };
+
+#endif // CPHONESINGLECALL_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonestartup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     GSM-specific start up state implementation.
+*
+*/
+
+
+#ifndef CPHONESTARTUP_H
+#define CPHONESTARTUP_H
+
+// INCLUDES
+#include "cphonestatestartup.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  GSM-specific start up state implementation.
+*/
+class CPhoneStartup : public CPhoneStateStartup
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStartup();
+        
+        /**
+        * Creates the Start up state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @param aPEReady: true if Phone Engine already started
+        * @return an instance of class CPhoneEmergency
+        */
+        static CPhoneStartup* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            TBool aPEReady );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );    
+                        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneStartup( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            TBool aPEReady );
+                    
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+    };
+
+#endif // CPHONESTARTUP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonestatemachinegsm.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       The class implements a GSM-specific state machine
+*
+*/
+
+
+#ifndef CPHONESTATEMACHINEGSM_H
+#define CPHONESTATEMACHINEGSM_H
+
+//  INCLUDES
+#include "cphonestatemachine.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class MPhoneCustomization;
+
+/**
+*  The class implements a GSM-specific state machine
+*/
+
+class CPhoneStateMachineGSM : public CPhoneStateMachine
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneStateMachineGSM();
+
+    public: // New functions
+        
+        /**
+        * Creates the only instance of state machine class
+        * @param aViewCommandHandle: a handle to the Phone UI view
+        * @return an instance of class CPhoneStateMachine
+        */
+        static CPhoneStateMachineGSM* NewL(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+
+    public: // From MPhoneStateMachine
+
+        /**
+        * Returns active state
+        */
+        IMPORT_C MPhoneState* State();
+        
+        /**
+        * Instantiates protocol specific Phone Engine
+        * @param reference to Engine Monitor
+        * @return Phone Engine instance
+        */
+        IMPORT_C MPEPhoneModel* CreatePhoneEngineL( MEngineMonitor& aEngineMonitor );
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneStateMachineGSM(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+ 
+        // Phone customization
+        MPhoneCustomization* iCustomization;
+        
+    private: // Data
+    
+        // Is emergency object instantiated - needed to prevent multiple instantiation
+        TBool iEmergencyStateConstructed;
+    
+         // Emergency state which is hold in memory all the time.
+        MPhoneState* iEmergencyState;         
+    };
+
+#endif      // CPHONESTATEMACHINEGSM_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonetwosingles.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Two single call state implementation.
+*
+*/
+
+
+#ifndef CPHONETWOSINGLES_H
+#define CPHONETWOSINGLES_H
+
+// INCLUDES
+#include "cphonegsmincall.h"
+#include "tphonecmdparamboolean.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Two single call state implementation.
+*/
+class CPhoneTwoSingles : public CPhoneGsmInCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneTwoSingles();
+
+        /**
+        * Creates the Two Singles state class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneStateIncoming
+        */
+        static CPhoneTwoSingles* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        IMPORT_C virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );    
+            
+        IMPORT_C void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+            
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        IMPORT_C CPhoneTwoSingles( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        IMPORT_C virtual void ConstructL();
+      
+        /** 
+        * Handle state-specific behaviour when number entry is cleared
+        */ 
+        IMPORT_C virtual void HandleNumberEntryClearedL();
+        
+        IMPORT_C virtual void OpenMenuBarL();
+        
+        IMPORT_C virtual void HandleConnectedConferenceL( TInt aCallId );
+        
+        IMPORT_C virtual void UpdateInCallCbaL();
+        
+        
+    private:     
+         
+        void HandleIdleL( TInt aCallId );
+          
+        void HandleConnectedL( TInt aCallId );
+        
+        void HandleHeldL( TInt aCallId );
+                
+        void HandleIncomingL( TInt aCallId );
+        
+        void DisplayIncomingCallL( 
+            TInt aCallId, 
+            const TPhoneCmdParamBoolean aCommandParam );  
+        
+    };
+
+#endif // CPHONETWOSINGLES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphonetwosinglesandwaiting.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Two single calls and waiting call state implementation.
+*
+*/
+
+
+#ifndef CPHONETWOSINGLESANDWAITING_H
+#define CPHONETWOSINGLESANDWAITING_H
+
+// INCLUDES
+#include "cphonetwosingles.h"
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Two single calls and waiting call state
+*/
+class CPhoneTwoSinglesAndWaiting : public CPhoneTwoSingles
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneTwoSinglesAndWaiting();
+
+        /**
+        * Creates the Two Singles And Waiting state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneSingleAndAlerting
+        */
+        static CPhoneTwoSinglesAndWaiting* NewL( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+
+        virtual void HandleKeyMessageL(
+            TPhoneKeyEventMessages aMessage,
+            TKeyCode aCode );
+
+        virtual void HandleKeyEventL( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aEventCode );
+        
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+        
+        /**
+        * HandleError
+        * Implements error handling framework
+        * @param aErrorInfo: the error info
+        */
+        IMPORT_C virtual void HandleErrorL( 
+            const TPEErrorInfo& aErrorInfo );
+
+        /**
+        * Handles user selected UI commands.
+        * @param aCommand - selected command
+        */    
+        TBool HandleCommandL( TInt aCommand );
+        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneTwoSinglesAndWaiting( 
+            MPhoneStateMachine* aStateMachine, 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneCustomization* aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+            
+        /**
+        * Open menu bar
+        */
+        virtual void OpenMenuBarL();
+        
+        virtual void HandleConnectedConferenceL( TInt aCallId );
+        
+        virtual void UpdateInCallCbaL();
+        
+     private:
+
+        void HandleIdleL( TInt aCallId );
+        
+        void StateTransitionToTwoSinglesL();
+        
+        void StateTransitionToSingleAndWaitingL();
+        
+        /** 
+        * Handle state-specific behaviour when number entry is cleared
+        */ 
+        void HandleNumberEntryClearedL();
+        
+        /**
+        *  Handles received EPhoneCmdUpdateUiControls command.
+        */
+        void UpdateUiControlsL();
+        
+        // call id of ringing call
+        TInt iRingingCallId;
+    };
+
+#endif // CPHONETWOSINGLESANDWAITING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneuistatemachinefactorygsm.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of CPhoneUIStateMachineFactoryGSM class.
+*
+*/
+
+
+#ifndef __CPHONEUISTATEMACHINEFACTORYGSM_H
+#define __CPHONEUISTATEMACHINEFACTORYGSM_H
+
+// INCLUDES
+#include "cphoneuistatemachinefactorybase.h"
+
+/**
+* This class implements GSM-specific variant of the PhoneUIStateMachine factory.
+*/
+class CPhoneUIStateMachineFactoryGSM :   
+    public CPhoneUIStateMachineFactoryBase
+    {
+    public: // From MPhoneUIStateMachineFactory
+
+        /**
+        * See MPhoneUIStateMachineFactory for details
+        */
+        MPhoneStateMachine* CreatePhoneStateMachineL(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+
+        /**
+        * See MPhoneUIStateMachineFactory for details
+        */
+        CPhoneResourceResolverBase* CreatePhoneResourceResolverL();
+        
+        CPhoneErrorMessagesHandler* CreatePhoneErrorMessagesHandlerL(
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneStateMachine* aStateMachine );
+    };
+
+#endif      // __CPHONEUISTATEMACHINEFACTORYGSM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/inc/phonestatedefinitionsgsm.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   GSM-specific phone state definitions.
+*
+*/
+
+
+#ifndef __PHONESTATEDEFINITIONSGSM_H
+#define __PHONESTATEDEFINITIONSGSM_H
+
+// INCLUDES
+
+#include "phoneconstants.h"
+#include "phonestatedefinitions.h"
+
+// DATA TYPES
+
+typedef TPhoneStateId TPhoneStateGSMId;
+
+enum
+    {
+    EPhoneStateAlerting = KPhoneStateProtocolFirst,
+    EPhoneStateAlertingInSingle,
+    EPhoneStateWaitingInSingle,
+    EPhoneStateTwoSingles,
+    EPhoneStateCallSetupInSingle,
+    EPhoneStateConference,
+    EPhoneStateConferenceAndCallSetup,
+    EPhoneStateConferenceAndSingle,
+    EPhoneStateConferenceAndWaiting,
+    EPhoneStateSingleAndCallSetupAndWaiting,
+    EPhoneStateCallSetupAndWaiting,
+    EPhoneStateTwoSinglesAndWaiting,
+    EPhoneStateConferenceAndSingleAndWaiting,
+    EPhoneStateConferenceAndWaitingAndCallSetup,
+    EPhoneStateGSMLast
+    };
+
+#endif      // __PHONESTATEDEFINITIONSGSM_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonealerting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneAlerting class.
+*
+*/
+
+
+// INCLUDES
+#include <pevirtualengine.h>
+#include <mpeengineinfo.h>
+#include <mpeclientinformation.h>
+#include <MediatorDomainUIDs.h>
+#include "cphonealerting.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "phoneconstants.h"
+#include "cphonemediatorfactory.h"
+#include "cphonemediatorsender.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneAlerting::CPhoneAlerting( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ),
+    iIncomingCallId( KErrNotFound )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::~CPhoneAlerting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneAlerting::~CPhoneAlerting()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneAlerting::ConstructL()
+    {
+    CPhoneGsmInCall::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneAlerting* CPhoneAlerting::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneAlerting* self = new( ELeave ) CPhoneAlerting( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// --------------------------------------------------------------
+// CPhoneAlerting::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+EXPORT_C void CPhoneAlerting::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneAlerting::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if ( IsNumberEntryUsedL() )
+                {
+                // send a manual control sequence
+                CallFromNumberEntryL();    
+                }
+            else
+                {
+                // Show not allowed note
+                SendGlobalErrorNoteL( 
+                    EPhoneNoteTextNotAllowed );
+                }
+            break;
+
+        // end-key
+        case EKeyNo:
+            // handle long press
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                // Close all connections
+                iStateMachine->SendPhoneEngineMessage(
+                    MPEPhoneModel::EPEMessageTerminateAllConnections ); 
+
+                if ( IsNumberEntryUsedL() )
+                    {
+                    BeginTransEffectLC( ENumberEntryClose );
+                    // Remove number entry from screen
+                    iViewCommandHandle->ExecuteCommandL( 
+                        EPhoneViewRemoveNumberEntry );
+                    EndTransEffect();    
+                    // Do state-specific operation when number entry is cleared
+                    HandleNumberEntryClearedL();
+                    }
+                if ( !TopAppIsDisplayedL() )
+                    {
+                    // Bring app to foreground
+                    TPhoneCmdParamInteger uidParam;
+                    uidParam.SetInteger( KUidPhoneApplication.iUid );
+                    iViewCommandHandle->ExecuteCommandL(
+                        EPhoneViewBringAppToForeground, &uidParam );
+                    }
+                }
+            else
+                {
+                // handle end key
+                DisconnectOutgoingCallL();
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneAlerting::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneAlerting::HandlePhoneEngineMessageL()");
+    
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageDisconnecting:
+            HandleDisconnectingL( aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageRemoteTerminated:
+            iViewCommandHandle->ExecuteCommandL( 
+                EPhoneViewHideNaviPaneAudioVolume );
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageIncoming:
+            {
+            // If incoming message is received in alerting state, teardown of
+            // alerting call must be ongoing. Handling of the incoming call is
+            // buffered until first call teardown is completed.
+            iIncomingCallId = aCallId;
+            }
+            break;
+        
+        case MEngineMonitor::EPEMessageIdle:
+            {
+            if ( KErrNotFound < iIncomingCallId )
+                {
+                TInt incomingCallId = iIncomingCallId;
+                iIncomingCallId = KErrNotFound;
+                
+                if ( aCallId != incomingCallId )
+                    {
+                    CPhoneGsmInCall::HandlePhoneEngineMessageL( 
+                        aMessage, aCallId );
+                    
+                    // Simulate incoming event which was received while 
+                    // teardown of first call was ongoing.
+                    iStateMachine->State()->HandlePhoneEngineMessageL( 
+                        MEngineMonitor::EPEMessageIncoming, incomingCallId );
+                    }
+                
+                return;
+                }
+            }
+            break;
+        
+        default:
+            break;
+        }
+
+    CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::HandleConnectedL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneAlerting::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneAlerting::HandleConnectedL()");
+    // Keep Phone in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    BeginUiUpdateLC();
+        
+    // Update the single call
+    UpdateSingleActiveCallL( aCallId );
+
+    SetTouchPaneButtons( EPhoneIncallButtons ); 
+
+    SetToolbarDimming( EFalse );
+        
+    EndUiUpdate();
+    
+    HandleColpNoteL( aCallId );
+    
+    // Go to single state
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );    
+    iStateMachine->ChangeState( EPhoneStateSingle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneAlerting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneAlerting::OpenMenuBarL()");
+    TInt resourceId;
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneAlertingCallMenubarWithNumberEntry;
+        }
+    // Use different resources for alerting data, video and cs call
+    else if( IsVideoCallAlertingL() )
+        {
+        resourceId = EPhoneAlertingVideoCallMenubar;
+        }
+    else
+        {
+        resourceId = EPhoneAlertingCallMenubar;
+        }            
+ 
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::HandleCommandL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneAlerting::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,  
+        "CPhoneAlerting::HandleCommandL()" );
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneInCallCmdHelp:
+            {
+            TPtrC contextName;
+            if ( IsVideoCallAlertingL() )
+                {
+                contextName.Set( KINCAL_HLP_VIDEOCALL() );    
+                }
+            else
+                {
+                contextName.Set( KINCAL_HLP_CALL_HANDLING() );
+                }
+            iViewCommandHandle->ExecuteCommandL(
+                EPhoneViewLaunchHelpApplication, 0, contextName );
+            }
+            break;
+        default:
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+        }
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::IsVideoCallAlertingL
+// -----------------------------------------------------------
+//
+TBool CPhoneAlerting::IsVideoCallAlertingL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,  
+        "CPhoneAlerting::IsVideoCallAlerting()" );
+    TBool retVal = EFalse;
+    // Fetch active call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+        
+    if ( callStateData.CallId() > KErrNotFound )
+        {
+        retVal = IsVideoCall( callStateData.CallId() );
+        }
+        
+    return retVal;
+    }
+    
+// -----------------------------------------------------------
+// CPhoneAlerting::CheckIfShowTerminationNote
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneAlerting::CheckIfShowCallTerminationNote( )
+    {
+    // Alerting state does not need call termination since
+    // call has not begun.
+    return EFalse;
+    }
+
+// -----------------------------------------------------------
+// CPhoneAlerting::HandleDisconnectingL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneAlerting::HandleDisconnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,  
+            "CPhoneAlerting::HandleDisconnectingL()" );
+    CPhoneGsmInCall::HandleDisconnectingL( aCallId );
+    }
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonecallsetup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneCallSetup class.
+*
+*/
+
+
+// INCLUDES
+#include <MediatorDomainUIDs.h>
+#include "cphonecallsetup.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "cphonetimer.h"
+#include "phonerssbase.h"
+#include "cphonemainresourceresolver.h"
+#include "phonelogger.h"
+#include "cphonegeneralgsmmessageshandler.h"
+#include "cphonemediatorfactory.h"
+#include "cphonemediatorsender.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneCallSetup::CPhoneCallSetup( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneStateCallSetup( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetup::~CPhoneCallSetup()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneCallSetup::~CPhoneCallSetup()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetup::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneCallSetup::ConstructL()
+    {
+    CPhoneStateCallSetup::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetup::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneCallSetup* CPhoneCallSetup::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneCallSetup* self = new (ELeave) CPhoneCallSetup( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetup::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneCallSetup::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneCallSetup::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnecting:
+            HandleConnectingL( aCallId );
+            break;
+
+        // fall through.    
+        case MEngineMonitor::EPEMessageIssuingSSRequest:
+        case MEngineMonitor::EPEMessageCallBarred:
+        case MEngineMonitor::EPEMessageShowVersion:
+        case MEngineMonitor::EPEMessageIssuedSSRequest:
+        case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
+        case MEngineMonitor::EPEMessageIncCallIsForw:
+        case MEngineMonitor::EPEMessageIncCallForwToC:
+        case MEngineMonitor::EPEMessageOutCallForwToC:
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: 
+        case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
+            {
+            __PHONELOG1( 
+                EBasic, 
+                EPhoneUIStates, 
+                "CPhoneCallSetup::HandlePhoneEngineMessageL Start create gsm message handler %d",
+                aMessage ); 
+            
+            CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
+                CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
+                                                       *iViewCommandHandle,
+                                                       *this );
+
+            CleanupStack::PushL( gsmMsgHandler );
+            gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
+            CleanupStack::PopAndDestroy( gsmMsgHandler );       
+            }
+            break;
+            
+        default:
+            CPhoneStateCallSetup::HandlePhoneEngineMessageL( aMessage, 
+                aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCallSetup::HandleConnectingL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneCallSetup::HandleConnectingL( TInt aCallId )
+    {
+    // Only handle connecting case for GSM protocol. In CDMA, this message is 
+    // set when the CDMA network receives the call, not (like in GSM) when
+    // when the remote party receives the call. So, in CDMA, the user
+    // should still be able to cancel the MO call before the call is connected.
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneCallSetup::HandleConnectingL()");
+    
+    BeginUiUpdateLC();
+    UpdateRemoteInfoDataL ( aCallId );
+    
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Home screen to foreground after call
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommand( EPhoneViewHsToForegroundAfterCall,
+        &booleanParam );
+    
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+    
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+
+    // Remove the number entry if it isn't DTMF dialer
+    /*if ( !iOnScreenDialer ||
+         !IsNumberEntryVisibleL() ||
+         !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }*/
+
+    SetToolbarButtonLoudspeakerEnabled();
+
+    EndUiUpdate();
+    
+    // Go to alerting state
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+
+    iStateMachine->ChangeState( EPhoneStateAlerting );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonecallsetupandwaiting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,272 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneCallSetupAndWaiting class.
+*
+*/
+
+
+// INCLUDES
+#include <pevirtualengine.h>
+#include <StringLoader.h>
+#include <MediatorDomainUIDs.h>
+
+#include "cphonecallsetupandwaiting.h"
+#include "tphonecmdparamboolean.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "cphonemediatorfactory.h"
+#include "cphonemediatorsender.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneCallSetupAndWaiting::CPhoneCallSetupAndWaiting(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) :
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::~CPhoneCallSetupAndWaiting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneCallSetupAndWaiting::~CPhoneCallSetupAndWaiting()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneCallSetupAndWaiting::ConstructL()
+    {
+    CPhoneGsmInCall::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneCallSetupAndWaiting* CPhoneCallSetupAndWaiting::NewL(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneCallSetupAndWaiting* self = new( ELeave ) CPhoneCallSetupAndWaiting(
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL(
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+
+        default:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneCallSetupAndWaiting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneCallSetupAndWaiting::OpenMenuBarL()");
+    TInt resourceId;
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneAlertingAndWaitingCallMenuBarWithNumberEntry;
+        }
+    else
+        {
+        resourceId = EPhoneAlertingAndWaitingCallMenuBar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneCallSetupAndWaiting::HandleIdleL()");
+
+    BeginUiUpdateLC();
+
+    // Remove call
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Find out do we have waiting or outgoing call left
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+        &callStateData );
+
+    if( callStateData.CallId() > KErrNotFound )
+        {
+        // Idle message came for callSetup
+
+        if ( iOnScreenDialer && IsDTMFEditorVisibleL()  )
+            {
+            CloseDTMFEditorL();
+            }
+
+        // Display ringing bubble
+        TPhoneCmdParamCallHeaderData callHeaderParam;
+        callHeaderParam.SetCallState( EPEStateRinging );
+
+        SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam );
+
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble,
+            callStateData.CallId(),
+            &callHeaderParam );
+
+        // Show incoming call buttons
+        SetTouchPaneButtons( EPhoneIncomingCallButtons );
+        SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
+
+        // Bring up callhandling view
+        BringIncomingToForegroundL();
+
+        // state changes to Incoming
+        iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
+        UpdateSilenceButtonDimming();
+        SetRingingTonePlaybackL( callStateData.CallId() );
+        SetBackButtonActive(EFalse);
+        iStateMachine->ChangeState( EPhoneStateIncoming );
+        }
+
+    else
+        {
+        // Show call setup buttons
+        CPhoneState::SetTouchPaneButtons( EPhoneCallSetupButtons );
+        // Waiting call was terminated
+        UpdateCbaL( EPhoneCallHandlingInCallCBA );
+        iStateMachine->ChangeState( EPhoneStateAlerting );
+        }
+
+    EndUiUpdate();
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneCallSetupAndWaiting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl,
+        "CPhoneCallSetupAndWaiting::UpdateInCallCbaL() ");
+
+    UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallSetupAndWaiting::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() ");
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    CPhoneState::BeginUiUpdateLC();
+
+    // Update bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
+        &callHeaderParam );
+
+    // Update Touch buttons
+    CPhoneState::SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    SetToolbarDimming( EFalse );
+
+    CPhoneState::EndUiUpdate();
+
+    if ( CPhoneState::IsNumberEntryUsedL() )
+        {
+        // Show number entry
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
+        }
+
+    // Go to Single And Waiting state
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconference.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1126 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneConference class.
+*
+*/
+
+
+// INCLUDES
+#include <eikmenub.h> 
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <pevirtualengine.h>
+#include <mpeengineinfo.h>
+#include <cpephonemodelif.h>
+#include <featmgr.h>
+#include "cphoneconference.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamkeyevent.h"
+#include "phonestatedefinitions.h"
+#include "tphonecmdparamglobalnote.h"
+#include "phonestatedefinitionsgsm.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "cphonekeys.h"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneConference::CPhoneConference( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::~CPhoneConference()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConference::~CPhoneConference()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneConference::ConstructL()
+    {
+    CPhoneGsmInCall::ConstructL();
+    
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    
+  
+    DefineAndSetHoldFlagL();
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConference* CPhoneConference::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneConference* self = new( ELeave ) CPhoneConference( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageConferenceIdle:
+            HandleConferenceIdleL();
+            break;
+            
+        case MEngineMonitor::EPEMessageHeldConference:
+            HandleHeldConferenceL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnectedConference:
+            HandleConnectedConferenceL();
+            break;
+
+        case MEngineMonitor::EPEMessageAddedConferenceMember:
+            UpdateConferenceSecurityStatusL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageWentOneToOne:
+            HandleWentOneToOneL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageHeld:
+            {
+            TPhoneCmdParamCallHeaderData callHeaderParam;
+            callHeaderParam.SetCallState( EPEStateHeld );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+                &callHeaderParam );
+            }
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            {
+            TPhoneCmdParamCallHeaderData callHeaderParam;
+            callHeaderParam.SetCallState( EPEStateConnected );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+                &callHeaderParam );
+            }
+            break;
+            
+        case MEngineMonitor::EPEMessageDialing:
+            HandleDiallingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageIncoming:
+            HandleIncomingL( aCallId );
+            break;
+
+        default:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference:HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneConference::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleCommandL()");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {   
+        case EAknSoftkeyCancel:
+            BeginUiUpdateLC();
+            CloseSelectionListL();
+            SetTouchPaneButtons( EPhoneConferenceButtons );
+            EndUiUpdate();    
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            break;
+    
+        case EPhoneInCallCmdHold:
+        case EPhoneInCallCmdConferenceHold:
+            iStateMachine->SendPhoneEngineMessage( 
+                CPEPhoneModelIF::EPEMessageHoldConference );
+            break;
+            
+        case EPhoneInCallCmdUnhold:
+        case EPhoneInCallCmdConferenceUnhold:
+            iStateMachine->SendPhoneEngineMessage( 
+                CPEPhoneModelIF::EPEMessageResumeConference );
+            break;
+            
+        // Conference -> Drop participant
+        case EPhoneInCallCmdDropSelection:
+            OpenDropParticipantSelectionL();
+            break;
+        
+        // Drop CBA    
+        case EPhoneInCallCmdDrop:
+            DropSelectedParticipantL();
+            break;
+            
+        case EPhoneInCallCmdPrivateSelection:
+            OpenPrivateSelectionL();
+            break;
+            
+        case EPhoneInCallCmdPrivate:
+            PrivateSelectedParticipantL();
+            break;
+          
+        case EPhoneInCallCmdNewCall:
+            LaunchNewCallQueryL();
+            break;
+            
+        case EPhoneInCallCmdNewCallCall:
+            CallFromNewCallQueryL();
+            break;
+            
+        case EPhoneInCallCmdParticipants:
+            OpenParticipantsListL();
+            break;
+            
+        case EPhoneViewOpenNumberEntry:
+            if ( IsConferenceBubbleInSelectionMode() )
+                {
+                CloseSelectionListL();
+                SetTouchPaneButtons( EPhoneConferenceButtons );
+                }
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;            
+
+        default:
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneConference::UpdateInCallCbaL()
+    {
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneConference::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::OpenMenuBarL()");
+    TInt resourceId;
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneConfCallMenubarWithNumberEntry;
+        }
+    else if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) 
+              && IsConferenceBubbleInSelectionMode() )        
+        {
+        resourceId = EPhoneConfCallParticipantsMenubar;            
+        }
+    else
+        {
+        resourceId = EPhoneConfCallMenubar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::HandleKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleKeyEventL( 
+    const TKeyEvent& aKeyEvent, 
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleKeyEventL()");
+    if ( IsConferenceBubbleInSelectionMode() )
+        {
+        if ( aKeyEvent.iCode == EKeyUpArrow ||
+             aKeyEvent.iCode == EKeyDownArrow )
+            {
+            TPhoneCmdParamKeyEvent keyEventParam;
+            keyEventParam.SetKeyEvent( aKeyEvent );
+            keyEventParam.SetEventCode( aEventCode );    
+            
+            iViewCommandHandle->ExecuteCommandL( 
+                EPhoneViewMoveHighLightInList, &keyEventParam );
+            }
+        }
+    else
+        {
+        if ( CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) )
+            {
+            // Handle numeric keys when key events are received 
+            // in conference state.
+            CPhoneGsmInCall::HandleNumericKeyEventL( aKeyEvent, aEventCode );
+            }
+        else
+            {
+            // Handle other key events.
+            CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode );
+            }
+        }
+    }
+
+// --------------------------------------------------------------
+// CPhoneConference::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneConference::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleKeyMessageL()");
+        
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if( IsNumberEntryVisibleL() )
+                {
+                CallFromNumberEntryL();    
+                }
+            else
+                {
+                ToggleHoldL();    
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::HandleNumberEntryClearedL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleNumberEntryClearedL()");
+    // Update CBA when number entry is cleared
+    UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference:HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleIdleL()");
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+
+    // If dialler is not open then close menu bar.
+    if ( !IsNumberEntryUsedL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        }
+        
+    // If conference bubble still exists then we have conference and
+    // single call
+    TPhoneCmdParamBoolean conferenceBubbleExists;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, 
+        &conferenceBubbleExists ); 
+        
+    if( conferenceBubbleExists.Boolean() )
+        {
+        // Go to Conference And Single state
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewRemoveFromConference, aCallId ); 
+        }
+    else
+        {
+        // Remove call header
+        iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewRemoveCallHeader, aCallId );    
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneConference:HandleConferenceIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleConferenceIdleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleConferenceIdleL()");
+    
+    BeginTransEffectLC( ENumberEntryOpen );
+    BeginUiUpdateLC();
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
+
+    TPhoneCmdParamInteger activeCallCount;
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+
+    switch( activeCallCount.Integer() )
+        {
+        case ENoActiveCalls:
+            MakeStateTransitionToIdleL();
+            break;
+            
+        case EOneActiveCall:
+            {
+            // Fetch ringing call's id from view
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateRinging );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+                
+            if( callStateData.CallId() > KErrNotFound )
+                {
+                UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+                iStateMachine->ChangeState( EPhoneStateWaitingInSingle );    
+                }
+            else
+                {
+                MakeStateTransitionToSingleL();                    
+                }
+            }
+            break;
+            
+        case ETwoActiveCalls:
+            MakeStateTransitionToTwoSinglesL();
+            break;
+            
+        default:
+            MakeStateTransitionToTwoSinglesL();
+            break;
+        }
+    
+    EndUiUpdate();
+    EndTransEffect();     
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::HandleHeldConferenceL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleHeldConferenceL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleHeldConferenceL()");
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateHeldConference );
+    
+    TInt callLabelId;
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCallOnHold );
+
+    StringLoader::Load( 
+        labelText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( labelText );
+ 
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewUpdateBubble, aCallId, &callHeaderParam );
+       
+    // Set Hold flag to view
+    SetHoldFlagL();
+    
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        SendGlobalInfoNoteL( EPhoneInformationConferenceOnHold );
+        }
+    
+    SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+    SetTouchPaneButtons( EPhoneConferenceButtons );
+    UpdateInCallCbaL();
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneConference::DefineAndSetHoldFlagL
+// -----------------------------------------------------------
+//
+void CPhoneConference::DefineAndSetHoldFlagL()
+    {
+    // Find out is conference held or not
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallId( KConferenceCallId );
+    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
+            &callStateData );
+    
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+        
+    if( callStateData.CallState() == EPEStateHeld )
+        {
+        holdFlag.SetBoolean( ETrue );
+        }
+    else
+        {
+        holdFlag.SetBoolean( EFalse );   
+        }
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::SetHoldFlagL
+// -----------------------------------------------------------
+//
+void CPhoneConference::SetHoldFlagL()
+    {
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::HandleConnectedConferenceL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleConnectedConferenceL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleConnectedConferenceL()");
+    // Update call state
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnectedConference );
+    
+    TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
+    TInt callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCLIConferenceCall );
+
+    StringLoader::Load( 
+        conferenceText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( conferenceText );
+ 
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewUpdateBubble, KConferenceCallId, &callHeaderParam );
+
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+    
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        { 
+        SendGlobalInfoNoteL( EPhoneInformationConferenceActiveted );
+        }
+    
+    SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );
+    SetTouchPaneButtons( EPhoneConferenceButtons );
+    
+    UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::OpenDropParticipantSelectionL
+// -----------------------------------------------------------
+//
+void CPhoneConference::OpenDropParticipantSelectionL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::OpenDropParticipantSelectionL()");
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewOpenConferenceList, &booleanParam );
+
+    iCbaManager->SetCbaL( EPhoneDropParticipantCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::DropSelectedParticipantL
+// -----------------------------------------------------------
+//
+void CPhoneConference::DropSelectedParticipantL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::DropSelectedParticipantL()");
+    // First fetch the call id matching the selected item 
+    TPhoneViewResponseId response;
+    TPhoneCmdParamInteger callId;
+    response = iViewCommandHandle->HandleCommandL(
+        EPhoneViewSelectedConfMember, &callId );    
+        
+    if( response == EPhoneViewResponseSuccess )
+        {
+        // Drop the call from conference
+        iStateMachine->SetCallId( callId.Integer() );    
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageDropConferenceMember );            
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::OpenPrivateSelectionL
+// -----------------------------------------------------------
+//
+void CPhoneConference::OpenPrivateSelectionL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::OpenPrivateSelectionL()");
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewOpenConferenceList, &booleanParam );
+
+    iCbaManager->SetCbaL( EPhonePrivateParticipantCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::PrivateSelectedParticipantL
+// -----------------------------------------------------------
+//
+void CPhoneConference::PrivateSelectedParticipantL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::PrivateSelectedParticipantL()");
+    // First fetch the call id matching the selected item 
+    TPhoneViewResponseId response;
+    TPhoneCmdParamInteger callId;
+    response = iViewCommandHandle->HandleCommandL(
+        EPhoneViewSelectedConfMember, &callId );
+    
+    if( response == EPhoneViewResponseSuccess )
+        {
+        // Drop the call from conference
+        iStateMachine->SetCallId( callId.Integer() );    
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageGoOneToOne );
+        
+        // Update call view
+        BeginUiUpdateLC();
+        CloseSelectionListL();
+        SetTouchPaneButtons( EPhoneConferenceButtons );
+        EndUiUpdate();    
+                
+        UpdateCbaL( EPhoneCallHandlingInCallCBA );               
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::MakeStateTransitionToIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConference::MakeStateTransitionToIdleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::MakeStateTransitionToIdleL()");
+    
+    SetDefaultFlagsL();
+
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);
+        
+        // Close dtmf dialer when call is disconnected.
+        if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+            {            
+            CloseDTMFEditorL();
+            // Display idle screen and update CBAs
+            DisplayIdleScreenL();
+            }        
+        }
+    else if ( !TopAppIsDisplayedL() )
+        {
+        // Close menu bar, if it is displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        
+        // Continue displaying current app but set up the 
+        // idle screen in the background
+        SetupIdleScreenInBackgroundL();
+        }
+    else
+        {
+        // Close menu bar, if it is displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        
+         // Display idle screen
+        DisplayIdleScreenL();
+        }
+
+    // Display call termination note, if necessary
+    DisplayCallTerminationNoteL();
+
+    UpdateCbaL( EPhoneEmptyCBA );
+    // Go to idle state
+    iStateMachine->ChangeState( EPhoneStateIdle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::MakeStateTransitionToSingleL
+// -----------------------------------------------------------
+//
+void CPhoneConference::MakeStateTransitionToSingleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::MakeStateTransitionToSingleL()");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+ 
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);
+        }
+    SetTouchPaneButtons( EPhoneIncallButtons );    
+  
+    // Go to single state
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    iStateMachine->ChangeState( EPhoneStateSingle );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::MakeTransitionToTwoSinglesL
+// -----------------------------------------------------------
+//
+void CPhoneConference::MakeStateTransitionToTwoSinglesL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::MakeStateTransitionToTwoSinglesL()");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);
+        }
+        
+    SetTouchPaneButtons( EPhoneTwoSinglesButtons );        
+    
+    // Set Two singles softkeys
+    UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+
+    // Go to two singles state
+    iStateMachine->ChangeState( EPhoneStateTwoSingles );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::CloseSelectionListL
+// -----------------------------------------------------------
+//
+void CPhoneConference::CloseSelectionListL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::CloseSelectionListL()");
+    // Close conference list
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewOpenConferenceList, &booleanParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::ToggleHold
+// -----------------------------------------------------------
+//
+void CPhoneConference::ToggleHoldL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::ToggleHoldL()");
+    TPhoneCmdParamBoolean hold;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetHoldFlag, &hold );
+    
+    if( hold.Boolean() )
+        {
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageResumeConference );
+        }
+    else
+        {
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageHoldConference );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::HandleDiallingL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleDiallingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleDiallingL()");
+    
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC(); 
+    
+    CloseSelectionListL(); 
+    
+    SetNumberEntryVisibilityL(EFalse);
+    
+    // Display call setup 
+    DisplayCallSetupL( aCallId );
+    
+    // Conference is understood as single call in buttons enumerations.
+    SetTouchPaneButtons(EPhoneCallSetupAndSingleButtons); 
+
+    EndUiUpdate();
+
+    EndTransEffect();
+    
+    // Set Call Setup CBA 
+    UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+      
+    // Go to conference and call setup state
+    iStateMachine->ChangeState( EPhoneStateConferenceAndCallSetup );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::DisplayCallSetupL
+// -----------------------------------------------------------
+//
+void CPhoneConference::DisplayCallSetupL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::DisplayCallSetupL()");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Remove dialogs if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    // Capture keys when the phone is dialling
+    CaptureKeysDuringCallNotificationL( ETrue );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Display call setup header
+    DisplayHeaderForOutgoingCallL( aCallId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneConference::CallFromNewCallQueryL
+// ---------------------------------------------------------
+//
+void CPhoneConference::CallFromNewCallQueryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::CallFromNewCallQueryL()");
+    // First get the phone number from the dialog
+    TPhoneCmdParamString phoneNumberParam;
+    HBufC *content = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( content->Des() );
+    phoneNumberParam.SetString( &ptr );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
+        &phoneNumberParam );
+
+    // Store the phone number
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
+
+    // clean up stack
+    CleanupStack::PopAndDestroy( content );
+  
+    // Dial number
+    DialVoiceCallL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::HandleIncomingL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleIncomingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleIncomingL()");
+    
+    BeginUiUpdateLC();
+ 
+    TPhoneCmdParamBoolean dialerParam;
+    dialerParam.SetBoolean( ETrue );
+    
+    // Get allow waiting call header param value.
+    AllowShowingOfWaitingCallHeaderL( dialerParam );
+            
+    CloseSelectionListL();
+
+    // Close fast swap window if it's displayed
+    CEikonEnv::Static()->DismissTaskList();
+    
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+    
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam );
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+
+    EndUiUpdate();
+
+    // Go to incoming state
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::DisplayIncomingCallL
+// -----------------------------------------------------------
+//
+void CPhoneConference::DisplayIncomingCallL( 
+    TInt aCallId, 
+    const TPhoneCmdParamBoolean aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::DisplayIncomingCallL()");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Cannot delete active note, e.g. New call query, 
+    // but show waiting note with or without caller name
+    if ( IsAnyQueryActiveL() ||  
+        ( !aCommandParam.Boolean() && iOnScreenDialer ) )
+        {
+        CallWaitingNoteL( aCallId );        
+        }
+    else
+        {
+        // Remove any phone dialogs if they are displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+        }
+
+    // Indicate that the Phone needs to be sent to the background if
+    // an application other than the top application is in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        &booleanParam );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+
+    DisplayHeaderForCallComingInL( aCallId, ETrue ); // waiting call 
+    }    
+
+// -----------------------------------------------------------
+// CPhoneConference::HandleWentOneToOneL
+// -----------------------------------------------------------
+//
+void CPhoneConference::HandleWentOneToOneL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConference::HandleWentOneToOneL()");
+
+    BeginUiUpdateLC();
+    
+    // Update conference bubble
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewPrivateFromConference, aCallId );
+        
+    // If conference bubble still exists then we have conference and
+    // single call
+    TPhoneCmdParamBoolean conferenceBubbleExists;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, 
+        &conferenceBubbleExists );                            
+    if( conferenceBubbleExists.Boolean() )
+        {
+        // Go to Conference And Single state
+      
+        UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+        iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                    
+        SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
+        SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+        }
+    else
+        {            
+        SetTouchPaneButtons( EPhoneTwoSinglesButtons );
+        }       
+    EndUiUpdate();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::OpenParticipantsListL
+// -----------------------------------------------------------
+//    
+void CPhoneConference::OpenParticipantsListL()
+    {
+    BeginUiUpdateLC();
+    
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( ETrue );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenConferenceList,
+                                         &booleanParam );    
+
+    SetTouchPaneButtons( EPhoneParticipantListButtons );
+                                         
+    EndUiUpdate();
+    
+    iCbaManager->SetCbaL( EPhoneParticipantListCBA );
+     
+    // Find out is conference held or not
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallId( KConferenceCallId );
+    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
+        &callStateData );
+    
+    if( callStateData.CallState() == EPEStateHeld )
+        {
+        //set Private button to Dimmed.        
+        SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+        } 
+    else
+        {
+        //set Private button to UnDimmed.        
+         SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );        
+        }   
+                                           
+    }
+
+// -----------------------------------------------------------
+// CPhoneConference::IsConferenceBubbleInSelectionMode
+// -----------------------------------------------------------
+//
+TBool CPhoneConference::IsConferenceBubbleInSelectionMode() const
+    {
+    TPhoneCmdParamBoolean booleanParam;
+    
+    iViewCommandHandle->ExecuteCommand( 
+        EPhoneViewGetIsConferenceInSelectionMode, &booleanParam );
+    
+    return booleanParam.Boolean();
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::HandleCreateNumberEntryL
+// ---------------------------------------------------------
+//
+void CPhoneConference::HandleCreateNumberEntryL( const TKeyEvent& aKeyEvent,
+        TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneConference::HandleCreateNumberEntryL() ");
+    if ( !IsConferenceBubbleInSelectionMode() )
+        {
+        CPhoneGsmInCall::HandleCreateNumberEntryL( aKeyEvent,aEventCode );
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneConference::UpdateConferenceSecurityStatusL
+// -----------------------------------------------------------
+//
+void CPhoneConference::UpdateConferenceSecurityStatusL( TInt aCallId )
+    {
+    __PHONELOG1( EBasic, EPhoneUIStates, 
+        "CPhoneConference::UpdateConferenceSecurityStatusL() - callId = %d", aCallId );
+
+    if( !iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) &&
+        iStateMachine->PhoneEngineInfo()->IsSecureCall( KPEConferenceCallID ) )
+        {
+        TPhoneCmdParamCallHeaderData callHeaderParam;
+        
+        callHeaderParam.SetCiphering( EFalse );
+        callHeaderParam.SetCipheringIndicatorAllowed(
+            iStateMachine->PhoneEngineInfo()->SecureSpecified() );
+        
+        iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewCipheringInfoChange,
+            KPEConferenceCallID,
+            &callHeaderParam );
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandcallsetup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,457 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneConferenceAndCallSetup class.
+*
+*/
+
+
+// INCLUDES
+#include "cphoneconferenceandcallsetup.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "tphonecmdparamglobalnote.h"
+#include "phoneui.hrh"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneConferenceAndCallSetup::CPhoneConferenceAndCallSetup( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneConference( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup()
+    {
+    // Reset flag
+    if ( iViewCommandHandle )
+        {
+        TPhoneCmdParamBoolean dtmfSendFlag;
+        dtmfSendFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewSetDtmfOptionsFlag, 
+            &dtmfSendFlag );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::ConstructL()
+    {
+    CPhoneConference::ConstructL();
+  
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndCallSetup* CPhoneConferenceAndCallSetup::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneConferenceAndCallSetup* self = new( ELeave ) CPhoneConferenceAndCallSetup( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnecting:
+            iAlerting = ETrue;
+            HandleConnectingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConferenceIdle:
+            HandleConferenceIdleL();
+            break;
+            
+        default:
+            CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
+                aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneConferenceAndCallSetup::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndCallSetup::HandleCommandL()");
+    TBool commandStatus = ETrue;
+    
+    switch( aCommand )
+        {   
+        case EPhoneDtmfDialerCancel:
+            {
+            CloseDTMFEditorL();
+            }
+            break;    
+    
+        default:
+            commandStatus = CPhoneConference::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+    
+// --------------------------------------------------------------
+// CPhoneConferenceAndCallSetup::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndCallSetup::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // End-key
+        case EKeyNo:
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                iStateMachine->SendPhoneEngineMessage(
+                        MPEPhoneModel::EPEMessageTerminateAllConnections );   
+                }
+            else
+                {
+                DisconnectOutgoingCallL();
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneConference::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::OpenMenuBarL()");
+    TInt resourceId;
+    
+    // Set specific flag to view so that DTMF menu item available
+    TPhoneCmdParamBoolean dtmfSendFlag;
+    dtmfSendFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, 
+        &dtmfSendFlag );
+     
+    if ( iOnScreenDialer &&  IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneAlertingAndConfHeldCallMenuBarWithNumberEntry;
+        }
+    else if ( IsConferenceBubbleInSelectionMode() )
+        {
+        resourceId = EPhoneConfCallParticipantsDropMenubar;    
+        }        
+    else
+        {
+        resourceId = EPhoneAlertingAndConfHeldCallMenuBar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+                CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resourceId ) );
+        
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::HandleConnectingL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::HandleConnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectingL()");
+    
+    BeginUiUpdateLC();
+        
+    UpdateRemoteInfoDataL ( aCallId );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+    
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || ! IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    
+    // Set Hold flag to view EFalse that IHF is on RSK not unhold
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+    
+    // Updated connecting cba's   
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );       
+        
+    EndUiUpdate();        
+    }
+    
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectedL()");
+    
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    
+    // Keep Phone in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+    
+    BeginUiUpdateLC();
+        
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+    
+    // Capturing keys and number entry must be removed because some
+    // networks jump over connecting state directly to connected state.
+    CaptureKeysDuringCallNotificationL( EFalse );
+    
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || ! IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    
+    SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
+    SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+    EndUiUpdate(); 
+
+    HandleColpNoteL( aCallId );
+    UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
+   
+    iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                     
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup:HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndCallSetup::HandleIdleL()");
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    TPhoneCmdParamBoolean conferenceExistsForCallId;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
+        aCallId, &conferenceExistsForCallId );
+    
+    if( conferenceExistsForCallId.Boolean() )
+        {
+        // Remove 'Conference on hold' global note
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+    
+        // Remove conference member from conference bubble
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, 
+            aCallId );
+        
+        //Check if removed call was last one to be able to be in conference mode
+        //If there is no confrence call, go to single and call setup state
+        TPhoneCmdParamBoolean conferenceExists;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, 
+            &conferenceExists );
+        
+        __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneConferenceAndCallSetup::HandleIdleL - conferenceExists =%d ",
+            conferenceExists.Boolean() );
+                
+        if( !conferenceExists.Boolean() )
+            {
+            if( iAlerting )
+                {
+                iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); 
+                }
+            else
+                {
+                iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );     
+                }
+            }
+        }
+    else
+        {       
+        // Remove  outgoing call 
+        BeginTransEffectLC( ENumberEntryOpen );
+        BeginUiUpdateLC();
+        
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+        
+        CheckIfRestoreNEContentAfterDtmfDialer();
+         
+        if ( IsNumberEntryUsedL() )
+            {
+            // Show the number entry if it exists
+            SetNumberEntryVisibilityL(ETrue);
+            }
+            
+        SetTouchPaneButtons( EPhoneConferenceButtons );
+        EndUiUpdate();
+        EndTransEffect(); 
+
+        // Go to conference state
+        UpdateCbaL( EPhoneCallHandlingInCallCBA );
+        iStateMachine->ChangeState( EPhoneStateConference );
+        } 
+
+    }
+   
+    
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::UpdateInCallCbaL() ");
+
+    if ( iAlerting )
+        {
+        UpdateCbaL( EPhoneCallHandlingInCallCBA );
+        }
+    else
+        {
+        UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+        }
+    } 
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndCallSetup:HandleConferenceIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndCallSetup::HandleConferenceIdleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndCallSetup::HandleConferenceIdleL()");
+        
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
+        
+    // Fetch alerting call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+
+    if ( callStateData.CallId() > KErrNotFound )
+        {
+        // Set Hold flag to view EFalse that dtmf menu item not delete
+        TPhoneCmdParamBoolean holdFlag;
+        holdFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+        // Go to alerting and single state
+        UpdateCbaL( EPhoneCallHandlingInCallCBA );
+        iStateMachine->ChangeState( EPhoneStateAlertingInSingle );     
+        }
+    else
+        {
+        // Go to callsetup and single state
+        UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+        iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
+        }           
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandsingle.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,658 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneConferenceAndSingle class.
+*
+*/
+
+
+// INCLUDES
+#include <StringLoader.h>
+#include <cpephonemodelif.h>
+#include <mpeengineinfo.h>
+#include <featmgr.h>
+#include "cphoneconferenceandsingle.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamstring.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "tphonecmdparamglobalnote.h"
+#include "phoneui.hrh"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneConferenceAndSingle::CPhoneConferenceAndSingle( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneConference( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::~CPhoneConferenceAndSingle()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndSingle::~CPhoneConferenceAndSingle()
+    {
+    // Reset flag 
+    if ( iViewCommandHandle )
+        {
+        TPhoneCmdParamBoolean dtmfSendFlag;
+        dtmfSendFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewSetDtmfOptionsFlag, 
+            &dtmfSendFlag );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::ConstructL()
+    {
+    CPhoneConference::ConstructL();
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndSingle* CPhoneConferenceAndSingle::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneConferenceAndSingle* self = new( ELeave ) CPhoneConferenceAndSingle( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingle::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnectedConference:
+            HandleConnectedConferenceL();
+            break;
+            
+        case MEngineMonitor::EPEMessageHeldConference:
+            HandleHeldConferenceL();
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageHeld:
+            HandleHeldL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageInValidEmergencyNumber:              
+            SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );                       
+            break;
+            
+        case MEngineMonitor::EPEMessageValidEmergencyNumber:
+            DialVoiceCallL();
+            break;                          
+           
+        case MEngineMonitor::EPEMessageAddedConferenceMember:
+            HandleAddedConferenceMemberL( aCallId );
+            break;
+            
+        default:
+            CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
+                aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle:HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneConferenceAndSingle::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleCommandL");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneNumberAcqCmdCall:
+        case EPhoneNumberAcqCmdSendCommand:
+            HandleSendL();
+            break;
+                    
+        case EAknSoftkeyCancel:
+            commandStatus = CPhoneConference::HandleCommandL( aCommand );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag );
+            SetTouchPaneButtons( EPhoneConferenceAndHeldSingleButtons );
+            break;
+            
+        case EPhoneInCallCmdJoin:
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageAddConferenceMember );
+            break;
+        
+        case EPhoneInCallCmdParticipants:
+            commandStatus = CPhoneConference::HandleCommandL( aCommand );
+            SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+            break;
+        
+        default:
+            commandStatus = CPhoneConference::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::OpenMenuBarL");
+    
+    // Set Conference And Single specific flag to view
+    TPhoneCmdParamBoolean conferenceAndSingleFlag;
+    conferenceAndSingleFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, 
+        &conferenceAndSingleFlag );
+    
+    // Set specific flag to view so that DTMF menu item available
+    TPhoneCmdParamBoolean dtmfSendFlag;
+    dtmfSendFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, 
+        &dtmfSendFlag );        
+    
+    TPhoneViewResponseId response;
+    TPhoneCmdParamCallStateData callStateData;
+    TPhoneCmdParamBoolean booleaParam;
+    TInt heldCallId( KErrNotFound );
+    TInt connectedCallId( KErrNotFound );
+    
+    // Fetch active call's id from view
+    callStateData.SetCallState( EPEStateConnected );
+    response = iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    if( response != EPhoneViewResponseSuccess )
+        {
+        // Unsuccesfull fetch - do nothing
+        return;            
+        }
+    connectedCallId = callStateData.CallId();
+    
+    // Fetch held call's id from view
+    callStateData.SetCallState( EPEStateHeld );
+    response = iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    if( response != EPhoneViewResponseSuccess )
+        {
+        // Unsuccesfull fetch - do nothing
+        return;            
+        }
+    heldCallId = callStateData.CallId();
+
+    // Open the correct menubar according which call is active
+    TInt resourceId;
+    if( connectedCallId == KConferenceCallId )
+        {
+        if ( IsNumberEntryVisibleL() )
+            {
+            resourceId = EPhoneConfAndHeldCallMenubarWithNumberEntry;
+            }
+        else if ( IsConferenceBubbleInSelectionMode() )
+            {
+            resourceId = EPhoneConfCallParticipantsDropMenubar;    
+            }
+        else
+            {
+            resourceId = EPhoneConfAndHeldCallMenubar;
+            }
+        }
+    else
+        {
+        if ( IsNumberEntryVisibleL() )
+            {
+            resourceId = EPhoneActiveAndHeldConfMenubarWithNumberEntry;
+            }
+        else if ( IsConferenceBubbleInSelectionMode() )
+            {
+            resourceId = EPhoneConfCallParticipantsDropMenubar;    
+            }            
+        else
+            {
+            resourceId = EPhoneActiveAndHeldConfMenubar;
+            }            
+        }
+        
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag );
+    
+    // Check that calls are the same type (f.ex. both are CS calls)
+    booleaParam.SetBoolean( 
+        heldCallId != KErrNotFound && connectedCallId != KErrNotFound &&
+        iStateMachine->PhoneEngineInfo()->CallType( heldCallId ) != 
+        iStateMachine->PhoneEngineInfo()->CallType( connectedCallId ));
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConfrenceOptionsFlag, 
+        &booleaParam );
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
+        {  
+        resourceId = CustomizedDialerMenuResourceIdL();         
+        }
+            
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+                CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resourceId ) );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleConnectedConferenceL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleConnectedConferenceL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedConferenceL");
+    // Update call state
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnectedConference );
+
+    TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
+    TInt callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCLIConferenceCall );
+
+    StringLoader::Load( 
+        conferenceText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( conferenceText );
+            
+    // Conference call is no longer on hold
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+    
+    BeginUiUpdateLC();
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewUpdateBubble, KConferenceCallId, &callHeaderParam );
+    
+    SetTouchPaneButtons( EPhoneConferenceAndHeldSingleButtons );
+    
+    EndUiUpdate();          
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleHeldConferenceL
+// 
+// one of the calls is on hold all the time, conference or single call
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleHeldConferenceL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldConferenceL");
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateHeldConference );
+    
+    TInt callLabelId;
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCallOnHold );
+
+    StringLoader::Load( 
+        labelText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( labelText );
+         
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag );
+
+    BeginUiUpdateLC();
+     
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewUpdateBubble, KConferenceCallId, &callHeaderParam );
+        
+    SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );    
+    EndUiUpdate();     
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedL");
+    
+    UpdateInCallCbaL();
+    
+    
+    // Display connected bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+
+    SetTouchPaneButtons( EPhoneConferenceButtons );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleHeldL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleHeldL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldL");
+    // Display hold bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateHeld );
+    
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    TInt callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCallOnHold );
+
+    StringLoader::Load( 
+        labelText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( labelText );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );      
+    
+    SetTouchPaneButtons( EPhoneConferenceButtons );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleAddedConferenceMemberL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleAddedConferenceMemberL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleAddedConferenceMemberL");
+    
+    BeginUiUpdateLC();
+        
+    // Update conference bubble
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewAddToConference );
+    
+    UpdateConferenceSecurityStatusL( aCallId );
+
+    SetTouchPaneButtons( EPhoneConferenceButtons );
+    SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );
+    
+    EndUiUpdate();
+
+    TPhoneCmdParamBoolean conferenceAndSingleFlag;
+    conferenceAndSingleFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, 
+        &conferenceAndSingleFlag );
+
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    iStateMachine->ChangeState( EPhoneStateConference );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingle::UpdateInCallCbaL() ");
+    
+    UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleIncomingL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleIncomingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndSingle::HandleIncomingL");
+    
+    BeginUiUpdateLC();  
+    
+    TPhoneCmdParamBoolean dialerParam;
+    dialerParam.SetBoolean( ETrue );
+    
+    // Get allow waiting call header param value.
+    AllowShowingOfWaitingCallHeaderL( dialerParam );
+    
+    // Close conference list
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewOpenConferenceList, &booleanParam );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCloseFSW );
+    
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+    
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam  );
+
+    // Set touch controls
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    
+    EndUiUpdate();
+
+    TPhoneCmdParamBoolean conferenceAndSingleFlag;
+    conferenceAndSingleFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, 
+        &conferenceAndSingleFlag );
+    
+    // Go to Conference And Single And Waiting state
+    UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA );
+    iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );                
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndSingle::HandleIdleL");
+    
+    // If dialler is not open then close menu bar.
+    if ( !IsNumberEntryUsedL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        }
+    
+    TPhoneCmdParamBoolean conferenceExistsForCallId;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
+        aCallId, &conferenceExistsForCallId );
+    
+    if( conferenceExistsForCallId.Boolean() )
+        {
+        // Remove conference member from conference bubble
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, 
+            aCallId );                    
+
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag );
+        }
+    else
+        {       
+        // Remove call
+        BeginUiUpdateLC(); 
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+        TPhoneCmdParamBoolean conferenceAndSingleFlag;
+        conferenceAndSingleFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, 
+            &conferenceAndSingleFlag );
+        
+        TPhoneCmdParamBoolean participantsVisibleFlag;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetConferenceListVisibleFlag,
+                &participantsVisibleFlag );
+        
+        // if participants list is visible - do not change buttons or cba
+        if( !participantsVisibleFlag.Boolean() )
+            {
+            // Go to Conference state
+            SetTouchPaneButtons( EPhoneConferenceButtons );
+            SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );  
+            
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            }
+      
+
+        EndUiUpdate();
+
+        iStateMachine->ChangeState( EPhoneStateConference );
+        }
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleConferenceIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleConferenceIdleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConferenceIdleL");
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
+    
+    TPhoneCmdParamInteger intParam;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls,
+        &intParam );
+        
+    switch( intParam.Integer() )
+        {
+        case EOneActiveCall:
+            MakeStateTransitionToSingleL();
+            break;
+            
+        case ETwoActiveCalls: // Fall through
+        default:
+            MakeStateTransitionToTwoSinglesL();
+            break;
+        }
+    }
+
+// --------------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndSingle::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if( IsNumberEntryVisibleL() )
+                {
+                HandleSendL();
+                }
+            else
+                {
+                // Number entry is below so swap the call
+                iStateMachine->SendPhoneEngineMessage(
+                    CPEPhoneModelIF::EPEMessageSwap );        
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneConference::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+
+
+// --------------------------------------------------------------
+// CPhoneConferenceAndSingle::HandleSendL 
+// --------------------------------------------------------------
+//
+void CPhoneConferenceAndSingle::HandleSendL()
+    {
+    // Get the number entry contents
+    HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( phoneNumber->Des() );
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+    
+    iViewCommandHandle->ExecuteCommand(
+        EPhoneViewGetNumberFromEntry,
+        &stringParam );
+    
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ) ;
+    
+    if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || 
+         phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
+        {  
+        // Send a manual control sequence by providing number 
+        // information with dial command
+        CallFromNumberEntryL();
+        }
+    else
+        {
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageCheckEmergencyNumber );
+        }   
+    CleanupStack::PopAndDestroy( phoneNumber );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandsingleandwaiting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,542 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneConferenceAndSingleAndWaiting class.
+*
+*/
+
+
+// INCLUDES
+#include <StringLoader.h>
+#include <cpephonemodelif.h>
+#include "cphoneconferenceandsingleandwaiting.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "tphonecmdparamglobalnote.h"
+#include "phoneui.hrh"
+#include "mphonestorage.h"
+#include "cphonecenrepproxy.h"
+#include <telephonyvariant.hrh>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneConferenceAndSingleAndWaiting::CPhoneConferenceAndSingleAndWaiting(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) :
+    CPhoneConferenceAndSingle( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::~CPhoneConferenceAndSingleAndWaiting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndSingleAndWaiting::~CPhoneConferenceAndSingleAndWaiting()
+    {
+    // Reset flag
+    if ( iViewCommandHandle )
+        {
+        TPhoneCmdParamBoolean dtmfSendFlag;
+        dtmfSendFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewSetDtmfOptionsFlag,
+            &dtmfSendFlag );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::ConstructL()
+    {
+    CPhoneConferenceAndSingle::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndSingleAndWaiting* CPhoneConferenceAndSingleAndWaiting::NewL(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneConferenceAndSingleAndWaiting* self = new( ELeave ) CPhoneConferenceAndSingleAndWaiting(
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::HandlePhoneEngineMessageL(
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingleAndWaiting::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageAddedConferenceMember:
+            HandleAddedConferenceMemberL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+
+        default:
+            CPhoneConferenceAndSingle::HandlePhoneEngineMessageL( aMessage,
+                aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneConferenceAndSingleAndWaiting::OpenMenuBarL()");
+    TInt resourceId = NULL;
+
+   // Set specific flag to view so that DTMF menu item available
+    TPhoneCmdParamBoolean dtmfSendFlag;
+    dtmfSendFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag,
+        &dtmfSendFlag );
+
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateHeld );
+    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+        &callStateData );
+    if( callStateData.CallId() == KConferenceCallId )
+        {
+        // Conference call is on hold and single is active
+        if ( IsNumberEntryVisibleL() )
+            {
+            resourceId = EPhoneCallActiveHeldConfAndWaitingMenubarWithNumberEntry;
+            }
+        else if ( IsConferenceBubbleInSelectionMode() )
+            {
+            resourceId = EPhoneConfCallParticipantsDropMenubar;
+            }
+        else
+            {
+            resourceId = EPhoneCallActiveHeldConfAndWaitingMenubar;
+            }
+        }
+    else if( callStateData.CallId() >= 0 )
+        {
+        // Single call is on hold and conference is active
+        if ( IsNumberEntryVisibleL() )
+            {
+            resourceId = EPhoneConfCallActiveHeldAndWaitingMenubarWithNumberEntry;
+            }
+        else if ( IsConferenceBubbleInSelectionMode() )
+            {
+            resourceId = EPhoneConfCallParticipantsDropMenubar;
+            }
+        else
+            {
+            resourceId = EPhoneConfCallActiveHeldAndWaitingMenubar;
+            }
+        }
+    else
+        {
+        return; // negative call id, don't do anything
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneConferenceAndSingleAndWaiting::HandleIdleL()");
+
+    // Effect is shown when dialer exist.
+    TBool effectStarted ( EFalse );
+    if ( !NeedToSendToBackgroundL() )
+        {
+        BeginTransEffectLC( ENumberEntryOpen );
+        effectStarted = ETrue;
+        }
+
+    BeginUiUpdateLC();
+    // Set touch controls
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+
+
+    TPhoneCmdParamBoolean conferenceExistsForCallId;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
+        aCallId, &conferenceExistsForCallId );
+
+    if( conferenceExistsForCallId.Boolean() )
+        {
+        // Remove conference member from conference bubble
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference,
+            aCallId );
+        }
+    else
+        {
+        // Remove call
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+        TPhoneCmdParamBoolean conferenceBubbleExists;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference,
+            &conferenceBubbleExists );
+        if( !conferenceBubbleExists.Boolean() )
+            {
+            // Idle message came for conference member.
+            MakeTransitionAccordingToActiveCallsL();
+            }
+        else
+            {
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateRinging );
+            iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+                &callStateData );
+            if( callStateData.CallId() >= 0 )
+                {
+                // We have Conference and Waiting calls left
+                MakeStateTransitionToConferenceAndWaitingL( aCallId );
+                }
+            else
+                {
+                // We have Conference and Single calls left
+                MakeStateTransitionToConferenceAndSingleL( aCallId );
+                }
+            }
+        }
+    EndUiUpdate();
+    if ( effectStarted )
+        {
+        EndTransEffect();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::HandleAddedConferenceMemberL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::HandleAddedConferenceMemberL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingleAndWaiting::HandleAddedConferenceMemberL");
+    // Update conference bubble
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewAddToConference );
+
+    UpdateConferenceSecurityStatusL( aCallId );
+
+    MakeStateTransitionToConferenceAndWaitingL( KConferenceCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndWaitingL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndWaitingL( TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndWaitingL()");
+    if ( !IsNumberEntryUsedL() )
+        {
+        // Close menu bar, if number entry isnt open.
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        }
+
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+
+    // Go to Conference And Waiting state
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndSingleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndSingleL( TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneConferenceAndSingleAndWaiting::MakeStateTransitionToConferenceAndSingleL()");
+
+    if( /*FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
+        */ 1 &&  iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        EnableCallUIL();
+        }
+
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+
+    if ( !IsNumberEntryUsedL() )
+        {
+        // Close menu bar, if number entry isnt open.
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        }
+
+    if ( IsNumberEntryUsedL() )
+        {
+        if ( NeedToSendToBackgroundL() )
+            {
+            // Return phone to the background if send to background is needed.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            }
+        else
+            {
+            // Show the number entry if it exists
+            SetNumberEntryVisibilityL(ETrue);
+            }
+        }
+    else
+        {
+        UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+        // If numberentry is not open just check NeedToSendToBackgroundL and
+        // sendbackround if needed.
+        if ( NeedToSendToBackgroundL() )
+            {
+            // Return phone to the background if send to background is needed.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+            }
+        }
+
+    SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+    SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+    // Go to conference and single state
+    // CBA updates in above if-else conditions
+    iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::HandleConferenceIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::HandleConferenceIdleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneConferenceAndSingleAndWaiting::HandleConferenceIdleL()");
+
+    BeginUiUpdateLC();
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Remove any phone dialogs if they are displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    MakeTransitionAccordingToActiveCallsL();
+
+    EndUiUpdate();
+    }
+
+// --------------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL(
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if( IsNumberEntryVisibleL() )
+                {
+                CallFromNumberEntryL();
+                }
+            else
+                {
+                // Not allowed to answer
+                SendGlobalWarningNoteL(
+                    EPhoneNoteTextCallNotAllowed );
+                }
+            break;
+
+        default:
+            // do base operation
+            CPhoneConferenceAndSingle::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::HandleKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aEventCode*/ )
+    {
+    if( EKeyDeviceF == aKeyEvent.iCode )
+        {
+        __PHONELOG( EBasic, EPhoneUIStates,
+            "CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL-deviceF" );
+        HandleHoldSwitchL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingleAndWaiting::UpdateInCallCbaL() ");
+
+    UpdateCbaL ( EPhoneCallHandlingCallWaitingCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndSingleAndWaiting::MakeTransitionAccordingToActiveCallsL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndSingleAndWaiting::MakeTransitionAccordingToActiveCallsL()
+    {
+    TPhoneCmdParamInteger activeCallCount;
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+
+    switch( activeCallCount.Integer() )
+         {
+         case ENoActiveCalls: // Go to incoming state
+            {
+            // Get Waiting call's Call Id
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateRinging );
+            iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+                &callStateData );
+
+            if ( callStateData.CallId() != KErrNotFound )
+                {
+                // Display ringing bubble
+                TPhoneCmdParamCallHeaderData callHeaderParam;
+                callHeaderParam.SetCallState( EPEStateRinging );
+
+                SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam );
+
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble,
+                    callStateData.CallId(),
+                    &callHeaderParam );
+
+                // Capture keys when there is an incoming call
+                CaptureKeysDuringCallNotificationL( ETrue );
+
+                // Go to Incoming state
+                iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
+
+                // Check if HW Keys or Call UI should be disabled
+                CheckDisableHWKeysAndCallUIL();
+
+                SetTouchPaneButtons( EPhoneIncomingCallButtons );
+                UpdateSilenceButtonDimming();
+                SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+                SetRingingTonePlaybackL( callStateData.CallId() );
+                SetToolbarDimming( ETrue );
+                SetBackButtonActive(EFalse);
+                iStateMachine->ChangeState( EPhoneStateIncoming );
+                }
+            else
+                {
+                SetDefaultFlagsL();
+                UpdateCbaL( EPhoneEmptyCBA );
+                iStateMachine->ChangeState( EPhoneStateIdle );
+                }
+            }
+            break;
+         case EOneActiveCall:
+            {
+            // Go to Single And Waiting state
+            UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+            SetTouchPaneButtons( EPhoneWaitingCallButtons );
+            SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+
+            // Check if HW Keys or Call UI should be disabled
+            CheckDisableHWKeysAndCallUIL();
+
+            iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
+            }
+            break;
+         case ETwoActiveCalls:
+            {
+            // Go to Two Singles And Waiting state
+            UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+
+            // Check if HW Keys or Call UI should be disabled
+            CheckDisableHWKeysAndCallUIL();
+
+            SetTouchPaneButtons( EPhoneWaitingCallButtons );
+            iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
+            }
+            break;
+         default:
+           // Too many active calls to handle reliable state change now.
+           // Waiting for all conference member idles
+           // This case may happen when 'End all calls' because conferenceIdle may
+           // come earlier than idle for conference member
+            break;
+         }
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandwaiting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,674 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneConferenceAndWaiting class.
+*
+*/
+
+
+// INCLUDES
+#include <StringLoader.h>
+#include <cpephonemodelif.h>
+#include <featmgr.h>
+#include <telephonyvariant.hrh>
+#include "cphoneconferenceandwaiting.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "tphonecmdparamglobalnote.h"
+#include "phoneui.hrh"
+#include "cphonecenrepproxy.h"
+#include "mphonestorage.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneConferenceAndWaiting::CPhoneConferenceAndWaiting( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneConference( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::~CPhoneConferenceAndWaiting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndWaiting::~CPhoneConferenceAndWaiting()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::ConstructL()
+    {
+    CPhoneConference::ConstructL();
+    
+    // Fetch ringing call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    iRingingCallId = callStateData.CallId();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndWaiting* CPhoneConferenceAndWaiting::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneConferenceAndWaiting* self = new( ELeave ) CPhoneConferenceAndWaiting( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndWaiting::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageDialing:
+            HandleDiallingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConferenceIdle:
+            HandleConferenceIdleL();
+            break;
+            
+        case MEngineMonitor::EPEMessageWentOneToOne:
+            HandleWentOneToOneL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageHeldConference:            
+        case MEngineMonitor::EPEMessageConnectedConference:
+            {
+            TPhoneCmdParamInteger callIdParam;
+            iViewCommandHandle->ExecuteCommandL( 
+                        EPhoneViewGetExpandedBubbleCallId, &callIdParam );
+            
+            CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
+                            aCallId );
+            
+            if ( KConferenceCallId == callIdParam.Integer() )
+                {
+                iViewCommandHandle->ExecuteCommand(EPhoneSetConferenceExpanded);
+                }
+            }
+            break;
+            
+        default:
+            CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
+                aCallId );
+            break;
+        }
+    }
+
+// --------------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneConferenceAndWaiting::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if( IsNumberEntryVisibleL() )
+                {
+                CallFromNumberEntryL();
+                }
+            else
+                {
+                // Number entry is below incoming call bubble so
+                // answer the call
+                iStateMachine->SendPhoneEngineMessage(
+                    MPEPhoneModel::EPEMessageAnswer ); 
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneConference::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aEventCode*/ )
+    {
+    if( EKeyDeviceF == aKeyEvent.iCode )
+        {
+        __PHONELOG( EBasic, EPhoneUIStates,
+            "CPhoneConferenceAndWaiting::HandleKeyMessageL-deviceF" );
+        HandleHoldSwitchL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, 
+        "CPhoneConferenceAndWaiting::OpenMenuBarL()");
+        
+    TInt resourceId( EPhoneConfAndCallWaitingMenubar );
+    
+    if( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneConfAndCallWaitingMenubarWithNumberEntry;
+        }
+    else if ( IsConferenceBubbleInSelectionMode() )
+        {
+        resourceId = EPhoneConfCallParticipantsMenubar;    
+        }        
+    
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+                CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resourceId ) );
+                
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneConferenceAndWaiting::HandleConnectedL()");
+    TPhoneCmdParamCallStateData callStateData;
+    
+    if ( iRingingCallId == KErrNotFound )
+        {
+        // Fetch ringing call's id from view
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateRinging );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+        iRingingCallId = callStateData.CallId();   
+        }
+    
+    if ( iRingingCallId == aCallId )
+        {
+        // not a member of conference call            
+        MakeStateTransitionToConferenceAndSingleL( aCallId );
+        }   
+    else
+        {
+        // member of conference call which is on hold
+        TPhoneCmdParamCallHeaderData callHeaderParam;
+        callHeaderParam.SetCallState( EPEStateConnected );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+            &callHeaderParam );
+        }   
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::MakeStateTransitionToConferenceAndSingleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::MakeStateTransitionToConferenceAndSingleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneConferenceAndWaiting::MakeStateTransitionToConferenceAndSingleL()");
+    
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
+        && iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        EnableCallUIL();
+        }
+    
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+    
+    // Effect is shown when dialer exist.
+    TBool effectStarted ( EFalse );
+    if ( !NeedToSendToBackgroundL() )
+        {
+        BeginTransEffectLC( ENumberEntryOpen );
+        effectStarted = ETrue; 
+        }
+        
+    BeginUiUpdateLC();    
+         
+    UpdateRemoteInfoDataL ( aCallId );
+    
+    if ( IsConferenceBubbleInSelectionMode() )
+        {
+        CloseSelectionListL();                
+        }
+    
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+    
+    
+    if ( IsNumberEntryUsedL() )
+        {
+        if ( NeedToSendToBackgroundL() )
+            {
+            // Return phone to the background if send to background is needed.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+            
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            }
+        else
+            {
+            // Show the number entry if it exists.
+            SetNumberEntryVisibilityL(ETrue);
+            }
+        }
+    else
+        {
+        UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+        // If numberentry is not open just check NeedToSendToBackgroundL and 
+        // sendbackround if needed.
+        }
+    SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
+    SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
+    
+    EndUiUpdate();
+    if( effectStarted )
+        {
+        EndTransEffect();    
+        }
+    // CBA updates in above if-else conditions
+    iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                     
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneConferenceAndWaiting::HandleIdleL()");
+    
+    if ( iRingingCallId == KErrNotFound )
+        {
+        // Fetch ringing call's id from view
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateRinging );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+        iRingingCallId = callStateData.CallId();   
+        }
+    
+    if( iRingingCallId == aCallId )
+        {
+        // Effect is shown when dialer exist.
+        TBool effectStarted ( EFalse );
+        if ( !NeedToSendToBackgroundL() )
+            {
+            BeginTransEffectLC( ENumberEntryOpen );
+            effectStarted = ETrue;
+            }
+        
+        BeginUiUpdateLC();    
+ 
+        // Idle message came for waiting call            
+        // Close menu bar, if it is displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+        // Remove call 
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+            
+        if ( IsNumberEntryUsedL() )
+            {
+            if ( NeedToSendToBackgroundL() )
+                {
+                // Return phone to the background if send to background is needed.
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+ 
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+                
+                UpdateCbaL( EPhoneCallHandlingInCallCBA );
+                }
+            else
+                {
+                // Show the number entry if it exists.
+                SetNumberEntryVisibilityL(ETrue);
+                }
+            }
+        else
+            {
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            // If numberentry is not open just check NeedToSendToBackgroundL and 
+            // sendbackround if needed.
+            if ( NeedToSendToBackgroundL() )
+                {
+                // Return phone to the background if send to background is needed.
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+                }
+            }
+        
+        if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+            && iStateMachine->PhoneStorage()->IsScreenLocked() )
+            {
+            EnableCallUIL();
+            }
+        
+        // Reset blocked keys list
+        iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+
+        if ( iViewCommandHandle->HandleCommandL( EPhoneViewIsConferenceInExpandedMode ) 
+                == EPhoneViewResponseSuccess )
+            {
+            SetTouchPaneButtons( EPhoneParticipantListButtons );
+            }
+        else
+            {
+            SetTouchPaneButtons( EPhoneConferenceButtons );    
+            }
+        EndUiUpdate();
+        if ( effectStarted )
+            {
+            EndTransEffect();    
+            }
+         
+        // Go to conference state
+        // CBA updates in above if-else conditions
+        iStateMachine->ChangeState( EPhoneStateConference );                    
+        }
+    else
+        {
+        // Idle message came for conference member
+        CPhoneConference::HandleIdleL( aCallId );           
+        
+        TPhoneCmdParamBoolean conferenceBubbleExists;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference,
+                                             &conferenceBubbleExists );                            
+                
+        if( !conferenceBubbleExists.Boolean() )
+            {
+            HandleConferenceIdleL();
+            }     
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleConferenceIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandleConferenceIdleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndWaiting::HandleConferenceIdleL()");
+ 
+    BeginTransEffectLC( ENumberEntryOpen );
+    BeginUiUpdateLC();
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
+    
+    TPhoneCmdParamInteger activeCallCount;
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+        
+     // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        
+    switch( activeCallCount.Integer() )
+        {
+        case ENoActiveCalls:
+            // Go to incoming state
+            {
+            // Display ringing bubble
+            TPhoneCmdParamCallHeaderData callHeaderParam;
+            callHeaderParam.SetCallState( EPEStateRinging );
+            
+            // Set Hold flag to view
+            TPhoneCmdParamBoolean holdFlag;
+            holdFlag.SetBoolean( EFalse );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+              
+            // Bring up callhandling view
+            BringIncomingToForegroundL(); 
+           
+            SetCallHeaderTextsForCallComingInL( iRingingCallId, EFalse, &callHeaderParam );
+          
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, 
+                iRingingCallId ,&callHeaderParam );
+            iCbaManager->UpdateIncomingCbaL( iRingingCallId );
+            UpdateSilenceButtonDimming();
+            
+            // Hide number entry if visible
+            if ( IsNumberEntryVisibleL() )
+                {
+                SetNumberEntryVisibilityL(EFalse);   
+                }
+            
+            // Check if HW Keys or Call UI should be disabled
+            CheckDisableHWKeysAndCallUIL();
+            
+            SetTouchPaneButtons( EPhoneIncomingCallButtons );
+            SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
+            SetRingingTonePlaybackL( iRingingCallId );          
+            SetToolbarDimming( ETrue );
+            SetBackButtonActive(EFalse);
+            iStateMachine->ChangeState( EPhoneStateIncoming );
+            break;   
+            }   
+            
+        case EOneActiveCall:
+            if ( IsNumberEntryUsedL() )
+                {
+                // Show the number entry if it exists
+                SetNumberEntryVisibilityL(ETrue);
+                }
+            // Go to waiting in single state
+            UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+            
+            // Check if HW Keys or Call UI should be disabled
+            CheckDisableHWKeysAndCallUIL();
+            
+            SetTouchPaneButtons( EPhoneWaitingCallButtons );             
+            iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
+            break;
+            
+        case ETwoActiveCalls:
+            if ( IsNumberEntryUsedL() )
+                {
+                // Show the number entry if it exists
+                SetNumberEntryVisibilityL(ETrue);
+                }
+            // Go to two singles and waiting state
+            UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+            
+            // Check if HW Keys or Call UI should be disabled
+            CheckDisableHWKeysAndCallUIL();
+            
+            SetTouchPaneButtons( EPhoneWaitingCallButtons );               
+
+            iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
+            break; 
+        default:
+          // Too many active calls to handle reliable state change now.
+          // Waiting for all conference member idles
+          // This case may happen when 'End all calls' because conferenceIdle may 
+          // come earlier than idle for conference member
+           break;            
+        }
+    EndUiUpdate();
+    EndTransEffect();  
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndWaiting::UpdateInCallCbaL() ");
+    UpdateCbaL ( EPhoneCallHandlingCallWaitingCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleDiallingL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandleDiallingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaiting::HandleDiallingL()");
+    
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC();
+    // Hide number entry if it exists
+    SetNumberEntryVisibilityL(EFalse);        
+
+    // Display call setup 
+    DisplayCallSetupL( aCallId );
+
+    SetTouchPaneButtons( EPhoneCallSetupButtons ); 
+
+    EndUiUpdate();
+    EndTransEffect();
+    
+    // Update conference and waiting and call setup softkeys
+    UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+    
+    // Go to conference and waiting and call setup state
+    iStateMachine->ChangeState( EPhoneStateConferenceAndWaitingAndCallSetup );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleWentOneToOneL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::HandleWentOneToOneL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaiting::HandleWentOneToOneL()");
+
+    BeginUiUpdateLC();
+    
+    // Update conference bubble
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewPrivateFromConference, aCallId );
+    
+    if ( iRingingCallId == KErrNotFound )
+        {
+        // Fetch ringing call's id from view
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateRinging );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+        iRingingCallId = callStateData.CallId();   
+        }
+        
+    TPhoneCmdParamBoolean conferenceBubbleExists;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, 
+        &conferenceBubbleExists );                            
+    if( conferenceBubbleExists.Boolean() && 
+        ( iRingingCallId != KErrNotFound ) )
+        {
+        // Set touch controls
+        SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
+        SetTouchPaneButtons( EPhoneWaitingCallButtons );
+        UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+        // Go to Conference And Single And Waiting state
+        iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );  
+        }
+
+    EndUiUpdate();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneConferenceAndWaiting::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneConferenceAndWaiting::HandleCommandL() ");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneCmdUpdateUiControls:
+            UpdateUiControlsL();
+            break;
+
+        default:
+            commandStatus = CPhoneConference::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaiting::UpdateUiControlsL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaiting::UpdateUiControlsL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndWaiting::UpdateUiControlsL( ) ");
+    iViewCommandHandle->ExecuteCommand(EPhoneSetConferenceExpanded);
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandwaitingandcallsetup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,497 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneConferenceAndWaitingAndCallSetup class.
+*
+*/
+
+
+// INCLUDES
+#include <StringLoader.h>
+#include <cpephonemodelif.h>
+#include "cphoneconferenceandwaitingandcallsetup.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "tphonecmdparamglobalnote.h"
+#include "phoneui.hrh"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneConferenceAndWaitingAndCallSetup::CPhoneConferenceAndWaitingAndCallSetup( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneConference( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::~CPhoneConferenceAndWaitingAndCallSetup()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndWaitingAndCallSetup::~CPhoneConferenceAndWaitingAndCallSetup()
+    {
+    // Reset flag
+    if ( iViewCommandHandle )
+        {
+        TPhoneCmdParamBoolean dtmfSendFlag;
+        dtmfSendFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewSetDtmfOptionsFlag, 
+            &dtmfSendFlag );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::ConstructL()
+    {
+    CPhoneConference::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneConferenceAndWaitingAndCallSetup* CPhoneConferenceAndWaitingAndCallSetup::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaitingAndCallSetup::NewL");
+    CPhoneConferenceAndWaitingAndCallSetup* self = 
+        new( ELeave ) CPhoneConferenceAndWaitingAndCallSetup( 
+            aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneConferenceAndWaitingAndCallSetup::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnecting:
+            iAlerting = ETrue;
+            HandleConnectingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageConferenceIdle:
+            HandleConferenceIdleL();
+            break;
+
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+
+        default:
+            CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
+                aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneConferenceAndWaitingAndCallSetup::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaitingAndCallSetup::HandleCommandL()");
+    TBool commandStatus = ETrue;
+    
+    switch( aCommand )
+        {   
+        case EPhoneDtmfDialerCancel:
+            {
+            CloseDTMFEditorL();
+            }
+            break;    
+    
+        default:
+            commandStatus = CPhoneConference::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// --------------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaitingAndCallSetup::HandleKeyMessageL");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if( IsNumberEntryVisibleL() )
+                 {
+                CallFromNumberEntryL();                             
+                 }
+             else
+                 {
+                // Number entry is behind waiting call bubble.
+                // We can't answer to call in this state so display
+                // Not allowed -note.
+                SendGlobalErrorNoteL( 
+                    EPhoneNoteTextNotAllowed );                                             
+                 }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneConference::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaitingAndCallSetup::OpenMenuBarL");
+
+    // Set specific flag to view so that DTMF menu item available
+    TPhoneCmdParamBoolean dtmfSendFlag;
+    dtmfSendFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, 
+        &dtmfSendFlag );
+   
+    TInt resourceId ( EPhoneAlertingWaitingAndConfHeldCallMenuBar );
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = 
+            EPhoneAlertingWaitingAndConfHeldCallMenuBarWithNumberEntry;
+        }
+    else if ( IsConferenceBubbleInSelectionMode() )
+        {
+        resourceId = EPhoneConfCallParticipantsDropMenubar;    
+        }         
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+                CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resourceId ) );    
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneConferenceAndWaitingAndCallSetup::SetCallSetupCbaL() ");    
+    
+    if ( iAlerting )
+        {
+        UpdateCbaL ( EPhoneCallHandlingCallWaitingCBA );
+        }
+    else
+        {
+        UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::HandleConnectingL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::HandleConnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaitingAndCallSetup::HandleConnectingL");
+    
+    BeginUiUpdateLC();
+    
+    UpdateRemoteInfoDataL ( aCallId );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+    
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+        
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    
+    EndUiUpdate();
+        
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );    
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaitingAndCallSetup::HandleConnectedL");
+    
+    BeginUiUpdateLC();
+    
+    UpdateRemoteInfoDataL ( aCallId );
+    
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+    
+    // Capturing keys and number entry must be removed because some
+    // networks jump over connecting state directly to connected state.
+    CaptureKeysDuringCallNotificationL( EFalse );
+    
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+        
+    HandleColpNoteL( aCallId );
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );    
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
+    EndUiUpdate();
+    
+    // Go to Conference And Single And Waiting state
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
+    iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );                
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::UpdateConnectingCbaL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::UpdateConnectingCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneConferenceAndCallSetup::UpdateInCallCbaL() ");
+        
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    } 
+    
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL");
+    
+    BeginTransEffectLC( ENumberEntryOpen );
+    BeginUiUpdateLC();
+        
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
+        
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);
+        }
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+        &callStateData );
+ 
+    if( callStateData.CallId() > KErrNotFound )
+        {        
+        // Go to Single And Waiting And Call Setup state
+        SetTouchPaneButtons( EPhoneCallSetupButtons );        
+        // No need update cbas
+        iStateMachine->ChangeState( EPhoneStateSingleAndCallSetupAndWaiting );
+        }
+    else 
+        {
+        callStateData.SetCallState( EPEStateHeld );
+        iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+            &callStateData );
+        if( callStateData.CallId() > KErrNotFound )
+            {
+            // Go to Single And Waiting And Call Setup state
+            SetTouchPaneButtons( EPhoneCallSetupButtons ); 
+            // No need update cbas         
+            iStateMachine->ChangeState( EPhoneStateSingleAndCallSetupAndWaiting );
+            }
+        else
+            {
+            // Reset Hold flag to view
+            TPhoneCmdParamBoolean holdFlag;
+            holdFlag.SetBoolean( EFalse );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
+
+            // Go to Call Setup And Waiting state
+            SetTouchPaneButtons( EPhoneCallSetupButtons ); 
+
+            SetToolbarDimming( ETrue );
+
+            // No need update cbas            
+            iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
+            }
+        }
+    EndUiUpdate();
+    EndTransEffect();               
+    }
+
+// -----------------------------------------------------------
+// CPhoneConferenceAndWaitingAndCallSetup::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneConferenceAndWaitingAndCallSetup::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+         "CPhoneConferenceAndWaitingAndCallSetup::HandleIdleL");        
+
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    TPhoneCmdParamBoolean conferenceExistsForCallId;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
+        aCallId, &conferenceExistsForCallId );
+    
+    if( conferenceExistsForCallId.Boolean() )
+        {
+        // Remove conference member from conference bubble
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, 
+            aCallId );            
+        return;
+        }
+    else
+        {
+        // Remove call 
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+        TPhoneCmdParamBoolean conferenceBubbleExists;
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, 
+            &conferenceBubbleExists );                            
+        if( !conferenceBubbleExists.Boolean() )
+            {
+            // Idle message came for last conference member.
+            // Don't do anything, wait for ConferenceIdle message
+            }            
+        else
+            {
+            BeginTransEffectLC( ENumberEntryOpen );
+            BeginUiUpdateLC();
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateRinging );
+            iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+                &callStateData );
+            if( callStateData.CallId() > KErrNotFound )
+                {
+                CheckIfRestoreNEContentAfterDtmfDialer();
+                
+                if ( IsNumberEntryUsedL() )
+                    {
+                    // Show the number entry if callsetup failed with number busy
+                    // etc reason.
+                    SetNumberEntryVisibilityL(ETrue);
+                    }
+                
+                // Go to Conference And Waiting state
+                SetTouchPaneButtons( EPhoneWaitingCallButtons );
+                UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );                 
+                iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );
+                }
+            else
+                {
+                // Go to Conference And Call Setup state
+                SetTouchPaneButtons( EPhoneCallSetupButtons );
+                UpdateCbaL( EPhoneCallHandlingInCallCBA );                  
+                iStateMachine->ChangeState( EPhoneStateConferenceAndCallSetup );
+                }
+            EndUiUpdate();
+            EndTransEffect();                
+            }
+        }
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneemergency.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,935 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneEmergency class.
+*
+*/
+
+
+// INCLUDES
+#include <eikmenub.h>
+#include <StringLoader.h>
+#include <ccpdefs.h>
+#include <featmgr.h>
+#include <cpephonemodelif.h>
+#include <mpeengineinfo.h>
+#include <AknUtils.h>
+
+#include "cphoneemergency.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamemergencycallheaderdata.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "mphonestatemachine.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "phonerssbase.h"
+#include "cphonemainresourceresolver.h"
+#include "phonelogger.h"
+#include "cphonepubsubproxy.h"
+#include "cphonekeys.h"
+#include "tphonecmdparamaudiooutput.h"
+#include "phoneresourceids.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneEmergency::CPhoneEmergency(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) :
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ),
+    iCallSetup( ETrue )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::~CPhoneEmergency()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneEmergency::~CPhoneEmergency()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::ConstructL()");
+    CPhoneGsmInCall::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneEmergency* CPhoneEmergency::NewL(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneEmergency* self = new (ELeave)
+        CPhoneEmergency( aStateMachine, aViewCommandHandle, aPhoneCustomization );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates,
+        "CPhoneEmergency::HandleNumberEntryClearedL()");
+    UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandlePhoneEngineMessageL(
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates,
+        "CPhoneEmergency::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            iCallSetup = ETrue;
+            HandleIdleL( aCallId );
+            iConnected = EFalse;
+            break;
+
+        case MEngineMonitor::EPEMessageDialing:
+            HandleDialingL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageConnected:
+            if( iCallSetup )
+                {
+                HandleConnectingL( aCallId );
+                iCallSetup = EFalse;
+                }
+            HandleConnectedL( aCallId );
+            iConnected = ETrue;
+            break;
+
+        case MEngineMonitor::EPEMessageConnecting:
+            HandleConnectingL( aCallId );
+            iCallSetup = EFalse;
+            break;
+
+        case MEngineMonitor::EPEMessageDisconnecting:
+            // Explicitly override this handling from CPhoneStateInCall
+            // where DTMF sending is cancelled and that causes emergency
+            // progress bar destroyed
+            CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageAudioOutputChanged:
+            if ( iCallSetup )
+                {
+                HandleAudioOutputChangedL();
+                }
+            else
+                {
+                CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+                }
+            break;
+
+        case MEngineMonitor::EPEMessageStoppedDTMF:      // fall through
+        case MEngineMonitor::EPEMessageSentDTMF:         // fall through
+        case MEngineMonitor::EPEMessageDTMFSendingAborted:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing )
+                {
+                TPhoneCmdParamBoolean isProgressNoteVisible;
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsProgressNoteVisible,
+                      &isProgressNoteVisible );
+
+                if ( !isProgressNoteVisible.Boolean() )
+                    {
+                    UpdateSetupCbaL();
+                    }
+                 }
+            break;
+
+        default:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL(
+                aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleIdleL() ");
+
+    // Re-enable global notes, this enables secui (if needed) to come on top
+    // if call creation was rejected by user
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        CloseDTMFEditorL();
+        }
+
+    if ( aCallId == KEmergencyCallId )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+        // Remove emergency connecting note if still there
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+        // Close menu bar, if it is displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+        const TBool isSimStateNotPresentWithSecurityMode = IsSimStateNotPresentWithSecurityModeEnabled();
+
+        // Sim IS not ok when making emergency call from Pin query, no note
+        if ( (!IsSimOk() && !iStartupInterrupted) || isSimStateNotPresentWithSecurityMode )
+            {
+            StartShowSecurityNoteL();
+            }
+        else
+            {
+            if ( !TopAppIsDisplayedL() || iDeviceLockOn  )
+                {
+                // Continue displaying current app but set up the
+                // idle screen in the background
+                SetupIdleScreenInBackgroundL();
+
+                // Update toolbar
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
+                }
+
+            else if ( iOnScreenDialer && IsNumberEntryContentStored() )
+                {
+                if ( !IsNumberEntryUsedL() )
+                    {
+                    CreateNumberEntryL();
+                    }
+                // Restore the number entry content from cache
+                RestoreNumberEntryContentL();
+                SetNumberEntryVisibilityL(ETrue);
+                }
+
+            else if ( IsNumberEntryUsedL() )
+                {
+                // Show the number entry if it exists
+                SetNumberEntryVisibilityL(ETrue);
+                // Update toolbar
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
+                }
+
+            else
+                {
+                 // Display idle screen
+                DisplayIdleScreenL();
+                }
+
+            // Display call termination note, if necessary
+            if ( iConnected )
+                {
+                DisplayCallTerminationNoteL();
+                }
+            }
+
+        // Go to emergency idle state or to startup state if emergency call
+        // initiated from PIN query
+        if ( iStartupInterrupted )
+            {
+            iStartupInterrupted = EFalse;
+            iStateMachine->ChangeState( EPhoneStateStartup );
+            }
+        else
+            {
+            if ( !isSimStateNotPresentWithSecurityMode )
+                {
+                SetDefaultFlagsL();
+                }
+            
+            // As long as security note is not shown with feature flag 
+            // KFeatureIdFfSimlessOfflineSupport undef it is ok to do SetupIdleScreenInBackgroundL.
+            if ( ( !IsNumberEntryUsedL() ) && 
+                 !( IsSimStateNotPresentWithSecurityModeEnabled() && 
+                    !FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) )
+                {
+                UpdateCbaL( EPhoneEmptyCBA );
+                
+                TPhoneCmdParamBoolean securityMode;
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &securityMode );
+                if ( !securityMode.Boolean() )
+                    {
+                    // Setup idle as next active app.
+                    SetupIdleScreenInBackgroundL();
+                    }
+                }
+            
+            iStateMachine->ChangeState( EPhoneStateIdle );
+            }
+        }
+    else
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleDialingL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandleDialingL( TInt aCallId )
+    {
+    // Discard all messages related to other calls than the emergency call
+    // We trust that the ISA call server has taken care of them. However,
+    // there could be a race condition between returning to Normal
+    // mode (receiving a network registration status message from PE)
+    // and receiving an EPEMessageDialling message. This can occur
+    // because PE messages are processed asynchronously.
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleDialingL() ");
+
+    if ( aCallId == KPEEmergencyCallId )
+        {
+        if ( !IsSimOk() )
+            {
+            TPhoneCmdParamBoolean visibleMode;
+            visibleMode.SetBoolean( ETrue );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetStatusPaneVisible, &visibleMode );
+            }
+
+        iDeviceLockOn = IsAutoLockOn();
+
+        // Close menu bar, if it is displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+        // Disable global notes when the phone is dialling
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+
+        // Capture keys when the phone is dialling
+        CaptureKeysDuringCallNotificationL( ETrue );
+
+        // Indicate that the Phone needs to be sent to the background if
+        // an application other than the top application is in the foreground
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetNeedToSendToBackgroundStatus,
+            &booleanParam );
+
+        // Bring Phone app in the foreground
+        TPhoneCmdParamInteger uidParam;
+        uidParam.SetInteger( KUidPhoneApplication.iUid );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+            &uidParam );
+
+        // Set Phone as the top application
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+            &uidParam );
+
+        // Hide the number entry if it is visible
+        if ( IsNumberEntryUsedL() )
+            {
+            // Remove number entry
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+            }
+
+        // Remove exit emergency mode query, if it exists
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
+
+        // Enable the volume display
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
+        
+        BeginUiUpdateLC();
+        
+        TPhoneCmdParamEmergencyCallHeaderData emergencyHeaderParam;
+        // Set call header
+        TBuf<KPhoneCallHeaderLabelMaxLength> headerText( KNullDesC );
+        StringLoader::Load(
+            headerText,
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID(
+                EPhoneEmergencyCallHeader ),
+            CCoeEnv::Static() );
+        emergencyHeaderParam.SetHeaderText( headerText );
+
+        // Set call header ciphering status
+        emergencyHeaderParam.SetCiphering(
+            iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) );
+        emergencyHeaderParam.SetCipheringIndicatorAllowed(
+            iStateMachine->PhoneEngineInfo()->SecureSpecified() );
+
+        // Notify the view
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewCreateEmergencyCallHeader,
+            aCallId,
+            &emergencyHeaderParam );
+
+        TPhoneCmdParamCallHeaderData headerParam;
+        headerParam.SetCallState( EPEStateDialing );
+        
+        StringLoader::Load(
+            headerText,
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID(
+                    EPhoneAttemptingEmergencyText ),
+            CCoeEnv::Static() );
+        headerParam.SetLabelText( headerText );
+        
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewUpdateBubble,
+            aCallId,
+            &headerParam );
+
+        SetTouchPaneButtons( EPhoneEmergencyCallButtons );
+        SetBackButtonActive(EFalse);
+        
+        EndUiUpdate();        
+
+        // ShowNoteL( EPhoneEmergencyConnectWaitNote );
+        UpdateSetupCbaL();
+        }
+    }
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleConnectingL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandleConnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectingL() ");
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
+          &globalNotifierParam );
+
+    if(  TouchCallHandlingSupported() )
+        {
+        if ( !IsSimStateNotPresentWithSecurityModeEnabled() )
+            {
+            // Stop capturing keys
+            CaptureKeysDuringCallNotificationL( EFalse );
+            }
+        }
+    else if ( !iDeviceLockOn && SimState() == EPESimUsable )
+        {
+        // Stop capturing keys
+        CaptureKeysDuringCallNotificationL( EFalse );
+        }
+
+    // Keep Phone in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+
+    // Remove emergency connecting note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+
+    TPhoneCmdParamCallHeaderData headerParam;
+    headerParam.SetCallState( EPEStateConnecting );
+    // Notify the view
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewUpdateBubble,
+        aCallId,
+        &headerParam );
+
+    SetToolbarButtonLoudspeakerEnabled();
+
+    UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleConnectedL() ");
+
+    BeginUiUpdateLC();
+
+    TPhoneCmdParamCallHeaderData emergencyHeaderParam;
+    emergencyHeaderParam.SetCallState( EPEStateConnected );
+    // Notify the view
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewUpdateBubble,
+        aCallId,
+        &emergencyHeaderParam );
+
+    SetBackButtonActive(ETrue);
+
+    EndUiUpdate();
+    SetToolbarDimming( ETrue );
+    UpdateInCallCbaL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::OpenMenuBarL() ");
+    TInt resourceId;
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneCallHandlingEmergencyMenubarWithNumberEntry;
+        }
+    else
+        {
+        resourceId = EPhoneCallHandlingEmergencyMenubar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
+        &integerParam );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneEmergency::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateInCallCbaL() ");
+    TInt resourceId = EPhoneCallHandlingEmergencyCBA;
+    iCbaManager->SetCbaL( resourceId );
+    }
+
+// --------------------------------------------------------------
+// CPhoneEmergency::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneEmergency::HandleKeyMessageL(
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyMessageL()");
+
+    switch ( aCode )
+        {
+        // end-key
+        case EKeyNo:
+            // handle end key
+            if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+                {
+                CloseDTMFEditorL();
+                }
+            DisconnectEmergencyCallL();
+            break;
+
+        // send-key
+        case EKeyYes:
+             if( iOnScreenDialer && IsNumberEntryVisibleL() )
+                {
+                TPhoneCmdParamInteger numberEntryCountParam;
+                    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
+                            &numberEntryCountParam );
+                    TInt neLength( numberEntryCountParam.Integer() );
+                if ( neLength )
+                    {
+                    // Show not allowed note
+                    SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+                    }
+                else
+                    {
+                    // Logs to open
+                    CallFromNumberEntryL();
+                    }
+                }
+            else
+                {
+                // Show not allowed note
+                SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+                }
+            break;
+
+        default:
+            {
+            if ( TouchCallHandlingSupported() )
+                {
+                CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); 
+                }
+            else if ( !iDeviceLockOn && SimState() == EPESimUsable )   
+                {
+                // do base operation
+                CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
+                }
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneEmergency::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleCommandL()");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneInCallCmdDtmfManualQuery:
+            if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing )
+                {
+                // Remove emergency connecting note
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+                }
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+
+        case EPhoneDtmfDialerExit:      // fall through
+        case EPhoneDtmfDialerCancel:
+             {
+             if ( iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) == EPEStateDialing )
+                 {
+                 CloseDTMFEditorL();
+
+                 TPhoneCmdParamBoolean isProgressNoteVisible;
+                 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsProgressNoteVisible,
+                        &isProgressNoteVisible );
+
+                 if ( !isProgressNoteVisible.Boolean() )
+                     {
+                     UpdateSetupCbaL();
+                     }
+                 }
+             else
+                 {
+                 commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+                 }
+             }
+             break;
+
+        case EPhoneInCallCmdEndThisOutgoingCall:
+        case EPhoneInCallCmdEndThisActiveCall:
+            DisconnectEmergencyCallL();
+            break;
+
+        default:
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::DisconnectEmergencyCallL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::DisconnectEmergencyCallL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates,
+        "CPhoneEmergency::DisconnectEmergencyCallL()");
+    // Release the call
+    iStateMachine->SetCallId(
+        KEmergencyCallId );
+    iStateMachine->SendPhoneEngineMessage(
+        CPEPhoneModelIF::EPEMessageRelease );
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleErrorL
+// Emergency handling for HandleError message
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandleErrorL( const TPEErrorInfo& aErrorInfo )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleError()");
+
+    switch( aErrorInfo.iErrorCode )
+        {
+        case ECCPErrorCCNoRouteToDestination:
+        case ECCPErrorUnacceptableChannel:
+        case ECCPErrorCCDestinationOutOfOrder:
+        case ECCPErrorNetworkOutOfOrder:
+        case ECCPErrorAccessInformationDiscarded:
+        case ECCPErrorCCResourceNotAvailable:
+        case ECCPErrorQualityOfServiceNotAvailable:
+        case ECCPErrorInvalidCallReferenceValue:
+        case ECCPErrorBadRequest:
+        case ECCPErrorConnectionError:
+        case ECCPErrorCCIncompatibleMessageInProtocolState:
+        case ECCPErrorCCNoChannelAvailable:
+        case ECCPErrorNetworkBusy:
+        case ECCPEmergencyFailed:
+            SendGlobalErrorNoteL( EPhoneNoteNoNetworkCallEmergency );
+            break;
+
+       default:
+        __PHONELOG1(
+            EOnlyFatal,
+            EPhoneUIStates,
+            "PHONEUI_ERROR: CPhoneEmergency::HandleError - Error send to PhoneState (err=%d)",
+            aErrorInfo.iErrorCode);
+            CPhoneState::HandleErrorL( aErrorInfo );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::HandleKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::HandleKeyEventL( ) ");
+    
+    if ( TouchCallHandlingSupported() )
+        {
+        CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode );
+        }
+    else
+        {
+         if ( iDeviceLockOn && CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) )
+            {
+            // Send the key event to the phone engine
+            SendKeyEventL( aKeyEvent, aEventCode );
+            }
+        else
+            {
+            // Handle numeric keys when key events are received in idle state
+            CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode );
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::SendKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::SendKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::SendKeyEventL( ) ");
+    switch( aEventCode )
+        {
+        // EEventKey
+        case EEventKey:
+            {
+            // Convert key code to western.
+            TBuf<1> buffer; // one character
+            buffer.Append( aKeyEvent.iCode );
+            __PHONELOG1( EBasic, EPhoneControl,
+                "CPhoneEmergency::SendKeyEventL(%S)",
+                &buffer );
+            AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern );
+            __PHONELOG1( EBasic, EPhoneControl,
+                "CPhoneEmergency::SendKeyEventL(%S)",
+                &buffer );
+            TLex code( buffer );
+            // Save the key code
+            iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() );
+            // Plays a DTMF tone if active call
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessagePlayDTMF );
+            }
+            break;
+        // EEventKeyUp
+        case EEventKeyUp:
+            // Send a key up event for the last key code sent to
+            // the phone engine
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageEndDTMF );
+            break;
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneEmergency::HandleAudioOutputChangedL
+// for setup
+// -----------------------------------------------------------------------------
+//
+void CPhoneEmergency::HandleAudioOutputChangedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::HandleAudioOutputChangedL( ) ");
+
+    // Audio Output
+    TPhoneCmdParamAudioOutput outputParam;
+
+    // Output
+    const TPEAudioOutput audioOutput =
+        iStateMachine->PhoneEngineInfo()->AudioOutput();
+
+    UpdateSetupCbaL();
+
+    // view update
+    outputParam.SetAudioOutput( audioOutput );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewActivateAudioPathUIChanges,
+        &outputParam );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneEmergency::SetStartupInterrupted
+// -----------------------------------------------------------------------------
+//
+void CPhoneEmergency::SetStartupInterrupted( const TBool aStartupInterrupted )
+    {
+    iStartupInterrupted = aStartupInterrupted;
+    }
+
+// -----------------------------------------------------------
+// CPhoneEmergency::UpdateSetupCbaL
+// -----------------------------------------------------------
+//
+void CPhoneEmergency::UpdateSetupCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneEmergency::UpdateSetupCbaL() ");
+   TInt resourceId = EPhoneCallHandlingEmergencyCBA;        
+   iCbaManager->SetCbaL( resourceId );
+    }
+
+// ---------------------------------------------------------
+// CPhoneEmergency::HandleCreateNumberEntryL
+//
+// ---------------------------------------------------------
+//
+void CPhoneEmergency::HandleCreateNumberEntryL( const TKeyEvent& aKeyEvent,
+        TEventCode aEventCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneEmergency::HandleCreateNumberEntryL() ");
+    if ( !iCallSetup && !iStartupInterrupted )
+        {
+        CPhoneGsmInCall::HandleCreateNumberEntryL( aKeyEvent, aEventCode );
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneEmergency::HandleRemConCommandL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneEmergency::HandleRemConCommandL(
+    TRemConCoreApiOperationId aOperationId,
+    TRemConCoreApiButtonAction aButtonAct )
+    {
+    TBool handled = EFalse;
+
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::MrccatoCommand() ");
+    
+    switch ( aOperationId )
+        {
+         case ERemConCoreApiMute:
+             __PHONELOG( EBasic, EPhoneControl, "CPhoneEmergency::MrccatoCommand emerg. call no muting" );
+             // Not Allowed
+             break;
+         default:
+             handled = CPhoneState::HandleRemConCommandL( aOperationId, aButtonAct );
+             break;
+        }
+    return handled;
+    }
+
+// --------------------------------------------------------------
+// CPhoneEmergency::TouchCallHandlingSupported
+// --------------------------------------------------------------
+//
+TBool CPhoneEmergency::TouchCallHandlingSupported () const
+    {
+    if ( FeatureManager::FeatureSupported ( KFeatureIdTouchCallHandling ) )
+        {
+        return ETrue;
+        }
+    else 
+        {
+        return EFalse;
+        }
+    }
+
+// --------------------------------------------------------------
+// CPhoneEmergency::UseEmergencyNoIhfCBA
+// --------------------------------------------------------------
+//
+TBool CPhoneEmergency::UseEmergencyNoIhfCBA( const TPEAudioOutput& aAudioOutput ) const
+    {
+    if ( !( TouchCallHandlingSupported() ) 
+        && ( ( aAudioOutput == EPEWiredAudioAccessory ) || ( IsSwivelClosed() ) ) )
+        {
+        return ETrue;
+        }
+    else 
+        {
+        return EFalse;
+        }
+    }
+
+// --------------------------------------------------------------
+// CPhoneEmergency::UseHandsetEmergencyCBA
+// --------------------------------------------------------------
+//
+TBool CPhoneEmergency::UseHandsetEmergencyCBA( const TPEAudioOutput& aAudioOutput ) const
+{
+    if ( !( TouchCallHandlingSupported() ) 
+        && ( ( aAudioOutput == EPELoudspeaker ) || ( aAudioOutput == EPEBTAudioAccessory ) ) )
+        {
+        return ETrue;
+        }
+    else 
+        {
+        return EFalse;
+        }
+}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneerrormessageshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,581 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneErrorMessagesHandler class.
+*
+*/
+
+
+// INCLUDES
+#include <mpeengineinfo.h>
+#include <telephonydomainpskeys.h>
+#include <UikonInternalPSKeys.h>
+#include <ccpdefs.h>
+
+#include "phoneui.pan"
+#include "phonerssbase.h"
+#include "cphoneerrormessageshandler.h"
+#include "cphonemainerrormessageshandler.h"
+#include "phonelogger.h"
+#include "cphonestatehandle.h"
+#include "mphoneviewcommandhandle.h"
+#include "cphonepubsubproxy.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamnote.h"
+#include "cphonemainresourceresolver.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneErrorMessagesHandler::CPhoneErrorMessagesHandler(
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneStateMachine* aStateMachine ) :
+    iViewCommandHandle( aViewCommandHandle),
+    iStateMachine (aStateMachine )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneErrorMessagesHandler::~CPhoneErrorMessagesHandler()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+EXPORT_C CPhoneErrorMessagesHandler::~CPhoneErrorMessagesHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneErrorMessagesHandler::ConstructL()
+    {    
+    CPhoneMainErrorMessagesHandler::Instance()->RegisterErrorMessagesHandler( this );
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneErrorMessagesHandler* CPhoneErrorMessagesHandler::NewL( 
+                    MPhoneViewCommandHandle* aViewCommandHandle,
+                    MPhoneStateMachine* aStateMachine )
+    {
+    CPhoneErrorMessagesHandler* self = 
+        new( ELeave ) CPhoneErrorMessagesHandler( 
+                    aViewCommandHandle,
+                    aStateMachine );
+    CleanupStack::PushL( self );    
+    self->ConstructL();
+    CleanupStack::Pop( self );    
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CPhoneErrorMessagesHandler::SendGlobalInfoNoteL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneErrorMessagesHandler::SendGlobalInfoNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, 
+        "CPhoneErrorMessagesHandler::SendGlobalInfoNoteL()" );
+
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    if ( CPhonePubSubProxy::Instance()->Value( 
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,    &globalNotifierParam );
+            
+        TPhoneCmdParamGlobalNote globalNoteParam;
+      
+        globalNoteParam.SetType( EAknGlobalInformationNote );
+        globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( EAvkonSIDInformationTone );
+
+        iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewShowGlobalNote, &globalNoteParam );    
+        }
+  
+    }
+ 
+// ---------------------------------------------------------
+//  CPhoneErrorMessagesHandler::SendGlobalErrorNoteL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneErrorMessagesHandler::SendGlobalErrorNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, 
+        "CPhoneErrorMessagesHandler::SendGlobalErrorNoteL()" );
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+
+    if ( CPhonePubSubProxy::Instance()->Value( 
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( 
+             EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+            
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetType( EAknGlobalErrorNote );
+        globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
+
+        iViewCommandHandle->ExecuteCommandL(  
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+  
+    }
+
+// ---------------------------------------------------------
+//  CPhoneErrorMessagesHandler::SendGlobalWarningNoteL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneErrorMessagesHandler::SendGlobalWarningNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneErrorMessagesHandler::SendGlobalWarningNoteL( ) ");
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+
+    if ( CPhonePubSubProxy::Instance()->Value( 
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 || 
+            SimState() == EPESimReadable )
+        {    
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL(  
+            EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+            
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetType( EAknGlobalWarningNote );
+        globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( EAvkonSIDWarningTone );
+
+        iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneErrorMessagesHandler::SimState()
+// ---------------------------------------------------------
+//
+TPESimState CPhoneErrorMessagesHandler::SimState() const
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneErrorMessagesHandler::SimState()");
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+        Panic( EPhoneCtrlInvariant ) );
+    return iStateMachine->PhoneEngineInfo()->SimState();
+    }
+            
+// -----------------------------------------------------------
+// CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL( const TPEErrorInfo& aErrorInfo )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL()");
+    
+    __PHONELOG1( EBasic, EPhoneControl,
+            "PhoneUIControl: CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL - aErrorInfo.iErrorCode =%d ",
+            aErrorInfo.iErrorCode);
+
+    switch( aErrorInfo.iErrorCode )
+        {
+        case ECCPErrorRejected:
+        case ECCPRequestFailure:
+            SendGlobalErrorNoteL( EPhoneNoteTextRequestRejected );    
+            break;
+            
+        case ECCPErrorInvalidPhoneNumber:
+            SendGlobalErrorNoteL( EPhoneInvalidPhoneNumber );
+            break;
+
+        case ECCPErrorInvalidURI:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneInvalidPhoneNumber );
+                }
+            else
+                {
+                SendGlobalErrorNoteL( EPhoneInvalidPhoneNumber );
+                }
+            break;
+
+        case ECCPErrorServiceSettingError:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNotePhoneOutOf3GCoverage );
+                }
+            else
+                {
+                SendGlobalInfoNoteL( EPhoneNoteTextCheckNetworkservices );
+                }
+            break;
+
+        case ECCPErrorNotAllowedInOfflineMode:
+        case ECCPErrorAuthenticationFailed:
+            SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly );
+            break;
+
+        case ECCPErrorNotReady:     
+        case ECCPErrorGeneral:
+        case ECCPErrorNotAllowed:
+        case ECCPErrorNotFound:
+        case ECCPErrorTimedOut:
+        case ECCPErrorAccessDenied:        
+            SendGlobalWarningNoteL( EPhoneNoteTextNotAllowed );                    
+            break;
+            
+        case ECCPErrorAlreadyInUse:
+            SendGlobalErrorNoteL( EPhoneNoteTextCallNotAllowed );                    
+            break;
+
+        case ECCPErrorInvalidFDN:
+            SendGlobalWarningNoteL( EPhoneNoteTextCallNotAllowedFDN );                    
+            break;
+            
+        case ECCPErrorNotReached:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNumberNotInUse );
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneNumberNotInUse );    
+                }
+                
+            break;
+
+        case ECCPErrorUnacceptableChannel:
+        case ECCPErrorCCDestinationOutOfOrder:
+        case ECCPErrorAccessInformationDiscarded:
+        case ECCPErrorQualityOfServiceNotAvailable:        
+        case ECCPErrorInvalidCallReferenceValue:
+        case ECCPErrorCCInvalidTransitNetworkSelection:        
+        case ECCPErrorConnectionError:        
+        case ECCPErrorCCIncompatibleMessageInCallState:        
+            if( IsVideoCall( aErrorInfo.iCallId ) &&
+                iStateMachine->PhoneEngineInfo()->ProfileId() != EProfileOffLineId )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteVideoCallNotPossible );
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneErrorInConnection );
+                }
+            break;
+            
+        case ECCPErrorCCResourceNotAvailable:
+            SendGlobalWarningNoteL( EPhoneErrorInConnection );
+            break;
+                        
+        case ECCPErrorNumberBarred:
+            SendGlobalWarningNoteL( EPhoneNumberBarred );
+            break;
+            
+        case ECCPErrorCCUserAlertingNoAnswer:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoAnswer );
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneNoAnswer );   
+                }           
+            break;
+            
+        case KErrPhoneEngineNoWcdmaNetwork:  // Videotel special case. Refactoring PE/CSPlugin needed
+        case ECCPErrorVideoCallNotSupportedByNetwork:
+            SendGlobalInfoNoteL( EPhoneInformationNoNetworkSupportForVideoCallNote );
+            break;
+                
+        case KErrPhoneEngineVideoCallNotAllowedDuringRestore: // Videotel special case. Refactoring PE/CSPlugin needed
+        case ECCPErrorVideoCallNotAllowedDuringRestore:
+            SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
+            break;
+ 
+        case KErrPhoneEngineVideoCallSetupFailed: // Videotel special case. Refactoring PE/CSPlugin needed
+        case ECCPErrorVideoCallSetupFailed:
+            SendGlobalInfoNoteL( EPhoneNoteVideoCallSetupFailed );
+            break;
+
+        case ECCPErrorNetworkBusy:
+            SendGlobalWarningNoteL( EPhoneNetworkBusy );
+            break;
+            
+        case ECCPErrorNoService:
+            SendGlobalWarningNoteL( EPhoneNoteNoService );   
+            break;
+            
+        case ECCPErrorBusy:
+            SendGlobalWarningNoteL( EPhoneNumberBusy );   
+            break;
+            
+        case ECCPErrorUserNotInCug:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNumberNotInCUG );
+                }
+             else
+                {
+                SendGlobalWarningNoteL( EPhoneNumberNotInCUG );   
+                }
+            break;
+            
+        case ECCPErrorCCNoRouteToDestination:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNotePhoneOutOf3GCoverage );
+                }
+             break;
+            
+        case ECCPErrorCCNormalCallClearing:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue16 );
+                }
+            break;
+                    
+        case ECCPErrorCCUserNotResponding:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue18 ); 
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneNoAnswer );
+                }
+            break;
+            
+        case ECCPErrorCCCallRejected:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCalledNumberHasBarredIncomingCalls );
+                }
+            break;
+            
+        case ECCPErrorMovedPermanently:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue22 );
+                }
+            break;
+            
+        case ECCPErrorNoAnswerForVideo:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNotePhoneOutOf3GCoverage );   
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneNoAnswer );
+                }
+            break;
+            
+        case ECCPErrorCCNoChannelAvailable:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue34 ); 
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneNetworkBusy );
+                }
+            break;
+            
+        case ECCPErrorNetworkOutOfOrder:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue38 );
+                }
+            break;
+            
+        case ECCPErrorCCRequestedFacilityNotSubscribed:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteVideoCallOnlyPossibleUnder3GCoverage );
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneNoteTextNotAllowed );
+                }
+            break;
+
+        case ECCPErrorCCIncomingCallsBarredInCug:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue55 );
+                }
+            break;
+            
+        case ECCPErrorCCIncompatibleDestination:
+        case ECCPErrorCCBearerCapabilityNotAuthorised:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteUnableToMakeVideoCallNotSupportedByOtherPhone );
+                }
+            break;
+        
+        case ECCPErrorCCBearerCapabilityNotCurrentlyAvailable:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue58 );
+                }
+            break;
+            
+        case ECCPErrorBadRequest:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteUnableToMakeVideoCallNotSupportedByOtherPhone );
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneErrorInConnection );
+                } 
+            break;
+            
+        case ECCPErrorCCUnspecifiedInterworkingError:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue127 );
+                }
+            break;
+            
+        case ECCPErrorCCPreemption:        
+        case ECCPErrorCCResponseToStatusEnquiry:        
+        case ECCPErrorCCInvalidMandatoryInformation:        
+        case ECCPErrorCCNonExistentMessageType:        
+        case ECCPErrorCCIncompatibleMessageInProtocolState:        
+        case ECCPErrorCCNonExistentInformationElement:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoNotSupported );
+                }
+            else
+                {
+                SendGlobalWarningNoteL( EPhoneErrorInConnection );
+                }     
+            break;
+
+        case ECCPErrorCCRecoveryOnTimerExpiry:        
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoNotSupported );                
+                }
+            break;
+            
+        case ECCPErrorCCFacilityRejected:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoNotSupported );
+                }
+            else
+                {
+                SendGlobalErrorNoteL( EPhoneNoteTextRequestRejected );
+                }
+            break;
+            
+        case ECCPTransferFailed:
+            SendGlobalErrorNoteL( EPhoneNoteTextRequestRejected );
+            break;
+ 
+        case ECCPErrorCCServiceNotAvailable:
+        case ECCPErrorCCBearerServiceNotImplemented:
+        case ECCPErrorCCOnlyRestrictedDigitalInformationBCAvailable:
+        case ECCPErrorCCServiceNotImplemented:
+            if( IsVideoCall( aErrorInfo.iCallId ) )
+                {
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoServiceNotAvailable );
+                }
+            break;
+            
+        case ECCPErrorCUGOutgoingCallsBarred:
+            SendGlobalInfoNoteL( EPhoneOutgoingCallsBarredWithinCUG );
+            break;
+        
+        case ECCPErrorCUGNotSelected:
+            SendGlobalInfoNoteL( EPhoneNoCUGSelected );
+            break;
+        
+        case ECCPErrorCUGIndexUnknown:
+            SendGlobalInfoNoteL( EPhoneUnknownCUGIndex );
+            break;
+        
+        case ECCPErrorCUGIndexIncompatible:
+            SendGlobalInfoNoteL( EPhoneCUGIndexIncompatible );
+            break;
+        
+        case ECCPErrorCUGCallsFailure:
+            SendGlobalInfoNoteL( EPhoneCUGCallsFailure );
+            break;
+        
+        case ECCPErrorCLIRNotSubscribed:
+            SendGlobalInfoNoteL( EPhoneCLIRNotSubscribed );
+            break;
+            
+        case ECCPErrorCCBSPossible:
+        case ECCPErrorCCBSNotPossible:
+        case ECCPErrorSatControl:
+            break;
+                
+        default:
+            __PHONELOG1(
+                EOnlyFatal, 
+                EPhoneControl,
+                "PHONEUI_ERROR: CPhoneErrorMessagesHandler::HandleErrorL - Error received (err=%d)",
+                aErrorInfo.iErrorCode);
+            break;
+        } 
+    }    
+
+// -----------------------------------------------------------
+// CPhoneErrorMessagesHandler::IsVideoCall
+// -----------------------------------------------------------
+//
+TBool CPhoneErrorMessagesHandler::IsVideoCall( const TInt aCallId ) const
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneErrorMessagesHandler::IsVideoCall() ");
+
+    if( aCallId == KErrNotFound )
+        {
+        // Illegal call id, check call type command
+        return ( iStateMachine->PhoneEngineInfo()->CallTypeCommand()
+            == EPECallTypeVideo );  
+        }
+        
+    return ( iStateMachine->PhoneEngineInfo()
+        ->CallType( aCallId )== EPECallTypeVideo );
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonegeneralgsmmessageshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,361 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneGeneralGsmMessagesHandler class.
+*
+*/
+
+
+// INCLUDES
+#ifdef __SYNCML_DM
+#include <apgcli.h>
+#endif
+#include <mpeengineinfo.h>
+#include <UikonInternalPSKeys.h>
+#include <mccessobserver.h>
+#include <featmgr.h>
+#include <StringLoader.h>
+
+#include "phoneconstants.h"
+#include "phonerssbase.h"
+#include "cphonegeneralgsmmessageshandler.h"
+#include "phonelogger.h"
+#include "mphonestatemachine.h"
+#include "mphoneviewcommandhandle.h"
+#include "phoneui.pan"
+#include "cphonepubsubproxy.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamnote.h"
+#include "tphonecmdparamappinfo.h"
+#include "cphonemainresourceresolver.h"
+#include "tphonecmdparaminteger.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneGeneralGsmMessagesHandler::CPhoneGeneralGsmMessagesHandler( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneState& aActiveState ) : 
+    iStateMachine( aStateMachine ),
+    iViewCommandHandle( aViewCommandHandle ),
+    iActiveState( aActiveState )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneGeneralGsmMessagesHandler::~CPhoneGeneralGsmMessagesHandler()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneGeneralGsmMessagesHandler::~CPhoneGeneralGsmMessagesHandler()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneGeneralGsmMessagesHandler::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneGeneralGsmMessagesHandler* CPhoneGeneralGsmMessagesHandler::NewL( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneState& aActiveState )
+    {
+    CPhoneGeneralGsmMessagesHandler* self = new( ELeave ) 
+        CPhoneGeneralGsmMessagesHandler( aStateMachine, 
+                                         aViewCommandHandle,
+                                         aActiveState );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneGeneralGsmMessagesHandler::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneGeneralGsmMessagesHandler::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGeneralGsmMessagesHandler::HandlePhoneEngineMessageL()" );
+
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageCallBarred:
+            SendGlobalInfoNoteL( EPhoneActiveBarrings );
+            break;
+        
+        case MEngineMonitor::EPEMessageIncCallIsForw:
+            HandleIncomingCallForwardedL();
+            break;
+            
+        case MEngineMonitor::EPEMessageIncCallForwToC:
+            SendGlobalInfoNoteL( EPhoneMtCallDiverting );
+            break;
+            
+        case MEngineMonitor::EPEMessageOutCallForwToC:
+            SendGlobalInfoNoteL( EPhoneDiverting );
+            break;
+
+        case MEngineMonitor::EPEMessageShowVersion:
+            HandleShowVersionL();
+            break;
+            
+        case MEngineMonitor::EPEMessageIssuedSSRequest:
+            {
+            __PHONELOG(
+                EBasic, 
+                EPhoneUIStates,
+                "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuedSSRequest" );
+
+            TPhoneCmdParamBoolean booleanParam;
+            booleanParam.SetBoolean( EFalse );
+            iViewCommandHandle.ExecuteCommandL( 
+                EPhoneViewSetBlockingDialogStatus, 
+                &booleanParam );
+            break;
+            }
+            
+        case MEngineMonitor::EPEMessageIssuingSSRequest:
+            {
+            __PHONELOG(
+                EBasic, 
+                EPhoneUIStates,
+                "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuingSSRequest" );
+                    
+            iStateMachine.SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
+             
+            // Remove number entry from screen
+            if ( !FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) &&
+                 iViewCommandHandle.HandleCommandL( 
+                     EPhoneViewGetNumberEntryIsVisibleStatus ) == 
+                     EPhoneViewResponseSuccess )  
+                {            
+                iViewCommandHandle.ExecuteCommandL( 
+                    EPhoneViewRemoveNumberEntry );
+                }
+            else if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+                {
+                iViewCommandHandle.ExecuteCommandL( 
+                    EPhoneViewClearNumberEntryContent );
+                }
+
+            // Enable global notes
+            TPhoneCmdParamBoolean globalNotifierParam;
+            globalNotifierParam.SetBoolean( EFalse );
+            iViewCommandHandle.ExecuteCommandL( 
+                EPhoneViewSetGlobalNotifiersDisabled,
+                &globalNotifierParam );
+            
+            TPhoneCmdParamBoolean booleanParam;
+            booleanParam.SetBoolean( ETrue );
+            iViewCommandHandle.ExecuteCommandL( 
+                EPhoneViewSetBlockingDialogStatus, 
+                &booleanParam );
+            
+            // Get active call count
+            TPhoneCmdParamInteger activeCallCount;
+            iViewCommandHandle.ExecuteCommandL(
+                EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+            
+            if( !activeCallCount.Integer() )
+                {
+                __PHONELOG(
+                    EBasic, 
+                    EPhoneUIStates,
+                    "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuingSSRequest no active call" );
+                // Ensure that the dialer is activated to display local notes and dialogs properly.
+                TPhoneCmdParamAppInfo param;
+                param.SetAppUid( KUidPhoneApplication );
+                param.SetViewUid( KUidViewId );
+                param.SetCustomMessageId( TUid::Uid( KTouchDiallerViewCommand ) );
+                iViewCommandHandle.ExecuteCommandL( 
+                    EPhoneViewActivateAppViewWithCustomMessage, 
+                    &param );
+                }
+            // Remove phoneumber query
+            iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveQuery );
+            break;
+            }
+
+        case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
+            SendGlobalErrorNoteL( EPhoneSSNotifCLIRSupprReject );
+            break;
+            
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
+            SendGlobalInfoNoteL( EPhoneAllIncomingCallsDiverted );
+            break;
+            
+        case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
+            SendGlobalInfoNoteL( EPhoneActiveDiverts );
+            break;
+
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL
+// ---------------------------------------------------------
+//
+void CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL()" );
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    if ( CPhonePubSubProxy::Instance()->Value( 
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+            
+        TPhoneCmdParamGlobalNote globalNoteParam;
+      
+        globalNoteParam.SetType( EAknGlobalInformationNote );
+        globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( EAvkonSIDInformationTone );
+
+        iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewShowGlobalNote, &globalNoteParam );    
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL
+// -----------------------------------------------------------
+//
+void CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL()" );
+    
+    iActiveState.SetDivertIndication( ETrue );
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneGeneralGsmMessagesHandler::HandleShowVersionL
+// -----------------------------------------------------------
+//
+void CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()" );
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer )  )  
+        {
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewClearNumberEntryContent );       
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNumberEntry );        
+        } 
+
+
+#ifdef __SYNCML_DM
+    // Launch DM UI 
+    RWsSession sess = CCoeEnv::Static()->WsSession();
+    RApaLsSession apaLsSession;        
+  
+    TApaTaskList appList( sess );
+    TApaTask bring = appList.FindApp( KDeviceManagerUid );
+
+    if ( bring.Exists() )
+        {
+        bring.BringToForeground();
+        }
+    else
+        {
+        if( !apaLsSession.Handle() )
+            {
+            User::LeaveIfError(apaLsSession.Connect());
+            }
+        CleanupClosePushL( apaLsSession );
+        TThreadId thread;
+        User::LeaveIfError( apaLsSession.StartDocument(KNullDesC, KDeviceManagerUid, thread) );
+        CleanupStack::PopAndDestroy( &apaLsSession );  
+        }
+
+    // Stop dtmf tone. Long key press case key up event go to 
+    // device manager application.
+    iStateMachine.SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageEndDTMF );
+    
+#else    
+    // Fetch version number
+    TPEPhoneIdentityParameters phoneIdentityParameters = iStateMachine.
+        PhoneEngineInfo()->PhoneIdentityParameters();
+
+    // Add it to the resource string
+    HBufC* buf = HBufC::NewLC( KSysUtilVersionTextLength );
+    buf->Des().Format( phoneIdentityParameters.iRevision );
+        
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteCustom );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInformationWaitNote ) );
+    noteParam.SetText( *buf );
+    
+    // Display note
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+    
+    CleanupStack::PopAndDestroy( buf );
+#endif
+    }
+
+// ---------------------------------------------------------
+//  CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL
+// ---------------------------------------------------------
+//
+void CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL()" );
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+
+    if ( CPhonePubSubProxy::Instance()->Value( 
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+            
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetType( EAknGlobalErrorNote );
+        globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
+
+        iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonegsmincall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,430 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneGsmInCall class.
+*
+*/
+
+
+// INCLUDES
+#include <mpeengineinfo.h>
+#include <pevirtualengine.h>
+#include <cpephonemodelif.h>
+#include <StringLoader.h>
+
+#include "cphonegsmincall.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "cphonegeneralgsmmessageshandler.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "mphonestatemachine.h"
+#include "cphonemainresourceresolver.h"
+#include "phoneui.hrh"
+
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamcallheaderdata.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneGsmInCall::CPhoneGsmInCall( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneStateInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::~CPhoneGsmInCall()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneGsmInCall::~CPhoneGsmInCall()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneGsmInCall::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneGsmInCall::ConstructL()");
+    CPhoneStateInCall::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneGsmInCall* CPhoneGsmInCall::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneGsmInCall* self = new (ELeave) 
+        CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneGsmInCall::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGsmInCall::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageRemoteHeld:
+            CPhoneState::SendGlobalInfoNoteL( 
+                EPhoneInformationRemotePutOnHoldNote );
+            break;
+        
+        case MEngineMonitor::EPEMessageRemoteResumed:
+            CPhoneState::SendGlobalInfoNoteL( 
+                EPhoneInformationConnectedNote );
+            break;
+            
+        case MEngineMonitor::EPEMessageRemoteCreatedConference:
+            CPhoneState::SendGlobalInfoNoteL( 
+                EPhoneInformationRemoteCreateConferenceNote );
+            break;        
+        case MEngineMonitor::EPEMessageIncCallIsForw:  // fall through
+        case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through
+        case MEngineMonitor::EPEMessageCallBarred: // fall through
+        case MEngineMonitor::EPEMessageShowVersion: // fall through
+        case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through
+        case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
+        case MEngineMonitor::EPEMessageIncCallForwToC: // fall through
+        case MEngineMonitor::EPEMessageOutCallForwToC: // fall through
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through
+        case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
+            {
+            CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
+                CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
+                                                       *iViewCommandHandle,
+                                                       *this );
+            CleanupStack::PushL( gsmMsgHandler );
+            gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
+            CleanupStack::PopAndDestroy( gsmMsgHandler );
+            
+            // Needed also in non-touch, if call waiting request (*43#) 
+            // is sent during active call at least.
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            }
+            break;
+
+        default:
+            CPhoneStateInCall::HandlePhoneEngineMessageL( 
+                aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall:HandleCommandL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneGsmInCall::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGsmInCall::HandleCommandL() ");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {                        
+        case EPhoneCallComingCmdAnswer:
+        case EPhoneInCallCmdAnswer:
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageAnswer );
+            break;
+        
+        // 'Replace' from menu            
+        case EPhoneInCallCmdReplace:
+            ReplaceCallL();
+            break;
+        
+        case EPhoneInCallCmdSwap:
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageSwap ); 
+            break;  
+            
+        case EPhoneInCallCmdEndAllCalls:
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageReleaseAll );        
+            break;
+            
+        case EPhoneInCallCmdCreateConference:
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageCreateConference );
+            break;
+            
+        case EPhoneInCallCmdTransfer:
+            iStateMachine->SendPhoneEngineMessage( 
+                CPEPhoneModelIF::EPEMessageTransfer );                        
+            break;   
+            
+       default:
+            CPhoneStateInCall::HandleCommandL( aCommand );
+            break;
+        }
+    return commandStatus;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::ReplaceCallL
+// -----------------------------------------------------------
+//
+void CPhoneGsmInCall::ReplaceCallL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGsmInCall::ReplaceCallL() ");
+          
+    iStateMachine->SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageReplaceActive );
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::HandleColpNoteL
+// -----------------------------------------------------------
+//
+void CPhoneGsmInCall::HandleColpNoteL( 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandleColpNoteL() ");
+
+    MPEEngineInfo* EngineInfo = CPhoneState::iStateMachine->PhoneEngineInfo();
+
+    if ( EngineInfo->RemoteColpNumber( aCallId ).Length() )
+        {
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetText(  EngineInfo->RemoteColpNumber( aCallId ) ); 
+        globalNoteParam.SetType( EAknGlobalInformationNote );
+        globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneColpConnected ) );
+        globalNoteParam.SetTone( EAvkonSIDInformationTone );
+            
+        iViewCommandHandle->ExecuteCommandL( 
+                EPhoneViewShowGlobalNote, &globalNoteParam );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::BringIncomingToForegroundL()
+// -----------------------------------------------------------
+//
+void CPhoneGsmInCall::BringIncomingToForegroundL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::BringIncomingToForegroundL( ) ");
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Remove any phone dialogs if they are displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    // Capture keys when there is an incoming call
+    CaptureKeysDuringCallNotificationL( ETrue );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+    
+    // Disable global notes when there is an incoming call
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
+        &globalNotifierParam );
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL
+// -----------------------------------------------------------
+//
+void CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL( 
+    TPhoneCmdParamBoolean& aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::AllowShowingOfWaitingCallHeaderL() ");
+
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewAllowWaitingCallHeader, 
+        &aCommandParam );
+    
+    // Non-touch :Hide number entry if it exists on 
+    // Touch : an internal operation ongoing 
+    // -> do not hide dialer
+    if ( !iOnScreenDialer )
+        {   
+        SetNumberEntryVisibilityL(EFalse);
+        }
+    // If param is true and number entry is open only then
+    // hide number entry.
+    else if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
+        {
+        SetNumberEntryVisibilityL(EFalse);
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::HandlePhoneForegroundEventL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneGsmInCall::HandlePhoneForegroundEventL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandlePhoneForegroundEventL( ) ");
+    if ( iOnScreenDialer && IsNumberEntryUsedL() )
+        {
+        // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible 
+        // to ensure that numberentry/dialler is drawn to UI.
+        TPhoneViewResponseId respond = 
+            iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible );
+                
+        if ( respond && IsNumberEntryVisibleL() )
+            {
+            // Set Number Entry CBA
+            iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
+            }
+        }
+     }
+
+// -----------------------------------------------------------
+// CPhoneGsmInCall::HandleHoldNoteL
+// -----------------------------------------------------------
+//
+void CPhoneGsmInCall::HandleHoldNoteL( 
+    TInt aCallId, TBool aHold )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandleHoldNoteL( ) ");
+    TBuf< KPhoneContactNameMaxLength > holdText( KNullDesC );
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    TInt resourceId(0);
+    
+    if( iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() ||
+        iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length())
+        {
+        TInt resource( EPhoneInformationCallActivetedCli );
+        if ( aHold )
+            {
+            resource = EPhoneInformationCallOnHoldCli;    
+            }
+        GetRemoteInfoDataL ( aCallId, holdText );
+        resourceId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( resource );
+        globalNoteParam.SetTextResourceId( resourceId );    
+        }
+    else
+        {
+        TInt resource( EPhoneInformationCallActiveted );
+        if ( aHold )
+            {
+            resource = EPhoneInformationCallOnHoldNoCli;    
+            }
+        resourceId = CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resource );
+                
+        HBufC* tmp = StringLoader::LoadL( resourceId, 
+            aCallId + 1 , CCoeEnv::Static() );
+
+        holdText = *tmp;
+        delete tmp;
+        tmp = NULL;  
+        }
+         
+    globalNoteParam.SetText( holdText ); 
+    globalNoteParam.SetType( EAknGlobalConfirmationNote );
+    globalNoteParam.SetTone( EAvkonSIDInformationTone );
+        
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewShowGlobalNote, &globalNoteParam ); 
+    }
+
+
+// ---------------------------------------------------------
+// CPhoneGsmInCall::SetDivertIndication
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneGsmInCall::SetDivertIndication( const TBool aDivertIndication )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneGsmInCall::SetDivertIndication()");
+           
+    CPhoneState::SetDivertIndication( aDivertIndication );    
+    
+    TRAP_IGNORE( HandeDivertIndicationL() );
+    }
+
+// ---------------------------------------------------------
+// CPhoneGsmInCall::HandeDivertIndicationL
+// ---------------------------------------------------------
+//
+void CPhoneGsmInCall::HandeDivertIndicationL()
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneGsmInCall::HandeDivertIndicationL()");
+       
+    TBuf< KPhoneContactNameMaxLength > remoteInfoText( KNullDesC );
+    TInt ringingCallId ( KErrNotFound );
+        
+    ringingCallId = GetRingingCallL();
+    
+    if( ringingCallId > KErrNotFound )
+       {
+       TPhoneCmdParamCallHeaderData divertData;
+    
+        divertData.SetDiverted( ETrue );
+       
+       GetRemoteInfoDataL( ringingCallId, remoteInfoText );
+       divertData.SetCLIText( 
+                  remoteInfoText,
+                  TPhoneCmdParamCallHeaderData::ERight );
+       
+       divertData.SetCiphering(
+           iStateMachine->PhoneEngineInfo()->IsSecureCall( ringingCallId ) );
+       divertData.SetCipheringIndicatorAllowed(
+           iStateMachine->PhoneEngineInfo()->SecureSpecified() );
+           
+       iViewCommandHandle->ExecuteCommandL( 
+           EPhoneViewUpdateCallHeaderRemoteInfoData, ringingCallId,
+           &divertData );
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneidle.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneIdle class.
+*
+*/
+
+
+// INCLUDES
+#include "cphoneidle.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "cphonegeneralgsmmessageshandler.h"
+#include "tphonecmdparamboolean.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneIdle::CPhoneIdle( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneStateIdle( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneIdle::~CPhoneIdle()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+EXPORT_C CPhoneIdle::~CPhoneIdle()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneIdle::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneIdle::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneIdle::ConstructL()");
+    CPhoneStateIdle::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneIdle::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneIdle* CPhoneIdle::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneIdle* self = new (ELeave) 
+        CPhoneIdle( aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneIdle::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneIdle::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, 
+        "CPhoneIdle::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageRemoteHeld:
+            CPhoneState::SendGlobalInfoNoteL( 
+                EPhoneInformationRemotePutOnHoldNote );
+            break;
+        
+        case MEngineMonitor::EPEMessageRemoteResumed:
+            CPhoneState::SendGlobalInfoNoteL( 
+                EPhoneInformationConnectedNote );
+            break;
+            
+        case MEngineMonitor::EPEMessageAudioOutputChanged:
+            HandleAudioOutputChangedL();
+            break;
+
+        case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through 
+            // Note that after the sending of SS 
+            // strings the view stays in Dialer.
+            if ( !iOnScreenDialer )  
+                {
+                SetupIdleScreenInBackgroundL();
+                }
+        case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through
+        case MEngineMonitor::EPEMessageCallBarred: // fall through
+        case MEngineMonitor::EPEMessageShowVersion: // fall through
+        case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
+        case MEngineMonitor::EPEMessageIncCallIsForw: // fall through
+        case MEngineMonitor::EPEMessageIncCallForwToC: // fall through
+        case MEngineMonitor::EPEMessageOutCallForwToC: // fall through
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through
+        case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
+            {
+            CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
+                CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
+                                                       *iViewCommandHandle,
+                                                       *this );
+            CleanupStack::PushL( gsmMsgHandler );
+            gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
+            CleanupStack::PopAndDestroy( gsmMsgHandler );
+            }
+            break;
+
+        default:
+            CPhoneStateIdle::HandlePhoneEngineMessageL( 
+                aMessage, aCallId );
+            break;
+        }
+
+#ifndef __SYNCML_DM
+      switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageShowVersion:
+            if ( !iOnScreenDialer )
+                {
+                HandleNumberEntryClearedL();
+                }
+            break;
+        default:    
+            break;
+        }
+#endif        
+    }
+
+// -----------------------------------------------------------
+// CPhoneIdle::HandleErrorL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneIdle::HandleErrorL( const TPEErrorInfo& aErrorInfo )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneIdle::HandleErrorL() ");
+    
+    TPhoneCmdParamBoolean blockingDialogStatus;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus, 
+        &blockingDialogStatus );
+
+    if( blockingDialogStatus.Boolean() )
+        {
+        blockingDialogStatus.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetBlockingDialogStatus, 
+            &blockingDialogStatus );
+        }
+    
+    CPhoneState::HandleErrorL( aErrorInfo );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneincoming.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneIncoming class.
+*
+*/
+
+
+// INCLUDES
+#include <featmgr.h>
+#include <telephonyvariant.hrh>
+#include "cphoneincoming.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "cphonegeneralgsmmessageshandler.h"
+#include "phonestatedefinitionsgsm.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "phoneui.hrh"
+#include "mphonestatemachine.h"
+#include "mphonestorage.h"
+#include "cphonecenrepproxy.h"
+#include "tphonecmdparamcallstatedata.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneIncoming::CPhoneIncoming( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneStateIncoming( aStateMachine, aViewCommandHandle, aPhoneCustomization ),
+    iWaitingCallId( KErrNotFound )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneIncoming::~CPhoneIncoming()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneIncoming::~CPhoneIncoming()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneIncoming::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneIncoming::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneIncoming::ConstructL()");
+    CPhoneStateIncoming::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneIncoming::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneIncoming* CPhoneIncoming::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneIncoming* self = new (ELeave) 
+        CPhoneIncoming( aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneIncoming::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneIncoming::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, 
+        "CPhoneIncoming::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIncoming:
+            iWaitingCallId = aCallId;
+            break;
+
+        case MEngineMonitor::EPEMessageConnected:
+            if( iWaitingCallId > KErrNotFound )
+                {
+                HandleIncomingL( iWaitingCallId );
+                }
+            else
+                {
+                // There is no another incoming call
+                CPhoneStateIncoming::HandlePhoneEngineMessageL( 
+                    aMessage, aCallId );
+                }
+            break;
+            
+        case MEngineMonitor::EPEMessageRemoteHeld:
+                SendGlobalInfoNoteL( EPhoneInformationRemotePutOnHoldNote );
+            break;
+        
+        case MEngineMonitor::EPEMessageRemoteResumed:
+                SendGlobalInfoNoteL( EPhoneInformationConnectedNote );
+            break;
+
+        // fall through.
+        case MEngineMonitor::EPEMessageIssuingSSRequest:
+        case MEngineMonitor::EPEMessageCallBarred:
+        case MEngineMonitor::EPEMessageShowVersion:
+        case MEngineMonitor::EPEMessageIssuedSSRequest:
+        case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
+        case MEngineMonitor::EPEMessageIncCallIsForw:
+        case MEngineMonitor::EPEMessageIncCallForwToC:
+        case MEngineMonitor::EPEMessageOutCallForwToC:
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
+        case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
+            {
+            CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
+                CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
+                                                       *iViewCommandHandle,
+                                                       *this );
+            CleanupStack::PushL( gsmMsgHandler );
+            gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
+            CleanupStack::PopAndDestroy( gsmMsgHandler );
+            }
+            break;
+            
+        case MEngineMonitor::EPEMessageIdle:
+           {
+           // Check if there is another incoming call while the first one is
+           // still disconnecting
+           if ( iWaitingCallId > KErrNotFound && aCallId != iWaitingCallId )
+               {
+               HandleIncomingL( iWaitingCallId );
+               
+               // Prevent execution of CPhoneStateIncoming::HandleIdleL, only remove
+               // the call bubble
+               BeginUiUpdateLC();
+               iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+               EndUiUpdate();
+
+               iWaitingCallId = KErrNotFound;
+               }
+           else
+               {
+               CPhoneStateIncoming::HandlePhoneEngineMessageL( 
+                   aMessage, aCallId );
+               }
+           }
+           break;
+
+        default:
+            CPhoneStateIncoming::HandlePhoneEngineMessageL( 
+                aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+//  CPhoneIncoming::HandleIncomingL
+// -----------------------------------------------------------
+void CPhoneIncoming::HandleIncomingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneIncoming::HandleIncomingL()");
+    
+    TPhoneCmdParamCallStateData callState;
+    callState.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallIdByState, &callState );
+    TInt connectedCall = callState.CallId(); 
+    
+    BeginUiUpdateLC();
+    
+    TPhoneCmdParamBoolean dialerParam;
+    dialerParam.SetBoolean( ETrue );
+    
+    AllowShowingOfWaitingCallHeaderL( dialerParam );
+      
+    // Close fast swap window if it's displayed
+    CEikonEnv::Static()->DismissTaskList();
+    
+    // If the 1st incoming call became Connected, this is waiting call
+    // If the 1st incoming call went just Idle, this is a normal call
+    if ( connectedCall > KErrNotFound )
+        {
+        SetTouchPaneButtons( EPhoneWaitingCallButtons );
+        }
+    else
+        {
+        SetTouchPaneButtons( EPhoneIncomingCallButtons );
+        }
+    
+    if ( KErrNotFound == connectedCall )
+        {
+        dialerParam.SetBoolean( EFalse );
+        }
+    
+    SetToolbarDimming( EFalse );
+    
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam );
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+            && !CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) 
+            && ( IsKeyLockOn() || IsAutoLockOn() ) )
+        {
+        DisableCallUIL();
+        }
+    else
+        {
+        // if keys have been locked, disable keylock without information note
+        if ( IsKeyLockOn() )
+            {
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
+            }
+        }
+        
+    if( CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) 
+            && ( IsKeyLockOn() || IsAutoLockOn() ) )
+        {
+        DisableHWKeysL();
+        }
+        
+    EndUiUpdate();
+
+    if ( connectedCall > KErrNotFound )
+        {
+        // Go to incoming state
+        iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+        iStateMachine->ChangeState( EPhoneStateWaitingInSingle );   
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneIncoming::DisplayIncomingCallL
+// -----------------------------------------------------------
+//
+void CPhoneIncoming::DisplayIncomingCallL( 
+    TInt aCallId, 
+    const TPhoneCmdParamBoolean aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneIncoming::DisplayIncomingCallL()");
+ 
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Cannot delete active note, e.g. New call query, 
+    // but show waiting note with or without caller name
+    if ( IsAnyQueryActiveL() || 
+        ( aCommandParam.Boolean() && iOnScreenDialer ) )
+        {
+        CallWaitingNoteL( aCallId );        
+        }
+    else
+        {
+        // Remove any phone dialogs if they are displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+        }
+    
+    // Indicate that the Phone needs to be sent to the background if
+    // an application other than the top application is in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        &booleanParam );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+
+    DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call 
+    }    
+
+// -----------------------------------------------------------
+// CPhoneIncoming::AllowShowingOfWaitingCallHeaderL
+// -----------------------------------------------------------
+//
+void CPhoneIncoming::AllowShowingOfWaitingCallHeaderL( 
+    TPhoneCmdParamBoolean& aCommandParam )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneIncoming::AllowShowingOfWaitingCallHeaderL() ");
+
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewAllowWaitingCallHeader, 
+        &aCommandParam );
+    
+    // Non-touch :Hide number entry if it exists on 
+    // Touch : an internal operation ongoing 
+    // -> do not hide dialer
+    if ( !iOnScreenDialer )
+        {   
+        SetNumberEntryVisibilityL(EFalse);
+        }
+    // If param is true and number entry is open only then
+    // hide number entry.
+    else if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
+        {
+        SetNumberEntryVisibilityL(EFalse);
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneIncoming::HandleLongHashL
+// -----------------------------------------------------------
+//
+ void CPhoneIncoming::HandleLongHashL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneIncoming::HandleLongHashL( ) ");
+    }
+
+ // -----------------------------------------------------------
+ // CPhoneIncoming::HandleErrorL
+ // -----------------------------------------------------------
+ //
+ EXPORT_C void CPhoneIncoming::HandleErrorL( 
+         const TPEErrorInfo& aErrorInfo )
+     {
+     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneIncoming::HandleErrorL()");
+     
+     if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer )
+         {
+         // Should not shown "No Answer" note
+         __PHONELOG1( EBasic, EPhoneUIStates,
+        "PhoneUIControl: CPhoneIncoming::HandleErrorL - aErrorInfo.iErrorCode =%d ",
+             aErrorInfo.iErrorCode);
+         }
+     else
+         {
+         CPhoneState::HandleErrorL( aErrorInfo );
+         }
+     }
+ 
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneresourceresolvergsm.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneResourceResolverGSM class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <bautils.h>
+#include <eikenv.h>
+#include <avkon.rsg>
+#include <AknUtils.h>
+#include <featmgr.h>
+
+#include "cphoneresourceresolvergsm.h"
+#include "cphonemainresourceresolver.h"
+#include "phoneconstants.h"
+#include "phonerssgsm.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "phoneresourceids.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverGSM::CPhoneResourceResolverGSM
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneResourceResolverGSM::CPhoneResourceResolverGSM(): iEnv( *CEikonEnv::Static() )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// ourceResolverGSM::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneResourceResolverGSM::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneResourceResolverGSM::ConstructL");
+
+    // Register resolver
+    CPhoneMainResourceResolver::Instance()->RegisterResolver( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverGSM::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneResourceResolverGSM* CPhoneResourceResolverGSM::NewL()
+    {
+    CPhoneResourceResolverGSM* self = 
+        new( ELeave ) CPhoneResourceResolverGSM();
+    CleanupStack::PushL( self );    
+    self->ConstructL();
+    CleanupStack::Pop( self );    
+    return self;
+    }
+
+// Destructor
+EXPORT_C CPhoneResourceResolverGSM::~CPhoneResourceResolverGSM()
+    {   
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverGSM::ResolveResourceID
+// Resolve resource id of given resource.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneResourceResolverGSM::ResolveResourceID( 
+    const TInt& aResource ) const
+    {    
+    return CPhoneResourceResolverBase::ResolveResourceID( aResource );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonesingleandalerting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneSingleAndAlerting class.
+*
+*/
+
+
+// INCLUDES
+#include <pevirtualengine.h>
+#include <cpephonemodelif.h>
+#include "cphonesingleandalerting.h"
+#include "tphonecmdparamboolean.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneSingleAndAlerting::CPhoneSingleAndAlerting( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneAlerting( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::~CPhoneSingleAndAlerting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndAlerting::~CPhoneSingleAndAlerting()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndAlerting::ConstructL()
+    {
+    CPhoneAlerting::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndAlerting* CPhoneSingleAndAlerting::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneSingleAndAlerting* self = new( ELeave ) CPhoneSingleAndAlerting( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndAlerting::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndAlerting::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+            
+        default:
+            CPhoneAlerting::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// --------------------------------------------------------------
+// CPhoneSingleAndAlerting::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneSingleAndAlerting::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndAlerting::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if ( CPhoneState::IsNumberEntryUsedL() )
+                {
+                // send a manual control sequence
+                CPhoneState::CallFromNumberEntryL();    
+                }
+            else
+                {
+                // Show not allowed note
+                CPhoneState::SendGlobalErrorNoteL( 
+                    EPhoneNoteTextNotAllowed );
+                }
+            break;
+
+        // end-key
+        case EKeyNo:
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                iStateMachine->SendPhoneEngineMessage(
+                    CPEPhoneModelIF::EPEMessageTerminateAllConnections );        
+                }
+            else
+                {
+                DisconnectOutgoingCallL();               
+                }
+                
+            if ( CPhoneState::IsNumberEntryUsedL() )
+                {
+                // Remove number entry from screen
+                iViewCommandHandle->ExecuteCommandL( 
+                      EPhoneViewRemoveNumberEntry );
+                // Do state-specific operation when number entry is cleared
+                HandleNumberEntryClearedL();
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneAlerting::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndAlerting::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndAlerting::HandleConnectedL()");
+
+    // Find the alerting call
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnecting );                    
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+        
+    if( callStateData.CallId() == aCallId )
+        {    
+        // Keep Phone in the foreground
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+        
+        // Close menu bar, if it is displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+        CPhoneState::BeginUiUpdateLC();
+            
+        // Show bubble
+        TPhoneCmdParamCallHeaderData callHeaderParam;
+        callHeaderParam.SetCallState( EPEStateConnected );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+            &callHeaderParam );
+
+        CPhoneState::SetTouchPaneButtons( EPhoneTwoSinglesButtons );
+        CPhoneState::EndUiUpdate();
+              
+        // Set Hold flag to view
+        TPhoneCmdParamBoolean holdFlag;
+        holdFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );  
+        
+        
+        // Set Two singles softkeys
+        UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+        
+        // Go to two singles state
+        iStateMachine->ChangeState( EPhoneStateTwoSingles );
+        }
+    else
+        {
+        // Show bubble
+        TPhoneCmdParamCallHeaderData callHeaderParam;
+        callHeaderParam.SetCallState( EPEStateConnected );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+            &callHeaderParam );  
+            
+        TPhoneCmdParamBoolean holdFlag;
+        holdFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+        }
+        
+    CPhoneGsmInCall::HandleColpNoteL( aCallId );
+    }
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndAlerting::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndAlerting::HandleIdleL()");
+    
+    BeginUiUpdateLC();
+    
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    if ( !TopAppIsDisplayedL() )
+        {
+        // Continue displaying current app but set up the 
+        // idle screen in the background
+        SetupIdleScreenInBackgroundL();
+        }
+        
+    TPhoneCmdParamInteger countParam;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, &countParam);
+    
+    if ( countParam.Integer() )
+        {
+        SetTouchPaneButtons( EPhoneIncallButtons );    
+        // Set Hold flag to view
+        TPhoneCmdParamBoolean holdFlag;
+        holdFlag.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+        UpdateCbaL( EPhoneCallHandlingInCallCBA );
+        iStateMachine->ChangeState( EPhoneStateSingle );
+        }
+    else
+        {
+        // Display call termination note, if necessary
+        DisplayCallTerminationNoteL();
+        SetTouchPaneButtons( EPhoneCallSetupButtons );
+        UpdateCbaL( EPhoneCallHandlingInCallCBA );
+        iStateMachine->ChangeState( EPhoneStateAlerting );
+        }
+
+    EndUiUpdate();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndAlerting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndAlerting::OpenMenuBarL()");
+    TInt resourceId;
+
+    if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneAlertingAndHeldCallMenuBarWithNumberEntry;
+        }
+    else
+        {
+        resourceId = EPhoneAlertingAndHeldCallMenuBar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndAlerting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndAlerting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneSingleAndAlerting::UpdateInCallCbaL() ");
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    }
+    
+        
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonesingleandcallsetup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,407 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneSingleAndCallSetup class.
+*
+*/
+
+
+// INCLUDES
+#include <featmgr.h>
+#include <cpephonemodelif.h>
+#include "cphonesingleandcallsetup.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "phonerssbase.h"
+#include "phoneui.hrh"
+#include "tphonecmdparamglobalnote.h"
+#include "cphonemainresourceresolver.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneSingleAndCallSetup::CPhoneSingleAndCallSetup( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneCallSetup( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::~CPhoneSingleAndCallSetup()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndCallSetup::~CPhoneSingleAndCallSetup()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetup::ConstructL()
+    {
+    CPhoneCallSetup::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndCallSetup* CPhoneSingleAndCallSetup::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneSingleAndCallSetup* self = new( ELeave ) CPhoneSingleAndCallSetup( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetup::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+         "CPhoneSingleAndCallSetup::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnecting:
+            HandleConnectingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+            
+        default:
+            CPhoneCallSetup::HandlePhoneEngineMessageL( aMessage, 
+                aCallId );
+            break;
+        }
+    }
+
+// --------------------------------------------------------------
+// CPhoneSingleAndCallSetup::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneSingleAndCallSetup::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndCallSetup::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if ( CPhoneState::IsNumberEntryUsedL() )
+                {
+                // send a manual control sequence
+                CPhoneState::CallFromNumberEntryL();    
+                }
+            else
+                {
+                // Show not allowed note
+                CPhoneState::SendGlobalErrorNoteL( 
+                    EPhoneNoteTextNotAllowed );
+                }
+            break;
+
+        // end-key
+        case EKeyNo:
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                iStateMachine->SendPhoneEngineMessage(
+                    CPEPhoneModelIF::EPEMessageTerminateAllConnections );        
+                }
+            else
+                {
+                // Fetch active call's id from view
+                TPhoneCmdParamCallStateData callStateData;
+                // Find the dialing call
+                callStateData.SetCallState( EPEStateDialing );
+                iViewCommandHandle->HandleCommandL(
+                    EPhoneViewGetCallIdByState, &callStateData ); 
+            
+                if( callStateData.CallId() > KErrNotFound )
+                    {
+                    // Release the call
+                    iStateMachine->SetCallId( 
+                        callStateData.CallId() );
+                    iStateMachine->SendPhoneEngineMessage( 
+                        MPEPhoneModel::EPEMessageRelease );
+                    }
+                else
+                    {
+                    callStateData.SetCallState( EPEStateDisconnecting );
+                    iViewCommandHandle->HandleCommandL(
+                        EPhoneViewGetCallIdByState, &callStateData );
+                    
+                     if ( callStateData.CallId() > KErrNotFound )
+                        {    
+                        // Release the call
+                        iStateMachine->SetCallId( 
+                            callStateData.CallId() );
+                        iStateMachine->SendPhoneEngineMessage( 
+                            MPEPhoneModel::EPEMessageRelease );   
+                        }
+                    }          
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneCallSetup::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::HandleConnectingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetup::HandleConnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetup::HandleConnectingL()");
+    
+    BeginUiUpdateLC();
+    
+    UpdateRemoteInfoDataL ( aCallId );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+    
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    // Stop capturing keys
+    CaptureKeysDuringCallNotificationL( EFalse );
+
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+
+    EndUiUpdate();
+        
+    // Set Hold flag to view EFalse that dtmf menu item not delete
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons );
+    
+    // Go to alerting state
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    iStateMachine->ChangeState( EPhoneStateAlertingInSingle );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetup::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndCallSetup::HandleConnectedL()");
+    
+    BeginUiUpdateLC();
+    
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+
+    // Capturing keys and number entry must be removed because some
+    // networks jump over connecting state directly to connected state.
+    CaptureKeysDuringCallNotificationL( EFalse );
+    
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    SetTouchPaneButtons( EPhoneTwoSinglesButtons );
+    
+    EndUiUpdate();        
+    
+     // Go to two singles state
+    UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+    iStateMachine->ChangeState( EPhoneStateTwoSingles );
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetup::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetup::HandleIdleL()");
+    
+    BeginTransEffectLC( ENumberEntryOpen );
+    BeginUiUpdateLC();
+ 
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Find out do we have single or outgoing call left
+    TPhoneCmdParamInteger activeCallCount;
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+        
+    if( activeCallCount.Integer() )
+        {
+        CheckIfRestoreNEContentAfterDtmfDialer();
+ 
+        if ( IsNumberEntryUsedL() )
+            {
+            // Show the number entry if it exists
+            SetNumberEntryVisibilityL(ETrue);
+            }
+        else
+            {
+            // Set incall CBAs
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );    
+            }
+            
+        SetTouchPaneButtons( EPhoneIncallButtons );    
+        // UnCapture keys callsetup fails
+        CaptureKeysDuringCallNotificationL( EFalse );
+        // Setup call was terminated
+        iStateMachine->ChangeState( EPhoneStateSingle );            
+        }
+    else
+        {
+        // Display call termination note, if necessary
+        DisplayCallTerminationNoteL();
+
+        // Single call was terminated
+        SetTouchPaneButtons( EPhoneCallSetupButtons );
+        SetToolbarDimming( ETrue );
+        SetToolbarButtonLoudspeakerEnabled();
+        // Update call setup CBAs
+        UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+        iStateMachine->ChangeState( EPhoneStateCallSetup );            
+        }
+        
+    EndUiUpdate();
+    EndTransEffect();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetup::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneSingleAndCallSetup::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndCallSetup::HandleCommandL()");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneInCallCmdEndThisOutgoingCall:
+            {
+            // Fetch  call's id from view
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateDialing );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+                
+            if ( callStateData.CallId() > KErrNotFound )
+                {
+                // Release the call
+                iStateMachine->SetCallId( 
+                    callStateData.CallId() );
+                iStateMachine->SendPhoneEngineMessage( 
+                    MPEPhoneModel::EPEMessageRelease );    
+                }
+            else
+                {
+                callStateData.SetCallState( EPEStateDisconnecting );
+                iViewCommandHandle->HandleCommandL(
+                    EPhoneViewGetCallIdByState, &callStateData );
+                
+                 if ( callStateData.CallId() > KErrNotFound )
+                    {    
+                    // Release the call
+                    iStateMachine->SetCallId( 
+                        callStateData.CallId() );
+                    iStateMachine->SendPhoneEngineMessage( 
+                        MPEPhoneModel::EPEMessageRelease );   
+                    }
+                __PHONELOG( EOnlyFatal, EPhoneUIStates, 
+                    "CPhoneSingleAndCallSetup::HandleCommandL EPhoneInCallCmdEndThisOutgoingCall has negative call id!" );   
+                }
+            }
+            break;
+            
+        default:
+            commandStatus = CPhoneStateCallSetup::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+ 
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,633 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneSingleAndCallSetupAndWaiting class.
+*
+*/
+
+
+// INCLUDES
+#include <eikmenub.h> 
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <pevirtualengine.h>
+#include <cpephonemodelif.h>
+#include "cphonesingleandcallsetupandwaiting.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "cphonestateincall.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+
+enum TTerminatedCall
+{
+    ENull = 0,
+    EHold,
+    ERinging,
+    EAlerting    
+};
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneSingleAndCallSetupAndWaiting::CPhoneSingleAndCallSetupAndWaiting( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::~CPhoneSingleAndCallSetupAndWaiting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndCallSetupAndWaiting::~CPhoneSingleAndCallSetupAndWaiting()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::ConstructL()
+    {
+    CPhoneGsmInCall::ConstructL();
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    iWaitingCallId = callStateData.CallId();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndCallSetupAndWaiting* CPhoneSingleAndCallSetupAndWaiting::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneSingleAndCallSetupAndWaiting* self = new( ELeave ) CPhoneSingleAndCallSetupAndWaiting( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// --------------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleKeyMessageL() ");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if( IsNumberEntryVisibleL() )
+                {
+                CPhoneState::CallFromNumberEntryL();                            
+                }
+            else
+                {
+                // Number entry is behind waiting call bubble
+                // We can't answer to waiting call in this state
+                // so display Not allowed -note.                        
+                CPhoneState::SendGlobalErrorNoteL( 
+                    EPhoneNoteTextNotAllowed );
+                }
+            break;
+            
+        // end-key
+        case EKeyNo:
+            if ( aMessage == EPhoneKeyLongPress )
+                {
+                // Close all connections
+                iStateMachine->SendPhoneEngineMessage(
+                    MPEPhoneModel::EPEMessageTerminateAllConnections );
+                 
+                if ( IsNumberEntryContentStored() )
+                    {
+                    ClearNumberEntryContentCache();
+                    }
+                
+                if ( CPhoneState::IsNumberEntryUsedL() )
+                    {
+                    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+                        {
+                        CloseDTMFEditorL();
+                        } 
+                    else
+                        {
+                        // Remove number entry from screen
+                        iViewCommandHandle->ExecuteCommandL( 
+                            EPhoneViewRemoveNumberEntry );
+                        // Do state-specific operation when number entry is cleared
+                        HandleNumberEntryClearedL();
+                        }
+                    }
+                if ( !TopAppIsDisplayedL() )
+                    {
+                    // Bring app to foreground
+                    TPhoneCmdParamInteger uidParam;
+                    uidParam.SetInteger( KUidPhoneApplication.iUid );
+                    iViewCommandHandle->ExecuteCommandL(
+                        EPhoneViewBringAppToForeground, &uidParam );
+                    }
+                }
+            else
+                {
+                // handle end key
+                DisconnectOutgoingCallL();              
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnecting:
+            iAlerting = ETrue;
+            HandleConnectingL( aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+                    
+        case MEngineMonitor::EPEMessageRemoteBusy:
+            // If call setup failed then stop capturing keys.
+            // Flow through to default branch.
+            CaptureKeysDuringCallNotificationL( EFalse );     
+        default:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting:HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneSingleAndCallSetupAndWaiting::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleCommandL() ");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {               
+        // 'End active call' from menu
+        case EPhoneInCallCmdEndThisActiveCall:
+            DisconnectOutgoingCallL();
+            break;
+        
+        // 'End all calls' from menu
+        case EPhoneInCallCmdEndAllCalls:
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageReleaseAll );
+            break;
+            
+        case EPhoneDtmfDialerCancel:
+            {
+            CloseDTMFEditorL();
+            }
+            break;    
+            
+        default:
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::OpenMenuBarL() ");
+    TInt resourceId;
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneAlertingHeldAndWaitingCallMenuBarWithNumberEntry;
+        }
+    else
+        {
+        resourceId = EPhoneAlertingHeldAndWaitingCallMenuBar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting:HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleIdleL() ");
+    // Fetch call ids for hold, ringing and alerting bubbles
+    TInt holdCallId;
+    TInt ringingCallId;
+    TInt alertingCallId;
+    TPhoneViewResponseId heldResponse;
+    TPhoneViewResponseId ringingResponse;
+    TPhoneViewResponseId alertingResponse;
+    TPhoneCmdParamCallStateData callStateData;
+    
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+    
+    callStateData.SetCallState( EPEStateHeld );
+    heldResponse = iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    holdCallId = callStateData.CallId();
+    
+    callStateData.SetCallState( EPEStateRinging );
+    ringingResponse = iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    ringingCallId = callStateData.CallId();
+                
+    callStateData.SetCallState( EPEStateConnecting );
+    alertingResponse = iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    alertingCallId = callStateData.CallId();
+    
+    if( heldResponse != EPhoneViewResponseSuccess ||
+        ringingResponse != EPhoneViewResponseSuccess ||
+        alertingResponse != EPhoneViewResponseSuccess )
+        {
+        // Some or all call id fetches were unsuccesfull.
+        // Terminate all connections and return to idle state.
+        
+        // TBD: Kill all bubbles here
+
+        iStateMachine->SendPhoneEngineMessage(
+            MPEPhoneModel::EPEMessageTerminateAllConnections );
+            
+        CPhoneGsmInCall::HandleIdleL( aCallId );            
+        return;
+        }
+
+    // Find out which call was terminated
+    TTerminatedCall terminatedCall = ENull;
+    if( holdCallId < 0 )
+        {
+        terminatedCall = EHold;            
+        }
+    else if( ringingCallId < 0 )
+        {
+        terminatedCall = ERinging;            
+        }
+    else if( alertingCallId < 0 )
+        {
+        terminatedCall = EAlerting;            
+        }
+    
+    switch( terminatedCall )
+        {
+        case EHold:
+            // Idle message came for hold call
+            StateChangeToCallSetupAndWaitingL( aCallId );            
+            break;
+            
+        case ERinging:
+            // Idle message came for ringing call
+            StateChangeToSingleAndAlertingL( aCallId );                    
+            break;        
+            
+        case EAlerting:
+            // Idle message came for alerting call
+            StateChangeToSingleAndWaitingL( aCallId );            
+            break;
+            
+        default:
+            break;
+        }
+
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting:HandleConnectingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
+    
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+    
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    BeginUiUpdateLC();
+
+    // Update bubble content
+    UpdateRemoteInfoDataL( aCallId );
+    
+    // Update bubble type
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnecting );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+        
+    EndUiUpdate();                
+
+    // Set call waiting cba
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    
+    // Stop key Capture when the phone is connecting
+    CaptureKeysDuringCallNotificationL( EFalse );           
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
+    // Keep Phone in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+    
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+    
+    // Capturing keys and number entry must be removed because some
+    // networks jump over connecting state directly to connected state.
+    CaptureKeysDuringCallNotificationL( EFalse );
+    
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    
+    HandleColpNoteL( aCallId );
+
+    if ( aCallId != iWaitingCallId )
+        {
+        // Alerting call is connected
+        StateChangeToTwoSinglesAndWaitingL( aCallId );
+        }
+    else   
+        {
+        // Waiting call is connected while alerting call is disconnecting
+        // (manual control sequence '1' + Send). 
+        StateChangeToTwoSinglesL( aCallId );                      
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting:StateChangeToCallSetupAndWaitingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() ");
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+        
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    
+    // Reset Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
+
+    BeginUiUpdateLC();
+    
+    SetTouchPaneButtons( EPhoneCallSetupButtons );
+    SetToolbarDimming( ETrue );
+    SetToolbarButtonLoudspeakerEnabled();
+    
+    EndUiUpdate();
+    
+    // Go to Call Setup And Waiting state
+    // No need to update cbas
+    iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndWaitingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL() ");
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+    
+    CheckIfRestoreNEContentAfterDtmfDialer();
+      
+    if ( CPhoneState::IsNumberEntryUsedL() )
+        {
+        // Show number entry
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( ETrue );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
+        }
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    
+        // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    BeginUiUpdateLC();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    
+    EndUiUpdate();
+    // Go to Single And Waiting state  
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
+    iStateMachine->ChangeState( EPhoneStateWaitingInSingle );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting:StateChangeToSingleAndAlertingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() ");
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Remove the number entry if it isn't DTMF dialer
+    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
+        }
+    
+    // Set Hold flag to view EFalse that dtmf menu item not delete
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    BeginUiUpdateLC();
+    
+    SetTouchPaneButtons( EPhoneCallSetupButtons );
+    
+    EndUiUpdate();
+    // Go to Single And Alerting state
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL( TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
+
+    BeginUiUpdateLC();
+    
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+    SetTouchPaneButtons( EPhoneTwoSinglesButtons );
+    
+    EndUiUpdate();
+
+    // Go to two singles state 
+    UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+    iStateMachine->ChangeState( EPhoneStateTwoSingles );                     
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL( TInt /*aCallId*/ )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
+
+    BeginUiUpdateLC();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
+    
+    EndUiUpdate();
+
+    // Go to two singles state and waiting
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndCallSetupAndWaiting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndCallSetupAndWaiting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleAndCallSetupAndWaiting::UpdateInCallCbaL() ");
+    
+    if ( iAlerting )
+        {
+        UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+        }
+    else
+        {
+        UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+        }
+    }
+    
+                
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonesingleandwaiting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,864 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneSingleAndWaiting class.
+*
+*/
+
+
+// INCLUDES
+#include <eikmenub.h>
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <featmgr.h>
+#include <pevirtualengine.h>
+#include <mpeengineinfo.h>
+#include <telephonyvariant.hrh>
+#include <cpephonemodelif.h>
+#include "cphonesingleandwaiting.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "cphonegsmincall.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "cphonecenrepproxy.h"
+#include "cphonepubsubproxy.h"
+#include "mphonestorage.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneSingleAndWaiting::CPhoneSingleAndWaiting(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) :
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ),
+    iSingleCallId ( KErrNotFound )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::~CPhoneSingleAndWaiting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndWaiting::~CPhoneSingleAndWaiting()
+    {
+    if ( iViewCommandHandle )
+        {
+        TPhoneCmdParamBoolean dtmfSendFlag;
+        dtmfSendFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommand( EPhoneViewSetVideoCallDTMFVisibilityFlag,
+                &dtmfSendFlag );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::ConstructL()
+    {
+    CPhoneGsmInCall::ConstructL();
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+
+    if ( callStateData.CallId() == KErrNotFound )
+        {
+        callStateData.SetCallState( EPEStateHeld );
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+        }
+    iSingleCallId = callStateData.CallId();
+
+    __PHONELOG1( EBasic, EPhoneUIStates,
+        "CPhoneSingleAndWaiting::ConstructL()  (iSingleCallId=%d)", iSingleCallId);
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleAndWaiting* CPhoneSingleAndWaiting::NewL(
+    MPhoneStateMachine* aStateMachine,
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneSingleAndWaiting* self = new( ELeave ) CPhoneSingleAndWaiting(
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandlePhoneEngineMessageL(
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageHeld:
+            HandleHeldL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageDialing:
+            HandleDiallingL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageDisconnecting:
+            HandleDisconnectingL( aCallId );
+            /* Flow through */
+
+        default:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting:HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneSingleAndWaiting::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleCommandL() ");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneInCallCmdHold:
+            {
+            iStateMachine->SetCallId( iSingleCallId );
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageHold );
+            break;
+            }
+
+        case EPhoneInCallCmdUnhold:
+            {
+            iStateMachine->SetCallId( iSingleCallId );
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageResume );
+            break;
+            }
+
+        case EPhoneInCallCmdNewCall:
+            LaunchNewCallQueryL();
+            break;
+
+        case EPhoneInCallCmdNewCallCall:
+            CallFromNewCallQueryL();
+            break;
+
+        case EPhoneCallComingCmdReject: // fall through
+            {
+            // Get waiting callid
+            TPhoneCmdParamCallStateData callStateData;
+            callStateData.SetCallState( EPEStateRinging );
+            iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+                &callStateData );
+            iStateMachine->SetCallId( callStateData.CallId() );
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageReject );
+            break;
+            }
+
+
+        case EPhoneInCallCmdReject:
+            iStateMachine->SetCallId( iSingleCallId );
+            iStateMachine->SendPhoneEngineMessage(
+                MPEPhoneModel::EPEMessageReject );
+            break;
+
+        case EPhoneCmdUpdateUiControls:
+            UpdateUiControlsL();
+            break;
+
+        default:
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::OpenMenuBarL() ");
+    TInt resourceId ( KErrNone );
+
+
+    if ( !IsAutoLockOn() )
+        {
+         if( IsVideoCallActiveL() || IsVideoCallRingingL() )
+            {
+            //DTMF hiding will be set to TRUE
+            if( IsVideoCallActiveL() )
+                {
+                TPhoneCmdParamBoolean dtmfSendFlag;
+                dtmfSendFlag.SetBoolean( ETrue );
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallDTMFVisibilityFlag,
+                        &dtmfSendFlag );
+                }
+            if ( IsNumberEntryVisibleL() )
+                {
+                resourceId = EPhoneVideoCallWaitingMenubarWithNumberEntry;
+                }
+            else
+                {
+                resourceId = EPhoneVideoCallWaitingMenubar;
+                }
+            }
+
+        else // single voice and waiting voice
+            {
+            if ( IsNumberEntryVisibleL() )
+                {
+                resourceId = EPhoneCallWaitingMenubarWithNumberEntry;
+                }
+            else
+                {
+                resourceId = EPhoneCallWaitingMenubar;
+                }
+            }
+        }
+    else
+        {
+        resourceId = EPhoneCallWaitingLockMenubar;
+        }
+
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger(
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
+        &integerParam );
+    }
+
+// --------------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleKeyMessageL(
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleKeyMessageL() ");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            {
+            if( IsNumberEntryVisibleL() )
+                {
+                // Send a manual control sequence by providing number
+                // information with Dial command
+                CallFromNumberEntryL();
+                }
+             else
+                {
+                // Close DTMF sending note if it exists
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
+
+                // Number entry is below incoming call bubble so
+                // answer the call
+                iStateMachine->SendPhoneEngineMessage(
+                    CPEPhoneModelIF::EPEMessageAnswer );
+                }
+            break;
+            }
+
+        default:
+            // do base operation
+            CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aEventCode*/ )
+    {
+    if( EKeyDeviceF == aKeyEvent.iCode )
+        {
+        __PHONELOG( EBasic, EPhoneUIStates,
+            "CPhoneSingleAndWaiting::HandleKeyMessageL-deviceF" );
+        HandleHoldSwitchL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleIdleL() ");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    if ( iSingleCallId == KErrNotFound )
+        {
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateDisconnecting );
+
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+
+        if ( callStateData.CallId() == KErrNotFound )
+            {
+            callStateData.SetCallState( EPEStateConnected );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+
+            if ( callStateData.CallId() == KErrNotFound )
+                {
+                callStateData.SetCallState( EPEStateHeld );
+                iViewCommandHandle->HandleCommandL(
+                    EPhoneViewGetCallIdByState, &callStateData );
+                }
+            }
+
+        iSingleCallId = callStateData.CallId();
+        }
+
+    __PHONELOG1( EBasic, EPhoneControl, 
+        "CPhoneSingleAndWaiting::HandleIdleL iSingleCallId(%d)",
+        iSingleCallId );
+    __PHONELOG1( EBasic, EPhoneControl, 
+        "CPhoneSingleAndWaiting::HandleIdleL aCallId(%d)",
+        aCallId );
+    
+    if( iSingleCallId == aCallId )
+        {
+        // Idle message came for active call
+        BeginUiUpdateLC();
+
+        // Remove call
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+        // Get waiting callId
+        TPhoneCmdParamCallStateData callStateData;
+        callStateData.SetCallState( EPEStateRinging );
+        iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
+            &callStateData );
+        
+        __PHONELOG1( EBasic, EPhoneControl, 
+            "CPhoneSingleAndWaiting::HandleIdleL EPEStateRinging CallId(%d)",
+            callStateData.CallId() );
+        
+        if ( callStateData.CallId() > KErrNotFound )
+            {
+            // Display ringing bubble
+            TPhoneCmdParamCallHeaderData callHeaderParam;
+            callHeaderParam.SetCallState( EPEStateRinging );
+
+            // Set Hold flag to view
+            TPhoneCmdParamBoolean holdFlag;
+            holdFlag.SetBoolean( EFalse );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+            
+            SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam );
+            
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble,
+                callStateData.CallId(),
+                &callHeaderParam );
+
+            // Hide number entry if visible
+            if ( IsNumberEntryVisibleL() )
+                {
+                SetNumberEntryVisibilityL(EFalse);
+                }
+
+            // Check if HW Keys or Call UI should be disabled
+            CheckDisableHWKeysAndCallUIL();
+            
+            SetTouchPaneButtons( EPhoneIncomingCallButtons );
+            SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
+            
+            // Bring up callhandling view
+            BringIncomingToForegroundL();
+
+            //Set incoming cba
+            iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
+            UpdateSilenceButtonDimming();
+            
+            // Play ringtone
+            SetRingingTonePlaybackL( callStateData.CallId() );
+            }
+        SetToolbarDimming( ETrue );
+        SetBackButtonActive(EFalse);
+        EndUiUpdate();
+
+        iStateMachine->ChangeState( EPhoneStateIncoming );
+        }
+    else
+        {
+        // Effect is shown when dialer exist.
+        TBool effectStarted ( EFalse );
+        if ( !NeedToSendToBackgroundL() )
+            {
+            BeginTransEffectLC( ENumberEntryOpen );
+            effectStarted = ETrue;
+            }
+
+        BeginUiUpdateLC();
+
+        // Remove call
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+        // Idle message came for waiting call
+        if ( IsNumberEntryUsedL() )
+            {
+            if ( NeedToSendToBackgroundL() )
+                {
+                // Return phone to the background if send to background is needed.
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+
+                UpdateCbaL( EPhoneCallHandlingInCallCBA );
+                }
+            else
+                {
+                // Show the number entry if it exists
+                SetNumberEntryVisibilityL(ETrue);
+                }
+            }
+        else
+            {
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            // If numberentry is not open just check NeedToSendToBackgroundL and
+            // sendbackround if needed.
+            if ( NeedToSendToBackgroundL() )
+                {
+                // Return phone to the background if send to background is needed.
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+                }
+            }
+        
+        // Enable call UI
+        if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+            && iStateMachine->PhoneStorage()->IsScreenLocked() )
+            {
+            EnableCallUIL();
+            }
+
+        // Reset blocked keys list
+        iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+
+        SetTouchPaneButtons( EPhoneIncallButtons );
+        EndUiUpdate();
+        if( effectStarted )
+            {
+            EndTransEffect();
+            }
+        // CBA updates in above if-else conditions
+        iStateMachine->ChangeState( EPhoneStateSingle );
+        }
+
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleHeldL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleHeldL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleHeldL() ");
+
+     // Display hold bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateHeld );
+
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    TInt callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCallOnHold );
+
+    StringLoader::Load( labelText, callLabelId, CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( labelText );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
+        &callHeaderParam );
+
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        HandleHoldNoteL( aCallId, ETrue );
+        }
+
+    UpdateInCallCbaL();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons ); 
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleConnectedL() ");
+
+    __PHONELOG1( EBasic, EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleConnectedL  (CallId=%d)", aCallId);
+
+    if ( iSingleCallId == aCallId )
+        {
+        // Connected message came for the hold call, we still
+        // have the waiting call also
+        HandleUnholdL( aCallId );
+        }
+    else
+        {
+        // Connected message came for waiting call
+        MakeStateTransitionToTwoSinglesL( aCallId );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleUnholdL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleUnholdL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleUnholdL() ");
+    // Close menu if focus is somewhere else than number entry.
+    if ( !IsNumberEntryUsedL() )
+        {
+        // Close menubar
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+        }
+
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
+        &callHeaderParam );
+
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        HandleHoldNoteL( aCallId, EFalse );
+        }
+
+    // Set CBAs
+    UpdateInCallCbaL();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons ); 
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::MakeStateTransitionToTwoSinglesL() ");
+
+    // Effect is shown when dialer exist.
+    TBool effectStarted ( EFalse );
+    if ( !NeedToSendToBackgroundL() )
+        {
+        BeginTransEffectLC( ENumberEntryOpen );
+        effectStarted = ETrue;
+        }
+    
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+    
+    BeginUiUpdateLC();
+
+    UpdateRemoteInfoDataL ( aCallId );
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
+        &callHeaderParam );
+
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    if ( IsNumberEntryUsedL() )
+        {
+        if ( NeedToSendToBackgroundL() )
+            {
+            // Return phone to the background if send to background is needed.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            }
+        else
+            {
+            // Show the number entry if it exists.
+            SetNumberEntryVisibilityL(ETrue);
+            }
+        }
+    else
+        {
+        // Set Two singles softkeys
+        UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+        }
+
+    // Close dtmf dialer if exist.
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        CloseDTMFEditorL();
+        }
+    else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
+        {
+        CloseCustomizedDialerL();
+        }
+
+    SetTouchPaneButtons( EPhoneTwoSinglesButtons );
+    EndUiUpdate();
+    if( effectStarted )
+        {
+        EndTransEffect();
+        }
+
+    // Go to two singles state
+    // CBA updates in above if-else conditions
+    iStateMachine->ChangeState( EPhoneStateTwoSingles );
+    }
+
+// ---------------------------------------------------------
+// CPhoneSingleAndWaiting::CallFromNewCallQueryL
+// ---------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::CallFromNewCallQueryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::CallFromNewCallQueryL() ");
+    // First get the phone number from the dialog
+    TPhoneCmdParamString phoneNumberParam;
+    HBufC *content = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( content->Des() );
+    phoneNumberParam.SetString( &ptr );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
+        &phoneNumberParam );
+
+    // Store the phone number
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
+
+    // clean up stack
+    CleanupStack::PopAndDestroy( content );
+
+    DialVoiceCallL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleDiallingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleDiallingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::HandleDiallingL() ");
+
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC();
+
+    // Hide number entry if it exists
+    SetNumberEntryVisibilityL(EFalse);
+
+    // Display call setup
+    DisplayCallSetupL( aCallId );
+
+    // Set Hold flag to view ( DTMF menu label have to present )
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    SetTouchPaneButtons( EPhoneCallSetupButtons );
+
+    EndUiUpdate();
+    EndTransEffect();
+
+    // Update call setup CBAs
+    UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+
+    // Go to Single And Waiting And Call Setup state
+    iStateMachine->ChangeState( EPhoneStateSingleAndCallSetupAndWaiting );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::DisplayCallSetupL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::DisplayCallSetupL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::DisplayCallSetupL() ");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Remove dialogs if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    // Capture keys when the phone is dialling
+    CaptureKeysDuringCallNotificationL( ETrue );
+
+    // Force telephony to the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Display call setup header
+    DisplayHeaderForOutgoingCallL( aCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneSingleAndWaiting::UpdateInCallCbaL() ");
+    TPhoneCmdParamInteger callIdParam;
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewGetExpandedBubbleCallId, &callIdParam );
+
+    if ( callIdParam.Integer()==iSingleCallId )
+        {
+        CPhoneGsmInCall::UpdateInCallCbaL();
+        } 
+    else 
+        {
+        iCbaManager->SetCbaL(  EPhoneCallHandlingCallWaitingCBA );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleErrorL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneSingleAndWaiting::HandleErrorL( const TPEErrorInfo& aErrorInfo )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::HandleErrorL()");
+
+    if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer )
+        {
+        // Should not shown "Not Allowed" note, if active call.
+        __PHONELOG1( EBasic, EPhoneUIStates,
+            "PhoneUIControl: CPhoneSingleAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ",
+            aErrorInfo.iErrorCode);
+        }
+    else
+        {
+        CPhoneState::HandleErrorL( aErrorInfo );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::HandleDisconnectingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::HandleDisconnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::HandleDisconnectingL( ) ");
+    
+    if( ( iSingleCallId == aCallId ) && IsVideoCall( aCallId ) )
+        {
+        __PHONELOG( EBasic, EPhoneControl, 
+            "CPhoneSingleAndWaiting::HandleDisconnectingL EPhoneViewSetNeedToSendToBackgroundStatus" );
+        
+        // Keep phone on the foreground
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetNeedToSendToBackgroundStatus,
+            &booleanParam );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleAndWaiting::UpdateUiControlsL
+// -----------------------------------------------------------
+//
+void CPhoneSingleAndWaiting::UpdateUiControlsL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::UpdateUiControlsL( ) ");
+    
+    UpdateInCallCbaL();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonesinglecall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,801 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneSingleCall class.
+*
+*/
+
+
+// INCLUDES
+#include <eikmenub.h> 
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <featmgr.h>
+#include <pevirtualengine.h>
+#include <mpeengineinfo.h>
+#include <cpephonemodelif.h>
+#include <connect/sbdefs.h>
+#include <videotelcontrolmediatorapi.h>
+#include <MediatorDomainUIDs.h>
+#include <telephonyvariant.hrh>
+
+#include "cphonesinglecall.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparaminteger.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonestatedefinitionsgsm.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phonelogger.h"
+#include "cphonepubsubproxy.h"
+#include "cphonemediatorfactory.h"
+#include "cphonemediatorsender.h"
+#include "cphoneswitchtovideoorvoicecommand.h"
+#include "mphonestorage.h"
+#include "cphonecenrepproxy.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneSingleCall::CPhoneSingleCall( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::~CPhoneSingleCall()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneSingleCall::~CPhoneSingleCall()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneSingleCall::ConstructL()
+    {
+    CPhoneGsmInCall::ConstructL();
+    
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    // Fetch active call's id from view    
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateConnected );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+            
+    if( callStateData.CallId() == KErrNotFound )
+        {
+        holdFlag.SetBoolean( ETrue );
+        // No connected call, find the hold call
+        callStateData.SetCallState( EPEStateHeld );                    
+        iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );
+            
+        if ( callStateData.CallId() == KErrNotFound ) 
+            {
+            // No hold call, find the disconnected call
+            callStateData.SetCallState( EPEStateDisconnecting );                    
+            iViewCommandHandle->HandleCommandL(
+            EPhoneViewGetCallIdByState, &callStateData );    
+            }
+        }
+
+    iCallId = callStateData.CallId();
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    
+    // Update phone number availability for menu use
+    PhoneNumberAvailableInPhoneEngineL( callStateData.CallId() );
+      
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneSingleCall* CPhoneSingleCall::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneSingleCall* self = new( ELeave ) CPhoneSingleCall( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// --------------------------------------------------------------
+// CPhoneSingleCall::HandleKeyMessageL
+// --------------------------------------------------------------
+//
+EXPORT_C void CPhoneSingleCall::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            if( IsNumberEntryUsedL() )
+                {
+                if ( IsVideoCallActiveL() )
+                    {
+                    HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+                    TPtr ptr( phoneNumber->Des() );
+                    TPhoneCmdParamString stringParam;
+                    stringParam.SetString( &ptr );
+                    iViewCommandHandle->ExecuteCommand(
+                        EPhoneViewGetNumberFromEntry,
+                        &stringParam );
+                    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ) ;
+                                            
+                    if (  iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ||
+                          phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
+                        {  
+                        // Send a manual control sequence by providing number 
+                        // information with dial command
+                        CallFromNumberEntryL();
+                        }
+                    else
+                        {
+                        iStateMachine->SendPhoneEngineMessage( 
+                            MPEPhoneModel::EPEMessageCheckEmergencyNumber );
+                        }
+                    CleanupStack::PopAndDestroy( phoneNumber ); 
+                    }
+                else
+                    {
+                    // Provide number information with dial command
+                    CallFromNumberEntryL();
+                    }
+                }
+            else
+                {
+                ToggleHoldL();                    
+                }
+            break;
+            
+        default:
+            // do base operation
+            CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneSingleCall::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageHeld:
+            HandleHeldL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageIncoming:
+            HandleIncomingL( aCallId );
+            break;
+                
+        case MEngineMonitor::EPEMessageDialing:
+            HandleDiallingL( aCallId );
+            break;
+        
+        /* Flow through */ 
+        case MEngineMonitor::EPEMessageRemoteTerminated:  
+        case MEngineMonitor::EPEMessageDisconnecting:
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        
+        case MEngineMonitor::EPEMessageInValidEmergencyNumber:
+            SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
+            break;
+            
+        case MEngineMonitor::EPEMessageValidEmergencyNumber:
+            DialVoiceCallL();
+            break;
+            
+        default:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::HandleCommandL
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneSingleCall::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::HandleCommandL()");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        /* Flow through */           
+        case EPhoneInCallCmdHold:
+        case EPhoneInCallCmdUnhold:
+            ToggleHoldL();
+            break;
+            
+        case EPhoneInCallCmdNewCall:
+            LaunchNewCallQueryL();
+            break;
+            
+        case EPhoneInCallCmdNewCallCall:
+            CallFromNewCallQueryL();
+            break;
+
+        case EPhoneInCallCmdSwitchToVideo:
+            SwitchToVideoL();
+            break;
+            
+        case EPhoneInCallCmdSwitchToVoice:
+            SwitchToVoiceL();
+            break;
+            
+        case EPhoneCmdYesSwitchToVideo:
+            // Set current call id
+            iStateMachine->SetCallId( iCallId );
+            iStateMachine->SendPhoneEngineMessage(
+                CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice );
+            break;
+        
+        /* Flow through */ 
+        case EPhoneCmdNoSwitchToVideo:
+        case EPhoneCmdNoSwitchToVoice:
+            // Sets touch buttons to correct status if 'No' command has occured.    
+            iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons );    
+            break;        
+                
+        case EPhoneCmdYesSwitchToVoice:
+            // Set current call id
+            iStateMachine->SetCallId( iCallId );
+                        if( IsVideoCall( iCallId ) )
+                        {
+                           // Video call can be released only after we get response to VT Shutdown Command
+                           CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
+                                                                                      KCatPhoneToVideotelCommands, 
+                                                                                      EVtCmdReleaseDataport,
+                                                                                      TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                                                            KPhoneToVideotelCmdVersionMinor, 
+                                                                                            KPhoneToVideotelCmdVersionBuild ),
+                                                                                      KNullDesC8,
+                                                                                      CPhoneSwitchToVideoOrVoiceCommand::NewL( *iStateMachine ) );
+                        }
+                        else
+                        {
+                          iStateMachine->SendPhoneEngineMessage(
+                              CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice );                    
+                        }
+            break;
+
+        case EPhoneVideoSharing:
+        case EPhoneVideoSharingOpt2:
+        case EPhoneVideoSharingOpt3:
+            {
+            TPhoneCmdParamInteger command;
+            command.SetInteger( aCommand );
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendAiwCommand, 
+                &command );                
+            }
+            break;           
+            
+        default:
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::OpenMenuBarL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneSingleCall::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::OpenMenuBarL()");
+
+    if ( IsVideoCall ( iCallId ))
+        {
+        OpenVideoCallMenuBarL();
+        }
+    else
+        {
+        CPhoneGsmInCall::OpenMenuBarL();            
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::CallId
+// -----------------------------------------------------------
+//
+EXPORT_C TInt CPhoneSingleCall::CallId() const
+    {
+    return iCallId;
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::OpenVideoCallMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::OpenVideoCallMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::OpenVideoCallMenuBarL()");
+    if( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+        {
+        TInt resourceId;
+
+        if ( IsNumberEntryUsedL() )
+            {
+            resourceId = EPhoneVideoCallMenubarWithNumberEntry;
+            }
+        else
+            {
+            resourceId = EPhoneVideoCallMenubar;
+            }
+        
+        TPhoneCmdParamInteger integerParam;
+        integerParam.SetInteger( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( resourceId ) );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+            &integerParam );
+        }                    
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleCall::HandleHeldL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::HandleHeldL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::HandleHeldL()");
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateHeld );
+    
+    TInt callLabelId;
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCallOnHold );
+
+    StringLoader::Load( 
+        labelText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( labelText );
+ 
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewUpdateBubble, aCallId, &callHeaderParam );
+       
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( ETrue );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+        
+    if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        { 
+        HandleHoldNoteL( aCallId , ETrue );
+        }
+
+    UpdateInCallCbaL();
+    SetTouchPaneButtons( EPhoneIncallHeldButtons );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleCall::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::HandleConnectedL()");
+    
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+    
+    // Get initial hold flag from view. 
+    TPhoneCmdParamBoolean holdFlag;
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetHoldFlag, &holdFlag );
+        
+    if ( holdFlag.Boolean() )
+        {
+        // Update hold flag to view
+        holdFlag.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+        
+        if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+            {
+            HandleHoldNoteL( aCallId , EFalse );
+            }
+        }
+
+    UpdateInCallCbaL();  
+    SetTouchPaneButtons( EPhoneIncallButtons );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleCall::ToggleHold
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::ToggleHoldL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::ToggleHoldL()");
+
+    TPECallControlCaps callControlCaps =
+        iStateMachine->PhoneEngineInfo()->CallControlCaps( iCallId );
+    
+    if ( callControlCaps & MCCECallObserver::ECCECapsHold  )
+        {
+        iStateMachine->SetCallId( iCallId );         
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageHold );    
+        }
+    else if ( callControlCaps & MCCECallObserver::ECCECapsResume )
+        {
+        iStateMachine->SetCallId( iCallId );         
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageResume );    
+        }
+    else
+        {
+        SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed );    
+        }
+    }
+        
+// -----------------------------------------------------------
+// CPhoneSingleCall::HandleIncomingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::HandleIncomingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::HandleIncomingL()");
+    
+    BeginUiUpdateLC();
+    
+    TPhoneCmdParamBoolean dialerParam;
+    dialerParam.SetBoolean( ETrue );
+    
+    // Get allow waiting call header param value.
+    AllowShowingOfWaitingCallHeaderL( dialerParam );    
+
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam );
+    
+    // Show incoming call buttons
+    SetTouchPaneButtons( EPhoneWaitingCallButtons ); 
+    
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+            && !CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) 
+            && ( IsKeyLockOn() || IsAutoLockOn() ) )
+        {
+        DisableCallUIL();
+        }
+    else
+        {
+        // if keys have been locked, disable keylock without information note
+        if ( IsKeyLockOn() )
+            {
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
+            }
+        }
+    
+    if( CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) 
+            && ( IsKeyLockOn() || IsAutoLockOn() ) )
+        {
+        DisableHWKeysL();
+        }
+        
+    EndUiUpdate();
+
+    // This query is required to dismiss
+    // Operation cannot be completed in waiting and single state
+    if ( iSwitchToVideoQuery )
+        {
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
+        }
+    
+    // Go to incoming state
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    iStateMachine->ChangeState( EPhoneStateWaitingInSingle );        
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleCall::DisplayIncomingCallL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::DisplayIncomingCallL( 
+    TInt aCallId, 
+    const TPhoneCmdParamBoolean aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::DisplayIncomingCallL()");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Cannot delete active note, e.g. New call query, 
+    // but show waiting note with or without caller name
+    if ( IsAnyQueryActiveL() || 
+        ( !aCommandParam.Boolean() && iOnScreenDialer ) )
+        {
+        CallWaitingNoteL( aCallId );        
+        }
+    else
+        {
+        // Remove any phone dialogs if they are displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+        }
+    
+    // Indicate that the Phone needs to be sent to the background if
+    // an application other than the top application is in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        &booleanParam );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+
+    DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call 
+    }    
+    
+// ---------------------------------------------------------
+// CPhoneSingleCall::CallFromNewCallQueryL
+// ---------------------------------------------------------
+//
+void CPhoneSingleCall::CallFromNewCallQueryL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::CallFromNewCallQueryL()");
+    // First get the phone number from the dialog
+    TPhoneCmdParamString phoneNumberParam;
+    HBufC *content = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    TPtr ptr( content->Des() );
+    phoneNumberParam.SetString( &ptr );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
+        &phoneNumberParam );
+
+    // Store the phone number
+    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
+
+    // clean up stack
+    CleanupStack::PopAndDestroy( content );
+    
+    DialVoiceCallL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::HandleDiallingL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::HandleDiallingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::HandleDiallingL()");
+    
+    BeginTransEffectLC( ENumberEntryClose );
+    BeginUiUpdateLC();
+    
+    SetNumberEntryVisibilityL(EFalse);
+
+    // Display call setup 
+    DisplayCallSetupL( aCallId );
+    
+    // Show incoming call buttons
+    SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons );
+
+    EndUiUpdate();
+    
+    EndTransEffect();
+
+    // Go to call setup state
+    UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+    iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleCall::DisplayCallSetupL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::DisplayCallSetupL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::DisplayCallSetupL()");
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Remove dialogs if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    // Capture keys when the phone is dialling
+    CaptureKeysDuringCallNotificationL( ETrue );
+
+    // Force telephony to the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Display call setup header
+    DisplayHeaderForOutgoingCallL( aCallId );
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::SetCallHoldL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::SetCallHoldL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::SetCallHold()");
+    
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallId( iCallId );
+    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
+        &callStateData );
+    
+    if( callStateData.CallState() == EPEStateConnected && !IsVideoCallActiveL() )
+        {
+        iStateMachine->SetCallId( iCallId );         
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageHold );    
+        }
+    else
+        {
+        // Show not allowed note
+        SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed );    
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneSingleCall::SetCallResumeL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::SetCallResumeL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::SetCallHold()");
+
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallId( iCallId );
+    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
+        &callStateData );
+    
+    if( callStateData.CallState() == EPEStateHeld )
+        {
+        iStateMachine->SetCallId( iCallId );
+        iStateMachine->SendPhoneEngineMessage(
+            CPEPhoneModelIF::EPEMessageResume );
+        }
+    else
+        {
+        // Show not allowed note
+        SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed );    
+        }                
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::SwitchToVideoL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::SwitchToVideoL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::SwitchToVideoL()");
+
+    if( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
+        {        
+        TInt networkMode( CPhonePubSubProxy::Instance()->Value( KPSUidNetworkInfo,
+            KNWTelephonyNetworkMode ) );
+        TBool restoreOngoing( CPhonePubSubProxy::Instance()->Value( KUidSystemCategory,
+            conn::KUidBackupRestoreKey ));
+    
+        TBool resetTouchButtons = EFalse;
+        
+        if ( networkMode != ENWNetworkModeWcdma )
+            {
+            // We aren't in 3G, video call not possible
+            SendGlobalInfoNoteL( EPhoneInformationNoNetworkSupportForVideoCallNote );    
+            resetTouchButtons = ETrue;
+            }
+        else if ( restoreOngoing & ( conn::EBURRestoreFull | conn::EBURRestorePartial ))
+            {
+            // MC restore ongoing
+            SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
+            resetTouchButtons = ETrue;    
+            }
+        else
+            {
+        iSwitchToVideoQuery = ETrue;
+        ShowQueryL( EPhoneSwitchToVideoQuery );
+        iSwitchToVideoQuery = EFalse;
+        }    
+    
+        if( resetTouchButtons )
+            {
+            // Sets touch buttons to correct status if error has occured.    
+            iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons ); 
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneSingleCall::SwitchToVoiceL
+// -----------------------------------------------------------
+//
+void CPhoneSingleCall::SwitchToVoiceL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneSingleCall::SwitchToVoiceL()");
+    
+    ShowQueryL( EPhoneSwitchToVoiceQuery );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonestartup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStartup class.
+*
+*/
+
+
+// INCLUDES
+#include "cphonestartup.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "cphonegeneralgsmmessageshandler.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneStartup::CPhoneStartup( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    TBool aPEReady ) : 
+    CPhoneStateStartup( aStateMachine, aViewCommandHandle, NULL )
+    {
+    iPEReady = aPEReady;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStartup::~CPhoneStartup()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneStartup::~CPhoneStartup()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStartup::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStartup::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneStartup::ConstructL()");
+    CPhoneStateStartup::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStartup::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStartup* CPhoneStartup::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle, 
+    TBool aPEReady )
+    {
+    CPhoneStartup* self = new (ELeave) 
+        CPhoneStartup( aStateMachine, aViewCommandHandle, aPEReady );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStartup::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneStartup::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIStates, 
+        "CPhoneStartup::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageRemoteHeld:
+            CPhoneState::SendGlobalInfoNoteL( 
+                EPhoneInformationRemotePutOnHoldNote );
+            break;
+        
+        case MEngineMonitor::EPEMessageRemoteResumed:
+            CPhoneState::SendGlobalInfoNoteL( 
+                EPhoneInformationConnectedNote );
+            break;
+
+        case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through
+        case MEngineMonitor::EPEMessageCallBarred: // fall through
+        case MEngineMonitor::EPEMessageShowVersion: // fall through
+        case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through
+        case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
+        case MEngineMonitor::EPEMessageIncCallIsForw: // fall through
+        case MEngineMonitor::EPEMessageIncCallForwToC: // fall through
+        case MEngineMonitor::EPEMessageOutCallForwToC: // fall through
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through
+        case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
+            {
+            CPhoneGeneralGsmMessagesHandler* gsmMsgHandler =
+                CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine,
+                                                       *iViewCommandHandle,
+                                                       *this );
+            CleanupStack::PushL( gsmMsgHandler );
+            gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId );
+            CleanupStack::PopAndDestroy( gsmMsgHandler );
+            }
+            break;
+
+        default:
+            CPhoneStateStartup::HandlePhoneEngineMessageL( 
+                aMessage, aCallId );
+            break;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonestatemachinegsm.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateMachineGSM class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <cpephonemodelif.h>
+#include "cphonestatemachinegsm.h"
+#include "phonelogger.h"
+#include "phonestatedefinitions.h"
+#include "phonestatedefinitionsgsm.h"
+#include "cphonecallsetup.h"
+#include "cphonealerting.h"
+#include "cphonesinglecall.h"
+#include "cphonesingleandcallsetup.h"
+#include "cphonesingleandalerting.h"
+#include "cphonesingleandwaiting.h"
+#include "cphonetwosingles.h"
+#include "cphoneconference.h"
+#include "cphoneconferenceandcallsetup.h"
+#include "cphoneconferenceandsingle.h"
+#include "cphoneconferenceandwaiting.h"
+#include "cphonesingleandcallsetupandwaiting.h"
+#include "cphonecallsetupandwaiting.h"
+#include "cphonetwosinglesandwaiting.h"
+#include "cphoneconferenceandsingleandwaiting.h"
+#include "cphoneemergency.h"
+#include "cphoneconferenceandwaitingandcallsetup.h"
+#include "cphoneidle.h"
+#include "cphoneincoming.h"
+#include "cphonestartup.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneStateMachineGSM::CPhoneStateMachineGSM
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneStateMachineGSM::CPhoneStateMachineGSM(
+    MPhoneViewCommandHandle* aViewCommandHandle ) :
+    CPhoneStateMachine( aViewCommandHandle )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachineGSM::~CPhoneStateMachineGSM()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneStateMachineGSM::~CPhoneStateMachineGSM()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneStateMachineGSM::~CPhoneStateMachineGSM() ");
+    if( iEmergencyState )
+        {
+        delete iEmergencyState;
+        iEmergencyState = NULL;         
+        }
+    Dll::FreeTls();
+    }
+
+// ---------------------------------------------------------
+// CPhoneStateMachineGSM::State
+// ---------------------------------------------------------
+EXPORT_C MPhoneState* CPhoneStateMachineGSM::State()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneStateMachineGSM::State() ");
+    __PHONELOG1( EBasic, EPhoneUIStates,
+            "CPhoneStateMachineGSM::State() = %d ", iNewStateId );
+            
+    TBool madeStateTransition = EFalse;
+    TBool deleteOldState( ETrue );
+    TInt err( KErrNone );
+    
+    if( iOldStateId != iNewStateId )
+        {
+        if( iOldStateId == EPhoneStateIdle ||
+            iOldStateId == EPhoneStateEmergency )
+            {
+            deleteOldState = EFalse;
+            }
+        if ( deleteOldState )
+            {
+            // Possible that derived class has been deleted iState,
+            // so this delete statement may be useless.
+            delete iState;
+            iState = NULL;                      
+            }
+        
+        // State transition need to be made - construct new state and
+        // destruct old
+        switch( iNewStateId )
+            {
+            case EPhoneStateCallSetup:
+                TRAP( err, iState = CPhoneCallSetup::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateAlerting:
+                TRAP( err, iState = CPhoneAlerting::NewL(
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateSingle:
+                TRAP( err, iState = CPhoneSingleCall::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateWaitingInSingle:
+                TRAP( err, iState = CPhoneSingleAndWaiting::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateTwoSingles:
+                TRAP( err, iState = CPhoneTwoSingles::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateCallSetupInSingle:
+                TRAP( err, iState = CPhoneSingleAndCallSetup::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateAlertingInSingle:
+                TRAP( err, iState = CPhoneSingleAndAlerting::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateConference:
+                TRAP( err, iState = CPhoneConference::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateConferenceAndCallSetup:
+                TRAP( err, iState = CPhoneConferenceAndCallSetup::NewL( 
+                    this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+ 
+            case EPhoneStateConferenceAndSingle:
+                TRAP( err, iState = CPhoneConferenceAndSingle::NewL( 
+                    this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateConferenceAndWaiting:
+                TRAP( err, iState = CPhoneConferenceAndWaiting::NewL( 
+                    this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateSingleAndCallSetupAndWaiting:
+                TRAP( err, iState = CPhoneSingleAndCallSetupAndWaiting::NewL( 
+                    this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateCallSetupAndWaiting:
+                TRAP( err, iState = CPhoneCallSetupAndWaiting::NewL( 
+                    this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+
+            case EPhoneStateTwoSinglesAndWaiting:
+                TRAP( err, iState = CPhoneTwoSinglesAndWaiting::NewL( 
+                    this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateConferenceAndSingleAndWaiting:
+                TRAP( err, iState = CPhoneConferenceAndSingleAndWaiting::NewL( 
+                    this, iViewCommandHandle, iCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateEmergency:
+                if( !iEmergencyStateConstructed )
+                    {
+                    TRAP( err, iEmergencyState = CPhoneEmergency::NewL( 
+                        this, iViewCommandHandle, iCustomization ) );
+                    __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );                                          
+                    iEmergencyStateConstructed = ETrue;
+                    }
+                static_cast< CPhoneEmergency* >( iEmergencyState )->
+                    SetStartupInterrupted( iOldStateId == EPhoneStateStartup );
+                iState = iEmergencyState;
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateConferenceAndWaitingAndCallSetup:
+                TRAP( err, iState = 
+                    CPhoneConferenceAndWaitingAndCallSetup::NewL( 
+                        this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateIdle:
+                if ( iOldStateId != EPhoneStateEmergency )
+                    {
+                    if( !iEmergencyStateConstructed )
+                        {
+                        TRAP( err, iEmergencyState = CPhoneEmergency::NewL( 
+                            this, iViewCommandHandle, iCustomization ) );
+                        __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );                                          
+                        iEmergencyStateConstructed = ETrue;
+                        }
+                    }
+                if( iIdleState == NULL )
+                    {
+                    TRAP( err, iIdleState = 
+                        CPhoneIdle::NewL( this, iViewCommandHandle, iCustomization ) );
+                    __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                    }
+                iState = iIdleState;
+                madeStateTransition = ETrue;
+                break;
+                
+            case EPhoneStateIncoming:
+                TRAP( err, iState = 
+                    CPhoneIncoming::NewL( this, iViewCommandHandle, iCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+
+            case EPhoneStateStartup:
+                TRAP( err, iState = 
+                    CPhoneStartup::NewL( this, iViewCommandHandle, 
+                    iOldStateId == EPhoneStateEmergency ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+
+            default:
+                iState = CPhoneStateMachine::State();
+                break;
+            }
+        }
+
+    if ( madeStateTransition )
+        {
+        __PHONELOGSTATECHANGE( iOldStateId, iNewStateId );
+        iOldStateId = iNewStateId;
+        }
+
+    return iState;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachineGSM::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateMachineGSM* CPhoneStateMachineGSM::NewL(
+    MPhoneViewCommandHandle* aViewCommandHandle ) 
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneStateMachineGSM::NewL() ");
+    CPhoneStateMachineGSM* self = 
+        new (ELeave) CPhoneStateMachineGSM( aViewCommandHandle );
+
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateMachineGSM::CreatePhoneEngineL
+// -----------------------------------------------------------
+//
+EXPORT_C MPEPhoneModel* CPhoneStateMachineGSM::CreatePhoneEngineL( 
+    MEngineMonitor& aEngineMonitor )
+    {
+    return CPEPhoneModelIF::CreateL( aEngineMonitor );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonetwosingles.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,493 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneTwoSingles class.
+*
+*/
+
+
+// INCLUDES
+#include <eikmenub.h> 
+#include <eikenv.h>
+#include <StringLoader.h>
+#include <pevirtualengine.h>
+#include <mpeengineinfo.h>
+#include <cpephonemodelif.h>
+#include <featmgr.h>
+#include "cphonetwosingles.h"
+#include "mphonestatemachine.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonestatedefinitions.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamappinfo.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C CPhoneTwoSingles::CPhoneTwoSingles(
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::~CPhoneTwoSingles()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C CPhoneTwoSingles::~CPhoneTwoSingles()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSingles::ConstructL()
+    {
+    CPhoneGsmInCall::ConstructL();
+    
+    // Re-enable global notes
+    TPhoneCmdParamBoolean globalNotifierParam;
+    globalNotifierParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
+        &globalNotifierParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneTwoSingles* CPhoneTwoSingles::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneTwoSingles* self = new( ELeave ) CPhoneTwoSingles( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSingles::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageHeld:
+            HandleHeldL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageConnectedConference:
+            HandleConnectedConferenceL( aCallId );
+            break;
+            
+        case MEngineMonitor::EPEMessageIncoming:
+            HandleIncomingL( aCallId );
+            break;
+
+        default:
+            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::OpenMenuBarL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSingles::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::OpenMenuBarL()");
+    TInt resourceId;
+
+    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
+        {
+        resourceId = EPhoneDtmfDialerMenubar;
+        }
+    if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
+        {
+        resourceId = CustomizedDialerMenuResourceIdL();
+        }
+    else if ( IsNumberEntryVisibleL() )
+        {
+        resourceId = EPhoneCallActiveAndHeldMenubarWithNumberEntry;
+        }
+    else
+        {
+        resourceId = EPhoneCallActiveAndHeldMenubar;
+        }
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+      
+// -----------------------------------------------------------
+// CPhoneTwoSingles:HandleIdleL
+// -----------------------------------------------------------
+//    
+void CPhoneTwoSingles::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandleIdleL()");
+    BeginUiUpdateLC();
+
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+
+    TPhoneCmdParamInteger activeCallCount;
+    iViewCommandHandle->ExecuteCommandL(
+        EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+
+    switch( activeCallCount.Integer() )
+        {
+        case EOneActiveCall:
+            {   
+            if ( IsNumberEntryUsedL() )
+                {
+                // Show the number entry if it exists
+                SetNumberEntryVisibilityL(ETrue);
+                }
+            else
+                {
+                // Close menu bar if number entry is not open.
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+                
+                // Set incall CBAs
+                UpdateCbaL( EPhoneCallHandlingInCallCBA );                
+                }
+            
+            TPhoneCmdParamCallStateData callStateData;  
+            callStateData.SetCallState( EPEStateHeld );
+            iViewCommandHandle->HandleCommandL(
+                EPhoneViewGetCallIdByState, &callStateData );
+            TInt holdCallId = callStateData.CallId();
+            
+            // Set Hold flag to view
+            TPhoneCmdParamBoolean holdFlag;
+            
+            if ( holdCallId < 0 )
+                {
+                holdFlag.SetBoolean( EFalse );
+                }
+            else
+                {
+                holdFlag.SetBoolean( ETrue );
+                // Close the dtmf query if it exists
+                CloseDtmfQueryL(); 
+                }
+
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+            SetTouchPaneButtons( EPhoneIncallButtons );         
+            // Go to single state
+            // CBA updates in above if-else conditions
+            iStateMachine->ChangeState( EPhoneStateSingle ); 
+            }
+            
+        default:
+            break;
+        }
+    EndUiUpdate(); 
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSingles::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            {
+            // Check is number entry open
+            if ( !IsNumberEntryVisibleL() )
+                {
+                iStateMachine->SendPhoneEngineMessage(
+                    CPEPhoneModelIF::EPEMessageSwap );
+                }
+            else
+                {
+                CallFromNumberEntryL();
+                }
+            break;    
+            }
+
+        default:
+            CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );   
+            break;
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneTwoSingles::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSingles::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandleConnectedL()");
+    // Show bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateConnected );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+    
+    SetTouchPaneButtons( EPhoneIncallButtons );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneTwoSingles::HandleHeldL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSingles::HandleHeldL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandleHeldL()");
+    // Display hold bubble
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+    callHeaderParam.SetCallState( EPEStateHeld );
+    
+    TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+    TInt callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCallOnHold );
+
+    StringLoader::Load( 
+        labelText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetLabelText( labelText );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
+        &callHeaderParam );
+    
+    SetTouchPaneButtons( EPhoneIncallButtons );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneTwoSingles::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSingles::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandleNumberEntryClearedL()");
+    UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::HandleConnectedConferenceL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSingles::HandleConnectedConferenceL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandleConnectedConferenceL()");
+    // Update call state
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+
+    TInt callLabelId;
+    TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
+    callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCLIConferenceCall );
+
+    StringLoader::Load( 
+        conferenceText, 
+        callLabelId, 
+        CCoeEnv::Static() );
+    callHeaderParam.SetCLIText( conferenceText, TPhoneCmdParamCallHeaderData::ERight );
+    
+    callHeaderParam.SetCallState(EPEStateConnectedConference);
+    BeginUiUpdateLC();
+    
+    callHeaderParam.SetCiphering(
+        iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) );
+        
+    callHeaderParam.SetCipheringIndicatorAllowed(
+        iStateMachine->PhoneEngineInfo()->SecureSpecified() );
+    
+    // Service identifier must be given so that service specific settings
+    // can be taken into account at phoneuiview.
+    callHeaderParam.SetServiceId( 
+        iStateMachine->PhoneEngineInfo()->ServiceId( aCallId ) );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId,
+        &callHeaderParam );
+
+    // Set Hold flag to view
+    TPhoneCmdParamBoolean holdFlag;
+    holdFlag.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
+
+    SetTouchPaneButtons( EPhoneConferenceButtons );
+    SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );
+    EndUiUpdate();
+    
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
+    
+    // Go to conference state
+    // No need for CBA update
+    iStateMachine->ChangeState( EPhoneStateConference );
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::HandleIncomingL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSingles::HandleIncomingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSingles::HandleIncomingL()");
+    
+    BeginUiUpdateLC();
+    
+    TPhoneCmdParamBoolean dialerParam;
+    dialerParam.SetBoolean( ETrue );
+    
+    // Get allow waiting call header param value.
+    AllowShowingOfWaitingCallHeaderL( dialerParam );
+    
+    // Close fast swap window if it's displayed
+    CEikonEnv::Static()->DismissTaskList();
+
+    // Display incoming call
+    DisplayIncomingCallL( aCallId, dialerParam );
+    
+    // Set touch controls
+    SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
+    
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+
+    EndUiUpdate();
+
+    // Go to incoming state
+    iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA );
+    
+    iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );        
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSingles::DisplayIncomingCallL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSingles::DisplayIncomingCallL( 
+    TInt aCallId, 
+    const TPhoneCmdParamBoolean aCommandParam )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+         "CPhoneTwoSingles::DisplayIncomingCallL()"); 
+    // Close menu bar, if it is displayed
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+
+    // Cannot delete active note, e.g. New call query, 
+    // but show waiting note with or without caller name
+    if ( IsAnyQueryActiveL() ||  
+        ( !aCommandParam.Boolean() && iOnScreenDialer ) )
+        {
+        CallWaitingNoteL( aCallId );        
+        }
+    else
+        {
+        // Remove any phone dialogs if they are displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+        }
+
+    // Indicate that the Phone needs to be sent to the background if
+    // an application other than the top application is in the foreground
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        &booleanParam );
+
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
+
+    // Set Phone as the top application
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
+        &uidParam );
+
+    CPhoneState::DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call 
+    }
+    
+// -----------------------------------------------------------
+// CPhoneTwoSingles::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSingles::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneTwoSingles::UpdateInCallCbaL() ");
+    UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,495 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneTwoSinglesAndWaiting class.
+*
+*/
+
+
+// INCLUDES
+#include <pevirtualengine.h>
+#include <StringLoader.h>
+#include <mpeengineinfo.h>
+#include <featmgr.h>
+#include "cphonetwosinglesandwaiting.h"
+#include "tphonecmdparamboolean.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "phoneviewcommanddefinitions.h"
+#include "phoneui.hrh"
+#include "cphonemainresourceresolver.h"
+#include "phonerssbase.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phonelogger.h"
+#include "mphonestorage.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneTwoSinglesAndWaiting::CPhoneTwoSinglesAndWaiting( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization ) : 
+    CPhoneTwoSingles( aStateMachine, aViewCommandHandle, aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::~CPhoneTwoSinglesAndWaiting()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneTwoSinglesAndWaiting::~CPhoneTwoSinglesAndWaiting()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::ConstructL()
+    {
+    CPhoneTwoSingles::ConstructL();
+    
+    // Fetch ringing call's id from view
+    TPhoneCmdParamCallStateData callStateData;
+    callStateData.SetCallState( EPEStateRinging );
+    iViewCommandHandle->HandleCommandL(
+        EPhoneViewGetCallIdByState, &callStateData );
+    iRingingCallId = callStateData.CallId();
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneTwoSinglesAndWaiting* CPhoneTwoSinglesAndWaiting::NewL( 
+    MPhoneStateMachine* aStateMachine, 
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneCustomization* aPhoneCustomization )
+    {
+    CPhoneTwoSinglesAndWaiting* self = new( ELeave ) CPhoneTwoSinglesAndWaiting( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aCode )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL()");
+    switch ( aCode )
+        {
+        // send-key
+        case EKeyYes:
+            {
+            if( IsNumberEntryVisibleL() )
+                {
+                CallFromNumberEntryL();                         
+                }
+            else
+                {
+                // Waiting call bubble is over number entry
+                // so display not allowed note because we
+                // can't answer the call
+                SendGlobalWarningNoteL( EPhoneNoteTextCallNotAllowed );                     
+                }
+            break;
+            }
+
+        default:
+            CPhoneTwoSingles::HandleKeyMessageL( aMessage, aCode );   
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleKeyEventL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aEventCode*/ )
+    {
+    if( EKeyDeviceF == aKeyEvent.iCode )
+        {
+        __PHONELOG( EBasic, EPhoneUIStates,
+            "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL-deviceF" );
+        HandleHoldSwitchL();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL()");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdleL( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageConnected:
+            UpdateInCallCbaL();
+            CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;           
+        default:
+            CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleErrorL
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneTwoSinglesAndWaiting::HandleErrorL( 
+        const TPEErrorInfo& aErrorInfo )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneTwoSinglesAndWaiting::HandleErrorL()");
+    
+    if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer )
+        {
+        // Should not shown "No Answer" note
+        __PHONELOG1( EBasic, EPhoneUIStates,
+       "PhoneUIControl: CPhoneTwoSinglesAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ",
+            aErrorInfo.iErrorCode);
+        }
+    else
+        {
+        CPhoneState::HandleErrorL( aErrorInfo );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::OpenMenuBarL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::OpenMenuBarL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::OpenMenuBarL()");
+
+    TInt resourceId ( EPhoneCallTwoSinglesWaitingLockMenubar );
+    
+    if ( !IsAutoLockOn() )
+        {
+        if ( IsNumberEntryVisibleL() )
+            {
+            resourceId = EPhoneCallActiveHeldAndWaitingMenubarWithNumberEntry;
+            }
+        else
+            {
+            resourceId = EPhoneCallActiveHeldAndWaitingMenubar;
+            }
+        }   
+
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( resourceId ) );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
+        &integerParam );
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleIdleL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::HandleIdleL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::HandleIdleL()");
+        
+    // Effect is shown when dialer exist.
+    
+    TBool effectStarted ( EFalse );
+    if ( !NeedToSendToBackgroundL())
+        {
+        BeginTransEffectLC( ENumberEntryOpen );
+        effectStarted = ETrue;   
+        }
+ 
+    BeginUiUpdateLC();    
+         
+    if ( !IsNumberEntryUsedL() )
+        {
+        // Close menu bar, if number entry isnt open.
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );       
+        }
+    
+    // Remove call 
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
+    
+    if ( iRingingCallId == aCallId )
+        {
+        StateTransitionToTwoSinglesL();    
+        }
+    else
+        {
+        StateTransitionToSingleAndWaitingL();
+        }
+
+    EndUiUpdate();
+    if ( effectStarted )
+        {
+        EndTransEffect();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()");
+    if ( IsNumberEntryUsedL() )
+        {
+        // Go to background if necessary
+        if ( NeedToSendToBackgroundL() )
+            {
+            // Return phone to the background if send to background is needed.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+            
+            UpdateCbaL( EPhoneCallHandlingInCallCBA );
+            }
+        else
+            {
+            // Show the number entry if it exists.
+            SetNumberEntryVisibilityL(ETrue);
+            }
+        } 
+    else
+        {
+        // Set Two singles softkeys
+        UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
+        
+        // If numberentry is not open just check NeedToSendToBackgroundL and 
+        // sendbackround if needed.
+        if ( NeedToSendToBackgroundL() )
+            {
+            // Return phone to the background if send to background is needed.
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
+            }
+        }
+
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+        && iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        EnableCallUIL();
+        }
+    
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+
+    // Go to two singles state
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+    SetTouchPaneButtons( EPhoneTwoSinglesButtons );
+    // CBA updates in above if-else conditions
+    iStateMachine->ChangeState( EPhoneStateTwoSingles );                     
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()");
+    // Go to two singles state
+    TPhoneCmdParamInteger callIdParam;
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewGetExpandedBubbleCallId, &callIdParam );
+    
+    if ( callIdParam.Integer()!=iRingingCallId )
+        {
+        CPhoneGsmInCall::UpdateInCallCbaL();
+        } 
+    else 
+        {
+        iCbaManager->SetCbaL( EPhoneCallHandlingCallWaitingCBA );
+        }
+  
+    // Set touch controls
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+    
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+  
+    iStateMachine->ChangeState( EPhoneStateWaitingInSingle );                             
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL()");
+    BeginUiUpdateLC();
+    // Update call state
+    TPhoneCmdParamCallHeaderData callHeaderParam;
+
+    TInt callLabelId;
+    TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
+    callLabelId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneCLIConferenceCall );
+
+    StringLoader::Load( 
+        conferenceText, 
+        callLabelId, 
+        CCoeEnv::Static() );        
+    callHeaderParam.SetCLIText( conferenceText, TPhoneCmdParamCallHeaderData::ERight );
+    
+    callHeaderParam.SetCallState(EPEStateConnectedConference);
+    
+    callHeaderParam.SetCiphering(
+        iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) );
+        
+    callHeaderParam.SetCipheringIndicatorAllowed(
+        iStateMachine->PhoneEngineInfo()->SecureSpecified() );
+
+    // Service identifier must be given so that service specific settings
+    // can be taken into account at phoneuiview.
+    callHeaderParam.SetServiceId( 
+        iStateMachine->PhoneEngineInfo()->ServiceId( aCallId ) );
+        
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
+
+
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId,
+        &callHeaderParam );
+        
+    // Clear the flag
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( EFalse );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+    
+    // Set touch controls
+    SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer );
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    
+    EndUiUpdate();
+    // Go to Conference And Waiting state
+    // No need for CBA update
+    iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );                
+    }
+    
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()");
+
+    TPhoneCmdParamInteger callIdParam;
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewGetExpandedBubbleCallId, &callIdParam );
+    
+    if ( callIdParam.Integer()!=iRingingCallId )
+        {
+        CPhoneGsmInCall::UpdateInCallCbaL();
+        } 
+    else 
+        {
+        iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()");
+    UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneTwoSinglesAndWaiting::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates,
+        "CPhoneTwoSinglesAndWaiting::HandleCommandL() ");
+    TBool commandStatus = ETrue;
+
+    switch( aCommand )
+        {
+        case EPhoneCmdUpdateUiControls:
+            UpdateUiControlsL();
+            break;
+
+        default:
+            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTwoSinglesAndWaiting::UpdateUiControlsL
+// -----------------------------------------------------------
+//
+void CPhoneTwoSinglesAndWaiting::UpdateUiControlsL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::UpdateUiControlsL( ) ");
+    UpdateInCallCbaL();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuistates/src/cphoneuistatemachinefactorygsm.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneUIStateMachineFactoryGSM class.
+*
+*/
+
+
+// INCLUDES
+#include "cphoneuistatemachinefactorygsm.h"
+#include "cphonestatemachinegsm.h"
+#include "cphoneresourceresolvergsm.h"
+#include "cphoneerrormessageshandler.h"
+
+// -----------------------------------------------------------
+// CPhoneUIControllerFactoryGSM::CreatePhoneStateMachineL()
+// Create instance of CPhoneStateMachine class.
+// (other items were commented in a header).
+// -----------------------------------------------------------
+MPhoneStateMachine* CPhoneUIStateMachineFactoryGSM::CreatePhoneStateMachineL(
+    MPhoneViewCommandHandle* aViewCommandHandle
+     )
+    {
+    return CPhoneStateMachineGSM::NewL( aViewCommandHandle );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIStateMachineFactoryGSM::CreatePhoneResourceResolverL
+// Create instance of CPhoneResourceResolverBase class.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneResourceResolverBase*
+    CPhoneUIStateMachineFactoryGSM::CreatePhoneResourceResolverL()
+    {
+    return CPhoneResourceResolverGSM::NewL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIStateMachineFactoryGSM::CreatePhoneResourceResolverL
+// Create instance of CPhoneResourceResolverBase class.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneErrorMessagesHandler*
+    CPhoneUIStateMachineFactoryGSM::CreatePhoneErrorMessagesHandlerL(
+        MPhoneViewCommandHandle* aViewCommandHandle,
+        MPhoneStateMachine* aStateMachine )
+    {
+    return CPhoneErrorMessagesHandler::NewL( aViewCommandHandle,
+                                             aStateMachine );
+    }
+
+// ---------------------------------------------------------
+// Polymorphic DLL entry point for ordinal 1.
+// ---------------------------------------------------------
+EXPORT_C CPhoneUIStateMachineFactoryBase* NewPhoneUIStateMachineFactoryL() 
+    {
+    return new( ELeave ) CPhoneUIStateMachineFactoryGSM;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/bwins/phoneuiutilsu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,318 @@
+EXPORTS
+	?DynMenu@TPhoneCmdParamDynMenu@@QAEPAXXZ @ 1 NONAME ; void * TPhoneCmdParamDynMenu::DynMenu(void)
+	?SetParticipantListCLI@TPhoneCmdParamCallHeaderData@@QAEXW4TPhoneParticipantListCLI@1@@Z @ 2 NONAME ; void TPhoneCmdParamCallHeaderData::SetParticipantListCLI(enum TPhoneCmdParamCallHeaderData::TPhoneParticipantListCLI)
+	?ContactLink@TPhoneCmdParamCallHeaderData@@QBEABVTDesC8@@XZ @ 3 NONAME ; class TDesC8 const & TPhoneCmdParamCallHeaderData::ContactLink(void) const
+	?LogIt@CPhoneLogger@@QAAXW4TPhoneUILoggingLevel@@W4TPhoneUILoggingComponent@@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 4 NONAME ; void CPhoneLogger::LogIt(enum TPhoneUILoggingLevel, enum TPhoneUILoggingComponent, class TRefByValue<class TDesC16 const >, ...)
+	?IsEscapeKey@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 5 NONAME ; int CPhoneKeys::IsEscapeKey(struct TKeyEvent const &, enum TEventCode)
+	?Tone@TPhoneCmdParamNote@@QBE?AW4TTone@CAknNoteDialog@@XZ @ 6 NONAME ; enum CAknNoteDialog::TTone TPhoneCmdParamNote::Tone(void) const
+	?LogStateChange@CPhoneLogger@@QAEXHH@Z @ 7 NONAME ; void CPhoneLogger::LogStateChange(int, int)
+	?SetObserver@TPhoneCmdParamNumberEntryObserver@@QAEXVTCallBack@@@Z @ 8 NONAME ; void TPhoneCmdParamNumberEntryObserver::SetObserver(class TCallBack)
+	?QueryType@TPhoneCmdParamQuery@@QBE?AW4TPhoneQueryType@@XZ @ 9 NONAME ; enum TPhoneQueryType TPhoneCmdParamQuery::QueryType(void) const
+	?SetCallType@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 10 NONAME ; void TPhoneCmdParamCallHeaderData::SetCallType(int)
+	?NumberType@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 11 NONAME ; int TPhoneCmdParamCallHeaderData::NumberType(void) const
+	?CbaCommandMapping@TPhoneCmdParamQuery@@QBEHH@Z @ 12 NONAME ; int TPhoneCmdParamQuery::CbaCommandMapping(int) const
+	?SetTone@TPhoneCmdParamQuery@@QAEXH@Z @ 13 NONAME ; void TPhoneCmdParamQuery::SetTone(int)
+	?PhoneNumber@TPhoneCmdParamSpeedDial@@QAEPAVTPtr16@@XZ @ 14 NONAME ; class TPtr16 * TPhoneCmdParamSpeedDial::PhoneNumber(void)
+	?CLIText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 15 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::CLIText(void) const
+	??0CPhoneLogger@@QAE@VTUid@@@Z @ 16 NONAME ; CPhoneLogger::CPhoneLogger(class TUid)
+	?RingingType@TPhoneCmdParamRingTone@@QBEHXZ @ 17 NONAME ; int TPhoneCmdParamRingTone::RingingType(void) const
+	?Remove@CPhoneRecoverySystem@@SAXH@Z @ 18 NONAME ; void CPhoneRecoverySystem::Remove(int)
+	??0TPhoneCmdParamKeyEvent@@QAE@XZ @ 19 NONAME ; TPhoneCmdParamKeyEvent::TPhoneCmdParamKeyEvent(void)
+	?SetPhoneEngine@CPhoneLogger@@QAEXPAVMPEPhoneModel@@@Z @ 20 NONAME ; void CPhoneLogger::SetPhoneEngine(class MPEPhoneModel *)
+	?SetSendKeyEnabled@TPhoneCmdParamQuery@@QAEXH@Z @ 21 NONAME ; void TPhoneCmdParamQuery::SetSendKeyEnabled(int)
+	?Pointer@TPhoneCmdParamPointer@@QBEPAXXZ @ 22 NONAME ; void * TPhoneCmdParamPointer::Pointer(void) const
+	?SetCallerText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 23 NONAME ; void TPhoneCmdParamCallHeaderData::SetCallerText(class TDesC16 const &)
+	?Line2@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 24 NONAME ; int TPhoneCmdParamIncallIndicatorData::Line2(void) const
+	?Text@TPhoneCmdParamGlobalNote@@QBEABVTDesC16@@XZ @ 25 NONAME ; class TDesC16 const & TPhoneCmdParamGlobalNote::Text(void) const
+	?RecoverNow@CPhoneRecoverySystem@@QAEHHCH@Z @ 26 NONAME ; int CPhoneRecoverySystem::RecoverNow(int, signed char, int)
+	?LogMsgFromControlToView@CPhoneLogger@@QAEXHH@Z @ 27 NONAME ; void CPhoneLogger::LogMsgFromControlToView(int, int)
+	??0TPhoneCmdParamBitmap@@QAE@XZ @ 28 NONAME ; TPhoneCmdParamBitmap::TPhoneCmdParamBitmap(void)
+	?NumberType@TPhoneCmdParamSpeedDial@@QAE?AW4TPhoneNumberType@@XZ @ 29 NONAME ; enum TPhoneNumberType TPhoneCmdParamSpeedDial::NumberType(void)
+	?SetHasThumbnail@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 30 NONAME ; void TPhoneCmdParamCallHeaderData::SetHasThumbnail(int)
+	?Text@TPhoneCmdParamNote@@QBEABVTDesC16@@XZ @ 31 NONAME ; class TDesC16 const & TPhoneCmdParamNote::Text(void) const
+	??1CPhoneMethodLogger@@UAE@XZ @ 32 NONAME ; CPhoneMethodLogger::~CPhoneMethodLogger(void)
+	?WaitForReady@TPhoneCmdParamGlobalNote@@QBEHXZ @ 33 NONAME ; int TPhoneCmdParamGlobalNote::WaitForReady(void) const
+	?MaskBitmap@TPhoneCmdParamBitmap@@QBEPAVCFbsBitmap@@XZ @ 34 NONAME ; class CFbsBitmap * TPhoneCmdParamBitmap::MaskBitmap(void) const
+	?IsScreenLocked@CPhoneStorage@@UAEHXZ @ 35 NONAME ; int CPhoneStorage::IsScreenLocked(void)
+	?SetText@TPhoneCmdParamGlobalNote@@QAEXABVTDesC16@@@Z @ 36 NONAME ; void TPhoneCmdParamGlobalNote::SetText(class TDesC16 const &)
+	?AddLibraryL@CPhoneLibraryContainer@@QAEXABVRLibrary@@@Z @ 37 NONAME ; void CPhoneLibraryContainer::AddLibraryL(class RLibrary const &)
+	??1CPhoneResourceResolverBase@@UAE@XZ @ 38 NONAME ; CPhoneResourceResolverBase::~CPhoneResourceResolverBase(void)
+	?ResetBlockedKeysList@CPhoneStorage@@UAEXXZ @ 39 NONAME ; void CPhoneStorage::ResetBlockedKeysList(void)
+	?SetInt@CPhoneCenRepProxy@@QAEHABVTUid@@IH@Z @ 40 NONAME ; int CPhoneCenRepProxy::SetInt(class TUid const &, unsigned int, int)
+	?GetCustomCommandForTimeOut@TPhoneCmdParamQuery@@QBEHAAH@Z @ 41 NONAME ; int TPhoneCmdParamQuery::GetCustomCommandForTimeOut(int &) const
+	?ParamId@TPhoneCommandParam@@QBE?AW4TPhoneParamId@1@XZ @ 42 NONAME ; enum TPhoneCommandParam::TPhoneParamId TPhoneCommandParam::ParamId(void) const
+	?SetString@CPhoneCenRepProxy@@QAEHABVTUid@@IABVTDesC16@@@Z @ 43 NONAME ; int CPhoneCenRepProxy::SetString(class TUid const &, unsigned int, class TDesC16 const &)
+	?Line2@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 44 NONAME ; int TPhoneCmdParamCallHeaderData::Line2(void) const
+	??1CPhoneTimer@@UAE@XZ @ 45 NONAME ; CPhoneTimer::~CPhoneTimer(void)
+	?LogMsgFromPEToPhoneUIEnd@CPhoneLogger@@QAEXH@Z @ 46 NONAME ; void CPhoneLogger::LogMsgFromPEToPhoneUIEnd(int)
+	?DialerController@TPhoneCmdParamCustomDialer@@QAEPAVMPhoneDialerController@@XZ @ 47 NONAME ; class MPhoneDialerController * TPhoneCmdParamCustomDialer::DialerController(void)
+	?Type@TPhoneCmdParamGlobalNote@@QBE?AW4TAknGlobalNoteType@@XZ @ 48 NONAME ; enum TAknGlobalNoteType TPhoneCmdParamGlobalNote::Type(void) const
+	?SetMultipleInstances@TPhoneCmdParamAppInfo@@QAEXH@Z @ 49 NONAME ; void TPhoneCmdParamAppInfo::SetMultipleInstances(int)
+	?Tone@TPhoneCmdParamGlobalNote@@QBEHXZ @ 50 NONAME ; int TPhoneCmdParamGlobalNote::Tone(void) const
+	?ChangePropertyValue@CPhonePubSubProxy@@QAEXABVTUid@@IH@Z @ 51 NONAME ; void CPhonePubSubProxy::ChangePropertyValue(class TUid const &, unsigned int, int)
+	?SetThumbnail@TPhoneCmdParamCallHeaderData@@QAEXPAVCFbsBitmap@@@Z @ 52 NONAME ; void TPhoneCmdParamCallHeaderData::SetThumbnail(class CFbsBitmap *)
+	?SetCbaCommandMapping@TPhoneCmdParamQuery@@QAEXHH@Z @ 53 NONAME ; void TPhoneCmdParamQuery::SetCbaCommandMapping(int, int)
+	?EventCode@TPhoneCmdParamKeyEvent@@QBE?AW4TEventCode@@XZ @ 54 NONAME ; enum TEventCode TPhoneCmdParamKeyEvent::EventCode(void) const
+	?KeyEvent@TPhoneCmdParamKeyEvent@@QBE?BUTKeyEvent@@XZ @ 55 NONAME ; struct TKeyEvent const TPhoneCmdParamKeyEvent::KeyEvent(void) const
+	?SetDataText@TPhoneCmdParamQuery@@QAEXPAVTDes16@@@Z @ 56 NONAME ; void TPhoneCmdParamQuery::SetDataText(class TDes16 *)
+	??0TPhoneCmdParamAppInfo@@QAE@XZ @ 57 NONAME ; TPhoneCmdParamAppInfo::TPhoneCmdParamAppInfo(void)
+	?LittleBubbleVisible@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 58 NONAME ; int TPhoneCmdParamIncallIndicatorData::LittleBubbleVisible(void) const
+	?SetCallState@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 59 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetCallState(int)
+	?GetString@CPhoneCenRepProxy@@QBEHABVTUid@@IAAVTDes16@@@Z @ 60 NONAME ; int CPhoneCenRepProxy::GetString(class TUid const &, unsigned int, class TDes16 &) const
+	?ResourceId@TPhoneCmdParamProgressNote@@QBEHXZ @ 61 NONAME ; int TPhoneCmdParamProgressNote::ResourceId(void) const
+	?CallId@TPhoneCmdParamCallStateData@@QBEHXZ @ 62 NONAME ; int TPhoneCmdParamCallStateData::CallId(void) const
+	?NotifyChangeL@CPhoneCenRepProxy@@QAEXABVTUid@@IPAVMPhoneCenRepObserver@@@Z @ 63 NONAME ; void CPhoneCenRepProxy::NotifyChangeL(class TUid const &, unsigned int, class MPhoneCenRepObserver *)
+	?SetResourceId@TPhoneCmdParamDynMenu@@QAEXH@Z @ 64 NONAME ; void TPhoneCmdParamDynMenu::SetResourceId(int)
+	?Validate@CPhoneKeys@@SAHABVTDesC16@@@Z @ 65 NONAME ; int CPhoneKeys::Validate(class TDesC16 const &)
+	??0TPhoneCmdParamKeyCapture@@QAE@XZ @ 66 NONAME ; TPhoneCmdParamKeyCapture::TPhoneCmdParamKeyCapture(void)
+	?SetResourceId@TPhoneCmdParamNote@@QAEXH@Z @ 67 NONAME ; void TPhoneCmdParamNote::SetResourceId(int)
+	?LogMsgFromPEToPhoneUI@CPhoneLogger@@QAEXHH@Z @ 68 NONAME ; void CPhoneLogger::LogMsgFromPEToPhoneUI(int, int)
+	??0TPhoneCmdParamProgressNote@@QAE@XZ @ 69 NONAME ; TPhoneCmdParamProgressNote::TPhoneCmdParamProgressNote(void)
+	?CallState@TPhoneCmdParamCallStateData@@QBEHXZ @ 70 NONAME ; int TPhoneCmdParamCallStateData::CallState(void) const
+	?SetPointer@TPhoneCmdParamPointer@@QAEXPAX@Z @ 71 NONAME ; void TPhoneCmdParamPointer::SetPointer(void *)
+	??1CPhoneCenRepProxy@@UAE@XZ @ 72 NONAME ; CPhoneCenRepProxy::~CPhoneCenRepProxy(void)
+	?SetEventCode@TPhoneCmdParamKeyEvent@@QAEXW4TEventCode@@@Z @ 73 NONAME ; void TPhoneCmdParamKeyEvent::SetEventCode(enum TEventCode)
+	?WaitTime@TPhoneCmdParamProgressNote@@QBE?AVTTimeIntervalMicroSeconds32@@XZ @ 74 NONAME ; class TTimeIntervalMicroSeconds32 TPhoneCmdParamProgressNote::WaitTime(void) const
+	?SetParam@TPhoneCmdParamAppInfo@@QAEXABVTDesC8@@@Z @ 75 NONAME ; void TPhoneCmdParamAppInfo::SetParam(class TDesC8 const &)
+	??0TPhoneCmdParamPointer@@QAE@XZ @ 76 NONAME ; TPhoneCmdParamPointer::TPhoneCmdParamPointer(void)
+	??0TPhoneCmdParamGlobalNote@@QAE@XZ @ 77 NONAME ; TPhoneCmdParamGlobalNote::TPhoneCmdParamGlobalNote(void)
+	?CallType@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 78 NONAME ; int TPhoneCmdParamCallHeaderData::CallType(void) const
+	?SetCiphering@TPhoneCmdParamEmergencyCallHeaderData@@QAEXH@Z @ 79 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetCiphering(int)
+	?SetTone@TPhoneCmdParamNote@@QAEXW4TTone@CAknNoteDialog@@@Z @ 80 NONAME ; void TPhoneCmdParamNote::SetTone(enum CAknNoteDialog::TTone)
+	?SetCustomCommandForTimeOut@TPhoneCmdParamQuery@@QAEXH@Z @ 81 NONAME ; void TPhoneCmdParamQuery::SetCustomCommandForTimeOut(int)
+	?IsBTAccAvailable@TPhoneCmdParamAudioAvailability@@QBEHXZ @ 82 NONAME ; int TPhoneCmdParamAudioAvailability::IsBTAccAvailable(void) const
+	?NewL@CPhoneStorage@@SAPAV1@XZ @ 83 NONAME ; class CPhoneStorage * CPhoneStorage::NewL(void)
+	?CNAPTextClippingDirection@TPhoneCmdParamCallHeaderData@@QBE?AW4TPhoneTextClippingDirection@1@XZ @ 84 NONAME ; enum TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection TPhoneCmdParamCallHeaderData::CNAPTextClippingDirection(void) const
+	?Timeout@TPhoneCmdParamNote@@QBE?AW4TTimeout@CAknNoteDialog@@XZ @ 85 NONAME ; enum CAknNoteDialog::TTimeout TPhoneCmdParamNote::Timeout(void) const
+	?Instance@CPhoneRecoverySystem@@SAPAV1@XZ @ 86 NONAME ; class CPhoneRecoverySystem * CPhoneRecoverySystem::Instance(void)
+	?CancelTimer@CPhoneTimer@@QAEXXZ @ 87 NONAME ; void CPhoneTimer::CancelTimer(void)
+	?NewL@CPhoneTimer@@SAPAV1@H@Z @ 88 NONAME ; class CPhoneTimer * CPhoneTimer::NewL(int)
+	?GetInt@CPhoneCenRepProxy@@QBEHABVTUid@@IAAH@Z @ 89 NONAME ; int CPhoneCenRepProxy::GetInt(class TUid const &, unsigned int, int &) const
+	?SetTextToSay@TPhoneCmdParamRingTone@@QAEXABVTDesC16@@@Z @ 90 NONAME ; void TPhoneCmdParamRingTone::SetTextToSay(class TDesC16 const &)
+	?SetCallState@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 91 NONAME ; void TPhoneCmdParamCallHeaderData::SetCallState(int)
+	?ContentCba@TPhoneCmdParamQuery@@QBEHXZ @ 92 NONAME ; int TPhoneCmdParamQuery::ContentCba(void) const
+	?SetTextResourceId@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 93 NONAME ; void TPhoneCmdParamGlobalNote::SetTextResourceId(int)
+	??0TPhoneCmdParamDynMenu@@QAE@XZ @ 94 NONAME ; TPhoneCmdParamDynMenu::TPhoneCmdParamDynMenu(void)
+	?CancelAllNotifications@CPhonePubSubProxy@@SAXPAVMPhonePubSubObserver@@@Z @ 95 NONAME ; void CPhonePubSubProxy::CancelAllNotifications(class MPhonePubSubObserver *)
+	??0TPhoneCommandParam@@QAE@XZ @ 96 NONAME ; TPhoneCommandParam::TPhoneCommandParam(void)
+	?SetCLIText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@W4TPhoneTextClippingDirection@1@@Z @ 97 NONAME ; void TPhoneCmdParamCallHeaderData::SetCLIText(class TDesC16 const &, enum TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection)
+	??1CPhoneLogger@@UAE@XZ @ 98 NONAME ; CPhoneLogger::~CPhoneLogger(void)
+	?Softkeys@TPhoneCmdParamGlobalNote@@QBEHXZ @ 99 NONAME ; int TPhoneCmdParamGlobalNote::Softkeys(void) const
+	?SetCallState@TPhoneCmdParamCallStateData@@QAEXH@Z @ 100 NONAME ; void TPhoneCmdParamCallStateData::SetCallState(int)
+	?CallerText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 101 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::CallerText(void) const
+	?Diverted@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 102 NONAME ; int TPhoneCmdParamCallHeaderData::Diverted(void) const
+	?String@TPhoneCmdParamString@@QAEPAVTPtr16@@XZ @ 103 NONAME ; class TPtr16 * TPhoneCmdParamString::String(void)
+	?SetKey@TPhoneCmdParamKeyCapture@@QAEXW4TStdScanCode@@@Z @ 104 NONAME ; void TPhoneCmdParamKeyCapture::SetKey(enum TStdScanCode)
+	?IsExtraChar@CPhoneKeys@@SAHH@Z @ 105 NONAME ; int CPhoneKeys::IsExtraChar(int)
+	?SetDynMenu@TPhoneCmdParamDynMenu@@QAEXPAX@Z @ 106 NONAME ; void TPhoneCmdParamDynMenu::SetDynMenu(void *)
+	?IsSecondHashKey@CPhoneKeys@@SAHABVTDes16@@@Z @ 107 NONAME ; int CPhoneKeys::IsSecondHashKey(class TDes16 const &)
+	?SetCallerImageStatus@TPhoneCmdParamRingTone@@QAEXH@Z @ 108 NONAME ; void TPhoneCmdParamRingTone::SetCallerImageStatus(int)
+	?GetReal@CPhoneCenRepProxy@@QBEHABVTUid@@IAAN@Z @ 109 NONAME ; int CPhoneCenRepProxy::GetReal(class TUid const &, unsigned int, double &) const
+	?SetShortLabelText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 110 NONAME ; void TPhoneCmdParamCallHeaderData::SetShortLabelText(class TDesC16 const &)
+	?SetDialerController@TPhoneCmdParamCustomDialer@@QAEXPAVMPhoneDialerController@@@Z @ 111 NONAME ; void TPhoneCmdParamCustomDialer::SetDialerController(class MPhoneDialerController *)
+	?RingTone@TPhoneCmdParamRingTone@@QBEABVTDesC16@@XZ @ 112 NONAME ; class TDesC16 const & TPhoneCmdParamRingTone::RingTone(void) const
+	?TimeOut@TPhoneCmdParamQuery@@QBEHXZ @ 113 NONAME ; int TPhoneCmdParamQuery::TimeOut(void) const
+	?ShortLabelText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 114 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::ShortLabelText(void) const
+	?SetInteger@TPhoneCmdParamInteger@@QAEXH@Z @ 115 NONAME ; void TPhoneCmdParamInteger::SetInteger(int)
+	?SetMaskBitmap@TPhoneCmdParamBitmap@@QAEXPAVCFbsBitmap@@@Z @ 116 NONAME ; void TPhoneCmdParamBitmap::SetMaskBitmap(class CFbsBitmap *)
+	?SetTimeout@TPhoneCmdParamNote@@QAEXW4TTimeout@CAknNoteDialog@@@Z @ 117 NONAME ; void TPhoneCmdParamNote::SetTimeout(enum CAknNoteDialog::TTimeout)
+	?IsBlockedKeysListEmpty@CPhoneStorage@@UAEHXZ @ 118 NONAME ; int CPhoneStorage::IsBlockedKeysListEmpty(void)
+	?SetCustomMessage@TPhoneCmdParamAppInfo@@QAEXABVTDesC8@@@Z @ 119 NONAME ; void TPhoneCmdParamAppInfo::SetCustomMessage(class TDesC8 const &)
+	?BaseConstructL@CPhoneResourceResolverBase@@QAEXXZ @ 120 NONAME ; void CPhoneResourceResolverBase::BaseConstructL(void)
+	?SetTextResourceId@TPhoneCmdParamNote@@QAEXH@Z @ 121 NONAME ; void TPhoneCmdParamNote::SetTextResourceId(int)
+	?SetString@TPhoneCmdParamString@@QAEXPAVTPtr16@@@Z @ 122 NONAME ; void TPhoneCmdParamString::SetString(class TPtr16 *)
+	?SetAppUid@TPhoneCmdParamAppInfo@@QAEXABVTUid@@@Z @ 123 NONAME ; void TPhoneCmdParamAppInfo::SetAppUid(class TUid const &)
+	?SetBTAccAvailable@TPhoneCmdParamAudioAvailability@@QAEXH@Z @ 124 NONAME ; void TPhoneCmdParamAudioAvailability::SetBTAccAvailable(int)
+	?IsTelephonyFeatureSupported@CPhoneCenRepProxy@@QAEHH@Z @ 125 NONAME ; int CPhoneCenRepProxy::IsTelephonyFeatureSupported(int)
+	?CallImageThemeFilePath@CPhoneCallThemeMonitor@@QBE?AVTPtrC16@@XZ @ 126 NONAME ; class TPtrC16 CPhoneCallThemeMonitor::CallImageThemeFilePath(void) const
+	?HasThumbnail@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 127 NONAME ; int TPhoneCmdParamCallHeaderData::HasThumbnail(void) const
+	?ClearBlackListNow@CPhoneClearBlacklist@@QAEXXZ @ 128 NONAME ; void CPhoneClearBlacklist::ClearBlackListNow(void)
+	?SetCipheringIndicatorAllowed@TPhoneCmdParamEmergencyCallHeaderData@@QAEXH@Z @ 129 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetCipheringIndicatorAllowed(int)
+	?SetCommandParamId@TPhoneCmdParamQuery@@QAEXW4TPhoneParamId@TPhoneCommandParam@@@Z @ 130 NONAME ; void TPhoneCmdParamQuery::SetCommandParamId(enum TPhoneCommandParam::TPhoneParamId)
+	??0TPhoneCmdParamEmergencyCallHeaderData@@QAE@XZ @ 131 NONAME ; TPhoneCmdParamEmergencyCallHeaderData::TPhoneCmdParamEmergencyCallHeaderData(void)
+	?After@CPhoneTimer@@QAEXVTTimeIntervalMicroSeconds32@@PAVMPhoneTimer@@@Z @ 132 NONAME ; void CPhoneTimer::After(class TTimeIntervalMicroSeconds32, class MPhoneTimer *)
+	?NewL@CPhoneLibraryContainer@@SAPAV1@XZ @ 133 NONAME ; class CPhoneLibraryContainer * CPhoneLibraryContainer::NewL(void)
+	?CreateL@CPhoneClearBlacklist@@SAPAV1@AAVRWsSession@@ABVRWindowBase@@@Z @ 134 NONAME ; class CPhoneClearBlacklist * CPhoneClearBlacklist::CreateL(class RWsSession &, class RWindowBase const &)
+	??1CPhoneStorage@@UAE@XZ @ 135 NONAME ; CPhoneStorage::~CPhoneStorage(void)
+	?SetVolume@TPhoneCmdParamRingTone@@QAEXH@Z @ 136 NONAME ; void TPhoneCmdParamRingTone::SetVolume(int)
+	??0TPhoneCmdParamString@@QAE@XZ @ 137 NONAME ; TPhoneCmdParamString::TPhoneCmdParamString(void)
+	?SetContactLink@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC8@@@Z @ 138 NONAME ; void TPhoneCmdParamCallHeaderData::SetContactLink(class TDesC8 const &)
+	??4TPhoneCmdParamQuery@@QAEAAV0@ABV0@@Z @ 139 NONAME ; class TPhoneCmdParamQuery & TPhoneCmdParamQuery::operator=(class TPhoneCmdParamQuery const &)
+	??0TPhoneCmdParamAudioAvailability@@QAE@XZ @ 140 NONAME ; TPhoneCmdParamAudioAvailability::TPhoneCmdParamAudioAvailability(void)
+	?GetBlockedKeyList@CPhoneStorage@@UBEABV?$RArray@H@@XZ @ 141 NONAME ; class RArray<int> const & CPhoneStorage::GetBlockedKeyList(void) const
+	??0TPhoneCmdParamRingTone@@QAE@XZ @ 142 NONAME ; TPhoneCmdParamRingTone::TPhoneCmdParamRingTone(void)
+	?Observer@TPhoneCmdParamNumberEntryObserver@@QAE?AVTCallBack@@XZ @ 143 NONAME ; class TCallBack TPhoneCmdParamNumberEntryObserver::Observer(void)
+	?SetSoftkeys@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 144 NONAME ; void TPhoneCmdParamGlobalNote::SetSoftkeys(int)
+	??0CPhoneResourceResolverBase@@IAE@XZ @ 145 NONAME ; CPhoneResourceResolverBase::CPhoneResourceResolverBase(void)
+	?SetCallId@TPhoneCmdParamCallStateData@@QAEXH@Z @ 146 NONAME ; void TPhoneCmdParamCallStateData::SetCallId(int)
+	?MultipleInstances@TPhoneCmdParamAppInfo@@QBEHXZ @ 147 NONAME ; int TPhoneCmdParamAppInfo::MultipleInstances(void) const
+	?ItemTextArrayForListQuery@TPhoneCmdParamQuery@@QBEPAVMDesC16Array@@XZ @ 148 NONAME ; class MDesC16Array * TPhoneCmdParamQuery::ItemTextArrayForListQuery(void) const
+	?SetHeaderText@TPhoneCmdParamEmergencyCallHeaderData@@QAEXABVTDesC16@@@Z @ 149 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetHeaderText(class TDesC16 const &)
+	?SetContentCba@TPhoneCmdParamQuery@@QAEXH@Z @ 150 NONAME ; void TPhoneCmdParamQuery::SetContentCba(int)
+	?CaptureType@TPhoneCmdParamKeyCapture@@QBE?AW4TPhoneCaptureType@@XZ @ 151 NONAME ; enum TPhoneCaptureType TPhoneCmdParamKeyCapture::CaptureType(void) const
+	?SetQueryResourceId@TPhoneCmdParamQuery@@QAEXH@Z @ 152 NONAME ; void TPhoneCmdParamQuery::SetQueryResourceId(int)
+	?CancelNotify@CPhoneCenRepProxy@@QAEXPAVMPhoneCenRepObserver@@I@Z @ 153 NONAME ; void CPhoneCenRepProxy::CancelNotify(class MPhoneCenRepObserver *, unsigned int)
+	?Param@TPhoneCmdParamAppInfo@@QBEABVTDesC8@@XZ @ 154 NONAME ; class TDesC8 const & TPhoneCmdParamAppInfo::Param(void) const
+	??0CPhoneMethodLogger@@QAE@W4TPhoneUILoggingComponent@@VTPtrC16@@@Z @ 155 NONAME ; CPhoneMethodLogger::CPhoneMethodLogger(enum TPhoneUILoggingComponent, class TPtrC16)
+	?IsDtmfTone@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 156 NONAME ; int CPhoneKeys::IsDtmfTone(struct TKeyEvent const &, enum TEventCode)
+	?SetMode@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 157 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetMode(int)
+	?NewL@CPhoneCallThemeMonitor@@SAPAV1@XZ @ 158 NONAME ; class CPhoneCallThemeMonitor * CPhoneCallThemeMonitor::NewL(void)
+	?SetPhoneNumber@TPhoneCmdParamSpeedDial@@QAEXPAVTPtr16@@@Z @ 159 NONAME ; void TPhoneCmdParamSpeedDial::SetPhoneNumber(class TPtr16 *)
+	?SendKeyEnabled@TPhoneCmdParamQuery@@QBEHXZ @ 160 NONAME ; int TPhoneCmdParamQuery::SendKeyEnabled(void) const
+	?SetNeedToEnableKeylock@CPhoneStorage@@UAEXH@Z @ 161 NONAME ; void CPhoneStorage::SetNeedToEnableKeylock(int)
+	?Find@CPhoneCenRepProxy@@QBEHABVTUid@@KKAAV?$RArray@K@@@Z @ 162 NONAME ; int CPhoneCenRepProxy::Find(class TUid const &, unsigned long, unsigned long, class RArray<unsigned long> &) const
+	?SetLabelText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 163 NONAME ; void TPhoneCmdParamCallHeaderData::SetLabelText(class TDesC16 const &)
+	?CNAPText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 164 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::CNAPText(void) const
+	?SetOwnPhoneNumberText@TPhoneCmdParamEmergencyCallHeaderData@@QAEXABVTDesC16@@@Z @ 165 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetOwnPhoneNumberText(class TDesC16 const &)
+	?Emergency@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 166 NONAME ; int TPhoneCmdParamIncallIndicatorData::Emergency(void) const
+	?AppUid@TPhoneCmdParamAppInfo@@QBE?AVTUid@@XZ @ 167 NONAME ; class TUid TPhoneCmdParamAppInfo::AppUid(void) const
+	?CustomMessage@TPhoneCmdParamAppInfo@@QBEABVTDesC8@@XZ @ 168 NONAME ; class TDesC8 const & TPhoneCmdParamAppInfo::CustomMessage(void) const
+	?QueryResourceId@TPhoneCmdParamQuery@@QBEHXZ @ 169 NONAME ; int TPhoneCmdParamQuery::QueryResourceId(void) const
+	?SetRingTone@TPhoneCmdParamRingTone@@QAEXABVTDesC16@@@Z @ 170 NONAME ; void TPhoneCmdParamRingTone::SetRingTone(class TDesC16 const &)
+	?NotifyChangeL@CPhonePubSubProxy@@QAEXABVTUid@@IPAVMPhonePubSubObserver@@@Z @ 171 NONAME ; void CPhonePubSubProxy::NotifyChangeL(class TUid const &, unsigned int, class MPhonePubSubObserver *)
+	?AppendBlockedKeysListL@CPhoneStorage@@UAEXW4TStdScanCode@@@Z @ 172 NONAME ; void CPhoneStorage::AppendBlockedKeysListL(enum TStdScanCode)
+	?SetEmergency@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 173 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetEmergency(int)
+	?SetDefaultCba@TPhoneCmdParamQuery@@QAEXH@Z @ 174 NONAME ; void TPhoneCmdParamQuery::SetDefaultCba(int)
+	?Type@TPhoneCmdParamTransEffect@@QBE?AW4TPhoneTransEffectType@@XZ @ 175 NONAME ; enum TPhoneTransEffectType TPhoneCmdParamTransEffect::Type(void) const
+	??0TPhoneCmdParamSfiData@@QAE@XZ @ 176 NONAME ; TPhoneCmdParamSfiData::TPhoneCmdParamSfiData(void)
+	??0TPhoneCmdParamCallHeaderData@@QAE@XZ @ 177 NONAME ; TPhoneCmdParamCallHeaderData::TPhoneCmdParamCallHeaderData(void)
+	??1CPhoneClearBlacklist@@UAE@XZ @ 178 NONAME ; CPhoneClearBlacklist::~CPhoneClearBlacklist(void)
+	?SetMute@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 179 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetMute(int)
+	?KeyCode@TPhoneCmdParamKeyCapture@@QBE?AW4TKeyCode@@XZ @ 180 NONAME ; enum TKeyCode TPhoneCmdParamKeyCapture::KeyCode(void) const
+	?IsNumberKey@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 181 NONAME ; int CPhoneKeys::IsNumberKey(struct TKeyEvent const &, enum TEventCode)
+	?TextResourceId@TPhoneCmdParamGlobalNote@@QBEHXZ @ 182 NONAME ; int TPhoneCmdParamGlobalNote::TextResourceId(void) const
+	?SetCiphering@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 183 NONAME ; void TPhoneCmdParamCallHeaderData::SetCiphering(int)
+	?EnablePreconditionL@CPhoneRecoverySystem@@QAEXXZ @ 184 NONAME ; void CPhoneRecoverySystem::EnablePreconditionL(void)
+	?AddL@CPhoneRecoverySystem@@QAEHVTCallBack@@CW4TRecoveryState@CTeleRecoverySystem@@@Z @ 185 NONAME ; int CPhoneRecoverySystem::AddL(class TCallBack, signed char, enum CTeleRecoverySystem::TRecoveryState)
+	?SetLine2@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 186 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetLine2(int)
+	?SetAudioOutput@TPhoneCmdParamAudioOutput@@QAEXW4TPEAudioOutput@@@Z @ 187 NONAME ; void TPhoneCmdParamAudioOutput::SetAudioOutput(enum TPEAudioOutput)
+	?HeaderText@TPhoneCmdParamEmergencyCallHeaderData@@QBEABVTDesC16@@XZ @ 188 NONAME ; class TDesC16 const & TPhoneCmdParamEmergencyCallHeaderData::HeaderText(void) const
+	?CallImageThemeSettings@CPhoneCallThemeMonitor@@QBEHXZ @ 189 NONAME ; int CPhoneCallThemeMonitor::CallImageThemeSettings(void) const
+	?SetLocation@TPhoneCmdParamSpeedDial@@QAEXH@Z @ 190 NONAME ; void TPhoneCmdParamSpeedDial::SetLocation(int)
+	??0TPhoneCmdParamTransEffect@@QAE@XZ @ 191 NONAME ; TPhoneCmdParamTransEffect::TPhoneCmdParamTransEffect(void)
+	?Number@TPhoneCmdParamSfiData@@QBEABVTDesC16@@XZ @ 192 NONAME ; class TDesC16 const & TPhoneCmdParamSfiData::Number(void) const
+	?OwnPhoneNumberText@TPhoneCmdParamEmergencyCallHeaderData@@QBEABVTDesC16@@XZ @ 193 NONAME ; class TDesC16 const & TPhoneCmdParamEmergencyCallHeaderData::OwnPhoneNumberText(void) const
+	?QueryPrompt@TPhoneCmdParamQuery@@QBEABVTDesC16@@XZ @ 194 NONAME ; class TDesC16 const & TPhoneCmdParamQuery::QueryPrompt(void) const
+	?NewL@CPhoneQwertyHandler@@SAPAV1@XZ @ 195 NONAME ; class CPhoneQwertyHandler * CPhoneQwertyHandler::NewL(void)
+	?SetQueryPrompt@TPhoneCmdParamQuery@@QAEXABVTDesC16@@@Z @ 196 NONAME ; void TPhoneCmdParamQuery::SetQueryPrompt(class TDesC16 const &)
+	?IsNumericKey@CPhoneKeys@@SAHABUTKeyEvent@@W4TEventCode@@@Z @ 197 NONAME ; int CPhoneKeys::IsNumericKey(struct TKeyEvent const &, enum TEventCode)
+	?SetCaptureType@TPhoneCmdParamKeyCapture@@QAEXW4TPhoneCaptureType@@@Z @ 198 NONAME ; void TPhoneCmdParamKeyCapture::SetCaptureType(enum TPhoneCaptureType)
+	?ViewUid@TPhoneCmdParamAppInfo@@QBE?AVTUid@@XZ @ 199 NONAME ; class TUid TPhoneCmdParamAppInfo::ViewUid(void) const
+	?SetLabelText@TPhoneCmdParamEmergencyCallHeaderData@@QAEXABVTDesC16@@@Z @ 200 NONAME ; void TPhoneCmdParamEmergencyCallHeaderData::SetLabelText(class TDesC16 const &)
+	??0TPhoneCmdParamSpeedDial@@QAE@XZ @ 201 NONAME ; TPhoneCmdParamSpeedDial::TPhoneCmdParamSpeedDial(void)
+	?IsCallerText@TPhoneCmdParamRingTone@@QAEHXZ @ 202 NONAME ; int TPhoneCmdParamRingTone::IsCallerText(void)
+	?SetBitmap@TPhoneCmdParamBitmap@@QAEXPAVCFbsBitmap@@@Z @ 203 NONAME ; void TPhoneCmdParamBitmap::SetBitmap(class CFbsBitmap *)
+	?SetNumber@TPhoneCmdParamSfiData@@QAEXABVTDesC16@@@Z @ 204 NONAME ; void TPhoneCmdParamSfiData::SetNumber(class TDesC16 const &)
+	?Location@TPhoneCmdParamSpeedDial@@QAEHXZ @ 205 NONAME ; int TPhoneCmdParamSpeedDial::Location(void)
+	?CipheringIndicatorAllowed@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 206 NONAME ; int TPhoneCmdParamCallHeaderData::CipheringIndicatorAllowed(void) const
+	?Name@TPhoneCmdParamSfiData@@QBEABVTDesC16@@XZ @ 207 NONAME ; class TDesC16 const & TPhoneCmdParamSfiData::Name(void) const
+	??0TPhoneCmdParamQuery@@QAE@ABV0@@Z @ 208 NONAME ; TPhoneCmdParamQuery::TPhoneCmdParamQuery(class TPhoneCmdParamQuery const &)
+	?CallState@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 209 NONAME ; int TPhoneCmdParamCallHeaderData::CallState(void) const
+	??0TPhoneCmdParamIncallIndicatorData@@QAE@XZ @ 210 NONAME ; TPhoneCmdParamIncallIndicatorData::TPhoneCmdParamIncallIndicatorData(void)
+	?Picture@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 211 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::Picture(void) const
+	?SetCallThemeSettingsObserver@CPhoneCallThemeMonitor@@QAEXPAVMPhoneCallThemeSettingsObserver@@@Z @ 212 NONAME ; void CPhoneCallThemeMonitor::SetCallThemeSettingsObserver(class MPhoneCallThemeSettingsObserver *)
+	?SetDiverted@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 213 NONAME ; void TPhoneCmdParamCallHeaderData::SetDiverted(int)
+	?ServiceId@TPhoneCmdParamCallHeaderData@@QBEKXZ @ 214 NONAME ; unsigned long TPhoneCmdParamCallHeaderData::ServiceId(void) const
+	?LabelText@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 215 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::LabelText(void) const
+	?Overflow@CPhoneLogger@@EAEXAAVTDes16@@@Z @ 216 NONAME ; void CPhoneLogger::Overflow(class TDes16 &)
+	?SetCNAPText@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@W4TPhoneTextClippingDirection@1@@Z @ 217 NONAME ; void TPhoneCmdParamCallHeaderData::SetCNAPText(class TDesC16 const &, enum TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection)
+	?SetServiceId@TPhoneCmdParamSpeedDial@@QAEXI@Z @ 218 NONAME ; void TPhoneCmdParamSpeedDial::SetServiceId(unsigned int)
+	?SetKeyEvent@TPhoneCmdParamKeyEvent@@QAEXABUTKeyEvent@@@Z @ 219 NONAME ; void TPhoneCmdParamKeyEvent::SetKeyEvent(struct TKeyEvent const &)
+	?Instance@CPhonePubSubProxy@@SAPAV1@XZ @ 220 NONAME ; class CPhonePubSubProxy * CPhonePubSubProxy::Instance(void)
+	?ResourceId@TPhoneCmdParamNote@@QBEHXZ @ 221 NONAME ; int TPhoneCmdParamNote::ResourceId(void) const
+	?CipheringIndicatorAllowed@TPhoneCmdParamEmergencyCallHeaderData@@QBEHXZ @ 222 NONAME ; int TPhoneCmdParamEmergencyCallHeaderData::CipheringIndicatorAllowed(void) const
+	?CancelAllNotifies@CPhoneCenRepProxy@@SAXPAVMPhoneCenRepObserver@@@Z @ 223 NONAME ; void CPhoneCenRepProxy::CancelAllNotifies(class MPhoneCenRepObserver *)
+	??1CPhoneQwertyHandler@@UAE@XZ @ 224 NONAME ; CPhoneQwertyHandler::~CPhoneQwertyHandler(void)
+	?TextResourceId@TPhoneCmdParamNote@@QBEHXZ @ 225 NONAME ; int TPhoneCmdParamNote::TextResourceId(void) const
+	?SetRemotePhoneNumber@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 226 NONAME ; void TPhoneCmdParamCallHeaderData::SetRemotePhoneNumber(class TDesC16 const &)
+	?CipheringIndicatorAllowed@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 227 NONAME ; int TPhoneCmdParamIncallIndicatorData::CipheringIndicatorAllowed(void) const
+	?SetScreenLocked@CPhoneStorage@@UAEXH@Z @ 228 NONAME ; void CPhoneStorage::SetScreenLocked(int)
+	??0TPhoneCmdParamCallStateData@@QAE@XZ @ 229 NONAME ; TPhoneCmdParamCallStateData::TPhoneCmdParamCallStateData(void)
+	?SetKeyCode@TPhoneCmdParamKeyCapture@@QAEXW4TKeyCode@@@Z @ 230 NONAME ; void TPhoneCmdParamKeyCapture::SetKeyCode(enum TKeyCode)
+	?CustomMessageId@TPhoneCmdParamAppInfo@@QBE?AVTUid@@XZ @ 231 NONAME ; class TUid TPhoneCmdParamAppInfo::CustomMessageId(void) const
+	?RemotePhoneNumber@TPhoneCmdParamCallHeaderData@@QBEABVTDesC16@@XZ @ 232 NONAME ; class TDesC16 const & TPhoneCmdParamCallHeaderData::RemotePhoneNumber(void) const
+	?SetType@TPhoneCmdParamNote@@QAEXW4TPhoneNoteType@@@Z @ 233 NONAME ; void TPhoneCmdParamNote::SetType(enum TPhoneNoteType)
+	?Instance@CPhoneClearBlacklist@@SAPAV1@XZ @ 234 NONAME ; class CPhoneClearBlacklist * CPhoneClearBlacklist::Instance(void)
+	?TextToSay@TPhoneCmdParamRingTone@@QBEABVTDesC16@@XZ @ 235 NONAME ; class TDesC16 const & TPhoneCmdParamRingTone::TextToSay(void) const
+	?Type@TPhoneCmdParamNote@@QBE?AW4TPhoneNoteType@@XZ @ 236 NONAME ; enum TPhoneNoteType TPhoneCmdParamNote::Type(void) const
+	?SetPicture@TPhoneCmdParamCallHeaderData@@QAEXABVTDesC16@@@Z @ 237 NONAME ; void TPhoneCmdParamCallHeaderData::SetPicture(class TDesC16 const &)
+	?Integer@TPhoneCmdParamInteger@@QBEHXZ @ 238 NONAME ; int TPhoneCmdParamInteger::Integer(void) const
+	?Mode@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 239 NONAME ; int TPhoneCmdParamIncallIndicatorData::Mode(void) const
+	?SetText@TPhoneCmdParamNote@@QAEXABVTDesC16@@@Z @ 240 NONAME ; void TPhoneCmdParamNote::SetText(class TDesC16 const &)
+	?SetCallerTextStatus@TPhoneCmdParamRingTone@@QAEXH@Z @ 241 NONAME ; void TPhoneCmdParamRingTone::SetCallerTextStatus(int)
+	?IsWiredAccAvailable@TPhoneCmdParamAudioAvailability@@QBEHXZ @ 242 NONAME ; int TPhoneCmdParamAudioAvailability::IsWiredAccAvailable(void) const
+	?SetWaitForReady@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 243 NONAME ; void TPhoneCmdParamGlobalNote::SetWaitForReady(int)
+	??0TPhoneCmdParamBoolean@@QAE@XZ @ 244 NONAME ; TPhoneCmdParamBoolean::TPhoneCmdParamBoolean(void)
+	?QueryCommandObserver@TPhoneCmdParamQuery@@QAEPAVMPhoneQueryCommandObserver@@XZ @ 245 NONAME ; class MPhoneQueryCommandObserver * TPhoneCmdParamQuery::QueryCommandObserver(void)
+	?DataText@TPhoneCmdParamQuery@@QBEPAVTDes16@@XZ @ 246 NONAME ; class TDes16 * TPhoneCmdParamQuery::DataText(void) const
+	?SetReal@CPhoneCenRepProxy@@QAEHABVTUid@@IN@Z @ 247 NONAME ; int CPhoneCenRepProxy::SetReal(class TUid const &, unsigned int, double)
+	??0TPhoneCmdParamCustomDialer@@QAE@XZ @ 248 NONAME ; TPhoneCmdParamCustomDialer::TPhoneCmdParamCustomDialer(void)
+	??1CPhonePubSubProxy@@UAE@XZ @ 249 NONAME ; CPhonePubSubProxy::~CPhonePubSubProxy(void)
+	?NumericKeyCode@CPhoneQwertyHandler@@QAEHABUTKeyEvent@@@Z @ 250 NONAME ; int CPhoneQwertyHandler::NumericKeyCode(struct TKeyEvent const &)
+	??0TPhoneCmdParamNote@@QAE@XZ @ 251 NONAME ; TPhoneCmdParamNote::TPhoneCmdParamNote(void)
+	?Volume@TPhoneCmdParamRingTone@@QBEHXZ @ 252 NONAME ; int TPhoneCmdParamRingTone::Volume(void) const
+	?SetItemTextArrayForListQuery@TPhoneCmdParamQuery@@QAEXAAVMDesC16Array@@@Z @ 253 NONAME ; void TPhoneCmdParamQuery::SetItemTextArrayForListQuery(class MDesC16Array &)
+	?Type@TPhoneCmdParamRingTone@@QBE?AW4TPhoneRingToneType@@XZ @ 254 NONAME ; enum TPhoneRingToneType TPhoneCmdParamRingTone::Type(void) const
+	?Key@TPhoneCmdParamKeyCapture@@QBE?AW4TStdScanCode@@XZ @ 255 NONAME ; enum TStdScanCode TPhoneCmdParamKeyCapture::Key(void) const
+	?LabelText@TPhoneCmdParamEmergencyCallHeaderData@@QBEABVTDesC16@@XZ @ 256 NONAME ; class TDesC16 const & TPhoneCmdParamEmergencyCallHeaderData::LabelText(void) const
+	?Ciphering@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 257 NONAME ; int TPhoneCmdParamIncallIndicatorData::Ciphering(void) const
+	?SetQueryCommandObserver@TPhoneCmdParamQuery@@QAEXAAVMPhoneQueryCommandObserver@@@Z @ 258 NONAME ; void TPhoneCmdParamQuery::SetQueryCommandObserver(class MPhoneQueryCommandObserver &)
+	?IsPhoneUIFeatureSupported@CPhoneCenRepProxy@@QAEHH@Z @ 259 NONAME ; int CPhoneCenRepProxy::IsPhoneUIFeatureSupported(int)
+	?DefaultCba@TPhoneCmdParamQuery@@QBEHXZ @ 260 NONAME ; int TPhoneCmdParamQuery::DefaultCba(void) const
+	?CallState@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 261 NONAME ; int TPhoneCmdParamIncallIndicatorData::CallState(void) const
+	??0TPhoneCmdParamNumberEntryObserver@@QAE@XZ @ 262 NONAME ; TPhoneCmdParamNumberEntryObserver::TPhoneCmdParamNumberEntryObserver(void)
+	?SetLine2@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 263 NONAME ; void TPhoneCmdParamCallHeaderData::SetLine2(int)
+	?FetchValuesFromCenRepL@CPhoneCenRepProxy@@QAEXAAVTPhoneCmdParamAppInfo@@W4TKeyCode@@PAVHBufC8@@AAH@Z @ 264 NONAME ; void CPhoneCenRepProxy::FetchValuesFromCenRepL(class TPhoneCmdParamAppInfo &, enum TKeyCode, class HBufC8 *, int &)
+	?ParticipantCLI@TPhoneCmdParamCallHeaderData@@QBE?AW4TPhoneParticipantListCLI@1@XZ @ 265 NONAME ; enum TPhoneCmdParamCallHeaderData::TPhoneParticipantListCLI TPhoneCmdParamCallHeaderData::ParticipantCLI(void) const
+	?Thumbnail@TPhoneCmdParamCallHeaderData@@QBEPAVCFbsBitmap@@XZ @ 266 NONAME ; class CFbsBitmap * TPhoneCmdParamCallHeaderData::Thumbnail(void) const
+	?SetTimeOut@TPhoneCmdParamQuery@@QAEXH@Z @ 267 NONAME ; void TPhoneCmdParamQuery::SetTimeOut(int)
+	?Boolean@TPhoneCmdParamBoolean@@QBEHXZ @ 268 NONAME ; int TPhoneCmdParamBoolean::Boolean(void) const
+	?CLITextClippingDirection@TPhoneCmdParamCallHeaderData@@QBE?AW4TPhoneTextClippingDirection@1@XZ @ 269 NONAME ; enum TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection TPhoneCmdParamCallHeaderData::CLITextClippingDirection(void) const
+	?LogMsgFromPhoneUIToPE@CPhoneLogger@@QAEXHH@Z @ 270 NONAME ; void CPhoneLogger::LogMsgFromPhoneUIToPE(int, int)
+	?SetCustomMessageId@TPhoneCmdParamAppInfo@@QAEXABVTUid@@@Z @ 271 NONAME ; void TPhoneCmdParamAppInfo::SetCustomMessageId(class TUid const &)
+	?ResolveResourceID@CPhoneResourceResolverBase@@UBEHABH@Z @ 272 NONAME ; int CPhoneResourceResolverBase::ResolveResourceID(int const &) const
+	?SetName@TPhoneCmdParamSfiData@@QAEXABVTDesC16@@@Z @ 273 NONAME ; void TPhoneCmdParamSfiData::SetName(class TDesC16 const &)
+	?SetType@TPhoneCmdParamGlobalNote@@QAEXW4TAknGlobalNoteType@@@Z @ 274 NONAME ; void TPhoneCmdParamGlobalNote::SetType(enum TAknGlobalNoteType)
+	?SetLittleBubbleVisible@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 275 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetLittleBubbleVisible(int)
+	?Ciphering@TPhoneCmdParamCallHeaderData@@QBEHXZ @ 276 NONAME ; int TPhoneCmdParamCallHeaderData::Ciphering(void) const
+	?SetType@TPhoneCmdParamRingTone@@QAEXW4TPhoneRingToneType@@@Z @ 277 NONAME ; void TPhoneCmdParamRingTone::SetType(enum TPhoneRingToneType)
+	?ResourceId@TPhoneCmdParamDynMenu@@QBEHXZ @ 278 NONAME ; int TPhoneCmdParamDynMenu::ResourceId(void) const
+	?SetCipheringIndicatorAllowed@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 279 NONAME ; void TPhoneCmdParamCallHeaderData::SetCipheringIndicatorAllowed(int)
+	?SetWaitTime@TPhoneCmdParamProgressNote@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 280 NONAME ; void TPhoneCmdParamProgressNote::SetWaitTime(class TTimeIntervalMicroSeconds32)
+	?Ciphering@TPhoneCmdParamEmergencyCallHeaderData@@QBEHXZ @ 281 NONAME ; int TPhoneCmdParamEmergencyCallHeaderData::Ciphering(void) const
+	??1CPhoneCallThemeMonitor@@UAE@XZ @ 282 NONAME ; CPhoneCallThemeMonitor::~CPhoneCallThemeMonitor(void)
+	?SetNumberType@TPhoneCmdParamCallHeaderData@@QAEXH@Z @ 283 NONAME ; void TPhoneCmdParamCallHeaderData::SetNumberType(int)
+	?Mute@TPhoneCmdParamIncallIndicatorData@@QBEHXZ @ 284 NONAME ; int TPhoneCmdParamIncallIndicatorData::Mute(void) const
+	?IsQwertyInput@CPhoneQwertyHandler@@QBEHXZ @ 285 NONAME ; int CPhoneQwertyHandler::IsQwertyInput(void) const
+	?SetBoolean@TPhoneCmdParamBoolean@@QAEXH@Z @ 286 NONAME ; void TPhoneCmdParamBoolean::SetBoolean(int)
+	?IsTelephonyFeatureSupported@CPhoneResourceResolverBase@@MBEHH@Z @ 287 NONAME ; int CPhoneResourceResolverBase::IsTelephonyFeatureSupported(int) const
+	?Instance@CPhoneMainErrorMessagesHandler@@SAPAV1@XZ @ 288 NONAME ; class CPhoneMainErrorMessagesHandler * CPhoneMainErrorMessagesHandler::Instance(void)
+	?SetViewUid@TPhoneCmdParamAppInfo@@QAEXABVTUid@@@Z @ 289 NONAME ; void TPhoneCmdParamAppInfo::SetViewUid(class TUid const &)
+	?SetServiceId@TPhoneCmdParamCallHeaderData@@QAEXK@Z @ 290 NONAME ; void TPhoneCmdParamCallHeaderData::SetServiceId(unsigned long)
+	?Instance@CPhoneCenRepProxy@@SAPAV1@XZ @ 291 NONAME ; class CPhoneCenRepProxy * CPhoneCenRepProxy::Instance(void)
+	?SetQueryType@TPhoneCmdParamQuery@@QAEXW4TPhoneQueryType@@@Z @ 292 NONAME ; void TPhoneCmdParamQuery::SetQueryType(enum TPhoneQueryType)
+	?Value@CPhonePubSubProxy@@QAEHABVTUid@@I@Z @ 293 NONAME ; int CPhonePubSubProxy::Value(class TUid const &, unsigned int)
+	?SetWiredAccAvailable@TPhoneCmdParamAudioAvailability@@QAEXH@Z @ 294 NONAME ; void TPhoneCmdParamAudioAvailability::SetWiredAccAvailable(int)
+	??0TPhoneCmdParamAudioOutput@@QAE@XZ @ 295 NONAME ; TPhoneCmdParamAudioOutput::TPhoneCmdParamAudioOutput(void)
+	?IsCallerImage@TPhoneCmdParamRingTone@@QAEHXZ @ 296 NONAME ; int TPhoneCmdParamRingTone::IsCallerImage(void)
+	??0TPhoneCmdParamQuery@@QAE@XZ @ 297 NONAME ; TPhoneCmdParamQuery::TPhoneCmdParamQuery(void)
+	?Instance@CPhoneMainResourceResolver@@SAPAV1@XZ @ 298 NONAME ; class CPhoneMainResourceResolver * CPhoneMainResourceResolver::Instance(void)
+	?ServiceId@TPhoneCmdParamSpeedDial@@QBEIXZ @ 299 NONAME ; unsigned int TPhoneCmdParamSpeedDial::ServiceId(void) const
+	??1CPhoneLibraryContainer@@UAE@XZ @ 300 NONAME ; CPhoneLibraryContainer::~CPhoneLibraryContainer(void)
+	?ClearBlackListOnNextKey@CPhoneClearBlacklist@@QAEXXZ @ 301 NONAME ; void CPhoneClearBlacklist::ClearBlackListOnNextKey(void)
+	?Tone@TPhoneCmdParamQuery@@QBEHXZ @ 302 NONAME ; int TPhoneCmdParamQuery::Tone(void) const
+	?SetNumberType@TPhoneCmdParamSpeedDial@@QAEXW4TPhoneNumberType@@@Z @ 303 NONAME ; void TPhoneCmdParamSpeedDial::SetNumberType(enum TPhoneNumberType)
+	?SetRingingType@TPhoneCmdParamRingTone@@QAEXH@Z @ 304 NONAME ; void TPhoneCmdParamRingTone::SetRingingType(int)
+	?SetCiphering@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 305 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetCiphering(int)
+	?SetCipheringIndicatorAllowed@TPhoneCmdParamIncallIndicatorData@@QAEXH@Z @ 306 NONAME ; void TPhoneCmdParamIncallIndicatorData::SetCipheringIndicatorAllowed(int)
+	?NeedToEnableKeylock@CPhoneStorage@@UAEHXZ @ 307 NONAME ; int CPhoneStorage::NeedToEnableKeylock(void)
+	?AudioOutput@TPhoneCmdParamAudioOutput@@QBE?AW4TPEAudioOutput@@XZ @ 308 NONAME ; enum TPEAudioOutput TPhoneCmdParamAudioOutput::AudioOutput(void) const
+	?SetResourceId@TPhoneCmdParamProgressNote@@QAEXH@Z @ 309 NONAME ; void TPhoneCmdParamProgressNote::SetResourceId(int)
+	??0TPhoneCmdParamInteger@@QAE@XZ @ 310 NONAME ; TPhoneCmdParamInteger::TPhoneCmdParamInteger(void)
+	?SetType@TPhoneCmdParamTransEffect@@QAEXW4TPhoneTransEffectType@@@Z @ 311 NONAME ; void TPhoneCmdParamTransEffect::SetType(enum TPhoneTransEffectType)
+	?Bitmap@TPhoneCmdParamBitmap@@QBEPAVCFbsBitmap@@XZ @ 312 NONAME ; class CFbsBitmap * TPhoneCmdParamBitmap::Bitmap(void) const
+	?SetTone@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 313 NONAME ; void TPhoneCmdParamGlobalNote::SetTone(int)
+	?After@CPhoneTimer@@QAEXVTTimeIntervalMicroSeconds32@@VTCallBack@@@Z @ 314 NONAME ; void CPhoneTimer::After(class TTimeIntervalMicroSeconds32, class TCallBack)
+	?SetTimeout@TPhoneCmdParamGlobalNote@@QAEXH@Z @ 315 NONAME ; void TPhoneCmdParamGlobalNote::SetTimeout(int)
+	?Timeout@TPhoneCmdParamGlobalNote@@QBEHXZ @ 316 NONAME ; int TPhoneCmdParamGlobalNote::Timeout(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/eabi/phoneuiutilsu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,421 @@
+EXPORTS
+	_ZN10CPhoneKeys10IsDtmfToneERK9TKeyEvent10TEventCode @ 1 NONAME
+	_ZN10CPhoneKeys11IsEscapeKeyERK9TKeyEvent10TEventCode @ 2 NONAME
+	_ZN10CPhoneKeys11IsExtraCharEi @ 3 NONAME
+	_ZN10CPhoneKeys11IsNumberKeyERK9TKeyEvent10TEventCode @ 4 NONAME
+	_ZN10CPhoneKeys12IsNumericKeyERK9TKeyEvent10TEventCode @ 5 NONAME
+	_ZN10CPhoneKeys15IsSecondHashKeyERK6TDes16 @ 6 NONAME
+	_ZN10CPhoneKeys8ValidateERK7TDesC16 @ 7 NONAME
+	_ZN11CPhoneTimer11CancelTimerEv @ 8 NONAME
+	_ZN11CPhoneTimer4NewLEi @ 9 NONAME
+	_ZN11CPhoneTimer5AfterE27TTimeIntervalMicroSeconds329TCallBack @ 10 NONAME
+	_ZN11CPhoneTimer5AfterE27TTimeIntervalMicroSeconds32P11MPhoneTimer @ 11 NONAME
+	_ZN11CPhoneTimerD0Ev @ 12 NONAME
+	_ZN11CPhoneTimerD1Ev @ 13 NONAME
+	_ZN11CPhoneTimerD2Ev @ 14 NONAME
+	_ZN12CPhoneLogger14LogStateChangeEii @ 15 NONAME
+	_ZN12CPhoneLogger14SetPhoneEngineEP13MPEPhoneModel @ 16 NONAME
+	_ZN12CPhoneLogger21LogMsgFromPEToPhoneUIEii @ 17 NONAME
+	_ZN12CPhoneLogger21LogMsgFromPhoneUIToPEEii @ 18 NONAME
+	_ZN12CPhoneLogger23LogMsgFromControlToViewEii @ 19 NONAME
+	_ZN12CPhoneLogger24LogMsgFromPEToPhoneUIEndEi @ 20 NONAME
+	_ZN12CPhoneLogger5LogItE20TPhoneUILoggingLevel24TPhoneUILoggingComponent11TRefByValueIK7TDesC16Ez @ 21 NONAME
+	_ZN12CPhoneLogger8OverflowER6TDes16 @ 22 NONAME
+	_ZN12CPhoneLoggerC1E4TUid @ 23 NONAME
+	_ZN12CPhoneLoggerC2E4TUid @ 24 NONAME
+	_ZN12CPhoneLoggerD0Ev @ 25 NONAME
+	_ZN12CPhoneLoggerD1Ev @ 26 NONAME
+	_ZN12CPhoneLoggerD2Ev @ 27 NONAME
+	_ZN13CPhoneStorage14IsScreenLockedEv @ 28 NONAME
+	_ZN13CPhoneStorage15SetScreenLockedEi @ 29 NONAME
+	_ZN13CPhoneStorage19NeedToEnableKeylockEv @ 30 NONAME
+	_ZN13CPhoneStorage20ResetBlockedKeysListEv @ 31 NONAME
+	_ZN13CPhoneStorage22AppendBlockedKeysListLE12TStdScanCode @ 32 NONAME
+	_ZN13CPhoneStorage22IsBlockedKeysListEmptyEv @ 33 NONAME
+	_ZN13CPhoneStorage22SetNeedToEnableKeylockEi @ 34 NONAME
+	_ZN13CPhoneStorage4NewLEv @ 35 NONAME
+	_ZN13CPhoneStorageD0Ev @ 36 NONAME
+	_ZN13CPhoneStorageD1Ev @ 37 NONAME
+	_ZN13CPhoneStorageD2Ev @ 38 NONAME
+	_ZN17CPhoneCenRepProxy12CancelNotifyEP20MPhoneCenRepObserverj @ 39 NONAME
+	_ZN17CPhoneCenRepProxy13NotifyChangeLERK4TUidjP20MPhoneCenRepObserver @ 40 NONAME
+	_ZN17CPhoneCenRepProxy17CancelAllNotifiesEP20MPhoneCenRepObserver @ 41 NONAME
+	_ZN17CPhoneCenRepProxy22FetchValuesFromCenRepLER21TPhoneCmdParamAppInfo8TKeyCodeP6HBufC8Ri @ 42 NONAME
+	_ZN17CPhoneCenRepProxy25IsPhoneUIFeatureSupportedEi @ 43 NONAME
+	_ZN17CPhoneCenRepProxy27IsTelephonyFeatureSupportedEi @ 44 NONAME
+	_ZN17CPhoneCenRepProxy6SetIntERK4TUidji @ 45 NONAME
+	_ZN17CPhoneCenRepProxy7SetRealERK4TUidjd @ 46 NONAME
+	_ZN17CPhoneCenRepProxy8InstanceEv @ 47 NONAME
+	_ZN17CPhoneCenRepProxy9SetStringERK4TUidjRK7TDesC16 @ 48 NONAME
+	_ZN17CPhoneCenRepProxyD0Ev @ 49 NONAME
+	_ZN17CPhoneCenRepProxyD1Ev @ 50 NONAME
+	_ZN17CPhoneCenRepProxyD2Ev @ 51 NONAME
+	_ZN17CPhonePubSubProxy13NotifyChangeLERK4TUidjP20MPhonePubSubObserver @ 52 NONAME
+	_ZN17CPhonePubSubProxy19ChangePropertyValueERK4TUidji @ 53 NONAME
+	_ZN17CPhonePubSubProxy22CancelAllNotificationsEP20MPhonePubSubObserver @ 54 NONAME
+	_ZN17CPhonePubSubProxy5ValueERK4TUidj @ 55 NONAME
+	_ZN17CPhonePubSubProxy8InstanceEv @ 56 NONAME
+	_ZN17CPhonePubSubProxyD0Ev @ 57 NONAME
+	_ZN17CPhonePubSubProxyD1Ev @ 58 NONAME
+	_ZN17CPhonePubSubProxyD2Ev @ 59 NONAME
+	_ZN18CPhoneMethodLoggerC1E24TPhoneUILoggingComponent7TPtrC16 @ 60 NONAME
+	_ZN18CPhoneMethodLoggerC2E24TPhoneUILoggingComponent7TPtrC16 @ 61 NONAME
+	_ZN18CPhoneMethodLoggerD0Ev @ 62 NONAME
+	_ZN18CPhoneMethodLoggerD1Ev @ 63 NONAME
+	_ZN18CPhoneMethodLoggerD2Ev @ 64 NONAME
+	_ZN18TPhoneCmdParamNote10SetTimeoutEN14CAknNoteDialog8TTimeoutE @ 65 NONAME
+	_ZN18TPhoneCmdParamNote13SetResourceIdEi @ 66 NONAME
+	_ZN18TPhoneCmdParamNote17SetTextResourceIdEi @ 67 NONAME
+	_ZN18TPhoneCmdParamNote7SetTextERK7TDesC16 @ 68 NONAME
+	_ZN18TPhoneCmdParamNote7SetToneEN14CAknNoteDialog5TToneE @ 69 NONAME
+	_ZN18TPhoneCmdParamNote7SetTypeE14TPhoneNoteType @ 70 NONAME
+	_ZN18TPhoneCmdParamNoteC1Ev @ 71 NONAME
+	_ZN18TPhoneCmdParamNoteC2Ev @ 72 NONAME
+	_ZN18TPhoneCommandParamC1Ev @ 73 NONAME
+	_ZN18TPhoneCommandParamC2Ev @ 74 NONAME
+	_ZN19CPhoneQwertyHandler14NumericKeyCodeERK9TKeyEvent @ 75 NONAME
+	_ZN19CPhoneQwertyHandler4NewLEv @ 76 NONAME
+	_ZN19CPhoneQwertyHandlerD0Ev @ 77 NONAME
+	_ZN19CPhoneQwertyHandlerD1Ev @ 78 NONAME
+	_ZN19CPhoneQwertyHandlerD2Ev @ 79 NONAME
+	_ZN19TPhoneCmdParamQuery10SetTimeOutEi @ 80 NONAME
+	_ZN19TPhoneCmdParamQuery11SetDataTextEP6TDes16 @ 81 NONAME
+	_ZN19TPhoneCmdParamQuery12SetQueryTypeE15TPhoneQueryType @ 82 NONAME
+	_ZN19TPhoneCmdParamQuery13SetContentCbaEi @ 83 NONAME
+	_ZN19TPhoneCmdParamQuery13SetDefaultCbaEi @ 84 NONAME
+	_ZN19TPhoneCmdParamQuery14SetQueryPromptERK7TDesC16 @ 85 NONAME
+	_ZN19TPhoneCmdParamQuery17SetCommandParamIdEN18TPhoneCommandParam13TPhoneParamIdE @ 86 NONAME
+	_ZN19TPhoneCmdParamQuery17SetSendKeyEnabledEi @ 87 NONAME
+	_ZN19TPhoneCmdParamQuery18SetQueryResourceIdEi @ 88 NONAME
+	_ZN19TPhoneCmdParamQuery20QueryCommandObserverEv @ 89 NONAME
+	_ZN19TPhoneCmdParamQuery20SetCbaCommandMappingEii @ 90 NONAME
+	_ZN19TPhoneCmdParamQuery23SetQueryCommandObserverER26MPhoneQueryCommandObserver @ 91 NONAME
+	_ZN19TPhoneCmdParamQuery26SetCustomCommandForTimeOutEi @ 92 NONAME
+	_ZN19TPhoneCmdParamQuery28SetItemTextArrayForListQueryER12MDesC16Array @ 93 NONAME
+	_ZN19TPhoneCmdParamQuery7SetToneEi @ 94 NONAME
+	_ZN19TPhoneCmdParamQueryC1ERKS_ @ 95 NONAME
+	_ZN19TPhoneCmdParamQueryC1Ev @ 96 NONAME
+	_ZN19TPhoneCmdParamQueryC2ERKS_ @ 97 NONAME
+	_ZN19TPhoneCmdParamQueryC2Ev @ 98 NONAME
+	_ZN19TPhoneCmdParamQueryaSERKS_ @ 99 NONAME
+	_ZN20CPhoneClearBlacklist17ClearBlackListNowEv @ 100 NONAME
+	_ZN20CPhoneClearBlacklist23ClearBlackListOnNextKeyEv @ 101 NONAME
+	_ZN20CPhoneClearBlacklist7CreateLER10RWsSessionRK11RWindowBase @ 102 NONAME
+	_ZN20CPhoneClearBlacklist8InstanceEv @ 103 NONAME
+	_ZN20CPhoneClearBlacklistD0Ev @ 104 NONAME
+	_ZN20CPhoneClearBlacklistD1Ev @ 105 NONAME
+	_ZN20CPhoneClearBlacklistD2Ev @ 106 NONAME
+	_ZN20CPhoneRecoverySystem10RecoverNowEiai @ 107 NONAME
+	_ZN20CPhoneRecoverySystem19EnablePreconditionLEv @ 108 NONAME
+	_ZN20CPhoneRecoverySystem4AddLE9TCallBackaN19CTeleRecoverySystem14TRecoveryStateE @ 109 NONAME
+	_ZN20CPhoneRecoverySystem6RemoveEi @ 110 NONAME
+	_ZN20CPhoneRecoverySystem8InstanceEv @ 111 NONAME
+	_ZN20TPhoneCmdParamBitmap13SetMaskBitmapEP10CFbsBitmap @ 112 NONAME
+	_ZN20TPhoneCmdParamBitmap9SetBitmapEP10CFbsBitmap @ 113 NONAME
+	_ZN20TPhoneCmdParamBitmapC1Ev @ 114 NONAME
+	_ZN20TPhoneCmdParamBitmapC2Ev @ 115 NONAME
+	_ZN20TPhoneCmdParamString6StringEv @ 116 NONAME
+	_ZN20TPhoneCmdParamString9SetStringEP6TPtr16 @ 117 NONAME
+	_ZN20TPhoneCmdParamStringC1Ev @ 118 NONAME
+	_ZN20TPhoneCmdParamStringC2Ev @ 119 NONAME
+	_ZN21TPhoneCmdParamAppInfo10SetViewUidERK4TUid @ 120 NONAME
+	_ZN21TPhoneCmdParamAppInfo16SetCustomMessageERK6TDesC8 @ 121 NONAME
+	_ZN21TPhoneCmdParamAppInfo18SetCustomMessageIdERK4TUid @ 122 NONAME
+	_ZN21TPhoneCmdParamAppInfo20SetMultipleInstancesEi @ 123 NONAME
+	_ZN21TPhoneCmdParamAppInfo8SetParamERK6TDesC8 @ 124 NONAME
+	_ZN21TPhoneCmdParamAppInfo9SetAppUidERK4TUid @ 125 NONAME
+	_ZN21TPhoneCmdParamAppInfoC1Ev @ 126 NONAME
+	_ZN21TPhoneCmdParamAppInfoC2Ev @ 127 NONAME
+	_ZN21TPhoneCmdParamBoolean10SetBooleanEi @ 128 NONAME
+	_ZN21TPhoneCmdParamBooleanC1Ev @ 129 NONAME
+	_ZN21TPhoneCmdParamBooleanC2Ev @ 130 NONAME
+	_ZN21TPhoneCmdParamDynMenu10SetDynMenuEPv @ 131 NONAME
+	_ZN21TPhoneCmdParamDynMenu13SetResourceIdEi @ 132 NONAME
+	_ZN21TPhoneCmdParamDynMenu7DynMenuEv @ 133 NONAME
+	_ZN21TPhoneCmdParamDynMenuC1Ev @ 134 NONAME
+	_ZN21TPhoneCmdParamDynMenuC2Ev @ 135 NONAME
+	_ZN21TPhoneCmdParamInteger10SetIntegerEi @ 136 NONAME
+	_ZN21TPhoneCmdParamIntegerC1Ev @ 137 NONAME
+	_ZN21TPhoneCmdParamIntegerC2Ev @ 138 NONAME
+	_ZN21TPhoneCmdParamPointer10SetPointerEPv @ 139 NONAME
+	_ZN21TPhoneCmdParamPointerC1Ev @ 140 NONAME
+	_ZN21TPhoneCmdParamPointerC2Ev @ 141 NONAME
+	_ZN21TPhoneCmdParamSfiData7SetNameERK7TDesC16 @ 142 NONAME
+	_ZN21TPhoneCmdParamSfiData9SetNumberERK7TDesC16 @ 143 NONAME
+	_ZN21TPhoneCmdParamSfiDataC1Ev @ 144 NONAME
+	_ZN21TPhoneCmdParamSfiDataC2Ev @ 145 NONAME
+	_ZN22CPhoneCallThemeMonitor28SetCallThemeSettingsObserverEP31MPhoneCallThemeSettingsObserver @ 146 NONAME
+	_ZN22CPhoneCallThemeMonitor4NewLEv @ 147 NONAME
+	_ZN22CPhoneCallThemeMonitorD0Ev @ 148 NONAME
+	_ZN22CPhoneCallThemeMonitorD1Ev @ 149 NONAME
+	_ZN22CPhoneCallThemeMonitorD2Ev @ 150 NONAME
+	_ZN22CPhoneLibraryContainer11AddLibraryLERK8RLibrary @ 151 NONAME
+	_ZN22CPhoneLibraryContainer4NewLEv @ 152 NONAME
+	_ZN22CPhoneLibraryContainerD0Ev @ 153 NONAME
+	_ZN22CPhoneLibraryContainerD1Ev @ 154 NONAME
+	_ZN22CPhoneLibraryContainerD2Ev @ 155 NONAME
+	_ZN22TPhoneCmdParamKeyEvent11SetKeyEventERK9TKeyEvent @ 156 NONAME
+	_ZN22TPhoneCmdParamKeyEvent12SetEventCodeE10TEventCode @ 157 NONAME
+	_ZN22TPhoneCmdParamKeyEventC1Ev @ 158 NONAME
+	_ZN22TPhoneCmdParamKeyEventC2Ev @ 159 NONAME
+	_ZN22TPhoneCmdParamRingTone11SetRingToneERK7TDesC16 @ 160 NONAME
+	_ZN22TPhoneCmdParamRingTone12IsCallerTextEv @ 161 NONAME
+	_ZN22TPhoneCmdParamRingTone12SetTextToSayERK7TDesC16 @ 162 NONAME
+	_ZN22TPhoneCmdParamRingTone13IsCallerImageEv @ 163 NONAME
+	_ZN22TPhoneCmdParamRingTone14SetRingingTypeEi @ 164 NONAME
+	_ZN22TPhoneCmdParamRingTone19SetCallerTextStatusEi @ 165 NONAME
+	_ZN22TPhoneCmdParamRingTone20SetCallerImageStatusEi @ 166 NONAME
+	_ZN22TPhoneCmdParamRingTone7SetTypeE18TPhoneRingToneType @ 167 NONAME
+	_ZN22TPhoneCmdParamRingTone9SetVolumeEi @ 168 NONAME
+	_ZN22TPhoneCmdParamRingToneC1Ev @ 169 NONAME
+	_ZN22TPhoneCmdParamRingToneC2Ev @ 170 NONAME
+	_ZN23TPhoneCmdParamSpeedDial10NumberTypeEv @ 171 NONAME
+	_ZN23TPhoneCmdParamSpeedDial11PhoneNumberEv @ 172 NONAME
+	_ZN23TPhoneCmdParamSpeedDial11SetLocationEi @ 173 NONAME
+	_ZN23TPhoneCmdParamSpeedDial12SetServiceIdEj @ 174 NONAME
+	_ZN23TPhoneCmdParamSpeedDial13SetNumberTypeE16TPhoneNumberType @ 175 NONAME
+	_ZN23TPhoneCmdParamSpeedDial14SetPhoneNumberEP6TPtr16 @ 176 NONAME
+	_ZN23TPhoneCmdParamSpeedDial8LocationEv @ 177 NONAME
+	_ZN23TPhoneCmdParamSpeedDialC1Ev @ 178 NONAME
+	_ZN23TPhoneCmdParamSpeedDialC2Ev @ 179 NONAME
+	_ZN24TPhoneCmdParamGlobalNote11SetSoftkeysEi @ 180 NONAME
+	_ZN24TPhoneCmdParamGlobalNote15SetWaitForReadyEi @ 181 NONAME
+	_ZN24TPhoneCmdParamGlobalNote17SetTextResourceIdEi @ 182 NONAME
+	_ZN24TPhoneCmdParamGlobalNote7SetTextERK7TDesC16 @ 183 NONAME
+	_ZN24TPhoneCmdParamGlobalNote7SetToneEi @ 184 NONAME
+	_ZN24TPhoneCmdParamGlobalNote7SetTypeE18TAknGlobalNoteType @ 185 NONAME
+	_ZN24TPhoneCmdParamGlobalNoteC1Ev @ 186 NONAME
+	_ZN24TPhoneCmdParamGlobalNoteC2Ev @ 187 NONAME
+	_ZN24TPhoneCmdParamKeyCapture10SetKeyCodeE8TKeyCode @ 188 NONAME
+	_ZN24TPhoneCmdParamKeyCapture14SetCaptureTypeE17TPhoneCaptureType @ 189 NONAME
+	_ZN24TPhoneCmdParamKeyCapture6SetKeyE12TStdScanCode @ 190 NONAME
+	_ZN24TPhoneCmdParamKeyCaptureC1Ev @ 191 NONAME
+	_ZN24TPhoneCmdParamKeyCaptureC2Ev @ 192 NONAME
+	_ZN25TPhoneCmdParamAudioOutput14SetAudioOutputE14TPEAudioOutput @ 193 NONAME
+	_ZN25TPhoneCmdParamAudioOutputC1Ev @ 194 NONAME
+	_ZN25TPhoneCmdParamAudioOutputC2Ev @ 195 NONAME
+	_ZN25TPhoneCmdParamTransEffect7SetTypeE21TPhoneTransEffectType @ 196 NONAME
+	_ZN25TPhoneCmdParamTransEffectC1Ev @ 197 NONAME
+	_ZN25TPhoneCmdParamTransEffectC2Ev @ 198 NONAME
+	_ZN26CPhoneMainResourceResolver8InstanceEv @ 199 NONAME
+	_ZN26CPhoneResourceResolverBase14BaseConstructLEv @ 200 NONAME
+	_ZN26CPhoneResourceResolverBaseC1Ev @ 201 NONAME
+	_ZN26CPhoneResourceResolverBaseC2Ev @ 202 NONAME
+	_ZN26CPhoneResourceResolverBaseD0Ev @ 203 NONAME
+	_ZN26CPhoneResourceResolverBaseD1Ev @ 204 NONAME
+	_ZN26CPhoneResourceResolverBaseD2Ev @ 205 NONAME
+	_ZN26TPhoneCmdParamCustomDialer16DialerControllerEv @ 206 NONAME
+	_ZN26TPhoneCmdParamCustomDialer19SetDialerControllerEP22MPhoneDialerController @ 207 NONAME
+	_ZN26TPhoneCmdParamCustomDialerC1Ev @ 208 NONAME
+	_ZN26TPhoneCmdParamCustomDialerC2Ev @ 209 NONAME
+	_ZN26TPhoneCmdParamProgressNote11SetWaitTimeE27TTimeIntervalMicroSeconds32 @ 210 NONAME
+	_ZN26TPhoneCmdParamProgressNote13SetResourceIdEi @ 211 NONAME
+	_ZN26TPhoneCmdParamProgressNoteC1Ev @ 212 NONAME
+	_ZN26TPhoneCmdParamProgressNoteC2Ev @ 213 NONAME
+	_ZN27TPhoneCmdParamCallStateData12SetCallStateEi @ 214 NONAME
+	_ZN27TPhoneCmdParamCallStateData9SetCallIdEi @ 215 NONAME
+	_ZN27TPhoneCmdParamCallStateDataC1Ev @ 216 NONAME
+	_ZN27TPhoneCmdParamCallStateDataC2Ev @ 217 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData10SetCLITextERK7TDesC16NS_27TPhoneTextClippingDirectionE @ 218 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData10SetPictureERK7TDesC16 @ 219 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData11SetCNAPTextERK7TDesC16NS_27TPhoneTextClippingDirectionE @ 220 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData11SetCallTypeEi @ 221 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData11SetDivertedEi @ 222 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetCallStateEi @ 223 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetCipheringEi @ 224 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetLabelTextERK7TDesC16 @ 225 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetServiceIdEm @ 226 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData12SetThumbnailEP10CFbsBitmap @ 227 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData13SetCallerTextERK7TDesC16 @ 228 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData13SetNumberTypeEi @ 229 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData14SetContactLinkERK6TDesC8 @ 230 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData15SetHasThumbnailEi @ 231 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData17SetShortLabelTextERK7TDesC16 @ 232 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData20SetRemotePhoneNumberERK7TDesC16 @ 233 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData21SetParticipantListCLIENS_24TPhoneParticipantListCLIE @ 234 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData28SetCipheringIndicatorAllowedEi @ 235 NONAME
+	_ZN28TPhoneCmdParamCallHeaderData8SetLine2Ei @ 236 NONAME
+	_ZN28TPhoneCmdParamCallHeaderDataC1Ev @ 237 NONAME
+	_ZN28TPhoneCmdParamCallHeaderDataC2Ev @ 238 NONAME
+	_ZN30CPhoneMainErrorMessagesHandler8InstanceEv @ 239 NONAME
+	_ZN31TPhoneCmdParamAudioAvailability17SetBTAccAvailableEi @ 240 NONAME
+	_ZN31TPhoneCmdParamAudioAvailability20SetWiredAccAvailableEi @ 241 NONAME
+	_ZN31TPhoneCmdParamAudioAvailabilityC1Ev @ 242 NONAME
+	_ZN31TPhoneCmdParamAudioAvailabilityC2Ev @ 243 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData12SetCallStateEi @ 244 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData12SetCipheringEi @ 245 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData12SetEmergencyEi @ 246 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData22SetLittleBubbleVisibleEi @ 247 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData28SetCipheringIndicatorAllowedEi @ 248 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData7SetModeEi @ 249 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData7SetMuteEi @ 250 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorData8SetLine2Ei @ 251 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorDataC1Ev @ 252 NONAME
+	_ZN33TPhoneCmdParamIncallIndicatorDataC2Ev @ 253 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserver11SetObserverE9TCallBack @ 254 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserver8ObserverEv @ 255 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserverC1Ev @ 256 NONAME
+	_ZN33TPhoneCmdParamNumberEntryObserverC2Ev @ 257 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData12SetCipheringEi @ 258 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData12SetLabelTextERK7TDesC16 @ 259 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData13SetHeaderTextERK7TDesC16 @ 260 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData21SetOwnPhoneNumberTextERK7TDesC16 @ 261 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderData28SetCipheringIndicatorAllowedEi @ 262 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderDataC1Ev @ 263 NONAME
+	_ZN37TPhoneCmdParamEmergencyCallHeaderDataC2Ev @ 264 NONAME
+	_ZNK13CPhoneStorage17GetBlockedKeyListEv @ 265 NONAME
+	_ZNK17CPhoneCenRepProxy4FindERK4TUidmmR6RArrayImE @ 266 NONAME
+	_ZNK17CPhoneCenRepProxy6GetIntERK4TUidjRi @ 267 NONAME
+	_ZNK17CPhoneCenRepProxy7GetRealERK4TUidjRd @ 268 NONAME
+	_ZNK17CPhoneCenRepProxy9GetStringERK4TUidjR6TDes16 @ 269 NONAME
+	_ZNK18TPhoneCmdParamNote10ResourceIdEv @ 270 NONAME
+	_ZNK18TPhoneCmdParamNote14TextResourceIdEv @ 271 NONAME
+	_ZNK18TPhoneCmdParamNote4TextEv @ 272 NONAME
+	_ZNK18TPhoneCmdParamNote4ToneEv @ 273 NONAME
+	_ZNK18TPhoneCmdParamNote4TypeEv @ 274 NONAME
+	_ZNK18TPhoneCmdParamNote7TimeoutEv @ 275 NONAME
+	_ZNK18TPhoneCommandParam7ParamIdEv @ 276 NONAME
+	_ZNK19CPhoneQwertyHandler13IsQwertyInputEv @ 277 NONAME
+	_ZNK19TPhoneCmdParamQuery10ContentCbaEv @ 278 NONAME
+	_ZNK19TPhoneCmdParamQuery10DefaultCbaEv @ 279 NONAME
+	_ZNK19TPhoneCmdParamQuery11QueryPromptEv @ 280 NONAME
+	_ZNK19TPhoneCmdParamQuery14SendKeyEnabledEv @ 281 NONAME
+	_ZNK19TPhoneCmdParamQuery15QueryResourceIdEv @ 282 NONAME
+	_ZNK19TPhoneCmdParamQuery17CbaCommandMappingEi @ 283 NONAME
+	_ZNK19TPhoneCmdParamQuery25ItemTextArrayForListQueryEv @ 284 NONAME
+	_ZNK19TPhoneCmdParamQuery26GetCustomCommandForTimeOutERi @ 285 NONAME
+	_ZNK19TPhoneCmdParamQuery4ToneEv @ 286 NONAME
+	_ZNK19TPhoneCmdParamQuery7TimeOutEv @ 287 NONAME
+	_ZNK19TPhoneCmdParamQuery8DataTextEv @ 288 NONAME
+	_ZNK19TPhoneCmdParamQuery9QueryTypeEv @ 289 NONAME
+	_ZNK20TPhoneCmdParamBitmap10MaskBitmapEv @ 290 NONAME
+	_ZNK20TPhoneCmdParamBitmap6BitmapEv @ 291 NONAME
+	_ZNK21TPhoneCmdParamAppInfo13CustomMessageEv @ 292 NONAME
+	_ZNK21TPhoneCmdParamAppInfo15CustomMessageIdEv @ 293 NONAME
+	_ZNK21TPhoneCmdParamAppInfo17MultipleInstancesEv @ 294 NONAME
+	_ZNK21TPhoneCmdParamAppInfo5ParamEv @ 295 NONAME
+	_ZNK21TPhoneCmdParamAppInfo6AppUidEv @ 296 NONAME
+	_ZNK21TPhoneCmdParamAppInfo7ViewUidEv @ 297 NONAME
+	_ZNK21TPhoneCmdParamBoolean7BooleanEv @ 298 NONAME
+	_ZNK21TPhoneCmdParamDynMenu10ResourceIdEv @ 299 NONAME
+	_ZNK21TPhoneCmdParamInteger7IntegerEv @ 300 NONAME
+	_ZNK21TPhoneCmdParamPointer7PointerEv @ 301 NONAME
+	_ZNK21TPhoneCmdParamSfiData4NameEv @ 302 NONAME
+	_ZNK21TPhoneCmdParamSfiData6NumberEv @ 303 NONAME
+	_ZNK22CPhoneCallThemeMonitor22CallImageThemeFilePathEv @ 304 NONAME
+	_ZNK22CPhoneCallThemeMonitor22CallImageThemeSettingsEv @ 305 NONAME
+	_ZNK22TPhoneCmdParamKeyEvent8KeyEventEv @ 306 NONAME
+	_ZNK22TPhoneCmdParamKeyEvent9EventCodeEv @ 307 NONAME
+	_ZNK22TPhoneCmdParamRingTone11RingingTypeEv @ 308 NONAME
+	_ZNK22TPhoneCmdParamRingTone4TypeEv @ 309 NONAME
+	_ZNK22TPhoneCmdParamRingTone6VolumeEv @ 310 NONAME
+	_ZNK22TPhoneCmdParamRingTone8RingToneEv @ 311 NONAME
+	_ZNK22TPhoneCmdParamRingTone9TextToSayEv @ 312 NONAME
+	_ZNK23TPhoneCmdParamSpeedDial9ServiceIdEv @ 313 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote12WaitForReadyEv @ 314 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote14TextResourceIdEv @ 315 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote4TextEv @ 316 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote4ToneEv @ 317 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote4TypeEv @ 318 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote8SoftkeysEv @ 319 NONAME
+	_ZNK24TPhoneCmdParamKeyCapture11CaptureTypeEv @ 320 NONAME
+	_ZNK24TPhoneCmdParamKeyCapture3KeyEv @ 321 NONAME
+	_ZNK24TPhoneCmdParamKeyCapture7KeyCodeEv @ 322 NONAME
+	_ZNK25TPhoneCmdParamAudioOutput11AudioOutputEv @ 323 NONAME
+	_ZNK25TPhoneCmdParamTransEffect4TypeEv @ 324 NONAME
+	_ZNK26CPhoneResourceResolverBase17ResolveResourceIDERKi @ 325 NONAME
+	_ZNK26CPhoneResourceResolverBase27IsTelephonyFeatureSupportedEi @ 326 NONAME
+	_ZNK26TPhoneCmdParamProgressNote10ResourceIdEv @ 327 NONAME
+	_ZNK26TPhoneCmdParamProgressNote8WaitTimeEv @ 328 NONAME
+	_ZNK27TPhoneCmdParamCallStateData6CallIdEv @ 329 NONAME
+	_ZNK27TPhoneCmdParamCallStateData9CallStateEv @ 330 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData10CallerTextEv @ 331 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData10NumberTypeEv @ 332 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData11ContactLinkEv @ 333 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData12HasThumbnailEv @ 334 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData14ParticipantCLIEv @ 335 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData14ShortLabelTextEv @ 336 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData17RemotePhoneNumberEv @ 337 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData24CLITextClippingDirectionEv @ 338 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData25CNAPTextClippingDirectionEv @ 339 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData25CipheringIndicatorAllowedEv @ 340 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData5Line2Ev @ 341 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData7CLITextEv @ 342 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData7PictureEv @ 343 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData8CNAPTextEv @ 344 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData8CallTypeEv @ 345 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData8DivertedEv @ 346 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9CallStateEv @ 347 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9CipheringEv @ 348 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9LabelTextEv @ 349 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9ServiceIdEv @ 350 NONAME
+	_ZNK28TPhoneCmdParamCallHeaderData9ThumbnailEv @ 351 NONAME
+	_ZNK31TPhoneCmdParamAudioAvailability16IsBTAccAvailableEv @ 352 NONAME
+	_ZNK31TPhoneCmdParamAudioAvailability19IsWiredAccAvailableEv @ 353 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData19LittleBubbleVisibleEv @ 354 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData25CipheringIndicatorAllowedEv @ 355 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData4ModeEv @ 356 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData4MuteEv @ 357 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData5Line2Ev @ 358 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData9CallStateEv @ 359 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData9CipheringEv @ 360 NONAME
+	_ZNK33TPhoneCmdParamIncallIndicatorData9EmergencyEv @ 361 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData10HeaderTextEv @ 362 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData18OwnPhoneNumberTextEv @ 363 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData25CipheringIndicatorAllowedEv @ 364 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData9CipheringEv @ 365 NONAME
+	_ZNK37TPhoneCmdParamEmergencyCallHeaderData9LabelTextEv @ 366 NONAME
+	_ZTI11CPhoneTimer @ 367 NONAME
+	_ZTI12CPhoneLogger @ 368 NONAME
+	_ZTI13CPhoneStorage @ 369 NONAME
+	_ZTI17CPhoneCenRepProxy @ 370 NONAME
+	_ZTI17CPhonePubSubProxy @ 371 NONAME
+	_ZTI18CPhoneMethodLogger @ 372 NONAME
+	_ZTI19CPhoneQwertyHandler @ 373 NONAME
+	_ZTI20CPhoneClearBlacklist @ 374 NONAME
+	_ZTI20CPhoneRecoverySystem @ 375 NONAME
+	_ZTI22CPhoneCallThemeMonitor @ 376 NONAME
+	_ZTI22CPhoneLibraryContainer @ 377 NONAME
+	_ZTI23CPhoneQwertyModeMonitor @ 378 NONAME
+	_ZTI24CPhoneCenRepEventHandler @ 379 NONAME
+	_ZTI24CPhoneLangSettingMonitor @ 380 NONAME
+	_ZTI25CPhonePublishSubscriberAO @ 381 NONAME
+	_ZTI26CPhoneMainResourceResolver @ 382 NONAME
+	_ZTI26CPhoneResourceResolverBase @ 383 NONAME
+	_ZTI30CPhoneMainErrorMessagesHandler @ 384 NONAME
+	_ZTV11CPhoneTimer @ 385 NONAME
+	_ZTV12CPhoneLogger @ 386 NONAME
+	_ZTV13CPhoneStorage @ 387 NONAME
+	_ZTV17CPhoneCenRepProxy @ 388 NONAME
+	_ZTV17CPhonePubSubProxy @ 389 NONAME
+	_ZTV18CPhoneMethodLogger @ 390 NONAME
+	_ZTV19CPhoneQwertyHandler @ 391 NONAME
+	_ZTV20CPhoneClearBlacklist @ 392 NONAME
+	_ZTV20CPhoneRecoverySystem @ 393 NONAME
+	_ZTV22CPhoneCallThemeMonitor @ 394 NONAME
+	_ZTV22CPhoneLibraryContainer @ 395 NONAME
+	_ZTV23CPhoneQwertyModeMonitor @ 396 NONAME
+	_ZTV24CPhoneCenRepEventHandler @ 397 NONAME
+	_ZTV24CPhoneLangSettingMonitor @ 398 NONAME
+	_ZTV25CPhonePublishSubscriberAO @ 399 NONAME
+	_ZTV26CPhoneMainResourceResolver @ 400 NONAME
+	_ZTV26CPhoneResourceResolverBase @ 401 NONAME
+	_ZTV30CPhoneMainErrorMessagesHandler @ 402 NONAME
+	_ZThn4_N12CPhoneLoggerD0Ev @ 403 NONAME
+	_ZThn4_N12CPhoneLoggerD1Ev @ 404 NONAME
+	_ZThn4_N13CPhoneStorage14IsScreenLockedEv @ 405 NONAME
+	_ZThn4_N13CPhoneStorage15SetScreenLockedEi @ 406 NONAME
+	_ZThn4_N13CPhoneStorage19NeedToEnableKeylockEv @ 407 NONAME
+	_ZThn4_N13CPhoneStorage20ResetBlockedKeysListEv @ 408 NONAME
+	_ZThn4_N13CPhoneStorage22AppendBlockedKeysListLE12TStdScanCode @ 409 NONAME
+	_ZThn4_N13CPhoneStorage22IsBlockedKeysListEmptyEv @ 410 NONAME
+	_ZThn4_N13CPhoneStorage22SetNeedToEnableKeylockEi @ 411 NONAME
+	_ZThn4_N13CPhoneStorageD0Ev @ 412 NONAME
+	_ZThn4_N13CPhoneStorageD1Ev @ 413 NONAME
+	_ZThn4_N26CPhoneResourceResolverBaseD0Ev @ 414 NONAME
+	_ZThn4_N26CPhoneResourceResolverBaseD1Ev @ 415 NONAME
+	_ZThn4_NK13CPhoneStorage17GetBlockedKeyListEv @ 416 NONAME
+	_ZThn4_NK26CPhoneResourceResolverBase17ResolveResourceIDERKi @ 417 NONAME
+	_ZN24TPhoneCmdParamGlobalNote10SetTimeoutEi @ 418 NONAME
+	_ZNK24TPhoneCmdParamGlobalNote7TimeoutEv @ 419 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneApp / PhoneUiUtils
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_EXPORTS
+
+// Stub SIS files:
+../group/phoneuiutils_stub.sis                  /epoc32/data/z/system/install/phoneuiutils_stub.sis
+
+// Singleton UIDs used in Telephony thread
+../inc/telinternalsingletonuids.h               |../../../inc/telinternalsingletonuids.h
+
+PRJ_MMPFILES
+phoneuiutils.mmp
+
+#endif // RD_PHONE_NG
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/group/phoneuiutils.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     PhoneUIUtils module project specification file.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+// <-- QT PHONE START --> 
+CAPABILITY CAP_GENERAL_DLL
+//CAPABILITY CAP_APPLICATION MultiMediaDD PowerMgmt NetworkControl DRM DiskAdmin
+// <-- QT PHONE END --> 
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          phoneuiutils.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x101F4D0F
+
+SOURCEPATH      ../src
+
+SOURCE          cphonecallthememonitor.cpp
+SOURCE          cphonecenrepeventhandler.cpp
+SOURCE          cphonecenrepproxy.cpp
+SOURCE          cphoneclearblacklist.cpp
+SOURCE          cphonekeys.cpp
+SOURCE          cphonelangsettingmonitor.cpp
+SOURCE          cphonelibrarycontainer.cpp
+SOURCE          cphonelogger.cpp
+SOURCE          cphonemainresourceresolver.cpp
+SOURCE          cphonemainerrormessageshandler.cpp
+SOURCE          cphonepublishsubscriberao.cpp
+SOURCE          cphonepubsubproxy.cpp
+SOURCE          cphoneqwertyhandler.cpp
+SOURCE          cphoneqwertymodemonitor.cpp
+SOURCE          cphonerecoverysystem.cpp
+SOURCE          cphoneresourceresolverbase.cpp
+SOURCE          cphonetimer.cpp
+SOURCE          ctelerecoverysystem.cpp
+SOURCE          ctelewaitingidle.cpp
+SOURCE          phoneloggerviewcommands.cpp
+SOURCE          phonestatestrings.cpp
+SOURCE          phonestatestringsgsm.cpp
+SOURCE          cphonestorage.cpp
+SOURCE          rphoneanimclearblacklist.cpp
+SOURCE          tphonecmdparamappinfo.cpp
+SOURCE          tphonecmdparamaudiooutput.cpp
+SOURCE          tphonecmdparamaudioavailability.cpp
+SOURCE          tphonecmdparambitmap.cpp
+SOURCE          tphonecmdparamboolean.cpp
+SOURCE          tphonecmdparamcallheaderdata.cpp
+SOURCE          tphonecmdparamcallstatedata.cpp
+SOURCE          tphonecmdparamdynmenu.cpp
+SOURCE          tphonecmdparamemergencycallheaderdata.cpp
+SOURCE          tphonecmdparamglobalnote.cpp
+SOURCE          tphonecmdparamincallindicatordata.cpp
+SOURCE          tphonecmdparaminteger.cpp
+SOURCE          tphonecmdparamkeycapture.cpp
+SOURCE          tphonecmdparamkeyevent.cpp
+// <-- QT PHONE START --> 
+//SOURCE          tphonecmdparammessageeditor.cpp
+// <-- QT PHONE END --> 
+SOURCE          tphonecmdparamnote.cpp
+SOURCE          tphonecmdparamprogressnote.cpp
+SOURCE          tphonecmdparamquery.cpp
+// <-- QT PHONE START -->
+//SOURCE          tphonecmdparamreconnectquery.cpp
+// <-- QT PHONE END -->
+SOURCE          tphonecmdparamringtone.cpp
+SOURCE          tphonecmdparamsfidata.cpp
+// <-- QT PHONE START -->
+//SOURCE          tphonecmdparamsingleitemfetch.cpp
+// <-- QT PHONE END -->
+SOURCE          tphonecmdparamspeeddial.cpp
+SOURCE          tphonecmdparamstring.cpp
+SOURCE          tphonecommandparam.cpp
+SOURCE          tphonecmdparamtranseffect.cpp
+SOURCE          tcbacommandmapping.cpp
+SOURCE          tphonecmdparamcustomdialer.cpp
+SOURCE          tphonecmdparamnumberentryobserver.cpp
+SOURCE          tphonecmdparampointer.cpp
+SOURCE          tphonetouchbuttonconfig.cpp
+
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui2/srcdata
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+LIBRARY         euser.lib
+LIBRARY         cone.lib
+LIBRARY         bafl.lib
+LIBRARY         flogger.lib
+LIBRARY         featmgr.lib         // FeatureManager
+LIBRARY         cenrepnotifhandler.lib
+LIBRARY         centralrepository.lib
+LIBRARY         ptiengine.lib
+LIBRARY         avkon.lib
+LIBRARY         ws32.lib
+// <-- QT PHONE START -->
+//LIBRARY         cauiengine.lib
+// <-- QT PHONE END -->
+
+#ifndef __WINS__
+LIBRARY         efsrv.lib
+#endif
+LIBRARY         charconv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/group/phoneuiutils_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phoneui utils component stub.
+;
+; Languages
+&EN
+
+; Header
+#{"PhoneUIUtils"}, (0x101F4D0F), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+;
+;  PhoneUIUtils
+;
+"" - "z:\sys\bin\PhoneUIUtils.dll"
Binary file phoneapp/phoneuiutils/group/phoneuiutils_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonecallthememonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitor for call theme settings.
+*
+*/
+
+
+
+#ifndef CPHONECALLTHEMEMONITOR_H
+#define CPHONECALLTHEMEMONITOR_H
+
+//  INCLUDES
+#include    "mphonecenrepobserver.h" 
+
+/**
+*  Observer interface to call theme settings.
+*
+*/
+class MPhoneCallThemeSettingsObserver
+    {
+    public:
+        /**
+        * Called when call theme settings have changed.
+        */
+        virtual void CallThemeSettingsChanged() = 0;
+    };
+
+// CLASS DECLARATION
+
+/**
+*  Monitor for call theme settings.
+*
+*/
+class CPhoneCallThemeMonitor : public CBase, private MPhoneCenRepObserver
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneCallThemeMonitor* NewL();
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneCallThemeMonitor();
+    
+        /**
+        * Fetches setting is call image theme .
+        * @return value of settings
+        */
+        IMPORT_C TInt CallImageThemeSettings() const;
+        
+        /**
+        * Fetches call image theme path.
+        * @return Call image theme path.
+        */
+        IMPORT_C TPtrC CallImageThemeFilePath() const;
+
+        /**
+        * Set call theme settings observer.
+        * @param aObserver Observer.
+        */
+        IMPORT_C void SetCallThemeSettingsObserver(
+            MPhoneCallThemeSettingsObserver* aObserver );
+
+    protected:
+        
+        /**
+        * Handle the change of the setting from Central Repository
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        */
+        virtual void HandleCenRepChangeL( 
+            const TUid& aUid,
+            const TUint aId );
+
+ 
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneCallThemeMonitor();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * Reads all theme settings from CenRep.
+        */
+        void ReadAllL();
+        
+        
+    private: // Data
+        // Themes client id
+        TInt iThemesClientID;
+  
+        // Current theme image setting
+        TInt iThemeCallImageSettings;
+        
+        // Theme image path and name
+        HBufC* iCallerImageThemePath;
+        
+        // Observer to be notified.
+        MPhoneCallThemeSettingsObserver* iObserver;
+     };
+
+#endif      // CPHONECALLTHEMEMONITOR_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonecenrepeventhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Central Repository event handler 
+*
+*/
+
+
+#ifndef __CPHONECENREPEVENTHANDLER_H
+#define __CPHONECENREPEVENTHANDLER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+* Class for observing central repository variable changes.
+*/
+
+class CPhoneCenRepEventHandler : 
+    public CBase, 
+    public MCenRepNotifyHandlerCallback
+    {
+    public: // Constructors and destructor
+        /**
+        * Default constructor
+        */
+        static CPhoneCenRepEventHandler* NewL( const TUid& aUid );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneCenRepEventHandler();
+
+    private:
+
+        /**
+        * EPOC default constructor.
+        * @return void
+        */
+        void ConstructL();
+        
+        /**
+        * Constructor
+        * @param aUid identifing the central repository UID.
+        * @return void
+        */         
+        CPhoneCenRepEventHandler( const TUid& aUid );
+    
+        /**
+        * C++ default constructor.
+        * @param None
+        * @return void
+        */
+        CPhoneCenRepEventHandler();
+        
+    public: // From MCenRepNotifyHandlerCallback
+
+        /**
+        * Notify the client about generic changes for the central repository
+        * key.
+        * @param aId Id of the key that has changed.
+        * @return none
+        */    
+        void HandleNotifyGeneric( TUint32 aId );
+
+        /**
+        * Notify the client about errors in the handler. Any error in 
+        * handling causes the handler to stop handling any more notifications. 
+        * Handling can be restarted with a call to aHandler->StartListeningL(),
+        * if the error is non-fatal. However, be careful to trap any errors 
+        * from this call if this is done.
+        * @param aId Id of the key this instance listens for or if 
+        * notifications for whole repository are listened, could also be 
+        * KInvalidNotificationId.
+        * @param aError Error code.
+        * @param aHandler Pointer to the handler instance. This pointer can 
+        *        be used to identify the handler or restart the listening.
+        * @return none
+        */    
+        void HandleNotifyError( 
+            TUint32 aId, 
+            TInt error, 
+            CCenRepNotifyHandler* aHandler );
+
+    private: // Data
+
+        TUid                  iUid;
+        CRepository*          iRepository;
+        CCenRepNotifyHandler* iCenRepNotifyHandler;
+    };
+
+#endif      // __CPHONECENREPEVENTHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonecenrepproxy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Proxy for the connection to central repository.
+*
+*/
+
+
+#ifndef __CPHONECENREPPROXY_H
+#define __CPHONECENREPPROXY_H
+
+//  INCLUDES
+#include <coemain.h>
+#include <e32base.h>
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+
+// CONSTANTS
+class MPhoneCenRepObserver;
+class CPhoneCenRepEventHandler;
+
+// FORWARD DECLARATIONS
+class TPhoneCmdParamAppInfo;
+
+/**
+*  CPhoneCenRepProxy is an API used as proxy for phone application to get/set
+*  and observe central repository settings.
+*
+*  How to get some setting?
+*  ---------------------------
+*  example code:
+*  TBuf<100> value;
+*  CPhoneCenRepProxy::Instance()->GetString( uid, key, value ); 
+*  
+*  uid and key should be retrieved from <Module Name>InternalCRKeys.h
+*  
+*  How to set any settings
+*  --------------------------------------
+*  example code:
+*  TInt value = 10;
+*  CPhoneCenRepProxy::Instance()->SetInt( uid, key, value );
+*
+*  How to observe any settings
+*  --------------------------------------
+*  example code:
+* 
+*  class CPhoneSomeManager : private MPhoneCenRepObserver
+*      {
+*      ...
+*      virtual void HandleCenRepChangeL( 
+*          const TUid& aUid, 
+*          const TUint aId );
+*      ....
+*      }
+*
+*  CPhoneSomeManager::SomeFunctionL
+*      {
+*      CPhoneCenRepProxy::Instance()->NotifyChangeL( uid1, id1, this );
+*
+*      CPhoneCenRepProxy::Instance()->NotifyChangeL( uid2, id2, this );
+*      }
+*  
+*  CPhoneSomeManager::HandleCenRepChangeL( 
+*      const TUid& aUid,
+*      const TUint aId )
+*      {
+*      switch( aId )
+*          {
+*          case ESetting1:
+*              .... //do something
+*          case ESetting2:
+*              .... //do something
+*          default:
+*              .... //panic in debug
+*          }
+*      }
+*
+*  //The CancelAllNotifies() should be always called before destroy the object
+*  CPhoneSomeManager::~CPhoneSomeManager()
+*      {
+*      CPhoneCenRepProxy::Instance()->CancelAllNotifies( this );
+*      }
+*
+*/
+
+
+// CLASS DECLARATION
+
+class CPhoneCenRepProxy : 
+    public CCoeStatic 
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * created instance.
+        * @return the created instance.
+        */
+        IMPORT_C static CPhoneCenRepProxy* Instance();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneCenRepProxy();
+
+    public: // New Functions
+
+        /**
+        * Cancel all requests by the observer. This function should always be 
+        * call before an object is destroyed. During shutdown, this singleton
+        * may be deleted before the classes that observe it. If this happens, the
+        * routine will just return since of requests have already been cancelled.
+        * @param aObserver
+        */
+        IMPORT_C static void CancelAllNotifies( 
+            MPhoneCenRepObserver* aObserver );
+        
+        /**
+        * Set integer value of setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aValue the value associated with the central repository ID
+        */
+        IMPORT_C TInt SetInt( 
+            const TUid& aUid, 
+            const TUint aId,
+            const TInt aValue );
+        
+        /**
+        * Set string value of setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aValue the value associated with the central repository ID
+        * @return refer to SharedDataClient.h for detail explanation
+        */
+        IMPORT_C TInt SetString( 
+            const TUid& aUid, 
+            const TUint aId,
+            const TDesC& aValue );
+            
+        /**
+        * Set real value of setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aValue the value associated with the central repository ID
+        */
+        IMPORT_C TInt SetReal( 
+            const TUid& aUid, 
+            const TUint aId,
+            const TReal aValue );
+        
+        /**
+        * Get integer value of setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aValue the value associated with the central repository ID
+        */
+        IMPORT_C TInt GetInt( 
+            const TUid& aUid, 
+            const TUint aId, 
+            TInt& aValue ) const;
+
+        /**
+        * Get string value of setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aValue the value associated with the central repository ID
+        */
+        IMPORT_C TInt GetString( 
+            const TUid& aUid, 
+            const TUint aId, 
+            TDes& aValue ) const;
+            
+        /**
+        * Get real value of setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aValue the value associated with the central repository ID
+        */
+        IMPORT_C TInt GetReal( 
+            const TUid& aUid, 
+            const TUint aId, 
+            TReal& aValue ) const;
+            
+        /**
+        * Notify the change of the setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aObserver The pointer to the observer to handle the change 
+        *     notification
+        */
+        IMPORT_C void NotifyChangeL( 
+            const TUid& aUid, 
+            const TUint aId, 
+            MPhoneCenRepObserver* aObserver );
+
+        /**
+        * Cancel request. If you don't want to receive notification of the 
+        * setting you issued before, call this function.
+        * @param aObserver The observer that have issued request before
+        * @param aId The setting which is to be canceled
+        */
+        IMPORT_C void CancelNotify( 
+            MPhoneCenRepObserver* aObserver,
+            const TUint aId );
+        
+        /**
+        * Return boolean value that states whether or not 
+        * the indicated feature is supported.
+        * @param aFeatureId the feature that is inspected (see values from 
+        *        TelephonyVariant.hrh)
+        * @return whether or not the feature is supported.
+        */
+        IMPORT_C TBool IsTelephonyFeatureSupported( const TInt aFeatureId );
+
+        /**
+        * Return boolean value that states whether or not 
+        * the indicated feature is supported.
+        * @param aFeatureId the feature that is inspected (see values from 
+        *        PhoneUIVariant.hrh)
+        * @return whether or not the feature is supported.
+        */
+        IMPORT_C TBool IsPhoneUIFeatureSupported( const TInt aFeatureId );
+        
+        /**
+         * Get keys from given value range
+         * @param aUid identifing the central repository UID.
+         * @param aPartial partial key to be found
+         * @param aMask mask for partial key
+         * @param aValues reference to array object for found keys
+         * @return KErrNone if successful, system wide error code otherwise.
+         */
+        IMPORT_C TInt Find(
+                const TUid& aUid,
+                const TUint32 aPartial, 
+                const TUint32 aMask,
+                RArray<TUint32>& aValues ) const;
+        
+        /**
+        * Fetches values from central repository
+        * @param aAppInfo reference to object containing info for 
+        * application launching
+        * @param aCode ascii value of the pressed key
+        * @param aAppParam application parameter
+        * @param aValuesFetched ETrue if values fetched ok
+        */
+        IMPORT_C void FetchValuesFromCenRepL( TPhoneCmdParamAppInfo& aAppInfo, 
+                                        TKeyCode aCode,
+                                        HBufC8* aAppParam, TBool& aValuesFetched );
+
+
+    public: // New methods
+
+        /**
+        * Handle notifications from central repository observers
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        */
+        void HandleNotify( 
+            const TUid& aUid, 
+            const TUint aId );
+
+    private:
+
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        static CPhoneCenRepProxy* NewL();
+        
+        /**
+        * C++ default constructor.
+        */
+        CPhoneCenRepProxy();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+    private:
+
+        /**
+        * Find the observer for specific setting on aUid and aId
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aFromIndex find next observer interested in this setting after 
+        *               aIndex
+        * @return The index of the observer if it's found and KErrNotFound if 
+        *         not
+        */
+        TInt FindByUidId( 
+            const TUid& aUid, 
+            const TUint aId, 
+            TInt aFromIndex = 0 );
+        
+        /**
+        * Find the specific Observer
+        * @param aObserver The pointer of the observer
+        * @param aId central repository ID.
+        * @return The index in iObserverArray. KErrNotFound if can't find the 
+                  specific observer
+        */
+        TInt FindByObserverId( 
+            const MPhoneCenRepObserver* aObserver,
+            const TUint aId );
+
+        /**
+        * Finds observer by uid, key and observer.
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aObserver The pointer of the observer
+        */
+        TInt FindByUidIdObserver( 
+            const TUid& aUid, 
+            const TUint aId, 
+            MPhoneCenRepObserver* aObserver );
+            
+        /**
+        * Returns Telephony variant read-only data.
+        * @return error code.
+        */
+        TInt GetTelephonyVariantData();  
+
+        /**
+        * Returns PhoneUI variant read-only data.
+        * @return error code.
+        */
+        TInt GetPhoneUIVariantData();  
+
+        /**
+        * Cancel all request by the observer. 
+        * @param aObserver
+        */
+        void CancelAllObserverNotifies( MPhoneCenRepObserver* aObserver );
+        
+        /**
+        * Cancel all requests from all observers.
+        */
+        void CancelAllNotifies();
+        
+    private:    // Data
+
+        // Defines information of one observer.
+        class TCenRepObserverTag
+            {
+            public:
+                TUid iUid;
+                TUint iId;
+                MPhoneCenRepObserver* iObserver;
+            };
+
+        // Owned array of observers.
+        CArrayFixFlat<TCenRepObserverTag>* iObserverArray;
+
+        // Central Repository event handlers.
+        CPhoneCenRepEventHandler* iCenRepAccessoryEventHandler;
+        CPhoneCenRepEventHandler* iCenRepNetworkEventHandler;
+        CPhoneCenRepEventHandler* iCenRepThemesEventHandler;
+        CPhoneCenRepEventHandler* iCenRepLanguageEventHandler;
+        CPhoneCenRepEventHandler* iCenRepQwertyEventHandler;
+        CPhoneCenRepEventHandler* iCenRepKDRMHelperEventHandler;
+
+        //Local Telephony variant read-only data.
+        TInt iTelephonyVariantReadOnlyValues;
+
+        //Local PhoneUI variant read-only data.
+        TInt iPhoneUIVariantReadOnlyValues;
+    };
+
+#endif      // __CPHONECENREPPROXY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphoneclearblacklist.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Singleton class that provides interfaces for controlling
+*                call blacklist clearing
+*
+*/
+
+
+#ifndef CPHONECLEARBLACKLIST_H
+#define CPHONECLEARBLACKLIST_H
+
+// INCLUDES
+#include <e32base.h>
+#include <coemain.h>
+// #include <w32std.h>
+
+// FORWARD DECLARATIONS
+class RWsSession;
+class RWindowBase;
+class RAnimDll;
+class RPhoneAnimClearBlacklist;
+
+// CLASS DECLARATION
+
+/**
+* Blacklist clearing.
+*
+* Used to clear the call blacklist.
+*
+*  @since 5.0
+*/
+class CPhoneClearBlacklist : public CCoeStatic
+    {
+    public: // Constructors and destructors.
+
+        /**
+        * First call initializes the singleton object. 
+        * Singleton must be initialized only once and then Instance() method 
+        * may be used to get handle to instance.
+        * @param aWsSession window server session.
+        * @param aDevice window.
+        * @return the created instance.
+        */
+        IMPORT_C static CPhoneClearBlacklist* CreateL(
+            RWsSession& aWsSession, 
+            const RWindowBase& aDevice );
+    
+        /**
+        * Returns an instance of this class.
+        * @return A pointer to CPhoneClearBlacklist class 
+        */
+        IMPORT_C static CPhoneClearBlacklist* Instance();
+
+        /**
+        * C++ destructor.
+        */
+        IMPORT_C ~CPhoneClearBlacklist();
+        
+    public: // New functions
+        
+        /** 
+        * Clear blacklist on next key press.
+        * This function should be called in startup and after every call.
+        */
+        IMPORT_C void ClearBlackListOnNextKey();
+        
+        /** 
+        * Clear blacklist.
+        * This function should be called when call is established in redial.
+        */
+        IMPORT_C void ClearBlackListNow();
+        
+    private:
+
+        /** 
+        * Constructor. 
+        */
+        CPhoneClearBlacklist();
+
+        /** 
+        * 2nd phase constructor
+        */
+        void ConstructL( RWsSession& aWsSession, const RWindowBase& aDevice );
+        
+    private:
+
+        // Owned anim dll instance.
+        RAnimDll*                   iAnimDll;
+
+        // Owned clear blacklist subsession.
+        RPhoneAnimClearBlacklist*   iAnim;
+
+    };
+
+#endif
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonekeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     It defines class that contains static helper functions.
+*
+*/
+
+
+#ifndef CPHONEKEYS_H
+#define CPHONEKEYS_H
+
+// INCLUDES
+#include    <w32std.h>
+#include    "phoneconstants.h"
+
+// CONSTANTS
+
+// CLASS DECLARATION
+
+/**
+* It defines some helper functions.
+*/
+class CPhoneKeys: public CBase
+    {
+    public: // New functions
+
+        /**
+        * Checks if the key is a number key.
+        */
+        IMPORT_C static TBool IsNumberKey(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+        
+        /**
+        * Checks if the key is a numeric key.
+        */
+        IMPORT_C static TBool IsNumericKey( 
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        /**
+        * Checks if keyevent is escape.
+        */
+        IMPORT_C static TBool IsEscapeKey(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        /**
+        * Checks if keyevent is DTMF tone.
+        */
+        IMPORT_C static TBool IsDtmfTone(
+            const TKeyEvent& aKeyEvent,
+            TEventCode aType );
+
+        /**
+        * Checks if keyevent is Second "#" key, i.e, "##".
+        */
+        IMPORT_C static TBool IsSecondHashKey(
+            const TDes& aText );
+        
+        /**
+        * Checks if keyevent is "*" key or following via taps of
+        */    
+        IMPORT_C static TBool IsExtraChar(
+            TInt aChar ); 
+        
+        /**
+        * Validates number entry string.
+        *
+        * String is ok if it contains only characters from 
+        * set { 0, .., 9, *, #, +, p, w, P, W }.
+        *
+        * @param aString string to be validated.
+        * @return ETrue iff string is ok.
+        */
+        IMPORT_C static TBool Validate( const TDesC& aString );           
+    };
+
+#endif      // CPHONEKEYS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonelangsettingmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitor for input language setting
+*
+*/
+
+#ifndef CPHONELANGSETTINGMONITOR_H
+#define CPHONELANGSETTINGMONITOR_H
+
+//  INCLUDES
+#include    <e32base.h>
+#include    "mphonecenrepobserver.h" 
+
+// CLASS DECLARATION
+// FORWARD DECLARATIONS
+class MPhoneLangSettingObserver;
+
+/**
+*  Monitor for call theme settings.
+*
+*/
+class CPhoneLangSettingMonitor : public CBase, private MPhoneCenRepObserver
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPhoneLangSettingMonitor* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneLangSettingMonitor();
+
+    public: // New functions
+        
+        /**
+        * Get input language id.
+        * @since Series 60 3.1
+        * @return Language id.
+        */
+        TInt InputLanguage() const;
+        
+        /**
+        * Add observer.
+        * @since Series 60 3.1
+        * @param aObserver Observer.
+        */
+        void AddObserverL( MPhoneLangSettingObserver& aObserver );
+
+        /**
+        * Remove observer.
+        * @since Series 60 3.1
+        * @param aObserver Observer.
+        */
+        void RemoveObserver( MPhoneLangSettingObserver& aObserver );
+
+    protected:  // Functions from base classes
+
+        /**
+        * Handle the change of the setting from Central Repository
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        */
+        virtual void HandleCenRepChangeL( 
+            const TUid& aUid,
+            const TUint aId );
+            
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneLangSettingMonitor();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data                
+        // AI Setting Change Observer array.
+        RPointerArray< MPhoneLangSettingObserver > iObserverArray;
+        // Language Setting.
+        TInt  iInputLanguageSetting;
+    };
+
+#endif      // CPHONELANGSETTINGMONITOR_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonelibrarycontainer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for factory library handles.
+*
+*/
+
+#ifndef __CPHONELIBRARYCONTAINER_H
+#define __CPHONELIBRARYCONTAINER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+/**
+*  Container for factory library handles.
+*
+*  @since 4.0
+*
+*/
+class CPhoneLibraryContainer : public CBase
+    {    
+    public:     // Construction / destruction
+
+        /**
+        * NewL function for creating the container.
+        * @param None
+        * @return None
+        */
+        IMPORT_C static CPhoneLibraryContainer* NewL();
+
+        /**
+        * Virtual Destructor
+        * @param None
+        * @return None
+        */
+        IMPORT_C virtual ~CPhoneLibraryContainer();
+
+    public:     // New functions
+
+        /**
+        * Adds library handle to container. NOTE: Ownership of handle is 
+        * moved to container! After calling that method given object isn't 
+        * allowed to close or destroy.
+        * @param Referece to library handle
+        * @return None
+        */
+        IMPORT_C void AddLibraryL( const RLibrary& aLibraryHandle );
+
+    private:  // Construction / destruction
+
+        /**
+        * Protected constructor.
+        * @param None
+        * @return None
+        */
+        CPhoneLibraryContainer();
+
+    private: // Data
+
+        RArray<RLibrary> iLibraries;
+    };
+
+#endif      // __CPHONELIBRARYCONTAINER_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonelogger.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,355 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    Phone logger
+*
+*/
+
+
+#ifndef __CPHONELOGGER_H
+#define __CPHONELOGGER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <coemain.h>
+#include "phoneconstants.h"
+#include "stringpool.h"
+
+// FORWARD DECLARATIONS
+class RFileLogger;
+class MPEEngineInfo;
+class MPEPhoneModel;
+
+enum TPhoneUILoggingLevel
+    {
+    ENo,           // No logging at all.
+    EOnlyFatal, // Only fatal errors etc. are logged
+    EBasic,    // Normal logging (fatals + PE mesages etc),
+    EMethodStartEnd,   // All above & function starts and ends are logged 
+                       // (where added)
+    EAll               // All above & extra logging
+    };
+    
+enum TPhoneUILoggingComponent
+    {
+    EPhoneAbstractFactoryClient,
+    EPhoneControl,
+    EPhonePhoneapp,
+    EPhoneUIView,
+    EPhoneUIStates,
+    EPhoneUIUtils,
+    PhoneUIVoIPExtension,
+    EPhoneMediatorCenter,
+    EPhoneAmountOfLoggingComponents     
+    };
+    
+// CLASS DECLARATION
+
+/** 
+    @private
+    @class          CPhone
+    @since          7.0
+    A utility used in phone application for logging in debug builds.  Log 
+    files are placed in the directory %EPOCROOT%/epoc32/wins/c/logs/phoneapp
+ */
+class CPhoneLogger : public TDesOverflow , public CCoeStatic
+    {
+    public: // New methods
+
+        /**
+        * C++ constructor
+        * @param aUid Uid for CCoeStatic uid.
+        */
+        IMPORT_C CPhoneLogger(TUid aUid);
+
+        /**
+        * C++ destructor. Closes the log file.
+        */
+        IMPORT_C virtual ~CPhoneLogger();
+
+        /**
+        * Formats a log message by given numerous parameters and writes it in 
+        * the log file.
+        * @param aLevel     is the logging level. log messages below chosen 
+        *                   level are not printed out.
+        * @param aLoggingComponent identifies the component where the log 
+        *                   message originates from. 
+        * @param aFmt       is the log message, it may include formatting 
+        * @return None.
+        */
+        IMPORT_C void LogIt(
+            TPhoneUILoggingLevel aLevel, 
+            TPhoneUILoggingComponent aLoggingComponent, 
+            TRefByValue<const TDesC> aFmt, ...);
+
+        /**
+        * Checks if logging components level is enough to log.
+        * @aLevel is level of the log message whose printage needs to be judged
+        * @aLoggingComponent is the component where the log message 
+        *     originates from
+        * @return ETrue if logging is needed, based on aLevel, 
+        *     aLoggingComponent and current log level. 
+        */
+        TBool CheckLogLevel(
+            TPhoneUILoggingLevel aLevel, 
+            TPhoneUILoggingComponent aLoggingComponent );
+         
+        /**
+        * Writes comment to log file.
+        *
+        * @param aComment   - A comment descriptor to be logged.
+        * @return None.
+        */
+        void WriteComment( const TDesC& aComment );
+
+        /**
+        * Creates a specified log message by given parameters and writes it 
+        * in the log file.
+        *
+        * @param aMessage   - Ordinal of enumerated phone engine command. 
+        *     Converts it in to descriptor.
+        * @param aCallId    - ID of current call.
+        * @return None.
+        */
+        IMPORT_C void LogMsgFromControlToView ( 
+            const TInt aMessage, 
+            const TInt aCallId );
+
+        /**
+        * Creates a PE specified log message by given parameters and writes 
+        * it in the log file.
+        *
+        * @param aMessage   - Ordinal of enumerated phone engine command. 
+        *     Converts it in to descriptor.
+        * @param aCallId    - ID of current call.
+        * @return None.
+        */
+        IMPORT_C void LogMsgFromPEToPhoneUI ( 
+            const TInt aMessage, 
+            const TInt aCallId );
+
+        /**
+        * Creates a PE specified log message by given TPEMessage id and call 
+        * id and writes it in the log file.
+        *
+        * @param aMessage     - Ordinal of enumerated phone engine command. 
+        *     Converts it in to descriptor.
+        * @param aCallId    - ID of current call.
+        * @return None.
+        */
+        IMPORT_C void LogMsgFromPhoneUIToPE( 
+            const TInt aMessage, 
+            const TInt aCallId );
+
+        /**
+        * Logs message from Phone Engine to Phoneapp execution ending. 
+        * (When message is executed succesfully, this function is called).
+        *
+        * @param aMessage     - Ordinal of enumerated phone engine command. 
+        *                       Converts it in to descriptor.
+        * @return None.
+        */
+        IMPORT_C void LogMsgFromPEToPhoneUIEnd( const TInt aMessage );
+
+        /**
+        * Logs state change.
+        *
+        * @param aCurrentState Current state of phoneapp.
+        * @param aNewState Next state of phoneapp.
+        * @return None.
+        */
+        IMPORT_C void LogStateChange( 
+            const TInt aCurrentState, 
+            const TInt aNewState );
+            
+        /**
+        * Sets pointer to Phone Engine
+        * @param aPhoneEngine pointer to Phone Engine instance
+        */
+        IMPORT_C void SetPhoneEngine( MPEPhoneModel* aPhoneEngine );
+
+    private:    // Methods from TDesOverflow
+
+        /**
+        * Formats a log message by given numerous parameters and writes 
+        * it in the log file.
+        *
+        * @param aFmt       - 
+        * @return None.
+        */
+        void LogIt( TRefByValue<const TDesC> aFmt, ...);
+        
+        /**
+        * Handles the overflow. This function is called when the 
+        * TDes16::AppendFormat() variant, which takes an overflow handler 
+        * argument, fails. TDes16::AppendFormat() variant called by LogIt().
+        *
+        * @param aDes       - The 16 bit modifiable descriptor whose overflow 
+        *                     results in the call to this overflow handler.
+        * @return None.
+        */
+        IMPORT_C virtual void Overflow(TDes16& aDes);
+
+    private: // New methods
+
+        /**
+        * Provides string representation for TPEMessagesFromPhoneEngine.
+        *
+        * @param aDes       - Descriptor for copying string representation.
+        * @return None.
+        */
+        void GetPEToPhoneUIStringById( TDes16& aDes, const TInt aID );
+
+        /**
+        * Provides string representation for TPACommandId.
+        *
+        * @param aDes        - Descriptor for copying string representation.
+        * @param aID         - Descriptor for copying string representation.
+        * @return None.
+        */
+        void GetPhoneUIToPEStringById( TDes16& aDes, const TInt aID );
+
+        /**
+        * Provides string representation for MPhoneViewCommandId.
+        *
+        * @param aDes        - Descriptor for copying string representation.
+        * @param aID         - Descriptor for copying string representation.
+        * @return None.
+        */
+        void GetPhoneUIToViewStringById( TDes16& aDes, const TInt aID );
+
+        /**
+        * Recounts TPhoneStateId enumeration values for logger.
+        *
+        * @param aID         - TPhoneStateId enumeration value
+        * @return            - Value of recounted enumeration id 
+        */
+        TInt RecountStateId( TInt aId );
+
+        /**
+        * Recounts TPhoneStateId GSM-variant enumeration values for logger.
+        *
+        * @param aID         - TPhoneStateId enumeration value
+        * @return            - Value of recounted enumeration id 
+        */
+        TInt RecountStateIdGSM( TInt aId );
+
+        /**
+        * Provides string representation for state
+        *
+        * @param aDes        - Descriptor for copying string representation.
+        * @param aID         - Id of the state.
+        * @return            - None.
+        */
+        void GetStateName( TDes16& aDes, const TInt aID );
+                    
+        /** Array of logging levels for each component */
+        TFixedArray<TPhoneUILoggingLevel, EPhoneAmountOfLoggingComponents> 
+            iLogLevelArray;
+
+    private: // attributes
+
+        // String pool handle
+        RStringPool iPool;
+        
+        /**
+        * Pointer to Phone Engine - uses relation
+        */
+        MPEPhoneModel* iPhoneEngine;
+    };
+    
+class CPhoneMethodLogger: public CBase
+    {
+    public:
+
+        /** Method logger constructor. constructor.
+          * Writes time lable and "Enter: " + the given string.
+          */
+        IMPORT_C CPhoneMethodLogger( 
+            TPhoneUILoggingComponent aLoggingComponent, 
+            TPtrC aString);
+
+        /** Destructor.
+          * Writes time lable and "Leave: " + the given string.
+          */
+        IMPORT_C ~CPhoneMethodLogger();
+
+    private:
+
+        TBuf<128> iString;
+        TPhoneUILoggingComponent iLoggingComponent;
+    };      
+
+// These are empty logging macros when PHONEUI_LOGGING_OUTPUT==0
+
+#if (PHONEUI_LOGGING_OUTPUT==0)
+    #define __PHONELOG(A, B, C)
+    #define __PHONELOG1(A,B, C, X)
+    #define __PHONELOG2(A,B, C, X, Y)
+    #define __PHONELOG3(A,B,  C, X, Y, Z)
+    #define __PHONELOGENGINEMSG( C, X )
+    #define __PHONELOGENGINEMSGEND( C)
+    #define __PHONELOGENGINECMD( C)   
+    #define __PHONELOGSTATECHANGE( C, X)
+    #define __LOGMETHODSTARTEND(A,C)
+    #define __PHONELOGVIEWMSG( C, X )   
+
+// These are the real logging macros that uses CPhoneLogger class.
+#else
+
+//If logging method == 2 define log file name.
+     
+    #define __PHONELOG(A, B, C)             (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogIt(A, B, _L(C) );
+        
+    #define __PHONELOG1(A, B, C, X)         (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogIt(A, B, _L(C), X);
+        
+    #define __PHONELOG2(A, B, C, X, Y)      (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogIt(A, B, _L(C), X, Y);
+        
+    #define __PHONELOG3(A, B, C, X, Y, Z)   (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogIt(A, B, _L(C), X, Y, Z);
+
+    #define __PHONELOGENGINEMSG( C, X )     (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogMsgFromPEToPhoneUI( (TInt)C, X);
+        
+    #define __PHONELOGENGINEMSGEND( C )      (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogMsgFromPEToPhoneUIEnd( (TInt)C );
+    
+    #define __PHONELOGENGINECMD( C )         (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogMsgFromPhoneUIToPE( (TInt)C, 0 );
+    
+    #define __PHONELOGVIEWMSG( C, X )       (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogMsgFromControlToView( (TInt)C, X);
+    
+    #define __PHONELOGSTATECHANGE( C, X )    (static_cast<CPhoneLogger*> \
+        (CCoeEnv::Static(KUidPhoneUILoggerSingleton)))-> \
+            LogStateChange( (TInt)C, TInt(X) );
+
+    #define __LOGMETHODSTARTEND( A, C )     CPhoneMethodLogger __log( A, ( _L(C) ) );
+
+
+#endif   // else --> #if (PHONE_LOGGING_METHOD==0 )
+
+#endif   // #ifndef __CPhoneLogger_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonemainerrormessageshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    Phone resource resolver
+*
+*/
+
+
+#ifndef __CPHONEMAINERRORMESSAGESHANDLER_H
+#define __CPHONEMAINERRORMESSAGESHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <coemain.h>
+#include "mphoneerrormessageshandler.h"
+#include "mphoneerrormessageshandlerregister.h"
+
+
+// CLASS DECLARATION
+
+/**
+*  CPhoneErrorMessagesHandlerRegister realizes the MPhoneErrorMessagesHandlerRegister interface, which
+*  allows for any error messagesd handler to offer their services for the Main Error messages
+*  Handler. Basically, the Main Error messages handler does not have any hard coded handling
+*  functionality. It only serves as access point for all the individual error messages handler
+*  scattered around the application ( via MPhoneErrorMessagesHandlerRegister interface ).
+*/
+class CPhoneMainErrorMessagesHandler : 
+    public CCoeStatic,
+    public MPhoneErrorMessagesHandler ,
+    public MPhoneErrorMessagesHandlerRegister
+    {
+    public: // Constructors and destructor
+        /**
+        * Virtual Destructor
+        * @param None
+        * @return None
+        */
+        virtual ~CPhoneMainErrorMessagesHandler();
+    
+    public: // From MPhoneErrorMessagesHandler
+        /**
+        * ShowErrorSpecificNoteL of given error.
+        * @param aErrorInfo: error code and callId
+        * @return None.
+        */
+        void ShowErrorSpecificNoteL( const TPEErrorInfo& aErrorInfo );
+
+    public: // From MPhoneErrorMessagesHandlerRegister
+        /**
+        * Register given handler for handling errors from given 
+        * enumeration.
+        * @param aHandler: Pointer to the handler to be registered.  
+        * @return None.
+        */
+        void RegisterErrorMessagesHandler( MPhoneErrorMessagesHandler* aHandler );
+
+    public: // New methods
+     
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * instance.
+        * @param None.
+        * @return Pointer to the one and only instance of main error 
+        *         handler -object.
+        */
+        IMPORT_C static  CPhoneMainErrorMessagesHandler* Instance();
+        
+    protected:  // Constructors and destructor
+        /**
+        * Protected constructor.
+        * @param None
+        * @return None
+        */
+        CPhoneMainErrorMessagesHandler();
+
+    private:    // Constructors and destructor
+        /**
+        * NewL function for creating the main resolver.
+        * @param None
+        * @return CPhoneMainResourceResolver*
+        */
+        static CPhoneMainErrorMessagesHandler* NewL();
+        
+    private:    // Data      
+        
+        MPhoneErrorMessagesHandler* iHandler;
+
+    };
+#endif      // __CPHONERESOURCERESOLVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonemainresourceresolver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    Phone resource resolver
+*
+*/
+
+
+#ifndef __CPHONEMAINRESOURCERESOLVER_H
+#define __CPHONEMAINRESOURCERESOLVER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <coemain.h>
+#include "mphoneresourceresolver.h"
+#include "mphoneresourceresolverregister.h"
+
+
+// CLASS DECLARATION
+
+/**
+*  CPhoneMainResourceResolver realizes the MPARegisterResourceResolver interface, which
+*  allows for any resource resolver to offer their services for the Main Resource
+*  Resolver. Basically, the Main Resource Resolver does not have any hard coded resolving
+*  functionality. It only serves as access point for all the individual resource resolvers
+*  scattered around the application ( via MPARegisterResourceResolver interface ).
+*/
+class CPhoneMainResourceResolver : 
+    public CCoeStatic,
+    public MPhoneResourceResolver,
+    public MPhoneResourceResolverRegister
+    {
+    public: // Constructors and destructor
+        /**
+        * Virtual Destructor
+        * @param None
+        * @return None
+        */
+        virtual ~CPhoneMainResourceResolver();
+    
+    public: // From MPAResourceResolver
+        /**
+        * Resolve resource id of given resource.
+        * @param aEnumUid: Uid of enumeration which contains needed resource 
+        *                  definition.
+        * @param aResource: ID of needed resource ( from enumeration ).
+        * @return Resource id.
+        */
+        TInt ResolveResourceID( const TInt& aResource ) const;
+
+    public: // From MPARegisterResourceResolver
+        /**
+        * Register given resolver for resolving resources from given 
+        * enumeration.
+        * @param aResolver: Pointer to the resolver to be registered.
+        * @param aEnumUid: Uid of enumeration which resources given resolver 
+        *                  resolves.        
+        * @return None.
+        */
+        void RegisterResolver( MPhoneResourceResolver* aResolver );
+
+    public: // New methods
+     
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * instance.
+        * @param None.
+        * @return Pointer to the one and only instance of main resouce 
+        *         resolver -object.
+        */
+        IMPORT_C static  CPhoneMainResourceResolver* Instance();
+        
+    protected:  // Constructors and destructor
+        /**
+        * Protected constructor.
+        * @param None
+        * @return None
+        */
+        CPhoneMainResourceResolver();
+
+    private:    // Constructors and destructor
+        /**
+        * NewL function for creating the main resolver.
+        * @param None
+        * @return CPhoneMainResourceResolver*
+        */
+        static CPhoneMainResourceResolver* NewL();
+        
+    private:    // Data      
+        
+        MPhoneResourceResolver* iResolver;
+
+    };
+#endif      // __CPHONERESOURCERESOLVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonepublishsubscriberao.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUI Publish and Subscriber (Publish & Subscribe).
+*
+*/
+
+
+#ifndef __CPHONEPUBLISHSUBSCRIBERAO_H
+#define __CPHONEPUBLISHSUBSCRIBERAO_H
+
+// INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+#include "mphonepubsubobserver.h"
+
+// CLASS DECLARATION
+/**
+*  This class observes property variable changes.
+*
+*  @lib   Services.dll
+*/
+
+class CPhonePublishSubscriberAO : public CActive
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */         
+        static CPhonePublishSubscriberAO* NewL( 
+            MPhonePubSubObserver* aPubSubObserver, 
+            const TUid& aCategory, 
+            const TUint aKey );
+
+        /**
+        * Destructor.
+        */
+        ~CPhonePublishSubscriberAO();
+
+        /**
+        * Subscribe to an RProperty
+        * @param none
+        * @return none
+        */
+        void Subscribe();
+
+    public: // from CActive
+
+        /**
+        * @param none
+        * @return none
+        */    
+        void RunL();
+    
+        /**
+        * @param aError the error returned
+        * @return error
+        */
+        TInt RunError( TInt aError );
+
+        /**
+        * @param none
+        * @return none
+        */    
+        void DoCancel();
+
+    public: // new methods
+
+        /**
+        * Return property category that is subscribed to
+        * @param None
+        */
+        const TUid Category() const;
+
+        /**
+        * Return property key that is subscribed to
+        * @param None
+        */
+        TUint Key() const;
+    
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhonePublishSubscriberAO( 
+            MPhonePubSubObserver* aPubSubObserver, 
+            const TUid& aCategory, 
+            const TUint aKey );
+
+    private:
+
+        MPhonePubSubObserver*   iPubSubObserver; // NOT OWN
+        RProperty               iProperty; 
+        TUid                    iCategory;
+        TUint                   iKey;
+    };
+
+#endif // __CPHONEPUBLISHSUBSCRIBERAO_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonepubsubproxy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,223 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Used as proxy for phone application to get and observe 
+*                the change of the variable.state of the phone.
+*
+*/
+
+
+#ifndef __CPHONEPUBSUBPROXY_H
+#define __CPHONEPUBSUBPROXY_H
+
+//  INCLUDES
+#include <coemain.h>
+#include <e32property.h>
+#include "mphonepubsubobserver.h"
+
+// FORWARD DECLARATIONS
+class CPhonePublishSubscriberAO;
+class CIdle;
+
+/**
+*  CPhonePubSubProxy is an API used as proxy for phone application to get/set
+*  and observe variable states.
+*
+*  How to get some setting?
+*  ---------------------------
+*  example code:
+*
+*  TUid category = KUidSystemCategory
+*  TUInt key = KPSUidAutolockStatusValue
+*  Tint value = CPhonePubSubProxy::Instance()->GetValue( category, key ); 
+*  
+*  uid and states can be found in PSVariables.h
+*  
+*  How to set any settings
+*  --------------------------------------
+*  example code:
+*
+*  TUid category = KUidSystemCategory
+*  TUInt key = KPSUidAutolockStatusValue
+*  TInt value = EPSAutolockOn;
+*
+*  CPhonePubSubProxy::Instance()->ChangePropertyValue( category, key, value );
+*
+*  How to observe any settings
+*  --------------------------------------
+*  example code:
+* 
+*  class CPhoneSomeManager : private MPhonePubSubObserver
+*  {
+*  
+*  virtual void HandlePropertyChangedL( const TUid& aCategory, 
+*            const TUint aKey, const TInt aValue );
+*  }
+*
+*  CPhoneSomeManager::SomeFunctionL
+*      {
+*      CPhonePubSubProxy::Instance()->NotifyChangeL( cat1, key1, this );
+*      CPhonePubSubProxy::Instance()->NotifyChangeL( cat2, key2, this );
+*      }
+*  
+*  CPhoneSomeManager::HandlePropertyChangedL( 
+*      const TUid& aCategory, 
+*      const TUint aKey, 
+*      const TInt aValue )
+*      {
+*      switch( aCategory )
+*          {
+*          case KUidSomeCategory1:
+*               .... //do something for the category i.e. look at value
+*          case KUidSomeCategory2:
+*               .... //do something for the category i.e. look at value
+*          default:
+*               .... //panic in debug
+*          }
+*      }
+*
+*  The CancelAllNotifies() should be always called before destroy the object
+*  CPhoneSomeManager::~CPhoneSomeManager()
+*      {
+*      CPhonePubSubProxy::Instance()->CancelAllNotifies( this );
+*      }
+*/
+
+// CLASS DECLARATION
+
+/**
+*  Used as proxy for phone application to get and observe the change of the
+*  state of the phone.
+*/
+class CPhonePubSubProxy : public CCoeStatic, public MPhonePubSubObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * First call initializes the singleton object. Subsequent calls 
+        * return instance.
+        * @return the created instance.
+        */
+        IMPORT_C static CPhonePubSubProxy* Instance();
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhonePubSubProxy();
+
+    public: // New Functions 
+
+        /**
+        * Cancel all requests by the observer. This function should always be 
+        * call before an object is destroyed. During shutdown, this singleton
+        * may be deleted before the classes that observe it. If this happens, the
+        * routine will just return since of requests have already been cancelled.
+        * @param aObserver
+        */
+        IMPORT_C static void CancelAllNotifications( 
+            MPhonePubSubObserver* aObserver );
+        
+        /**
+        * Get the property value of particular category key.
+        *
+        * @param aCategory the category for the key.
+        * @param aKey the property key.
+        * @return current property value.
+        */
+        IMPORT_C TInt Value( const TUid& aCategory, const TUint aKey );
+
+        /**
+        * Notify the change of state to particular varible.
+        *
+        * @param aUid Specify the uid of the particular varible.
+        * @param aObserver The observer to receive the notification.
+        */
+        IMPORT_C void NotifyChangeL( 
+            const TUid& aCategory, 
+            const TUint aKey,
+            MPhonePubSubObserver* aObserver );
+
+        /**
+        * Change a specific property value.
+        *
+        * @param aCategory Category of property.
+        * @param aKey Property key to be changed
+        * @param aValue New property value.
+        */
+        IMPORT_C void ChangePropertyValue( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue );
+
+    private:
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        static CPhonePubSubProxy* NewL();
+
+        /**
+        * C++ constructor.
+        */
+        CPhonePubSubProxy();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+    private:
+        
+        /**
+        * Cancel all request by the observer. 
+        * @param aObserver
+        */
+        void CancelAllObserverNotifies( 
+            MPhonePubSubObserver* aObserver );
+        
+        /**
+        * function used to forward change events to observers.
+        * @param aCategory Category of property
+        * @param aKey Property key that is changed
+        * @param aValue New property value
+        */
+        void HandlePropertyChangedL( 
+            const TUid& aCategory, 
+            const TUint aKey, 
+            const TInt aValue );
+        
+    private:    // Data
+
+        // Observer elements.
+        class TPubSubObserverTag
+            {
+           public: 
+                // Unique property category.
+                TUid iCategory; 
+                // Property key
+                TUint iKey;
+                // Observer.
+                MPhonePubSubObserver* iObserver;
+            };
+
+        // Owned array of observers.
+        CArrayFixFlat<TPubSubObserverTag>* iObserverArray;
+
+        // Owned array of publish subscribers.
+        CArrayPtrFlat<CPhonePublishSubscriberAO>* iPublishSubscriberArray;
+
+    };
+
+#endif      // __CPHONEPUBSUBPROXY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphoneqwertyhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Input method related functionality.
+*
+*/
+
+
+
+#ifndef CPHONEQWERTYHANDLER_H
+#define CPHONEQWERTYHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "mphoneqwertymodeobserver.h"
+#include "mphonelangsettingobserver.h"
+#include <PtiDefs.h>
+#include <w32std.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CPhoneLangSettingMonitor;
+class CPhoneQwertyModeMonitor;
+
+// CLASS DECLARATION
+
+/**
+*  Input method related functionality.
+*
+*/
+class CPhoneQwertyHandler : public CBase, 
+                            private MPhoneLangSettingObserver,
+                            private MPhoneQwertyModeObserver
+    {
+    friend class T_CPhoneQwertyHandlerUT;
+    
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneQwertyHandler* NewL();
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneQwertyHandler();
+
+        /**
+        * Checks if qwerty input is used.
+        * @return ETrue if in qwerty mode.
+        */
+        IMPORT_C TBool IsQwertyInput() const;
+        
+        /**
+        * Gets keycode according to current keyboard mapping. 
+        */
+        IMPORT_C TInt NumericKeyCode( const TKeyEvent& aKeyEvent );
+
+    private:
+    
+        /**
+        * @see MIdleLangSettingObserver.
+        */
+        void HandleInputLanguageSettingChange( TInt aLanguage );
+        
+        /**
+        * @see MIdleQwertyModeObserver.
+        */
+        void HandleQwertyModeChange( TInt aMode );
+        
+        /**
+        * @see MIdleQwertyModeObserver.
+        */
+        void HandleKeyboardLayoutChange();
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneQwertyHandler();
+                                  
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * LoadNumericKeyBindings
+        */
+        void LoadNumericKeyBindings( TInt aLanguage, TInt aKeyboard );
+
+
+    private:    // Data
+        
+        // Input language
+        TInt iInputLanguageId;
+        
+        // Qwerty mode
+        TInt iQwertyMode;
+        
+        // Language setting monitor            
+        CPhoneLangSettingMonitor* iLangSettingMonitor;
+        
+        // Qwerty mode monitor
+        CPhoneQwertyModeMonitor* iQwertyModeMonitor;
+        
+        // RArray
+        RArray<TPtiNumericKeyBinding> iNumericKeys;
+    };
+
+#endif // CPHONEQWERTYHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphoneqwertymodemonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Qwerty Mode Monitor.
+*
+*/
+
+
+#ifndef CPHONEQWERTYMODEMONITOR_H 
+#define CPHONEQWERTYMODEMONITOR_H 
+
+//  INCLUDES
+#include    "mphonepubsubobserver.h" 
+#include    "mphoneqwertymodeobserver.h"
+
+
+// CLASS DECLARATION
+
+/**
+*  Qwerty Mode Monitor.
+*/
+class CPhoneQwertyModeMonitor 
+    : public CBase, 
+      private MPhonePubSubObserver
+    {
+    friend class T_CPhoneQwertyModeMonitorUT;
+    
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @return New instance
+        */
+        static  CPhoneQwertyModeMonitor* NewL();
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneQwertyModeMonitor();
+
+    protected: // Functions from base classes
+        
+        /**
+        * Handle the change of the setting from P&S key.
+        * @param aUid identifing the P&S gategory.
+        * @param aId P&S key.
+        * @param aValue Current value of the key.
+        */
+        virtual void HandlePropertyChangedL( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue );
+
+    public: // New methods
+
+        /**
+        * Gets current qwerty mode.
+        * @return Current qwerty mode.
+        */
+        TInt QwertyMode() const;
+
+        /**
+        * Gets current keyboard.
+        * @return Current keyboard.
+        */
+        TInt Keyboard() const;
+                
+        /**
+        * Adds qwerty mdoe observer.
+        * @param aObserver Observer object.
+        */
+        void AddObserverL( MPhoneQwertyModeObserver& aObserver );
+
+        /**
+        * Removes qwerty mode observer.
+        * @param aObserver Observer object.
+        */
+        void RemoveObserver( MPhoneQwertyModeObserver& aObserver );
+        
+    private: 
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneQwertyModeMonitor();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * Current qwerty mode.
+        */
+        TInt GetQwertyMode() const;
+
+        /**
+         * Current keyboard.
+         */
+        TInt GetKeyboard() const;
+
+    private:    // Data
+
+        // Call State Change Observer array.
+        RPointerArray< MPhoneQwertyModeObserver > iObserverArray;
+
+        // Current qwerty mode.
+        TInt iQwertyMode;
+        
+        //Current keyboard.
+        TInt iKeyboard;
+    };
+
+#endif      // CPHONEQWERTYMODEMONITOR_H 
+
+// End of File
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonerecoverysystem.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Manager to recover important operations.
+*
+*/
+
+
+#ifndef CPHONERECOVERYSYSTEM_H
+#define CPHONERECOVERYSYSTEM_H
+
+// INCLUDES
+#include    <coemain.h>
+#include    <e32base.h>
+#include    "ctelerecoverysystem.h"
+
+// CONSTANTS
+const TInt KNullId = -1;
+const TInt KIdContainerSize = 10;
+
+// MACROS     
+
+
+// DATA TYPES
+typedef TInt TPhoneRecoveryId;
+typedef TInt8 TPhoneRecoveryPriority;
+
+typedef TPhoneRecoveryId TRecoveryId;
+typedef TPhoneRecoveryPriority TRecoveryPriority;
+
+
+
+// FORWARD DECLARATIONS
+class CPhoneTimer;
+//class CTeleRecoverySystem;
+
+// CLASS DECLARATION
+
+/**
+*  If an operation fails, phone application may be leaved to incorrect states. 
+*  By using recovery system, failed operation will be tried again some time 
+*  later. This may enhance the robustness of phone application.
+* 
+*  Return value from callback function
+*  KErrNone: EStateIdle
+*  KErrNoMemory, KErrInUse, KErrServerTerminated, KErrServerBusy, KErrNotRead,
+*  KErrAccessDenied, KErrLocked, KErrDiskFull, KErrTimedOut: EStateWaiting
+*  Otherwise: EStatePending
+*  If call back function leaves, then the error of leave is used as return 
+*  value.
+*  Note: In the recovery callback function, CPhoneRecoverySystem::AddL(...) or
+*  CPhoneRecoverySystem::Add(...) should never be called. 
+*  
+*  @since 1.0
+*/
+class CPhoneRecoverySystem 
+    : public CCoeStatic
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * First call initializes the singleton object. Subsequent calls return
+        * instance.
+        * @return the created instance.
+        */
+        IMPORT_C static CPhoneRecoverySystem* Instance();
+
+        /**
+        * Destructor.
+        */
+        ~CPhoneRecoverySystem();
+       
+    public: // new function
+
+        /**
+        * Adds a new item with given priority & state. Returns Null id if it
+        * failed. Same item must not be added twice. Callback's return value
+        * indicates how many steps there are to be done, 0 - no more steps. 
+        * Error code or leave - failure.
+        * Priority indicates importantance of the action.
+        *
+        * @param aCallBack callback.
+        * @param aPriority priority.
+        * @param aState start state.
+        * @return identifier.
+        */
+        TRecoveryId Add( TCallBack aCallBack, 
+            TRecoveryPriority aPriority, 
+            CTeleRecoverySystem::TRecoveryState aState );
+
+        /**
+        * Add a new item to the recovery system. The function may leave if
+        * OOM. 
+        *
+        * @param aCallBack callback.
+        * @param aPriority priority.
+        * @param aState start state.
+        * @return identifier.
+        */
+        IMPORT_C TRecoveryId AddL( TCallBack aCallBack,
+            TRecoveryPriority aPriority,
+            CTeleRecoverySystem::TRecoveryState aState );
+    
+        /**
+        * Removes item.
+        *
+        * @param aId identifier of the item to be removed.
+        */
+        IMPORT_C static void Remove( TRecoveryId aId );
+    
+        /**
+        * Sets state. Note: The timer will not be started if the state is
+        * set to be waiting.
+        *
+        * @param aId identifier.
+        * @param aState new state.
+        */
+        void SetState( TRecoveryId aId, 
+            CTeleRecoverySystem::TRecoveryState aState );
+    
+        /**
+        * Resets pending recovery actions back to waiting.
+        */
+        void ResetPending();
+    
+        /**
+        * Recovers one step or all steps synchronously. Even if it's solved
+        * it should call the method.
+        *
+        * @param aId identifier.
+        * @param aPriority priority.
+        * @param aAllSteps ETrue if all steps need to be run.
+        * @return error code.
+        */
+        IMPORT_C TInt RecoverNow( TRecoveryId aId, 
+            TRecoveryPriority aPriority, 
+            TBool aAllSteps = EFalse );
+
+        /**
+        * Informs that precondition has been satisfied.
+        */
+        IMPORT_C void EnablePreconditionL();
+
+                        
+       /**
+        * Create tele recovery system
+        */    
+        CTeleRecoverySystem* CreateRecoverySystemL();
+
+    private: // New functions
+
+        /**
+        * Removes recovery id item.
+        *
+        * @param aId identifier of the item to be removed.
+        */
+        void RemoveId( TRecoveryId aId );
+    
+    private: // private structures
+        
+        // Defines structure containing information
+        // of a recovery item.
+        class TRecoveryItem
+            {
+            public:
+                // Identifier
+                TRecoveryId iId;
+                // Callback
+                TCallBack iCallBack;
+                // Priority
+                TRecoveryPriority iPriority;
+                // State
+                CTeleRecoverySystem::TRecoveryState iState;
+            };
+
+    private: //private function
+
+        /**
+        * Two-phased constructor.
+        * @return new instance.
+        */
+        static CPhoneRecoverySystem* NewL();
+
+        /**
+        * C++ constructor.
+        */
+        CPhoneRecoverySystem();
+         
+        /**
+        * Adds id to container which holds all the ids this singleton
+        * has given out via AddL method.
+        * @param aId - Id to be added in container
+        * @exception -1 (KErrNoSpace) is thrown if there isn't room in the container
+        */
+        void AddIdToContainer( TRecoveryId aId );
+        
+        /**
+        * Removes given id from the container which holds all the ids this singleton
+        * has given out via AddL method.
+        * @param aId - Id to be removed from container
+        */
+        void RemoveFromContainer( TRecoveryId aId );
+        
+        /**
+        * This is called from destructor. Method removes all the ids from recovery
+        * system that are hold within container. This is done this way because
+        * this singleton object is actually destructed by coeenv before some of
+        * object's clients' destructor is called where it would try to remove
+        * id from the recovery system. Now this way we do not leak any resources.
+        */
+        void RemoveAllIdsFromContainer();
+
+
+    private:    // Data  
+           
+        // Timer for recovery
+        CPhoneTimer* iTimer;
+
+        // Timer for recovery all steps
+        CPhoneTimer* iAllStepsTimer;
+
+        // Id counter for TRecoveryId
+        TInt iIdCounter;
+
+        // Count the ticks
+        TInt iTickCounter;
+
+#ifdef _DEBUG
+        // Debug: to prevent modification of recovery system in 
+        // recovery callback.
+        TBool iIsCallBack;
+#endif // _DEBUG
+
+        // ETrue if precondition ok
+        TBool iPrecondOk;
+
+        // ETrue if precondition SIM ok
+        TBool iPrecondSimOk;
+
+        // Keycount - recovery counter is checked only after some keypresses
+        TInt iKeyCount;
+        
+        // Reference to Tele recovery system.
+        CTeleRecoverySystem* iRecoverySystem;
+        
+        // Container for allocated recovery ids
+        TFixedArray< TInt, KIdContainerSize > iIdContainer;
+
+    };
+
+#endif      // CPHONERECOVERYSYSTEM_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphoneresourceresolverbase.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     Concrete resource resolver for common phoneapp resources.
+*
+*/
+
+
+#ifndef __CPHONERESOURCERESOLVERBASE_H
+#define __CPHONERESOURCERESOLVERBASE_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "mphoneresourceresolver.h"
+#include "tphonetouchbuttonconfig.h"
+
+// FORWARD DECLARATIONS
+class CEikonEnv;
+
+// CLASS DECLARATION
+/**
+*  Concrete resource resolver for common phoneapp resources.
+*/
+class CPhoneResourceResolverBase : 
+    public CBase,
+    public MPhoneResourceResolver
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Base constructor. Should be called from the ConstructL of
+        * the deriving class.
+        * @param None
+        * @return None
+        */
+        IMPORT_C void BaseConstructL();
+        
+        /**
+        * Virtual Destructor
+        * @param None
+        * @return None
+        */
+        IMPORT_C virtual ~CPhoneResourceResolverBase();        
+    
+    public: // From MPAResourceResolver
+
+        /**
+        * Resolve resource id of given resource.
+        * @param aEnumUid: Uid of enumeration which contains needed 
+        *                  resource definition.
+        * @param aResource: ID of needed resource ( from enumeration ).
+        * @return Resource id.
+        */
+        IMPORT_C TInt ResolveResourceID( const TInt& aResource ) const;       
+
+    protected:    // Constructors and destructor        
+        /**
+        * Private constructor.
+        * @param None        
+        * @return None
+        */
+        IMPORT_C CPhoneResourceResolverBase();
+        
+        /**
+        * Checkes whether a certain feature is on / or not.
+        * @param aFeatureId
+        * @return TBool supported /not supported
+        */ 
+        IMPORT_C virtual TBool IsTelephonyFeatureSupported( TInt aFeatureId ) const;
+    
+   protected:
+       TInt iResourceOffset;     
+
+    private:
+        // Feature variation
+        enum TVariationFlags
+            {
+            //Flag to indicate whether on screen dialer is supported.
+            EOnscreenDialer = 1,
+            //Flag to indicate whether on touch call handling is supported.
+            ETouchCallHandling = 2,
+            //Flag to indicate whether videocallmenu is supported.
+            EVideoCallMenu = 4
+            };
+        TInt iVariationFlags;
+        
+        CEikonEnv& iEnv;
+        
+        TInt iCUIResourceOffset;
+        TInt iPTCHResourceOffset;
+        
+        // Touch button config
+        TPhoneTouchButtonConfig iTouchButtonConfig;
+    };
+
+#endif      // __CPHONERESOURCERESOLVERBASE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonestorage.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Storage of data
+*
+*/
+
+
+#ifndef CPHONESTORAGE_H
+#define CPHONESTORAGE_H
+
+#include "mphonestorage.h"
+#include <e32base.h>
+
+
+// CLASS DECLARATION
+
+/**
+ *  Data storage.
+ *
+ *  @lib PhoneUIUtils.lib
+ *  @since S60 v5.0
+ */
+class CPhoneStorage : 
+    public CBase, public MPhoneStorage
+    {
+public:
+
+    IMPORT_C static CPhoneStorage* NewL();
+
+    IMPORT_C virtual ~CPhoneStorage();
+    
+    /**
+     * AppendBlockedKeysListL.
+     *
+     * @since S60 v5.0
+     */
+    IMPORT_C void AppendBlockedKeysListL( TStdScanCode aScanCode );
+    
+    /**
+     * GetBlockedKeyList.
+     *
+     * @since S60 v5.0
+     */
+    IMPORT_C const RArray<TInt>& GetBlockedKeyList() const;
+
+    /**
+     * ResetBlockedKeysList.
+     *
+     * @since S60 v5.0
+     */
+    IMPORT_C void ResetBlockedKeysList();
+
+    /**
+     * IsBlockedKeysListEmpty.
+     */
+    IMPORT_C TBool IsBlockedKeysListEmpty();
+
+    /**
+     * SetScreenLocked.
+     */
+    IMPORT_C void SetScreenLocked( TBool aLocked );
+    
+    /**
+     * IsScreenLocked.
+     */
+    IMPORT_C TBool IsScreenLocked();
+    
+    /**
+     * SetNeedToEnableKeylock.
+     */
+    IMPORT_C void SetNeedToEnableKeylock( TBool aNeedToEnableKeylock );
+
+    /**
+     * NeedToEnableKeylock.
+     */
+    IMPORT_C TBool NeedToEnableKeylock();
+    
+private:
+
+    CPhoneStorage();
+    
+    void ConstructL();
+    
+private: // data
+
+     // Blocked key list
+     RArray<TInt> iBlockedKeysScanCode;
+     
+     // Is touch screen locked there is an incoming call
+     TBool iIsScreenLocked;
+     
+     // ETrue, if keylock must enable when call ends
+     TBool iNeedToEnableKeylock;
+    };
+#endif // CPHONESTORAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/cphonetimer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    Utility class for CTimer object
+*
+*/
+
+
+#ifndef CPHONETIMER_H
+#define CPHONETIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "mphonetimer.h"
+
+// CLASS DECLARATION
+
+/**
+*  Utility class for timer 
+*/
+class CPhoneTimer : public CTimer
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPhoneTimer* NewL( 
+            TInt aPriority = CActive::EPriorityStandard );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPhoneTimer();
+
+    public: // New functions
+        
+        /**
+        * The Callback function is called after the interval
+        * All former request will be canceled first
+        */
+        IMPORT_C void After( 
+            TTimeIntervalMicroSeconds32 anInterval,
+            TCallBack aCallBack );
+
+        /**
+        * Use the maxin class to notify the timer
+        * All former request will be canceled first
+        */
+        IMPORT_C void After( 
+            TTimeIntervalMicroSeconds32 anInterval, 
+            MPhoneTimer* aObserver );
+
+        /**
+        * Cancel the timer if needed
+        */
+        IMPORT_C void CancelTimer();
+
+    protected:  // Functions from base classes
+        
+        /**
+        * From CTimer::RunL()
+        */
+        virtual void RunL();
+
+        /**
+        * From CTimer::DoCancel()
+        */
+        virtual void DoCancel();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPhoneTimer( TInt aPriority );
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        // By default, prohibit copy constructor
+        CPhoneTimer( const CPhoneTimer& );
+
+        // Prohibit assigment operator
+        CPhoneTimer& operator=( const CPhoneTimer& );
+
+    private:    // Data
+
+        // Used by After( anInterval, aCallBack )
+        TCallBack iCallBack;
+
+        // Used by After( anInterval, aObserver )
+        MPhoneTimer* iTimerObserver;
+    };
+
+#endif      // CPhoneTimer_H 
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/ctelerecoverysystem.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,497 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Recovery system class.
+*
+*/
+
+
+
+#ifndef CTeleRecoverySystem_H
+#define CTeleRecoverySystem_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class CPhoneTimer;
+class CTeleWaitingIdle;
+
+// DATA TYPES
+typedef TInt TPhoneRecoveryId;
+typedef TInt8 TPhoneRecoveryPriority;
+
+// Template class for late construct
+// User guide:
+// In header file:
+// class A
+//     {
+//     public:
+//         static A* NewL( CTeleRecoverySystem& aRecoverySystem );
+//         void ~A();
+//         void EarlyDestruct();
+//     private:
+//         A( CTeleRecoverySystem& aRecoverySystem );
+//         void ConstructL();
+//         void LateConstructL();
+//         static TInt LateConstructCallBackL( TAny* aAny );
+//     private:
+//         CTeleRecoverySystem& iRecoverySystem;
+//         TInt iLateConstructId;
+//     }
+// 
+// In cpp file
+// A* A::NewL( CPhoneRecoverySstem& aRecoverySystem )
+//     {
+//     A* self = new ( ELeave ) A( aRecoverySystem );
+//     CleanupStack::PushL( A );
+//     A->ConstructL();
+//     CleanupStack::Pop();
+//     }
+// void A::~A();
+//    {
+//    EarlyDestruct();
+//    iRecoverySystem.Remove( iLateConstructId );
+//    }
+// void A::EarlyDestruct()
+//    {
+//    //do all the construct
+//    }
+// A::A( CTeleRecoverySystem& aRecoverySystem ) 
+//    : iReoverySystem( aRecoverySystem )
+//    {
+//    }
+// void A::ConstructL()
+//    {
+//    // Add everything related to recovery system. 
+//    // If EStateWaiting is used, make sure in the callback 
+//    // function, the system may not be constructed yet.
+//    iRecoverySystem.AddL( TCallBack( LateConstructCallBackL, this ),
+//        CTeleRecoverySystem::EPhonePriorityStandard,
+//        CTeleRecoverySystem::EStateWaiting );
+//    }
+// void A::LateConstructL()
+//    {
+//    //Do the real construct
+//    //Note! CTeleRecoverySystem::AddL() shouldn't be called in this function.
+//    }
+// TInt A::LateConstructCallBackL( TAny* aAny )
+//    {
+//    A* self = reinterpret_cast< A* >( aAny );
+//    CleanupEarlyDestructPushL( *self );
+//    self->LateConstructL();
+//    CleanupStack::Pop();
+//    }
+// 
+// Call Resume() from time to time. For example in OfferKeyEventL, every 16th
+// key press calls Resume().
+//
+// TKeyResponse A::OfferKeyEventL(...)
+//    {
+//    iKeyCount++;
+//    iKeyCount %= 16;
+//    if ( !iKeyCount )
+//      {
+//      iRecoverySystem.Resume();
+//      iKeyCount = 0;
+//      }
+//    return EKeyWasNotConsumed;
+//    }
+//      
+
+/**
+* Template class to handle late construction.
+*/
+template <class T>
+class CleanupEarlyDestruct
+    {
+    public:
+        
+        /**
+        * Pushes an item to cleanup stack. 
+        * If leave occurs, then EarlyDestruct 
+        * method will be called.
+        *
+        * @param aRef instance of which EarlyDestruct
+        *             needs to be called upon leave.
+        */
+        inline static void PushL( T& aRef );
+        
+    private:
+        
+        /**
+        * Cleanup action.
+        */
+        static void Cleanup( TAny* aPtr );
+        
+    };
+
+/**
+* Helper function.
+*/ 
+template <class T>
+inline void CleanupEarlyDestructPushL( T& aRef );
+
+// CLASS DECLARATION
+
+/**
+*  If an operation fails, user classes may be leaved to incorrect states. 
+*  By using recovery system, failed operation will be tried again some time 
+*  later. This may enhance the robustness of user class.
+*/
+NONSHARABLE_CLASS( CTeleRecoverySystem ): public CActive
+    {   
+    public:
+    // Enumerates priorities:
+    // EPriorityDontCare - don't care
+    // EPriorityLow - low
+    // EPriorityStandard - standard
+    // EPriorityHigh - high
+    // EPriorityCritical - very critical.
+    enum TPhonePriority
+        {
+        EPhonePriorityDontCare = -10,
+        EPhonePriorityLow = -5,
+        EPhonePriorityStandard = 0,
+        EPhonePriorityHigh = 5,
+        EPhonePriorityCritical = 100
+        };
+        
+    // Enumerates states for a recovery item:
+    // EStateIdle - solved, everything is fine
+    // EStateWaiting - not solved, waiting
+    // EStatePending - semipermanently not solved
+    // EStateStarting - recovery for all steps started
+    // EStateLockedPending - locked to pending state. it's not allowed 
+    //                       to be moved back to waiting
+    // EStatePrecond - precondition: light idle-phone is reached, 
+    //                 but before PIN code query)must be satisfied 
+    //                 before this can be run
+    // EStatePrecondSim - precondition: SIM card is ready. This happens 
+    //                 after PIN code is accepted.
+    enum TRecoveryState
+        {
+        EPhoneStateIdle, 
+        EPhoneStateWaiting,  
+        EPhoneStatePending,  
+        EPhoneStateStarting, 
+        EPhoneStateLockedPending, 
+        EPhoneStatePrecond, 
+        EPhoneStatePrecondSim  
+        };
+
+    // Defines null id.
+    enum 
+        {
+        KNullId = -1
+        }; 
+    
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CTeleRecoverySystem* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CTeleRecoverySystem();
+
+    public: // New functions
+               
+        /**
+        * Adds a new item with given priority & state. Returns Null id if it
+        * failed. Same item must not be added twice. Callback's return value
+        * indicates how many steps there are to be done, 0 - no more steps. 
+        * Error code or leave - failure.
+        * Priority indicates importantance of the action.
+        *
+        * @param aCallBack callback.
+        * @param aPriority priority.
+        * @param aState start state.
+        * @return identifier.
+        */
+        virtual TPhoneRecoveryId Add( TCallBack aCallBack, 
+            TPhoneRecoveryPriority aPriority, 
+            TRecoveryState aState );
+
+        /**
+        * Add a new item to the recovery system.
+        * The function may leave if OOM. 
+        *
+        * @param aCallBack callback.
+        * @param aPriority priority.
+        * @param aState start state.
+        * @return identifier.
+        */
+        virtual TPhoneRecoveryId AddL( TCallBack aCallBack,
+            TPhoneRecoveryPriority aPriority,
+            TRecoveryState aState );
+    
+        /**
+        * Removes item.
+        *
+        * @param aId identifier of the item to be removed.
+        */
+        virtual void Remove( TPhoneRecoveryId aId );
+    
+        /**
+        * Sets state. Note: The timer will not be started if the state is
+        * set to be waiting.
+        *
+        * @param aId identifier.
+        * @param aState new state.
+        */
+        virtual void SetState( TPhoneRecoveryId aId, TRecoveryState aState );
+    
+        /**
+        * Resets pending recovery actions back to waiting.
+        */
+        virtual void ResetPending();
+    
+        /**
+        * Recovers one step or all steps synchronously. Even if it's solved
+        * it should call the method.
+        *
+        * @param aId identifier.
+        * @param aPriority priority.
+        * @param aAllSteps ETrue if all steps need to be run.
+        * @return error code.
+        */
+        virtual TInt RecoverNow( TPhoneRecoveryId aId, 
+            TPhoneRecoveryPriority aPriority, 
+            TBool aAllSteps = EFalse );
+
+        /**
+        * Informs that precondition has been satisfied.
+        */
+        virtual void EnablePrecondition();
+        
+        /**
+        * If recovery has been paused due to internal logic, requests
+        * recovery to continue. 
+        * User class should call this from time to time to improve robustness.
+        * For example, user class could call this based on key events it receives.
+        */
+        virtual void Resume();
+    
+    public:
+    
+        /**
+        * Recovers all steps synchronously.
+        */
+        void RecoverAllNow();
+        
+    public: // Functions from base classes
+
+        /**
+        * @see CActive::RunL.
+        */
+        void RunL();
+
+        /**
+        * @see CActive::DoCancel.
+        */
+        void DoCancel();
+        
+    private: // private structures
+        
+        // Defines structure containing information of a recovery item.
+        struct TRecoveryItem
+            {
+            // Identifier
+            TPhoneRecoveryId iId;
+            // Callback
+            TCallBack iCallBack;
+            // Priority
+            TPhoneRecoveryPriority iPriority;
+            // State
+            TRecoveryState iState;
+            };
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CTeleRecoverySystem();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * Enable precondition Sim OK.
+        */
+        void EnablePrecondSimOk();
+
+        /**
+        * Do item call back
+        */
+        TInt DoItemCallBack( TRecoveryItem& aItem );
+
+        /**
+        * Call back funciton for CPhoneTimer.
+        */
+        static TInt HandleTimer( TAny* aAny );
+
+        /**
+        * Really handle function to handle timer.
+        */
+        TInt DoHandleTimer();
+
+        /**
+        * Call back funciton for AllStepsTimer.
+        */
+        static TInt HandleAllStepsTimer( TAny* aAny );
+
+        /**
+        * Handle AllStesTimer timeout.
+        */
+        TInt DoHandleAllStepsTimer();
+
+        /**
+        * Checks and updates state if precondition has been satisfied.
+        */
+        void CheckStateForPrecondition( TRecoveryState& aState );
+
+        /**
+        * It starts a timer if required when event state changes.
+        *
+        * @param aNewState new state of the event.
+        */
+        void StartTimerIfRequired( TRecoveryState aNewState );
+
+        /**
+        * It start the timer, but iTickCounter will not be cleared.
+        */
+        void StartTimerIfIdle();
+
+        /**
+        * Start timer.
+        */
+        void StartTimer();
+
+        /**
+        * Starts all steps timer.
+        */
+        void StartAllStepsTimer();
+
+        /**
+        * Starts timer for the next recovery attempt.
+        */
+        void StartNext( TInt aFound );
+
+        /**
+        * Determines which events will be run.
+        */
+        TInt DetermineRun() const;
+
+        /**
+        * Calculates next tick.
+        */
+        inline TInt NextTick( TInt aTicks ) const;
+
+        /**
+        * Finds by recovery id.
+        *
+        * @param aId id.
+        * @return recovery id.
+        */
+        TInt Find( TPhoneRecoveryId aId ) const;                    
+        
+        /**
+        * Issues new active object request.
+        */
+        void IssueRequest();
+        
+        /**
+        * Is SIM now ok?
+        */
+        TBool IsSIMOk();
+        
+        /**
+        * Check for SIM availability. 
+        */
+        TInt CheckSIMAvailable();
+        
+        /**
+        * Checks if Idle is started.
+        */
+        TBool IsIdle();
+                        
+    private:    // Data
+    
+        // Currently handled request.
+        enum TPhoneRequestStatus
+            {
+            EPhoneNone,
+            EPhoneSIMPresent,
+            EPhoneSIMStatus
+            };
+
+        // Timer for recovery
+        CPhoneTimer* iTimer;
+
+        // Timer for recovery all steps
+        CPhoneTimer* iAllStepsTimer;
+        
+        // Timer for idle.
+        CTeleWaitingIdle* iWaitingIdle;
+
+        // Recoverty time array
+        CArrayFixFlat< TRecoveryItem >* iRecoveryItems;
+
+        // Id counter for TPhoneRecoveryId
+        TInt iIdCounter;
+
+        // Count the ticks
+        TInt iTickCounter;
+        
+        // Sim present status. 
+        TInt iSimAvailable;
+
+#ifdef _DEBUG
+        // Debug: to prevent modification of recovery system in 
+        // recovery callback.
+        TBool iIsCallBack;
+#endif // _DEBUG
+
+        // ETrue if precondition ok
+        TBool iPrecondOk;
+
+        // ETrue if precondition SIM ok
+        TBool iPrecondSimOk;
+        
+        // Indicates what request is currently handled.
+        TPhoneRequestStatus iRequest;
+     
+        //  Owned Publish and Subscribe property for SIM status.
+        RProperty iSimStatusProperty;
+        
+        // Owned Publish and Subscribe property for SIM present.
+        RProperty iSimPresentProperty;
+        
+        // Owned Publish and Subscribe property for Idle active.
+        RProperty iIdleActive;
+    };
+
+// Inline methods.
+#include "ctelerecoverysystem.inl"
+
+#endif      // CTELERECOVERYSYSTEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/ctelerecoverysystem.inl	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Inline methods for CTeUtlRecoverySystem.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "ctelerecoverysystem.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CleanupEarlyDestruct::PushL
+// -----------------------------------------------------------------------------
+//
+template <class T>
+inline void CleanupEarlyDestruct<T>::PushL( T& aRef )
+    {
+    CleanupStack::PushL( TCleanupItem( &Cleanup, &aRef ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CleanupEarlyDestruct::Cleanup
+// -----------------------------------------------------------------------------
+//
+template <class T>
+void CleanupEarlyDestruct<T>::Cleanup( TAny *aPtr )
+    { 
+    ( static_cast< T* >( aPtr ) )->EarlyDestruct();
+    }
+
+// -----------------------------------------------------------------------------
+// CleanupEarlyDestructPushL
+// -----------------------------------------------------------------------------
+//
+template <class T>
+inline void CleanupEarlyDestructPushL( T& aRef )
+    {
+    CleanupEarlyDestruct<T>::PushL( aRef );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/ctelewaitingidle.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Utility class for waiting idle.
+*
+*/
+
+
+#ifndef CTeleWaitingIdle_H
+#define CTeleWaitingIdle_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+
+class CTeleRecoverySystem;
+
+// CLASS DECLARATION
+
+/**
+* Utility class for CTeleWaitingIdle.
+* 
+* @lib -
+* @since S60 5.0
+*/
+NONSHARABLE_CLASS( CTeleWaitingIdle ) : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aPriority priority for the timer.
+        * @return new instance of CTeleWaitingIdle.
+        */
+        static CTeleWaitingIdle* NewL( 
+                            TInt aPriority, 
+                            CTeleRecoverySystem& aRecoverySystem );
+                            
+        /**
+        * Destructor.
+        */
+        virtual ~CTeleWaitingIdle();
+
+    public: // New functions
+        
+        /**
+        * The Callback function is called after the interval.
+        *
+        * @param anInterval interval.
+        * @param aCallBack callback to be called after 
+        *                  interval.
+        */
+        void StartWaitingIdleL();
+
+    protected:  // Functions from base classes
+        
+        /**
+        * @see CActive.
+        */
+        virtual void RunL();
+        
+        /**
+        * @see CActive::DoCancel.
+        */
+        void DoCancel();        
+
+    private: // Constructors
+
+        /**
+        * C++ constructor.
+        */
+        CTeleWaitingIdle( TInt aPriority, 
+                           CTeleRecoverySystem& aRecoverySystem );
+
+    private:    // Data
+    
+        // Timer callback.
+        TCallBack iCallBack;
+        
+        // Central Repository.
+        RProperty iProperty;
+        
+        // Recovery System.
+        CTeleRecoverySystem& iRecoverySystem;
+    };
+
+#endif      // CTeleWaitingIdle_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphonecenrepobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract class for observe change of setting 
+*                through CPhoneCenRepProxy
+*
+*/
+
+
+#ifndef __MPHONECENREPOBSERVER_H
+#define __MPHONECENREPOBSERVER_H
+
+// CLASS DECLARATION
+
+/**
+* Abstract class for observe change of setting through CPhoneCenRepProxy
+*/
+class MPhoneCenRepObserver
+    {
+    public: // New functions
+        
+        /**
+        * Handle the change of the setting from Central Repository
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        */
+        virtual void HandleCenRepChangeL( 
+            const TUid& aUid,
+            const TUint aId ) = 0;
+    };
+
+#endif      // MPHONECENREPOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphoneerrormessageshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Show error notes.
+*
+*/
+
+
+#ifndef __MPHONEERRORMESSAGESHANDLER_H
+#define __MPHONEERRORMESSAGESHANDLER_H
+
+// INCLUDES
+#include <pevirtualengine.h>
+
+// CLASS DECLARATION
+class TPEErrorInfo;
+
+class MPhoneErrorMessagesHandler
+    {
+    public:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneErrorMessagesHandler() {};
+
+        virtual void ShowErrorSpecificNoteL( const TPEErrorInfo& aErrorInfo ) = 0;
+    };
+
+#endif // __MPHONEERRORMESSAGESHANDLER_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphoneerrormessageshandlerregister.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    API for register error messages handler.
+*
+*/
+
+
+#ifndef __MPHONEERRORMESSAGESHANDLERREGISTER_H
+#define __MPHONEERRORMESSAGESHANDLERREGISTER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+
+// CLASS DECLARATION
+
+/**
+*  API for register resource resolvers.
+*/
+class MPhoneErrorMessagesHandlerRegister
+    {
+    public:     
+        
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneErrorMessagesHandlerRegister(){};
+
+        /**
+        * R 
+        * @return None.
+        */
+        virtual void RegisterErrorMessagesHandler( MPhoneErrorMessagesHandler* aResolver ) = 0;
+
+    };
+#endif      // __MPHONEERRORMESSAGESHANDLERREGISTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphonelangsettingobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer for Input Language Setting changes.
+*
+*/
+
+
+#ifndef MPHONELANGSETTINGOBSERVER_H 
+#define MPHONELANGSETTINGOBSERVER_H
+
+// CLASS DECLARATION
+
+/**
+*  Observer for Input Language Setting changes.
+*/
+class MPhoneLangSettingObserver
+    {
+    public:
+
+        /**
+        * Handle Input Language Setting changes.
+        * @param aLanguage state of Input Language setting.
+        */
+        virtual void HandleInputLanguageSettingChange( TInt aLanguage ) = 0;
+    };
+
+#endif      // MPHONELANGSETTINGOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphonepubsubobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Abstract class to observe property value changes
+*
+*/
+
+
+#ifndef __MPHONEPUBSUBOBSERVER_H
+#define __MPHONEPUBSUBOBSERVER_H
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Abstract class to observe the property value changes
+*/
+class MPhonePubSubObserver
+    {
+    public: 
+        
+        /**
+        * This function is called when there is property value change.
+        * @param aCategory Category of the property
+        * @param aKey Property key that is changed
+        * @param aValue New property value
+        */
+        virtual void HandlePropertyChangedL( 
+            const TUid& aCategory,
+            const TUint aKey,
+            const TInt aValue ) = 0;
+    };
+
+#endif      // __MPhonePubSubObserver_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphonequerycommandobserver.h	Fri Jun 04 10:19:18 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:  Abstract class to observe query commands.
+*
+*/
+
+
+#ifndef __MPHONEQUERYCOMMANDOBSERVER_H
+#define __MPHONEQUERYCOMMANDOBSERVER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+/**
+*  Abstract class to observe query commands. 
+*/
+class MPhoneQueryCommandObserver
+    {
+    public:
+
+        /**
+         * Destructor.
+         */
+        virtual ~MPhoneQueryCommandObserver() {};
+
+        /**
+         * Sends command which was selected from a query for
+         * command observer.
+         * @param aCommandId A command id.
+         */
+        virtual void ProcessCommandL( TInt aCommandId  ) = 0;
+
+    };
+
+#endif // __MPHONEQUERYCOMMANDOBSERVER_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphoneqwertymodeobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer for qwerty mode.
+*
+*/
+
+
+#ifndef MPHONEQWERTYMODEOBSERVER_H 
+#define MPHONEQWERTYMODEOBSERVER_H
+
+// CLASS DECLARATION
+
+/**
+*  Observer for qwerty mode changes.
+*/
+class MPhoneQwertyModeObserver
+    {
+
+    public:
+        /**
+        * Handle Qwerty mode change.
+        * @param aMode 0 = off, 1 = on
+        */
+        virtual void HandleQwertyModeChange( TInt aMode ) = 0;
+        
+        /**
+        * Handle qwerty keyboard layout change.
+        */
+        virtual void HandleKeyboardLayoutChange() = 0;
+
+    };
+
+#endif // MPHONEQWERTYMODEOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphoneresourceresolver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    An abstract base class for resource resolvers.
+*
+*/
+
+
+#ifndef MPHONERESOURCERESOLVER_H
+#define MPHONERESOURCERESOLVER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+
+// CLASS DECLARATION
+
+/**
+*  An abstract base class for resource resolvers.
+*/
+class MPhoneResourceResolver
+    {
+    public:
+    
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneResourceResolver() {};
+
+        /**
+        * Resolve resource id of given resource.
+        * @param aResource: ID of needed resource ( from enumeration ).
+        * @return Resource id.
+        */
+        virtual TInt ResolveResourceID( const TInt& aResource ) const = 0;
+
+        
+    };
+#endif      // MPHONERESOURCERESOLVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphoneresourceresolverregister.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    API for register resource resolvers.
+*
+*/
+
+
+#ifndef __MPHONERESOURCERESOLVERREGISTER_H
+#define __MPHONERESOURCERESOLVERREGISTER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+
+// CLASS DECLARATION
+
+/**
+*  API for register resource resolvers.
+*/
+class MPhoneResourceResolverRegister
+    {
+    public:     
+        
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneResourceResolverRegister(){};
+
+        /**
+        * Register given resolver for resolving resources.
+        * @param aResolver: Pointer to the resolver to be registered.      
+        * @return None.
+        */
+        virtual void RegisterResolver( MPhoneResourceResolver* aResolver ) = 0;
+
+    };
+#endif      // __MPHONERESOURCERESOLVERREGISTER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphonestorage.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Storage for data.
+*
+*/
+
+
+#ifndef __MPHONESTORAGE_H
+#define __MPHONESTORAGE_H
+
+// INCLUDES
+
+#include <e32base.h>
+#include <e32keys.h>
+
+// CLASS DECLARATION
+
+class MPhoneStorage
+    {
+    public:
+
+        /**
+        * Destructor.
+        */
+        virtual ~MPhoneStorage() {};
+
+        virtual void AppendBlockedKeysListL( TStdScanCode aScanCode ) = 0;
+        
+        virtual const RArray<TInt>& GetBlockedKeyList() const = 0;
+        
+        virtual void ResetBlockedKeysList() = 0;
+        
+        virtual TBool IsBlockedKeysListEmpty() = 0;
+        
+        virtual void SetScreenLocked( TBool aLocked ) = 0;
+        
+        virtual TBool IsScreenLocked() = 0;
+        
+        virtual TBool NeedToEnableKeylock() = 0;
+        
+        virtual void SetNeedToEnableKeylock( TBool aEnableKeylock ) = 0;
+    };
+
+#endif // __MPHONESTORAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/mphonetimer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Mixin class for phone timer.
+*
+*/
+
+
+#ifndef __MPHONETIMER_H
+#define __MPHONETIMER_H
+
+/**
+*  Mixin class for phone timer
+*/
+class MPhoneTimer
+    {
+
+    public: // New functions
+        
+        /**
+        * Destructor
+        */
+        virtual ~MPhoneTimer(){};
+
+        /**
+        * This function is called after on timeout
+        */
+        virtual void HandleTimeOutL() = 0;
+    };
+
+#endif      // __MPHONETIMER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phoneconstants.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,498 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Common constant values needed through PhoneUI module.
+
+*
+*/
+
+#ifndef PHONECONSTANTS_H
+#define PHONECONSTANTS_H
+
+//  INCLUDES
+#include <e32base.h>
+#ifdef RD_UIKON_UNBRANCH
+#include    <AknDef.h>
+#include    <aknconsts.h>
+#endif // RD_UIKON_UNBRANCH
+#include "telinternalsingletonuids.h"
+
+
+// CONSTANTS
+
+// SECURITY POLICIES
+
+    // Read capability: AlwaysPass.
+    _LIT_SECURITY_POLICY_PASS( KPhoneReadPolicyAlwaysPass );
+    
+    // Read capability: ReadDeviceData.
+    _LIT_SECURITY_POLICY_C1( KPhoneReadPolicy, ECapabilityReadDeviceData );
+    
+    // Write capability: WriteDeviceData.
+    _LIT_SECURITY_POLICY_C1( KPhoneWritePolicy, ECapabilityWriteDeviceData );
+    
+// Application UIDs
+const TUid KUidPhoneApplication = { 0x100058B3 };   // Phone application
+const TUid KPhoneUidAppPhonebook = { 0x101F4CCE };  // PhoneBook
+const TUid KPhoneUidAppPhoneInfo = { 0x101fc0ef };  // Phone Info
+const TUid KPhoneUidAppFTD = { 0x100058F2 };        // Field Test Display
+const TUid KDeviceManagerUid = {0x101F6DE5};        // Device manager application  
+const TUid KUidStartupApplication = { 0x100058F4 }; // Startup application
+const TUid KUidSpdia = { 0x1000590A };              // Speeddial application.
+const TUid KVtUiAppUidValue = { 0x101F8681 };       // Video Telephony application
+
+// Contants below define which view will be activated. 
+const TInt KTouchDiallerViewCommand = 1;
+const TInt KTouchCallHandlingVievCommand = 2;
+
+// Defination for launching PhoneInfo application
+const TUid KPhoneUidViewPhoneInfo = { 1 };  
+
+// Defination for launching Log application
+const TUid KPhoneUidViewLogLastDial = { 1 };        // Last dialled view ID of Log application
+const TUid KPhoneUidLogStm = { 0x01002982 };        // Id for stm for Log application
+_LIT8( KPhoneStmLoadMagicString, "outside" );       // Message for activating view of an application
+
+// Used in CPhoneKeyEventHandler
+// Seconds in microseconds
+const TInt KPhoneSecondInMicroseconds = 1000000;
+// For long press of end key while external
+const TInt KPhoneLongPressKeyEventDuration = 
+    ( KPhoneSecondInMicroseconds * 6 ) / 10; // 0.6 sec
+
+// Used in CPhoneUIController
+//
+// Delay between Phone Engine start tries
+const TInt KPeRetryDelay = 500000;
+// PE start retry times
+const TInt KPeRetryCount = 10;
+
+// ServiceId value: service not determined
+const TInt  KUnknownService = 0;
+
+// Used in CPhoneViewController
+// Voice Mail Box key "1"
+const TInt KPhoneVoiceMailBoxLocation = 1;  
+// Video Mail Box key "2"
+const TInt KPhoneVideoMbxLocation = 2;
+// Path to soft reject resource
+_LIT( KPhoneSoftRejectResource, "z:softreject.rsc" );
+
+// Used in CPhoneMenuController
+// valid phone number length
+const TInt KPhoneValidPhoneNumberLength = 3;
+
+// Used in CPhoneState
+// Maximum length of the Call header label
+const TInt KPhoneCallHeaderLabelMaxLength = 50;
+// Line feed
+_LIT( KPhoneLineFeed, "\n");
+// Length of the text to display call duration - 
+// at least double the length of (HH:MM:SS)
+const TInt KPhoneMaxTimeDisplayTextLength = 16;
+// Length of the profile display date string
+const TInt KPhoneMaxDateDisplayTextLength = 100;
+
+// Used in CPhoneStateIncoming
+// Array granularity for soft reject array.
+const TInt KPhoneSoftRejectArrayGranularity = 2;
+// Length of SMS.
+const TInt KPhoneSMSLength = 160;
+
+// Used in CPhoneStateInCall
+// Default CBA resource ID for single item fetch dialog
+const TInt KPhoneDefaultFetchCBA = 0; 
+
+// Used in CPhoneBubbleWrapper
+const TInt KPhoneNumberEntryBufferSize = 100;
+const TInt KMaxNumberOfCallerBubbles = 20;
+const TInt KNumberOfActiveCalls = 2;
+
+// Constant to indicate 'no resource'
+const TInt KPhoneBubbleNoResource = KErrNotFound;
+const TInt KPhoneContactNameMaxLength = 101;    // 50+50 first & last names + 1 for space between
+// Conference case
+const TInt KPhoneConferenceInitialSize = 2;
+const TInt KConferenceMaxParticipants = 5;
+
+// Used in CPhoneStatusPane
+const TInt KPhoneTitlePaneTextSize = 128;
+const TInt KPhoneTitlePaneForOperatorName = 1;
+const TInt KPhoneTitlePaneForPbkSigleFetch = 2;
+const TInt KPhoneTitlePaneListGranularity = 4;
+const TInt KPhoneNaviPaneListGranularity = 4;
+
+// Resource enumeration uid's
+const TUid KUidRssPhoneBase                       = { 0x01 };
+const TUid KUidRssPhoneGSM                        = { 0x02 };
+
+// For CPhoneView use
+const TUid KUidViewId = { 0x10282D81 };
+const TUid KUidAppId = { 0x100058B3 };
+ 
+// Amount of regions to be reserved.
+const TInt KPhoneRegionAmount = 16;
+
+const TInt KDefaultCallHeaderLeft = 12;
+const TInt KDefaultCallHeaderTop = 6;
+const TInt KDefaultCallHeaderRight = 19;
+const TInt KDefaultCallHeaderBottom = 12;
+const TInt KCallHeaderLeft = 156;
+const TInt KCallHeaderTop = 6;
+const TInt KCallHeaderRight = 164;
+const TInt KCallHeaderBottom = 12;
+
+const TInt KClockWindowActive = 3;
+const TInt KClockWindowIdle = 2;
+
+
+// Used in CPhoneKeys
+// The character to be used as the 'wait' character, by DTMF code.
+const TUint KPhoneDtmfWaitCharacter  = 'w';
+
+// The character to be used as the 'soft pause' character, by DTMF code.
+const TUint KPhoneDtmfPauseCharacter = 'p';
+
+// The character to be used as the 'speed-dial' character, by DTMF code.
+const TUint KPhoneDtmfSpeedDialCharacter = '+';
+
+// The length of the speed dial prefix, used to prevent buffer overflow
+const TUint KPhoneDtmfSpeedDialPrefixLength = 1;
+
+// Following, are the standard DTMF characters...
+const TInt KPhoneDtmfHashCharacter    = '#';
+const TInt KPhoneDtmfStarCharacter    = '*';
+const TInt KPhoneDtmf0Character       = '0';
+const TInt KPhoneDtmf1Character       = '1';
+const TInt KPhoneDtmf2Character       = '2';
+const TInt KPhoneDtmf3Character       = '3';
+const TInt KPhoneDtmf4Character       = '4';
+const TInt KPhoneDtmf5Character       = '5';
+const TInt KPhoneDtmf6Character       = '6';
+const TInt KPhoneDtmf7Character       = '7';
+const TInt KPhoneDtmf8Character       = '8';
+const TInt KPhoneDtmf9Character       = '9';
+
+// Check second #
+const TInt KSecondKeyEvent = 2;
+
+// Used in CPhoneStringContainer
+const TInt KPhoneStringContainerReserved = 50;
+const TInt KPhoneStringContainerGranularity = 10;
+
+// Used in test shutdown
+_LIT( KExit, "*#1234#" );
+/// ROM drive.
+_LIT( KDriveZ, "z:" );
+
+_LIT( KPhoneResourceFile, "phoneui.rsc" );
+_LIT( KPhoneResourceFileVoIP, "phoneuivoip.rsc" );
+_LIT( KPhoneResourceFileCHUI, "callhandlingui.rsc" );
+_LIT( KPhoneResourceFilePHTC, "phoneuitouch.rsc" );
+
+// Used in CPhoneAppUI
+// Priority of application window groups.
+const TInt KPhoneApplicationWindowGroupPriority = 0;
+
+// Ordinal position of phone application when sending to background.
+// NOTE: 0 - foreground application
+//       1 - server side status pane
+//       2 - phone application
+const TInt KPhoneWindowGroupPositionBackground = 2;
+
+// Here is priority for capturing keys, used in cpaappuibase.cpp :
+const TInt KPhoneCapturePriority = 10;
+
+// Name of the EIKON server window group.
+_LIT( KPhoneEikonServer, "EikonServer" );
+
+// For CPhoneLogger use
+const TInt KMaxLogLineLength = 256;
+const TInt KMaxAppendLength = 64;
+
+// From CPhoneNoteUtilities
+const TInt KPhoneNoteSoftkeysUseDefault = 0;
+const TInt KPhoneNoteGraphicNone = -1;
+const TInt KPhoneNoteNoTimeout = -1;
+
+// State machine ordinal number
+static const TInt KPhoneUiStateMachineOrdinal = 1;
+
+static const TUid KUidAppGSMStates = { 0x101F7CAC };
+static const TUid KUidAppVoIPExtensionStates = { 0x101F7CA9 };
+
+// Log folder and log file name
+_LIT( KPhoneLogFolder, "PhoneUI");
+_LIT( KPhoneLogFileName, "PhoneUI.log" );
+
+// Paths to CentRep
+_LIT( KGSMProtocol, "phoneuistates.dll" );
+_LIT( KVoIPExtension, "phoneuivoipextension.dll" );
+
+// Literals for formatting log messages
+_LIT( KPEDefaultMsgToPhoneUI,   "PE ----> PHONEUI <%S> message from PE. CallId: %d.");
+_LIT( KPEDefaultMsgToPE,        "PE <---- PHONEUI        <%S> to PE.");
+_LIT( KPEDefaultMsgToPhoneUIEnd,"PE ----> PHONEUI_COMPLETED    <%S> message from PE  executed succesfully");
+_LIT( KPEDefaultMsgToPEEnd,     "PE <---- PHONEUI_COMPLETED    <%S> message to PE  sended succesfully");
+_LIT( KPEDefaultStateChange,    "PHONEUI_STATE_CHANGE     <%S> -> <%S> ");
+_LIT( KPEDefaultMsgToView,      "PHONEUI ----> VIEW <%S> message from Control. CallId: %d.");
+
+// Component literals for CPhoneMethodLogger
+_LIT( KPhoneUI, "PhoneUI: " );
+_LIT( KPhoneUIControl, "PhoneUIControl: " );
+_LIT( KPhoneUIView, "PhoneUIView: " );
+_LIT( KPhoneUIStates, "PhoneUIStates: " );
+_LIT( KPhoneUIUtils, "PhoneUIUtils: " );
+_LIT( KPhoneMediatorCenter, "PhoneMediatorCenter: " );
+_LIT( KLessThan, "<" );
+_LIT( KGreaterThan, ">" );
+
+// Used in PhoneStateDefinitions*
+const TInt KPhoneStateCommonFirst = 0;
+const TInt KPhoneStateProtocolFirst = 100;
+
+// Used in PhoneViewCommandDefinitions*
+const TInt KPhoneViewCommandCommonFirst = 1; // can't be 0 due to mediator
+const TInt KPhoneViewCommandCarrierFirst = 1000;
+const TInt KPhoneViewResponseCommonFirst = 0;
+const TInt KPhoneViewResponseCarrierFirst = 1000;
+
+// Used in PhoneRss*
+const TInt KPhoneRssCommonFirst = 0;
+const TInt KPhoneRssProtocolFirst = 1000;
+
+// Used in CPhoneNoteController
+const TInt KPhoneMaxCharsInNote = 256;
+
+// Used in CPhoneCenRepProxy
+// Variant read only default value
+const TInt KPhoneVariantReadOnlyDefaultValue = 0x00000000;
+const TInt KPhoneCenRepObserversGranularity = 16;
+
+// Used in CPhonePubSubProxy
+const TInt KPhonePubSubProxyObserverArrayGranularity = 16;
+const TInt KPhonePubSubArrayGranularity = 16;
+
+// Used in CPhoneInCallIndicator
+const TInt KPhoneIncallIndicatorDefaultValue = 0;
+const TInt KPhoneIncallIndicatorArrayGranularity = 8;
+
+// Used in CPhoneApplicationExit
+// Default buffer size. Do not rely on this. Use MaxLength instead.
+const TInt KPhoneTemporaryBufferMaxLength = 1024;
+// UID range separator.
+const TInt KPhoneApplicationRangeSeparator = '-';
+// Drive identifier.
+const TInt KPhoneApplicationDriveIdentifier = ':';
+// Retry five times.
+const TInt KPhoneApplicationRetryCount = 5;
+// Interval between retry attempts.
+const TInt KPhoneApplicationRetryInterval = 100000;
+// Any application 
+_LIT( KPhoneApplicationAnyApp, "*" );
+// OOM idenfier.
+_LIT( KPhoneApplicationOom, "OOM" );
+
+// Emergency call id
+const TInt KEmergencyCallId = 7;
+
+// Conference call id
+const TInt KConferenceCallId = 8;
+
+// LifeTimer const
+const TInt KPhoneLifeTimerHoursLength   = 6;
+const TInt KPhoneLifeTimerMinutesLength = 2;
+const TInt KTimerTextLength             = 64;
+const TInt KTimerMinuteSeparator        = 2;
+
+//AudioVolume const
+// CONSTANTS
+const TInt KPhoneDefaultVolume = 4;
+
+const TInt KPhoneVolumeMinValue = 0;
+const TInt KPhoneVolumeMaxValue = 10;
+
+const TInt KPhoneVolumeWinsVolumeDivider = 10;
+
+// Used in CPhoneRemoteControlHandler
+#ifdef RD_UIKON_UNBRANCH
+// Volume repeat delay.
+const TInt KPhoneButtonRepeatDelay = KAknStandardKeyboardRepeatRate;
+#else // RD_UIKON_UNBRANCH
+// Volume repeat delay.
+const TInt KPhoneButtonRepeatDelay = (1000000/6);
+#endif // RD_UIKON_UNBRANCH
+
+// First voice call id
+const TInt KVoiceCallIdFirst = 0;
+
+// Video telephony call ids
+const TInt KVideoTelephonyCallId1 = 9;
+const TInt KVideoTelephonyCallId2 = 10;
+  
+// Used in MPhoneAudioPlayerObserver
+const TInt KPhoneAudioPlayerNotSpecified = -1;
+
+// Used in CPhoneAudioPlayer
+// One second pause between ringing repeats.
+const TInt KPhoneRingingRepeatsTrailPause = 1000000;
+// For ascending and descending, each level is played for 3 seconds
+const TInt KPhoneAudioAscendingRampDuration = 3000000;
+// For repeating the audio tone forever
+const TInt KPhoneMdaAudioToneRepeatForever = -2;
+// Value how much to shift variable
+const TInt KTimesToMultiply = 2; 
+
+// Used in CPhoneRingingTone
+_LIT( KPhoneRingingToneDriveZ, "z:" );
+#ifdef RD_VIDEO_AS_RINGING_TONE
+    _LIT( KPhoneRingingToneVideoMime, "video/*" );
+    _LIT( KPhoneRingingToneRealVideoMime, "*realmedia" );
+#endif    
+
+// Used in CPhoneRingingTonePlayerAO
+// Tts volumes
+const TInt KTtsVolumeBoost = 9;
+const TInt KTtsVolumeMin = 2;
+const TInt KTtsVolumeAscendingRepeat = 4;
+const TInt KPlayerVolumeAscendingRepeat = 3;
+const TInt KTtsVolumeAscendingDecrease = 2;
+
+// Header that is added to the text-to-say, that makes this text recognizable 
+// as Text-To-Speech data
+_LIT( KPhoneTtsHeader, "(tts)");
+// If the ringing tone for line1, line2 or personal ringing tone is not played
+// in 3 seconds, then try next. 
+const TInt KPhoneMaxRingingWaiting = 3000000;
+const TInt KPhoneTtsAscendingStep = 3000000; 
+// Delays between periods of Text-To-Speech playing
+// e.g. { 3 000 000, 4 000 000} means the following order of playiong:
+// 3 secs tone, then TTS, then 4 secs of tone, then TTS, then tone forever.
+const TInt KPhoneTtsDelays[] = { 3000000, 4000000 }; //2000000, 3000000
+// Amount of elements in KPhoneTtsDelays array.
+const TInt KPhoneTtsDelaysCount = sizeof( KPhoneTtsDelays ) / sizeof ( TInt );
+// Audio preference for Text to Speech
+const TUint KAudioPrefTextToSpeechCallHardCoded = 0x01370001;
+// Sound files
+#ifdef __WINS__
+    _LIT( KPhoneDefaultSoundFile, "z:test.wav" );
+    _LIT( KPhoneSilentSoundFile, "z:test.wav" );
+    _LIT( KPhoneBeepOnceSoundFile, "z:test.wav" );
+#else
+    _LIT( KPhoneDefaultSoundFile, "\\System\\Sounds\\Simple\\Nokia tune.wav" );
+    // Sequence for silent call ringing tone. Don't touch these sequence.
+    _LIT8( KPhoneNoSoundSequence, "\x00\x11\x0A\x05\xFC\x0A\x08\x40\x32\x0A\
+\xF7\x40\x64\x06\x0B" );
+    // Sequence for beep call ringing tone. Don't touch these sequence.
+    _LIT8( KPhoneBeepSequence, "\x00\x11\x0A\x0A\x08\x73\x0A\x40\x28\x0A\xF7\
+\x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B" );
+    // Sequence for unsecure VoIP call warning tone. Don´t touch these sequence.
+    _LIT8( KPhoneUnsecureVoIPCall, "\x00\x11\x0B\x67\x04\x40\x04\x67\x04\x40\
+\x04\x6C\x04\x40\x04\x6D\x04\x0B" );
+#endif // __WINS__
+
+// Used in CPhoneVideoPlayer
+const TInt KPhoneVideoMinVolumeLevel = 0;
+const TInt KPhoneVideoMaxVolumeLevel = 10;
+const TInt KPhoneVideoVolumeRampInterval = 3000000;
+const TInt KPhoneVideoVolumeRampStep = 1;
+const TInt KPhoneVideoSubQCCIFWidth = 128;
+const TInt KPhoneVideoSubQCCIFHeight = 96;
+
+const TInt KBaseScaleFactor = 100;
+const TInt KHalfBaseScale = 50;
+const TInt KFullScaleFactor = 1.0;
+const TInt KHalfScaleFactor = 0.5;
+const TInt KCentering = 2;
+
+
+// Used in mediator for receiving and sending events and commands
+const TUid KPhoneUiCategory = { 0x100058B3 };
+
+// Our mediator interface versions
+const TInt KCommandIfVersionMajor = 1;
+const TInt KCommandIfVersionMinor = 0;
+const TInt KCommandIfVersionBuild = 0;
+const TInt KEventIfVersionMajor = 1;
+const TInt KEventIfVersionMinor = 0;
+const TInt KEventIfVersionBuild = 0;
+
+// Mediator interface command's time out
+const TInt KPhoneUiMediatorIfTimeout = 10000;
+
+// Name of Call UI dll which is loaded polymorficly in CPhoneQueryController
+_LIT( KPhoneCaUiLoadedLib, "cauiengine.dll" );
+
+// CPhoneTextQuery constants
+const TInt KLeftCbaId = 0;
+const TInt KRightCbaId = 2;
+
+// Used in CPhoneNoteTimer
+// Time in milliseconds that the timer runs.
+const TInt KDtmfWaitNoteTimeoutValue = 100000;
+
+// Als line change timer 2,4 seconds.
+// Together with long keypress (0.6) seconds
+// it is 3 seconds like in the specification.
+const TInt KAlsLineChangeTimerValue = 2400000;
+
+// Wlan MAC address length, separator and formatter
+const TInt  KPhoneWlanMacAddressLength = 50;
+const TUint KPhoneWlanSeparator (':');
+_LIT( KWLanMACDataFormat, "%02x");
+
+// BTA Disconnect handler timeout
+// 1 minute in microseconds.
+const TInt KPhoneBtaaConnectionLostQueryTimeout = 60000000; 
+
+// Time cap between information note and reconnect query
+const TInt KInformationNoteDisplayTime = 3000000;
+
+// HELP
+_LIT( KINCAL_HLP_CALL_HANDLING, "INCAL_HLP_CALL_HANDLING" );
+_LIT( KINCAL_HLP_VIDEOCALL, "INCAL_HLP_VIDEO_CALL" );
+_LIT( KDATA_DIALER_HLP_MAIN, "DIALER_HLP_MAIN" );
+_LIT( KDATA_DIALER_HLP_SEND_DTMF, "DIALER_HLP_SEND_DTMF" );
+
+// Maximum length of file path for caller image theme
+const TInt KMaxFilePathLength = 256;
+
+// Used in Ringingtone handling
+const TInt Kkilo = 1024;
+
+// Allow name in call header in setup state after 1.5s
+const TInt KTimeoutAllowName = 1500000;
+
+// It enumerates different screen saver states.
+enum TPhoneScreensaverState
+    {
+    EPhoneScreensaverNotAllowed = 1,
+    EPhoneScreensaverAllowed = 0
+    };
+
+// VoIP variation
+const TInt KDynamicVoIPOff = 0;
+const TInt KDynamicVoIPOn = 1;
+
+// Max param lenght.
+const TInt KPhoneMaxParamLength = 10;
+
+// Video call setup failed query timeout
+const TInt KPhoneVideoCallSetupFailedQueryTimeout = 5; 
+
+// Key event value for long press
+const TInt EEventLongPress = 1100;
+
+#endif  // PHONECONSTANTS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonelogger.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Macro definition file for logging.
+*
+*/
+
+
+#ifndef __PHONELOGGER_H
+#define __PHONELOGGER_H
+
+// By default, logging will always be switched on.  Later, this may be 
+// removed, leaving it to individual source files to enable logging where 
+// needed.
+#define _LOGGING
+
+/*
+ Here we have 3 possible logging methods, or 2 and no logging at all.
+ Later you'll find logic that selects one of these. If you're not happy
+ with that logic in your case, throw it away and just #define your
+ favourite logging method. 
+ set PHONEUI_LOGGER_METHOD to NO_LOGGING to get no logging at all
+ set PHONEUI_LOGGER_METHOD to RDEBUG_LOGGING to get logging via RDebug::Print
+ set PHONEUI_LOGGER_METHOD to FILE_LOGGING to get logging to log file
+ */
+    
+ #define  NO_LOGGING        0   // No logging at all.
+ #define  RDEBUG_LOGGING    1   // Logging via RDebug::Print
+ #define  FILE_LOGGING      2   // Logging to log file
+
+/*
+ * here is default logic: if we have DEBUG build then select
+ * logging vua RDebug:Print. If anything else, have no logging at all
+ */
+#if ( defined (_DEBUG) && defined (_LOGGING) )
+#define PHONEUI_LOGGING_OUTPUT RDEBUG_LOGGING // <- Here is the place where you can set 
+                                 // debugging method.
+#else
+#define PHONEUI_LOGGING_OUTPUT NO_LOGGING
+#endif// INCLUDES
+
+// System includes.
+#include <e32std.h>
+#include "cphonelogger.h"
+
+#endif // __PHONELOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phoneloggerviewcommands.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,425 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Macro definition file for logging.
+*
+*/
+
+// Autogenerated from phoneloggerviewcommands.st by the stringtable tool - Do not edit
+
+#ifndef STRINGTABLE_PhoneLoggerviewCommands
+#define STRINGTABLE_PhoneLoggerviewCommands
+
+#include <stringpool.h>
+
+struct TStringTable;
+
+/** A String table */
+class PhoneLoggerviewCommands 
+    {
+public:
+    enum TStrings
+        {
+        /** EPhoneViewStartValue */
+        EPhoneViewStartValue,
+        /** EPhoneViewCreateNumberEntry */
+        EPhoneViewCreateNumberEntry,
+        /** EPhoneViewSetNumberEntryContent */
+        EPhoneViewSetNumberEntryContent,
+        /** EPhoneViewSendKeyEventToNumberEntry */
+        EPhoneViewSendKeyEventToNumberEntry,
+        /** EPhoneViewRemoveNumberEntry */
+        EPhoneViewRemoveNumberEntry,
+        /** EPhoneViewSetNumberEntryVisible */
+        EPhoneViewSetNumberEntryVisible,
+        /** EPhoneViewGetNumberFromEntry */
+        EPhoneViewGetNumberFromEntry,
+        /** EPhoneViewGetNumberEntryCount */
+        EPhoneViewGetNumberEntryCount,
+        /** EPhoneViewGetNumberEntryIsUsedStatus */
+        EPhoneViewGetNumberEntryIsUsedStatus,
+        /** EPhoneViewGetNumberEntryIsVisibleStatus */
+        EPhoneViewGetNumberEntryIsVisibleStatus,
+        /** EPhoneViewToggleNumberEntryAlphaNumericMode */
+        EPhoneViewToggleNumberEntryAlphaNumericMode,
+        /** EPhoneViewIsNumberEntryNumericMode */
+        EPhoneViewIsNumberEntryNumericMode,
+        /** EPhoneViewClearNumberEntryContent */
+        EPhoneViewClearNumberEntryContent,
+        /** EPhoneViewCreateCallHeader */
+        EPhoneViewCreateCallHeader,
+        /** EPhoneViewCreateEmergencyCallHeader */
+        EPhoneViewCreateEmergencyCallHeader,
+        /** EPhoneViewUpdateCallHeaderRemoteInfoData */
+        EPhoneViewUpdateCallHeaderRemoteInfoData,
+        /** EPhoneViewUpdateCallHeaderCallDuration */
+        EPhoneViewUpdateCallHeaderCallDuration,
+        /** EPhoneViewRemoveCallHeader */
+        EPhoneViewRemoveCallHeader,
+        /** EPhoneViewMenuBarOpen */
+        EPhoneViewMenuBarOpen,
+        /** EPhoneViewMenuBarClose */
+        EPhoneViewMenuBarClose,
+        /** EPhoneViewDimCbaCommand */
+        EPhoneViewDimCbaCommand,
+        /** EPhoneViewUpdateCba */
+        EPhoneViewUpdateCba,
+        /** EPhoneViewUpdateBubble */
+        EPhoneViewUpdateBubble,
+        /** EPhoneViewMenuPane */
+        EPhoneViewMenuPane,
+        /** EPhoneViewMenuBar */
+        EPhoneViewMenuBar,
+        /** EPhoneViewSetTitlePaneContent */
+        EPhoneViewSetTitlePaneContent,
+        /** EPhoneViewSetNaviPaneContent */
+        EPhoneViewSetNaviPaneContent,
+        /** EPhoneViewSetTitlePanePicture */
+        EPhoneViewSetTitlePanePicture,
+        /** EPhoneViewGetTitlePaneIsVisibleStatus */
+        EPhoneViewGetTitlePaneIsVisibleStatus,
+        /** EPhoneViewActivateAudioPathUIChanges */
+        EPhoneViewActivateAudioPathUIChanges,
+        /** EPhoneViewActivateAudioAvailabilityUIChanges */
+        EPhoneViewActivateAudioAvailabilityUIChanges,
+        /** EPhoneViewActivateMuteUIChanges */
+        EPhoneViewActivateMuteUIChanges,
+        /** EPhoneViewShowNote */
+        EPhoneViewShowNote,
+        /** EPhoneViewShowGlobalNote */
+        EPhoneViewShowGlobalNote,
+        /** EPhoneViewShowProgressNote */
+        EPhoneViewShowProgressNote,
+        /** EPhoneViewRemoveNote */
+        EPhoneViewRemoveNote,
+        /** EPhoneViewRemoveProgressNote */
+        EPhoneViewRemoveProgressNote,
+        /** EPhoneViewRemoveGlobalNote */
+        EPhoneViewRemoveGlobalNote,
+        /** EPhoneViewGetIsNoteVisible */
+        EPhoneViewGetIsNoteVisible,
+        /** EPhoneViewGetIsProgressNoteVisible */
+        EPhoneViewGetIsProgressNoteVisible,
+        /** EPhoneViewShowQuery */
+        EPhoneViewShowQuery,
+        /** EPhoneViewSetListQueryString */
+        EPhoneViewSetListQueryString,
+        /** EPhoneViewRemoveQuery */
+        EPhoneViewRemoveQuery,
+        /** EPhoneViewGetTextQueryContents */
+        EPhoneViewGetTextQueryContents,
+        /** EPhoneViewSetTopApplication */
+        EPhoneViewSetTopApplication,
+        /** EPhoneViewBringAppToForeground */
+        EPhoneViewBringAppToForeground,
+        /** EPhoneViewSendToBackground */
+        EPhoneViewSendToBackground,
+        /** EPhoneViewSetNeedToSendToBackgroundStatus */
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        /** EPhoneViewGetNeedToSendToBackgroundStatus */
+        EPhoneViewGetNeedToSendToBackgroundStatus,
+        /** EPhoneViewGetTopApplicationIsDisplayedStatus */
+        EPhoneViewGetTopApplicationIsDisplayedStatus,
+        /** EPhoneViewGetForegroundApplication */
+        EPhoneViewGetForegroundApplication,
+        /** EPhoneViewSetBackgroundImageBitmap */
+        EPhoneViewSetBackgroundImageBitmap,
+        /** EPhoneViewGetBackgroundImageBitmap */
+        EPhoneViewGetBackgroundImageBitmap,
+        /** EPhoneViewActivateApp */
+        EPhoneViewActivateApp,
+        /** EPhoneViewActivateAppView */
+        EPhoneViewActivateAppView,
+        /** EPhoneViewActivateAppViewWithCustomMessage */
+        EPhoneViewActivateAppViewWithCustomMessage,
+        /** EPhoneViewActivateAppViewConventional */
+        EPhoneViewActivateAppViewConventional,
+        /** EPhoneViewLaunchApplication */
+        EPhoneViewLaunchApplication,
+        /** EPhoneViewLaunchHelpApplication */
+        EPhoneViewLaunchHelpApplication,
+        /** EPhoneViewOpenMessageEditor */
+        EPhoneViewOpenMessageEditor,
+        /** EPhoneViewExitApplications */
+        EPhoneViewExitApplications,
+        /** EPhoneViewUpdateIncallIndicator */
+        EPhoneViewUpdateIncallIndicator,
+        /** EPhoneViewStartCapturingKey */
+        EPhoneViewStartCapturingKey,
+        /** EPhoneViewStopCapturingKey */
+        EPhoneViewStopCapturingKey,
+        /** EPhoneViewSetGlobalNotifiersDisabled */
+        EPhoneViewSetGlobalNotifiersDisabled,
+        /** EPhoneViewSetSpeedDialLocation */
+        EPhoneViewSetSpeedDialLocation,
+        /** EPhoneViewGetNumberFromSpeedDialLocation */
+        EPhoneViewGetNumberFromSpeedDialLocation,
+        /** EPhoneViewAssignSpeedDialLocation */
+        EPhoneViewAssignSpeedDialLocation,
+        /** EPhoneViewGetHoldFlag */
+        EPhoneViewGetHoldFlag,
+        /** EPhoneViewSetHoldFlag */
+        EPhoneViewSetHoldFlag,
+        /** EPhoneViewSetSoftRejectFlag */
+        EPhoneViewSetSoftRejectFlag,
+        /** EPhoneViewGetSoftRejectFlag */
+        EPhoneViewGetSoftRejectFlag,
+        /** EPhoneViewSetServiceCodeFlag */
+        EPhoneViewSetServiceCodeFlag,
+        /** EPhoneViewUpdateContact */
+        EPhoneViewUpdateContact,
+        /** EPhoneViewAddContact */
+        EPhoneViewAddContact,
+        /** EPhoneViewOpenSingleItemFetchDialog */
+        EPhoneViewOpenSingleItemFetchDialog,
+        /** EPhoneViewRemovePhoneDialogs */
+        EPhoneViewRemovePhoneDialogs,
+        /** EPhoneViewCreateConference */
+        EPhoneViewCreateConference,
+        /** EPhoneViewAddToConference */
+        EPhoneViewAddToConference,
+        /** EPhoneViewRemoveFromConference */
+        EPhoneViewRemoveFromConference,
+        /** EPhoneViewPrivateFromConference */
+        EPhoneViewPrivateFromConference,
+        /** EPhoneViewSelectedConfMember */
+        EPhoneViewSelectedConfMember,
+        /** EPhoneViewOpenConferenceList */
+        EPhoneViewOpenConferenceList,
+        /** EPhoneViewGetConferenceListVisibleFlag */
+        EPhoneViewGetConferenceListVisibleFlag,
+        /** EPhoneViewGetCallState */
+        EPhoneViewGetCallState,
+        /** EPhoneViewGetCallIdByState */
+        EPhoneViewGetCallIdByState,
+        /** EPhoneViewMoveHighLightInList */
+        EPhoneViewMoveHighLightInList,
+        /** EPhoneViewGetCountOfActiveCalls */
+        EPhoneViewGetCountOfActiveCalls,
+        /** EPhoneViewSetNaviPaneAudioVolume */
+        EPhoneViewSetNaviPaneAudioVolume,
+        /** EPhoneViewShowNaviPaneAudioVolume */
+        EPhoneViewShowNaviPaneAudioVolume,
+        /** EPhoneViewHideNaviPaneAudioVolume */
+        EPhoneViewHideNaviPaneAudioVolume,
+        /** EPhoneViewGetIsConference */
+        EPhoneViewGetIsConference,
+        /** EPhoneViewGetCallExistsInConference */
+        EPhoneViewGetCallExistsInConference,
+        /** EPhoneViewRemoveAllCallHeaders */
+        EPhoneViewRemoveAllCallHeaders,
+        /** EPhoneViewPlayRingTone */
+        EPhoneViewPlayRingTone,
+        /** EPhoneViewMuteRingTone */
+        EPhoneViewMuteRingTone,
+        /** EPhoneViewStopRingTone */
+        EPhoneViewStopRingTone,
+        /** EPhoneViewMuteRingToneOnAnswer */
+        EPhoneViewMuteRingToneOnAnswer,
+        /** EPhoneViewCipheringInfoChange */
+        EPhoneViewCipheringInfoChange,
+        /** EPhoneViewUpdateMaxConfMemberFlag */
+        EPhoneViewUpdateMaxConfMemberFlag,
+        /** EPhoneViewCloseFSW */
+        EPhoneViewCloseFSW,
+        /** EPhoneViewLaunchRfsDeep */
+        EPhoneViewLaunchRfsDeep,
+        /** EPhoneViewLaunchRfsNormal */
+        EPhoneViewLaunchRfsNormal,
+        /** EPhoneViewUpdateView */
+        EPhoneViewUpdateView,
+        /** EPhoneViewOpenSoftRejectEditor */
+        EPhoneViewOpenSoftRejectEditor,
+        /** EPhoneViewSendMessage */
+        EPhoneViewSendMessage,
+        /** EPhoneViewSetBlockingDialogStatus */
+        EPhoneViewSetBlockingDialogStatus,
+        /** EPhoneViewSetPhoneNumberAvailableInPhoneEngine */
+        EPhoneViewSetPhoneNumberAvailableInPhoneEngine,
+        /** EPhoneViewSetSecurityMode */
+        EPhoneViewSetSecurityMode,
+        /** EPhoneViewGetSecurityModeStatus */
+        EPhoneViewGetSecurityModeStatus,
+        /** EPhoneViewSetStatusPaneVisible */
+        EPhoneViewSetStatusPaneVisible,
+        /** EPhoneViewEnableKeyLock */
+        EPhoneViewEnableKeyLock,
+        /** EPhoneViewEnableKeyLockWithoutNote */
+        EPhoneViewEnableKeyLockWithoutNote,
+        /** EPhoneViewLaunchFaxModem */
+        EPhoneViewLaunchFaxModem,
+        /** EPhoneViewUpdateFSW */
+        EPhoneViewUpdateFSW,
+        /** EPhoneViewIsQuery */
+        EPhoneViewIsQuery,
+        /** EPhoneViewBringIdleToForeground */
+        EPhoneViewBringIdleToForeground,
+        /** EPhoneViewSetIdleTopApplication */
+        EPhoneViewSetIdleTopApplication,
+        /** EPhoneViewBeginUpdate */
+        EPhoneViewBeginUpdate,
+        /** EPhoneViewEndUpdate */
+        EPhoneViewEndUpdate,
+        /** EPhoneViewSetConfrenceOptionsFlag */
+        EPhoneViewSetConfrenceOptionsFlag,
+        /** EPhoneViewRemoveConferenceBubble */
+        EPhoneViewRemoveConferenceBubble,
+        /** EPhoneViewGetSoftRejectWindowGroupId */
+        EPhoneViewGetSoftRejectWindowGroupId,
+        /** EPhoneViewSetTouchPaneButtons */
+        EPhoneViewSetTouchPaneButtons,
+        /** EPhoneViewSetTouchPaneVisible */
+        EPhoneViewSetTouchPaneVisible,
+        /** EPhoneViewEnableTouchButton */
+        EPhoneViewEnableTouchButton,
+        /** EPhoneViewDisableTouchButton */
+        EPhoneViewDisableTouchButton,
+        /** EPhoneResetTouchButtons */
+        EPhoneResetTouchButtons,
+        /** EPhoneViewGetIsConferenceInSelectionMode */
+        EPhoneViewGetIsConferenceInSelectionMode,
+        /** EPhoneViewIsStraightCallToVideoMailBox */
+        EPhoneViewIsStraightCallToVideoMailBox,
+        /** EPhoneViewSetDtmfDialerViewVisible */
+        EPhoneViewSetDtmfDialerViewVisible,
+        /** EPhoneViewSetRetrictedDialer */
+        EPhoneViewSetRetrictedDialer,
+        /** EPhoneViewIsConferenceInExpandedMode */
+        EPhoneViewIsConferenceInExpandedMode,
+        /** EPhoneViewIsMenuBarVisible */
+        EPhoneViewIsMenuBarVisible,
+        /** EPhoneViewGetBlockingDialogStatus */
+        EPhoneViewGetBlockingDialogStatus,
+        /** EPhoneViewYesSingleItemFetch */
+        EPhoneViewYesSingleItemFetch,
+        /** EPhoneViewNoSingleItemFetch */
+        EPhoneViewNoSingleItemFetch,
+        /** EPhoneViewGetLocalizedNumberFromEntry */
+        EPhoneViewGetLocalizedNumberFromEntry,
+        /** EPhoneViewIsNoteActive */
+        EPhoneViewIsNoteActive,
+        /** EPhoneViewOpenNumberEntry */
+        EPhoneViewOpenNumberEntry,
+        /** EPhoneViewOpenCallHandling */
+        EPhoneViewOpenCallHandling,
+        /** EPhoneViewGetConferenceAndSingleFlag */
+        EPhoneViewGetConferenceAndSingleFlag,
+        /** EPhoneViewSetConferenceAndSingleFlag */
+        EPhoneViewSetConferenceAndSingleFlag,
+        /** EPhoneViewSetVideoCallFlag */
+        EPhoneViewSetVideoCallFlag,
+        /** EPhoneViewSetDtmfOptionsFlag */
+        EPhoneViewSetDtmfOptionsFlag,
+        /** EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery */
+        EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery,
+        /** EPhoneViewGetAudioVolumeLevel */
+        EPhoneViewGetAudioVolumeLevel,
+        /** EPhoneViewIsIdleTopApp */
+        EPhoneViewIsIdleTopApp,
+        /** EPhoneViewUpdateToolbar */
+        EPhoneViewUpdateToolbar,
+        /** EPhoneViewSetControlAndVisibility */
+        EPhoneViewSetControlAndVisibility,
+        /** EPhoneViewAllowWaitingCallHeader */
+        EPhoneViewAllowWaitingCallHeader,
+        /** EPhoneViewBeginTransEffect */
+        EPhoneViewBeginTransEffect,
+        /** EPhoneViewEndTransEffect */
+        EPhoneViewEndTransEffect,
+        /** EPhoneViewSetDialerControlVisible */
+        EPhoneViewSetDialerControlVisible,
+        /** EPhoneViewCloseSingleItemFetchDialog */
+        EPhoneViewCloseSingleItemFetchDialog,
+        /** EPhoneViewGetActivatePreviousApp */
+        EPhoneViewGetActivatePreviousApp,
+        /** EPhoneViewActivatePreviousApp */
+        EPhoneViewActivatePreviousApp,
+        /** EPhoneViewSetPointerCapture */
+        EPhoneViewSetPointerCapture,
+        /** EPhoneViewSetSendKeyDialerActivationFlag */
+        EPhoneViewSetSendKeyDialerActivationFlag,
+        /** EPhoneViewPrepareIcons */
+        EPhoneViewPrepareIcons,
+        /** EPhoneViewKeypadAudioEnabled */
+        EPhoneViewKeypadAudioEnabled,
+        /** EPhoneViewKeypadAudioDisabled */
+        EPhoneViewKeypadAudioDisabled,
+        /** EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel */
+        EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel,
+        /** EPhoneViewRemoveDtmfNote */
+        EPhoneViewRemoveDtmfNote,
+        /** EPhoneViewUpdatePhoneIconToFSW */
+        EPhoneViewUpdatePhoneIconToFSW,
+        /** EPhoneViewSetEikonNotifiersDisabled */
+        EPhoneViewSetEikonNotifiersDisabled,
+        /** EPhoneViewCancelAllNotications */
+        EPhoneViewCancelAllNotications,
+        /** EPhoneViewSetVideoCallDTMFVisibilityFlag */
+        EPhoneViewSetVideoCallDTMFVisibilityFlag,
+        /** EPhoneViewIsKeyLockEnabled */
+        EPhoneViewIsKeyLockEnabled,
+        /** EPhoneViewDisableKeyLock */
+        EPhoneViewDisableKeyLock,
+        /** EPhoneViewLoadPlugins */
+        EPhoneViewLoadPlugins,
+        /** PhoneViewServiceSelection */
+        PhoneViewServiceSelection,
+        /** EPhoneViewOpenVirtualKeyBoard */
+        EPhoneViewOpenVirtualKeyBoard,
+        /** EPhoneViewUpdateNoteSoftkeys */
+        EPhoneViewUpdateNoteSoftkeys,
+        /** EPhoneViewShowCustomizedDialer */
+        EPhoneViewShowCustomizedDialer,
+        /** EPhoneViewHideCustomizedDialer */
+        EPhoneViewHideCustomizedDialer,
+        /** EPhoneViewGetCustomizedDialerMenuResourceId */
+        EPhoneViewGetCustomizedDialerMenuResourceId,
+        /** EPhoneViewGetCustomizedDialerCbaResourceId */
+        EPhoneViewGetCustomizedDialerCbaResourceId,
+        /** EPhoneViewCreatePhoneBookServices */
+        EPhoneViewCreatePhoneBookServices,
+        /** EPhoneViewDisableKeyLockWithoutNote */
+        EPhoneViewDisableKeyLockWithoutNote,
+        /** EPhoneViewGetKeyLockStatus */
+        EPhoneViewGetKeyLockStatus,
+        /** EPhoneViewSetNumberEntryObserver */
+        EPhoneViewSetNumberEntryObserver,
+        /** EPhoneViewGetSingleItemFetchType */
+        EPhoneViewGetSingleItemFetchType,
+        /** EPhoneViewRemoveGlobalWaitNote */
+        EPhoneViewRemoveGlobalWaitNote,
+        /** EPhoneViewSetPhoneCustomization */
+        EPhoneViewSetPhoneCustomization,
+        /** EPhoneViewSetViewCustomization */
+        EPhoneViewSetViewCustomization,
+        /** EPhoneViewSetButtonCustomization */
+        EPhoneViewSetButtonCustomization,
+        /** EPhoneViewUpdateContactByString */
+        EPhoneViewUpdateContactByString,
+        /** EPhoneViewAddContactByString */
+        EPhoneViewAddContactByString,
+        /** EPhoneViewIsActiveNoteDissmissableByKeyEvent */
+        EPhoneViewIsActiveNoteDissmissableByKeyEvent,
+        /** EPhoneViewSetNoConnectedCalls */
+        EPhoneViewSetNoConnectedCalls,
+        /** EPhoneViewIsDTMFEditorVisible */
+        EPhoneViewIsDTMFEditorVisible,
+        /** , // Don't remove this, this should always be the last in list. */
+        EPhoneAmountOfCommands
+        };
+    static const TStringTable Table;    
+    };
+
+#endif // STRINGTABLE_PhoneLoggerviewCommands
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonemediatorpackagetypes.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Package types which may be sent via Mediator.
+*
+*/
+
+
+#ifndef PHONEMEDIATORPACKAGETYPES_H
+#define PHONEMEDIATORPACKAGETYPES_H
+
+// INCLUDES
+#include <e32base.h>
+#include "tphonecommandparam.h"
+
+// CONSTANTS
+const TInt KPhoneDescriptorSize = 200;
+
+// DATA TYPES
+class TCallIdAndCommandParam
+    {
+    public:
+        TInt iCallId;
+        TPhoneCommandParam iCommandParam;   
+    };
+    
+class TCallIdAndTDesC
+    {
+    public:
+        TInt iCallId;
+        TBuf<KPhoneDescriptorSize> iMessage;        
+    };
+
+typedef TPckgBuf<TInt> TCallIdPackage;
+typedef TPckgBuf<TPhoneCommandParam> TCommandParamPackage;
+typedef TPckgBuf<TCallIdAndCommandParam> TCallIdAndCommandParamPackage;
+typedef TPckgBuf<TCallIdAndTDesC> TCallIdAndTDesCPackage;
+    
+#endif // PHONEMEDIATORPACKAGETYPES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phoneresourceids.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,400 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Old Symbian resource ids.
+*
+*/
+
+#ifndef PHONERESOURCEIDS_H
+#define PHONERESOURCEIDS_H
+
+enum
+    {
+    R_PHONE_ERROR_NUMBER_BUSY = 1,
+    R_PHONE_SS_NOTIFICATION_MOCAL_WAITING_TEXT,
+    R_PHONEUI_IDLE_MENUBAR,
+    R_PHONEUIDIALER_NUMBERACQ_MENUBAR,
+    R_PHONEUI_NUMBERACQ_VIDEOCALL_MENUBAR,
+    R_PHONEUI_NUMBERACQ_MENUBAR,
+    R_PHONEUI_NUMBERACQ_OK_VIDEOCALL_MENUBAR,
+    R_PHONEUI_NUMBERACQ_OK_MENUBAR,
+    R_PHONEUI_CALLHANDLING_MENUBAR,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_MENUBAR,//10
+    R_PHONEUIDIALER_NUMBERACQ_EMERGENCY_MENUBAR,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_INCOMINGCALL_MENUBAR,
+    R_PHONEUI_INCOMINGVIDEOCALL_MENUBAR,
+    R_PHONEUI_INCOMINGCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_INCOMINGVIDEOCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_ALERTINGCALL_MENUBAR,
+    R_PHONEUI_ALERTINGCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_ACTIVEANDHELD_MENUBAR,
+    R_PHONEUI_ACTIVEANDHELD_MENUBAR_WITH_NUMBERENTRY,//20
+    R_PHONEUI_CALLWAITING_MENUBAR, 
+    R_PHONEUI_CALLWAITING_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_CALLACTIVEHELDANDWAITING_MENUBAR,
+    R_PHONEUI_CALLACTIVEHELDANDWAITING_MENUBAR_VARIED,
+    R_PHONEUI_CALLACTIVEHELDANDWAITING_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_ALERTINGANDHELDCALL_MENUBAR,
+    R_PHONEUI_ALERTINGANDHELDCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_ALERTINGANDCONFHELDCALL_MENUBAR,
+    R_PHONEUI_ALERTINGANDCONFHELDCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_ALERTINGWAITINGANDHELDCONFCALL_MENUBAR,//30
+    R_PHONEUI_ALERTINGWAITINGANDHELDCONFCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_ALERTINGHELDANDWAITINGCALL_MENUBAR,
+    R_PHONEUI_ALERTINGHELDANDWAITINGCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_ALERTINGANDWAITINGCALL_MENUBAR,
+    R_PHONEUI_TOUCH_CONFCALL_MENUBAR,
+    R_PHONEUI_CONFCALL_MENUBAR,
+    R_PHONEUI_CONFCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_TOUCH_CONFANDCALLWAITING_MENUBAR,
+    R_PHONEUI_CONFANDCALLWAITING_MENUBAR,
+    R_PHONEUI_CONFANDCALLWAITING_MENUBAR_WITH_NUMBERENTRY,//40
+    R_PHONEUI_TOUCH_ACTIVECONFANDHELD_MENUBAR,
+    R_PHONEUI_ACTIVECONFANDHELD_MENUBAR,
+    R_PHONEUI_ACTIVECONFANDHELD_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_TOUCH_ACTIVEANDHELDCONF_MENUBAR,
+    R_PHONEUI_ACTIVEANDHELDCONF_MENUBAR,
+    R_PHONEUI_ACTIVEANDHELDCONF_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_TOUCH_CONFCALLACTIVEHELDANDWAITING_MENUBAR,
+    R_PHONEUI_CONFCALLACTIVEHELDANDWAITING_MENUBAR,
+    R_PHONEUI_CONFCALLACTIVEHELDANDWAITING_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_TOUCH_CALLACTIVEHELDCONFANDWAITING_MENUBAR,//50
+    R_PHONEUI_CALLACTIVEHELDCONFANDWAITING_MENUBAR,
+    R_PHONEUI_CALLACTIVEHELDCONFANDWAITING_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_PARTICIPANT_LIST_MENUBAR,
+    R_PHONEUI_PARTICIPANT_LIST_DROP_MENUBAR,
+    R_PHONE_INCALL_VIDEOCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONE_INCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUIDIALER_DTMFVIEW_MENUBAR,
+    R_PHONEUI_EMPTY_CBA,
+    R_PHONEUI_EMERGENCY_IDLE_CBA,
+    R_PHONEUI_SEND_DTMF_NO_CBA,//60
+    R_PHONEUI_SEND_DTMF_EMPTY_EDIT_BOX_CBA,
+    R_PHONEUI_SEND_DTMF_NORMAL_EDIT_BOX_CBA,
+    R_PHONEUI_DTMF_SPEED_DIAL_NORMAL_EDIT_BOX_CBA,
+    R_PHONEUI_NUMBERACQ_VIDEOCALL_CBA,
+    R_PHONEUI_DIALER_CBA,
+    R_PHONEUI_NUMBERACQ_CBA,
+    R_PHONEUI_INCALL_NUMBERACQ_CBA,
+    R_PHONEUI_SETTINGSUI_CBA,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_CBA,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_TOIHF_CBA,//70
+    R_PHONEUI_CALLHANDLING_CALLSETUP_TOHANDSET_CBA,
+    R_PHONEUI_INCALL_DIALER_CBA,
+    R_PHONEUI_CALLHANDLING_INCALL_CBA,
+    R_PHONEUI_CALLHANDLING_INCALL_NOIHF_CBA,
+    R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA,
+    R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA,
+    R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA,
+    R_PHONEUI_CALLHANDLING_INCALL_BTAA_CBA,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_CBA,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_HANDSET_CBA,//80
+    R_PHONEUI_CALLHANDLING_EMERGENCY_NOIHF_CBA,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_NO_OPTIONS_CBA,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_NO_OPTIONS_HANDSET_CBA,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_NO_OPTIONS_NOIHF_CBA,
+    R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA,
+    R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA,
+    R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA,
+    R_PHONEUI_CALLHANDLING_CALLWAITING_CBA,
+    R_PHONEUI_CALLHANDLING_NEW_CALL_FIND_CBA,
+    R_PHONEUI_CALLHANDLING_NEW_CALL_CALL_CBA,//90
+    R_PHONEUI_CALLHANDLING_NEW_CALL_SWAP_CBA,
+    R_PHONEUI_NEW_CALL_FETCH_CBA,
+    R_PHONEUI_EXIT_EMERGENCY_MODE_CBA,
+    R_PHONEUI_EMERGENCY_MODE_NOTE_CBA,
+    R_CONFERENCE_DROPPARTICIPANT_SOFTKEYS,
+    R_CONFERENCE_PRIVATE_SOFTKEYS,
+    R_PHONEUI_CALLHANDLING_INCALL_ENDACTIVE_CBA,
+    R_NOTETEXT_NUMBER_NOT_IN_USE,
+    R_NOTETEXT_NUMBER_BARRED,
+    R_NOTETEXT_NUMBER_NOT_IN_CUG,//100
+    R_NOTETEXT_NO_ANSWER,
+    R_NOTETEXT_NETWORK_BUSY,
+    R_NOTETEXT_OUT_OF_RANGE,
+    R_NOTETEXT_CALL_FAILED,
+    R_NOTETEXT_SIGNAL_FADED,
+    R_NOTETEXT_ERROR_IN_CONNECTION,
+    R_NOTETEXT_INVALID_PHONENUMBER,
+    R_NOTETEXT_EMPTY_SIM_LOCATION,
+    R_PHONEUI_CONFERENCE_CALL,
+    R_PHONE_ERROR_EMERGENCY_CALLS_ONLY,
+    R_PHONE_ERROR_CALL_NOT_ALLOWED,
+    R_PHONE_ERROR_CALL_NOT_ALLOWED_FDN,
+    R_PHONE_ERROR_CHECK_NETWORK_SERVICES,
+    R_PHONE_ERROR_REQUEST_REJECTED,
+    R_ERROR_NOTE_NOT_ALLOWED,
+    R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED,
+    R_PHONEUI_NO_VIDEO_NETWORK,
+    R_PHONEUI_VIDEO_CALL_INCOMING,
+    R_PHONEUI_VIDEO_CALL_INCOMING_SHORT,
+    R_PHONEUI_VIDEOCALL_2G_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_VIDEOCALL_MENUBAR,
+    R_PHONEUI_VIDEOCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_VIDEOCALL_WAITING_MENUBAR,
+    R_PHONEUI_WAITING_LOCK_MENUBAR,
+    R_PHONEUI_TWOSINGLES_WAITING_LOCK_MENUBAR,
+    R_PHONEUI_VIDEOCALL_WAITING_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_SOFTKEYS_EMPTY_BACK,
+//    R_AVKON_IHF_ACTIVATED_CONFIRMATION_NOTE_TEXT,
+//    R_AVKON_IHF_DEACTIVATED_CONFIRMATION_NOTE_TEXT,
+    R_NOTE_TEXT_CONF_AUDIOS_HANDSET,
+    R_NOTE_TEXT_CONF_AUDIOS_BT_ACCESSORY,
+    R_PHONEUI_STRING_LIST,
+    R_NOTETEXT_ALL_INCOMING_CALLS_DIVERTED,
+    R_NOTETEXT_ACTIVE_DIVERTS,
+    R_PHONEUI_DEFAULT_SKEY_LIST,
+    R_PHONEUI_EMERGENCY_CALL_HEADER,
+    R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE,
+    R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE_TOIHF,
+    R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE_TOHANDSET,
+    R_PHONE_EMERGENCY_MODE_INFORMATION_NOTE,
+    R_PHONE_EXIT_EMERGENCY_MODE_QUERY,
+    R_PHONEUI_MTCAL_INCOMING_CALL,
+    R_PHONEUI_MTCAL_INCOMING_CALL_SHORT,
+    R_PHONEUI_OUT_GOING_CALL,
+    R_PHONEUI_OUT_GOING_CALL_SHORT,
+    R_PHONEUI_OUT_GOING_VIDEO_CALL,
+    R_PHONEUI_OUT_GOING_VIDEO_CALL_SHORT,
+//    R_QTN_TIME_DURAT_LONG_WITH_ZERO,
+    R_PHONEUI_SEND_DTMF_QUERY,
+    R_PHONEUI_SENDING_DTMF_WAIT_NOTE,
+    R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT,
+    R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY,
+    R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT,
+    R_PHONEUI_TITLE_IN_DTMF_FETCH,
+    R_PHONEUI_DTMF_SPEED_DIAL_NUMBER_QUERY,
+    R_ERROR_NOTE_SPEED_DIAL_NOT_ASSIGNED,
+    R_ERROR_NOTE_INVALID_SPEED_DIAL,
+    R_PHONEUI_ALS_CONFIRMATION_QUERY,
+    R_PHONEUI_LINE_BLOCKING_NOTE_TEXT,
+    R_PHONEUI_MTCAL_INCOMING_LINE2,
+    R_PHONEUI_MTCAL_WAITING_NUMBER_LINE2,
+    R_PHONEUI_MTCAL_ARRIVING_NUMBER_LINE2,
+    R_PHONEUI_MULTC_WAITING,
+    R_PHONEUI_MULTC_INFO_WAIT_WITHOUT,
+    R_PHONEUI_MULTC_INFO_WAIT_WITH,
+    R_PHONEUI_GPRS_CONN_IN_PROGRESS,
+    R_PHONEUI_MULTC_WAITING_SHORT,
+    R_PHONEUI_NEW_CALL_PHONE_NUMBER_EDITOR,
+    R_PHONEUI_TITLE_IN_NEW_CALL_FETCH,
+    R_PHONEUI_IDLE_APPS,
+    R_PHONE_DISCONNECTING_NETWORK_WAIT_NOTE,
+    R_PHONE_INCALL_MUTED_PANE,
+    R_PHONEUI_INCALL_CALL_NUMBER,
+    R_PHONEUI_INCALL_CALL_DISCONNECTED,
+    R_PHONE_ERROR_CALL_IN_PROGRESS,
+    R_CONFERENCE_DROPPARTICIPANT_DIALOG,
+    R_CONFERENCE_PRIVATE_DIALOG,
+    R_PHONEUI_AUTOMATICREDIAL_WAIT_NOTE,
+    R_PHONE_INFORMATION_NOTE,
+    R_PHONE_INFORMATION_NOTE_WITH_WAIT,
+    R_PHONE_ERROR_NOTE,
+    R_PHONE_WARNING_NOTE,
+    R_PHONE_CONFIRMATION_NOTE,
+    R_PHONE_IMEI_STRING,
+    R_PHONE_SECURITY_INFORMATION_NOTE,
+    R_PHONE_BT_DEV_ADDRESS,
+    R_INCAL_INFO_HOLD_TEXT,
+    R_INCAL_REMOTE_ACTIVE_TEXT,
+    R_INCAL_REMOTE_CREATE_CONFERENCE_TEXT,
+    R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT,
+    R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT,
+    R_INCAL_INFO_HOLD_CLI_TEXT,
+    R_INCAL_INFO_CONF_HOLD_TEXT,
+    R_INCAL_INFO_HOLD_NOCLI_TEXT,
+    R_MULTC_INFO_CONFERENCE_TEXT,
+    R_PHONEUI_INCALL_CALL_HELD,
+    R_MULTC_UNHOLD_DONE_TEXT,
+    R_REQUESTING_WAIT_NOTE,
+    R_MULTC_CLI_UNHOLD_DONE_TEXT,
+    R_NOTETEXT_DIVERTING,
+    R_NOTETEXT_DIVERTING_INCOMING_CALL,
+    R_NOTETEXT_CALL_BARRINGS,
+    R_PHONEUI_MTCAL_CLI_WITHHELD,
+    R_PHONEUI_NOTE_TEXT_POST_CALL_SUMMARY,
+    R_PHONEUI_NOTE_TEXT_POST_CALL_DURATION,
+    R_PHONEUI_IDLE_TIME_FORMAT,
+    R_PHONEUI_LIFE_TIMER_STRING,
+    R_PHONEUI_NOTE_TEXT_PHONE_ENGINE_FAILED_AT_STARTUP,
+    R_PHONE_MTCAL_CLI_PAYPHONE,
+    R_PHONE_ERROR_CALL_BARRED_IN_CUG,
+    R_PHONE_ERROR_SELECT_CUG,
+    R_PHONE_ERROR_CUG_UNKNOWN,
+    R_PHONE_ERROR_NOT_POSSIBLE_IN_CUG,
+    R_PHONE_ERROR_CHECK_CUG,
+    R_PHONE_ERROR_CHECK_CLIR,
+    R_PHONE_SS_NOTIFICATION_CLIR_SUPPR_REJECT_TEXT,
+    R_PHONE_WLAN_MAC_STRING,
+    R_PHONE_TEXT_COLP_CONNECTED,
+    R_PHONE_BT_LOOPBACK_ENABLED_STRING,
+    R_PHONE_BT_LOOPBACK_DISABLED_STRING,
+    R_PHONE_LINE_BLOCKING_NOTE,
+    R_PHONE_INCALL_QUERY_SWITCH_TO_VIDEO,
+    R_PHONE_INCALL_QUERY_SWITCH_TO_VOICE,
+    R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT,
+    R_PHONE_INCALL_INFO_VIDEO_CALL_NOT_ALLOWED_DURING_RESTORE,
+    R_PHONEUI_SIM_REJECTED,
+    R_PHONEUI_SIM_UNACCEPTED,
+    R_PHONEUI_SIM_REMOVED,
+    R_PHONEUI_REBOOT_REQUIRED,
+    R_PHONEUI_VIDEO_CALL_NOT_POSSIBLE,
+    R_PHONEUI_CONTINUE_IN_HANDSET,
+    R_PHONEUI_CONTINUE_IN_LOUDSPEAKER,
+//    R_AVKON_SOFTKEYS_YES_NO,
+    R_PHONEUI_ALERTINGVIDEOCALL_MENUBAR,
+    R_PHONEUI_CALLCOMING_SOFTKEYS_WHEN_SLIDER,
+    R_PHONEUI_CALLCOMING_SOFTKEYS_WHEN_SILENT_SLIDER,
+    R_PHONEUI_SOFTKEYS_OPTIONS_SOFTREJECT_SLIDER,
+    R_PHONE_INCALL_INFO_VIDEO_CALL_SETUP_FAILED,
+    R_PHONE_ERROR_NO_SERVICE,
+    R_PHONEUI_INCALL_BUTTONS,
+    R_PHONEUI_TWO_SINGLES_BUTTONS,
+    R_PHONEUI_CONFERENCE_BUTTONS,
+    R_PHONEUI_PARTICIPANT_LIST_BUTTONS,
+    R_PHONEUI_CONFERENCE_AND_SINGLE_BUTTONS,
+    R_PHONEUI_CONFERENCE_AND_HELD_SINGLE_BUTTONS,
+    R_PHONEUI_EMERGENCY_CALL_BUTTONS,
+    R_CONFERENCE_PARTICIPANT_LIST_SOFTKEYS,
+    R_PHONEUI_BT_TOGGLE_BUTTON,
+    R_PHONEUI_IHF_TOGGLE_BUTTON,
+    R_PHONEUI_INCOMING_CALL_BUTTONS,
+    R_PHONEUI_CALL_SETUP_BUTTONS,
+    R_PHONEUI_WAITING_CALL_BUTTONS,
+    R_PHONEUI_CALL_SETUP_AND_SINGLE_BUTTONS,
+    R_CALL_INFO_CAUSE_VALUE3,
+    R_CALL_INFO_CAUSE_VALUE16,
+    R_CALL_INFO_CAUSE_VALUE18,
+    R_CALL_INFO_CAUSE_VALUE21,
+    R_CALL_INFO_CAUSE_VALUE22,
+    R_CALL_INFO_CAUSE_VALUE31,
+    R_CALL_INFO_CAUSE_VALUE34,
+    R_CALL_INFO_CAUSE_VALUE38,
+    R_CALL_INFO_CAUSE_VALUE50,
+    R_CALL_INFO_CAUSE_VALUE55,
+    R_CALL_INFO_CAUSE_VALUE57,
+    R_CALL_INFO_CAUSE_VALUE58,
+    R_CALL_INFO_CAUSE_VALUE88,
+    R_CALL_INFO_CAUSE_VALUE127,
+    R_CALL_INFO_NOT_SUPPORTED,
+    R_CALL_INFO_SERVICE_NOT_AVAILABLE,
+    R_PHONE_DTMF_LIST_QUERY,
+    R_PHONE_TTY_INFO_NO_AUDIO_CONTROL,
+    R_DIALER_ADD_TO_CONTACTS_SELECTION_LIST_QUERY,
+    R_PHONEUI_DTMFDIALER_SOFTKEYS_OPTIONS_CANCEL,
+    R_PHONEUI_DIALER_NUMBERENTRY_PROMPT_TEXT,
+    R_PHONEUI_MTCAL_CALL,
+    R_NOTE_INCAL_QUERY_VCALL_FAILED,
+    R_NOTE_TEXT_CLIR_CHANGE,
+    R_NOTE_TEXT_CUG_IN_USE,
+    R_PHONEUI_MTCAL_DIVERTED_CALL,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_ENDOUTGOING_CBA,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_TOIHF_DTMFDIALER_CBA,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_TOIHF_ENDOUTGOING_CBA,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_TOHANDSET_DTMFDIALER_CBA,
+    R_PHONEUI_CALLHANDLING_CALLSETUP_TOHANDSET_ENDOUTGOING_CBA,
+    R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE_EMPTY_DIALER,
+    R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU,
+    R_PHONEUI_NUMBERACQ_OPTIONS_MENU,
+    R_PHONEUIDIALER_OPTIONS_MENU,
+    R_PHONEUI_CALLHANDLING_INCALL_OPTIONS_MENU,
+    R_PHONEUI_CALLWAITING_OPTIONS_MENU,
+    R_PHONEUI_ACTIVEANDHELDCALL_OPTIONS_MENU,
+    R_PHONEUI_ACTIVEANDHELDCONFCALL_OPTIONS_MENU,
+    R_PHONEUI_CALLACTIVEHELDANDWAITING_OPTIONS_MENU,
+    R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO,
+    R_PHONEUI_CALLCOMING_SWIVEL_CLOSED_CBA,
+    R_PHONEUI_CALLCOMING_SILENT_SWIVEL_CLOSED_CBA,
+    R_PHONEUI_WAITING_ANSWER_SWIVEL_CLOSED_CBA,
+    R_PHONEUI_WAITING_REPLACE_SWIVEL_CLOSED_CBA,
+    R_PHONEUI_ALERTINGANDWAITINGCALL_MENUBAR_WITH_NUMBERENTRY,
+    R_PHONEUI_NUMBERACQ_MENUBAR_VOIP,
+    R_PHONEUI_NUMBERACQ_MENUBAR_VOIP_WITH_SERVICE_NUMBER,
+    R_PHONEUI_NUMBERACQ_OK_MENUBAR_VOIP,
+    R_PHONEUI_NUMBERACQ_OK_MENUBAR_VOIP_WITH_SERVICE_NUMBER,
+    R_PHONEUI_NUMBERACQ_INTERNETCALL_CBA,
+    R_PHONEUI_VOIP_PRIVATE_ADDRESS,
+    R_PHONE_VOIP_NO_AUDIO_SUPPORT,
+    R_PHONE_VOIP_NO_VOIP_SERVICE_ERROR,
+    R_PHONE_VOIP_CALL_BEING_FORWARDED,
+    R_NO_SERVICE_AVAILABLE_INFO,
+    R_PHONE_VOIP_ADDRESS_NOT_IN_USE,
+    R_PHONE_VOIP_REQUEST_TIME_OUT,
+    R_PHONE_VOIP_INVALID_RECIPIENT_ADDRESS,
+    R_PHONE_VOIP_NUMBER_BUSY,
+    R_PHONE_VOIP_NOT_FOUND,
+    R_PHONE_VOIP_NO_ANSWER,
+    R_PHONE_SS_NOTIFICATION_TEXT_VOIP_SIPS_FAILED,
+    R_VOIP_NETWORK_ERROR_NOTE,
+    R_VOIP_HOLD_FAILED,
+    R_VOIP_HOLD_NUMBER_FAILED,
+    R_VOIP_RESUME_FAILED,
+    R_VOIP_RESUME_NUMBER_FAILED,
+    R_VOIP_SWAP_FAILED,
+    R_VOIP_CONFERENCE_HOLD_FAILED,
+    R_VOIP_CONFERENCE_RESUME_FAILED,
+    R_VOIP_TRANSFER_FAILED_NOTE,
+    R_VOIP_TRANSFER_WAITING_ACCEPTENCE,
+    R_VOIP_CALL_TYPE_INTERNET,
+    R_VOIP_UNATTENDED_TRANSFER_OPTION,       
+    R_PHONE_VOIP_TRANSFER_ACCEPT,
+    R_PHONE_VOIP_TRANSFER_ACCEPT_CLI,
+    R_PHONE_VOIP_QUERY_ACC_ID_HEADER,
+    R_VOIP_TRANSFER_ADDRESS,
+    R_PHONEUIDIALER_NUMBERENTRY_EMPTY_TRANSFER_MENUBAR,
+    R_PHONEUIDIALER_NUMBERENTRY_NOT_EMPTY_TRANSFER_MENUBAR,
+    R_PHONEUI_TRANSFER_DIALER_SOFTKEYS_OPTIONS_CANCEL,
+    R_PHONE_TRANSFER_VOIP_CALL_QUERY,
+    R_PHONE_VOIP_SOFTKEYS_SEARCH_CANCEL,
+    R_PHONE_VOIP_SOFTKEYS_OK_CANCEL,
+    R_PHONE_NEW_VOIP_CALL_QUERY,
+    R_PHONE_NEW_VOIP_CALL_SOFTKEYS_SEARCH_CANCEL,
+    R_PHONE_VOIP_NEW_CALL_SOFTKEYS_OK_CANCEL,
+    R_PHONE_VOIP_CONNECTING_SERVICE,
+    R_PHONEUI_VOIP_ERROR_NOTE_AUTHENTICATION_FAILED,
+    R_VOIP_HANDOVER_TO_WLAN_OPTION,      
+    R_VOIP_HANDOVER_TO_GSM_OPTION,
+    R_PHONE_VOIP_NEW_CALL_OPTION,       
+    R_PHONEUI_VOIP_ERROR_IN_CONNECTION,
+    R_VOIP_VCC_WAIT_HO_FROM_WLAN,      
+    R_VOIP_VCC_WAIT_HO_FROM_GSM,      
+    R_VOIP_VCC_INFO_HO_FAILED,
+    R_PHONEUI_VOIP_QUERY_HEADER_MOVED_PERMANENTLY,
+    R_PHONE_VOIP_SOFTKEYS_OK_END_CALL,
+    R_PHONE_VOIP_MULTIPLE_CHOICES_LIST_QUERY,
+    R_PHONE_VOIP_NO_CONNECTIONS_DEFINED,
+    R_PHONE_VOIP_NO_CONNECTIONS_AVAILABLE,
+    R_PHONE_VOIP_CONNECTION_DOES_NOT_SUPPORT_CALLS,
+    R_PHONE_VOIP_CONNECTION_NOT_AVAILABLE_DURING_ALR,
+    R_PHONE_VOIP_CREATING_CONN_FAILED_PERMANENTLY,
+    R_PHONEUI_NEW_CALL_MENU_VOIP,
+    R_PHONEUI_NUMBERACQ_OPTIONS_MENU_VOIP,
+    R_PHONEUI_NUMBERACQ_OPTIONS_MENU_VOIP_WITH_SERVICE_NUMBER,
+    R_PHONEUI_NUMBERACQ_OPTIONS_MENU_ITEM_ALPHA_MODE,
+    R_PHONEUI_NUMBERACQ_OPTIONS_MENU_ITEM_NUMERIC_MODE,
+    R_VOIP_DIALER_TOOLTIP_ACCEPT,
+    R_VOIP_DIALER_TOOLTIP_SEARCH,
+    R_PHONEUI_INCALL_HELD_BUTTONS,
+    R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT,
+    R_NOTE_PHONE_OUT_OF_3G_COVERAGE,
+    R_NOTE_CALLED_NUMBER_HAS_BARRED_INCOMING_CALLS,
+    R_NOTE_VIDEO_CALL_ONLY_POSSIBLE_UNDER_3G_COVERAGE,
+    R_NOTE_UNABLE_TO_MAKE_VIDEO_CALL_NOT_SUPPORTED_BY_OTHER_PHONE,
+    R_NOTETEXT_USE_KEYGUARD_TO_UNLOCK,
+    R_PHONEUI_CALLHANDLING_EMERGENCY_INCALL_NO_OPTIONS,
+    EPhoneResourceLast
+    };
+
+#endif // PHONERESOURCEIDS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonerssbase.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,401 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*     File containing enumeration for PhoneUI resources used from
+*     common code.
+*
+*/
+
+
+#ifndef PHONERSSBASE_H
+#define PHONERSSBASE_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "phoneconstants.h"
+
+// DATA TYPES
+enum TPhoneRssBase
+    {
+    EPhoneStringList = KPhoneRssCommonFirst,
+    EPhoneDefaultSkeyList,
+    EPhoneEmergencyCallLabel,
+    EPhoneEmergencyCallHeader,
+    EPhoneEmergencyConnectWaitNote,
+    EPhoneEmergencyModeInformationNote,
+    EPhoneExitEmergencyModeQuery,
+    EPhoneIncomingCallLabel,
+    EPhoneIncomingCallLabelShort,
+    EPhoneIncomingCallKeysLocked,
+    EPhoneOutgoingVideoCallLabel,
+    EPhoneOutgoingVideoCallLabelShort,
+    EPhoneOutgoingCallLabel,
+    EPhoneOutgoingCallLabelShort,
+    EPhoneCallDurationFormatString,
+    EPhoneCallWaitingLabel,
+    EPhoneCallWaitingLabelShort,
+    EPhoneCallWaitingWithoutLabel,
+    EPhoneCallWaitingWithLabel,
+    EPhoneMulticallLabel,
+    EPhoneGprsConnInProgress,
+    EPhoneNewCallPhoneNumberEditor, //20
+    EPhoneNewCallFetchTitle,
+    EPhoneDisconnectingNetworkNote,
+    EPhoneInformationNote,
+    EPhoneInformationWaitNote,
+    EPhoneInformationErrorNote,
+    EPhoneInformationWarningNote,
+    EPhoneInformationConfirmationNote,
+    EPhoneSecurityInformationNote,
+    EPhoneRequestingNote,
+    EPhonePhoneImeiString,
+    EPhonePhoneBtDevAddress,
+    EPhoneInformationRemoteCreateConferenceNote,
+    EPhoneInformationRemotePutOnHoldNote,
+    EPhoneInformationConnectedNote,
+    EPhoneInformationCallOnHold,
+    EPhoneInformationCallActiveted,
+    EPhoneInformationCallOnHoldCli,
+    EPhoneInformationConferenceOnHold,
+    EPhoneInformationConferenceActiveted,
+    EPhoneInformationCallActivetedCli, //40
+    EPhoneInformationCallOnHoldNoCli,
+    EPhoneInformationNoNetworkSupportForVideoCallNote,
+    EPhoneInformationVideoCallNotAllowedDuringRestoreNote,
+    EPhoneCallOnHold,
+
+    EPhoneNoteTextCallNotPossibleWhenCallInCallSetupState ,
+    EPhoneNoteTextCallNotPossibleWhenAlreadyMaxNumberOfCalls,
+    EPhoneNoteTextCallNotPossibleWhenOnlyIncomingCall,
+    EPhoneNoteTextJoinNotPossibleWhenOnlyOneCall,
+    EPhoneNoteTextJoinNotPossibleWhenAlreadyMaxNumOfMembers,
+    EPhoneNoteTextAnswerNotPossibleWhenCallInCallSetupState,
+    EPhoneNoteTextAnswerNotPossibleWhenAlreadyMaxNumOfCalls,
+    EPhoneNoteTextCallNotAllowed,
+    EPhoneNoteTextCallNotAllowedFDN,
+    EPhoneNoteTextHoldNotPossibleWhenCallInCallSetupState,
+    EPhoneNoteTextActivateNotPossibleWhenCallInCallSetupState,
+    EPhoneNoteSimNotReady,
+    EPhoneNoteTextCallSummary,
+    EPhoneNoteTextCallDuration,
+    EPhoneNoteNoNetworkCallEmergency,
+    EPhoneNoteNoVideoNetwork, //60
+    EPhoneNoteTextRequestRejected,
+    EPhoneNoteTextCheckNetworkservices,
+    EPhoneInformationBannerCallEnded,
+    EPhoneCLIConferenceCall,
+    EPhoneCLIEmergencyCall,
+    EPhoneCLIConferenceCallParticipants,
+    EPhoneInfoHandsfreeDeactivated,
+    EPhoneInfoHandsetActivated,
+    EPhoneInfoBTAccActivated,
+    EPhoneInfoMicrophoneMuted,
+    EPhoneInfoMicrophoneUnmuted,
+
+    EPhoneNumberNotInUse,
+    EPhoneNumberBusy,
+    EPhoneNumberBarred,
+    EPhoneNumberNotInCUG,
+    EPhoneNoAnswer,
+    EPhoneMOOutOfRange,
+    EPhoneNetworkBusy,
+    EPhoneSignalFaded,
+    EPhoneErrorInConnection,
+    EPhoneInvalidPhoneNumber,
+    EPhoneOutgoingCallsBarredWithinCUG,
+    EPhoneNoCUGSelected,
+    EPhoneUnknownCUGIndex,
+    EPhoneCUGIndexIncompatible,
+    EPhoneCUGCallsFailure,
+    EPhoneCLIRNotSubscribed,
+    EPhoneFDNCallBlock,
+    EPhoneMOCallFailed,
+    EPhoneNoNetworkCoverage,
+    EPhoneCLIWithheld,
+    EPhoneWaitingText,
+    EPhoneIdleTimeFormat,
+    EPhoneLifeTimeFormat,
+    EPhoneInCallDisconnected,
+    EPhoneCallInProgress,
+    EPhoneEmergencyCallsOnly,
+    EPhoneNoteTextNotAllowed,
+    EPhoneEmptySimLocation, //100
+    EPhoneActiveDiverts,
+    EPhoneAllIncomingCallsDiverted,
+    EPhoneDiverting,
+    EPhoneMtCallDiverting,
+    EPhoneActiveBarrings,
+    EPhoneVideoCallIncoming,
+    EPhoneVideoCallIncomingShort,
+
+    // "Muted"
+    EPhoneInCallMutedText,
+    // "Call"
+    EPhoneCall,
+    // " Call %N"
+    EPhoneInCallNumberText,
+    /** "Transferring" -information note. */
+    EPhoneInCallWaitTransfer,
+    EPhoneInCallTransferred,
+    EPhoneInCallTransferredWithNro,
+    // the "DTMF Number" Query Dialog for DTMF.
+    EPhoneDtmfNumberQuery,
+
+    // the "Sending..." Wait Note for DTMF.
+    EPhoneSendingDtmfWaitNote,
+
+    // the text, "Sending...\n%U", used to produce
+    // the text for the wait-dialog.
+    EPhoneSendingDtmfWaitNoteText,
+
+    // the confirmation note, seen when processing
+    // the 'wait' character in a DTMF string.
+    EPhoneDtmfWaitCharacterConfirmationQuery,
+
+    // the text, "Send DTMF:\n%U", used to produce
+    // the text for the confirmation dialog.
+    EPhoneDtmfWaitCharacterConfirmationQueryText,
+
+    EPhoneDtmfFetchTitle,
+    EPhoneDtmfSpeedDialNumberQuery,
+    EPhoneDtmfSpeedDialNotAssigned,
+    EPhoneDtmfInvalidSpeedDial,
+
+    // ALS
+    EPhoneAlsLineChangeConfirmationQuery,
+    EPhoneAlsLineBlockingNoteText,
+    EPhoneInCallLine2,
+    EPhoneIncomingLine2Text,
+    EPhoneIncomingLine2WaitingText,
+    EPhoneIncomingLine2CallingText,
+
+    EPhoneConferenceDropParticipantDialog,
+    EPhoneConferencePrivateDialog,
+
+    EPhoneIdleMenubar,
+    EPhoneNumberAcqMenubar,           // include [Call] menu item
+    EPhoneNumberAcqOkMenubar,         // OK menu with [Call] menu item
+    EPhoneCallHandlingMenubar,
+    EPhoneCallHandlingMenubarWithNumberEntry,
+    EPhoneCallHandlingMenubarWithSendNumberEntry,
+    EPhoneCallHandlingHeldMenubarWithNumberEntry,
+    EPhoneCallHandlingHeldMenubarWithSendNumberEntry,
+    EPhoneCallHandlingHeldMenubar,
+    EPhoneCallHandlingHeldUnmuteMenubar,
+    EPhoneCallHandlingUnmuteMenubar,
+    EPhoneCallHandlingEmergencyMenubar,
+    EPhoneCallHandlingEmergencyMenubarWithNumberEntry,
+    EPhoneIncomingCallMenubar,
+    EPhoneIncomingCallMenubarWithNumberEntry,
+    EPhoneAlertingCallMenubar,
+    EPhoneAlertingCallMenubarWithNumberEntry,
+    EPhoneIncomingVideoCallMenubar,
+    EPhoneIncomingVideoCallMenubarWithNumberEntry,
+
+    // Multicall cases
+    EPhoneCallActiveAndHeldMenubar, //150
+    EPhoneCallActiveAndHeldMenubarWithNumberEntry,
+    EPhoneCallWaitingMenubar,
+    EPhoneCallWaitingMenubarWithNumberEntry,
+    EPhoneCallHeldAndWaitingMenubar,
+    EPhoneCallActiveHeldAndWaitingMenubar,
+    EPhoneCallActiveHeldAndWaitingMenubarWithNumberEntry,
+    EPhoneAlertingAndHeldCallMenuBar,
+    EPhoneAlertingAndHeldCallMenuBarWithNumberEntry,
+    EPhoneAlertingHeldAndWaitingCallMenuBar,
+    EPhoneAlertingHeldAndWaitingCallMenuBarWithNumberEntry,
+    EPhoneAlertingAndWaitingCallMenuBar,
+    EPhoneAlertingAndWaitingCallMenuBarWithNumberEntry,
+    EPhoneCallWaitingLockMenubar,
+    EPhoneCallTwoSinglesWaitingLockMenubar,
+
+    // Video call cases
+    EPhoneVideoCall2gMenubarWithNumberEntry,
+    EPhoneVideoCallWaitingMenubar,
+    EPhoneVideoCallWaitingMenubarWithNumberEntry,
+    EPhoneVideoCallMenubar,
+    EPhoneVideoCallMenubarWithNumberEntry,
+    EPhoneAlertingVideoCallMenubar,
+    EPhoneVideoCallSetupFailedCreateVoiceCallToTheSameContactText,
+
+    //Conference call cases
+    EPhoneConfCallMenubar,
+    EPhoneConfCallMenubarWithNumberEntry,
+    EPhoneConfAndCallWaitingMenubar,
+    EPhoneConfAndCallWaitingMenubarWithNumberEntry,
+    EPhoneConfAndHeldCallMenubar,
+    EPhoneConfAndHeldCallMenubarWithNumberEntry,
+    EPhoneActiveAndHeldConfMenubar,
+    EPhoneActiveAndHeldConfMenubarWithNumberEntry,
+    EPhoneConfCallActiveHeldAndWaitingMenubar,
+    EPhoneConfCallActiveHeldAndWaitingMenubarWithNumberEntry,
+    EPhoneCallActiveHeldConfAndWaitingMenubar,
+    EPhoneCallActiveHeldConfAndWaitingMenubarWithNumberEntry,
+    EPhoneAlertingAndConfHeldCallMenuBar,
+    EPhoneAlertingWaitingAndConfHeldCallMenuBar,
+    EPhoneAlertingAndConfHeldCallMenuBarWithNumberEntry,
+    EPhoneAlertingWaitingAndConfHeldCallMenuBarWithNumberEntry,
+    EPhoneConfCallParticipantsMenubar,
+    EPhoneConfCallParticipantsDropMenubar,
+    //Dialer cases
+    EPhoneDialerNumberAcqMenubar,
+    EPhoneDtmfDialerCBA,
+    EPhoneDtmfDialerMenubar,
+    EPhoneDtmfDialerNumberEntryPromptText,
+
+    EPhonePhoneAppMenuBarResourceOffset,
+    EPhonePhoneAppMenuBarResourceLast,
+    EPhonePhoneAppMenuPaneResourceOffset,
+    EPhonePhoneAppMenuPaneResourceLast,
+
+    EPhoneEmptyCBA,
+    EPhoneEmergencyIdleCBA,
+    EPhoneNumberAcqCBA, //200
+    EPhoneInCallNumberAcqCBA,
+    EPhoneSettingsUiCBA,
+    EPhoneCallHandlingCallSetupCBA,
+    EPhoneCallHandlingCallSetupToIhfCBA,
+    EPhoneCallHandlingCallSetupToHandsetCBA,
+    EPhoneCallHandlingInCallCBA,
+    EPhoneCallHandlingInCallNoIhfCBA,
+    EPhoneCallHandlingInCallUnmuteCBA,
+    EPhoneCallHandlingInCallHandsetCBA,
+    EPhoneCallHandlingInCallBtaaCBA,
+    EPhoneCallHandlingEmergencyCBA,
+    EPhoneCallHandlingEmergencyInCallNoOptions,
+    EPhoneCallHandlingEmergencyHandsetCBA,
+    EPhoneCallHandlingEmergencyNoIhfCBA,
+    EPhoneCallHandlingEmergencyNoOptionsCBA,
+    EPhoneCallHandlingEmergencyNoOptionsHandsetCBA,
+    EPhoneCallHandlingEmergencyNoOptionsNoIhfCBA,
+    EPhoneCallHandlingIncomingCBA,
+    EPhoneCallHandlingIncomingRejectCBA,
+    EPhoneCallHandlingIncomingSoftRejectCBA,
+    EPhoneCallHandlingInCallUnholdCBA,
+
+    // KTelephonyLVFlagCoverHideSendEndKey
+    EPhoneCallHandlingIncomingSliderCBA,
+    EPhoneCallHandlingIncomingSilentSliderCBA,
+    EPhoneCallHandlingIncomingSoftRejectSliderCBA,
+
+    // Swivel closed
+    EPhoneCallHandlingIncomingSwivelClosedCBA,
+    EPhoneCallHandlingIncomingSilentSwivelClosedCBA,
+    EPhoneCallHandlingWaitingAnswerSwivelClosedCBA,
+    EPhoneCallHandlingWaitingReplaceSwivelClosedCBA,
+
+    // the view itself requires a default CBA, but it will never be visible,
+    // so here's one that does nothing.
+    EPhoneSendDtmfNoCBA,
+
+    // the user has not typed anything into the edit-box (without content)
+    EPhoneSendDtmfEmptyEditBoxCBA,
+
+    // the user has typed something into the edit-box (with content)
+    EPhoneSendDtmfNormalEditBoxCBA,
+    EPhoneDtmfSpeedDialNormalEditBoxCBA,
+
+    EPhoneCallHandlingCallWaitingCBA,
+    EPhoneCallHandlingNewCallFindCBA,
+    EPhoneCallHandlingNewCallCallCBA,
+    EPhoneCallHandlingNewCallSwapCBA,
+    EPhoneEmptyBackCBA,
+    EPhoneNewCallFetchCBA,
+    EPhoneEmergencyExitCBA, //250
+    EPhoneEmergencyModeNoteCBA,
+    EPhoneDropParticipantCBA,
+    EPhonePrivateParticipantCBA,
+    EPhoneJoinParticipantCBA,
+    EPhoneCallHandlingInCallEndCallCBA,
+    EPhonePhoneAppToolbarResourceOffset,
+    EPhonePhoneAppToolbarResourceLast,
+
+    EPhoneCLIPayphone,
+    EPhoneSSNotifCLIRSupprReject,
+
+
+    EPhoneWlanMacAddress,
+
+    EPhoneColpConnected,
+
+    EPhoneBtLoopbackEnabled,
+    EPhoneBtLoopbackDisabled,
+
+    EPhoneLineBlockingNote,
+
+    EPhoneSwitchToVideoQuery,
+    EPhoneSwitchToVoiceQuery,
+    EPhoneSimRejected,
+    EPhoneSimUnaccepted,
+    EPhoneSimRemoved,
+    EPhoneRebootRequired,
+    EPhoneNoteVideoCallNotPossible,
+    EPhoneContinueInHandsetConfirmationQuery,
+    EPhoneContinueInLoudspeakerConfirmationQuery,
+    EPhoneDisconnectingQueryCBA,
+    EPhoneNoteVideoCallSetupFailed,
+    EPhoneNoteNoService,
+    EPhoneNoteCallInfoCauseValue16,
+    EPhoneNoteCallInfoCauseValue18,
+    EPhoneNoteCallInfoCauseValue22,
+    EPhoneNoteCallInfoCauseValue34,
+    EPhoneNoteCallInfoCauseValue38,
+    EPhoneNoteCallInfoCauseValue55,
+    EPhoneNoteCallInfoCauseValue58,
+    EPhoneNoteCallInfoCauseValue127,
+    EPhoneNoteCallInfoNotSupported,
+    EPhoneNoteCallInfoServiceNotAvailable,
+    EPhoneNoteTTYNoAudioControl, //300
+    EPhoneInfoClirChange,
+    EPhoneInfoCugInUse,
+
+    //the "DTMF number" list query
+    EPhoneDtmfNumberListQuery,
+    // contact list query
+    EPhoneAddtoContactsListQuery,
+    // Debug only
+    EPhoneNoteTextPEFailedAtStartup,
+
+    // Touch buttons
+    EPhoneIncallButtons,
+    EPhoneTwoSinglesButtons,
+    EPhoneConferenceButtons,
+    EPhoneParticipantListButtons,
+    EPhoneConferenceAndSingleButtons,
+    EPhoneConferenceAndHeldSingleButtons,
+    EPhoneParticipantListCBA,
+    EPhoneEmergencyCallButtons,
+    EPhoneAudioBTAButton,
+    EPhoneAudioDefButton,
+    EPhoneIncomingCallButtons,
+    EPhoneCallSetupButtons,
+    EPhoneWaitingCallButtons,
+    EPhoneCallSetupAndSingleButtons,
+    
+    // Video call error notes
+    EPhoneNotePhoneOutOf3GCoverage, // cause 3,31,69
+    EPhoneNoteVideoCallOnlyPossibleUnder3GCoverage, // cause 50
+    EPhoneNoteUnableToMakeVideoCallNotSupportedByOtherPhone, // cause 57,88 
+    EPhoneNoteCalledNumberHasBarredIncomingCalls, // cause 21
+    
+    EPhoneIncallHeldButtons,
+    EPhoneAttemptingEmergencyText,
+
+    // Last
+    EPhoneRssBaseLast
+    };
+
+#endif      // PHONERSSBASE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonerssgsm.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     File containing enumeration for phoneapp resources used from GSM
+*     specific code.
+*
+*/
+
+
+#ifndef __PHONERSSGSM_H
+#define __PHONERSSGSM_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// DATA TYPES
+enum TPARssPhoneUIGSM
+    {
+
+    };
+
+#endif      // __PHONERSSGSM_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonerssvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     File containing enumeration for phoneapp resources used from VoIP
+*     specific code.
+*
+*/
+
+
+#ifndef PHONERSSVOIP_H
+#define PHONERSSVOIP_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "phonerssbase.h"
+
+
+// DATA TYPES
+enum TPhoneRssVoIP
+    {
+    EPhoneVoIPNumberAcqMenubar = EPhoneRssBaseLast,
+    EPhoneVoIPNumberAcqMenubarWithServiceNumber,
+    EPhoneVoIPNumberAcqOkMenubar,
+    EPhoneVoIPNumberAcqOkMenubarWithServiceNumber,
+    EPhoneVoIPNumberAcqInternetSoftkey,
+    EPhoneVoIPPrivateAddress,
+    EPhoneVoIPNoAudioSupport,
+    EPhoneVoIPNoService,
+    EPhoneVoIPAddressNotInUse,
+    EPhoneVoIPServiceUnavailable,
+    EPhoneVoIPRequestTimeOut,
+    EPhoneVoIPInvalidRecipientAddress,
+    EPhoneVoIPNumberBusy,
+    EPhoneVoIPNotFound,
+    EPhoneVoIPNoAnswer,
+    EPhoneSSNotificationTextVoipSipsFailed,
+    EPhoneVoIPNetworkError,
+    EPhoneVoIPHoldFail,
+    EPhoneVoIPResumeFail,
+    EPhoneVoIPHoldNumberFail,
+    EPhoneVoIPResumeNumberFail,
+    EPhoneVoIPSwapFail,
+    EPhoneVoIPConferenceHoldFail,
+    EPhoneVoIPConferenceResumeFail,
+    EPhoneVoIPTransferFail,
+    EPhoneVoIPUnattendedTransferOption,
+    EPhoneVoIPCallTypeInternet,
+    EPhoneVoIPNumberAcqXSPCall,
+    EPhoneVoIPUnattendedTransferAcceptanceQueryIdentified,
+    EPhoneVoIPUnattendedTransferAcceptanceQueryAnonymous,
+    EPhoneVoIPUnattendedTransferAcceptanceQueryHeader,
+    EPhoneVoIPTransferAddress,
+    EPhoneVoIPTransferDialerNumberEntryEmptyMenubar,
+    EPhoneVoIPTransferDialerNumberEntryNotEmptyMenubar,
+    EPhoneVoIPTransferDialerSoftkeys,
+    EPhoneVoIPTransferAddressQuery,
+    EPhoneVoIPTransferAddressQueryEmptySoftkeys,
+    EPhoneVoIPTransferAddressQueryNotEmptySoftkeys,
+    EPhoneVoIPNewCallQuery,
+    EPhoneVoIPNewCallQueryEmptySoftkeys,
+    EPhoneVoIPNewCallQueryNotEmptySoftkeys,
+    EPhoneVoIPNewCallMenuOption,
+    EPhoneVoIPEnablingServiceWaitNoteText,
+    EPhoneVoIPAuthenticationFailed,
+    EPhoneVoIPErrorInConnection,
+    EPhoneVoIPWaitingAcceptanceNote,
+    EPhoneRemoteForwarding,
+    EPhoneVoIPHandoverToGsmOption,
+    EPhoneVoIPHandoverToWlanOption,
+    EPhoneVoIPWaitHandoverFromWlan,
+    EPhoneVoIPWaitHandoverFromGsm,
+    EPhoneVoIPHandoverFail,
+    EPhoneVoIPMovedPermanentlyQueryHeader,
+    EPhoneVoIPMovedPermanentlySoftkeys,
+    EPhoneVoIPMultipleChoicesListQuery,
+    EPhoneVoIPNoConnectionsDefined,
+    EPhoneVoIPNoConnectionsAvailable,
+    EPhoneVoIPCallsNotSupported,
+    EPhoneVoIPNotAvailableWhenConnecting,
+    EPhoneVoIPDefectiveSettings,
+    // Last
+    EPhoneVoIPLast
+    };
+
+#endif      // PHONERSSVOIP_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonestatestrings.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Macro definition file for logging.
+*
+*/
+
+// Autogenerated from phonestatestrings.st by the stringtable tool - Do not edit
+
+#ifndef STRINGTABLE_PhoneStateStrings
+#define STRINGTABLE_PhoneStateStrings
+
+#include <stringpool.h>
+
+struct TStringTable;
+
+/** A String table */
+class PhoneStateStrings 
+    {
+public:
+    enum TStrings
+        {
+        /** EPhoneStateNull */
+        EPhoneStateNull,
+        /** EPhoneStateStartup */
+        EPhoneStateStartup,
+        /** EPhoneStateIdle */
+        EPhoneStateIdle,
+        /** EPhoneStateCallSetup */
+        EPhoneStateCallSetup,
+        /** EPhoneStateSingle */
+        EPhoneStateSingle,
+        /** EPhoneStateIncoming */
+        EPhoneStateIncoming,
+        /** EPhoneStateEmergency */
+        EPhoneStateEmergency
+        };
+    static const TStringTable Table;    
+    };
+
+#endif // STRINGTABLE_PhoneStateStrings
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/phonestatestringsgsm.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Macro definition file for logging.
+*
+*/
+
+// Autogenerated from phonestatestringsgsm.st by the stringtable tool - Do not edit
+
+#ifndef STRINGTABLE_PhoneStateStringsGSM
+#define STRINGTABLE_PhoneStateStringsGSM
+
+#include <stringpool.h>
+
+struct TStringTable;
+
+/** A String table */
+class PhoneStateStringsGSM 
+    {
+public:
+    enum TStrings
+        {
+        // GSM States - start at KPhoneStateProtocolFirst
+        /** EPhoneStateAlerting */
+        EPhoneStateAlerting,
+        /** EPhoneStateAlertingInSingle */
+        EPhoneStateAlertingInSingle,
+        /** EPhoneStateWaitingInSingle */
+        EPhoneStateWaitingInSingle,
+        /** EPhoneStateTwoSingles */
+        EPhoneStateTwoSingles,
+        /** EPhoneStateCallSetupInSingle */
+        EPhoneStateCallSetupInSingle,
+        /** EPhoneStateConference */
+        EPhoneStateConference,
+        /** EPhoneStateConferenceAndCallSetup */
+        EPhoneStateConferenceAndCallSetup,
+        /** EPhoneStateConferenceAndSingle */
+        EPhoneStateConferenceAndSingle,
+        /** EPhoneStateConferenceAndWaiting */
+        EPhoneStateConferenceAndWaiting,
+        /** EPhoneStateSingleAndCallSetupAndWaiting */
+        EPhoneStateSingleAndCallSetupAndWaiting,
+        /** EPhoneStateCallSetupAndWaiting */
+        EPhoneStateCallSetupAndWaiting,
+        /** EPhoneStateTwoSinglesAndWaiting */
+        EPhoneStateTwoSinglesAndWaiting,
+        /** EPhoneStateConferenceAndSingleAndWaiting */
+        EPhoneStateConferenceAndSingleAndWaiting,
+        /** EPhoneStateConferenceAndWaitingAndCallSetup */
+        EPhoneStateConferenceAndWaitingAndCallSetup,
+        /** EPhoneStateLastGSMState */
+        EPhoneStateLastGSMState
+        };
+    static const TStringTable Table;    
+    };
+
+#endif // STRINGTABLE_PhoneStateStringsGSM
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/rphoneanimclearblacklist.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Client side for blacklist clearing plugin.
+*
+*/
+
+
+#ifndef RPHONEANIMCLEARBLACKLIST_H
+#define RPHONEANIMCLEARBLACKLIST_H
+
+// INCLUDES
+#include <w32std.h>     // RAnim
+
+// FORWARD DECLARATIONS
+class CCoeControl;
+
+// CLASS DECLARATION
+
+/**
+* Blacklist clearing plugin client side object.
+*
+* Used to clear DOS side blacklist. Window server Plug-in.
+*
+* @since 1.0
+*/
+class RPhoneAnimClearBlacklist : public RAnim
+    {
+    public: // Constructors and destructors
+        
+        /** 
+        * Constructor. 
+        * @param aAnimDll This is server side object.
+        */
+        RPhoneAnimClearBlacklist( RAnimDll& aAnimDll );
+        
+        /** 
+        * Construction.
+        * @param aDevice window.
+        */
+        void ConstructL( const RWindowBase& aDevice );
+        
+    public: // New functions
+        
+        /** 
+        * Clear blacklist on next key press.
+        * This function should be called in startup and after every call.
+        */
+        void ClearBlackListOnNextKey();
+        
+        /** 
+        * Clear blacklist on PhoneCommand.
+        * This function should be called in when blaclist is wanted to clear.
+        */
+        void ClearBlackListNow();
+    };
+
+#endif      // RPHONEANIMCLEARBLACKLIST_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tcbacommandmapping.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Class holds mapping between CBA and custom commands.
+*
+*/
+
+
+#ifndef T_TCBACOMMANDMAPPING_H
+#define T_TCBACOMMANDMAPPING_H
+
+
+#include <e32base.h>
+
+/**
+ *  Class holds mapping between CBA and custom commands.
+ *
+ *  @lib phoneuiutils.dll
+ *  @since S60 v5.1
+ */
+class TCbaCommandMapping
+    {
+
+public:
+    /**
+     * C++ default constructor. Use only for NULL-object creation.
+     */    
+    TCbaCommandMapping();
+        
+    /**
+     * C++ overloaded constructor.
+     */
+    TCbaCommandMapping( TInt aCbaCommandId, TInt aCustomCommandId );
+    
+    /**
+     * Returns CBA command identifier.
+     * @return  CBA command identifier.
+     */
+    TInt CbaCommandId() const;
+    
+    /**
+     * Returns custom command identifier.
+     * @return  Custom command identifier.
+     */
+    TInt CustomCommandId() const;
+    
+    /**
+     * Comparison operator for mappings.
+     * @return  ETrue if mapping is same, EFalse otherwise.
+     */
+    TBool operator==( const TCbaCommandMapping& aMapping ) const;
+
+private: // data
+
+    /**
+     * CBA command identifier.
+     */
+    TInt iCbaCommandId;
+    
+    /**
+     * Custom command identifier.
+     */
+    TInt iCustomCommandId;
+
+    };
+
+
+#endif // T_TCBACOMMANDMAPPING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/telinternalsingletonuids.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony Internal Singleton UIDs.
+*
+*/
+
+
+#ifndef TELINTERNALSINGLETONUIDS_H
+#define TELINTERNALSINGLETONUIDS_H
+
+#include <e32std.h>
+
+// CONSTANTS
+
+/*****************************************************************************
+* Telephony Internal Singleton UIDs 
+*****************************************************************************/
+
+// Phone Application's State Machine Singleton UID
+static const TUid KUidStateHandleSingleton = { 0x01 };
+
+// Phone Application's View Controller Singleton UID
+static const TUid KUidPhoneViewControllerSingleton = { 0x02 };
+
+// Phone Application's Status Pane Handler Singleton UID
+static const TUid KUidPhoneStatusPaneHandlerSingleton = { 0x03 };
+
+// Phone Application's Resource Resolver Singleton UID
+static const TUid KUidMainResourceResolverSingleton = { 0x04 };
+
+// Phone Application's Logger Singleton UID
+static const TUid KUidPhoneUILoggerSingleton = { 0x05 };
+
+// Phone Application's Central Repository Proxy Singleton UID
+static const TUid KUidCenRepProxySingleton = { 0x06 };
+
+// Phone Application's Publish and Subscribe Proxy Singleton UID
+static const TUid KUidPubSubProxySingleton = { 0x07 };
+
+// Phone Application's Recovery System Singleton UID
+static const TUid KUidRecoverySystemSingleton = { 0x08 };
+
+// Phone Application's Reconnect Query Singleton UID
+static const TUid KUidReconnectQuerySingleton = { 0x09 };
+
+// Phone Application's Call Header Animation Singleton UID
+static const TUid KUidCallHeaderTextAnimationSingleton = { 0x0A };
+
+// Phone Application's Call Black List Clearing Singleton UID
+static const TUid KUidClearBlackListSingleton = { 0x0B };
+
+// Phone Application's Error message Handler Singleton UID
+static const TUid KUidMainErrorMessagesHandlerSingleton = { 0x0D };
+
+// Phone Application's bluetooth accessory disconnect handler singleton UID.
+static const TUid KUidBtaaDisconnectHandlerSingleton = { 0x0E };
+
+// Phone Mediator Command Listener Singleton UID
+static const TUid KUidMediatorCommandListenerSingleton = { 0x0F };
+
+// Phone Mediator Sender Singleton UID
+static const TUid KUidMediatorSenderSingleton = { 0x10 };
+
+// Phone Mediator Factory Singleton UID
+static const TUid KUidMediatorFactorySingleton = { 0x11 };
+
+#endif // TELINTERNALSINGLETONUIDS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/telprivatecrkeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony private Central Repository keys
+*
+*/
+
+
+#ifndef TELEPHONYPRIVATECRKEYS_H
+#define TELEPHONYPRIVATECRKEYS_H
+
+#include <e32std.h>
+
+/******************************************************************************
+* Telephony Private Variation API
+* Keys under this category are used in defining telephony private variation.
+******************************************************************************/
+const TUid KCRUidTelPrivateVariation = {0x102828B2}; 
+ 
+/**
+* Set of applications by UID that are closed when end key is pressed. Can 
+* be list of UIDs or UID ranges (<uid1>-<uid2>) or combination of both or 
+* all apps (i.e. '*'). UIDs are hexadecimal e.g. "10005951". Elements are 
+* separated with space. Supports also closing any app when memory is low.
+* This is marked with "OOM" token.
+*/
+const TUint32 KTelAppsCloseList                             = 0x00000001; 
+
+/**
+* Set of applications by UID  that should NOT be closed when end key is 
+* pressed. Same format as in KTelAppsCloseList but OOM token is not 
+* applicable.
+*/
+const TUint32 KTelAppsKeepList                              = 0x00000002;
+
+/**
+* Application UID for long '0' key press. By default value is 0x10008D39 
+* which is web browser UID. Products can set this to some other to 
+* launch different applications. Note if you change this remember to change
+* KTelAppLaunchParam.
+*/
+const TUint32 KTelAppLaunch                                 = 0x00000003; 
+
+/**
+* Param which is passed to application which is launched using long '0' 
+* key press. By default value is '5' which is special value for web 
+* browser and max lenght is 10 characters.Note if you change KTelAppLaunch
+* you will need to change this too.
+*/
+const TUint32 KTelAppLaunchParam                            = 0x00000004; 
+
+/**
+* The ascii code of a button that is specified to launch an application
+* defined in KTelButton1AppUID. This key is of type Int.
+*/
+const TUint32 KTelButton1                                   = 0x00FF0101; 
+
+/**
+* The UID of application to be launched on a press of a button defined 
+* in KTelButton1. This key is of type Int.
+*/
+const TUint32 KTelButton1AppUID                             = 0x00FF0102;
+
+/**
+* A optional parameter to be passed to the application defined in
+* KTelButton1AppUID. This key is of type String.
+*/
+const TUint32 KTelButton1AppParam                           = 0x00FF0103;
+
+/**
+* The ascii code of a button that is specified to launch an application
+* defined in KTelButton2AppUID. This key is of type Int.
+*/
+const TUint32 KTelButton2                                   = 0x00FF0201;
+
+/**
+* The UID of application to be launched on a press of a button defined 
+* in KTelButton2. This key is of type Int.
+*/
+const TUint32 KTelButton2AppUID                             = 0x00FF0202;
+
+/**
+* A optional parameter to be passed to the application defined in
+* KTelButton2AppUID. This key is of type String.
+*/
+const TUint32 KTelButton2AppParam                           = 0x00FF0203;
+
+/**
+* The ascii code of a button that is specified to launch an application
+* defined in KTelButton3AppUID. This key is of type Int.
+*/
+const TUint32 KTelButton3                                   = 0x00FF0301;
+
+/**
+* The UID of application to be launched on a press of a button defined 
+* in KTelButton3. This key is of type Int.
+*/
+const TUint32 KTelButton3AppUID                             = 0x00FF0302;
+
+/**
+* A optional parameter to be passed to the application defined in
+* KTelButton3AppUID. This key is of type String.
+*/
+const TUint32 KTelButton3AppParam                           = 0x00FF0303;
+
+#endif      // TELEPHONYPRIVATECRKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamKeycapture.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMKEYCAPTURE_H
+#define __TPHONECMDPARAMKEYCAPTURE_H
+
+//  INCLUDES
+
+#include <e32keys.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+enum TPhoneCaptureType
+{
+    EPhoneKeyEvent,
+    EPhoneKeyUpAndDownEvents,
+    EPhoneKeyAllEvents
+};
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for key capture information.
+*/
+class TPhoneCmdParamKeyCapture : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamKeyCapture();
+
+    public: 
+        
+        /**
+        * Sets the key scan code.
+        * @param aKey is the key scan code
+        */
+        IMPORT_C void SetKey( TStdScanCode aKey );
+
+        
+        /**
+        * Sets the key code.
+        * @param aKeyCode is the key code
+        */
+        IMPORT_C void SetKeyCode( TKeyCode aKeyCode );
+
+        /**
+        * Sets the key capture type.
+        * @param aCaptureType is the key capture type
+        */
+        IMPORT_C void SetCaptureType( TPhoneCaptureType aCaptureType );
+
+        /**
+        * Returns the key scan code.
+        * @return Returns the key scan code
+        */
+        IMPORT_C TStdScanCode Key() const;
+
+        /**
+        * Returns the key code.
+        * @return Returns the key code
+        */
+        IMPORT_C TKeyCode KeyCode() const;
+
+        /**
+        * Returns the key capture type
+        * @return Returns the key capture type
+        */
+        IMPORT_C TPhoneCaptureType CaptureType() const;
+
+    private:    
+        
+        /**
+        * Key scan code
+        */
+        TStdScanCode iKey;
+
+        /**
+        * Key code
+        */
+        TKeyCode iKeyCode;
+
+        /**
+        * Key capture type
+        */
+        TPhoneCaptureType iCaptureType;
+    };
+
+#endif // __TPHONECMDPARAMKEYCAPTURE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamappinfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     A paramater class for application information.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMAPPINFO_H
+#define __TPHONECMDPARAMAPPINFO_H
+
+//  INCLUDES
+
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A paramater class for identifying view.
+*/
+class TPhoneCmdParamAppInfo : public TPhoneUICommandParam
+    {   
+    public:
+
+        /**
+        * Constructor.
+        */
+        IMPORT_C TPhoneCmdParamAppInfo();
+
+        /**
+        * Sets application uid.
+        * @param    aAppUid, Id of app.
+        * @return   None.
+        */
+        IMPORT_C void SetAppUid( const TUid& aAppUid );
+
+        /**
+        * Sets view uid.
+        * @param    aViewUid, Id of view.
+        * @return   None.
+        */
+        IMPORT_C void SetViewUid( const TUid& aViewUid );
+
+        /**
+        * Sets application parameter.
+        * @param    aParam
+        * @return   None.
+        */
+        IMPORT_C void SetParam( const TDesC8& aParam );
+
+        /**
+        * Sets Custom Message Id.
+        * @param    aCustomMessageId
+        * @return   None.
+        */
+        IMPORT_C void SetCustomMessageId( const TUid& aCustomMessageId );
+
+        /**
+        * Sets Custom Message.
+        * @param    aCustomMessage
+        * @return   None.
+        */
+        IMPORT_C void SetCustomMessage( const TDesC8& aCustomMessage );
+
+        /**
+        * Sets multiple instances status for the application
+        * @param aMultipleInstances is ETrue if there are multiple instances
+        *  of the application.
+        */
+        IMPORT_C void SetMultipleInstances( TBool aMultipleInstances );
+
+        /**
+        * Returns App uid.
+        * @param    None.
+        * @return   iAppUid.
+        */
+        IMPORT_C TUid AppUid() const;
+
+        /**
+        * Returns View uid.
+        * @param    None.
+        * @return   iViewUid.
+        */
+        IMPORT_C TUid ViewUid() const;
+
+        /**
+        * Returns App parameter.
+        * @param    None.
+        * @return   iParam.
+        */
+        IMPORT_C const TDesC8& Param() const;
+
+        /**
+        * Returns Custom Message Id.
+        * @param    None.
+        * @return   iCustomMessageId.
+        */
+        IMPORT_C TUid CustomMessageId() const;
+
+        /**
+        * Returns CustomMessage.
+        * @param    None.
+        * @return   iMessage.
+        */
+        IMPORT_C const TDesC8& CustomMessage() const;
+
+          /**
+        * Returns multiple instance status of the application.
+        * @return Returns ETrue if there are multiple instances of the
+        *  application.
+        */
+        IMPORT_C TBool MultipleInstances() const;
+
+  private:    
+
+        /**
+        * App UID.
+        */
+        TUid iAppUid;
+
+        /**
+        * App view UID.
+        */
+        TUid iViewUid;
+
+        /**
+        * App parameter
+        */
+        TPtrC8 iParam;
+
+        /**
+        * Custom message ID.
+        */
+        TUid iCustomMessageId;
+
+        /**
+        * Custom message
+        */
+        TPtrC8 iCustomMessage;
+
+        /**
+        * Indicates that they are multiple instance for this application
+        */
+        TBool iMultipleInstances;
+
+    };
+
+#endif // __TPHONECMDPARAMAPPINFO_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamaudioavailability.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMAUDIOAVAILABILITY_H
+#define __TPHONECMDPARAMAUDIOAVAILABILITY_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include <pevirtualengine.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for call header information.
+*/
+class TPhoneCmdParamAudioAvailability : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamAudioAvailability();
+
+    public: 
+ 
+        /**
+        * BT Acc available mode
+        * @param aAudioOutput is the accessory mode
+        */        
+        IMPORT_C void SetBTAccAvailable( TBool aState );
+        
+        /**
+        * Returns the BT Acc available mode
+        * @return Returns the audio output
+        */
+        IMPORT_C TBool IsBTAccAvailable() const;
+
+        /**
+        * Wired Acc available mode
+        * @param aAudioOutput is the accessory mode
+        */        
+        IMPORT_C void SetWiredAccAvailable( TBool aState );
+        
+        /**
+        * Returns the Wired Acc available mode
+        * @return Returns the audio output
+        */
+        IMPORT_C TBool IsWiredAccAvailable() const;
+ 
+    private:    
+
+        /**
+        * BT Acc available mode 
+        */
+        TBool iBTAccAvailable;
+
+        /**
+        * Wired Acc available mode 
+        */
+        TBool iWiredAccAvailable;
+    };
+
+#endif // _TPHONECMDPARAMAUDIOOUTPUT_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamaudiooutput.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMAUDIOOUTPUT_H
+#define __TPHONECMDPARAMAUDIOOUTPUT_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include <pevirtualengine.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for call header information.
+*/
+class TPhoneCmdParamAudioOutput : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamAudioOutput();
+
+    public: 
+        
+        /**
+        * Sets the audio output
+        * @param aAudioOutput is the accessory mode
+        */
+        IMPORT_C void SetAudioOutput( 
+            TPEAudioOutput aAudioOutput );
+
+        /**
+        * Returns the audio output
+        * @return Returns the audio output
+        */
+        IMPORT_C TPEAudioOutput AudioOutput() const;
+ 
+    private:    
+
+        /**
+        * Audio path
+        */
+        TPEAudioOutput iAudioOutput;
+           
+    };
+
+#endif // _TPHONECMDPARAMAUDIOOUTPUT_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparambitmap.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Command parameter class for Bitmap objects
+*     
+*
+*/
+
+
+#ifndef TPHONECMDPARAMBITMAP_H
+#define TPHONECMDPARAMBITMAP_H
+
+//  INCLUDES
+#include <fbs.h>
+#include "tphonecommandparam.h"
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for passing a CFbsBitmap around. This
+*  is used for various purposes where CFbsBitmap is useful. 
+*/
+class TPhoneCmdParamBitmap : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamBitmap();
+
+        /**
+        * Sets the Bitmap value.
+        * @param aBitmap is the bitmap.
+        */
+        IMPORT_C void SetBitmap( CFbsBitmap* aBitmap );
+
+        /**
+        * Returns the Bitmap.
+        * @return Returns the Bitmap
+        */
+        IMPORT_C CFbsBitmap* Bitmap() const;
+
+        /**
+        * Sets the mask bitmap value.
+        * @param aMaskBitmap is the masking bitmap.
+        */
+        IMPORT_C void SetMaskBitmap( CFbsBitmap* aMaskBitmap );
+
+        /**
+        * Returns the mask bitmap.
+        * @return Returns the mask bitmap
+        */
+        IMPORT_C CFbsBitmap* MaskBitmap() const;
+
+
+    private:    
+        
+        /**
+        * Pointer to bitmap
+        */
+        CFbsBitmap* iBitmap;
+
+        /**
+        * Pointer to masking bitmap
+        */
+        CFbsBitmap* iMaskBitmap;
+
+    };
+
+#endif      // TPHONECMDPARAMBITMAP_H 
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamboolean.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of TPhoneCmdParamBoolean class.
+*     
+*
+*/
+
+
+#ifndef TPHONECMDPARAMBOOLEAN_H
+#define TPHONECMDPARAMBOOLEAN_H
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for passing a TBool around. This
+*  is used for various purposes where TBool is useful. 
+*/
+class TPhoneCmdParamBoolean : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamBoolean();
+
+    public: 
+        
+        /**
+        * Sets the Boolean boolean value.
+        * @param aBoolean is the Boolean value.
+        */
+        IMPORT_C void SetBoolean( TBool aBoolean );
+
+        /**
+        * Returns the Boolean.
+        * @return Returns the Boolean
+        */
+        IMPORT_C TBool Boolean() const;
+
+    private:    
+        
+        /**
+        * Boolean value
+        */
+        TBool iBoolean;
+
+    };
+
+#endif      // TPhoneCmdParamBoolean_H 
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamcallheaderdata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,419 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMCALLHEADERDATA_H
+#define __TPHONECMDPARAMCALLHEADERDATA_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include <cntdef.h>
+#include "tphonecommandparam.h"
+#include "phoneconstants.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+class CFbsBitmap;
+
+/**
+*  A parameter class for call header information.
+*/
+class TPhoneCmdParamCallHeaderData : public TPhoneUICommandParam
+    {
+    public:
+        // CLI used in conference call participant list.
+        enum TPhoneParticipantListCLI
+            {
+            EPhoneParticipantCLIText,
+            EPhoneParticipantCNAPText,                
+            };
+
+        enum TPhoneTextClippingDirection
+            {
+            ERight,
+            ELeft
+            };
+           
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamCallHeaderData();
+
+    public: 
+        
+        /**
+        * Sets the call header label text.
+        * @param aLabel is the label
+        */
+        IMPORT_C void SetLabelText( const TDesC& aLabelText );
+
+        /**
+        * Sets the call header short label text
+        * @param aShortLabel is the short label
+        */
+        IMPORT_C void SetShortLabelText( const TDesC& aShortLabelText );
+
+        /**
+        * Sets the call header call state.
+        * @param aCallState is the call state
+        */
+        IMPORT_C void SetCallState( TInt aCallState );
+
+        /**
+        * Sets the call header call type.
+        * @param aCallType is the call type
+        */
+        IMPORT_C void SetCallType( TInt aCallType );
+
+        /**
+        * Sets the call header number type.
+        * @param aNumberType is the number type
+        */
+        IMPORT_C void SetNumberType( TInt aNumberType );
+
+        /**
+        * Sets the call header voice privacy status.
+        * @param aCiphering is ETrue if voice privacy is on.
+        */
+        IMPORT_C void SetCiphering( TBool aCiphering );
+
+        /**
+        * Sets the call header CLI text
+        * @param aCLI is the CLI text
+        * @param aDirection Clipping direction of the CLI text.
+        */
+        IMPORT_C void SetCLIText( const TDesC& aCLIText, 
+                                  TPhoneTextClippingDirection aDirection );
+
+        /**
+        * Sets the call header CNAP text
+        * @param aCNAP is the CNAP text
+        * @param aDirection Clipping direction of the CNAP text.
+        */
+        IMPORT_C void SetCNAPText( const TDesC& aCNAPText,
+                                   TPhoneTextClippingDirection aDirection );
+
+        /**
+        * Sets the call header picture
+        * @param aPicture is the picture data
+        */
+        IMPORT_C void SetPicture( const TDesC& aPicture );
+
+        /**
+        * Sets the call header diverted status.
+        * @param call flag
+        */
+        IMPORT_C void SetDiverted( TBool aDiverted );
+            
+        /**
+        * Sets the call header line2 status.
+        * @param aLine2 is ETrue if line2 is active.
+        */
+        IMPORT_C void SetLine2( TBool aLine2 );
+            
+        /**
+        * Returns the call header label text
+        * @return Returns the label
+        */
+        IMPORT_C const TDesC& LabelText() const;
+
+        /**
+        * Returns the call header short label text.
+        * @return Returns the short label
+        */
+        IMPORT_C const TDesC& ShortLabelText() const;
+
+        /**
+        * Returns the call header call state.
+        * @return Returns the call state
+        */
+        IMPORT_C TInt CallState() const;
+
+        /**
+        * Returns the call header call type.
+        * @return Returns the call type
+        */
+        IMPORT_C TInt CallType() const;
+
+        /**
+        * Returns the call header number type.
+        * @return Returns the number type 
+        */
+        IMPORT_C TInt NumberType() const;
+
+        /**
+        * Returns the call header ciphering status.
+        * @return Returns ETrue if ciphering is on 
+        */
+        IMPORT_C TBool Ciphering() const;
+
+        /**
+        * Returns the call header CLI text.
+        * @return Returns the CLI text
+        */
+        IMPORT_C const TDesC& CLIText() const;
+
+        /**
+         * Returns the clipping direction of the CLI text.
+         * @return  Clipping direction of the CLI text.
+         */
+        IMPORT_C TPhoneTextClippingDirection CLITextClippingDirection() const;
+
+        /**
+         * Returns the clipping direction of the CNAP text.
+         * @return  Clipping direction of the CNAP text.
+         */
+        IMPORT_C TPhoneTextClippingDirection CNAPTextClippingDirection() const;
+        
+        /**
+        * Returns the call header CNAP text.
+        * @return Returns the CNAP text
+        */
+        IMPORT_C const TDesC& CNAPText() const;
+
+        /**
+        * Returns the call header picture.
+        * @return Returns the picture
+        */
+        IMPORT_C const TDesC& Picture() const;
+        
+        /**
+        * Returns call diverted status.
+        * @return Returns ETrue if diverted call.
+        */
+        IMPORT_C TBool Diverted() const;
+        
+        /**
+        * Returns the call header line 2 active.
+        * @return Returns ETrue if line2 is on 
+        */
+        IMPORT_C TBool Line2() const;
+        
+        /**
+        * Returns the Thumbnail.
+        * @return Returns pointer to the thumbnail image 
+        */
+        IMPORT_C CFbsBitmap* Thumbnail() const;
+        
+        /**
+        * Sets the Thumbnail
+        * @param aThumbnail is pointer to the thumbnail image
+        */
+        IMPORT_C void SetThumbnail( CFbsBitmap* aThumbnail );
+        
+        /**
+        * Sets the call header Caller text
+        * @param aCallerText is the Caller text
+        */
+        IMPORT_C void SetCallerText( const TDesC& aCallerText );
+        
+        /**
+        * Returns the call Caller text.
+        * @return Returns the Caller text
+        */
+        IMPORT_C const TDesC& CallerText() const;
+
+        /**
+        * Sets CLI used in conference call participant list. 
+        * @param aCLIType CLI type.
+        */
+        IMPORT_C void SetParticipantListCLI(
+            TPhoneParticipantListCLI aCLIType );
+            
+        /**
+        * Gets CLI type used in conference call participant list. 
+        * @return CLI type.
+        */
+        IMPORT_C TPhoneParticipantListCLI ParticipantCLI() const;
+        
+        /**
+        * Returns the status of Thumbnail.
+        * @return Returns ETrue if thumbnail exist in contact
+        */
+        IMPORT_C TBool HasThumbnail() const;
+        
+        /**
+        * Sets the Thumbnail status
+        * @param aStatus status of thumbnail in contact
+        */
+        IMPORT_C void SetHasThumbnail( TBool aStatus );
+
+        /**
+        * Sets the ciphering indicator allowed or hidden
+        * @param aAllowed EFalse to prevent ciphering indicator from showing
+        *                 ETrue to enable
+        */
+        IMPORT_C void SetCipheringIndicatorAllowed( TBool aAllowed );
+        
+        /**
+        * Returns the ciphering indicator allowed status
+        * @return Returns EFalse when ciphering indicator is wanted to be disabled
+        *         ETrue to be allowed
+        */
+        IMPORT_C TBool CipheringIndicatorAllowed() const;        
+        
+        /**
+         * Set service id. See Service Provider Settings API
+         * @param Service id.
+         */
+        IMPORT_C void SetServiceId( TUint32 aServiceId );
+        
+        /**
+         * Returns service id. See Service Provider Settings API
+         * @return Service id.
+         */
+        IMPORT_C TUint32 ServiceId() const;
+        
+        /**
+         * Sets contact store link. See Virtual Phonebook API
+         * @param aContactStoreLink Contact store link
+         */
+        IMPORT_C void SetContactLink( const TDesC8& aContactLink );
+        
+        /**
+         * Returns contact store link. See Virtual Phonebook API
+         * @return Contact store link
+         */
+        IMPORT_C const TDesC8& ContactLink() const;
+        
+        /**
+         * Sets remote end phone number.
+         * @param aRemoteNumber Number to be set.
+         */
+        IMPORT_C void SetRemotePhoneNumber( const TDesC& aPhoneNumber );
+        
+        /**
+         * Remote phone number.
+         * @return Phone number for remote end.
+         */
+        IMPORT_C const TDesC& RemotePhoneNumber() const;
+    private:    
+        
+        /**
+        * Call header label text
+        */
+        TBuf<KPhoneCallHeaderLabelMaxLength> iLabelText;
+
+        /**
+        * Call header short label text
+        */
+        TBuf<KPhoneCallHeaderLabelMaxLength> iShortLabelText;
+
+        /**
+        * Call header call state
+        */
+        TInt iCallState;
+
+        /**
+        * Call header call type
+        */
+        TInt iCallType;
+
+        /**
+        * Call header number type
+        */
+        TInt iNumberType;
+
+        /**
+        * Call header ciphering status
+        */
+        TBool iCiphering;
+
+        /**
+        * Call header CLI Text
+        */
+        TBuf<KCntMaxTextFieldLength> iCLIText;
+
+        /**
+         * Clipping direction of the CLI text.
+         */
+        TPhoneTextClippingDirection iCLITextClippingDirection;
+       
+        /**
+         * Clipping direction of the CLI text.
+         */
+//        CBubbleManager::TPhoneClippingDirection iCNAPTextClippingDirection;
+        TPhoneTextClippingDirection iCNAPTextClippingDirection;
+        
+        /**
+        * Call header CNAP Text
+        */
+        TBuf<KCntMaxTextFieldLength> iCNAPText;
+
+        /**
+        * Call header picture data
+        */
+        TPtrC iPicture;
+        
+        TBool iLine2;
+        
+        /**
+        * Thumbnail image
+        */
+        CFbsBitmap* iThumbnail;
+        
+        /**
+        * Caller text
+        */
+        TPtrC iCallerText;
+        
+        /**
+        * Conference call participant list CLI.
+        */
+        TPhoneParticipantListCLI iParticipantListCLI;
+        
+        /**
+        * Thumbnail contact status
+        */
+        TBool iHasThumbnail;
+        
+        /**
+        * Ciphering indicator allowed status
+        */
+        TBool iCipheringIndicatorAllowed;
+        
+        /**
+         * Service id
+         * See Service Provider Settings API
+         */
+        TUint32 iServiceId;
+        
+        /**
+         * Contact store link
+         * See Virtual Phonebook API
+         */
+        TPtrC8 iContactLink;
+        
+        /**
+         * Remote phone number
+         */
+        TPtrC iRemotePhoneNumber;
+
+        /**
+         * Call divert status.
+         */
+        TBool iDiverted;        
+    };
+
+#endif // __TPHONECMDPARAMCALLHEADERDATA_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamcallstatedata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMCALLSTATEDATA_H
+#define __TPHONECMDPARAMCALLSTATEDATA_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for call header information.
+*/
+class TPhoneCmdParamCallStateData : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamCallStateData();
+
+    public: 
+        
+        /**
+        * Sets the call header call state.
+        * @param aCallState is the call state
+        */
+        IMPORT_C void SetCallState( TInt aCallState );
+        
+        /**
+        * Sets the call id.
+        * @param aCallId is the call id
+        */
+        IMPORT_C void SetCallId( TInt aCallId );
+
+        /**
+        * Returns the call header call state.
+        * @return Returns the call state
+        */
+        IMPORT_C TInt CallState() const;
+        
+        /**
+        * Returns the call id.
+        * @return Returns the call id
+        */
+        IMPORT_C TInt CallId() const;   
+
+    private:    
+
+        /**
+        * Call header call state
+        */
+        TInt iCallState;
+
+        /**
+        * Call id
+        */
+        TInt iCallId;
+
+    };
+
+#endif // _TPHONECMDPARAMCALLSTATEDATA_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamcustomdialer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parameter class for custom dialer creation
+*
+*/
+
+
+#ifndef TPHONECMDPARAMCUSTOMDIALER_H_
+#define TPHONECMDPARAMCUSTOMDIALER_H_
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+
+class MPhoneDialerController;
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for one integer value.
+*  
+*/
+class TPhoneCmdParamCustomDialer : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamCustomDialer();
+
+    public: 
+        
+        /**
+        * Sets the custom dialer 
+        * @param aDialerController Reference to custom dialer controller
+        */
+        IMPORT_C void SetDialerController( MPhoneDialerController* aDialerController );
+
+        /**
+        * Returns pointer to custom dialer controller
+        */
+        IMPORT_C MPhoneDialerController* DialerController();
+
+    private:   
+
+        MPhoneDialerController* iCustomDialer;
+    };
+
+
+#endif /*TPHONECMDPARAMCUSTOMDIALER_H_*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamdynmenu.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parameter class for dynamic menu generation
+*
+*/
+
+#ifndef __TPHONECMDPARAMDYNMENU_H
+#define __TPHONECMDPARAMDYNMENU_H
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for one integer value.
+*  
+*/
+class TPhoneCmdParamDynMenu : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamDynMenu();
+
+    public: 
+        
+        /**
+        * Sets the resourceId value
+        * @param aInteger is integer value
+        */
+        IMPORT_C void SetResourceId( TInt aInteger );
+
+        /**
+        * Sets the DynMenu pointer value
+        * @param aPointer is integer value
+        */
+        IMPORT_C void SetDynMenu( TAny* aPointer );
+
+        /**
+        * Returns the integer.
+        * @return Returns the carried integer
+        */
+        IMPORT_C  TInt ResourceId() const;
+
+        /**
+        * Returns the integer.
+        * @return Returns the pointer
+        */
+        IMPORT_C TAny* DynMenu();
+
+    private:   
+
+        /**
+        * The integer
+        */
+        TInt iResourceId;
+
+        TAny* iDynMenu;
+    };
+
+#endif      // __TPHONECMDPARAMDYNMENU_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamemergencycallheaderdata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMEMERGENCYCALLHEADERDATA_H
+#define __TPHONECMDPARAMEMERGENCYCALLHEADERDATA_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for emergency call header information.
+*/
+class TPhoneCmdParamEmergencyCallHeaderData : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamEmergencyCallHeaderData();
+
+    public: 
+        
+        /**
+        * Sets the call header label text.
+        * @param aLabelText is the label
+        */
+        IMPORT_C void SetLabelText( const TDesC& aLabelText );
+
+        /**
+        * Sets the call header text
+        * @param aHeaderText is the short label
+        */
+        IMPORT_C void SetHeaderText( const TDesC& aHeaderText );
+
+        /**
+        * Sets the call header voice privacy status.
+        * @param aCiphering is ETrue if voice privacy is on.
+        */
+        IMPORT_C void SetCiphering( TBool aCiphering );
+
+        /**
+        * Sets the call header own phone number text
+        * @param aOwnNumberText is the user's phone number
+        */
+        IMPORT_C void SetOwnPhoneNumberText( 
+            const TDesC& aOwnPhoneNumberText );
+
+        /**
+        * Returns the call header label text
+        * @return Returns the label
+        */
+        IMPORT_C const TDesC& LabelText() const;
+
+        /**
+        * Returns the call header text.
+        * @return Returns the header
+        */
+        IMPORT_C const TDesC& HeaderText() const;
+
+        /**
+        * Returns the call header ciphering status.
+        * @return Returns ETrue if ciphering is on 
+        */
+        IMPORT_C TBool Ciphering() const;
+
+        /**
+        * Returns the own phone number text.
+        * @return Returns the own phone number text
+        */
+        IMPORT_C const TDesC& OwnPhoneNumberText() const;
+
+        /**
+        * Sets the ciphering indicator allowed or hidden
+        * @param aAllowed EFalse to prevent ciphering indicator from showing
+        *                 ETrue to enable
+        */
+        IMPORT_C void SetCipheringIndicatorAllowed( TBool aAllowed );
+        
+        /**
+        * Returns the ciphering indicator allowed status
+        * @return Returns EFalse when ciphering indicator is wanted to be disabled
+        *         ETrue to be allowed
+        */
+        IMPORT_C TBool CipheringIndicatorAllowed() const;
+        
+    private:    
+        
+        /**
+        * Call header label text
+        */
+        TPtrC iLabelText;
+
+        /**
+        * Call header text
+        */
+        TPtrC iHeaderText;
+
+        /**
+        * Call header ciphering status
+        */
+        TBool iCiphering;
+
+        /**
+        * Call header own phone number Text
+        */
+        TPtrC iOwnPhoneNumberText;
+
+        /**
+        * Should the ciphering indicator be visible or not
+        */
+        TBool iCipheringIndicatorAllowed;
+        
+    };
+
+#endif // __TPHONECMDPARAMEMERGENCYCALLHEADERDATA_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamglobalnote.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMGLOBALNOTE_H
+#define __TPHONECMDPARAMGLOBALNOTE_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include <AknGlobalNote.h> // for CAknGlobalNote
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for global note information.
+*/
+class TPhoneCmdParamGlobalNote : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamGlobalNote();
+
+    public: 
+        
+        /**
+        * Sets the global note type.
+        * @param aType is the global note type
+        */
+        IMPORT_C void SetType( TAknGlobalNoteType aType );
+
+        /**
+        * Sets the text resource ID for the global note
+        * @param aResourceId is the global note resource ID
+        */
+        IMPORT_C void SetTextResourceId( TInt aTextResourceId );
+
+        /**
+        * Sets the text for the global note.
+        * @param aText is the global note text
+        */
+        IMPORT_C void SetText( const TDesC& aText );
+
+        /**
+        * Sets the global note tone.
+        * @param aTone is the note tone
+        */
+        IMPORT_C void SetTone( TInt aTone );
+       
+        /**
+        * Sets the global note wait status.
+        * @param aStatus Wait for completed or not
+        */
+        IMPORT_C void SetWaitForReady( TBool aStatus );
+        
+        /**
+        * Sets the global note softkeys.
+        * @param aTone is the note softkeys
+        */
+        IMPORT_C void SetSoftkeys( TInt aSoftkeys );
+
+        /**
+        * Sets timeout for a note.
+        * @param    aTimeout    Timeout in milliseconds. If timeout == 0 then 
+        * default timeout is used. If timeout < 0 the note is not closed 
+        * automatically.
+        */
+        IMPORT_C void SetTimeout( TInt aTimeout );
+        
+        /**
+        * Returns the global note type
+        * @return Returns the type
+        */
+        IMPORT_C TAknGlobalNoteType Type() const;
+
+        /**
+        * Returns the global note text resource ID.
+        * @return Returns the global note text resource ID.
+        */
+        IMPORT_C TInt TextResourceId() const;
+
+        /**
+        * Returns the global note text
+        * @return Returns the text
+        */
+        IMPORT_C const TDesC& Text() const;
+
+        /**
+        * Returns the global note tone.
+        * @return Returns the global note tone
+        */
+        IMPORT_C TInt Tone() const;
+        
+        /**
+        * Gets the global note wait status
+        * @return  ETrue if wait for completed
+        */
+        IMPORT_C TBool WaitForReady() const;
+        
+        /**
+        * Returns the global note softkeys.
+        * @return Returns the global note softkeys
+        */
+        IMPORT_C TInt Softkeys() const;
+        
+        /**
+         * Returns the timeout value.
+         * @return   Timeout value.
+         */
+        IMPORT_C TInt Timeout() const;
+    
+    private:    
+        
+        /**
+        * Global note type
+        */
+        TAknGlobalNoteType iType;
+
+        /**
+        * Global note text resource ID
+        */
+        TInt iTextResourceId;
+
+        /**
+        * Global note text
+        */
+        TPtrC iText;
+
+        /**
+        * Global note tone
+        */
+        TInt iTone;
+        
+        /**
+        * Wait for ready status
+        */
+        TBool iWaitforReady;
+        
+        /**
+        * Global note softkeys
+        */
+        TInt iSoftkeys;
+        
+        /**
+        * Timeout for a note.
+        */
+        TInt iTimeout;
+    };
+
+#endif // __TPHONECMDPARAMGLOBALNOTE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamincallindicatordata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMINCALLINDICATORDATA_H
+#define __TPHONECMDPARAMINCALLINDICATORDATA_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for call header information.
+*/
+class TPhoneCmdParamIncallIndicatorData : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamIncallIndicatorData();
+
+    public: 
+        
+        /**
+        * Sets the incall indicator call state.
+        * @param aCallState is the call state
+        */
+        IMPORT_C void SetCallState( TInt aCallState );
+       
+        /**
+        * Sets the incall indicator mode.
+        * @param aMode is the mode status
+        */
+        IMPORT_C void SetMode( TInt aMode );
+       
+        /**
+        * Sets the incall indicator mute status.
+        * @param aMute is the mute status
+        */
+        IMPORT_C void SetMute( TBool aMute );
+
+        /**
+        * Sets the incall indicator ciphering status.
+        * @param aCiphering is ETrue if ciphering is on.
+        */
+        IMPORT_C void SetCiphering( TBool aCiphering );
+
+        /**
+        * Sets the incall indicator emergency status.
+        * @param aEmergency is ETrue if emergency mode is on.
+        */
+        IMPORT_C void SetEmergency( TBool aEmergency );
+
+        /**
+        * Sets the incall indicator line2 status.
+        * @param aLine2 is the line2 status
+        */
+        IMPORT_C void SetLine2( TBool aLine2 );
+        
+        /**
+        * Returns the incall indicator call state.
+        * @return Returns the call state
+        */
+        IMPORT_C TInt CallState() const;
+
+        /**
+        * Returns the incall indicator mode.
+        * @return Returns the call state
+        */
+        IMPORT_C TInt Mode() const;
+
+        /**
+        * Returns the incall indicator mute status.
+        * @return Returns ETrue if mute is on 
+        */
+        IMPORT_C TBool Mute() const;
+
+        /**
+        * Returns the incall indicator ciphering status.
+        * @return Returns ETrue if ciphering is on 
+        */
+        IMPORT_C TBool Ciphering() const;
+
+        /**
+        * Returns the incall indicator emergency status.
+        * @return Returns ETrue if emergency mode is on 
+        */
+        IMPORT_C TBool Emergency() const;
+        
+        /**
+        * Returns the incall indicator line2 status.
+        * @return Returns ETrue if call is in line2 
+        */
+        IMPORT_C TBool Line2() const;
+        
+        /**
+        * Sets the little bubble visible or hidden
+        * @param aVisible EFalse to prevent little bubble from showing
+        *                 ETrue to set visible
+        */
+        IMPORT_C void SetLittleBubbleVisible( TBool aVisible );
+        
+        /**
+        * Returns the little bubble visible status
+        * @return Returns EFalse when little bubble is wanted to be hidden
+        *         ETrue to be visible
+        */
+        IMPORT_C TBool LittleBubbleVisible() const;
+
+        /**
+        * Sets the ciphering indicator allowed or hidden
+        * @param aAllowed EFalse to prevent ciphering indicator from showing
+        *                 ETrue to enable
+        */
+        IMPORT_C void SetCipheringIndicatorAllowed( TBool aAllowed );
+        
+        /**
+        * Returns the ciphering indicator allowed status
+        * @return Returns EFalse when ciphering indicator is wanted to be disabled
+        *         ETrue to be allowed
+        */
+        IMPORT_C TBool CipheringIndicatorAllowed() const;
+        
+    private:    
+        
+        /**
+        * Incall indicator call state
+        */
+        TInt iCallState;
+
+        /**
+        * Incall indicator mode
+        */
+        TInt iMode;
+
+        /**
+        * Incall indicator mute status
+        */
+        TBool iMute;
+
+        /**
+        * Incall indicator ciphering status
+        */
+        TBool iCiphering;
+
+        /**
+        * Incall indicator emergency status
+        */
+        TBool iEmergency;
+        
+        /**
+        * Incall indicator line2 status
+        */
+        TBool iLine2;
+        
+        /**
+        * Should the little bubble be visible or not
+        */
+        TBool iLittleBubbleVisible;
+
+        /**
+        * Should the ciphering indicator be visible or not
+        */
+        TBool iCipheringIndicatorAllowed;
+        
+    };
+
+#endif // __TPHONECMDPARAMINCALLINDICATORDATA_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparaminteger.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parameter class for TInt.
+*
+*/
+
+#ifndef TPHONECMDPARAMINTEGER_H
+#define TPHONECMDPARAMINTEGER_H
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for one integer value.
+*  
+*/
+class TPhoneCmdParamInteger : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamInteger();
+
+    public: 
+        
+        /**
+        * Sets the integer value
+        * @param aInteger is integer value
+        */
+        IMPORT_C void SetInteger( TInt aInteger );
+
+        /**
+        * Returns the integer.
+        * @return Returns the carried integer
+        */
+        IMPORT_C TInt Integer() const;
+
+    private:   
+
+        /**
+        * The integer
+        */
+        TInt iInteger;
+    };
+
+#endif      // TPHONECMDPARAMINTEGER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamkeyevent.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMKEYEVENT_H
+#define __TPHONECMDPARAMKEYEVENT_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for key event information.
+*/
+class TPhoneCmdParamKeyEvent : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamKeyEvent();
+
+    public: 
+        
+        /**
+        * Sets the key event.
+        * @param aKeyEvent is the key event
+        */
+        IMPORT_C void SetKeyEvent( const TKeyEvent& aKeyEvent );
+
+        
+        /**
+        * Sets the key event code.
+        * @param aEventCode is the key event code
+        */
+        IMPORT_C void SetEventCode( TEventCode aEventCode );
+
+        /**
+        * Returns the key event.
+        * @return Returns the key event
+        */
+        IMPORT_C const TKeyEvent KeyEvent() const;
+
+
+        /**
+        * Returns the key code.
+        * @return Returns the key code
+        */
+        IMPORT_C TEventCode EventCode() const;
+
+    private:    
+        
+        /**
+        * Key event
+        */
+        TKeyEvent iKeyEvent;
+
+        /**
+        * Key event code
+        */
+        TEventCode iEventCode;
+
+    };
+
+#endif // __TPHONECMDPARAMKEYEVENT_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparammessageeditor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     A paramater class for opening message editors.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMMESSAGEEDITOR_H
+#define __TPHONECMDPARAMMESSAGEEDITOR_H
+
+//  INCLUDES
+#include <CMessageData.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A paramater class for identifying view.
+*/
+class TPhoneCmdParamMessageEditor : public TPhoneUICommandParam
+    {   
+    public:
+
+        /**
+        * Constructor.
+        */
+        IMPORT_C TPhoneCmdParamMessageEditor();
+
+        /**
+        * Sets the message editor data.
+        * @param    aMessageData
+        * @return   None.
+        */
+        IMPORT_C void SetMessageData( CMessageData* aMessageData );
+
+        /**
+        * Returns message editor data.
+        * @param    None.
+        * @return   iMessageData.
+        */
+        IMPORT_C CMessageData* MessageData() const;
+
+  private:    
+  
+        /**
+        * Message Editor Data.
+        */
+        CMessageData* iMessageData;
+
+    };
+
+#endif // __TPHONECMDPARAMMESSAGEEDITOR_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamnote.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMNOTE_H
+#define __TPHONECMDPARAMNOTE_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include <aknnotedialog.h> 
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+/**
+* Enumerates note types
+*
+* EPhoneNoteError - error note
+* EPhoneNoteWarning - warning note
+* EPhoneNoteInformation - information note
+* EPhoneNoteConfirmation - confirmation note
+* EPhoneNoteCustom - custom note
+* EPhoneNotePermanent - custom permanent note
+* EPhoneNoteDtmfSending - Dtmf sending note
+* EPhoneNoteSecurity - security note
+*/
+enum TPhoneNoteType
+{
+    EPhoneNoteError,
+    EPhoneNoteWarning,
+    EPhoneNoteInformation,
+    EPhoneNoteConfirmation,
+    EPhoneNoteCustom,
+    EPhoneNotePermanent,
+    EPhoneNoteDtmfSending,
+    EPhoneNoteSecurity,
+    EPhoneNoteUIDisabled
+};
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for note dialog information.
+*/
+class TPhoneCmdParamNote : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamNote();
+
+    public: 
+        
+        /**
+        * Sets the note type
+        * @param aType is the note type
+        */
+        IMPORT_C void SetType( TPhoneNoteType aType );
+
+        /**
+        * Sets the resource ID for the note
+        * @param aResourceId is the note resource ID
+        */
+        IMPORT_C void SetResourceId( TInt aResourceId );
+
+        /**
+        * Sets the text resource ID for the note
+        * @param aResourceId is the note resource ID
+        */
+        IMPORT_C void SetTextResourceId( TInt aTextResourceId );
+
+        /**
+        * Sets the text for the note
+        * @param aText is the note text
+        */
+        IMPORT_C void SetText( const TDesC& aText );
+
+        /**
+        * Sets the note tone.
+        * @param aTone is the note tone
+        */
+        IMPORT_C void SetTone( CAknNoteDialog::TTone aTone );
+       
+        /**
+        * Sets the note timeout.
+        * @param aTimeout is the note timeout
+        */
+        IMPORT_C void SetTimeout( CAknNoteDialog::TTimeout aTimeout );
+
+        /**
+        * Returns the note type
+        * @return Returns the type
+        */
+        IMPORT_C TPhoneNoteType Type() const;
+
+        /**
+        * Returns the note resource ID.
+        * @return Returns the note resource ID.
+        */
+        IMPORT_C TInt ResourceId() const;
+
+        /**
+        * Returns the note text resource ID.
+        * @return Returns the note text resource ID.
+        */
+        IMPORT_C TInt TextResourceId() const;
+
+        /**
+        * Returns the note text.
+        * @return Returns the note text.
+        */
+        IMPORT_C const TDesC& Text() const;
+
+        /**
+        * Returns the note tone.
+        * @return Returns the note tone
+        */
+        IMPORT_C CAknNoteDialog::TTone Tone() const;
+
+        /**
+        * Returns the note timeout.
+        * @return Returns the note timeout 
+        */
+        IMPORT_C CAknNoteDialog::TTimeout Timeout() const;
+
+    private:    
+        
+        /**
+        * Note type
+        */
+        TPhoneNoteType iType;
+
+        /**
+        * Note resource ID
+        */
+        TInt iResourceId;
+
+        /**
+        * Note text resource ID
+        */
+        TInt iTextResourceId;
+
+        /**
+        * Note text
+        */
+        TPtrC iText;
+
+        /**
+        * Note tone
+        */
+        CAknNoteDialog::TTone iTone;
+
+        /**
+        * Note timeout
+        */
+        CAknNoteDialog::TTimeout iTimeout;
+    };
+
+#endif // __TPHONECMDPARAMNOTE_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamnumberentryobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+
+#ifndef __TPHONECMDPARAMNUMBERENTRYOBSERVER_H
+#define __TPHONECMDPARAMNUMBERENTRYOBSERVER_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for key event information.
+*/
+class TPhoneCmdParamNumberEntryObserver : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamNumberEntryObserver();
+
+    public: 
+        
+        /**
+        * Sets the callback function
+        * @param aKeyEvent is the callback function
+        */
+        IMPORT_C void SetObserver( TCallBack aCallBack );
+
+        /**
+        * Returns the observer.
+        * @return Returns the observer
+        */
+        IMPORT_C TCallBack Observer();
+
+    private:    
+        
+        TCallBack iCallBack;
+    };
+
+#endif // __TPHONECMDPARAMNUMBERENTRYOBSERVER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparampointer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parameter class for TAny type pointer.
+*
+*/
+
+#ifndef TPHONECMDPARAMPOINTER_H
+#define TPHONECMDPARAMPOINTER_H
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for address pointer.
+*  
+*/
+class TPhoneCmdParamPointer : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamPointer();
+
+    public: 
+        
+        /**
+        * Sets the pointer address
+        * @param aInteger is integer value
+        */
+        IMPORT_C void SetPointer( TAny* aPointer );
+
+        /**
+        * Returns the address pointer.
+        * @return Returns address of the pointer
+        */
+        IMPORT_C TAny* Pointer() const;
+
+    private:   
+
+        /**
+        * The address pointer
+        */
+        TAny* iPointer;
+    };
+
+#endif      // TPHONECMDPARAMPOINTER_H   
+          
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamprogressnote.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef TPHONECMDPARAMPROGRESSNOTE_H
+#define TPHONECMDPARAMPROGRESSNOTE_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include <aknnotedialog.h> 
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for note dialog information.
+*/
+class TPhoneCmdParamProgressNote : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamProgressNote();
+
+    public: 
+
+        /**
+        * Sets the resource ID for the note
+        * @param aResourceId is the note resource ID
+        */
+        IMPORT_C void SetResourceId( TInt aResourceId );
+        
+         /**
+        * Sets the wait time for the note
+        * @param aWaitTime is the note wait time
+        */
+        IMPORT_C void SetWaitTime( TTimeIntervalMicroSeconds32 aTime );
+
+        /**
+        * Returns the note resource ID.
+        * @return Returns the note resource ID.
+        */
+        IMPORT_C TInt ResourceId() const;
+        
+        /**
+        * Returns the note wait time
+        * @return Returns the note wait time.
+        */
+        IMPORT_C TTimeIntervalMicroSeconds32 WaitTime() const;
+
+    private:    
+
+        /**
+        * Note resource ID
+        */
+        TInt iResourceId;
+        
+        /**
+        * Note wait time
+        */
+        TTimeIntervalMicroSeconds32 iWaitTime;
+    };
+
+#endif // TPHONECMDPARAMPROGRESSNOTE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamquery.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,319 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parameter class for query dialogs.
+*
+*/
+
+#ifndef __TPHONECMDPARAMQUERY_H
+#define __TPHONECMDPARAMQUERY_H
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+#include "tcbacommandmapping.h"
+#include "mphonequerycommandobserver.h"
+#include <bamdesca.h>
+
+// DATA TYPES
+enum TPhoneQueryType
+    {
+    EPhoneQueryDialog,
+    EPhoneTextQueryDialog,
+    EPhoneGlobalQueryDialog,  
+    EPhoneDtmfListQueryDialog,
+    EPhoneDtmfTextQuery,
+    EPhoneContactsListQuery,
+    EPhoneGlobalMsgQuery,
+    EPhoneGenericTextQuery,
+    EPhoneGlobalWaitNote, // This is special case cause its note with softkeys
+    EPhoneCustomListQueryDialog // Custom list query.
+    };
+
+/** Maximum number of configurable CBA command mappings.*/
+const TInt KMaxNumberOfCbaCommandMappings = 4;
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for query dialogs.
+*  
+*/
+class TPhoneCmdParamQuery : public TPhoneUICommandParam
+    {
+    public:
+        
+        /**
+         * C++ default constructor.
+         */
+        IMPORT_C TPhoneCmdParamQuery();
+        
+        /**
+         * C++ copy constructor.
+         */
+        IMPORT_C TPhoneCmdParamQuery( const TPhoneCmdParamQuery& aParam );
+        
+        /**
+         * C++ assignment operator.
+         */
+        IMPORT_C TPhoneCmdParamQuery& operator=( 
+            const TPhoneCmdParamQuery& aParam );
+        
+    public: 
+        
+        /**
+        * Sets the resource id for dialog
+        * @param aDialogResourceId is integer value
+        */
+        IMPORT_C void SetQueryResourceId( TInt aDialogResourceId );
+
+        /**
+        * Returns the dialog resource id.
+        * @return Returns the carried resource id
+        */
+        IMPORT_C TInt QueryResourceId() const;
+        
+        /**
+        * Sets the dialog prompt
+        * @param aDialogPrompt is dialog prompt text
+        */
+        IMPORT_C void SetQueryPrompt( const TDesC& aDialogPrompt );
+
+        /**
+        * Returns the dialog prompt.
+        * @return Returns the dialog prompt text
+        */
+        IMPORT_C const TDesC& QueryPrompt() const;
+        
+        /**
+        * Sets the default cba resource
+        * @param aCbaResourceId is integer value
+        */
+        IMPORT_C void SetDefaultCba( TInt aCbaResourceId );
+        
+        /**
+        * Returns the default CBA's resource id
+        * @return Returns the carried default CBA resource id
+        */
+        IMPORT_C TInt DefaultCba() const;
+        
+        /**
+        * Sets the content cba resource.
+        * These CBAs get displayed when there is some text/numbers in the the dialog.
+        * @param aCbaResourceId is integer value
+        */
+        IMPORT_C void SetContentCba( TInt aCbaResourceId );
+        
+        /**
+        * Returns the content CBA's resource id
+        * @return Returns the carried content CBA resource id
+        */
+        IMPORT_C TInt ContentCba() const;
+        
+        /**
+        * Sets the data text for dialog
+        * @param aDataText is TDes pointer
+        */
+        IMPORT_C void SetDataText( TDes* aDataText );
+        
+        /**
+        * Returns the data text
+        * @return Returns the pointer to data text
+        */
+        IMPORT_C TDes* DataText() const;
+        
+        /**
+        * Sets the query type
+        * @param query type
+        */
+        IMPORT_C void SetQueryType( TPhoneQueryType aQueryType );
+        
+        /**
+        * Returns the query type
+        * @return query type
+        */
+        IMPORT_C TPhoneQueryType QueryType() const;
+
+        /**
+        * Sets the send key enable status.
+        * @param aSendKeyEnabled is ETrue if the send key can be
+        *  processed by the query.
+        */
+        IMPORT_C void SetSendKeyEnabled( TBool aSendKeyEnabled );
+
+        /**
+        * Returns the send key enabled status.
+        * @return Returns ETrue if the send key can be processed by the query 
+        */
+        IMPORT_C TBool SendKeyEnabled() const;
+        
+        /**
+        * Sets the command param id.
+        * @param aParamId command id
+        */
+        IMPORT_C void SetCommandParamId( TPhoneCommandParam::TPhoneParamId aParamId );
+
+        /**
+        * Sets the timeout in milliseconds.
+        * Query will destroyed after this time 
+        * @param aTimeOut is integer value
+        */
+        IMPORT_C void SetTimeOut( TInt aTimeOut );
+
+        /**
+        * Gets the timeout of global query.
+        */
+        IMPORT_C TInt TimeOut() const;
+
+        /**
+        * Sets query dialog tone identifier.
+        * @param    aTone   Identifier for a tone to play with dialog.
+        */
+        IMPORT_C void SetTone( TInt aTone );
+        
+        /**
+        * Gets query dialog tone identifier.
+        * @return   Identifier for a tone to play with dialog. 
+        */
+        IMPORT_C TInt Tone() const;
+        
+        /**
+         * Sets mapping from CBA command to customized one.
+         * @param    aCbaCommandId      CBA command identifier.
+         * @param    aCustomCommandId   Custom command identifier.
+         */
+        IMPORT_C void SetCbaCommandMapping( 
+            TInt aCbaCommandId, TInt aCustomCommandId );
+        
+        /**
+         * Returns custom command mapped to given CBA command. 
+         * If mapping is not defined, CBA command is returned.
+         * @return  Custom command identifier for CBA command.
+         */
+        IMPORT_C TInt CbaCommandMapping( TInt aCbaCommandId ) const;
+
+        /**
+         * Sets custom command to be used if query time outs.
+         * @param    aCustomCommandId   Custom command identifier.
+         */
+        IMPORT_C void SetCustomCommandForTimeOut( TInt aCustomCommandId );
+        
+        /**
+         * Gets custom command to use if query time outs.
+         * @param   aCustomCommandId    Custom command, if defined. 
+         * @return  KErrNotFound if not defined, KErrNone otherwise.
+         */
+        IMPORT_C TInt GetCustomCommandForTimeOut( TInt& aCustomCommandId ) const;
+        
+
+        /**
+         * Sets observer for query commands.
+         * @param    aObserver   Command Observer. Ownership NOT
+         *                       transferred.
+         */
+        IMPORT_C void SetQueryCommandObserver( 
+                MPhoneQueryCommandObserver& aObserver );
+
+        /**
+         * Returns observer for query commands.
+         * @return    Query command observer (NULL if not setted). 
+         *            Ownership NOT transferred.
+         */
+        IMPORT_C MPhoneQueryCommandObserver* QueryCommandObserver();
+        
+        /**
+         * Sets item text array for custom list query.
+         * @param    aItemTextArray   Item text array.
+         */
+        IMPORT_C void SetItemTextArrayForListQuery( 
+                MDesCArray& aItemTextArray );
+
+        /**
+         * Returns item text array for custom list query.
+         * @return    Item text array (NULL if not setted). 
+         */
+        IMPORT_C MDesCArray* ItemTextArrayForListQuery() const;
+        
+    private:   
+
+        /**
+        * The dialog resource id
+        */
+        TInt iDialogResourceId;
+        
+        /**
+        * The dialog prompt
+        */
+        TPtrC iDialogPrompt;
+
+        /**
+        * The default CBA resource id
+        */
+        TInt iDefaultCbaResourceId;
+        
+        /**
+        * The content CBA resource id
+        */
+        TInt iContentCbaResourceId;
+        
+        /**
+        * The data text
+        */
+        TDes* iDataText;
+        
+        /**
+        * Query type
+        */
+        TPhoneQueryType iQueryType;
+
+        /**
+        * The send key enabled status
+        */
+        TBool iSendKeyEnabled;
+
+        /**
+        * The timeout
+        */
+        TInt iTimeOut;
+        
+        /**
+         * Query dialog tone.
+         */
+        TInt iTone;
+        
+        /**
+         * CBA command <-> custom command mappings.
+         */
+        TFixedArray<TCbaCommandMapping, KMaxNumberOfCbaCommandMappings> 
+            iCbaCommandMappings;
+        
+        /**
+         * Custom command to be used if query time outs.
+         */
+        TInt iCustomCmdForTimeOut;
+
+        /**
+         * Query command observer.
+         * Not own.
+         */
+        MPhoneQueryCommandObserver* iCommandObserver;
+
+        /**
+         * Item text array for custom list query.
+         * Not own.
+         */
+        MDesCArray* iItemTextArray;
+    };
+
+#endif      // __TPHONECMDPARAMQUERY_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamreconnectquery.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef TPHONECMDPARAMRECONNECTQUERY_H
+#define TPHONECMDPARAMRECONNECTQUERY_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// FORWARD DECLARATION
+class MCaUiReconnectQueryObserver;
+class CPhCntMatcher;
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for displaying reconnect query.
+*/
+class TPhoneCmdParamReconnectQuery : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamReconnectQuery( MCaUiReconnectQueryObserver& aObserver );
+
+    public: 
+        
+        /**
+        * Sets the contact matcher.
+        * @param aPhCntMatcher pointer to contact matcher. NULL value allowed.
+        */
+        IMPORT_C void SetContactMatcher( CPhCntMatcher* aPhCntMatcher );
+
+        /**
+        * Sets the phone number.
+        * @param aPhoneNumber phone number
+        */
+        IMPORT_C void SetPhoneNumber( const TPtrC aPhoneNumber );
+
+        /**
+        * Sets the video call option to visible or hidden in reconnect query.
+        * @param aIncludeVideoCallOption EFalse to hide video call option, ETrue to show it.
+        */
+        IMPORT_C void SetIncludeVideoOption( const TBool aIncludeVideoCallOption );
+       
+        /**
+        * Returns the reference to reconnect query observer.
+        * @return Returns the reference to reconnect query observer.
+        */
+        IMPORT_C MCaUiReconnectQueryObserver& ReconnectQueryObserver() const;
+
+        /**
+        * Returns the contact matcher pointer.
+        * @return Returns the contact matcher pointer.
+        */
+        IMPORT_C CPhCntMatcher* ContactMatcher() const;
+
+        /**
+        * Returns the phone number.
+        * @return Returns the phone number.
+        */
+        IMPORT_C const TPtrC PhoneNumber() const;
+
+        /**
+        * Returns the video call option value.
+        * @return Returns the video call option value.
+        */
+        IMPORT_C TBool IncludeVideoCallOption() const;
+
+    private:    
+        
+        /**
+        * Reconnect query observer
+        */
+        MCaUiReconnectQueryObserver& iObserver;
+
+        /**
+        * Contact matcher
+        */
+        CPhCntMatcher* iContactMatcher;
+
+        /**
+        * Phone number
+        */
+        TPtrC iPhoneNumber;
+
+        /**
+        * Include video call option
+        */
+        TBool iIncludeVideoCallOption;
+    };
+
+#endif // TPHONECMDPARAMRECONNECTQUERY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamringtone.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef TPHONECMDPARAMRINGTONE_H
+#define TPHONECMDPARAMRINGTONE_H
+
+//  INCLUDES
+
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+enum TPhoneRingToneType
+    {
+    EPhoneRingToneProfile,
+    EPhoneRingTonePersonal
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for ring tone information.
+*/
+class TPhoneCmdParamRingTone : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamRingTone();
+
+    public: 
+        
+        /**
+        * Sets the ring tone type
+        * @param aRingToneType is the ring tone type
+        */
+        IMPORT_C void SetType( const TPhoneRingToneType aType );
+
+        /**
+        * Sets the ring tone volume
+        * @param aVolume is the ring tone volume
+        */
+        IMPORT_C void SetVolume( TInt aVolume );
+       
+        /**
+        * Sets the ring tone ringing type.
+        * @param aRingingType is the ring tone ringing type
+        */
+        IMPORT_C void SetRingingType( TInt aRingingType );
+       
+        /**
+        * Sets the ring tone 
+        * @param aRingTone is the ring tone
+        */
+        IMPORT_C void SetRingTone( const TDesC& aRingTone );
+
+        /**
+        * Sets the text to say
+        * @param aTextToSay is the text to say
+        */
+        IMPORT_C void SetTextToSay( const TDesC& aTextToSay );
+
+        /**
+        * Returns the ring tone type
+        * @return Returns the ring tone type
+        */
+        IMPORT_C TPhoneRingToneType Type() const;
+
+        /**
+        * Returns the ring tone volume
+        * @return Returns the ring tone volume
+        */
+        IMPORT_C TInt Volume() const;
+
+        /**
+        * Returns the ring tone ringing type.
+        * @return Returns the ring tone ringing type 
+        */
+        IMPORT_C TInt RingingType() const;
+
+        /**
+        * Returns the ring tone.
+        * @return Returns the ring tone
+        */
+        IMPORT_C const TDesC& RingTone() const;
+
+        /**
+        * Returns the text to say.
+        * @return Returns the text to say
+        */
+        IMPORT_C const TDesC& TextToSay() const;
+        
+        /**
+        * Sets status of caller text
+        * @param aStatus, caller text status 
+        */
+        IMPORT_C void SetCallerTextStatus( TBool aStatus );
+
+        /**
+        * Returns status of caller text
+        * @return Returns ETrue if used
+        */
+        IMPORT_C TBool IsCallerText();
+
+        /**
+        * Sets status of caller image
+        * @param aStatus, caller image status
+        */
+        IMPORT_C void SetCallerImageStatus( TBool aStatus );
+
+        /**
+        * Returns status of caller image
+        * @return Returns ETrue if used
+        */
+        IMPORT_C TBool IsCallerImage();
+
+    private:    
+        
+        /**
+        * Ring tone
+        */
+        TPtrC iRingTone;
+
+        /**
+        * Ring tone text to say
+        */
+        TPtrC iTextToSay;
+
+        /**
+        * Ring tone type
+        */
+        TPhoneRingToneType iType;
+
+        /**
+        * Ring tone volume
+        */
+        TInt iVolume;
+
+        /**
+        * Ring tone ringing type
+        */
+        TInt iRingingType;
+
+        /**
+        * Status of caller text
+        */
+        TBool iIsCallerText;
+        
+        /**
+        * Status of caller image
+        */
+        TBool iIsCallerImage;
+    };
+
+#endif // __TPHONECMDPARAMCALLHEADERDATA_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamsfidata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMSFIDATA_H
+#define __TPHONECMDPARAMSFIDATA_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for call header information.
+*/
+class TPhoneCmdParamSfiData : public TPhoneUICommandParam
+    {   
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamSfiData();
+
+    public: 
+        
+        /**
+        * Sets the call header label text.
+        * @param aLabel is the label
+        */
+        IMPORT_C void SetNumber( const TDesC& aLabelText );
+
+        /**
+        * Sets the call header short label text
+        * @param aShortLabel is the short label
+        */
+        IMPORT_C void SetName( const TDesC& aShortLabelText );
+
+        /**
+        * Returns the call header label text
+        * @return Returns the label
+        */
+        IMPORT_C const TDesC& Number() const;
+
+        /**
+        * Returns the call header short label text.
+        * @return Returns the short label
+        */
+        IMPORT_C const TDesC& Name() const;
+
+    private:    
+        
+        /**
+        * Call header label text
+        */
+        TPtrC iNumber;
+
+        /**
+        * Call header short label text
+        */
+        TPtrC iName;
+
+    };
+
+#endif // __TPHONECMDPARAMSFIDATA_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamsingleitemfetch.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parameter class for single item fetch dialogs.
+*
+*/
+
+#ifndef __TPHONECMDPARAMSINGLEITEMFETCH_H
+#define __TPHONECMDPARAMSINGLEITEMFETCH_H
+
+//  INCLUDES
+#include <cphcntsingleitemfetch.h>
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for query dialogs.
+*  
+*/
+class TPhoneCmdParamSingleItemFetch : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamSingleItemFetch();
+
+    public: 
+        
+        /**
+        * Sets the single item fetch type
+        * @param fetch type
+        */
+        IMPORT_C void SetType( CPhCntSingleItemFetch::TFetchType aType );
+        
+        /**
+        * Returns the single item fetch type
+        * @return fetch type
+        */
+        IMPORT_C CPhCntSingleItemFetch::TFetchType Type();
+
+        /**
+        * Sets the title pane resource id for the single item fetch dialog
+        * @param title pane resource id
+        */
+        IMPORT_C void SetTitlePaneResourceId( TInt aTitlePaneResourceId );
+
+        /**
+        * Returns the title pane resource id for the single item fetch dialog
+        * @return title pane resource id
+        */
+        IMPORT_C TInt TitlePaneResourceId() const;
+        
+        /**
+        * Sets the CBA resource id for the single item fetch dialog
+        * @param CBA resource id
+        */
+        IMPORT_C void SetCbaResourceId( TInt aCbaResourceId );
+
+        /**
+        * Returns the CBA resource id for the single item fetch dialog
+        * @return CBA resource id
+        */
+        IMPORT_C TInt CbaResourceId() const;
+        
+        /**
+        * Sets the string pointer used in the single item fetch dialog
+        * @param pointer to string used in dialog
+        */
+        IMPORT_C void SetString( TDes* aString );
+        
+        /**
+        * Returns the string pointer used for the single item fetch dialog
+        * @return string pointer used in dialog
+        */
+        IMPORT_C TDes* String() const;
+        
+    private:   
+
+        /**
+        * Fetch type
+        */
+        CPhCntSingleItemFetch::TFetchType iType;
+
+        /**
+        * The title pane resource id
+        */
+        TInt iTitlePaneResourceId;
+        
+        /**
+        * The CBA resource id
+        */
+        TInt iCbaResourceId;
+        
+        /**
+        * The fetch dialog string pointer
+        */
+        TDes* iString;
+        
+    };
+
+#endif      // __TPHONECMDPARAMSINGLEITEMFETCH_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamspeeddial.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+#ifndef TPHONECMDPARAMSPEEDDIAL_H
+#define TPHONECMDPARAMSPEEDDIAL_H
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+/**
+* Phone number types
+*
+* EPhoneNumberTypeNotFound - phone number's type was not found
+* EPhoneNumberTypeCS - CS call can be made to the phone number
+* EPhoneNumberTypeVideo - video call can be made to the phone number
+* EPhoneNumberTypeVoip - VoIP call can be made to the address.
+*/
+enum TPhoneNumberType
+{
+    EPhoneNumberTypeNotFound = -1,
+    EPhoneNumberTypeCS = 0,
+    EPhoneNumberTypeVideo,
+    EPhoneNumberTypeVoip
+};
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for one TDesC and TInt value.
+*  
+*/
+class TPhoneCmdParamSpeedDial : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamSpeedDial();
+
+    public: 
+        
+        /**
+        * Sets the phone number.
+        * @param aPhoneNumber is phone number in string format
+        */
+        IMPORT_C void SetPhoneNumber( TPtr* aPhoneNumber );
+
+        /**
+        * Returns the phone number.
+        * @return Returns the carried phone number string
+        */
+        IMPORT_C TPtr* PhoneNumber();
+        
+        /**
+        * Sets the phone number's type.
+        * @param aNumberType number type
+        */
+        IMPORT_C void SetNumberType( TPhoneNumberType aNumberType );
+        
+        /**
+        * Returns the phone number's type.
+        * @return phone number's type
+        */
+        IMPORT_C TPhoneNumberType NumberType();
+        
+        /**
+        * Sets the speed dial location.
+        * @param aLocation location to be set
+        */
+        IMPORT_C void SetLocation( TInt aLocation );
+        
+        /**
+        * Returns the speed dial location.
+        * @return values from 1 to 9 for succesfull location.
+        *         Values below 0 indicate unsuccesfull location fetch.
+        */
+        IMPORT_C TInt Location();
+
+        /**
+        * Sets the serviceId
+        * @param aServiceId The serviceId user has selected for speeddial
+        */
+        IMPORT_C void SetServiceId( TUint aServiceId ); 
+
+        /**
+        * Returns the serviceId
+        * @param aServiceId serviceId
+        */
+        IMPORT_C TUint ServiceId() const;
+
+    private:   
+
+        /**
+        * The phone number
+        */
+        TPtr* iPhoneNumber;
+        
+        /**
+        * The phone number's type
+        */
+        TPhoneNumberType iNumberType;
+        
+        /**
+        * Speed dial location
+        */
+        TInt iLocation;
+        /**
+        * The serviceId
+        */
+        TUint iServiceId;
+    };
+
+#endif      // TPHONECMDPARAMSPEEDDIAL_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamstring.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+#ifndef __TPHONECMDPARAMSTRING_H
+#define __TPHONECMDPARAMSTRING_H
+
+//  INCLUDES
+#include "tphonecommandparam.h"
+
+// CLASS DECLARATION
+
+/**
+*  A concrete parameter class for one TDesC value.
+*  
+*/
+class TPhoneCmdParamString : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamString();
+
+    public: 
+        
+        /**
+        * Sets the string value
+        * @param aString is string value
+        */
+        IMPORT_C void SetString( TPtr* aString );
+
+        /**
+        * Returns the string.
+        * @return Returns the carried string
+        */
+        IMPORT_C TPtr* String();
+
+    private:   
+
+        /**
+        * The string
+        */
+        TPtr* iString;
+    };
+
+#endif      // __TPHONECMDPARAMSTRING_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecmdparamtranseffect.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+
+#ifndef __TPHONECMDPARAMTRANSEFFECT_H
+#define __TPHONECMDPARAMTRANSEFFECT_H
+
+//  INCLUDES
+
+#include <w32std.h>
+#include <aknnotedialog.h> 
+#include "tphonecommandparam.h"
+
+// DATA TYPES
+
+/**
+* Enumerates effect types
+*
+* EPhoneTransitionEffectStart - TBD
+* EPhoneTransitionEffectStop - TBD 
+*/
+enum TPhoneTransEffectType
+    {
+    EPhoneTransEffectNone,
+    EPhoneTransEffectDialerOpen,
+    EPhoneTransEffectDialerClose,
+    EPhoneTransEffectDialerCreate,
+    EPhoneTransEffectStop
+    };
+
+// CLASS DECLARATION
+
+/**
+*  A parameter class for note dialog information.
+*/
+class TPhoneCmdParamTransEffect : public TPhoneUICommandParam
+    {   
+   
+    
+    public: 
+           
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamTransEffect();
+
+    public: 
+        
+        /**
+        * Sets the effect type
+        * @param aType is the effect type
+        */
+        IMPORT_C void SetType( TPhoneTransEffectType aType );
+
+ 
+        /**
+        * Returns the effect type
+        * @return Returns the type
+        */
+        IMPORT_C TPhoneTransEffectType Type() const;
+   
+    private:    
+        
+        /**
+        * Note type
+        */
+        TPhoneTransEffectType iType;
+
+    };
+
+#endif // __TPHONECMDPARAMTRANSEFFECT_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonecommandparam.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for all command parameter classes.
+*
+*/
+
+#ifndef TPHONECOMMANDPARAM_H
+#define TPHONECOMMANDPARAM_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// FORWARD DECLARATIONS
+class TPhoneCommandParam;
+
+// DATA TYPES
+typedef TPhoneCommandParam TPhoneUICommandParam;
+typedef TPhoneCommandParam TPhoneEngineCommandParam;
+
+// CLASS DECLARATION
+
+/**
+*  A base class for command parameter.
+*  
+*/
+class TPhoneCommandParam
+    {
+    public: // enum
+
+    /** TPhoneParamId is list of possible phone ui command parameters */
+    enum TPhoneParamId
+        {
+        EPAParamIdCallId = 200,
+        EPAParamIdKeyCode,
+        EPAParamIdDtmfString,
+        EPAParamIdPhoneNumber,
+        EPAParamIdAudioIHFMode,
+        EPAUIParamIdMOTerminationIndicator,
+        EPAUIParamIdMOSettingsIndication,
+        EPAUIParamCallControlState,
+        EPAUIParamIdMenuBar,
+        EPAUIParamIdChangeMenuBar,
+        EPAUIParamIdChangeToolBar,
+        EPAUIParamIdRemoteInfo,
+        EPAUIParamIdInformationBanner,
+        EPAUIParamIdCallStatusIndicator,    
+        EPAUIParamIdTerminationNote,
+        EPAUIParamIdViewId,
+        EPAUIParamIdKeyEvent,
+        EPAUIParamIdServiceReqResult,
+        EPAUIParamIdToolBar,
+        EPAUIParamIdEmergencyPhase,
+        EPAUIParamIdKeyCapture,    
+        EPAUIParamIdHscsd,
+        EPAUIParamIdUid,        
+        EPAUIParamAppInfo,
+        EPAUIParamIdSoftkeyName,
+        EPAUIParamIdGlobalIndicator, // for displaying global note
+        EPAUIParamIdCallGuard,
+        EPAUIParamIdSpeedDial,
+
+    // ----- USED TYPES ---------
+        EPhoneParamIdInteger,
+        EPhoneParamIdMenu,
+        EPhoneParamIdBoolean,
+        EPhoneParamIdKeyEvent,
+        EPhoneParamIdKeyCapture,
+        EPhoneParamIdString,
+        EPhoneParamIdNote,
+        EPhoneParamIdGlobalNote,
+        EPhoneParamIdCallHeaderData,
+        EPhoneParamIdEmergencyCallHeaderData,
+        EPhoneParamIdIncallIndicatorData,
+        EPhoneParamIdAppInfo,
+        EPhoneParamIdQuery,
+        EPhoneParamIdMessageEditor,
+        EPhoneParamIdCallStateData,
+        EPhoneParamIdSingleItemFetch,
+        EPhoneParamIdBitmap,
+        EPhoneParamIdSfiData,
+        EPhoneParamIdProgressNote,
+        EPhoneParamIdAudioOutput,
+        EPhoneParamIdAudioAvailable,
+        EPhoneParamIdRingTone,
+        EPhoneParamIdSpeedDial,
+        EPhoneParamIdReconnectQuery,
+        EPhoneParamIdVideoCallSetupFailedCreateVoiceCallToTheSameContactQuery,
+        EPhoneParamRebootQuery,
+        EPhoneParamIdUnattendedTransferAcceptanceQuery,
+        EPhoneParamIdCustomDialer,
+        EPhoneParamIdGlobalWaitNote,
+        EPhoneNumberEntryObserver,
+        EPhoneParamIdPointer,
+        // Add new params before this
+        EPhoneParamIdLast
+        };
+
+    public: 
+        
+        /**
+        * Method for checking the command parameter id.
+        * 
+        * @return Returns an id of the command parameter in question.
+        */
+        IMPORT_C TPhoneParamId ParamId() const;
+
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCommandParam();
+
+
+    protected:
+
+        /**
+        * Param ID.
+        */
+        TPhoneParamId iParamId;
+    };
+
+#endif // TPHONECOMMANDPARAM_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/inc/tphonetouchbuttonconfig.h	Fri Jun 04 10:19:18 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: Touch button configuration.
+*
+*/
+
+#ifndef TPHONETOUCHBUTTONCONFIG_H
+#define TPHONETOUCHBUTTONCONFIG_H
+
+#include <e32std.h>
+#include "phoneui.hrh"
+
+const TInt    KTelButtonsConfigKeyCount = 1; 
+
+/**
+ *  Touch button configuration.
+ *
+ *
+ *
+ *  @lib PhoneUiUtils.lib
+ *  @since S60 v5.0
+ */
+class TPhoneTouchButtonConfig
+    {
+public:
+    TPhoneTouchButtonConfig();
+
+    /**
+     * Read configuration from resource file.
+     *
+     * @since S60 5.0
+     * @return KErrNone if successful, otherwise error code.
+     */
+    TInt ReadConfiguration();
+   
+    /**
+     * Returns resource id from configuration.
+     *
+     * @since S60 5.0
+     * @param aButtons Requested configuration.
+     * @param aDefaultResourceId This is returned, if config is not found.  
+     * @return Resource id.
+     */
+    TInt ResourceId( TPhoneUIConfigurableButtons aButtons, 
+                     TInt aDefaultResourceId ) const;
+
+private:
+    void ReadCenRepKeysL( 
+            TFixedArray<TInt,KTelButtonsConfigKeyCount>& aKeyValues ) const;
+    void ReadConfigResourceL( 
+            const TFixedArray<TInt,KTelButtonsConfigKeyCount>& aKeyValues );
+    
+    inline TInt MapToCenRepKey( TInt aButtons ) const;
+    
+private:
+    TFixedArray<TInt,EPhoneButtonConfigCount> iConfiguration;
+    };
+
+#endif // TPHONETOUCHBUTTONCONFIG_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphoneLogger.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,589 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneLogger class.
+*
+*/
+
+
+// INCLUDE FILES
+// System includes
+#include <f32file.h> // for TParse, in Flogger stuff
+#include <flogger.h>
+#include <pevirtualengine.h>
+#include <featmgr.h>        // for FeatureManager
+
+#include "phoneconstants.h"
+#include "phonelogger.h"
+
+// Local includes
+#include "phonestatestrings.h" // also includes StringPool.h
+#include "phonestatestringsgsm.h" // also includes StringPool.h
+#include "phoneloggerviewcommands.h" // also includes StringPool.h
+#include "phoneui.pan"
+
+// Class signature
+#include "cphonelogger.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::CPhoneLogger
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// Constructed with destructionPriority = -1, CPhoneLogger will then be 
+// destroyed after the CCoeAppUi object is destroyed.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneLogger::CPhoneLogger( TUid aUid ) : CCoeStatic( aUid, -1 )
+    {
+    // Logging levels for each component is setted here
+    iLogLevelArray[ EPhoneAbstractFactoryClient ] = ENo;
+    iLogLevelArray[ EPhoneControl ] = EAll;
+    iLogLevelArray[ EPhonePhoneapp ] = EAll;
+    iLogLevelArray[ EPhoneUIStates ] = EAll;
+    iLogLevelArray[ EPhoneUIView ] = EAll;
+    iLogLevelArray[ EPhoneUIUtils ] = EAll;
+    iLogLevelArray[ PhoneUIVoIPExtension ] = EAll;
+    iLogLevelArray[ EPhoneMediatorCenter ] = EAll;
+    }
+
+
+// Destructor
+EXPORT_C
+CPhoneLogger::~CPhoneLogger()
+    {
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+    iPool.Close();
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::CheckLogLevel
+// Checks if component that tries to log has big enough log level.
+// -----------------------------------------------------------------------------
+//
+TBool CPhoneLogger::CheckLogLevel(
+    TPhoneUILoggingLevel aLevel, 
+    TPhoneUILoggingComponent aLoggingComponent )
+    {
+        __ASSERT_DEBUG( aLoggingComponent < iLogLevelArray.Count(),
+        Panic( EPhoneUtilsIndexOutOfBounds ) );
+        
+    return ( aLevel <= iLogLevelArray[aLoggingComponent] );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogIt
+// Messages to the log file.
+// -----------------------------------------------------------------------------
+//
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::LogIt( TRefByValue<const TDesC> aFmt, ...)
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+
+    TBuf<KMaxLogLineLength> buf;
+
+    buf.AppendFormatList( aFmt, list, this );
+    VA_END( list );
+
+    WriteComment( buf );
+
+    }
+#else 
+void CPhoneLogger::LogIt( TRefByValue<const TDesC> /*aFmt*/, ...) {}
+#endif
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogIt
+// Writes messages to the log.
+// -----------------------------------------------------------------------------
+//
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+EXPORT_C void CPhoneLogger::LogIt(
+    TPhoneUILoggingLevel aLevel, 
+    TPhoneUILoggingComponent aLoggingComponent, 
+    TRefByValue<const TDesC> aFmt, ...)
+    {
+    if ( this == NULL ) return;
+    if ( CheckLogLevel( aLevel, aLoggingComponent ) )
+        {
+        VA_LIST list;
+        VA_START( list, aFmt );
+
+        TBuf<KMaxLogLineLength> buf;
+
+        buf.AppendFormatList( aFmt, list, this );
+        VA_END( list );
+
+        WriteComment( buf );  
+        }   
+    }
+#else 
+EXPORT_C void CPhoneLogger::LogIt(
+    TPhoneUILoggingLevel /*aLevel*/, 
+    TPhoneUILoggingComponent, 
+    TRefByValue<const TDesC> /*aFmt*/, ...) {}
+#endif
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::WriteComment
+// Do a write of the supplied data, literally where possible
+// -----------------------------------------------------------------------------
+//
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::WriteComment( const TDesC& aComment )
+    {
+#if ( PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING )
+    RDebug::Print( aComment );
+#endif
+#if (PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+    RFileLogger::Write( 
+        KPhoneLogFolder(),
+        KPhoneLogFileName(),
+        EFileLoggingModeAppend,
+        aComment);
+#endif
+    }
+// Logging method == 0 (no logging at all) is handled so
+// that no code is generated at all.
+#else 
+void CPhoneLogger::WriteComment( const TDesC& )
+{
+//TInt test;
+}
+#endif
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::Overflow
+// Implements overflow handler derived from TDes16Overflow. 
+// Used by TDes16::AppendFormatList().
+// -----------------------------------------------------------------------------
+//
+EXPORT_C
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::Overflow( TDes16& aDes )
+    {
+    // Overflow has occured - end log line with '...'
+    _LIT( KErrOverflowMsg, "..." );
+    if ( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
+        {
+        aDes.Append( KErrOverflowMsg );
+        }
+    }
+#else
+void CPhoneLogger::Overflow( TDes& ) {}
+#endif
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogMsgFromPhoneUIToPE
+// LogPECommand: 
+// Creates a PE specified log message by given command and 
+// call id and writes it in the log file.
+//
+// NOTE:
+//  If You make changes to enum TPACommandId, please do same 
+//  changes to paloggermessagestophoneenginestrings.st and run abld 
+//  makefile.
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::LogMsgFromPhoneUIToPE( 
+    const TInt aMessage, 
+    const TInt /*aCallId*/ )
+    {
+    // Log only if logging level for control is big enough.
+    if ( iLogLevelArray[EPhoneControl] >= EBasic )
+        {   
+        TBuf<KMaxAppendLength> buf;
+        GetPhoneUIToPEStringById( buf, aMessage );
+        LogIt( KPEDefaultMsgToPE, &buf );
+        }
+    }
+
+#else
+void CPhoneLogger::LogMsgFromPhoneUIToPE( const TInt, const TInt ) {}
+#endif //_DEBUG
+
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogMsgFromControlToView
+// -----------------------------------------------------------------------------
+//
+EXPORT_C
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::LogMsgFromControlToView(
+    const TInt aMessage, 
+    const TInt /*aCallId*/ )
+    {
+    // Log only if logging level for Phoneapp is big enough.
+    if ( iLogLevelArray[EPhoneUIView] >= EBasic )
+        {   
+        TBuf<KMaxAppendLength> buf;
+        GetPhoneUIToViewStringById( buf, aMessage );
+        LogIt( KPEDefaultMsgToView, &buf );
+        }
+    }
+
+#else
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogMsgFromControlToView
+// -----------------------------------------------------------------------------
+//
+void CPhoneLogger::LogMsgFromControlToView( const TInt, const TInt ) {}
+#endif //_DEBUG
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogStateChange
+// Writes state chage to log file
+// -----------------------------------------------------------------------------
+//
+EXPORT_C
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::LogStateChange( 
+    const TInt aCurrentState, 
+    const TInt aNewState )
+    {
+    // Log only if logging level for Phone UI control is big enough.
+    if ( ( iLogLevelArray[EPhoneControl] >= EBasic ) ||
+        ( iLogLevelArray[EPhoneUIStates] >= EBasic ) )
+        {           
+        TBuf<KMaxAppendLength> currentState;
+        TBuf<KMaxAppendLength> newState;
+        
+        GetStateName( currentState, aCurrentState );
+        GetStateName( newState, aNewState );
+        
+        LogIt( KPEDefaultStateChange, &currentState, &newState );
+        }
+    }
+
+#else
+void CPhoneLogger::LogStateChange( const TInt, const TInt ) {}
+#endif //_DEBUG
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogMsgFromPEToPhoneUI
+// LogPEMessage: 
+// Creates a PE specified log message by given parameters 
+// and writes it in the log file.
+//
+// NOTE:
+//  If You make changes to enum TPEMessagesFromPhoneEngine, please do same 
+//  changes to phoneloggermessagesfromphoneenginestrings.st and run abld 
+//  makefile.
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::LogMsgFromPEToPhoneUI( 
+    const TInt aMessage, 
+    const TInt aCallId  )
+    {
+    // Log only if logging level for application control is big enough.
+    if ( iLogLevelArray[EPhoneControl] >= EBasic )
+        {          
+        TBuf<KMaxAppendLength> buf;
+        GetPEToPhoneUIStringById( buf, aMessage );
+        LogIt( KPEDefaultMsgToPhoneUI, &buf, aCallId );
+        }
+    }
+
+#else
+void CPhoneLogger::LogMsgFromPEToPhoneUI ( const TInt, const TInt ) {}
+#endif //_DEBUG
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::LogMsgFromPEToPhoneUIEnd
+// -----------------------------------------------------------------------------
+//
+EXPORT_C
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::LogMsgFromPEToPhoneUIEnd( const TInt aMessage )
+    {
+    // Log only if logging level for application control is big enough.
+    if ( iLogLevelArray[EPhoneControl] >= EBasic )
+        {           
+        TBuf<KMaxAppendLength> buf;
+        GetPEToPhoneUIStringById( buf, aMessage );
+        LogIt( KPEDefaultMsgToPhoneUIEnd, &buf );
+        }
+    }
+
+#else
+void CPhoneLogger::LogMsgFromPEToPhoneUIEnd ( const TInt ) {}
+#endif //_DEBUG
+
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::GetPEToPhoneUIStringById
+// Provides string representation for TPEMessagesFromPhoneEngine enums by 
+// ordinal number.
+//
+// NOTE:
+//  If You make changes to enum TPEMessagesFromPhoneEngine, please do same 
+//  changes to phoneloggermessagesfromphoneenginestrings.st and run abld 
+//  makefile.
+//
+// -----------------------------------------------------------------------------
+//
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::GetPEToPhoneUIStringById( TDes16& aDes, const TInt aID )
+    {
+    ASSERT( iPhoneEngine );
+    aDes.Copy( iPhoneEngine->NameByMessageFromPhoneEngine( aID ) );
+    }
+
+#else
+void CPhoneLogger::GetPEToPhoneUIStringById( TDes16& , const TInt ) {}
+#endif //_DEBUG
+
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::GetStateName
+// -----------------------------------------------------------------------------
+//
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::GetStateName( TDes16& aDes, const TInt aID )
+    {
+    TStringTable table;
+    TInt stateID;
+    if ( aID < KPhoneStateProtocolFirst )
+        {
+        table = PhoneStateStrings::Table;
+        stateID = aID;
+        }
+    else 
+        {
+        stateID = aID - KPhoneStateProtocolFirst;
+
+        if ( FeatureManager::FeatureSupported( KFeatureIdProtocolGsm ) ||
+            FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) )
+            {
+            table = PhoneStateStringsGSM::Table;
+            }
+        }
+
+    TRAPD( err, iPool.OpenL( table ) );
+    if ( err == KErrNone )
+        {
+        aDes.Copy( iPool.StringF( stateID, table ).DesC() );
+        iPool.Close();
+        }
+
+    if ( ( aDes.Length() == 0 ) || ( err != KErrNone ) )
+        {
+        aDes.AppendNum( (TInt)aID );
+        }
+    }
+
+#else
+void CPhoneLogger::GetStateName( TDes16& , const TInt ) {}
+#endif //_DEBUG
+/*
+// ==========================================================
+// GetViewName: 
+// Appends view name to given buf.
+//
+// ==========================================================
+#if (PHONEUI_LOGGING_OUTPUT == 1 || PHONEUI_LOGGING_OUTPUT == 2)
+void CPhoneLogger::GetViewName( TDes16& aDes, const TInt aID )
+    {
+    TRAPD( err, iPool->OpenL( PhoneUIViewStrings::Table ) );
+    if( err == KErrNone )
+        {
+        aDes.Copy(iPool->StringF( aID, PAViewStrings::Table ).DesC());
+        iPool->Close();
+        }
+
+    if( ( aDes.Length() == 0 ) || ( err != KErrNone ) )
+        {
+        aDes.AppendNum( (TInt)aID );                                                                                            
+        }
+    }
+
+#else
+void CPhoneLogger::GetViewName( TDes16& , const TInt ) {}
+#endif //_DEBUG
+*/
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::GetPhoneUIToPEStringById
+// Provides string representation for TPACommandId enums by 
+// ordinal number.
+//
+// NOTE:
+//  If You make changes to enum TPACommandId, please do same 
+//  changes to paloggermessagestophoneenginestrings.st and run abld 
+//  makefile.
+//
+// -----------------------------------------------------------------------------
+//
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::GetPhoneUIToPEStringById( TDes16& aDes, const TInt aID )
+    {
+    ASSERT( iPhoneEngine );
+    aDes.Copy( iPhoneEngine->NameByMessageToPhoneEngine( aID ) );
+    }
+
+#else
+void CPhoneLogger::GetPhoneUIToPEStringById( TDes16& , const TInt ) {}
+#endif //_DEBUG
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::GetPhoneUIToViewStringById
+// Provides string representation for TPACommandId enums by 
+// ordinal number.
+//
+// NOTE:
+//  If You make changes to enum TPACommandId, please do same 
+//  changes to paloggermessagestophoneenginestrings.st and run abld 
+//  makefile.
+//
+// -----------------------------------------------------------------------------
+//
+#if (PHONEUI_LOGGING_OUTPUT == RDEBUG_LOGGING || PHONEUI_LOGGING_OUTPUT == FILE_LOGGING)
+void CPhoneLogger::GetPhoneUIToViewStringById( TDes16& aDes, const TInt aID )
+    {
+    TRAPD( err, iPool.OpenL( PhoneLoggerviewCommands::Table ) );
+    if ( err == KErrNone )
+        {
+        aDes.Copy( iPool.StringF( aID, 
+            PhoneLoggerviewCommands::Table ).DesC() );
+        iPool.Close();
+        }
+
+    if ( ( aDes.Length() == 0 ) || ( err != KErrNone ) )
+        {
+        aDes.AppendNum( (TInt)aID );
+        }
+    }
+
+#else
+void CPhoneLogger::GetPhoneUIToViewStringById( TDes16& , const TInt ) {}
+#endif //_DEBUG
+
+// ---------------------------------------------------------
+// CPhoneLogger::SetPhoneEngine
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneLogger::SetPhoneEngine( 
+    MPEPhoneModel* aPhoneEngine )
+    {
+    iPhoneEngine = aPhoneEngine;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneLogger::CPhoneMethodLogger
+// Method logger contructor. Logs method start.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneMethodLogger::CPhoneMethodLogger(
+    TPhoneUILoggingComponent aLoggingComponent, 
+    TPtrC aString )
+    {
+    iLoggingComponent = aLoggingComponent;
+    iString = aString;
+    TBuf<KMaxLogLineLength> str;
+    switch( iLoggingComponent )
+        {
+        case EPhoneControl:
+            str.Append( KPhoneUIControl );
+            break;
+        
+        case EPhonePhoneapp:
+            str.Append( KPhoneUI );
+            break;
+            
+        case EPhoneUIView:
+            str.Append( KPhoneUIView );
+            break;
+            
+        case EPhoneUIStates:
+            str.Append( KPhoneUIStates );
+            break;
+            
+        case EPhoneUIUtils:
+            str.Append( KPhoneUIUtils );
+            break;
+
+        case EPhoneMediatorCenter:
+            str.Append( KPhoneMediatorCenter );
+            break;
+                        
+        default:
+            break;
+        }
+        
+    str.Append( iString );
+    str.Append( KLessThan );
+    
+    CPhoneLogger * logger = static_cast<CPhoneLogger*>(
+        CCoeEnv::Static( KUidPhoneUILoggerSingleton ) );
+    if ( logger )
+        {
+        logger->LogIt( EMethodStartEnd, iLoggingComponent, str );
+        }
+    }
+
+// Destructor
+EXPORT_C CPhoneMethodLogger::~CPhoneMethodLogger()
+    {
+    TBuf<KMaxLogLineLength> str;
+    switch( iLoggingComponent )
+        {
+        case EPhoneControl:
+            str.Append( KPhoneUIControl );
+            break;
+        
+        case EPhonePhoneapp:
+            str.Append( KPhoneUI );
+            break;
+            
+        case EPhoneUIView:
+            str.Append( KPhoneUIView );
+            break;
+            
+        case EPhoneUIStates:
+            str.Append( KPhoneUIStates );
+            break;
+            
+        case EPhoneUIUtils:
+            str.Append( KPhoneUIUtils );
+            break;
+
+        case EPhoneMediatorCenter:
+            str.Append( KPhoneMediatorCenter );
+            break;
+            
+        default:
+            break;
+        }
+    str.Append( iString );
+    str.Append( KGreaterThan );
+
+    CPhoneLogger * logger = static_cast<CPhoneLogger*>(
+        CCoeEnv::Static( KUidPhoneUILoggerSingleton ) );
+    if ( logger )
+        {
+        logger->LogIt( EMethodStartEnd, iLoggingComponent, str );
+        }
+    }
+
+//  End of File  
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonecallthememonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  See class description.
+*
+*/
+
+
+// INCLUDE FILES
+#include <bautils.h>
+#include <data_caging_path_literals.hrh>
+#include <pslninternalcrkeys.h>
+
+#include "phoneconstants.h"
+#include "cphonecallthememonitor.h"
+#include "phonelogger.h"
+#include "cphonecenrepproxy.h"
+#include "mphonecenrepobserver.h"
+#include "phoneui.pan"
+
+// Values for KThemesCallImageSettings CR key
+const TInt KPslnCRUserDefinedCallImage = 1;
+
+ 
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneCallThemeMonitor::CPhoneCallThemeMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneCallThemeMonitor::CPhoneCallThemeMonitor()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCallThemeMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneCallThemeMonitor::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CPhoneCallThemeMonitor::ConstructL ()" );    
+
+    // Get all current values
+    TRAP_IGNORE( ReadAllL() );    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCallThemeMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneCallThemeMonitor* CPhoneCallThemeMonitor::NewL()
+    {
+    CPhoneCallThemeMonitor* self = 
+        new (ELeave) CPhoneCallThemeMonitor();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// Destructor
+EXPORT_C CPhoneCallThemeMonitor::~CPhoneCallThemeMonitor()
+    {
+    delete iCallerImageThemePath;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCallThemeMonitor::CallImageThemeSettings
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCallThemeMonitor::CallImageThemeSettings() const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CPhoneCallThemeMonitor::CallImageThemeSettings ()" );    
+    return iThemeCallImageSettings;
+    }    
+
+// -----------------------------------------------------------------------------
+// CPhoneCallThemeMonitor::CallImageThemeFilePath
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPtrC CPhoneCallThemeMonitor::CallImageThemeFilePath() const
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CPhoneCallThemeMonitor::CallImageThemeFilePath ()" );    
+    if ( iCallerImageThemePath )    
+        {
+        return *iCallerImageThemePath;    
+        }
+    else
+        {
+        return KNullDesC();    
+        }        
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCallThemeMonitor::SetCallThemeSettingsObserver
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneCallThemeMonitor::SetCallThemeSettingsObserver(
+    MPhoneCallThemeSettingsObserver* aObserver )
+    {
+    __ASSERT_DEBUG( iObserver == NULL, Panic( KErrNotSupported ) );
+    iObserver = aObserver;
+    }
+
+// -----------------------------------------------------------
+// CPhoneCallThemeMonitor::HandleCenRepChangeL
+// -----------------------------------------------------------
+//
+void CPhoneCallThemeMonitor::HandleCenRepChangeL( 
+    const TUid& aUid,
+    const TUint aId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneCallThemeMonitor::HandleCenRepChangeL( ) ");
+    if ( aUid == KCRUidThemes ) 
+        {
+        if (aId == KThemesCallImagePath || aId == KThemesCallImageSetting )    
+            {
+            ReadAllL();
+            if ( iObserver )
+                {
+                iObserver->CallThemeSettingsChanged();
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCallThemeMonitor::ReadAllL
+// -----------------------------------------------------------------------------
+//
+void CPhoneCallThemeMonitor::ReadAllL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CPhoneCallThemeMonitor::ReadAllL ()" );
+
+    // Call image status 
+    TInt value( KErrNone );
+    TInt err( CPhoneCenRepProxy::Instance()->GetInt(
+        KCRUidThemes,
+        KThemesCallImageSetting,
+        value ) );
+    
+    if ( err == KErrNone )
+        {
+        iThemeCallImageSettings = value;    
+        }
+  
+    if ( iThemeCallImageSettings == KPslnCRUserDefinedCallImage )
+        {
+        delete iCallerImageThemePath;
+        iCallerImageThemePath = NULL;
+        iCallerImageThemePath = HBufC::NewL( KMaxFilePathLength );
+        TPtr imagePtr ( iCallerImageThemePath->Des() );
+            
+        __PHONELOG1( EBasic, EPhoneUIUtils,
+            "CPhoneCallThemeMonitor::ReadAllL -> image path = %S", &imagePtr );
+        } 
+    else
+        {
+        delete iCallerImageThemePath;
+        iCallerImageThemePath = NULL;
+        }             
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonecenrepeventhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  see class description.
+ *
+*/
+
+
+// INCLUDE FILES
+#include "phonelogger.h"
+#include "phoneui.pan"
+
+#include "cphonecenrepeventhandler.h"
+#include "cphonecenrepproxy.h"
+
+// ========================== MEMBER FUNCTIONS ================================
+
+// ----------------------------------------------------------------------------
+// CPhoneCenRepEventHandler* CPhoneCenRepEventHandler::NewL()
+// ----------------------------------------------------------------------------
+
+CPhoneCenRepEventHandler* CPhoneCenRepEventHandler::NewL( 
+    const TUid& aUid )
+    {       
+    CPhoneCenRepEventHandler* self = 
+        new ( ELeave ) CPhoneCenRepEventHandler( aUid );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self ); 
+
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCenRepEventHandler::CPhoneCenRepEventHandler
+// ----------------------------------------------------------------------------
+
+CPhoneCenRepEventHandler::CPhoneCenRepEventHandler( const TUid& aUid ) :
+    iUid( aUid )
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCenRepEventHandler::~CPhoneCenRepEventHandler
+// ----------------------------------------------------------------------------
+
+CPhoneCenRepEventHandler::~CPhoneCenRepEventHandler()
+    {
+    if ( iCenRepNotifyHandler )
+        {
+        iCenRepNotifyHandler->StopListening();
+        }
+    delete iCenRepNotifyHandler;
+    delete iRepository;
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCenRepEventHandler::ConstructL
+// ----------------------------------------------------------------------------
+
+void CPhoneCenRepEventHandler::ConstructL()
+    {
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneCenRepEventHandler::ConstructL: uid=%d", 
+        iUid );
+
+    iRepository = CRepository::NewL( iUid );
+    
+    iCenRepNotifyHandler = CCenRepNotifyHandler::NewL( 
+        *this, 
+        *iRepository );
+
+    iCenRepNotifyHandler->StartListeningL();
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCenRepEventHandler::HandleNotifyGeneric
+// ----------------------------------------------------------------------------
+void CPhoneCenRepEventHandler::HandleNotifyGeneric( TUint32 aId )
+    {
+    
+    __PHONELOG2( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhoneCenRepEventHandler::HandleNotifyGeneric: uid=%d, id=%d", 
+        iUid,
+        aId );
+
+    CPhoneCenRepProxy::Instance()->HandleNotify( iUid, aId );
+    }
+
+// ----------------------------------------------------------------------------
+// CPhoneCenRepEventHandler::HandleNotifyError
+// ----------------------------------------------------------------------------
+void CPhoneCenRepEventHandler::HandleNotifyError( 
+    TUint32 /*aId*/, 
+    TInt error, 
+    CCenRepNotifyHandler* /*aHandler*/ )
+    {
+    if ( error )
+        {
+        __PHONELOG2( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepEventHandler::HandleNotifyError: uid=%d, error = %d", 
+            iUid,
+            error );        
+        }
+
+    // Resume listening
+    TRAPD( err, iCenRepNotifyHandler->StartListeningL() );
+    if ( KErrNone != err )
+        {
+        Panic( err );
+        }
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonecenrepproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,717 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Central Repository proxy.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <e32std.h>
+#include    <e32def.h>
+#include    <e32base.h>
+#include    <telinternalcrkeys.h>
+#include    <pslninternalcrkeys.h>
+#include    <LogsDomainCRKeys.h>
+#include    <accessoriescrkeys.h>
+#include    <settingsinternalcrkeys.h>
+#include    <UiklafInternalCRKeys.h>
+#include    <ProfileEngineDomainCRKeys.h>
+#include    <DRMHelperServerInternalCRKeys.h>
+#include    <AknFepInternalCRKeys.h>
+#include    <AvkonInternalCRKeys.h>
+#include    <btengdomaincrkeys.h> 
+#include    <utf.h>
+
+#include    "phoneui.pan"
+#include    "cphonecenrepproxy.h"
+#include    "mphonecenrepobserver.h"
+#include    "cphonecenrepeventhandler.h"
+#include    "phoneconstants.h"
+#include    "phonelogger.h"
+#include    "telprivatecrkeys.h"
+#include    "tphonecmdparamappinfo.h"
+
+//CONSTANTS
+const TInt KMaxParamLength = 1024;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneCenRepProxy* CPhoneCenRepProxy::Instance()
+    {
+    CPhoneCenRepProxy* instance = static_cast<CPhoneCenRepProxy*> 
+        ( CCoeEnv::Static ( KUidCenRepProxySingleton ) );
+    
+    if( !instance )
+        {
+        TRAPD( err, instance = CPhoneCenRepProxy::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneUtilsCouldNotCreateSingleton );    
+            }
+        }
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::CancelAllNotifies
+// Cancel the notification if the singleton still exists.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneCenRepProxy::CancelAllNotifies( 
+    MPhoneCenRepObserver* aObserver )
+    {
+    CPhoneCenRepProxy* instance = static_cast<CPhoneCenRepProxy*> 
+        ( CCoeEnv::Static( KUidCenRepProxySingleton ) );
+    
+    // Ignore the call since the singleton has already been destroyed and the
+    // notifications removed
+    if( instance != NULL )
+        {
+        instance->CancelAllObserverNotifies( aObserver );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::NewL
+// ---------------------------------------------------------
+//
+CPhoneCenRepProxy* CPhoneCenRepProxy::NewL()
+    {
+    CPhoneCenRepProxy* self = 
+        new (ELeave) CPhoneCenRepProxy();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::~CPhoneCenRepProxy
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneCenRepProxy::~CPhoneCenRepProxy()
+    {
+    // The Cancel should be always called before destroy the object
+    CancelAllNotifies();
+    
+    delete iCenRepAccessoryEventHandler;
+    delete iCenRepNetworkEventHandler;
+    delete iCenRepThemesEventHandler;
+    delete iCenRepLanguageEventHandler;
+    delete iCenRepQwertyEventHandler;
+    delete iCenRepKDRMHelperEventHandler;
+    delete iObserverArray;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::CPhoneCenRepProxy
+// ---------------------------------------------------------
+//
+CPhoneCenRepProxy::CPhoneCenRepProxy() :
+    CCoeStatic( KUidCenRepProxySingleton, EThread )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneCenRepProxy::ConstructL()
+    {
+    iObserverArray = new ( ELeave ) CArrayFixFlat<TCenRepObserverTag>( 
+        KPhoneCenRepObserversGranularity );
+
+    iTelephonyVariantReadOnlyValues = KPhoneVariantReadOnlyDefaultValue;
+    iPhoneUIVariantReadOnlyValues = KPhoneVariantReadOnlyDefaultValue;
+    
+    User::LeaveIfError( GetTelephonyVariantData() );
+    User::LeaveIfError( GetPhoneUIVariantData() );
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::HandleNotifyL
+// ---------------------------------------------------------
+//
+void CPhoneCenRepProxy::HandleNotify( 
+    const TUid& aUid, 
+    const TUint aId )
+    {
+    TInt index = FindByUidId( aUid, aId, 0 );
+    while ( index != KErrNotFound )
+        {
+        __ASSERT_DEBUG( index < iObserverArray->Count(), 
+            Panic( EPhoneUtilsIndexOutOfBounds ) );
+        const TCenRepObserverTag& observerTag = iObserverArray->At( index );
+        TRAP_IGNORE( observerTag.iObserver->HandleCenRepChangeL( aUid, aId ) );
+        index = FindByUidId( aUid, aId, index+1 );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::SetInt
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCenRepProxy::SetInt( 
+    const TUid& aUid, 
+    const TUint aId,
+    const TInt aValue )
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        err = repository->Set( aId, aValue );
+        }
+    delete repository;
+
+    if ( err != KErrNone )
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::SetInt() error: %d", 
+            err );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsInvariant ) );
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::SetString
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCenRepProxy::SetString( 
+    const TUid& aUid, 
+    const TUint aId,
+    const TDesC& aValue )
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        err = repository->Set( aId, aValue );
+        }
+    delete repository;
+
+    if ( err != KErrNone )
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::SetString() error: %d", 
+            err );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsInvariant ) );
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::SetReal
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCenRepProxy::SetReal( 
+    const TUid& aUid, 
+    const TUint aId,
+    const TReal aValue )
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        err = repository->Set( aId, aValue );
+        }
+    delete repository;
+
+    if ( err != KErrNone )
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::SetReal() error: %d", 
+            err );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsInvariant ) );
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::GetInt
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCenRepProxy::GetInt( 
+    const TUid& aUid, 
+    const TUint aId,
+    TInt& aValue ) const
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        err = repository->Get( aId, aValue );
+        delete repository;
+        }
+
+    if ( err != KErrNone)
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::GetInt() error: %d", 
+            err );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsInvariant ) );
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::GetString
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCenRepProxy::GetString( 
+    const TUid& aUid, 
+    const TUint aId,
+    TDes& aValue ) const
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        err = repository->Get( aId, aValue );
+        delete repository;
+        }
+
+    if ( err != KErrNone)
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::GetString() error: %d", 
+            err );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsInvariant ) );
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::GetReal
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCenRepProxy::GetReal( 
+    const TUid& aUid, 
+    const TUint aId,
+    TReal& aValue ) const
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        err = repository->Get( aId, aValue );
+        delete repository;
+        }
+
+    if ( err != KErrNone)
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::GetReal() error: %d", 
+            err );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsInvariant ) );
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::NotifyChangeL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneCenRepProxy::NotifyChangeL( 
+    const TUid& aUid, 
+    const TUint aId, 
+    MPhoneCenRepObserver* aObserver )
+    {
+    // Make sure this request hasn't been request by this observer yet
+    if ( FindByUidIdObserver( aUid, aId, aObserver ) == KErrNotFound )
+        {
+        TCenRepObserverTag tag;
+        tag.iUid = aUid;
+        tag.iId = aId;
+        tag.iObserver = aObserver;
+    
+        iObserverArray->AppendL( tag );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::CancelNotify
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneCenRepProxy::CancelNotify( 
+    MPhoneCenRepObserver* aObserver, 
+    const TUint aId )
+    {
+    TInt index = FindByObserverId( aObserver, aId );
+    // This class may be destroyded by CCoeEnv::DestroyEnvironmentStatic() 
+    // before CancelNotifys are called.
+    if( index == KErrNotFound )
+        {
+        return;            
+        }
+    
+    __ASSERT_DEBUG( index < iObserverArray->Count(),
+        Panic( EPhoneUtilsIndexOutOfBounds ) );
+        
+    TCenRepObserverTag observerTag = iObserverArray->At( index );
+    iObserverArray->Delete( index );
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::CancelAllObserverNotifies
+// ---------------------------------------------------------
+//
+void CPhoneCenRepProxy::CancelAllObserverNotifies( 
+    MPhoneCenRepObserver* aObserver )
+    {
+    const TInt count = iObserverArray->Count();
+    for ( TInt i = count-1; i >=0; i-- )
+        {
+        const TCenRepObserverTag& observerTag = iObserverArray->At( i );
+        if ( observerTag.iObserver == aObserver )
+            {
+            iObserverArray->Delete( i );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::CancelAllNotifies
+// ---------------------------------------------------------
+//
+void CPhoneCenRepProxy::CancelAllNotifies()
+    {
+    const TInt count = iObserverArray->Count();
+    for ( TInt i = count-1; i >=0; i-- )
+        {
+        const TCenRepObserverTag& observerTag = iObserverArray->At( i );
+        iObserverArray->Delete( i );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::FindByUidId
+// ---------------------------------------------------------
+//
+TInt CPhoneCenRepProxy::FindByUidId( 
+    const TUid& aUid,
+    const TUint aId, 
+    TInt aFromIndex )
+    {
+    const TInt count = iObserverArray->Count();
+    TInt result = KErrNotFound;
+    for ( TInt i = aFromIndex; i < count; i++ )
+        {
+        const TCenRepObserverTag& observerTag = iObserverArray->At( i );
+        if ( observerTag.iUid == aUid  && observerTag.iId == aId ) 
+            {
+            result = i;
+            break;
+            }
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::FindByObserverId
+// ---------------------------------------------------------
+//
+TInt CPhoneCenRepProxy::FindByObserverId( 
+    const MPhoneCenRepObserver* aObserver,
+    const TUint aId )
+    {
+    const TInt count = iObserverArray->Count();
+    TInt result = KErrNotFound;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        const TCenRepObserverTag& observerTag = iObserverArray->At( i );
+        if ( observerTag.iObserver == aObserver && observerTag.iId == aId ) 
+            {
+            result = i;
+            break;
+            }
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::FindByUidIdObserver
+// ---------------------------------------------------------
+//
+TInt CPhoneCenRepProxy::FindByUidIdObserver( 
+    const TUid& aUid, 
+    const TUint aId, 
+    MPhoneCenRepObserver* aObserver )
+    {
+    TInt pos = FindByUidId( aUid, aId, 0 );
+    TInt result = KErrNotFound;
+    while ( pos != KErrNotFound )
+        {
+        __ASSERT_DEBUG( pos < iObserverArray->Count(), 
+            Panic( EPhoneUtilsIndexOutOfBounds ) );
+        const TCenRepObserverTag& observerTag = iObserverArray->At( pos );
+        if ( observerTag.iObserver == aObserver )
+            {
+            result = pos;
+            break;
+            }
+
+        pos++;
+        pos = FindByUidId( aUid, aId, pos );
+        }
+
+    return result;
+    }   
+
+// -----------------------------------------------------------------------------
+// CPhoneCenRepProxy::IsTelephonyFeatureSupported
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneCenRepProxy::IsTelephonyFeatureSupported( 
+    const TInt aFeatureId )
+    {
+    return ( aFeatureId & iTelephonyVariantReadOnlyValues );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCenRepProxy::GetTelephonyVariantData
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneCenRepProxy::GetTelephonyVariantData()
+    {
+    TInt err = KErrNone;
+
+    // Variation data should be unchangable during run-time, 
+    // therefore, if once succesfully read, later reads are
+    // not allowed.
+    if( iTelephonyVariantReadOnlyValues == KPhoneVariantReadOnlyDefaultValue )
+        {
+        err = GetInt( 
+            KCRUidTelVariation, 
+            KTelVariationFlags, 
+            iTelephonyVariantReadOnlyValues );
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCenRepProxy::IsPhoneUIFeatureSupported
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneCenRepProxy::IsPhoneUIFeatureSupported( 
+    const TInt aFeatureId )
+    {
+    return ( aFeatureId & iPhoneUIVariantReadOnlyValues );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCenRepProxy::GetPhoneUIVariantData
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneCenRepProxy::GetPhoneUIVariantData()
+    {
+    TInt err = KErrNone;
+/*
+    // Variation data should be unchangable during run-time, 
+    // therefore, if once succesfully read, later reads are
+    // not allowed.
+    if ( iPhoneUIVariantReadOnlyValues == KPhoneVariantReadOnlyDefaultValue )
+        {
+        err = GetInt( 
+            KCRUidPhoneAppS60Variation, 
+            KPhoneAppS60VariationFlags, 
+            iPhoneAppS60VariantReadOnlyValues );
+        }
+*/
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CPhoneCenRepProxy::Find
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhoneCenRepProxy::Find(
+    const TUid& aUid,
+    const TUint32 aPartial, 
+    const TUint32 aMask,
+    RArray<TUint32>& aValues ) const
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        TRAP( err, repository->FindL( aPartial, aMask, aValues ) );
+        delete repository;
+        }
+
+    if ( err != KErrNone)
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::GetInt() error: %d", 
+            err );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsInvariant ) );
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneCenRepProxy::FetchValuesFromCenRepL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneCenRepProxy::FetchValuesFromCenRepL( 
+                                                TPhoneCmdParamAppInfo& aAppInfo,
+                                                TKeyCode aCode, 
+                                                HBufC8* aAppParam,
+                                                TBool& aValuesFetched )
+    {
+    const TUint32     KPartialKey = 0xFF0000;
+    const TUint32   KLaunchGroupIdMask = 0x00FF00;
+    const TUint32   KLaunchPlaceIdMask = 0x0000FF;
+    const TUint32     KIdmask = 0xFF0000;
+    
+    const TUint32   KLaunchGroupIdShift = 8;
+    const TInt      KUidId = 2;
+    const TInt      KParamId = 3;
+
+    RArray<TUint32> foundKeys;
+    CleanupClosePushL( foundKeys );    
+    
+    CRepository* repository = NULL;
+    repository = CRepository::NewL( KCRUidTelPrivateVariation );
+    
+    TInt err( KErrNone );
+    
+    if ( repository )
+        {
+        CleanupStack::PushL( repository );
+        err = repository->FindL( KPartialKey, KIdmask, foundKeys );
+        }
+
+    if ( KErrNone != err )
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhoneCenRepProxy::FetchValuesFromCenRepL() error: %d", 
+            err );
+        User::Leave( err );
+        }        
+    
+    TInt uid(0);
+    TInt code(0);
+    HBufC* param = HBufC::NewL( KMaxParamLength );
+    TPtr paramPtr = param->Des();
+    CleanupStack::PushL( param );
+    
+    for ( TInt i = 0; i < foundKeys.Count(); i++ )
+        {
+        User::LeaveIfError( repository->Get(
+                foundKeys[i], code ) );       
+        
+        //peekIndex is used to check if foundKeys-array has a next 
+        //element. For this reason (i+1) is used.
+        TInt peekIndex(i+1);
+        TInt peekGroupId(0);
+        TInt launchGroupID 
+            = ( foundKeys[i] & KLaunchGroupIdMask ) >> KLaunchGroupIdShift;        
+        
+        if( peekIndex < foundKeys.Count() && code == aCode )
+            {
+            peekGroupId =
+            ( foundKeys[peekIndex] & KLaunchGroupIdMask ) 
+                    >> KLaunchGroupIdShift;
+        
+            // Check that group Id is the same as for the key fetched earlier
+            // (KKeyId) and the key id for this key is (KUidId).
+            if( launchGroupID == peekGroupId &&
+                KUidId == ( foundKeys[peekIndex] & KLaunchPlaceIdMask ) )  
+                {
+                User::LeaveIfError( repository->Get(
+                        foundKeys[++i], uid ) );
+                }
+            
+            peekIndex = i+1; // peekIndex update. The actual value is dependant on
+                              // whether variable i was incremented or not in previous if.
+
+            if( peekIndex < foundKeys.Count() )
+                {
+                peekGroupId = 
+                       ( foundKeys[peekIndex] & KLaunchGroupIdMask ) 
+                               >> KLaunchGroupIdShift;
+                // Check that group Id is still the same as for the keys fetched 
+                // earlier (KKeyId and KUidId)
+                // and the key id for this key is (KParamId).
+                if( launchGroupID == peekGroupId &&
+                        KParamId == ( foundKeys[peekIndex] & KLaunchPlaceIdMask ) )
+                    {                
+                    User::LeaveIfError( repository->Get( 
+                            foundKeys[++i], paramPtr ) );
+                    break;
+                    }
+                }
+            }
+        else
+            {
+            i++; // skip uid index (wrong code)
+            i++; // skip parameter index (wrong code)
+            }
+        }
+    
+    if ( uid != 0 )
+        {
+        aAppInfo.SetAppUid( TUid::Uid( uid ) );
+        // TDesc16 to TDesc8 conversion. Central repository supports only
+        // 16 bit buffers, setParam function in TPhoneCmdParamAppInfo wants
+        // 8 bit.
+        TPtr8 eightBitParamPtr = aAppParam->Des();
+        CnvUtfConverter::ConvertFromUnicodeToUtf8( eightBitParamPtr, 
+                paramPtr );         
+        
+        aAppInfo.SetParam( eightBitParamPtr );
+        aValuesFetched = ETrue;
+        }
+    
+    CleanupStack::PopAndDestroy( param ); 
+    CleanupStack::PopAndDestroy( repository );
+    CleanupStack::PopAndDestroy( &foundKeys );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphoneclearblacklist.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Blacklist clearing.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphoneclearblacklist.h"
+#include "phoneconstants.h"
+#include "phonelogger.h"
+#include "phoneui.pan"
+#include "rphoneanimclearblacklist.h"
+#include <data_caging_path_literals.hrh>
+
+// CONSTANTS
+#ifdef __WINS__
+_LIT( KPhoneAnimDllFileName, "phoneanimdll.dll" );
+#else
+_LIT( KPhoneAnimDllFileName, "z:phoneanimdll.dll" );
+#endif // __WINS__
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------
+// CPhoneClearBlacklist::CreateL
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneClearBlacklist* CPhoneClearBlacklist::CreateL( RWsSession& aWsSession, 
+     const RWindowBase& aDevice )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CPhoneClearBlacklist::CreateL( ) ");
+    CPhoneClearBlacklist* instance = static_cast<CPhoneClearBlacklist*>(
+        CCoeEnv::Static( KUidClearBlackListSingleton ) );
+    if ( !instance )
+        {
+        instance = new (ELeave) CPhoneClearBlacklist();
+        CleanupStack::PushL( instance );
+        instance->ConstructL( aWsSession, aDevice );
+        CleanupStack::Pop( instance );
+        }
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhoneClearBlacklist::Instance
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneClearBlacklist* CPhoneClearBlacklist::Instance()
+    {
+    CPhoneClearBlacklist* instance = static_cast<CPhoneClearBlacklist*>(
+        CCoeEnv::Static( KUidClearBlackListSingleton ) );
+    __ASSERT_DEBUG( instance, Panic( EPhoneCtrlSingletonNotInitialized ) );
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+//  CPhoneClearBlacklist::CPhoneClearBlacklist
+// -----------------------------------------------------------------------------
+//
+CPhoneClearBlacklist::CPhoneClearBlacklist() : CCoeStatic( KUidClearBlackListSingleton )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//  CPhoneClearBlacklist::~CPhoneClearBlacklist
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneClearBlacklist::~CPhoneClearBlacklist()
+    {
+    if ( iAnim )
+        {
+        iAnim->Close();
+        delete iAnim;
+        }
+
+    if ( iAnimDll )
+        {
+        iAnimDll->Close();
+        delete iAnimDll;
+        }   
+    }
+
+// -----------------------------------------------------------------------------
+//  CPhoneClearBlacklist::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhoneClearBlacklist::ConstructL( RWsSession& aWsSession, 
+     const RWindowBase& aDevice )
+    {
+    // Construct RAnim connection
+    iAnimDll = new (ELeave) RAnimDll( aWsSession );
+
+    TParse* fp = new (ELeave) TParse();
+#ifdef __WINS__
+    fp->Set( KPhoneAnimDllFileName, NULL, NULL ); 
+#else
+    fp->Set( KPhoneAnimDllFileName, &KDC_SHARED_LIB_DIR, NULL );     
+#endif //__WINS__
+    TFileName fileName( fp->FullName() );
+    delete fp;
+
+    User::LeaveIfError( iAnimDll->Load( fileName ) );
+
+    iAnim = new (ELeave) RPhoneAnimClearBlacklist( *iAnimDll );
+    iAnim->ConstructL( aDevice );
+    }
+
+// -----------------------------------------------------------------------------
+//  CPhoneClearBlacklist::ClearBlackList
+//
+//  Clears blacklist.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneClearBlacklist::ClearBlackListNow()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CPhoneClearBlacklist::ClearBlackListNow( ) ");
+    iAnim->ClearBlackListNow();
+    }
+
+// -----------------------------------------------------------------------------
+//  CPhoneClearBlacklist::ClearBlackListOnNextKey
+//
+//  Clears blacklist.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneClearBlacklist::ClearBlackListOnNextKey()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CPhoneClearBlacklist::ClearBlackListOnNextKey( ) ");
+    iAnim->ClearBlackListOnNextKey();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonekeys.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone Keys
+*
+*/
+
+
+// INCLUDE FILES
+#include    "cphonekeys.h"
+#include    <aknkeys.h>
+#include    <AknUtils.h>
+#include    "phonelogger.h"
+
+// CONSTANTS
+_LIT( KPhoneValidChars, "0123456789*#+pwPW" );
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneKeys::IsNumberKey
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneKeys::IsNumberKey(
+    const TKeyEvent& aKeyEvent,
+    TEventCode /*aType*/ )
+    {
+    // Convert key code to western.
+    TBuf<1> buffer; // one character
+    buffer.Append( aKeyEvent.iCode );
+    AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern );
+
+    TBool result = EFalse;
+
+    switch ( buffer[ 0 ] ) // first char
+        {
+        // Digits, 0 .. 9
+        case KPhoneDtmf0Character:
+        case KPhoneDtmf1Character:
+        case KPhoneDtmf2Character:
+        case KPhoneDtmf3Character:
+        case KPhoneDtmf4Character:
+        case KPhoneDtmf5Character:
+        case KPhoneDtmf6Character:
+        case KPhoneDtmf7Character:
+        case KPhoneDtmf8Character:
+        case KPhoneDtmf9Character:
+            result = ETrue;
+            break;
+        default:
+            break;
+        }
+__PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "PhoneKeys::IsNumberKey: result: %d", 
+        result );
+        
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeys::IsNumericKey
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneKeys::IsNumericKey( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    TBool result = IsNumberKey( aKeyEvent, aType );
+
+    if ( !result )
+        {
+        switch( aKeyEvent.iCode )
+            {
+            case KPhoneDtmfHashCharacter:      // Hash
+            case KPhoneDtmfStarCharacter:      // Asterisk
+                // the following key can be got via taps of *
+            case KPhoneDtmfSpeedDialCharacter: // Plus
+            case KPhoneDtmfPauseCharacter:     // DTMF Soft-Pause character
+            case KPhoneDtmfWaitCharacter:      // DTMF Wait character
+                result = ETrue;
+                break;
+            default:
+                break;
+            }
+        }
+
+__PHONELOG2( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "PhoneKeys::IsNumericKey: result: %d, code %d", 
+        result,
+        aKeyEvent.iCode );
+
+    return result;
+    }       
+
+// ---------------------------------------------------------
+// CPhoneKeys::IsEscapeKey
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneKeys::IsEscapeKey(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    return 
+        ( aType == EEventKey ) && 
+        ( aKeyEvent.iCode == EKeyEscape );
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeys::IsDTMFTone
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneKeys::IsDtmfTone( 
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType )
+    {
+    TBool result = IsNumberKey( aKeyEvent, aType );
+
+    if ( !result )
+        {
+        switch( aKeyEvent.iCode )
+            {
+            case KPhoneDtmfHashCharacter:  // Hash
+            case KPhoneDtmfStarCharacter:  // Asterisk
+                result = ETrue;
+                break;
+            default:
+                break;
+            }
+        }
+
+__PHONELOG2( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "PhoneKeys::IsDtmfTone: result: %d, code %d", 
+        result,
+        aKeyEvent.iCode );
+        
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeys::IsSecondHashKey
+// Checks if keyevent is Second "#" key, i.e, "##".
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneKeys::IsSecondHashKey(
+    const TDes& aText )
+    {
+    TInt length = aText.Length();
+    TBool result = EFalse;
+
+    // * or # character entered
+    if ( ( length >= KSecondKeyEvent ) 
+        && ( aText[0] == KPhoneDtmfHashCharacter ) 
+        && ( aText[1] == KPhoneDtmfHashCharacter ) )
+        {
+        result = ETrue;
+        }
+    
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "PhoneKeys::IsSecondHashKey: result: %d", 
+        result );
+        
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// PhoneKeys::IsExtraChar
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPhoneKeys::IsExtraChar(
+        TInt aChar )
+    {
+    TBool result = EFalse;
+    switch( aChar )
+        {
+        case '*': // Asterisk
+            // the following key can be got via taps of *
+        case '+': // Plus
+        case 'p': // P character
+        case 'w': // W character
+            result = ETrue;
+            break;
+        default:
+            break;
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CPhoneKeys::Validate
+//
+// Go through the whole string and validate each character.
+// If character is invalid, check if we have reached end of
+// string (in which case, input.Peek() returns 0).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CPhoneKeys::Validate( const TDesC& aString )
+    {
+    TLex input( aString );
+    TPtrC valid( KPhoneValidChars );
+
+    while ( valid.Locate( input.Peek() ) != KErrNotFound )
+        {
+        input.Inc();
+        }
+    
+    return !input.Remainder().Length();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonelangsettingmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitor for language settings.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <bautils.h>
+#include <AknFepInternalCRKeys.h>
+#include "cphonelangsettingmonitor.h"
+#include "mphonelangsettingobserver.h"
+#include "phonelogger.h"
+#include "cphonecenrepproxy.h"
+#include "mphonecenrepobserver.h"
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneLangSettingMonitor::CPhoneLangSettingMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneLangSettingMonitor::CPhoneLangSettingMonitor()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneLangSettingMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneLangSettingMonitor::ConstructL()
+    {
+    TInt language(1); // english
+    TInt err = KErrNone;
+    
+    if ( err == KErrNone )
+        {
+        iInputLanguageSetting = language;    
+        }             
+            
+    // Start listen changes in setting and image path
+    CPhoneCenRepProxy::Instance()->NotifyChangeL(
+        KCRUidAknFep, 
+        KAknFepInputTxtLang,
+        this );       
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneLangSettingMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneLangSettingMonitor* CPhoneLangSettingMonitor::NewL()
+    {
+    CPhoneLangSettingMonitor* self = 
+        new (ELeave) CPhoneLangSettingMonitor();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// Destructor
+CPhoneLangSettingMonitor::~CPhoneLangSettingMonitor()
+    {
+    iObserverArray.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneLangSettingMonitor::AddObserverL
+// -----------------------------------------------------------------------------
+//
+void CPhoneLangSettingMonitor::AddObserverL(
+    MPhoneLangSettingObserver& aObserver )
+    {
+    if ( iObserverArray.Find( &aObserver ) != KErrNone )
+        {
+        User::LeaveIfError( iObserverArray.Append( &aObserver ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneLangSettingMonitor::RemoveObserver
+// -----------------------------------------------------------------------------
+//
+void CPhoneLangSettingMonitor::RemoveObserver(
+    MPhoneLangSettingObserver& aObserver )
+    {
+    TInt index;
+    if ( iObserverArray.FindInAddressOrder( &aObserver, index ) == KErrNone )
+        {
+        iObserverArray.Remove( index );
+        }
+    }
+// -----------------------------------------------------------------------------
+// CPhoneLangSettingMonitor::HandleCenRepChangeL
+// -----------------------------------------------------------------------------
+//
+void CPhoneLangSettingMonitor::HandleCenRepChangeL( 
+    const TUid& aUid,
+    const TUint aId )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, 
+        "CPhoneLangSettingMonitor::HandleCenRepChangeL( )");
+        
+    if ( aUid == KCRUidAknFep && aId == KAknFepInputTxtLang )
+        {
+        TInt language(1); // english
+        TInt err( CPhoneCenRepProxy::Instance()->GetInt(
+            KCRUidAknFep,
+            KAknFepInputTxtLang,
+            language ));
+ 
+        if ( err == KErrNone && iInputLanguageSetting != language )
+            {           
+            iInputLanguageSetting = language;
+            
+            // Notify change to the observers.
+            for ( TInt i = 0; i < iObserverArray.Count(); i++ ) 
+                {
+                iObserverArray[i]->HandleInputLanguageSettingChange( 
+                    iInputLanguageSetting );
+                }    
+            }   
+        }      
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneLangSettingMonitor::Language
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneLangSettingMonitor::InputLanguage() const
+    {
+    return iInputLanguageSetting;
+    }
+
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonelibrarycontainer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for factory library handles.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonelibrarycontainer.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneLibraryContainer::~CPhoneLibraryContainer()
+// Destructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneLibraryContainer::~CPhoneLibraryContainer()
+    {
+    TInt i( 0 );
+    TInt count( iLibraries.Count() ); 
+
+    // Close the libraries
+    for( ; i < count; i++ )
+        {
+        iLibraries[i].Close();
+        }
+
+    // Free allocated memory from array
+    iLibraries.Close();
+    }
+
+// ---------------------------------------------------------
+// CPhoneLibraryContainer::CPhoneLibraryContainer()
+// Default constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+CPhoneLibraryContainer::CPhoneLibraryContainer()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneLibraryContainer::NewL()
+// Two-phased constructor.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneLibraryContainer* CPhoneLibraryContainer::NewL()
+    {
+    CPhoneLibraryContainer* self = new( ELeave ) CPhoneLibraryContainer;
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CPhoneLibraryContainer::AddLibraryL()
+// Adds library to container.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneLibraryContainer::AddLibraryL( 
+    const RLibrary& aLibraryHandle )
+    {
+    User::LeaveIfError( iLibraries.Append( aLibraryHandle ) );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonemainerrormessageshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMainErrorMessagesHandler class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32uid.h>
+#include <pevirtualengine.h>
+#include "cphonemainerrormessageshandler.h"
+
+#include "phoneui.pan"
+#include "phoneconstants.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneMainErrorMessagesHandler::CPhoneMainErrorMessagesHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMainErrorMessagesHandler::CPhoneMainErrorMessagesHandler() :
+    CCoeStatic( KUidMainErrorMessagesHandlerSingleton, EThread )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMainErrorMessagesHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneMainErrorMessagesHandler* CPhoneMainErrorMessagesHandler::NewL()
+    {
+    CPhoneMainErrorMessagesHandler* self = 
+        new( ELeave ) CPhoneMainErrorMessagesHandler();
+
+    return self;
+    }
+
+// Destructor
+CPhoneMainErrorMessagesHandler::~CPhoneMainErrorMessagesHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMainErrorMessagesHandler::ResolveResourceID
+// Resolve resource id of given resource.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneMainErrorMessagesHandler::ShowErrorSpecificNoteL( 
+    const TPEErrorInfo& aErrorInfo )
+    {
+    return iHandler->ShowErrorSpecificNoteL( aErrorInfo );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMainErrorMessagesHandler::RegisterResolverL
+// Register given resolver
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneMainErrorMessagesHandler::RegisterErrorMessagesHandler( 
+    MPhoneErrorMessagesHandler* aHandler )
+    {
+    if ( !iHandler )
+        {
+        iHandler = aHandler;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMainErrorMessagesHandler::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneMainErrorMessagesHandler* CPhoneMainErrorMessagesHandler::Instance()
+    {
+    CPhoneMainErrorMessagesHandler* instance = 
+        static_cast<CPhoneMainErrorMessagesHandler*>( 
+        CCoeEnv::Static ( KUidMainErrorMessagesHandlerSingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneMainErrorMessagesHandler::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneUtilsCouldNotCreateSingleton );    
+            }
+        }
+    return instance;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonemainresourceresolver.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneMainResourceResolver class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32uid.h>
+#include "cphonemainresourceresolver.h"
+
+#include "phoneui.pan"
+#include "phoneconstants.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneMainResourceResolver::CPhoneMainResourceResolver
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneMainResourceResolver::CPhoneMainResourceResolver() :
+    CCoeStatic( KUidMainResourceResolverSingleton, EThread )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMainResourceResolver::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneMainResourceResolver* CPhoneMainResourceResolver::NewL()
+    {
+    CPhoneMainResourceResolver* self = 
+        new( ELeave ) CPhoneMainResourceResolver();
+
+    return self;
+    }
+
+// Destructor
+CPhoneMainResourceResolver::~CPhoneMainResourceResolver()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMainResourceResolver::ResolveResourceID
+// Resolve resource id of given resource.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneMainResourceResolver::ResolveResourceID( 
+    const TInt& aResource ) const
+    {
+    return iResolver->ResolveResourceID( aResource );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneMainResourceResolver::RegisterResolverL
+// Register given resolver
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPhoneMainResourceResolver::RegisterResolver( 
+    MPhoneResourceResolver* aResolver )
+    {
+    if ( !iResolver )
+        {
+        iResolver = aResolver;
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneMainResourceResolver::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneMainResourceResolver* CPhoneMainResourceResolver::Instance()
+    {
+    CPhoneMainResourceResolver* instance = 
+        static_cast<CPhoneMainResourceResolver*>( 
+        CCoeEnv::Static ( KUidMainResourceResolverSingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneMainResourceResolver::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneUtilsCouldNotCreateSingleton );    
+            }
+        }
+    return instance;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonepublishsubscriberao.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  see header description
+ *
+*/
+
+
+// INCLUDES
+#include <e32svr.h>
+#include "cphonepublishsubscriberao.h"
+#include "phonelogger.h"
+
+// CONSTANTS
+
+// ============================= MEMBER FUNCTIONS =============================
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::NewL()
+// ----------------------------------------------------------------------------
+CPhonePublishSubscriberAO* CPhonePublishSubscriberAO::NewL( 
+    MPhonePubSubObserver* aPubSubObserver, 
+    const TUid& aCategory, 
+    const TUint aKey )
+    {
+    CPhonePublishSubscriberAO* self = 
+        new (ELeave) CPhonePublishSubscriberAO( 
+            aPubSubObserver, aCategory, aKey );
+
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::Subscribe()
+// ----------------------------------------------------------------------------
+void CPhonePublishSubscriberAO::Subscribe()
+    {
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::CPhonePublishSubscriberAO()
+// ----------------------------------------------------------------------------
+CPhonePublishSubscriberAO::CPhonePublishSubscriberAO( 
+    MPhonePubSubObserver* aPubSubObserver, 
+    const TUid& aCategory, 
+    const TUint aKey ) :
+    CActive( EPriorityStandard ),
+    iPubSubObserver( aPubSubObserver ),
+    iCategory( aCategory ),
+    iKey( aKey )
+    {
+    CActiveScheduler::Add( this );
+    iProperty.Attach( iCategory, iKey );
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::RunL()
+// ----------------------------------------------------------------------------
+void CPhonePublishSubscriberAO::RunL()
+    {
+    Subscribe();
+    
+    // Get the value     
+    TInt value( 0 );
+    iProperty.Get( iCategory, iKey, value );
+
+    // Notify the observer
+    iPubSubObserver->HandlePropertyChangedL( iCategory, iKey, value );
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::DoCancel()
+// ----------------------------------------------------------------------------
+void CPhonePublishSubscriberAO::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::RunError()
+// ----------------------------------------------------------------------------
+TInt CPhonePublishSubscriberAO::RunError( TInt aError )
+    {    
+    __PHONELOG1( 
+        EBasic, 
+        EPhonePhoneapp, 
+        "CPhonePublishSubscriberAO::RunError: error: %d", 
+        aError );
+
+    return aError;
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::~CPhonePublishSubscriberAO()
+// ----------------------------------------------------------------------------
+CPhonePublishSubscriberAO::~CPhonePublishSubscriberAO()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::Category()
+// ----------------------------------------------------------------------------
+const TUid CPhonePublishSubscriberAO::Category() const
+    {
+    return iCategory;
+    }
+
+// ----------------------------------------------------------------------------
+// CPhonePublishSubscriberAO::Key()
+// ----------------------------------------------------------------------------
+TUint CPhonePublishSubscriberAO::Key() const
+    {
+    return iKey;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonepubsubproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Publish & Subscribe proxy.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32base.h>     // TPriority::EPriorityHigh=20
+#include <PSVariables.h>
+#include <telinternalpskeys.h>
+#include <telephonydomainpstypes.h>
+#include <btengdomainpskeys.h>
+
+#include <startupdomainpskeys.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <hwrmdomainpskeys.h>
+#include <UikonInternalPSKeys.h>
+
+#include  "phoneui.pan"
+#include  "phoneconstants.h"
+#include  "phonelogger.h"
+
+#include  "cphonepubsubproxy.h"
+#include  "cphonepublishsubscriberao.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhonePubSubProxy* CPhonePubSubProxy::Instance()
+    {
+    CPhonePubSubProxy* instance = static_cast<CPhonePubSubProxy*> 
+        ( CCoeEnv::Static ( KUidPubSubProxySingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhonePubSubProxy::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneUtilsCouldNotCreateSingleton );    
+            }
+        }
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::CancelAllNotifications
+// Cancel the notification if the singleton still exists.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhonePubSubProxy::CancelAllNotifications( 
+    MPhonePubSubObserver* aObserver )
+    {
+    CPhonePubSubProxy* instance = static_cast<CPhonePubSubProxy*> 
+        ( CCoeEnv::Static( KUidPubSubProxySingleton ) );
+    
+    // Ignore the call since the singleton has already been destroyed and the
+    // notifications removed
+    if ( instance )
+        {
+        instance->CancelAllObserverNotifies( aObserver );
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::NewL
+// ---------------------------------------------------------
+//
+CPhonePubSubProxy* CPhonePubSubProxy::NewL()
+    {
+    CPhonePubSubProxy* self = new (ELeave) CPhonePubSubProxy();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhonePubSubProxy::~CPhonePubSubProxy
+// ---------------------------------------------------------
+//
+EXPORT_C CPhonePubSubProxy::~CPhonePubSubProxy()
+    {
+    if ( iPublishSubscriberArray )
+        {
+        iPublishSubscriberArray->ResetAndDestroy();
+        }
+    delete iPublishSubscriberArray;
+    delete iObserverArray;
+    }
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::CPhonePubSubProxy
+// ---------------------------------------------------------
+//
+CPhonePubSubProxy::CPhonePubSubProxy() :
+    CCoeStatic( KUidPubSubProxySingleton, EThread )
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::ConstructL
+// ---------------------------------------------------------
+//
+void CPhonePubSubProxy::ConstructL()
+    {
+    iObserverArray = new ( ELeave ) CArrayFixFlat< TPubSubObserverTag >( 
+        KPhonePubSubProxyObserverArrayGranularity );
+
+    iPublishSubscriberArray = new ( ELeave ) 
+        CArrayPtrFlat< CPhonePublishSubscriberAO >( 
+            KPhonePubSubArrayGranularity );
+    }
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::Value
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CPhonePubSubProxy::Value( 
+    const TUid& aCategory,
+    const TUint aKey )
+    {
+    TInt err( KErrNone );
+    TInt value( 0 );
+
+    err = RProperty::Get( aCategory, aKey, value );
+    if ( err != KErrNone )
+        {
+        value = err;
+
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhonePubSubProxy::GetValue error: %d", 
+            err );
+        }
+
+    return value;
+    }
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::NotifyChangeL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhonePubSubProxy::NotifyChangeL( 
+    const TUid& aCategory,
+    const TUint aKey, 
+    MPhonePubSubObserver* aObserver )
+    {
+    __ASSERT_DEBUG( aObserver, Panic( EPhoneUtilsParameterNotInitialized ) );
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhonePubSubProxy::NotifyChangeL() ");
+    
+    // make sure this a new item in iObserverArray
+    TBool requestIssued = EFalse;
+    TBool sameRequestIssuedByObserver = EFalse;
+    TInt count = iObserverArray->Count();
+
+    // check if the request has already been issued
+    for ( TInt i = 0; i < count && !requestIssued; i++ ) 
+        {
+        const TPubSubObserverTag& observerTag = iObserverArray->At( i );
+        if ( ( observerTag.iCategory == aCategory ) &&
+            ( observerTag.iKey == aKey ) )
+            {
+            requestIssued = ETrue;
+            if ( observerTag.iObserver == aObserver )
+                {
+                sameRequestIssuedByObserver = ETrue;
+                }
+            }
+        }
+
+    // make sure the same request hasn't been issued by this observer
+    if ( !sameRequestIssuedByObserver )
+        {
+        //add new observer to the array
+        TPubSubObserverTag newObserver;
+        newObserver.iCategory = aCategory;
+        newObserver.iKey = aKey;
+        newObserver.iObserver = aObserver;
+        iObserverArray->AppendL( newObserver );
+        }
+
+    //make sure the request hasn't been issued before
+    if ( !requestIssued )
+        {
+        //issue a new request
+        CPhonePublishSubscriberAO* publishSubscriber = 
+            CPhonePublishSubscriberAO::NewL( this, aCategory, aKey );
+    
+        CleanupStack::PushL( publishSubscriber );
+        iPublishSubscriberArray->AppendL( publishSubscriber );
+        CleanupStack::Pop( publishSubscriber );
+        
+        //subscribe for property change notications
+        publishSubscriber->Subscribe();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::ChangePropertyValue
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhonePubSubProxy::ChangePropertyValue( 
+    const TUid& aCategory,
+    const TUint aKey, 
+    const TInt aValue )
+    {
+    TInt err( KErrNone );
+
+    err = RProperty::Set( aCategory, aKey, aValue );
+    if ( err != KErrNone )
+        {
+        __PHONELOG1( 
+            EBasic, 
+            EPhonePhoneapp, 
+            "CPhonePubSubProxy::ChangePropertyValue error: %d", 
+            err );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhonePubSubProxy::HandlePropertyChangedL
+// ---------------------------------------------------------
+//
+void CPhonePubSubProxy::HandlePropertyChangedL( 
+    const TUid& aCategory, 
+    const TUint aKey,
+    const TInt aValue )
+    {
+    TInt count = iObserverArray->Count();
+    for ( TInt i = 0; i < count; )
+        {
+        // Take observer information.
+        TPubSubObserverTag observerTag = iObserverArray->At( i );
+        
+        if ( ( observerTag.iCategory == aCategory ) && 
+            ( observerTag.iKey == aKey ) ) 
+            {
+            observerTag.iObserver->HandlePropertyChangedL( 
+                aCategory, aKey, aValue );
+            }
+
+        // Update count variable - might have been modified by the
+        // HandlePropertyChangedL call.
+        count = iObserverArray->Count();
+
+        // If still in bounds, check if nothing changed. If so, then
+        // we can move to next observer.
+        if ( i < count )
+            {
+            const TPubSubObserverTag& obs = iObserverArray->At( i );
+
+            if ( ( obs.iObserver == observerTag.iObserver ) &&
+                 ( obs.iCategory == observerTag.iCategory ) &&
+                 ( obs.iKey == observerTag.iKey ) )
+                {
+                i++;
+                }
+            }
+        }
+    }
+               
+// ---------------------------------------------------------
+// CPhonePubSubProxy::CancelAllObserverNotifies
+// ---------------------------------------------------------
+//
+void CPhonePubSubProxy::CancelAllObserverNotifies( 
+    MPhonePubSubObserver* aObserver )
+    {
+    TInt count = iObserverArray->Count();
+
+    // Remove the observer and its subscriptions
+    TBool observerRemoved = EFalse;
+    for( TInt i = count - 1; i >= 0 && !observerRemoved; i-- ) 
+        {
+        const TPubSubObserverTag& observerTag = iObserverArray->At( i );
+        if ( observerTag.iObserver == aObserver )
+            {
+            // Remove observer 
+            observerRemoved = ETrue;
+            iObserverArray->Delete( i );
+
+            // Remove this observers' subscriptions
+            TInt pubSubCount = iPublishSubscriberArray->Count();
+     
+            for ( TInt j = pubSubCount - 1; j >= 0; j++ )
+                {
+                CPhonePublishSubscriberAO* publishSubscriber = 
+                    iPublishSubscriberArray->At( j );
+
+                if ( publishSubscriber->Category() == observerTag.iCategory && 
+                    publishSubscriber->Key() == observerTag.iKey )
+                    {
+                    iPublishSubscriberArray->Delete( i );
+                    delete publishSubscriber;
+                    }
+                }
+            }
+        }
+    }
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphoneqwertyhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneQwertyHandler class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "cphoneqwertyhandler.h"
+#include    "cphonelangsettingmonitor.h"
+#include    "cphoneqwertymodemonitor.h"
+#include    <PtiEngine.h>
+#include    <w32std.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::CPhoneQwertyHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneQwertyHandler::CPhoneQwertyHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneQwertyHandler::ConstructL()
+    {
+    // Language setting monitor
+    iLangSettingMonitor = CPhoneLangSettingMonitor::NewL();
+    iLangSettingMonitor->AddObserverL( *this );
+    
+    // Qwerty mode
+    iQwertyModeMonitor = CPhoneQwertyModeMonitor::NewL();
+    iQwertyModeMonitor->AddObserverL( *this );
+    
+    // Read current values
+    iInputLanguageId = iLangSettingMonitor->InputLanguage();
+    iQwertyMode = iQwertyModeMonitor->QwertyMode();
+    
+    if ( iQwertyMode )
+        {
+        LoadNumericKeyBindings( iInputLanguageId, iQwertyModeMonitor->Keyboard() );            
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneQwertyHandler* CPhoneQwertyHandler::NewL()
+    {
+    CPhoneQwertyHandler* self = 
+        new (ELeave) CPhoneQwertyHandler();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// Destructor
+EXPORT_C CPhoneQwertyHandler::~CPhoneQwertyHandler()
+    {
+    iLangSettingMonitor->RemoveObserver( *this );
+    delete iLangSettingMonitor;
+    iLangSettingMonitor = NULL;
+    iQwertyModeMonitor->RemoveObserver( *this );
+    delete iQwertyModeMonitor;
+    iQwertyModeMonitor = NULL;
+    iNumericKeys.Close();
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::IsQwertyInput
+// -----------------------------------------------------------------------------
+//    
+EXPORT_C TBool CPhoneQwertyHandler::IsQwertyInput() const
+    {
+    return iQwertyMode > 0 ? ETrue : EFalse;    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::HandleLanguageSettingChange
+// -----------------------------------------------------------------------------
+//    
+void CPhoneQwertyHandler::HandleInputLanguageSettingChange( TInt aLanguage )
+    {
+    iInputLanguageId = aLanguage;
+    if ( iQwertyMode )
+        {
+        LoadNumericKeyBindings( iInputLanguageId, iQwertyModeMonitor->Keyboard() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::HandleQwertyModeChange
+// Loads keybinding with keyboard EPtiKeyboardNone if no keyboeard has been   
+// defined
+// -----------------------------------------------------------------------------
+//    
+void CPhoneQwertyHandler::HandleQwertyModeChange( TInt aMode )
+    {
+    iQwertyMode = aMode;
+#ifndef RD_INTELLIGENT_TEXT_INPUT    
+    if ( iQwertyMode && !iNumericKeys.Count() )
+        {
+        LoadNumericKeyBindings( iInputLanguageId, iQwertyModeMonitor->Keyboard() );            
+        }
+#endif    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::HandleKeyboardLayoutChange
+// This event comes after HandleQwertyModeChange
+// -----------------------------------------------------------------------------
+//
+void CPhoneQwertyHandler::HandleKeyboardLayoutChange()
+    {
+    
+    LoadNumericKeyBindings( iInputLanguageId, iQwertyModeMonitor->Keyboard() );            
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::LoadNumericKeyBindings
+// -----------------------------------------------------------------------------
+//    
+void CPhoneQwertyHandler::LoadNumericKeyBindings( TInt aLanguage, TInt aKeyboard )
+    {
+    iNumericKeys.Reset();
+    
+#ifdef RD_INTELLIGENT_TEXT_INPUT    
+    TPtiKeyboardType keyboard = static_cast<TPtiKeyboardType>( aKeyboard );
+    TRAPD( err, 
+        {
+        CPtiEngine* ptiEngine = CPtiEngine::NewL();
+        CleanupStack::PushL( ptiEngine );
+        
+        ptiEngine->GetNumericModeKeysForQwertyL( aLanguage, 
+                                                 iNumericKeys,
+                                                 keyboard );         
+        CleanupStack::PopAndDestroy( ptiEngine );                                                 
+        } ); // TRAP
+#else
+    TRAPD( err, 
+        {
+        CPtiEngine* ptiEngine = CPtiEngine::NewL();
+        CleanupStack::PushL( ptiEngine );
+        ptiEngine->GetNumericModeKeysForQwertyL( aLanguage, 
+                                                 iNumericKeys );         
+        CleanupStack::PopAndDestroy( ptiEngine );                                                 
+        } ); // TRAP
+#endif    
+        
+    if ( err )        
+        {
+        iNumericKeys.Reset();
+        iQwertyMode = 0; // To default mode
+        }
+    else
+        {
+        // remove keys that are not remapped
+        TInt numericKeysCount = iNumericKeys.Count();
+        while ( numericKeysCount-- )
+            {
+            TPtiNumericKeyBinding numKeyBind = iNumericKeys[numericKeysCount];
+            
+            // This is PTI bug? Should not be in numeric keys list.
+            if ( numKeyBind.iKey == EPtiKeyQwertySpace ) 
+                 {
+                 iNumericKeys.Remove( numericKeysCount );                    
+                 }
+            }    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyHandler::NumericKeyCode
+// -----------------------------------------------------------------------------
+//    
+EXPORT_C TInt CPhoneQwertyHandler::NumericKeyCode( const TKeyEvent& aKeyEvent )
+    {
+  
+    // Check shift state
+    TBool shiftActive(EFalse);
+    shiftActive = aKeyEvent.iModifiers & EModifierLeftShift ||
+                  aKeyEvent.iModifiers & EModifierRightShift; //||
+    
+    TInt numericKeysCount = iNumericKeys.Count();
+    
+    while ( numericKeysCount-- )
+        {
+        TPtiNumericKeyBinding numKeyBind = iNumericKeys[numericKeysCount];
+            
+        TBool shiftRequired = ( numKeyBind.iCase ==EPtiCaseUpper ) ||
+                              ( numKeyBind.iCase ==EPtiCaseChrUpper );
+            
+        if ( numKeyBind.iKey == aKeyEvent.iScanCode &&
+             (shiftRequired == shiftActive  )   )
+            {
+            return numKeyBind.iChar;
+            }
+        }
+        
+    return EKeyNull;         
+    }           
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphoneqwertymodemonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Qwerty Mode Monitor.
+*
+*/
+
+
+// INCLUDE FILES
+#include <bautils.h>
+#include <AvkonInternalCRKeys.h>
+#include <e32property.h>
+#include <PSVariables.h>
+#include <bldvariant.hrh>
+
+#include "cphoneqwertymodemonitor.h"
+#include "mphoneqwertymodeobserver.h"
+#include "phonelogger.h"
+#include "cphonepubsubproxy.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// C++ constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneQwertyModeMonitor::CPhoneQwertyModeMonitor()
+    {
+    }
+
+// ---------------------------------------------------------
+// CPhoneQwertyModeMonitor::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneQwertyModeMonitor::ConstructL()
+    {
+    iQwertyMode = GetQwertyMode();     
+    iKeyboard = GetKeyboard();    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneQwertyModeMonitor* CPhoneQwertyModeMonitor::NewL()
+    {
+    CPhoneQwertyModeMonitor* self = 
+        new (ELeave) CPhoneQwertyModeMonitor();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// Destructor
+CPhoneQwertyModeMonitor::~CPhoneQwertyModeMonitor()
+    {
+    iObserverArray.Reset();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::AddObserverL
+// -----------------------------------------------------------------------------
+//
+void CPhoneQwertyModeMonitor::AddObserverL(
+    MPhoneQwertyModeObserver& aObserver )
+    {
+    if ( iObserverArray.Find( &aObserver ) != KErrNone )
+        {
+        User::LeaveIfError( iObserverArray.Append( &aObserver ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::RemoveObserver
+// -----------------------------------------------------------------------------
+//
+void CPhoneQwertyModeMonitor::RemoveObserver(
+    MPhoneQwertyModeObserver& aObserver )
+    {
+    TInt index;
+    if ( iObserverArray.FindInAddressOrder( &aObserver, index ) == KErrNone )
+        {
+        iObserverArray.Remove( index );
+        }
+    }
+    
+// -----------------------------------------------------------
+// CPhoneQwertyModeMonitor::HandlePropertyChangedL
+// -----------------------------------------------------------
+//
+void CPhoneQwertyModeMonitor::HandlePropertyChangedL( 
+        const TUid& aCategory,
+        const TUint aKey,
+        const TInt aValue )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneQwertyModeMonitor::HandlePropertyChangedL( ) ");
+    if ( aCategory == KCRUidAvkon )
+        {
+        if ( aKey == KAknQwertyInputModeActive )
+            {
+            iQwertyMode = aValue;
+
+            for ( TInt i = 0; i < iObserverArray.Count(); i++ ) 
+                {
+                iObserverArray[ i ]->HandleQwertyModeChange( 
+                    iQwertyMode );
+                }           
+            }
+#ifdef RD_INTELLIGENT_TEXT_INPUT        
+        else if ( aKey == KAknKeyBoardLayout )
+            {
+            for ( TInt i = 0; i < iObserverArray.Count(); i++ ) 
+                {
+                iKeyboard = aValue;
+                iObserverArray[ i ]->HandleKeyboardLayoutChange();
+                }
+            }
+#endif    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::QwertyMode
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneQwertyModeMonitor::QwertyMode() const
+    {
+    return iQwertyMode;
+    }
+  
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::Keyboard
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneQwertyModeMonitor::Keyboard() const
+    {
+    return iKeyboard;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::GetQwertyMode
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneQwertyModeMonitor::GetQwertyMode() const
+    {
+    // Get call state.
+    /*TInt qwertyMode( CPhonePubSubProxy::Instance()->Value(
+        KCRUidAvkon,
+        KAknQwertyInputModeActive ) );*/
+    TInt qwertyMode(0);
+    
+    return qwertyMode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneQwertyModeMonitor::GetQwertyMode
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneQwertyModeMonitor::GetKeyboard() const
+    {
+    TInt keyboard(0);    
+    return keyboard;
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonerecoverysystem.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,279 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Recovery system.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <e32svr.h>
+
+#include    "phoneui.pan"
+#include    "cphonerecoverysystem.h"
+#include    "ctelerecoverysystem.h"
+#include    "cphonetimer.h"
+#include    "phoneconstants.h"
+
+const TInt KEmptySlot = 0;
+const TInt KErrNoSpace = -1;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneRecoverySystem::Instance
+// Initializes the singleton object
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneRecoverySystem* CPhoneRecoverySystem::Instance()
+    {
+    CPhoneRecoverySystem* instance = static_cast<CPhoneRecoverySystem*> 
+        ( CCoeEnv::Static ( KUidRecoverySystemSingleton ) );
+    
+    if ( !instance )
+        {
+        TRAPD( err, instance = CPhoneRecoverySystem::NewL() );
+        if ( err )
+            {
+            Panic( EPhoneUtilsCouldNotCreateSingleton );    
+            }
+        }
+    return instance;
+    }
+
+// ---------------------------------------------------------
+// CPhoneRecoverySystem::CPhoneRecoverySystem
+// ---------------------------------------------------------
+//
+CPhoneRecoverySystem::CPhoneRecoverySystem() :
+    CCoeStatic( KUidRecoverySystemSingleton, EThread )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::NewL
+// -----------------------------------------------------------------------------
+//
+CPhoneRecoverySystem* CPhoneRecoverySystem::NewL()
+    {
+    CPhoneRecoverySystem* self = new (ELeave) CPhoneRecoverySystem();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeUtlFactoryImpl::CreateRecoverySystemL
+// 
+// -----------------------------------------------------------------------------
+//
+CTeleRecoverySystem* CPhoneRecoverySystem::CreateRecoverySystemL()
+    {
+    return CTeleRecoverySystem::NewL();
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::~CPhoneRecoverySystem
+// -----------------------------------------------------------------------------
+//
+CPhoneRecoverySystem::~CPhoneRecoverySystem()
+    {
+    RemoveAllIdsFromContainer();
+    delete iRecoverySystem;
+    iRecoverySystem = NULL; 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::AddL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TRecoveryId CPhoneRecoverySystem::AddL( 
+    TCallBack aCallBack, 
+    TRecoveryPriority aPriority, 
+    CTeleRecoverySystem::TRecoveryState aState )
+    {
+    if ( !iRecoverySystem )
+        {
+        iRecoverySystem = CreateRecoverySystemL();  
+        }
+        
+    TRecoveryId id = iRecoverySystem->AddL( 
+        aCallBack, 
+        aPriority, 
+        aState );
+
+    try
+        {
+        AddIdToContainer( id ); 
+        }
+    catch( TInt exception )
+        {
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneUtilsBufferOverflow ) );   
+        }
+    
+    return id;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::Add
+// -----------------------------------------------------------------------------
+//
+TRecoveryId CPhoneRecoverySystem::Add(
+    TCallBack aCallBack, 
+    TRecoveryPriority aPriority, 
+    CTeleRecoverySystem::TRecoveryState aState )
+    {
+    return iRecoverySystem->Add( 
+        aCallBack, 
+        aPriority, 
+        aState );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::Remove
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRecoverySystem::Remove( TRecoveryId aId )
+    {
+    CPhoneRecoverySystem* instance = static_cast<CPhoneRecoverySystem*> 
+        ( CCoeEnv::Static( KUidRecoverySystemSingleton ) );
+    
+    if ( instance )
+        {
+        instance->RemoveId( aId );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::RemoveId
+// -----------------------------------------------------------------------------
+//
+void CPhoneRecoverySystem::RemoveId( TRecoveryId aId )
+    {
+    if ( iRecoverySystem )
+        {
+        iRecoverySystem->Remove( aId );
+        RemoveFromContainer( aId );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::SetState
+// -----------------------------------------------------------------------------
+//
+void CPhoneRecoverySystem::SetState( TRecoveryId aId, CTeleRecoverySystem::TRecoveryState aState )
+    {
+    iRecoverySystem->SetState( 
+        aId, 
+        aState );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::ResetPending
+// -----------------------------------------------------------------------------
+//
+void CPhoneRecoverySystem::ResetPending()
+    {
+    iRecoverySystem->ResetPending();
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::RecoverNow
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneRecoverySystem::RecoverNow( TRecoveryId aId,
+    TRecoveryPriority aPriority,
+    TBool aAllSteps )
+    {
+    __ASSERT_DEBUG( iRecoverySystem, Panic( EPhoneUtilsInvariant ) );
+    
+    if ( !iRecoverySystem )
+        {
+        TRAPD( error, iRecoverySystem = CreateRecoverySystemL() )
+        if( error != KErrNone )
+            {
+            return error;
+            }
+        }
+    return iRecoverySystem->RecoverNow( aId, aPriority, aAllSteps );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::EnablePreconditionL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneRecoverySystem::EnablePreconditionL()
+    {
+    __ASSERT_DEBUG( iRecoverySystem, Panic( EPhoneUtilsInvariant ) );
+    
+    if ( !iRecoverySystem )
+        {
+        iRecoverySystem = CreateRecoverySystemL();
+        }
+        
+    iRecoverySystem->EnablePrecondition();
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::AddIdToContainer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRecoverySystem::AddIdToContainer( TRecoveryId aId )
+    {
+    __ASSERT_DEBUG( iIdContainer.Count() == KIdContainerSize, Panic( EPhoneUtilsInvariant ) );
+    for( TInt i = 0; i < KIdContainerSize; i++ )
+        {
+        if( iIdContainer[ i ] == KEmptySlot )
+            {
+            iIdContainer[ i ] = aId;
+            return;             
+            }
+        }
+    
+    // All slots checked, no space - throw exception    
+    throw KErrNoSpace;      
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::RemoveFromContainer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRecoverySystem::RemoveFromContainer( TRecoveryId aId )
+    {
+    __ASSERT_DEBUG( iIdContainer.Count() == KIdContainerSize, Panic( EPhoneUtilsInvariant ) );
+    for( TInt i = 0; i < KIdContainerSize; i++ )
+        {
+        if( iIdContainer[ i ] == aId )
+            {
+            iIdContainer[ i ] = KEmptySlot;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRecoverySystem::RemoveAllIdsFromContainer
+// -----------------------------------------------------------------------------
+//
+void CPhoneRecoverySystem::RemoveAllIdsFromContainer()
+    {
+    __ASSERT_DEBUG( iIdContainer.Count() == KIdContainerSize, Panic( EPhoneUtilsInvariant ) );
+    for( TInt i = 0; i < KIdContainerSize; i++ )
+        {
+        if( iIdContainer[ i ] != KEmptySlot )
+            {
+            RemoveId( iIdContainer[ i ] );
+            }
+        }       
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphoneresourceresolverbase.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1523 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneResourceResolverBase class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <bautils.h>
+#include <eikenv.h>
+#include <avkon.rsg>
+#include <featmgr.h>
+#include <telephonyvariant.hrh>
+
+#include "phoneui.pan"
+#include "cphoneresourceresolverbase.h"
+#include "cphonemainresourceresolver.h"
+#include "phoneconstants.h"
+#include "phonerssbase.h"
+#include "phonelogger.h"
+#include "cphonecenrepproxy.h"
+
+#include "phoneresourceids.h"
+#include "tphonetouchbuttonconfig.h"
+#include <data_caging_path_literals.hrh>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverBase::CPhoneResourceResolverBase
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPhoneResourceResolverBase::CPhoneResourceResolverBase():
+    iEnv( *CEikonEnv::Static() )
+    {
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        iVariationFlags |= EOnscreenDialer;
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        iVariationFlags |= ETouchCallHandling;
+        }
+
+    if ( FeatureManager::FeatureSupported( KFeatureIdVideocallMenuVisibility ) )
+        {
+        iVariationFlags |= EVideoCallMenu;
+        }
+    }
+
+// Destructor
+EXPORT_C CPhoneResourceResolverBase::~CPhoneResourceResolverBase()
+    {
+    // Remove resource file
+    iEnv.DeleteResourceFile( iResourceOffset );
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        iEnv.DeleteResourceFile( iCUIResourceOffset );
+        iEnv.DeleteResourceFile( iPTCHResourceOffset );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverBase::BaseConstructL
+// 
+// 
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneResourceResolverBase::BaseConstructL()
+    { 
+    // Add resource file
+    // Create path to default resource file name
+    TFileName path( KDriveZ );
+    path.Append( KDC_APP_RESOURCE_DIR );
+    path.Append( KPhoneResourceFile );
+    
+    RFs &fsSession= iEnv.FsSession();
+    BaflUtils::NearestLanguageFile( fsSession, path ); 
+    iResourceOffset = iEnv.AddResourceFileL( path );
+    
+    if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
+        {
+        // callhandlingui.rss
+        TFileName callHandlingPath( KDriveZ );
+        callHandlingPath.Append( KDC_APP_RESOURCE_DIR );
+        callHandlingPath.Append( KPhoneResourceFileCHUI );
+        BaflUtils::NearestLanguageFile( fsSession, callHandlingPath ); 
+        iCUIResourceOffset = iEnv.AddResourceFileL( callHandlingPath );
+        // phoneuitouch.rss
+        TFileName phoneUiTouchPath( KDriveZ );
+        phoneUiTouchPath.Append( KDC_APP_RESOURCE_DIR );
+        phoneUiTouchPath.Append( KPhoneResourceFilePHTC );
+        BaflUtils::NearestLanguageFile( fsSession, phoneUiTouchPath ); 
+        iPTCHResourceOffset = iEnv.AddResourceFileL( phoneUiTouchPath );
+
+        iTouchButtonConfig.ReadConfiguration();
+        }
+    
+    }
+
+EXPORT_C TBool CPhoneResourceResolverBase::IsTelephonyFeatureSupported( TInt aFeatureId ) const
+    {
+    return CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( aFeatureId );
+    }
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverBase::ResolveResourceID
+// Empty implementation, because there isn't common phoneapp.rss file.
+// Panics, if called.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPhoneResourceResolverBase::ResolveResourceID(
+    const TInt& aResource ) const
+    {
+    TInt retVal( KErrNotFound );
+
+    __PHONELOG1( EBasic, EPhoneUIView, "CPhoneResourceResolverBase::ResolveResourceID - aResource(%d)",
+        aResource );
+    switch( aResource )
+        {
+        case EPhoneNumberBusy:
+            retVal = R_PHONE_ERROR_NUMBER_BUSY;
+            break;
+
+        case EPhoneWaitingText:
+            retVal = R_PHONE_SS_NOTIFICATION_MOCAL_WAITING_TEXT;
+            break;
+
+        case EPhoneIdleMenubar:
+            retVal = R_PHONEUI_IDLE_MENUBAR;
+            break;
+
+        case EPhoneNumberAcqMenubar:
+
+            if ( iVariationFlags & EOnscreenDialer)
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else if ( iVariationFlags & EVideoCallMenu )
+                {
+                retVal = R_PHONEUI_NUMBERACQ_VIDEOCALL_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_NUMBERACQ_MENUBAR;
+                }
+
+            break;
+
+        case EPhoneNumberAcqOkMenubar:
+            if ( iVariationFlags & EVideoCallMenu )
+                {
+                retVal = R_PHONEUI_NUMBERACQ_OK_VIDEOCALL_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_NUMBERACQ_OK_MENUBAR;
+                }
+            break;
+
+        case EPhoneCallHandlingMenubar:
+            retVal = R_PHONEUI_CALLHANDLING_MENUBAR;
+            break;
+
+        case EPhoneCallHandlingEmergencyMenubar:
+            retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_MENUBAR;
+            break;
+
+        case EPhoneCallHandlingEmergencyMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_EMERGENCY_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneIncomingCallMenubar:
+            retVal = R_PHONEUI_INCOMINGCALL_MENUBAR;
+            break;
+
+       case EPhoneIncomingVideoCallMenubar:
+            retVal = R_PHONEUI_INCOMINGVIDEOCALL_MENUBAR;
+            break;
+
+        case EPhoneIncomingCallMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_INCOMINGCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+        case EPhoneIncomingVideoCallMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_INCOMINGVIDEOCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case  EPhoneAlertingCallMenubar:
+            retVal = R_PHONEUI_ALERTINGCALL_MENUBAR;
+            break;
+
+        case  EPhoneAlertingCallMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ALERTINGCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneCallActiveAndHeldMenubar:
+            retVal = R_PHONEUI_ACTIVEANDHELD_MENUBAR;
+            break;
+
+        case EPhoneCallActiveAndHeldMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ACTIVEANDHELD_MENUBAR_WITH_NUMBERENTRY;
+                }
+            break;
+
+        case EPhoneCallWaitingMenubar:
+            retVal = R_PHONEUI_CALLWAITING_MENUBAR;
+            break;
+
+        case EPhoneCallWaitingMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLWAITING_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneCallActiveHeldAndWaitingMenubar:
+            if ( !IsTelephonyFeatureSupported( KTelephonyLVFlagOptionsChange ))
+                {
+                retVal = R_PHONEUI_CALLACTIVEHELDANDWAITING_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLACTIVEHELDANDWAITING_MENUBAR_VARIED;
+                }
+            break;
+
+        case EPhoneCallActiveHeldAndWaitingMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer)
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLACTIVEHELDANDWAITING_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneAlertingAndHeldCallMenuBar:
+            retVal = R_PHONEUI_ALERTINGANDHELDCALL_MENUBAR;
+            break;
+
+        case EPhoneAlertingAndHeldCallMenuBarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ALERTINGANDHELDCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneAlertingAndConfHeldCallMenuBar:
+            retVal = R_PHONEUI_ALERTINGANDCONFHELDCALL_MENUBAR;
+            break;
+
+        case EPhoneAlertingAndConfHeldCallMenuBarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ALERTINGANDCONFHELDCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+            break;
+
+        case EPhoneAlertingWaitingAndConfHeldCallMenuBar:
+            retVal = R_PHONEUI_ALERTINGWAITINGANDHELDCONFCALL_MENUBAR;
+            break;
+
+        case EPhoneAlertingWaitingAndConfHeldCallMenuBarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ALERTINGWAITINGANDHELDCONFCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+            break;
+
+        case EPhoneAlertingHeldAndWaitingCallMenuBar:
+            retVal = R_PHONEUI_ALERTINGHELDANDWAITINGCALL_MENUBAR;
+            break;
+
+        case EPhoneAlertingHeldAndWaitingCallMenuBarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ALERTINGHELDANDWAITINGCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneAlertingAndWaitingCallMenuBar:
+            retVal = R_PHONEUI_ALERTINGANDWAITINGCALL_MENUBAR;
+            break;
+
+        case EPhoneAlertingAndWaitingCallMenuBarWithNumberEntry:
+            {
+            retVal = R_PHONEUI_ALERTINGANDWAITINGCALL_MENUBAR_WITH_NUMBERENTRY;
+            }
+            break;
+
+        case EPhoneConfCallMenubar:
+            if ( iVariationFlags & ETouchCallHandling )
+                {
+                retVal = R_PHONEUI_TOUCH_CONFCALL_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CONFCALL_MENUBAR;
+                }
+            break;
+
+        case EPhoneConfCallMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CONFCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneConfAndCallWaitingMenubar:
+            if ( iVariationFlags & ETouchCallHandling )
+                {
+                retVal = R_PHONEUI_TOUCH_CONFANDCALLWAITING_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CONFANDCALLWAITING_MENUBAR;
+                }
+            break;
+
+        case EPhoneConfAndCallWaitingMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CONFANDCALLWAITING_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneConfAndHeldCallMenubar:
+            if ( iVariationFlags & ETouchCallHandling )
+                {
+                retVal = R_PHONEUI_TOUCH_ACTIVECONFANDHELD_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ACTIVECONFANDHELD_MENUBAR;
+                }
+            break;
+
+        case EPhoneConfAndHeldCallMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ACTIVECONFANDHELD_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneActiveAndHeldConfMenubar:
+            if ( iVariationFlags & ETouchCallHandling )
+                {
+                retVal = R_PHONEUI_TOUCH_ACTIVEANDHELDCONF_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ACTIVEANDHELDCONF_MENUBAR;
+                }
+            break;
+
+        case EPhoneActiveAndHeldConfMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_ACTIVEANDHELDCONF_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneConfCallActiveHeldAndWaitingMenubar:
+            if ( iVariationFlags & ETouchCallHandling )
+                {
+                retVal = R_PHONEUI_TOUCH_CONFCALLACTIVEHELDANDWAITING_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CONFCALLACTIVEHELDANDWAITING_MENUBAR;
+                }
+            break;
+
+        case EPhoneConfCallActiveHeldAndWaitingMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CONFCALLACTIVEHELDANDWAITING_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneCallActiveHeldConfAndWaitingMenubar:
+            if ( iVariationFlags & ETouchCallHandling )
+                {
+                retVal = R_PHONEUI_TOUCH_CALLACTIVEHELDCONFANDWAITING_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLACTIVEHELDCONFANDWAITING_MENUBAR;
+                }
+            break;
+
+        case EPhoneCallActiveHeldConfAndWaitingMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLACTIVEHELDCONFANDWAITING_MENUBAR_WITH_NUMBERENTRY;
+                }
+
+            break;
+
+        case EPhoneConfCallParticipantsMenubar:
+            retVal = R_PHONEUI_PARTICIPANT_LIST_MENUBAR;
+            break;
+
+        case EPhoneConfCallParticipantsDropMenubar:
+            retVal = R_PHONEUI_PARTICIPANT_LIST_DROP_MENUBAR;
+            break;
+
+        case EPhoneCallHandlingMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer)
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else if ( iVariationFlags & EVideoCallMenu )
+                {
+                retVal = R_PHONE_INCALL_VIDEOCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+            else
+                {
+                retVal = R_PHONE_INCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+            break;
+        case EPhoneDtmfDialerMenubar:
+                {
+                retVal = R_PHONEUIDIALER_DTMFVIEW_MENUBAR;
+                }
+            break;
+
+        case EPhoneEmptyCBA:
+            retVal = R_PHONEUI_EMPTY_CBA;
+            break;
+
+        case EPhoneEmergencyIdleCBA:
+            retVal = R_PHONEUI_EMERGENCY_IDLE_CBA;
+            break;
+
+        case EPhoneSendDtmfNoCBA:
+            retVal = R_PHONEUI_SEND_DTMF_NO_CBA;
+            break;
+
+        case EPhoneSendDtmfEmptyEditBoxCBA:
+            retVal = R_PHONEUI_SEND_DTMF_EMPTY_EDIT_BOX_CBA;
+            break;
+
+        case EPhoneSendDtmfNormalEditBoxCBA:
+            retVal = R_PHONEUI_SEND_DTMF_NORMAL_EDIT_BOX_CBA;
+            break;
+
+        case EPhoneDtmfSpeedDialNormalEditBoxCBA:
+            retVal = R_PHONEUI_DTMF_SPEED_DIAL_NORMAL_EDIT_BOX_CBA;
+            break;
+
+        case EPhoneNumberAcqCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                  {
+                  retVal = R_PHONEUI_DIALER_CBA;
+                  }
+            else if ( iVariationFlags & EVideoCallMenu )
+                  {
+                  retVal = R_PHONEUI_NUMBERACQ_VIDEOCALL_CBA;
+                  }
+            else
+                 {
+                 retVal = R_PHONEUI_NUMBERACQ_CBA;
+                 }
+            break;
+
+        case EPhoneInCallNumberAcqCBA:
+            retVal = R_PHONEUI_INCALL_NUMBERACQ_CBA;
+            break;
+
+        case EPhoneSettingsUiCBA:
+            retVal = R_PHONEUI_SETTINGSUI_CBA;
+            break;
+
+        case EPhoneCallHandlingCallSetupCBA:
+            if (  iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_ENDOUTGOING_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingCallSetupToIhfCBA:
+            if (  iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_CALLHANDLING_CALLSETUP_TOIHF_DTMFDIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_CALLSETUP_TOIHF_ENDOUTGOING_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingCallSetupToHandsetCBA:
+            if (  iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_CALLHANDLING_CALLSETUP_TOHANDSET_DTMFDIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_CALLSETUP_TOHANDSET_ENDOUTGOING_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingInCallCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_INCALL_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingInCallNoIhfCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_INCALL_NOIHF_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingInCallUnmuteCBA:
+            retVal = R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA;
+            break;
+
+        case EPhoneCallHandlingInCallUnholdCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_INCALL_UNHOLD_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingInCallHandsetCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingInCallBtaaCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_CALLHANDLING_INCALL_BTAA_CBA;
+                }
+
+            break;
+
+        case EPhoneCallHandlingEmergencyCBA:
+                {
+                retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_CBA;
+                }
+
+            break;
+
+        case EPhoneCallHandlingEmergencyHandsetCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_HANDSET_CBA;
+                }
+            break;
+
+        case EPhoneCallHandlingEmergencyNoIhfCBA:
+            retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_NOIHF_CBA;
+            break;
+
+        case EPhoneCallHandlingEmergencyNoOptionsCBA:
+            retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_NO_OPTIONS_CBA;
+            break;
+
+        case EPhoneCallHandlingEmergencyNoOptionsHandsetCBA:
+            retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_NO_OPTIONS_HANDSET_CBA;
+            break;
+
+        case EPhoneCallHandlingEmergencyNoOptionsNoIhfCBA:
+            retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_NO_OPTIONS_NOIHF_CBA;
+            break;
+
+        case EPhoneCallHandlingIncomingCBA:
+            retVal = R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA;
+            break;
+
+        case EPhoneCallHandlingIncomingRejectCBA:
+            retVal = R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA;
+            break;
+
+        case EPhoneCallHandlingIncomingSoftRejectCBA:
+            retVal = R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA;
+            break;
+
+        case EPhoneCallHandlingCallWaitingCBA:
+            retVal = R_PHONEUI_CALLHANDLING_CALLWAITING_CBA;
+            break;
+
+        case EPhoneCallHandlingNewCallFindCBA:
+            retVal = R_PHONEUI_CALLHANDLING_NEW_CALL_FIND_CBA;
+            break;
+
+        case EPhoneCallHandlingNewCallCallCBA:
+            retVal = R_PHONEUI_CALLHANDLING_NEW_CALL_CALL_CBA;
+            break;
+
+        case EPhoneCallHandlingNewCallSwapCBA:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUI_INCALL_DIALER_CBA;
+                }
+            else
+                {
+                retVal = R_PHONEUI_CALLHANDLING_NEW_CALL_SWAP_CBA;
+                }
+            break;
+
+        case EPhoneNewCallFetchCBA:
+            retVal = R_PHONEUI_NEW_CALL_FETCH_CBA;
+            break;
+
+        case EPhoneEmergencyExitCBA:
+            retVal = R_PHONEUI_EXIT_EMERGENCY_MODE_CBA;
+            break;
+
+        case EPhoneEmergencyModeNoteCBA:
+            retVal = R_PHONEUI_EMERGENCY_MODE_NOTE_CBA;
+            break;
+
+        case EPhoneDropParticipantCBA:
+            retVal = R_CONFERENCE_DROPPARTICIPANT_SOFTKEYS;
+            break;
+
+        case EPhonePrivateParticipantCBA:
+            retVal = R_CONFERENCE_PRIVATE_SOFTKEYS;
+            break;
+
+        case EPhoneCallHandlingInCallEndCallCBA:
+            retVal = R_PHONEUI_CALLHANDLING_INCALL_ENDACTIVE_CBA;
+            break;
+
+        case EPhoneNumberNotInUse: // TPAUICmdParamMOTerminationIndicator related start here
+            retVal = R_NOTETEXT_NUMBER_NOT_IN_USE;
+            break;
+
+        case EPhoneNumberBarred:
+            retVal = R_NOTETEXT_NUMBER_BARRED;
+            break;
+
+        case EPhoneNumberNotInCUG:
+            retVal = R_NOTETEXT_NUMBER_NOT_IN_CUG;
+            break;
+
+        case EPhoneNoAnswer:
+            retVal = R_NOTETEXT_NO_ANSWER;
+            break;
+
+        case EPhoneNetworkBusy:
+            retVal = R_NOTETEXT_NETWORK_BUSY;
+            break;
+
+        case EPhoneMOOutOfRange:
+            retVal = R_NOTETEXT_OUT_OF_RANGE;
+            break;
+
+        case EPhoneMOCallFailed:
+            retVal = R_NOTETEXT_CALL_FAILED;
+            break;
+
+        case EPhoneSignalFaded:
+            retVal = R_NOTETEXT_SIGNAL_FADED;
+            break;
+
+        case EPhoneErrorInConnection:
+            retVal = R_NOTETEXT_ERROR_IN_CONNECTION;
+            break;
+
+        case EPhoneInvalidPhoneNumber:
+            retVal = R_NOTETEXT_INVALID_PHONENUMBER;
+            break;
+
+        case EPhoneEmptySimLocation:
+            retVal = R_NOTETEXT_EMPTY_SIM_LOCATION;
+            break;
+
+        case EPhoneCLIConferenceCall:
+            retVal = R_PHONEUI_CONFERENCE_CALL;
+            break;
+
+        case EPhoneEmergencyCallsOnly:
+            retVal =R_PHONE_ERROR_EMERGENCY_CALLS_ONLY;
+            break;
+
+        case EPhoneNoteTextCallNotAllowed:
+            retVal = R_PHONE_ERROR_CALL_NOT_ALLOWED;
+            break;
+
+        case EPhoneNoteTextCallNotAllowedFDN:
+            retVal = R_PHONE_ERROR_CALL_NOT_ALLOWED_FDN;
+            break;
+
+        case EPhoneNoteTextCheckNetworkservices:
+            retVal = R_PHONE_ERROR_CHECK_NETWORK_SERVICES;
+            break;
+
+        case EPhoneNoteTextRequestRejected:
+            retVal = R_PHONE_ERROR_REQUEST_REJECTED;
+            break;
+
+       case EPhoneNoteTextNotAllowed:
+            retVal = R_ERROR_NOTE_NOT_ALLOWED;
+            break;
+
+       case EPhoneNoteNoNetworkCallEmergency:
+            retVal = R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED;
+            break;
+
+        case EPhoneNoteNoVideoNetwork:
+            retVal = R_PHONEUI_NO_VIDEO_NETWORK;
+            break;
+
+        case EPhoneVideoCallIncoming:
+            retVal = R_PHONEUI_VIDEO_CALL_INCOMING;
+            break;
+
+        case EPhoneVideoCallIncomingShort:
+            retVal = R_PHONEUI_VIDEO_CALL_INCOMING_SHORT;
+            break;
+
+       case EPhoneVideoCall2gMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_VIDEOCALL_2G_MENUBAR_WITH_NUMBERENTRY;
+                }
+            break;
+
+       case EPhoneVideoCallMenubar:
+            retVal = R_PHONEUI_VIDEOCALL_MENUBAR;
+            break;
+
+       case EPhoneVideoCallMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_VIDEOCALL_MENUBAR_WITH_NUMBERENTRY;
+                }
+            break;
+
+       case EPhoneVideoCallWaitingMenubar:
+            retVal = R_PHONEUI_VIDEOCALL_WAITING_MENUBAR;
+            break;
+
+       case EPhoneCallWaitingLockMenubar:
+            retVal = R_PHONEUI_WAITING_LOCK_MENUBAR;
+            break;
+
+       case EPhoneCallTwoSinglesWaitingLockMenubar:
+            retVal = R_PHONEUI_TWOSINGLES_WAITING_LOCK_MENUBAR;
+            break;
+
+       case EPhoneVideoCallWaitingMenubarWithNumberEntry:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONEUIDIALER_NUMBERACQ_MENUBAR;
+                }
+            else
+                {
+                retVal = R_PHONEUI_VIDEOCALL_WAITING_MENUBAR_WITH_NUMBERENTRY;
+                }
+            break;
+
+       case EPhoneEmptyBackCBA:
+            retVal = R_PHONEUI_SOFTKEYS_EMPTY_BACK;
+            break;
+
+        case EPhoneInfoHandsfreeDeactivated:
+            retVal = R_AVKON_IHF_DEACTIVATED_CONFIRMATION_NOTE_TEXT;
+            break;
+
+        case EPhoneInfoHandsetActivated:
+            retVal = R_NOTE_TEXT_CONF_AUDIOS_HANDSET;
+            break;
+            
+        case EPhoneInfoBTAccActivated:
+            retVal = R_NOTE_TEXT_CONF_AUDIOS_BT_ACCESSORY;
+            break;
+
+        case EPhoneStringList:
+            retVal = R_PHONEUI_STRING_LIST;
+            break;
+
+        case EPhoneAllIncomingCallsDiverted:
+            retVal = R_NOTETEXT_ALL_INCOMING_CALLS_DIVERTED;
+            break;
+
+        case EPhoneActiveDiverts:
+            retVal = R_NOTETEXT_ACTIVE_DIVERTS;
+            break;
+
+        case EPhoneDefaultSkeyList:
+            retVal = R_PHONEUI_DEFAULT_SKEY_LIST;
+            break;
+
+        case EPhoneEmergencyCallHeader:
+            retVal = R_PHONEUI_EMERGENCY_CALL_HEADER;
+            break;
+
+        case EPhoneEmergencyConnectWaitNote:
+            if ( iVariationFlags & EOnscreenDialer )
+                {
+                retVal = R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE_EMPTY_DIALER;
+                }
+            else
+                {
+                retVal = R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE;
+                }
+            break;
+
+        case EPhoneEmergencyModeInformationNote:
+            retVal = R_PHONE_EMERGENCY_MODE_INFORMATION_NOTE;
+            break;
+
+        case EPhoneExitEmergencyModeQuery:
+            retVal = R_PHONE_EXIT_EMERGENCY_MODE_QUERY;
+            break;
+
+        case EPhoneIncomingCallKeysLocked:
+            retVal = R_NOTETEXT_USE_KEYGUARD_TO_UNLOCK;
+            break;
+
+        case EPhoneIncomingCallLabel:
+            retVal = R_PHONEUI_MTCAL_INCOMING_CALL;
+            break;
+
+        case EPhoneIncomingCallLabelShort:
+            retVal = R_PHONEUI_MTCAL_INCOMING_CALL_SHORT;
+            break;
+
+        case EPhoneOutgoingCallLabel:
+            retVal = R_PHONEUI_OUT_GOING_CALL;
+            break;
+
+        case EPhoneOutgoingCallLabelShort:
+            retVal = R_PHONEUI_OUT_GOING_CALL_SHORT;
+            break;
+
+        case EPhoneOutgoingVideoCallLabel:
+            retVal = R_PHONEUI_OUT_GOING_VIDEO_CALL;
+            break;
+
+        case EPhoneOutgoingVideoCallLabelShort:
+            retVal = R_PHONEUI_OUT_GOING_VIDEO_CALL_SHORT;
+            break;
+
+        case EPhoneCallDurationFormatString:
+            retVal = R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO;
+            break;
+
+        case EPhoneDtmfNumberQuery:
+            retVal = R_PHONEUI_SEND_DTMF_QUERY;
+            break;
+
+        case EPhoneSendingDtmfWaitNote:
+            retVal = R_PHONEUI_SENDING_DTMF_WAIT_NOTE;
+            break;
+
+        case EPhoneSendingDtmfWaitNoteText:
+            retVal = R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT;
+            break;
+
+        case EPhoneDtmfWaitCharacterConfirmationQuery:
+            retVal = R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY;
+            break;
+
+        case EPhoneDtmfWaitCharacterConfirmationQueryText:
+            retVal = R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT;
+            break;
+
+        case EPhoneDtmfFetchTitle:
+            retVal = R_PHONEUI_TITLE_IN_DTMF_FETCH;
+            break;
+
+        case EPhoneDtmfSpeedDialNumberQuery:
+            retVal = R_PHONEUI_DTMF_SPEED_DIAL_NUMBER_QUERY;
+            break;
+
+        case EPhoneDtmfSpeedDialNotAssigned:
+            retVal = R_ERROR_NOTE_SPEED_DIAL_NOT_ASSIGNED;
+            break;
+
+        case EPhoneDtmfInvalidSpeedDial:
+            retVal = R_ERROR_NOTE_INVALID_SPEED_DIAL;
+            break;
+
+        case EPhoneAlsLineChangeConfirmationQuery:
+            retVal = R_PHONEUI_ALS_CONFIRMATION_QUERY;
+            break;
+
+        case EPhoneAlsLineBlockingNoteText:
+            retVal = R_PHONEUI_LINE_BLOCKING_NOTE_TEXT;
+            break;
+
+        case EPhoneIncomingLine2Text:
+            retVal = R_PHONEUI_MTCAL_INCOMING_LINE2;
+            break;
+
+        case EPhoneIncomingLine2WaitingText:
+            retVal = R_PHONEUI_MTCAL_WAITING_NUMBER_LINE2;
+            break;
+
+        case EPhoneIncomingLine2CallingText:
+            retVal = R_PHONEUI_MTCAL_ARRIVING_NUMBER_LINE2;
+            break;
+
+        case EPhoneCallWaitingLabel:
+            retVal = R_PHONEUI_MULTC_WAITING;
+            break;
+
+        case EPhoneCallWaitingWithoutLabel:
+            retVal = R_PHONEUI_MULTC_INFO_WAIT_WITHOUT;
+            break;
+
+        case EPhoneCallWaitingWithLabel:
+            retVal = R_PHONEUI_MULTC_INFO_WAIT_WITH;
+            break;
+
+        case EPhoneGprsConnInProgress:
+            retVal = R_PHONEUI_GPRS_CONN_IN_PROGRESS;
+            break;
+
+        case EPhoneCallWaitingLabelShort:
+            retVal = R_PHONEUI_MULTC_WAITING_SHORT;
+            break;
+
+        case EPhoneNewCallPhoneNumberEditor:
+            retVal = R_PHONEUI_NEW_CALL_PHONE_NUMBER_EDITOR;
+            break;
+
+        case EPhoneNewCallFetchTitle:
+            retVal = R_PHONEUI_TITLE_IN_NEW_CALL_FETCH;
+            break;
+
+        case EPhoneDisconnectingNetworkNote:
+            retVal = R_PHONE_DISCONNECTING_NETWORK_WAIT_NOTE;
+            break;
+
+        case EPhoneInCallMutedText:
+            retVal = R_PHONE_INCALL_MUTED_PANE;
+            break;
+
+        case EPhoneInCallNumberText:
+            retVal = R_PHONEUI_INCALL_CALL_NUMBER;
+            break;
+
+        case EPhoneInCallDisconnected:
+            retVal = R_PHONEUI_INCALL_CALL_DISCONNECTED;
+            break;
+
+        case EPhoneCallInProgress:
+            retVal = R_PHONE_ERROR_CALL_IN_PROGRESS;
+            break;
+
+        case EPhoneConferenceDropParticipantDialog:
+            retVal = R_CONFERENCE_DROPPARTICIPANT_DIALOG;
+            break;
+
+        case EPhoneConferencePrivateDialog:
+            retVal = R_CONFERENCE_PRIVATE_DIALOG;
+            break;
+
+        case EPhoneInformationNote:
+            retVal = R_PHONE_INFORMATION_NOTE;
+            break;
+
+        case EPhoneInformationWaitNote:
+            retVal = R_PHONE_INFORMATION_NOTE_WITH_WAIT;
+            break;
+
+        case EPhoneInformationErrorNote:
+            retVal = R_PHONE_ERROR_NOTE;
+            break;
+
+        case EPhoneInformationWarningNote:
+            retVal = R_PHONE_WARNING_NOTE;
+            break;
+
+        case EPhoneInformationConfirmationNote:
+            retVal = R_PHONE_CONFIRMATION_NOTE;
+            break;
+
+        case EPhonePhoneImeiString:
+            retVal = R_PHONE_IMEI_STRING;
+            break;
+
+        case EPhoneSecurityInformationNote:
+            retVal = R_PHONE_SECURITY_INFORMATION_NOTE;
+            break;
+        case EPhonePhoneBtDevAddress:
+            retVal = R_PHONE_BT_DEV_ADDRESS;
+            break;
+
+        case EPhoneInformationRemotePutOnHoldNote:
+            retVal = R_INCAL_INFO_HOLD_TEXT;
+            break;
+
+        case EPhoneInformationConnectedNote:
+            retVal = R_INCAL_REMOTE_ACTIVE_TEXT;
+            break;
+
+        case EPhoneInformationRemoteCreateConferenceNote:
+            retVal = R_INCAL_REMOTE_CREATE_CONFERENCE_TEXT;
+            break;
+
+        case EPhoneInformationCallOnHold:
+            retVal = R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT;
+            break;
+
+        case EPhoneInCallTransferred:
+            retVal = R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT;
+            break;
+
+        case EPhoneInformationCallOnHoldCli:
+            retVal = R_INCAL_INFO_HOLD_CLI_TEXT;
+            break;
+
+        case EPhoneInformationConferenceOnHold:
+            retVal = R_INCAL_INFO_CONF_HOLD_TEXT;
+            break;
+
+        case EPhoneInformationCallOnHoldNoCli:
+            retVal = R_INCAL_INFO_HOLD_NOCLI_TEXT;
+            break;
+
+        case EPhoneInformationConferenceActiveted:
+            retVal = R_MULTC_INFO_CONFERENCE_TEXT;
+            break;
+
+        case EPhoneCallOnHold:
+            retVal = R_PHONEUI_INCALL_CALL_HELD;
+            break;
+
+        case EPhoneInformationCallActiveted:
+            retVal = R_MULTC_UNHOLD_DONE_TEXT;
+            break;
+
+        case EPhoneRequestingNote:
+            retVal = R_REQUESTING_WAIT_NOTE;
+            break;
+
+        case EPhoneInformationCallActivetedCli:
+            retVal = R_MULTC_CLI_UNHOLD_DONE_TEXT;
+            break;
+
+        case EPhoneDiverting:
+            retVal = R_NOTETEXT_DIVERTING;
+            break;
+
+        case EPhoneMtCallDiverting:
+            retVal = R_NOTETEXT_DIVERTING_INCOMING_CALL;
+            break;
+
+        case EPhoneActiveBarrings:
+            retVal = R_NOTETEXT_CALL_BARRINGS;
+            break;
+
+        case EPhoneCLIWithheld:
+            retVal = R_PHONEUI_MTCAL_CLI_WITHHELD;
+            break;
+
+        case EPhoneNoteTextCallSummary:
+            retVal = R_PHONEUI_NOTE_TEXT_POST_CALL_SUMMARY;
+            break;
+
+        case EPhoneNoteTextCallDuration:
+            retVal = R_PHONEUI_NOTE_TEXT_POST_CALL_DURATION;
+            break;
+
+        case EPhoneIdleTimeFormat:
+            retVal = R_PHONEUI_IDLE_TIME_FORMAT;
+            break;
+
+        case EPhoneLifeTimeFormat:
+            retVal = R_PHONEUI_LIFE_TIMER_STRING;
+            break;
+
+        case EPhoneNoteTextPEFailedAtStartup:
+            retVal = R_PHONEUI_NOTE_TEXT_PHONE_ENGINE_FAILED_AT_STARTUP;
+            break;
+
+        case EPhoneCLIPayphone:
+            retVal = R_PHONE_MTCAL_CLI_PAYPHONE;
+            break;
+
+        case EPhoneOutgoingCallsBarredWithinCUG:
+            retVal = R_PHONE_ERROR_CALL_BARRED_IN_CUG;
+            break;
+
+        case EPhoneNoCUGSelected:
+            retVal = R_PHONE_ERROR_SELECT_CUG;
+            break;
+
+        case EPhoneUnknownCUGIndex:
+            retVal = R_PHONE_ERROR_CUG_UNKNOWN;
+            break;
+
+        case EPhoneCUGIndexIncompatible:
+            retVal = R_PHONE_ERROR_NOT_POSSIBLE_IN_CUG;
+            break;
+
+        case EPhoneCUGCallsFailure:
+            retVal = R_PHONE_ERROR_CHECK_CUG;
+            break;
+
+        case EPhoneCLIRNotSubscribed:
+            retVal = R_PHONE_ERROR_CHECK_CLIR;
+            break;
+
+        case EPhoneSSNotifCLIRSupprReject:
+            retVal = R_PHONE_SS_NOTIFICATION_CLIR_SUPPR_REJECT_TEXT;
+            break;
+
+        case EPhoneWlanMacAddress:
+            retVal = R_PHONE_WLAN_MAC_STRING;
+            break;
+
+        case EPhoneColpConnected:
+            retVal = R_PHONE_TEXT_COLP_CONNECTED;
+            break;
+
+        case EPhoneBtLoopbackEnabled:
+            retVal = R_PHONE_BT_LOOPBACK_ENABLED_STRING;
+            break;
+
+        case EPhoneBtLoopbackDisabled:
+            retVal = R_PHONE_BT_LOOPBACK_DISABLED_STRING;
+            break;
+
+        case EPhoneLineBlockingNote:
+            retVal = R_PHONE_LINE_BLOCKING_NOTE;
+            break;
+
+        case EPhoneSwitchToVideoQuery:
+            retVal = R_PHONE_INCALL_QUERY_SWITCH_TO_VIDEO;
+            break;
+
+        case EPhoneSwitchToVoiceQuery:
+            retVal = R_PHONE_INCALL_QUERY_SWITCH_TO_VOICE;
+            break;
+
+        case EPhoneInformationNoNetworkSupportForVideoCallNote:
+            retVal =  R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT;
+            break;
+
+        case EPhoneInformationVideoCallNotAllowedDuringRestoreNote:
+            retVal =  R_PHONE_INCALL_INFO_VIDEO_CALL_NOT_ALLOWED_DURING_RESTORE;
+            break;
+
+        case EPhoneSimRejected:
+            retVal = R_PHONEUI_SIM_REJECTED;
+            break;
+
+        case EPhoneSimUnaccepted:
+            retVal = R_PHONEUI_SIM_UNACCEPTED;
+            break;
+
+        case EPhoneSimRemoved:
+            retVal = R_PHONEUI_SIM_REMOVED;
+            break;
+
+        case EPhoneRebootRequired:
+            retVal = R_PHONEUI_REBOOT_REQUIRED;
+            break;
+
+        case EPhoneNoteVideoCallNotPossible:
+            retVal = R_PHONEUI_VIDEO_CALL_NOT_POSSIBLE;
+            break;
+
+        case EPhoneContinueInHandsetConfirmationQuery:
+            retVal = R_PHONEUI_CONTINUE_IN_HANDSET;
+            break;
+
+        case EPhoneContinueInLoudspeakerConfirmationQuery:
+            retVal = R_PHONEUI_CONTINUE_IN_LOUDSPEAKER;
+            break;
+
+        case EPhoneDisconnectingQueryCBA:
+            retVal = R_AVKON_SOFTKEYS_YES_NO;
+            break;
+
+        case EPhoneAlertingVideoCallMenubar:
+            retVal = R_PHONEUI_ALERTINGVIDEOCALL_MENUBAR;
+            break;
+
+        case EPhoneCallHandlingIncomingSliderCBA:
+            retVal = R_PHONEUI_CALLCOMING_SOFTKEYS_WHEN_SLIDER;
+            break;
+
+        case EPhoneCallHandlingIncomingSilentSliderCBA:
+            retVal = R_PHONEUI_CALLCOMING_SOFTKEYS_WHEN_SILENT_SLIDER;
+            break;
+
+        case EPhoneCallHandlingIncomingSoftRejectSliderCBA:
+            retVal = R_PHONEUI_SOFTKEYS_OPTIONS_SOFTREJECT_SLIDER;
+            break;
+
+        case EPhoneCallHandlingIncomingSwivelClosedCBA:
+            retVal = R_PHONEUI_CALLCOMING_SWIVEL_CLOSED_CBA;
+            break;
+
+        case EPhoneCallHandlingIncomingSilentSwivelClosedCBA:
+            retVal = R_PHONEUI_CALLCOMING_SILENT_SWIVEL_CLOSED_CBA;
+            break;
+
+        case EPhoneCallHandlingWaitingAnswerSwivelClosedCBA:
+            retVal = R_PHONEUI_WAITING_ANSWER_SWIVEL_CLOSED_CBA;
+            break;
+
+        case EPhoneCallHandlingWaitingReplaceSwivelClosedCBA:
+            retVal = R_PHONEUI_WAITING_REPLACE_SWIVEL_CLOSED_CBA;
+            break;
+
+        case EPhoneNoteVideoCallSetupFailed:
+            retVal = R_PHONE_INCALL_INFO_VIDEO_CALL_SETUP_FAILED;
+            break;
+
+        case EPhoneNoteNoService:
+            retVal = R_PHONE_ERROR_NO_SERVICE;
+            break;
+
+        case EPhoneIncallButtons:
+            retVal = R_PHONEUI_INCALL_BUTTONS;
+            break;
+
+        case EPhoneTwoSinglesButtons:
+            retVal = R_PHONEUI_TWO_SINGLES_BUTTONS;
+            break;
+
+        case EPhoneConferenceButtons:
+            retVal = R_PHONEUI_CONFERENCE_BUTTONS;
+            break;
+
+        case EPhoneParticipantListButtons:
+            retVal = R_PHONEUI_PARTICIPANT_LIST_BUTTONS;
+            break;
+
+        case EPhoneConferenceAndSingleButtons:
+            retVal = R_PHONEUI_CONFERENCE_AND_SINGLE_BUTTONS;
+            break;
+
+        case EPhoneConferenceAndHeldSingleButtons:
+            retVal = R_PHONEUI_CONFERENCE_AND_HELD_SINGLE_BUTTONS;
+            break;
+
+        case EPhoneEmergencyCallButtons:
+            retVal = R_PHONEUI_EMERGENCY_CALL_BUTTONS;
+            break;
+
+        case EPhoneParticipantListCBA:
+            retVal = R_CONFERENCE_PARTICIPANT_LIST_SOFTKEYS;
+            break;
+
+        case EPhoneAudioBTAButton:
+            retVal = R_PHONEUI_BT_TOGGLE_BUTTON;
+            break;
+
+        case EPhoneAudioDefButton:
+            retVal = R_PHONEUI_IHF_TOGGLE_BUTTON;
+            break;
+
+        case EPhoneIncomingCallButtons:
+            retVal = iTouchButtonConfig.ResourceId( 
+                    EPhoneConfigIncomingCallButtons,
+                    R_PHONEUI_INCOMING_CALL_BUTTONS );
+            break;
+
+        case EPhoneCallSetupButtons:
+            retVal = R_PHONEUI_CALL_SETUP_BUTTONS;
+            break;
+
+        case EPhoneWaitingCallButtons:
+            retVal = R_PHONEUI_WAITING_CALL_BUTTONS;
+            break;
+
+        case EPhoneCallSetupAndSingleButtons:
+            retVal = R_PHONEUI_CALL_SETUP_AND_SINGLE_BUTTONS;
+            break;
+
+        case EPhoneNotePhoneOutOf3GCoverage:
+            retVal = R_NOTE_PHONE_OUT_OF_3G_COVERAGE;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue16:
+            retVal = R_CALL_INFO_CAUSE_VALUE16;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue18:
+            retVal = R_CALL_INFO_CAUSE_VALUE18;
+            break;
+
+        case EPhoneNoteCalledNumberHasBarredIncomingCalls:
+            retVal = R_NOTE_CALLED_NUMBER_HAS_BARRED_INCOMING_CALLS;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue22:
+            retVal = R_CALL_INFO_CAUSE_VALUE22;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue34:
+            retVal = R_CALL_INFO_CAUSE_VALUE34;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue38:
+            retVal = R_CALL_INFO_CAUSE_VALUE38;
+            break;
+
+        case EPhoneNoteVideoCallOnlyPossibleUnder3GCoverage:
+            retVal = R_NOTE_VIDEO_CALL_ONLY_POSSIBLE_UNDER_3G_COVERAGE;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue55:
+            retVal = R_CALL_INFO_CAUSE_VALUE55;
+            break;
+
+        case EPhoneNoteUnableToMakeVideoCallNotSupportedByOtherPhone:
+            retVal = R_NOTE_UNABLE_TO_MAKE_VIDEO_CALL_NOT_SUPPORTED_BY_OTHER_PHONE;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue58:
+            retVal = R_CALL_INFO_CAUSE_VALUE58;
+            break;
+
+        case EPhoneNoteCallInfoCauseValue127:
+            retVal = R_CALL_INFO_CAUSE_VALUE127;
+            break;
+
+        case EPhoneNoteCallInfoNotSupported:
+            retVal = R_CALL_INFO_NOT_SUPPORTED;
+            break;
+
+        case EPhoneNoteCallInfoServiceNotAvailable:
+            retVal = R_CALL_INFO_SERVICE_NOT_AVAILABLE;
+            break;
+
+        case EPhoneDtmfNumberListQuery:
+            retVal = R_PHONE_DTMF_LIST_QUERY;
+            break;
+
+        case EPhoneNoteTTYNoAudioControl:
+            retVal = R_PHONE_TTY_INFO_NO_AUDIO_CONTROL;
+            break;
+
+        case EPhoneAddtoContactsListQuery:
+            retVal = R_DIALER_ADD_TO_CONTACTS_SELECTION_LIST_QUERY;
+            break;
+
+        case EPhoneDtmfDialerCBA:
+            retVal = R_PHONEUI_DTMFDIALER_SOFTKEYS_OPTIONS_CANCEL;
+            break;
+
+        case EPhoneDtmfDialerNumberEntryPromptText:
+            retVal = R_PHONEUI_DIALER_NUMBERENTRY_PROMPT_TEXT;
+            break;
+
+        case EPhoneCall:
+            retVal = R_PHONEUI_MTCAL_CALL;
+            break;
+
+        case EPhoneVideoCallSetupFailedCreateVoiceCallToTheSameContactText:
+            retVal = R_NOTE_INCAL_QUERY_VCALL_FAILED;
+            break;
+
+        case EPhoneInfoClirChange:
+            retVal = R_NOTE_TEXT_CLIR_CHANGE;
+            break;
+
+        case EPhoneInfoCugInUse:
+            retVal = R_NOTE_TEXT_CUG_IN_USE;
+            break;
+
+        case EPhoneCallHandlingEmergencyInCallNoOptions:
+            retVal = R_PHONEUI_CALLHANDLING_EMERGENCY_INCALL_NO_OPTIONS;
+            break;
+
+        case EPhoneIncallHeldButtons:
+            retVal = R_PHONEUI_INCALL_HELD_BUTTONS;
+            break;
+            
+        case EPhoneAttemptingEmergencyText:
+            retVal = R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT;
+            break;
+
+        default:
+            Panic( EPhoneUtilsResourcePhoneappNotFound );
+            break;
+        }
+    return retVal;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonestorage.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Storage of data
+*
+*/
+
+
+#include <eikappui.h>
+#include <eikenv.h>
+#include "cphonestorage.h"
+#include "phonelogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhoneStorage::CPhoneStorage()
+    : iIsScreenLocked( EFalse ),
+    iNeedToEnableKeylock( EFalse )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::CPhoneStorage()");
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPhoneStorage::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::ConstructL()");
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPhoneStorage* CPhoneStorage::NewL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::NewL()");
+    CPhoneStorage* self = 
+        new (ELeave) CPhoneStorage();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPhoneStorage::~CPhoneStorage()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::~CPhoneStorage()");
+    iBlockedKeysScanCode.Reset();
+    iBlockedKeysScanCode.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneStorage::AppendBlockedKeysListL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CPhoneStorage::AppendBlockedKeysListL( TStdScanCode aScanCode )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::AppendBlockedKeysListL()");
+    iBlockedKeysScanCode.AppendL( aScanCode );
+    }
+
+// -----------------------------------------------------------
+// CPhoneStorage::GetBlockedKeyList
+// -----------------------------------------------------------
+//
+EXPORT_C const RArray<TInt>& CPhoneStorage::GetBlockedKeyList() const
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::GetBlockedKeyList()");
+    return iBlockedKeysScanCode;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStorage::ResetBlockedKeysList
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStorage::ResetBlockedKeysList()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::ResetBlockedKeysList()");
+    iBlockedKeysScanCode.Reset();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStorage::IsBlockedKeysListSet
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStorage::IsBlockedKeysListEmpty()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::IsBlockedKeysListSet()");
+    TBool ret = ETrue;
+    if( iBlockedKeysScanCode.Count() )
+        {
+        ret = EFalse;
+        }
+    return ret;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStorage::SetScreenLocked
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStorage::SetScreenLocked( TBool aLocked )
+    {
+    iIsScreenLocked = aLocked;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStorage::IsScreenLocked
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStorage::IsScreenLocked()
+    {
+    return iIsScreenLocked;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStorage::NeedToEnableKeylock
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneStorage::NeedToEnableKeylock()
+    {
+    return iNeedToEnableKeylock;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStorage::NeedToEnableKeylock
+// -----------------------------------------------------------
+//
+EXPORT_C void CPhoneStorage::SetNeedToEnableKeylock( TBool aNeedToEnableKeylock )
+    {
+    iNeedToEnableKeylock = aNeedToEnableKeylock;
+    }
+
+// END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/cphonetimer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   See header.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cphonetimer.h"
+#include "phoneui.pan"
+#include "phonelogger.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPhoneTimer::CPhoneTimer
+// ---------------------------------------------------------
+//
+CPhoneTimer::CPhoneTimer( TInt aPriority ) :
+    CTimer( aPriority)
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::CPhoneTimer() ");
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------
+// CPhoneTimer::ConstructL
+// ---------------------------------------------------------
+//
+void CPhoneTimer::ConstructL()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::ConstructL() ");
+    CTimer::ConstructL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneTimer::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneTimer* CPhoneTimer::NewL( TInt aPriority )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::NewL() ");
+    CPhoneTimer* self = new (ELeave) CPhoneTimer( aPriority );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// CPhoneTimer::~CPhoneTimer
+// ---------------------------------------------------------
+//
+EXPORT_C CPhoneTimer::~CPhoneTimer()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::~CPhoneTimer() ");
+    Cancel();    
+    }
+
+// ---------------------------------------------------------
+// CPhoneTimer::RunL()
+// ---------------------------------------------------------
+//
+void CPhoneTimer::RunL()
+    {
+    __PHONELOG1( EBasic, EPhoneUIUtils, 
+        "CPhoneTimer::RunL iStatus(%d)", 
+        iStatus.Int() );
+    
+    if ( iStatus != KErrNone )
+        {
+        //error code is ignored, as CPeriodic. 
+        return;
+        }
+   
+    if ( !iTimerObserver )
+        {
+        __PHONELOG( EBasic, EPhoneUIUtils, 
+            "CPhoneTimer::RunL CallBack" );
+        iCallBack.CallBack();
+        }
+    else
+        {
+        __PHONELOG( EBasic, EPhoneUIUtils, 
+            "CPhoneTimer::RunL HandleTimeOutL" );
+        iTimerObserver->HandleTimeOutL();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneTimer::After()
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneTimer::After( 
+    TTimeIntervalMicroSeconds32 anInterval, 
+    TCallBack aCallBack )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::After() ");
+    
+    if ( IsActive() )
+        {
+        Cancel();
+        }
+    iTimerObserver = NULL;
+    iCallBack = aCallBack;
+    CTimer::After( anInterval );
+    }
+
+// ---------------------------------------------------------
+// CPhoneTimer::After()
+// ---------------------------------------------------------
+//
+
+EXPORT_C void CPhoneTimer::After( 
+    TTimeIntervalMicroSeconds32 anInterval, 
+    MPhoneTimer* aObserver )
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::After() ");
+    
+    __ASSERT_DEBUG( aObserver, Panic( EPhoneUtilsParameterNotInitialized ) );
+    
+    if ( IsActive() )
+        {
+        Cancel();
+        }
+    iTimerObserver = aObserver;
+    CTimer::After( anInterval );
+    }
+
+// ---------------------------------------------------------
+//  CPhoneTimer::CancelTimer
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneTimer::CancelTimer()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::CancelTimer() ");
+    Cancel();
+    }
+
+// ---------------------------------------------------------
+//  CPhoneTimer::DoCancel
+// ---------------------------------------------------------
+//
+void CPhoneTimer::DoCancel()
+    {
+    __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneTimer::DoCancel() ");
+    iTimerObserver = NULL;
+    CTimer::DoCancel();
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/ctelerecoverysystem.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1063 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Recovery system class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "ctelerecoverysystem.h"
+#include    <e32svr.h>
+#include    <startupdomainpskeys.h>
+
+#include    "phonelogger.h"
+#include    "phoneui.pan"
+#include    "cphonetimer.h"
+#include    "ctelewaitingidle.h"
+
+
+// CONSTANTS
+const TInt KPhoneRecoveryItemsArrayGranularity = 8;
+const TInt KPhoneRecoveryTickInterval = 50000; // 0.05 second
+const TInt KPhoneRecoveryTicksForCritical = 2;
+const TInt KPhoneRecoveryTicksForHigh = 3; 
+const TInt KPhoneRecoveryTicksForStandard = 5;
+const TInt KPhoneRecoveryTicksForLow = 23;
+const TInt KPhoneRecoveryTicksForDontCare = 37;
+const TInt KPhoneRecoveryTicksMaximum = 2048; //maximum about 1.5 minutes
+const TInt KPhoneRecoveryDontStartTimer = 10000;
+const TInt KPhoneRecoveryCounterStart = 0;
+const TInt KPhoneRecoveryCounterPause = -1;
+const TInt KPhoneRecoveryMainTimerPriority = CActive::EPriorityLow;
+const TInt KPhoneRecoveryAllStepsTimerPriority = CActive::EPriorityLow + 1;
+
+// Priority of active object; set it quite high.
+const TInt KTelePubSubPriority = CActive::EPriorityUserInput;
+
+// Flags for all priorities.
+enum 
+    {
+    EPhoneFlagCritical = 1,
+    EPhoneFlagHigh     = 2,
+    EPhoneFlagStandard = 4,
+    EPhoneFlagLow      = 8,
+    EPhoneFlagDontCare = 16
+    };
+    
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::CTeleRecoverySystem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CTeleRecoverySystem::CTeleRecoverySystem() 
+    : CActive( KTelePubSubPriority )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::ConstructL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::ConstructL ()" ); 
+    iRequest = EPhoneNone;
+    
+    // Construct Recovery items array.
+    iRecoveryItems = new ( ELeave ) CArrayFixFlat< TRecoveryItem >( 
+        KPhoneRecoveryItemsArrayGranularity );
+
+    // Construct CPhoneTimer.
+    iTimer = CPhoneTimer::NewL( KPhoneRecoveryMainTimerPriority );    
+
+    // Construct timer for recovery all steps.
+    iAllStepsTimer = CPhoneTimer::NewL( KPhoneRecoveryAllStepsTimerPriority );
+    
+    iWaitingIdle = CTeleWaitingIdle::NewL( CActive::EPriorityLow, *this );
+    iWaitingIdle->StartWaitingIdleL();
+    
+    __PHONELOG( 
+        EBasic, 
+        EPhoneUIUtils, 
+        "CTeleRecoverySystem::ConstructL: timers" );
+
+    User::LeaveIfError( 
+        iSimStatusProperty.Attach( 
+            KPSUidStartup, 
+            KPSSimStatus ) );
+
+    __PHONELOG( 
+        EBasic, 
+        EPhoneUIUtils, 
+        "CTeleRecoverySystem::ConstructL: attach2" );
+
+    // Check current SIM status.
+    User::LeaveIfError( CheckSIMAvailable() );
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CTeleRecoverySystem* CTeleRecoverySystem::NewL()
+    {
+    CTeleRecoverySystem* self = new( ELeave ) CTeleRecoverySystem;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// Destructor
+CTeleRecoverySystem::~CTeleRecoverySystem()
+    {
+    // Stop listening for SIM changes.
+    Cancel();    
+
+    iSimStatusProperty.Close();
+    iSimPresentProperty.Close();
+
+    if ( iWaitingIdle )
+        {
+        delete iWaitingIdle;
+        iWaitingIdle = NULL;  
+        }
+        
+    delete iRecoveryItems;
+    delete iTimer;
+    delete iAllStepsTimer;
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::AddL
+// -----------------------------------------------------------------------------
+//
+TPhoneRecoveryId CTeleRecoverySystem::AddL( TCallBack aCallBack, 
+    TPhoneRecoveryPriority aPriority, TRecoveryState aState )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::AddL()" ); 
+    __ASSERT_DEBUG( !iIsCallBack, Panic( EPhoneUtilsNoCallBack ) );   
+
+    CheckStateForPrecondition( aState );
+
+    iIdCounter++;
+    TInt count = iRecoveryItems->Count();
+    TInt i = 0;
+    for ( ; i < count; i++ )
+        {
+        if ( iRecoveryItems->At( i ).iPriority <= aPriority )
+            {
+            break;
+            }
+        }
+    TRecoveryItem item;
+    item.iCallBack = aCallBack;
+    item.iId = iIdCounter;
+    item.iPriority = aPriority;
+    item.iState = aState;
+    
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIUtils, 
+        "CTeleRecoverySystem::AddL itemIdx= %d:", i );
+
+    iRecoveryItems->InsertL( i, item );
+
+    StartTimerIfRequired( aState );
+    return iIdCounter;
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::Add
+// -----------------------------------------------------------------------------
+//
+TPhoneRecoveryId CTeleRecoverySystem::Add( TCallBack aCallBack, 
+    TPhoneRecoveryPriority aPriority, TRecoveryState aState )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::AddL()" ); 
+    TPhoneRecoveryId id = KNullId;
+    TRAP_IGNORE( id = AddL( aCallBack, aPriority, aState ) );
+    return id;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::Remove
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::Remove( TPhoneRecoveryId aId )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::Remove()" ); 
+    __ASSERT_DEBUG( !iIsCallBack, Panic( EPhoneUtilsNoCallBack ) ); 
+
+    TInt count = iRecoveryItems->Count();
+    
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIUtils, 
+        "CTeleRecoverySystem::count = %d:", count );
+        
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if( iRecoveryItems->At( i ).iId == aId )
+            {
+            iRecoveryItems->Delete( i );
+            __PHONELOG1( 
+                EBasic, 
+                EPhoneUIUtils, 
+                "CTeleRecoverySystem::Delete itemIdx= %d:", i );
+            return;
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::SetState
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::SetState( 
+    TPhoneRecoveryId aId, TRecoveryState aState )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::SetState()" );
+    CheckStateForPrecondition( aState );
+    
+    TInt count = iRecoveryItems->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TRecoveryItem& item = iRecoveryItems->At( i );
+        if( item.iId == aId )
+            {
+            item.iState = aState;
+            StartTimerIfRequired( aState ); 
+            __PHONELOG1( 
+                EBasic, 
+                EPhoneUIUtils, 
+                "CTeleRecoverySystem::SetState itemIdx= %d:", item.iId );      
+            return;
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::ResetPending
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::ResetPending()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::ResetPending()" );
+    TBool startTimer = EFalse;
+    TInt count = iRecoveryItems->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TRecoveryItem& item = iRecoveryItems->At( i );
+        if( item.iState == EPhoneStatePending )
+            {
+            item.iState = EPhoneStateWaiting;
+            startTimer = ETrue;
+            }
+        }
+
+    if ( startTimer )
+        {
+        StartTimer();
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::RecoverNow
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::RecoverNow( TPhoneRecoveryId aId,
+    TPhoneRecoveryPriority aPriority, TBool aAllSteps )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::RecoverNow()" );
+    TInt err = KErrNone;
+    TInt pos = Find( aId );
+
+    if ( pos != KErrNotFound )
+        {
+        TRecoveryItem& item = iRecoveryItems->At( pos );
+        item.iPriority = aPriority;
+        err = DoItemCallBack( item );
+        if ( item.iState == EPhoneStateWaiting )
+            {
+            if ( aAllSteps )
+                {
+                item.iState = EPhoneStateStarting;
+                }
+                
+            StartTimerIfRequired( item.iState );
+            }
+        }
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIUtils, 
+        "CTeleRecoverySystem::RecoverNow error = %d:", err );   
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::RecoverAllNow
+//
+// -----------------------------------------------------------------------------
+//   
+void CTeleRecoverySystem::RecoverAllNow()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::RecoverAllNow()" );
+    StartTimerIfIdle();
+    StartAllStepsTimer();
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::EnablePrecondition
+//
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::EnablePrecondition()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::EnablePrecondition()" );
+    // If precondition has already been satisfied, then
+    // there should not be anything left to do.
+    if ( iPrecondOk )
+        {
+        return;
+        }
+
+    // Store flag to indicate that precondition has been
+    // satisfied.
+    iPrecondOk = ETrue;
+
+    // Go through all recovery items and update state so that
+    // there won't be any items in EPhoneStatePrecond after the loop.
+    // Timer must be started.
+    TInt count = iRecoveryItems->Count();
+
+    for ( TInt index = 0; index < count; index++ )
+        {
+        TRecoveryItem& item = iRecoveryItems->At( index );
+
+        CheckStateForPrecondition( item.iState );
+        }
+
+    if ( IsIdle() )
+        {
+        iTimer->Cancel();
+        StartTimer();       
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::Resume
+// 
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::Resume()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::Resume()" );
+    if ( iTickCounter == KPhoneRecoveryCounterPause )
+        {
+        StartTimer();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::RunL
+// 
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::RunL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::RunL()" );
+    if ( iStatus != KErrNone )
+        {
+        // If SIM is already available, just listen for SIM status.
+        if ( iSimAvailable == ESimUsable )
+            {            
+            iRequest = EPhoneSIMStatus;
+            }
+        else
+            {
+            iRequest = EPhoneSIMPresent;
+            }
+
+        __PHONELOG1( 
+            EBasic, 
+            EPhoneUIUtils, 
+            "CTeleRecoverySystem::RunL NewRq = %d ", (TInt) iRequest ); 
+
+        IssueRequest();
+        return;
+        }
+        
+    // If SIM present availability is still scrutinized, check status.
+    if ( iRequest == EPhoneSIMPresent )
+        {
+        if ( iSimPresentProperty.Handle() )
+            {            
+            iSimPresentProperty.Get( iSimAvailable );
+            }            
+
+        if ( iSimAvailable == ESimUsable )
+            {
+            iRequest = EPhoneSIMStatus;
+            
+            __PHONELOG1( 
+                EBasic, 
+                EPhoneUIUtils, 
+                "CTeleRecoverySystem::RunL NewRq = %d ", (TInt) iRequest ); 
+            }
+        else
+            {
+            // SIM is not yet available, start listening again.
+            IssueRequest();
+            return;
+            }
+        }
+
+    // If SIM is available and SIM status is ok and precondition has not been
+    // set, set precondition.
+    if ( IsSIMOk() && !iPrecondSimOk )
+        {
+        EnablePrecondSimOk();
+        }
+    
+    // Start listening again.
+    IssueRequest();
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::DoCancel
+// 
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::DoCancel()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::DoCancel()");
+
+    if ( iSimStatusProperty.Handle() )
+        {        
+        iSimStatusProperty.Cancel();
+        }
+
+    if ( iSimPresentProperty.Handle() )
+        {        
+        iSimPresentProperty.Cancel();
+        }                
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::EnablePrecondSimOk
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::EnablePrecondSimOk()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::EnablePreSIM()");
+    
+    if ( iPrecondSimOk )
+        {
+        return;
+        }
+    iPrecondSimOk = ETrue;
+
+    // Go through all recovery items and update state so that
+    // there won't be any items in EPhoneStatePrecondSim after the loop.
+    // Timer must be started.
+    TInt count = iRecoveryItems->Count();
+
+    for ( TInt index = 0; index < count; index++ )
+        {
+        TRecoveryItem& item = iRecoveryItems->At( index );
+
+        CheckStateForPrecondition( item.iState );
+        }
+
+    iTimer->Cancel();
+    StartTimer();
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::DoItemCallBack
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::DoItemCallBack( TRecoveryItem& aItem )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::DoItemCallBack()");
+    
+#ifdef _DEBUG
+    iIsCallBack = ETrue;
+#endif // _DEBUG
+
+    TInt err = KErrNone;    
+    TRAPD( leaveErr, err = aItem.iCallBack.CallBack() );
+
+    __PHONELOG1( 
+        EBasic, 
+        EPhoneUIUtils, 
+        "CTeleRecoverySystem::DoItemCallBack Err = %d ", leaveErr );
+    
+#ifdef _DEBUG
+    iIsCallBack = EFalse;
+#endif // _DEBUG
+
+    if( leaveErr != KErrNone )
+        {
+        err = leaveErr;
+        }
+
+    if ( err > KErrNone )
+        {
+        aItem.iState = EPhoneStateWaiting;
+        err = KErrNone;
+        }
+    else
+        {
+        switch ( err )
+            {
+            case KErrNone:
+                aItem.iState = EPhoneStateIdle;
+                break;
+            case KErrNoMemory:
+            case KErrInUse:
+            case KErrServerBusy:
+            case KErrNotReady:
+            case KErrLocked:
+            case KErrTimedOut:
+            case KErrDied:
+            case KErrServerTerminated:
+                aItem.iState = EPhoneStateWaiting;
+                break;
+            default:
+                aItem.iState = EPhoneStatePending;
+                break;
+            }
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::HandleTimer
+//
+// Callback function.
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::HandleTimer( TAny* aAny )
+    {
+    return static_cast< CTeleRecoverySystem* >( aAny )->DoHandleTimer();
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::DoHandleTimer
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::DoHandleTimer()
+    {
+    // It will be sum of flags in which there are items in priority.
+    TInt found = 0;
+
+    // It contains flags which will be run at the current time.
+    const TInt run = DetermineRun();
+    
+    // Go through all items and for each item:
+    //  If item is in waiting state,
+    //      update variable found and
+    //      update priority and
+    //      perform action if required.
+
+    const TInt count = iRecoveryItems->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TRecoveryItem& item = iRecoveryItems->At( i );
+        if( item.iState == EPhoneStateWaiting )
+            {
+            TBool doCallBack = EFalse;
+
+            if ( item.iPriority >= EPhonePriorityCritical )
+                {
+                found |= EPhoneFlagCritical;
+                doCallBack = ( run & EPhoneFlagCritical );
+                }
+            else if ( item.iPriority > EPhonePriorityHigh )
+                {
+                // For priority Critical.
+                item.iPriority--;
+                found |= EPhoneFlagHigh;
+                doCallBack = ( run & EPhoneFlagHigh );
+                }
+            else if ( item.iPriority > EPhonePriorityStandard )
+                {
+                // For priority High.
+                item.iPriority--;
+                found |= EPhoneFlagStandard;
+                doCallBack = ( run & EPhoneFlagHigh );
+                }
+            else if ( item.iPriority > EPhonePriorityLow )
+                {
+                // For priority Standard.
+                item.iPriority--;
+                found |= EPhoneFlagLow;
+                doCallBack = ( run & EPhoneFlagStandard );
+                }
+            else if ( item.iPriority > EPhonePriorityDontCare )
+                {
+                // For priority Low.
+                item.iPriority--;
+                found |= EPhoneFlagDontCare;
+                doCallBack = ( run & EPhoneFlagLow );
+                }
+            else 
+                {
+                // For priority DontCare.
+                found |= EPhoneFlagDontCare;
+                doCallBack = ( run & EPhoneFlagDontCare );
+                }
+
+            if ( doCallBack )
+                {
+                DoItemCallBack( item );
+                }
+            }
+        }
+
+    // Start timer for the next time.
+    StartNext( found );       
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::HandleAllStepsTimer
+//
+// Callback function.
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::HandleAllStepsTimer( TAny* aAny )
+    {
+    return 
+        static_cast< CTeleRecoverySystem* >( aAny )->DoHandleAllStepsTimer();
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::DoHandleAllStepsTimer
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::DoHandleAllStepsTimer()
+    {
+    TInt count = iRecoveryItems->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TRecoveryItem& item = iRecoveryItems->At( i );
+        if( item.iState == EPhoneStateStarting )
+            {
+            // Perform recovery step.
+            //
+            TInt err = DoItemCallBack( item );
+
+            if ( item.iState == EPhoneStateWaiting )
+                {
+                // If step went ok, then we can perform next step soon.
+                // If step didn't succeed, then there is no point to 
+                // start again immediately.
+                if ( err == KErrNone )
+                    {
+                    item.iState = EPhoneStateStarting;
+                    }
+                
+                // And start timer.
+                StartTimerIfRequired( item.iState );
+                }
+            }
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::CheckStateForPrecondition
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::CheckStateForPrecondition( TRecoveryState& aState )
+    {
+    if ( iPrecondOk && aState == EPhoneStatePrecond )
+        {
+        aState = EPhoneStateWaiting;
+        }
+
+    if ( iPrecondSimOk && aState == EPhoneStatePrecondSim )
+        {
+        aState = EPhoneStateWaiting;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::StartTimerIfRequired
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::StartTimerIfRequired( TRecoveryState aNewState )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::StartTimerIfRequired()");
+    
+    if ( IsIdle() )
+        {
+        if ( aNewState == EPhoneStateWaiting )
+            {
+            StartTimerIfIdle();
+            }
+        else if ( aNewState == EPhoneStateStarting )
+            {
+            StartAllStepsTimer();
+            }       
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::IsIdle()
+// -----------------------------------------------------------------------------
+//    
+TBool CTeleRecoverySystem::IsIdle()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::IsIdle()");
+    TBool retVal(EFalse);
+    TInt error(0);
+    TInt state(0);
+    
+    error = iIdleActive.Get(
+        KPSUidStartup, 
+        KPSIdlePhase1Ok, 
+        state );
+    
+    if ( ( state == EIdlePhase1Ok ) &&
+        ( error == KErrNone ) )
+        {
+        if ( iWaitingIdle )
+            {
+            delete iWaitingIdle;
+            iWaitingIdle = NULL;  
+            }
+        retVal = ETrue;
+        }
+
+    return retVal;      
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::StartTimerIfIdle
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::StartTimerIfIdle()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::StartTimerIfIdle()");
+
+    if ( !iTimer->IsActive() )
+        {
+        iTimer->After( KPhoneRecoveryTickInterval,
+            TCallBack( HandleTimer, this ) );
+        iTickCounter++;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::StartTimer
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::StartTimer()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::StartTimer()");
+   
+    if ( !iTimer->IsActive() )
+        {
+        iTickCounter = KPhoneRecoveryCounterStart;
+        iTimer->After( KPhoneRecoveryTickInterval, 
+            TCallBack( HandleTimer, this ) );
+        }       
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::StartAllStepsTimer
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::StartAllStepsTimer()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::StartAllStepsTimer()");
+    if ( !iAllStepsTimer->IsActive() )
+        {
+        iAllStepsTimer->After( 1, TCallBack( HandleAllStepsTimer, this ) );
+        }
+  }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::StartNext
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::StartNext( TInt aFound )
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::StartNext()");
+    // Calculate time of next attempt.
+    
+    // This is performed as follows:
+    //  For each priority:
+    //      If there was item in waiting state, 
+    //      then calculate next attempt time for that.
+    //  Use the minimum attempt time to determine next attempt.
+    
+    TInt nextTick = KPhoneRecoveryDontStartTimer; 
+    if ( aFound & EPhoneFlagCritical )
+        {
+        nextTick = Min( nextTick, NextTick( KPhoneRecoveryTicksForCritical ) );
+        }
+    if ( aFound & EPhoneFlagHigh )
+        {
+        nextTick = Min( nextTick, NextTick( KPhoneRecoveryTicksForHigh ) );
+        }
+    if ( aFound & EPhoneFlagStandard )
+        {
+        nextTick = Min( nextTick, NextTick( KPhoneRecoveryTicksForStandard ) );
+        }
+    if ( aFound & EPhoneFlagLow )
+        {
+        nextTick = Min( nextTick, NextTick( KPhoneRecoveryTicksForLow ) );
+        }
+    if ( aFound & EPhoneFlagDontCare )
+        {
+        nextTick = Min( nextTick, NextTick( KPhoneRecoveryTicksForDontCare ) );
+        }
+    
+    if( nextTick < KPhoneRecoveryDontStartTimer )
+        {
+        if ( nextTick <= KPhoneRecoveryTicksMaximum )
+            {
+            iTimer->After( KPhoneRecoveryTickInterval*( nextTick-iTickCounter ), 
+                TCallBack( HandleTimer, this ) );
+            iTickCounter = nextTick;
+            }
+        else 
+            {
+            //pause the recover to save memory
+            iTickCounter = KPhoneRecoveryCounterPause;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::DetermineRun
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::DetermineRun() const
+    {
+    TInt run = 0;
+
+    // Check if critical tasks ought to be run.
+    if ( !( iTickCounter % KPhoneRecoveryTicksForCritical ) )
+        {
+        run |= EPhoneFlagCritical;
+        }
+    
+    // Check if high tasks ought to be run.
+    if ( !( iTickCounter % KPhoneRecoveryTicksForHigh ) )
+        {
+        run |= EPhoneFlagHigh;
+        }
+    
+    // Check if standard tasks ought to be run.
+    if ( !( iTickCounter % KPhoneRecoveryTicksForStandard ) )
+        {
+        run |= EPhoneFlagStandard;
+        }
+    
+    // Check if low tasks ought to be run.
+    if ( !( iTickCounter % KPhoneRecoveryTicksForLow ) )
+        {
+        run |= EPhoneFlagLow;
+        }
+    
+    // Check if 'dont care' tasks ought to be run.
+    if ( !( iTickCounter % KPhoneRecoveryTicksForDontCare ) )
+        {
+        run |= EPhoneFlagDontCare;
+        }
+
+    if ( !run )
+        {
+        run |= EPhoneFlagCritical;
+        }
+
+    return run;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::NextTick
+// -----------------------------------------------------------------------------
+//
+inline TInt CTeleRecoverySystem::NextTick( TInt aTicks ) const
+    {
+    // Find smallest such value k that satisfies the following conditions:
+    //  1. It must be larger than iTickCounter
+    //  2. It must be multiple of aTicks.
+
+    return ( iTickCounter / aTicks + 1 ) * aTicks; 
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::Find
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::Find( TPhoneRecoveryId aId ) const
+    {
+    const TInt count = iRecoveryItems->Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        const TRecoveryItem& item = iRecoveryItems->At( i );
+        if ( item.iId == aId )
+            {
+            return i;
+            }
+        }
+
+    return KErrNotFound;
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::IssueRequest
+// 
+// -----------------------------------------------------------------------------
+//
+void CTeleRecoverySystem::IssueRequest()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::IssueRequest()");
+    if ( !IsActive() )
+        {
+        if ( iRequest == EPhoneSIMPresent )
+            {                        
+            iSimPresentProperty.Subscribe( iStatus );
+
+            __PHONELOG( 
+                EBasic, 
+                EPhoneUIUtils, 
+                "CTeleRecoverySystem::DoItemCallBack IssueReq.2");
+            }
+        else
+            {
+            __PHONELOG( 
+                EBasic, 
+                EPhoneUIUtils, 
+                "CTeleRecoverySystem::DoItemCallBack IssueReq.3");
+                
+            __ASSERT_DEBUG( iRequest == EPhoneSIMStatus, Panic( EPhoneUtilsNoCallBack ) );
+
+            iSimStatusProperty.Subscribe( iStatus );
+            }
+
+        SetActive();
+        }
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::IsSIMOk
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CTeleRecoverySystem::IsSIMOk()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::IsSIMOk()");
+    
+    TInt value = KErrNotFound;
+    TBool simOk = EFalse;
+
+    if ( iSimAvailable != ESimUsable )
+        {
+        __PHONELOG( 
+                EBasic, 
+                EPhoneUIUtils, 
+                "CTeleRecoverySystem::IsSIMOk Ret 0");
+        // SIM is not yet available.
+        return EFalse;
+        }
+
+    // Get current status.
+    if ( iSimStatusProperty.Handle() )
+        {        
+        iSimStatusProperty.Get( value );
+        }
+        
+    simOk = ( value == ESimUsable ); 
+
+    __PHONELOG1( 
+            EBasic, 
+            EPhoneUIUtils, 
+            "CTeleRecoverySystem::IsSIMOk Ret: %d ",  (TInt) simOk);
+    
+    return simOk;
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleRecoverySystem::CheckSIMAvailable
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CTeleRecoverySystem::CheckSIMAvailable()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIUtils, "CTeleRecoverySystem::CheckSIMAvailable()");
+
+    // Check current SIM present state.
+    if ( iSimStatusProperty.Handle() )
+        {
+        iSimStatusProperty.Get( iSimAvailable );
+
+        __PHONELOG1( 
+                EBasic, 
+                EPhoneUIUtils, 
+                "CTeleRecoverySystem::CheckSIMAvailable %d ",  iSimAvailable );
+
+        if ( iSimAvailable != ESimUsable )
+
+            {
+            // Since SIM is not yet present, wait for availability.
+            iRequest = EPhoneSIMStatus;
+            }
+        else
+            {
+            // SIM is now available, start listening for SIM status.
+            iRequest = EPhoneSIMStatus;
+
+            __PHONELOG1( 
+                    EBasic, 
+                    EPhoneUIUtils, 
+                    "CTeleRecoverySystem::CheckSIMAvailable new rq %d ",  (TInt) iRequest );
+
+            
+            if ( iSimStatusProperty.Handle() )
+                {        
+                TInt value = ESimStatusUninitialized;
+                iSimStatusProperty.Get( value );
+                iPrecondSimOk = ( value == ESimUsable );
+                }
+            else
+                {
+                return KErrBadHandle;
+                }            
+            }      
+        IssueRequest();
+        }
+    else
+        {
+        return KErrBadHandle;
+        }    
+    return KErrNone;
+    }
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/ctelewaitingidle.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Utility class for waiting idle.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "ctelewaitingidle.h"
+#include    "cphonerecoverysystem.h"
+#include    "phonelogger.h"
+#include    <startupdomainpskeys.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CTeleWaitingIdle::CTeleWaitingIdle
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CTeleWaitingIdle::CTeleWaitingIdle( 
+                        TInt aPriority, 
+                        CTeleRecoverySystem& aRecoverySystem ) : 
+                        CActive( aPriority), 
+                        iRecoverySystem( aRecoverySystem )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleWaitingIdle::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CTeleWaitingIdle* CTeleWaitingIdle::NewL( TInt aPriority, 
+                                    CTeleRecoverySystem& aRecoverySystem )
+    {
+    CTeleWaitingIdle* self = new( ELeave ) CTeleWaitingIdle( 
+                                aPriority, aRecoverySystem );
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CTeleWaitingIdle::~CTeleWaitingIdle()
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+CTeleWaitingIdle::~CTeleWaitingIdle()
+    {
+    Cancel();
+        
+    if ( iProperty.Handle() )
+        {
+        iProperty.Close();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleWaitingIdle::DoCancel
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CTeleWaitingIdle::DoCancel()
+    {        
+    if ( iProperty.Handle() )
+        {
+        iProperty.Cancel();
+        }
+    }    
+
+// -----------------------------------------------------------------------------
+// CTeleWaitingIdle::RunL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CTeleWaitingIdle::RunL()
+    {
+//    Phone_PRINT("WI.RunL >");
+    if ( iStatus != KErrNone )
+        {
+        //error code is ignored, as CPeriodic. 
+        return;
+        }
+    StartWaitingIdleL();
+    }
+
+// -----------------------------------------------------------------------------
+// CTeleWaitingIdle::StartWaitingIdle
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CTeleWaitingIdle::StartWaitingIdleL()
+    {
+//    Phone_PRINT("WI.StartWaitingIdle >");
+    TInt state(0);
+
+    User::LeaveIfError( 
+        iProperty.Get( 
+        KPSUidStartup, 
+        KPSIdlePhase1Ok, 
+        state ) );
+        
+//    Phone_PRINTF("CTeleWaitingIdle::After - state = %d >",state);  
+    if ( IsActive() )
+        {
+        Cancel();
+        }
+        
+    if ( state == EIdlePhase1Ok )
+        {
+//        Phone_PRINT("WI.StartWaitingIdle - RecoverAllNow");
+        iRecoverySystem.RecoverAllNow();
+        }
+    else
+        {
+        User::LeaveIfError( 
+            iProperty.Attach( 
+            KPSUidStartup, 
+            KPSIdlePhase1Ok ) );
+                
+        if ( !IsActive() )
+            {        
+            iProperty.Subscribe( iStatus );
+            SetActive();
+            }       
+        }
+    }
+    
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/generate.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,25 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: Generate string tables and move headers.
+rem
+
+perl %EPOCROOT%epoc32\tools\stringtable.pl phoneloggerviewcommands.st
+perl %EPOCROOT%epoc32\tools\stringtable.pl phonestatestrings.st
+perl %EPOCROOT%epoc32\tools\stringtable.pl phonestatestringsgsm.st
+
+perl ..\..\phoneui\internal\tools\add_copyright.pl
+
+move /Y phoneloggerviewcommands.h  ..\inc\phoneloggerviewcommands.h
+move /Y phonestatestrings.h ..\inc\phonestatestrings.h 
+move /Y phonestatestringsgsm.h ..\inc\phonestatestringsgsm.h 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/phoneloggerviewcommands.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,421 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Macro definition file for logging.
+*
+*/
+
+// Autogenerated from phoneloggerviewcommands.st by the stringtable tool - Do not edit
+#include <e32std.h>
+#include <stringpool.h>
+#include <stringtablesupport.h>
+#include "phoneloggerviewcommands.h"
+#ifdef _DEBUG
+#undef _DEBUG
+#endif
+
+_STLIT8(K1, "EPhoneViewStartValue");
+_STLIT8(K2, "EPhoneViewCreateNumberEntry");
+_STLIT8(K3, "EPhoneViewSetNumberEntryContent");
+_STLIT8(K4, "EPhoneViewSendKeyEventToNumberEntry");
+_STLIT8(K5, "EPhoneViewRemoveNumberEntry");
+_STLIT8(K6, "EPhoneViewSetNumberEntryVisible");
+_STLIT8(K7, "EPhoneViewGetNumberFromEntry");
+_STLIT8(K8, "EPhoneViewGetNumberEntryCount");
+_STLIT8(K9, "EPhoneViewGetNumberEntryIsUsedStatus");
+_STLIT8(K10, "EPhoneViewGetNumberEntryIsVisibleStatus");
+_STLIT8(K11, "EPhoneViewToggleNumberEntryAlphaNumericMode");
+_STLIT8(K12, "EPhoneViewIsNumberEntryNumericMode");
+_STLIT8(K13, "EPhoneViewClearNumberEntryContent");
+_STLIT8(K14, "EPhoneViewCreateCallHeader");
+_STLIT8(K15, "EPhoneViewCreateEmergencyCallHeader");
+_STLIT8(K16, "EPhoneViewUpdateCallHeaderRemoteInfoData");
+_STLIT8(K17, "EPhoneViewUpdateCallHeaderCallDuration");
+_STLIT8(K18, "EPhoneViewRemoveCallHeader");
+_STLIT8(K19, "EPhoneViewMenuBarOpen");
+_STLIT8(K20, "EPhoneViewMenuBarClose");
+_STLIT8(K21, "EPhoneViewDimCbaCommand");
+_STLIT8(K22, "EPhoneViewUpdateCba");
+_STLIT8(K23, "EPhoneViewUpdateBubble");
+_STLIT8(K24, "EPhoneViewMenuPane");
+_STLIT8(K25, "EPhoneViewMenuBar");
+_STLIT8(K26, "EPhoneViewSetTitlePaneContent");
+_STLIT8(K27, "EPhoneViewSetNaviPaneContent");
+_STLIT8(K28, "EPhoneViewSetTitlePanePicture");
+_STLIT8(K29, "EPhoneViewGetTitlePaneIsVisibleStatus");
+_STLIT8(K30, "EPhoneViewActivateAudioPathUIChanges");
+_STLIT8(K31, "EPhoneViewActivateAudioAvailabilityUIChanges");
+_STLIT8(K32, "EPhoneViewActivateMuteUIChanges");
+_STLIT8(K33, "EPhoneViewShowNote");
+_STLIT8(K34, "EPhoneViewShowGlobalNote");
+_STLIT8(K35, "EPhoneViewShowProgressNote");
+_STLIT8(K36, "EPhoneViewRemoveNote");
+_STLIT8(K37, "EPhoneViewRemoveProgressNote");
+_STLIT8(K38, "EPhoneViewRemoveGlobalNote");
+_STLIT8(K39, "EPhoneViewGetIsNoteVisible");
+_STLIT8(K40, "EPhoneViewGetIsProgressNoteVisible");
+_STLIT8(K41, "EPhoneViewShowQuery");
+_STLIT8(K42, "EPhoneViewSetListQueryString");
+_STLIT8(K43, "EPhoneViewRemoveQuery");
+_STLIT8(K44, "EPhoneViewGetTextQueryContents");
+_STLIT8(K45, "EPhoneViewSetTopApplication");
+_STLIT8(K46, "EPhoneViewBringAppToForeground");
+_STLIT8(K47, "EPhoneViewSendToBackground");
+_STLIT8(K48, "EPhoneViewSetNeedToSendToBackgroundStatus");
+_STLIT8(K49, "EPhoneViewGetNeedToSendToBackgroundStatus");
+_STLIT8(K50, "EPhoneViewGetTopApplicationIsDisplayedStatus");
+_STLIT8(K51, "EPhoneViewGetForegroundApplication");
+_STLIT8(K52, "EPhoneViewSetBackgroundImageBitmap");
+_STLIT8(K53, "EPhoneViewGetBackgroundImageBitmap");
+_STLIT8(K54, "EPhoneViewActivateApp");
+_STLIT8(K55, "EPhoneViewActivateAppView");
+_STLIT8(K56, "EPhoneViewActivateAppViewWithCustomMessage");
+_STLIT8(K57, "EPhoneViewActivateAppViewConventional");
+_STLIT8(K58, "EPhoneViewLaunchApplication");
+_STLIT8(K59, "EPhoneViewLaunchHelpApplication");
+_STLIT8(K60, "EPhoneViewOpenMessageEditor");
+_STLIT8(K61, "EPhoneViewExitApplications");
+_STLIT8(K62, "EPhoneViewUpdateIncallIndicator");
+_STLIT8(K63, "EPhoneViewStartCapturingKey");
+_STLIT8(K64, "EPhoneViewStopCapturingKey");
+_STLIT8(K65, "EPhoneViewSetGlobalNotifiersDisabled");
+_STLIT8(K66, "EPhoneViewSetSpeedDialLocation");
+_STLIT8(K67, "EPhoneViewGetNumberFromSpeedDialLocation");
+_STLIT8(K68, "EPhoneViewAssignSpeedDialLocation");
+_STLIT8(K69, "EPhoneViewGetHoldFlag");
+_STLIT8(K70, "EPhoneViewSetHoldFlag");
+_STLIT8(K71, "EPhoneViewSetSoftRejectFlag");
+_STLIT8(K72, "EPhoneViewGetSoftRejectFlag");
+_STLIT8(K73, "EPhoneViewSetServiceCodeFlag");
+_STLIT8(K74, "EPhoneViewUpdateContact");
+_STLIT8(K75, "EPhoneViewAddContact");
+_STLIT8(K76, "EPhoneViewOpenSingleItemFetchDialog");
+_STLIT8(K77, "EPhoneViewRemovePhoneDialogs");
+_STLIT8(K78, "EPhoneViewCreateConference");
+_STLIT8(K79, "EPhoneViewAddToConference");
+_STLIT8(K80, "EPhoneViewRemoveFromConference");
+_STLIT8(K81, "EPhoneViewPrivateFromConference");
+_STLIT8(K82, "EPhoneViewSelectedConfMember");
+_STLIT8(K83, "EPhoneViewOpenConferenceList");
+_STLIT8(K84, "EPhoneViewGetConferenceListVisibleFlag");
+_STLIT8(K85, "EPhoneViewGetCallState");
+_STLIT8(K86, "EPhoneViewGetCallIdByState");
+_STLIT8(K87, "EPhoneViewMoveHighLightInList");
+_STLIT8(K88, "EPhoneViewGetCountOfActiveCalls");
+_STLIT8(K89, "EPhoneViewSetNaviPaneAudioVolume");
+_STLIT8(K90, "EPhoneViewShowNaviPaneAudioVolume");
+_STLIT8(K91, "EPhoneViewHideNaviPaneAudioVolume");
+_STLIT8(K92, "EPhoneViewGetIsConference");
+_STLIT8(K93, "EPhoneViewGetCallExistsInConference");
+_STLIT8(K94, "EPhoneViewRemoveAllCallHeaders");
+_STLIT8(K95, "EPhoneViewPlayRingTone");
+_STLIT8(K96, "EPhoneViewMuteRingTone");
+_STLIT8(K97, "EPhoneViewStopRingTone");
+_STLIT8(K98, "EPhoneViewMuteRingToneOnAnswer");
+_STLIT8(K99, "EPhoneViewCipheringInfoChange");
+_STLIT8(K100, "EPhoneViewUpdateMaxConfMemberFlag");
+_STLIT8(K101, "EPhoneViewCloseFSW");
+_STLIT8(K102, "EPhoneViewLaunchRfsDeep");
+_STLIT8(K103, "EPhoneViewLaunchRfsNormal");
+_STLIT8(K104, "EPhoneViewUpdateView");
+_STLIT8(K105, "EPhoneViewOpenSoftRejectEditor");
+_STLIT8(K106, "EPhoneViewSendMessage");
+_STLIT8(K107, "EPhoneViewSetBlockingDialogStatus");
+_STLIT8(K108, "EPhoneViewSetPhoneNumberAvailableInPhoneEngine");
+_STLIT8(K109, "EPhoneViewSetSecurityMode");
+_STLIT8(K110, "EPhoneViewGetSecurityModeStatus");
+_STLIT8(K111, "EPhoneViewSetStatusPaneVisible");
+_STLIT8(K112, "EPhoneViewEnableKeyLock");
+_STLIT8(K113, "EPhoneViewEnableKeyLockWithoutNote");
+_STLIT8(K114, "EPhoneViewLaunchFaxModem");
+_STLIT8(K115, "EPhoneViewUpdateFSW");
+_STLIT8(K116, "EPhoneViewIsQuery");
+_STLIT8(K117, "EPhoneViewBringIdleToForeground");
+_STLIT8(K118, "EPhoneViewSetIdleTopApplication");
+_STLIT8(K119, "EPhoneViewBeginUpdate");
+_STLIT8(K120, "EPhoneViewEndUpdate");
+_STLIT8(K121, "EPhoneViewSetConfrenceOptionsFlag");
+_STLIT8(K122, "EPhoneViewRemoveConferenceBubble");
+_STLIT8(K123, "EPhoneViewGetSoftRejectWindowGroupId");
+_STLIT8(K124, "EPhoneViewSetTouchPaneButtons");
+_STLIT8(K125, "EPhoneViewSetTouchPaneVisible");
+_STLIT8(K126, "EPhoneViewEnableTouchButton");
+_STLIT8(K127, "EPhoneViewDisableTouchButton");
+_STLIT8(K128, "EPhoneResetTouchButtons");
+_STLIT8(K129, "EPhoneViewGetIsConferenceInSelectionMode");
+_STLIT8(K130, "EPhoneViewIsStraightCallToVideoMailBox");
+_STLIT8(K131, "EPhoneViewSetDtmfDialerViewVisible");
+_STLIT8(K132, "EPhoneViewSetRetrictedDialer");
+_STLIT8(K133, "EPhoneViewIsConferenceInExpandedMode");
+_STLIT8(K134, "EPhoneViewIsMenuBarVisible");
+_STLIT8(K135, "EPhoneViewGetBlockingDialogStatus");
+_STLIT8(K136, "EPhoneViewYesSingleItemFetch");
+_STLIT8(K137, "EPhoneViewNoSingleItemFetch");
+_STLIT8(K138, "EPhoneViewGetLocalizedNumberFromEntry");
+_STLIT8(K139, "EPhoneViewIsNoteActive");
+_STLIT8(K140, "EPhoneViewOpenNumberEntry");
+_STLIT8(K141, "EPhoneViewOpenCallHandling");
+_STLIT8(K142, "EPhoneViewGetConferenceAndSingleFlag");
+_STLIT8(K143, "EPhoneViewSetConferenceAndSingleFlag");
+_STLIT8(K144, "EPhoneViewSetVideoCallFlag");
+_STLIT8(K145, "EPhoneViewSetDtmfOptionsFlag");
+_STLIT8(K146, "EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery");
+_STLIT8(K147, "EPhoneViewGetAudioVolumeLevel");
+_STLIT8(K148, "EPhoneViewIsIdleTopApp");
+_STLIT8(K149, "EPhoneViewUpdateToolbar");
+_STLIT8(K150, "EPhoneViewSetControlAndVisibility");
+_STLIT8(K151, "EPhoneViewAllowWaitingCallHeader");
+_STLIT8(K152, "EPhoneViewBeginTransEffect");
+_STLIT8(K153, "EPhoneViewEndTransEffect");
+_STLIT8(K154, "EPhoneViewSetDialerControlVisible");
+_STLIT8(K155, "EPhoneViewCloseSingleItemFetchDialog");
+_STLIT8(K156, "EPhoneViewGetActivatePreviousApp");
+_STLIT8(K157, "EPhoneViewActivatePreviousApp");
+_STLIT8(K158, "EPhoneViewSetPointerCapture");
+_STLIT8(K159, "EPhoneViewSetSendKeyDialerActivationFlag");
+_STLIT8(K160, "EPhoneViewPrepareIcons");
+_STLIT8(K161, "EPhoneViewKeypadAudioEnabled");
+_STLIT8(K162, "EPhoneViewKeypadAudioDisabled");
+_STLIT8(K163, "EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel");
+_STLIT8(K164, "EPhoneViewRemoveDtmfNote");
+_STLIT8(K165, "EPhoneViewUpdatePhoneIconToFSW");
+_STLIT8(K166, "EPhoneViewSetEikonNotifiersDisabled");
+_STLIT8(K167, "EPhoneViewCancelAllNotications");
+_STLIT8(K168, "EPhoneViewSetVideoCallDTMFVisibilityFlag");
+_STLIT8(K169, "EPhoneViewIsKeyLockEnabled");
+_STLIT8(K170, "EPhoneViewDisableKeyLock");
+_STLIT8(K171, "EPhoneViewLoadPlugins");
+_STLIT8(K172, "PhoneViewServiceSelection");
+_STLIT8(K173, "EPhoneViewOpenVirtualKeyBoard");
+_STLIT8(K174, "EPhoneViewUpdateNoteSoftkeys");
+_STLIT8(K175, "EPhoneViewShowCustomizedDialer");
+_STLIT8(K176, "EPhoneViewHideCustomizedDialer");
+_STLIT8(K177, "EPhoneViewGetCustomizedDialerMenuResourceId");
+_STLIT8(K178, "EPhoneViewGetCustomizedDialerCbaResourceId");
+_STLIT8(K179, "EPhoneViewCreatePhoneBookServices");
+_STLIT8(K180, "EPhoneViewDisableKeyLockWithoutNote");
+_STLIT8(K181, "EPhoneViewGetKeyLockStatus");
+_STLIT8(K182, "EPhoneViewSetNumberEntryObserver");
+_STLIT8(K183, "EPhoneViewGetSingleItemFetchType");
+_STLIT8(K184, "EPhoneViewRemoveGlobalWaitNote");
+_STLIT8(K185, "EPhoneViewSetPhoneCustomization");
+_STLIT8(K186, "EPhoneViewSetViewCustomization");
+_STLIT8(K187, "EPhoneViewSetButtonCustomization");
+_STLIT8(K188, "EPhoneViewUpdateContactByString");
+_STLIT8(K189, "EPhoneViewAddContactByString");
+_STLIT8(K190, "EPhoneViewIsActiveNoteDissmissableByKeyEvent");
+_STLIT8(K191, "EPhoneViewSetNoConnectedCalls");
+_STLIT8(K192, "EPhoneViewIsDTMFEditorVisible");
+_STLIT8(K193, ", // Don't remove this, this should always be the last in list.");
+
+// Intermediate
+const void * const KStringPointers[] =
+    {
+    (const void*)&K1,
+    (const void*)&K2,
+    (const void*)&K3,
+    (const void*)&K4,
+    (const void*)&K5,
+    (const void*)&K6,
+    (const void*)&K7,
+    (const void*)&K8,
+    (const void*)&K9,
+    (const void*)&K10,
+    (const void*)&K11,
+    (const void*)&K12,
+    (const void*)&K13,
+    (const void*)&K14,
+    (const void*)&K15,
+    (const void*)&K16,
+    (const void*)&K17,
+    (const void*)&K18,
+    (const void*)&K19,
+    (const void*)&K20,
+    (const void*)&K21,
+    (const void*)&K22,
+    (const void*)&K23,
+    (const void*)&K24,
+    (const void*)&K25,
+    (const void*)&K26,
+    (const void*)&K27,
+    (const void*)&K28,
+    (const void*)&K29,
+    (const void*)&K30,
+    (const void*)&K31,
+    (const void*)&K32,
+    (const void*)&K33,
+    (const void*)&K34,
+    (const void*)&K35,
+    (const void*)&K36,
+    (const void*)&K37,
+    (const void*)&K38,
+    (const void*)&K39,
+    (const void*)&K40,
+    (const void*)&K41,
+    (const void*)&K42,
+    (const void*)&K43,
+    (const void*)&K44,
+    (const void*)&K45,
+    (const void*)&K46,
+    (const void*)&K47,
+    (const void*)&K48,
+    (const void*)&K49,
+    (const void*)&K50,
+    (const void*)&K51,
+    (const void*)&K52,
+    (const void*)&K53,
+    (const void*)&K54,
+    (const void*)&K55,
+    (const void*)&K56,
+    (const void*)&K57,
+    (const void*)&K58,
+    (const void*)&K59,
+    (const void*)&K60,
+    (const void*)&K61,
+    (const void*)&K62,
+    (const void*)&K63,
+    (const void*)&K64,
+    (const void*)&K65,
+    (const void*)&K66,
+    (const void*)&K67,
+    (const void*)&K68,
+    (const void*)&K69,
+    (const void*)&K70,
+    (const void*)&K71,
+    (const void*)&K72,
+    (const void*)&K73,
+    (const void*)&K74,
+    (const void*)&K75,
+    (const void*)&K76,
+    (const void*)&K77,
+    (const void*)&K78,
+    (const void*)&K79,
+    (const void*)&K80,
+    (const void*)&K81,
+    (const void*)&K82,
+    (const void*)&K83,
+    (const void*)&K84,
+    (const void*)&K85,
+    (const void*)&K86,
+    (const void*)&K87,
+    (const void*)&K88,
+    (const void*)&K89,
+    (const void*)&K90,
+    (const void*)&K91,
+    (const void*)&K92,
+    (const void*)&K93,
+    (const void*)&K94,
+    (const void*)&K95,
+    (const void*)&K96,
+    (const void*)&K97,
+    (const void*)&K98,
+    (const void*)&K99,
+    (const void*)&K100,
+    (const void*)&K101,
+    (const void*)&K102,
+    (const void*)&K103,
+    (const void*)&K104,
+    (const void*)&K105,
+    (const void*)&K106,
+    (const void*)&K107,
+    (const void*)&K108,
+    (const void*)&K109,
+    (const void*)&K110,
+    (const void*)&K111,
+    (const void*)&K112,
+    (const void*)&K113,
+    (const void*)&K114,
+    (const void*)&K115,
+    (const void*)&K116,
+    (const void*)&K117,
+    (const void*)&K118,
+    (const void*)&K119,
+    (const void*)&K120,
+    (const void*)&K121,
+    (const void*)&K122,
+    (const void*)&K123,
+    (const void*)&K124,
+    (const void*)&K125,
+    (const void*)&K126,
+    (const void*)&K127,
+    (const void*)&K128,
+    (const void*)&K129,
+    (const void*)&K130,
+    (const void*)&K131,
+    (const void*)&K132,
+    (const void*)&K133,
+    (const void*)&K134,
+    (const void*)&K135,
+    (const void*)&K136,
+    (const void*)&K137,
+    (const void*)&K138,
+    (const void*)&K139,
+    (const void*)&K140,
+    (const void*)&K141,
+    (const void*)&K142,
+    (const void*)&K143,
+    (const void*)&K144,
+    (const void*)&K145,
+    (const void*)&K146,
+    (const void*)&K147,
+    (const void*)&K148,
+    (const void*)&K149,
+    (const void*)&K150,
+    (const void*)&K151,
+    (const void*)&K152,
+    (const void*)&K153,
+    (const void*)&K154,
+    (const void*)&K155,
+    (const void*)&K156,
+    (const void*)&K157,
+    (const void*)&K158,
+    (const void*)&K159,
+    (const void*)&K160,
+    (const void*)&K161,
+    (const void*)&K162,
+    (const void*)&K163,
+    (const void*)&K164,
+    (const void*)&K165,
+    (const void*)&K166,
+    (const void*)&K167,
+    (const void*)&K168,
+    (const void*)&K169,
+    (const void*)&K170,
+    (const void*)&K171,
+    (const void*)&K172,
+    (const void*)&K173,
+    (const void*)&K174,
+    (const void*)&K175,
+    (const void*)&K176,
+    (const void*)&K177,
+    (const void*)&K178,
+    (const void*)&K179,
+    (const void*)&K180,
+    (const void*)&K181,
+    (const void*)&K182,
+    (const void*)&K183,
+    (const void*)&K184,
+    (const void*)&K185,
+    (const void*)&K186,
+    (const void*)&K187,
+    (const void*)&K188,
+    (const void*)&K189,
+    (const void*)&K190,
+    (const void*)&K191,
+    (const void*)&K192,
+    (const void*)&K193
+    };
+
+const TStringTable PhoneLoggerviewCommands::Table = {193, KStringPointers, EFalse};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/phoneloggerviewcommands.st	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,195 @@
+# Phone Application Logger UI Command String Table
+fstringtable PhoneLoggerviewCommands
+EPhoneViewStartValue EPhoneViewStartValue
+EPhoneViewCreateNumberEntry EPhoneViewCreateNumberEntry
+EPhoneViewSetNumberEntryContent EPhoneViewSetNumberEntryContent
+EPhoneViewSendKeyEventToNumberEntry EPhoneViewSendKeyEventToNumberEntry
+EPhoneViewRemoveNumberEntry EPhoneViewRemoveNumberEntry
+EPhoneViewSetNumberEntryVisible EPhoneViewSetNumberEntryVisible
+EPhoneViewGetNumberFromEntry EPhoneViewGetNumberFromEntry
+EPhoneViewGetNumberEntryCount EPhoneViewGetNumberEntryCount
+EPhoneViewGetNumberEntryIsUsedStatus EPhoneViewGetNumberEntryIsUsedStatus
+EPhoneViewGetNumberEntryIsVisibleStatus EPhoneViewGetNumberEntryIsVisibleStatus
+EPhoneViewToggleNumberEntryAlphaNumericMode EPhoneViewToggleNumberEntryAlphaNumericMode
+EPhoneViewIsNumberEntryNumericMode EPhoneViewIsNumberEntryNumericMode
+EPhoneViewClearNumberEntryContent EPhoneViewClearNumberEntryContent
+EPhoneViewCreateCallHeader  EPhoneViewCreateCallHeader
+EPhoneViewCreateEmergencyCallHeader EPhoneViewCreateEmergencyCallHeader
+EPhoneViewUpdateCallHeaderRemoteInfoData EPhoneViewUpdateCallHeaderRemoteInfoData
+EPhoneViewUpdateCallHeaderCallDuration EPhoneViewUpdateCallHeaderCallDuration
+EPhoneViewRemoveCallHeader  EPhoneViewRemoveCallHeader
+EPhoneViewMenuBarOpen       EPhoneViewMenuBarOpen
+EPhoneViewMenuBarClose      EPhoneViewMenuBarClose
+EPhoneViewDimCbaCommand     EPhoneViewDimCbaCommand
+EPhoneViewUpdateCba         EPhoneViewUpdateCba
+EPhoneViewUpdateBubble      EPhoneViewUpdateBubble
+EPhoneViewMenuPane      EPhoneViewMenuPane
+EPhoneViewMenuBar       EPhoneViewMenuBar
+EPhoneViewSetTitlePaneContent   EPhoneViewSetTitlePaneContent
+EPhoneViewSetNaviPaneContent   EPhoneViewSetNaviPaneContent
+EPhoneViewSetTitlePanePicture EPhoneViewSetTitlePanePicture
+EPhoneViewGetTitlePaneIsVisibleStatus EPhoneViewGetTitlePaneIsVisibleStatus
+EPhoneViewActivateAudioPathUIChanges  EPhoneViewActivateAudioPathUIChanges
+EPhoneViewActivateAudioAvailabilityUIChanges  EPhoneViewActivateAudioAvailabilityUIChanges
+EPhoneViewActivateMuteUIChanges EPhoneViewActivateMuteUIChanges
+EPhoneViewShowNote EPhoneViewShowNote
+EPhoneViewShowGlobalNote EPhoneViewShowGlobalNote
+EPhoneViewShowProgressNote EPhoneViewShowProgressNote
+EPhoneViewRemoveNote EPhoneViewRemoveNote
+EPhoneViewRemoveProgressNote EPhoneViewRemoveProgressNote
+EPhoneViewRemoveGlobalNote EPhoneViewRemoveGlobalNote
+EPhoneViewGetIsNoteVisible EPhoneViewGetIsNoteVisible
+EPhoneViewGetIsProgressNoteVisible EPhoneViewGetIsProgressNoteVisible
+EPhoneViewShowQuery EPhoneViewShowQuery
+EPhoneViewSetListQueryString EPhoneViewSetListQueryString
+EPhoneViewRemoveQuery EPhoneViewRemoveQuery
+EPhoneViewGetTextQueryContents EPhoneViewGetTextQueryContents
+EPhoneViewSetTopApplication EPhoneViewSetTopApplication
+EPhoneViewBringAppToForeground EPhoneViewBringAppToForeground
+EPhoneViewSendToBackground EPhoneViewSendToBackground
+EPhoneViewSetNeedToSendToBackgroundStatus EPhoneViewSetNeedToSendToBackgroundStatus
+EPhoneViewGetNeedToSendToBackgroundStatus EPhoneViewGetNeedToSendToBackgroundStatus
+EPhoneViewGetTopApplicationIsDisplayedStatus EPhoneViewGetTopApplicationIsDisplayedStatus
+EPhoneViewGetForegroundApplication EPhoneViewGetForegroundApplication
+EPhoneViewSetBackgroundImageBitmap EPhoneViewSetBackgroundImageBitmap
+EPhoneViewGetBackgroundImageBitmap EPhoneViewGetBackgroundImageBitmap
+EPhoneViewActivateApp EPhoneViewActivateApp
+EPhoneViewActivateAppView EPhoneViewActivateAppView
+EPhoneViewActivateAppViewWithCustomMessage EPhoneViewActivateAppViewWithCustomMessage
+EPhoneViewActivateAppViewConventional EPhoneViewActivateAppViewConventional
+EPhoneViewLaunchApplication EPhoneViewLaunchApplication
+EPhoneViewLaunchHelpApplication EPhoneViewLaunchHelpApplication
+EPhoneViewOpenMessageEditor EPhoneViewOpenMessageEditor
+EPhoneViewExitApplications EPhoneViewExitApplications
+EPhoneViewUpdateIncallIndicator EPhoneViewUpdateIncallIndicator
+EPhoneViewStartCapturingKey EPhoneViewStartCapturingKey
+EPhoneViewStopCapturingKey EPhoneViewStopCapturingKey
+EPhoneViewSetGlobalNotifiersDisabled EPhoneViewSetGlobalNotifiersDisabled
+EPhoneViewSetSpeedDialLocation EPhoneViewSetSpeedDialLocation
+EPhoneViewGetNumberFromSpeedDialLocation EPhoneViewGetNumberFromSpeedDialLocation
+EPhoneViewAssignSpeedDialLocation EPhoneViewAssignSpeedDialLocation
+EPhoneViewGetHoldFlag EPhoneViewGetHoldFlag
+EPhoneViewSetHoldFlag EPhoneViewSetHoldFlag
+EPhoneViewSetSoftRejectFlag EPhoneViewSetSoftRejectFlag
+EPhoneViewGetSoftRejectFlag EPhoneViewGetSoftRejectFlag
+EPhoneViewSetServiceCodeFlag EPhoneViewSetServiceCodeFlag
+EPhoneViewUpdateContact EPhoneViewUpdateContact
+EPhoneViewAddContact EPhoneViewAddContact
+EPhoneViewOpenSingleItemFetchDialog EPhoneViewOpenSingleItemFetchDialog
+EPhoneViewRemovePhoneDialogs EPhoneViewRemovePhoneDialogs
+EPhoneViewCreateConference EPhoneViewCreateConference
+EPhoneViewAddToConference EPhoneViewAddToConference
+EPhoneViewRemoveFromConference EPhoneViewRemoveFromConference
+EPhoneViewPrivateFromConference EPhoneViewPrivateFromConference
+EPhoneViewSelectedConfMember EPhoneViewSelectedConfMember
+EPhoneViewOpenConferenceList EPhoneViewOpenConferenceList
+EPhoneViewGetConferenceListVisibleFlag EPhoneViewGetConferenceListVisibleFlag
+EPhoneViewGetCallState EPhoneViewGetCallState
+EPhoneViewGetCallIdByState EPhoneViewGetCallIdByState
+EPhoneViewMoveHighLightInList EPhoneViewMoveHighLightInList
+EPhoneViewGetCountOfActiveCalls EPhoneViewGetCountOfActiveCalls
+EPhoneViewSetNaviPaneAudioVolume EPhoneViewSetNaviPaneAudioVolume
+EPhoneViewShowNaviPaneAudioVolume EPhoneViewShowNaviPaneAudioVolume
+EPhoneViewHideNaviPaneAudioVolume EPhoneViewHideNaviPaneAudioVolume
+EPhoneViewGetIsConference EPhoneViewGetIsConference
+EPhoneViewGetCallExistsInConference EPhoneViewGetCallExistsInConference
+EPhoneViewRemoveAllCallHeaders EPhoneViewRemoveAllCallHeaders
+EPhoneViewPlayRingTone EPhoneViewPlayRingTone
+EPhoneViewMuteRingTone EPhoneViewMuteRingTone
+EPhoneViewStopRingTone EPhoneViewStopRingTone
+EPhoneViewMuteRingToneOnAnswer EPhoneViewMuteRingToneOnAnswer
+EPhoneViewCipheringInfoChange EPhoneViewCipheringInfoChange
+EPhoneViewUpdateMaxConfMemberFlag EPhoneViewUpdateMaxConfMemberFlag
+EPhoneViewCloseFSW EPhoneViewCloseFSW
+EPhoneViewLaunchRfsDeep EPhoneViewLaunchRfsDeep
+EPhoneViewLaunchRfsNormal EPhoneViewLaunchRfsNormal
+EPhoneViewUpdateView EPhoneViewUpdateView
+EPhoneViewOpenSoftRejectEditor EPhoneViewOpenSoftRejectEditor
+EPhoneViewSendMessage EPhoneViewSendMessage
+EPhoneViewSetBlockingDialogStatus EPhoneViewSetBlockingDialogStatus
+EPhoneViewSetPhoneNumberAvailableInPhoneEngine EPhoneViewSetPhoneNumberAvailableInPhoneEngine
+EPhoneViewSetSecurityMode EPhoneViewSetSecurityMode
+EPhoneViewGetSecurityModeStatus EPhoneViewGetSecurityModeStatus
+EPhoneViewSetStatusPaneVisible EPhoneViewSetStatusPaneVisible
+EPhoneViewEnableKeyLock EPhoneViewEnableKeyLock
+EPhoneViewEnableKeyLockWithoutNote EPhoneViewEnableKeyLockWithoutNote
+EPhoneViewLaunchFaxModem EPhoneViewLaunchFaxModem
+EPhoneViewUpdateFSW EPhoneViewUpdateFSW
+EPhoneViewIsQuery EPhoneViewIsQuery
+EPhoneViewBringIdleToForeground EPhoneViewBringIdleToForeground
+EPhoneViewSetIdleTopApplication EPhoneViewSetIdleTopApplication
+EPhoneViewBeginUpdate EPhoneViewBeginUpdate
+EPhoneViewEndUpdate EPhoneViewEndUpdate
+EPhoneViewSetConfrenceOptionsFlag EPhoneViewSetConfrenceOptionsFlag
+EPhoneViewRemoveConferenceBubble EPhoneViewRemoveConferenceBubble
+EPhoneViewGetSoftRejectWindowGroupId EPhoneViewGetSoftRejectWindowGroupId
+EPhoneViewSetTouchPaneButtons EPhoneViewSetTouchPaneButtons
+EPhoneViewSetTouchPaneVisible EPhoneViewSetTouchPaneVisible
+EPhoneViewEnableTouchButton EPhoneViewEnableTouchButton
+EPhoneViewDisableTouchButton EPhoneViewDisableTouchButton
+EPhoneResetTouchButtons EPhoneResetTouchButtons
+EPhoneViewGetIsConferenceInSelectionMode EPhoneViewGetIsConferenceInSelectionMode  
+EPhoneViewIsStraightCallToVideoMailBox EPhoneViewIsStraightCallToVideoMailBox
+EPhoneViewSetDtmfDialerViewVisible EPhoneViewSetDtmfDialerViewVisible
+EPhoneViewSetRetrictedDialer EPhoneViewSetRetrictedDialer
+EPhoneViewIsConferenceInExpandedMode EPhoneViewIsConferenceInExpandedMode 
+EPhoneViewIsMenuBarVisible EPhoneViewIsMenuBarVisible
+EPhoneViewGetBlockingDialogStatus EPhoneViewGetBlockingDialogStatus
+EPhoneViewYesSingleItemFetch EPhoneViewYesSingleItemFetch
+EPhoneViewNoSingleItemFetch EPhoneViewNoSingleItemFetch
+EPhoneViewGetLocalizedNumberFromEntry EPhoneViewGetLocalizedNumberFromEntry
+EPhoneViewIsNoteActive EPhoneViewIsNoteActive
+EPhoneViewOpenNumberEntry EPhoneViewOpenNumberEntry
+EPhoneViewOpenCallHandling EPhoneViewOpenCallHandling
+EPhoneViewGetConferenceAndSingleFlag EPhoneViewGetConferenceAndSingleFlag
+EPhoneViewSetConferenceAndSingleFlag EPhoneViewSetConferenceAndSingleFlag
+EPhoneViewSetVideoCallFlag EPhoneViewSetVideoCallFlag
+EPhoneViewSetDtmfOptionsFlag EPhoneViewSetDtmfOptionsFlag
+EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery EPhoneViewShowVTSetupFailedCreateCallToSameContactQuery
+EPhoneViewGetAudioVolumeLevel EPhoneViewGetAudioVolumeLevel
+EPhoneViewIsIdleTopApp EPhoneViewIsIdleTopApp
+EPhoneViewUpdateToolbar EPhoneViewUpdateToolbar
+EPhoneViewSetControlAndVisibility EPhoneViewSetControlAndVisibility
+EPhoneViewAllowWaitingCallHeader EPhoneViewAllowWaitingCallHeader
+EPhoneViewBeginTransEffect EPhoneViewBeginTransEffect
+EPhoneViewEndTransEffect EPhoneViewEndTransEffect
+EPhoneViewSetDialerControlVisible EPhoneViewSetDialerControlVisible
+EPhoneViewCloseSingleItemFetchDialog EPhoneViewCloseSingleItemFetchDialog
+EPhoneViewGetActivatePreviousApp EPhoneViewGetActivatePreviousApp
+EPhoneViewActivatePreviousApp EPhoneViewActivatePreviousApp
+EPhoneViewSetPointerCapture EPhoneViewSetPointerCapture
+EPhoneViewSetSendKeyDialerActivationFlag EPhoneViewSetSendKeyDialerActivationFlag
+EPhoneViewPrepareIcons EPhoneViewPrepareIcons 
+EPhoneViewKeypadAudioEnabled EPhoneViewKeypadAudioEnabled
+EPhoneViewKeypadAudioDisabled EPhoneViewKeypadAudioDisabled
+EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel
+EPhoneViewRemoveDtmfNote EPhoneViewRemoveDtmfNote
+EPhoneViewUpdatePhoneIconToFSW EPhoneViewUpdatePhoneIconToFSW
+EPhoneViewSetEikonNotifiersDisabled EPhoneViewSetEikonNotifiersDisabled
+EPhoneViewCancelAllNotications EPhoneViewCancelAllNotications
+EPhoneViewSetVideoCallDTMFVisibilityFlag EPhoneViewSetVideoCallDTMFVisibilityFlag
+EPhoneViewIsKeyLockEnabled EPhoneViewIsKeyLockEnabled
+EPhoneViewDisableKeyLock EPhoneViewDisableKeyLock
+EPhoneViewLoadPlugins EPhoneViewLoadPlugins
+PhoneViewServiceSelection PhoneViewServiceSelection
+EPhoneViewOpenVirtualKeyBoard EPhoneViewOpenVirtualKeyBoard
+EPhoneViewUpdateNoteSoftkeys EPhoneViewUpdateNoteSoftkeys
+EPhoneViewShowCustomizedDialer EPhoneViewShowCustomizedDialer
+EPhoneViewHideCustomizedDialer EPhoneViewHideCustomizedDialer
+EPhoneViewGetCustomizedDialerMenuResourceId EPhoneViewGetCustomizedDialerMenuResourceId
+EPhoneViewGetCustomizedDialerCbaResourceId EPhoneViewGetCustomizedDialerCbaResourceId
+EPhoneViewCreatePhoneBookServices EPhoneViewCreatePhoneBookServices
+EPhoneViewDisableKeyLockWithoutNote EPhoneViewDisableKeyLockWithoutNote
+EPhoneViewGetKeyLockStatus EPhoneViewGetKeyLockStatus
+EPhoneViewSetNumberEntryObserver EPhoneViewSetNumberEntryObserver
+EPhoneViewGetSingleItemFetchType EPhoneViewGetSingleItemFetchType
+EPhoneViewRemoveGlobalWaitNote EPhoneViewRemoveGlobalWaitNote
+EPhoneViewSetPhoneCustomization EPhoneViewSetPhoneCustomization
+EPhoneViewSetViewCustomization EPhoneViewSetViewCustomization
+EPhoneViewSetButtonCustomization EPhoneViewSetButtonCustomization
+EPhoneViewUpdateContactByString EPhoneViewUpdateContactByString
+EPhoneViewAddContactByString EPhoneViewAddContactByString
+EPhoneViewIsActiveNoteDissmissableByKeyEvent EPhoneViewIsActiveNoteDissmissableByKeyEvent
+EPhoneViewSetNoConnectedCalls EPhoneViewSetNoConnectedCalls
+EPhoneViewIsDTMFEditorVisible EPhoneViewIsDTMFEditorVisible
+EPhoneAmountOfCommands, // Don't remove this, this should always be the last in list.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/phonestatestrings.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Macro definition file for logging.
+*
+*/
+
+// Autogenerated from phonestatestrings.st by the stringtable tool - Do not edit
+#include <e32std.h>
+#include <stringpool.h>
+#include <stringtablesupport.h>
+#include "phonestatestrings.h"
+#ifdef _DEBUG
+#undef _DEBUG
+#endif
+
+_STLIT8(K1, "EPhoneStateNull");
+_STLIT8(K2, "EPhoneStateStartup");
+_STLIT8(K3, "EPhoneStateIdle");
+_STLIT8(K4, "EPhoneStateCallSetup");
+_STLIT8(K5, "EPhoneStateSingle");
+_STLIT8(K6, "EPhoneStateIncoming");
+_STLIT8(K7, "EPhoneStateEmergency");
+
+// Intermediate
+const void * const KStringPointers[] =
+    {
+    (const void*)&K1,
+    (const void*)&K2,
+    (const void*)&K3,
+    (const void*)&K4,
+    (const void*)&K5,
+    (const void*)&K6,
+    (const void*)&K7
+    };
+
+const TStringTable PhoneStateStrings::Table = {7, KStringPointers, EFalse};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/phonestatestrings.st	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,9 @@
+# Phone UI Logger UI Command String Table
+fstringtable PhoneStateStrings
+EPhoneStateNull EPhoneStateNull
+EPhoneStateStartup EPhoneStateStartup
+EPhoneStateIdle EPhoneStateIdle
+EPhoneStateCallSetup EPhoneStateCallSetup
+EPhoneStateSingle EPhoneStateSingle
+EPhoneStateIncoming EPhoneStateIncoming
+EPhoneStateEmergency EPhoneStateEmergency
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/phonestatestringsgsm.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Macro definition file for logging.
+*
+*/
+
+// Autogenerated from phonestatestringsgsm.st by the stringtable tool - Do not edit
+#include <e32std.h>
+#include <stringpool.h>
+#include <stringtablesupport.h>
+#include "phonestatestringsgsm.h"
+#ifdef _DEBUG
+#undef _DEBUG
+#endif
+
+_STLIT8(K1, "EPhoneStateAlerting");
+_STLIT8(K2, "EPhoneStateAlertingInSingle");
+_STLIT8(K3, "EPhoneStateWaitingInSingle");
+_STLIT8(K4, "EPhoneStateTwoSingles");
+_STLIT8(K5, "EPhoneStateCallSetupInSingle");
+_STLIT8(K6, "EPhoneStateConference");
+_STLIT8(K7, "EPhoneStateConferenceAndCallSetup");
+_STLIT8(K8, "EPhoneStateConferenceAndSingle");
+_STLIT8(K9, "EPhoneStateConferenceAndWaiting");
+_STLIT8(K10, "EPhoneStateSingleAndCallSetupAndWaiting");
+_STLIT8(K11, "EPhoneStateCallSetupAndWaiting");
+_STLIT8(K12, "EPhoneStateTwoSinglesAndWaiting");
+_STLIT8(K13, "EPhoneStateConferenceAndSingleAndWaiting");
+_STLIT8(K14, "EPhoneStateConferenceAndWaitingAndCallSetup");
+_STLIT8(K15, "EPhoneStateLastGSMState");
+
+// Intermediate
+const void * const KStringPointers[] =
+    {
+    (const void*)&K1,
+    (const void*)&K2,
+    (const void*)&K3,
+    (const void*)&K4,
+    (const void*)&K5,
+    (const void*)&K6,
+    (const void*)&K7,
+    (const void*)&K8,
+    (const void*)&K9,
+    (const void*)&K10,
+    (const void*)&K11,
+    (const void*)&K12,
+    (const void*)&K13,
+    (const void*)&K14,
+    (const void*)&K15
+    };
+
+const TStringTable PhoneStateStringsGSM::Table = {15, KStringPointers, EFalse};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/phonestatestringsgsm.st	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,18 @@
+# Phone UI Logger UI Command GSM String Table
+fstringtable PhoneStateStringsGSM
+!// GSM States - start at KPhoneStateProtocolFirst
+EPhoneStateAlerting EPhoneStateAlerting
+EPhoneStateAlertingInSingle EPhoneStateAlertingInSingle
+EPhoneStateWaitingInSingle EPhoneStateWaitingInSingle
+EPhoneStateTwoSingles EPhoneStateTwoSingles
+EPhoneStateCallSetupInSingle EPhoneStateCallSetupInSingle
+EPhoneStateConference EPhoneStateConference
+EPhoneStateConferenceAndCallSetup EPhoneStateConferenceAndCallSetup
+EPhoneStateConferenceAndSingle EPhoneStateConferenceAndSingle
+EPhoneStateConferenceAndWaiting EPhoneStateConferenceAndWaiting
+EPhoneStateSingleAndCallSetupAndWaiting EPhoneStateSingleAndCallSetupAndWaiting
+EPhoneStateCallSetupAndWaiting EPhoneStateCallSetupAndWaiting
+EPhoneStateTwoSinglesAndWaiting EPhoneStateTwoSinglesAndWaiting
+EPhoneStateConferenceAndSingleAndWaiting EPhoneStateConferenceAndSingleAndWaiting
+EPhoneStateConferenceAndWaitingAndCallSetup EPhoneStateConferenceAndWaitingAndCallSetup
+EPhoneStateLastGSMState EPhoneStateLastGSMState
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/rphoneanimclearblacklist.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Client side for blacklist clearing plugin.
+*
+*/
+
+
+// INCLUDE FILES
+#include "rphoneanimclearblacklist.h"   // This
+#include <coecntrl.h>                   // CCoeControl
+#include <phoneanimdllstd.h>            // Command
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// RPhoneAnimClearBlacklist::RPhoneAnimClearBlacklist
+// ---------------------------------------------------------
+//
+RPhoneAnimClearBlacklist::RPhoneAnimClearBlacklist( RAnimDll& aAnimDll )
+    :RAnim( aAnimDll )
+    {
+    }
+
+// ---------------------------------------------------------
+// RPhoneAnimClearBlacklist::ConstructL
+// ---------------------------------------------------------
+//
+void RPhoneAnimClearBlacklist::ConstructL( const RWindowBase& aDevice )
+    {
+    // Creates a server side anim class
+    RAnim::Construct( aDevice, EAnimClearBlackList, TPtrC8() );
+    }
+
+// ---------------------------------------------------------
+// RPhoneAnimClearBlacklist::ClearBlackListOnNextKey()
+//
+//  Tells to plugin to clear list on next key event.
+// ---------------------------------------------------------
+//
+void RPhoneAnimClearBlacklist::ClearBlackListOnNextKey()
+    {
+    Command( ECancelBlackList );
+    }
+
+// ---------------------------------------------------------
+// RPhoneAnimClearBlacklist::ClearBlackList()
+//
+//  Tells to plugin to clear list.
+// ---------------------------------------------------------
+//
+void RPhoneAnimClearBlacklist::ClearBlackListNow()
+    {
+    Command( EClearBlackListNow );
+    }
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tcbacommandmapping.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Class holds mapping between CBA and custom commands.
+*
+*/
+
+
+#include "tcbacommandmapping.h"
+
+/** Uninitialized command identifier. */
+const TInt KUninitializedCommmandId = -1;
+
+// ======== MEMBER FUNCTIONS ========
+
+// -----------------------------------------------------------------------------
+// TCbaCommandMapping::TCbaCommandMapping
+// C++ default constructor for null object creation.
+// -----------------------------------------------------------------------------
+//
+TCbaCommandMapping::TCbaCommandMapping()
+    : 
+    iCbaCommandId( KUninitializedCommmandId ), 
+    iCustomCommandId( KUninitializedCommmandId ) 
+    {}
+
+
+// -----------------------------------------------------------------------------
+// TCbaCommandMapping::TCbaCommandMapping
+// Overloaded C++ constructor.
+// -----------------------------------------------------------------------------
+//
+TCbaCommandMapping::TCbaCommandMapping( 
+        TInt aCbaCommandId, TInt aCustomCommandId )
+    : 
+    iCbaCommandId( aCbaCommandId ), iCustomCommandId( aCustomCommandId ) 
+    {}
+
+
+// -----------------------------------------------------------------------------
+// TCbaCommandMapping::CbaCommandId
+// -----------------------------------------------------------------------------
+//
+TInt TCbaCommandMapping::CbaCommandId() const 
+    { 
+    return iCbaCommandId; 
+    }
+
+
+// -----------------------------------------------------------------------------
+// TCbaCommandMapping::CustomCommandId
+// -----------------------------------------------------------------------------
+//
+TInt TCbaCommandMapping::CustomCommandId() const 
+    { 
+    return iCustomCommandId; 
+    }
+
+
+// -----------------------------------------------------------------------------
+// TCbaCommandMapping::operator==
+// -----------------------------------------------------------------------------
+//
+TBool TCbaCommandMapping::operator==( 
+        const TCbaCommandMapping& aMapping ) const
+    {
+    return ( iCbaCommandId == aMapping.CbaCommandId() &&
+             iCustomCommandId == aMapping.CustomCommandId() );
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamappinfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamAppInfo class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "tphonecmdparamappinfo.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C TPhoneCmdParamAppInfo::TPhoneCmdParamAppInfo() :
+    TPhoneCommandParam(),
+    iAppUid( KNullUid ),
+    iViewUid( KNullUid ),
+    iParam( KNullDesC8 ),
+    iCustomMessageId( KNullUid ), // NULL for no message
+    iCustomMessage( KNullDesC8 ),
+    iMultipleInstances( EFalse )
+    {
+    iParamId = EPhoneParamIdAppInfo;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::SetAppUid
+// Sets applicaiton uid.
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAppInfo::SetAppUid( const TUid& aAppUid )
+   {
+   iAppUid = aAppUid;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::SetViewUid
+// Sets View uid.
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAppInfo::SetViewUid( const TUid& aViewUid )
+   {
+   iViewUid = aViewUid;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::SetParam
+// Sets application parameter
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAppInfo::SetParam( const TDesC8& aParam )
+   {
+   iParam.Set( aParam );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::SetCustomMessageId
+// Sets Custom Message Id.
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAppInfo::SetCustomMessageId( 
+   const TUid& aCustomMessageId )
+   {
+   iCustomMessageId = aCustomMessageId;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::SetCustomMessage
+// Sets Custom message
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAppInfo::SetCustomMessage( 
+   const TDesC8& aCustomMessage )
+   {
+   iCustomMessage.Set( aCustomMessage );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::SetMultipleInstances
+// Sets the application's multiple instance status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAppInfo::SetMultipleInstances( 
+   TBool aMultipleInstances )
+   {
+   iMultipleInstances = aMultipleInstances;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::AppUid
+// Returns application uid
+// ---------------------------------------------------------
+//
+EXPORT_C TUid TPhoneCmdParamAppInfo::AppUid() const
+   {
+   return iAppUid;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::ViewUid
+// Returns View uid
+// ---------------------------------------------------------
+//
+EXPORT_C TUid TPhoneCmdParamAppInfo::ViewUid() const
+   {
+   return iViewUid;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::Param
+// Returns App parameter
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC8& TPhoneCmdParamAppInfo::Param() const
+   {
+   return iParam;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::CustomMessageId
+// Returns Custom Message Id
+// ---------------------------------------------------------
+//
+EXPORT_C TUid TPhoneCmdParamAppInfo::CustomMessageId() const
+   {
+   return iCustomMessageId;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::CustomMessage
+// Returns Message
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC8& TPhoneCmdParamAppInfo::CustomMessage() const
+   {
+   return iCustomMessage;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAppInfo::MultipleInstances
+// Returns the application's multiple instance status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamAppInfo::MultipleInstances() const
+   {
+   return iMultipleInstances;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamaudioavailability.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamAudioAvailability class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamaudioavailability.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamAudioAvailability::TPhoneCmdParamAudioAvailability
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamAudioAvailability::TPhoneCmdParamAudioAvailability() :
+    TPhoneCommandParam()
+    {
+    iParamId = EPhoneParamIdAudioAvailable;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAudioAvailability::SetBTAccAvailable
+// Sets the BT accessory availability 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAudioAvailability::SetBTAccAvailable( 
+    TBool aState )
+    {
+    iBTAccAvailable = aState;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAudioAvailability::IsBTAccAvailable
+// Returns the BT accessory availability 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool 
+    TPhoneCmdParamAudioAvailability::IsBTAccAvailable() const
+    {
+    return iBTAccAvailable;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAudioAvailability::SetWiredAccAvailable
+// Sets the wired accessory availability
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAudioAvailability::SetWiredAccAvailable( TBool aState )
+    {
+    iWiredAccAvailable = aState;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAudioAvailability::IsWiredAccAvailable
+// Returns the wired accessory availability 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamAudioAvailability::IsWiredAccAvailable() const
+    {
+    return iWiredAccAvailable;
+    }
+
+ 
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamaudiooutput.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamAudioOutput class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamaudiooutput.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamAudioOutput::TPhoneCmdParamAudioOutput
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamAudioOutput::TPhoneCmdParamAudioOutput() :
+    TPhoneCommandParam(),
+    iAudioOutput( EPEHandset )
+    {
+    iParamId = EPhoneParamIdAudioOutput;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAudioOutput::SetAudioOutput
+// Sets the accessory mode
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamAudioOutput::SetAudioOutput( 
+    TPEAudioOutput aAudioOutput )
+    {
+    iAudioOutput = aAudioOutput;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamAudioOutput::AudioOutput
+// Returns the accessory mode
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPEAudioOutput 
+    TPhoneCmdParamAudioOutput::AudioOutput() const
+    {
+    return iAudioOutput;
+    }
+ 
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparambitmap.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamBitmap class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "tphonecmdparambitmap.h"
+#include "phoneui.pan"  
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamBitmap::TPhoneCmdParamBitmap
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamBitmap::TPhoneCmdParamBitmap() :
+    TPhoneCommandParam(),
+    iBitmap( NULL ),
+    iMaskBitmap( NULL )
+    {
+    iParamId = EPhoneParamIdBitmap;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamBitmap::SetBitmap
+// Sets the Bitmap
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamBitmap::SetBitmap( CFbsBitmap* aBitmap )
+   {
+   __ASSERT_DEBUG( aBitmap, Panic( EPhoneUtilsParameterNotInitialized ) );
+   iBitmap = aBitmap;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamBitmap::Bitmap
+// Returns the Bitmap
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CFbsBitmap* TPhoneCmdParamBitmap::Bitmap() const
+   {
+   __ASSERT_DEBUG( iBitmap, Panic( EPhoneUtilsInvariant ) );
+   return iBitmap;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamBitmap::SetMaskBitmap
+// Sets the mask bitmap
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamBitmap::SetMaskBitmap( CFbsBitmap* aMaskBitmap )
+   {
+   __ASSERT_DEBUG( aMaskBitmap, Panic( EPhoneUtilsParameterNotInitialized ) );
+   iMaskBitmap = aMaskBitmap;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamBitmap::MaskBitmap
+// Returns the mask bitmap
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CFbsBitmap* TPhoneCmdParamBitmap::MaskBitmap() const
+   {
+   return iMaskBitmap;
+   }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamboolean.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamBoolean class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "tphonecmdparamboolean.h"  
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamBoolean::TPhoneCmdParamBoolean
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamBoolean::TPhoneCmdParamBoolean() :
+    TPhoneCommandParam(),
+    iBoolean( EFalse )
+    {
+    iParamId = EPhoneParamIdBoolean;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamBoolean::SetBoolean
+// Sets the Boolean value
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamBoolean::SetBoolean( TBool aBoolean )
+   {
+   iBoolean = aBoolean;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamBoolean::Boolean
+// Returns the Boolean value
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamBoolean::Boolean() const
+   {
+   return iBoolean;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamcallheaderdata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,490 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamCallHeaderData class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    <fbs.h>
+#include "tphonecmdparamcallheaderdata.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::TPhoneCmdParamCallHeaderData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamCallHeaderData::TPhoneCmdParamCallHeaderData() :
+    TPhoneCommandParam(),
+    iLabelText( KNullDesC ),
+    iShortLabelText( KNullDesC ),
+    iCallState( 0 ),
+    iNumberType( 0 ),
+    iCiphering( EFalse ),
+    iCLIText( KNullDesC ),
+    iCNAPText( KNullDesC ),
+    iPicture( KNullDesC ),
+    iLine2 ( EFalse ),
+    iThumbnail( NULL ),
+    iCallerText( KNullDesC ),
+    iParticipantListCLI( EPhoneParticipantCLIText ),
+    iCipheringIndicatorAllowed( ETrue ),
+    iContactLink( KNullDesC8 ),
+    iRemotePhoneNumber( KNullDesC )
+    ,iDiverted( EFalse )
+    {
+    iParamId = EPhoneParamIdCallHeaderData;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetLabelText
+// Sets the call header label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetLabelText( 
+   const TDesC& aLabelText )
+    {
+    iLabelText = aLabelText;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetShortLabelText
+// Sets the call header short label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetShortLabelText( 
+   const TDesC& aShortLabelText )
+    {
+    iShortLabelText = aShortLabelText;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetCallState
+// Sets the call header call state
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetCallState( TInt aCallState )
+   {
+   iCallState = aCallState;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetCallType
+// Sets the call header call type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetCallType( TInt aCallType )
+   {
+   iCallType = aCallType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetNumberType
+// Sets the call header number type 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetNumberType( TInt aNumberType )
+   {
+   iNumberType = aNumberType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetCiphering
+// Sets the call header ciphering status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetCiphering( 
+   TBool aCiphering )
+   {
+   iCiphering = aCiphering;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetCLIText
+// Sets the call header CLI text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetCLIText( 
+   const TDesC& aCLIText,
+   TPhoneTextClippingDirection aDirection )
+   {
+   iCLIText = aCLIText;
+   iCLITextClippingDirection = aDirection; 
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetCNAPText
+// Sets the call header CNAP text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetCNAPText( 
+   const TDesC& aCNAPText,
+   TPhoneTextClippingDirection aDirection )
+   {
+   iCNAPText = aCNAPText;
+   iCNAPTextClippingDirection = aDirection; 
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetPicture
+// Sets the call header picture
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetPicture( 
+   const TDesC& aPicture )
+   {
+   iPicture.Set( aPicture );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetCallFlag
+// Sets the call flag
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetDiverted(
+    TBool aDiverted )
+    {
+    iDiverted = aDiverted;        
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetLine2
+// ---------------------------------------------------------
+//  
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetLine2(
+    TBool aLine2 )
+   {
+   iLine2 = aLine2;
+   }
+    
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::LabelText
+// Returns the call header label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamCallHeaderData::LabelText() const
+   {
+   return iLabelText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::ShortLabelText
+// Returns the call header short label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamCallHeaderData::ShortLabelText() const
+   {
+   return iShortLabelText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CallState
+// Returns the call header call state
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamCallHeaderData::CallState() const
+   {
+   return iCallState;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CallType
+// Returns the call header call type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamCallHeaderData::CallType() const
+   {
+   return iCallType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::NumberType
+// Returns the call header number type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamCallHeaderData::NumberType() const
+   {
+   return iNumberType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::Ciphering
+// Returns the call header ciphering
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamCallHeaderData::Ciphering() const
+   {
+   return iCiphering;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CLIText
+// Returns the call header CLI text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamCallHeaderData::CLIText() const
+   {
+   return iCLIText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CLITextClippingDirection
+// Returns the clipping direction of the CLI text.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection 
+TPhoneCmdParamCallHeaderData::CLITextClippingDirection() const
+    {
+    return iCLITextClippingDirection;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CNAPTextClippingDirection
+// Returns the clipping direction of the CNAP text.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection 
+TPhoneCmdParamCallHeaderData::CNAPTextClippingDirection() const
+    {
+    return iCNAPTextClippingDirection;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CNAPText
+// Returns the call header CNAP text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamCallHeaderData::CNAPText() const
+   {
+   return iCNAPText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::Picture
+// Returns the call header picture
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamCallHeaderData::Picture() const
+   {
+   return iPicture;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CallFlag
+// Returns the call flag
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamCallHeaderData::Diverted() const
+    {
+    return iDiverted;        
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::Line2
+// Returns the call header line2
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamCallHeaderData::Line2() const
+   {
+   return iLine2;
+   }
+   
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::Thumbnail
+// Returns the pointer to thumbnail image
+// ---------------------------------------------------------
+//
+EXPORT_C CFbsBitmap* TPhoneCmdParamCallHeaderData::Thumbnail() const
+   {
+   return iThumbnail;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetThumbnail
+// Sets the pointer to thumbnail image
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetThumbnail( 
+   CFbsBitmap* aThumbnail )
+   {
+   iThumbnail = aThumbnail;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CallerText
+// Returns the Caller text
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamCallHeaderData::CallerText() const
+   {
+   return iCallerText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CallerText
+// Sets the Caller text
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetCallerText( 
+   const TDesC& aCallerText )
+   {
+   iCallerText.Set( aCallerText );
+   }
+   
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetParticipantCLI
+// Sets the Caller text
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetParticipantListCLI(
+    TPhoneParticipantListCLI aCLIType )
+    {
+    iParticipantListCLI = aCLIType;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::ParticipantCLI
+// Sets the Caller text
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamCallHeaderData::TPhoneParticipantListCLI 
+    TPhoneCmdParamCallHeaderData::ParticipantCLI() const
+    {
+    return iParticipantListCLI;    
+    }       
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::HasThumbnail
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamCallHeaderData::HasThumbnail() const
+    {
+    return iHasThumbnail;
+    }    
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetHasThumbnail
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetHasThumbnail( TBool aStatus )
+    {
+    iHasThumbnail = aStatus;
+    }
+   
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetCipheringIndicatorAllowed
+// Sets the ciphering indicator allowed status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetCipheringIndicatorAllowed( 
+    TBool aAllowed )
+    {
+    iCipheringIndicatorAllowed = aAllowed;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::CipheringIndicatorAllowed
+// Returns the ciphering indicator allowed status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamCallHeaderData::CipheringIndicatorAllowed() const    
+    {
+    return iCipheringIndicatorAllowed;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetServiceId
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetServiceId( TUint32 aServiceId )
+    {
+    iServiceId = aServiceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::ServiceId
+// ---------------------------------------------------------
+//
+EXPORT_C TUint32 TPhoneCmdParamCallHeaderData::ServiceId() const
+    {
+    return iServiceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetContactLink
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetContactLink( 
+    const TDesC8& aContactLink )
+    {
+    iContactLink.Set( aContactLink );
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::ContactLink
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC8& TPhoneCmdParamCallHeaderData::ContactLink() const
+    {
+    return iContactLink;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::SetRemotePhoneNumber
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallHeaderData::SetRemotePhoneNumber( 
+    const TDesC& aPhoneNumber )
+    {
+    iRemotePhoneNumber.Set( aPhoneNumber );
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallHeaderData::RemotePhoneNumber
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamCallHeaderData::RemotePhoneNumber() const
+    {
+    return iRemotePhoneNumber;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamcallstatedata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamCallStateData class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamcallstatedata.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamCallStateData::TPhoneCmdParamCallStateData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamCallStateData::TPhoneCmdParamCallStateData() :
+    TPhoneCommandParam(),
+    iCallState( 0 ),
+    iCallId( KErrNotFound )
+    {
+    iParamId = EPhoneParamIdCallStateData;
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallStateData::SetCallState
+// Sets the call header call state
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallStateData::SetCallState( TInt aCallState )
+   {
+   iCallState = aCallState;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallStateData::CallState
+// Returns the call header call state
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamCallStateData::CallState() const
+   {
+   return iCallState;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallStateData::SetCallState
+// Sets the call id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCallStateData::SetCallId( TInt aCallId )
+   {
+   iCallId = aCallId;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCallStateData::CallId
+// Returns the call Id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamCallStateData::CallId() const
+   {
+   return iCallId;
+   }
+   
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamcustomdialer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamCustomDialer class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamcustomdialer.h"    
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamDynMenu::TPhoneCmdParamDynMenu
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamCustomDialer::TPhoneCmdParamCustomDialer() :
+    TPhoneCommandParam(),
+    iCustomDialer( NULL )
+    {
+    iParamId = EPhoneParamIdCustomDialer;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCustomDialer::SetDialerController
+// Sets the dialer controller
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamCustomDialer::SetDialerController( MPhoneDialerController* aDialerController )
+    {  
+    iCustomDialer = aDialerController;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamCustomDialer::DialerController
+// Return pointer to dialer controller
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C MPhoneDialerController* TPhoneCmdParamCustomDialer::DialerController()
+    {
+    return iCustomDialer;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamdynmenu.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamDynMenu class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamdynmenu.h"    
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamDynMenu::TPhoneCmdParamDynMenu
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamDynMenu::TPhoneCmdParamDynMenu() :
+    TPhoneCommandParam(),
+    iResourceId( 0 ), 
+    iDynMenu ( NULL )
+    {
+    iParamId = EPhoneParamIdMenu;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamDynMenu::SetResourceId
+// Sets the menu resource id.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamDynMenu::SetResourceId( 
+    TInt aResourceId )
+    {
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneUtilsParameterNotInitialized ) );
+    iResourceId = aResourceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamDynMenu::SetDynMenu
+// Sets the menu pointer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamDynMenu::SetDynMenu( TAny* aDynMenu )
+    {
+    __ASSERT_DEBUG( aDynMenu, Panic( EPhoneUtilsParameterNotInitialized ) );
+    iDynMenu = aDynMenu;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamDynMenu::ResourceId
+// Returns the Menu bar resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamDynMenu::ResourceId() const
+   {
+    __ASSERT_DEBUG( iResourceId, Panic( EPhoneUtilsInvariant ) );
+   return iResourceId;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamDynMenu::DynMenu
+// Returns the current view ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TAny* TPhoneCmdParamDynMenu::DynMenu()
+   {
+    __ASSERT_DEBUG( iDynMenu, Panic( EPhoneUtilsInvariant ) );
+   return iDynMenu;
+   }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamemergencycallheaderdata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamEmergencyCallHeaderData class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamemergencycallheaderdata.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::TPhoneCmdParamEmergencyCallHeaderData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamEmergencyCallHeaderData::
+TPhoneCmdParamEmergencyCallHeaderData() :
+    TPhoneCommandParam(),
+    iLabelText( KNullDesC ),
+    iHeaderText( KNullDesC ),
+    iCiphering( EFalse ),
+    iOwnPhoneNumberText( KNullDesC ),
+    iCipheringIndicatorAllowed( ETrue )
+    {
+    iParamId = EPhoneParamIdEmergencyCallHeaderData;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::SetLabelText
+// Sets the call header label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamEmergencyCallHeaderData::SetLabelText( 
+   const TDesC& aLabelText )
+   {
+   iLabelText.Set( aLabelText );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::SetHeaderText
+// Sets the call header text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamEmergencyCallHeaderData::SetHeaderText( 
+   const TDesC& aHeaderText )
+   {
+   iHeaderText.Set( aHeaderText );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::SetCiphering
+// Sets the call header ciphering status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamEmergencyCallHeaderData::SetCiphering( 
+   TBool aCiphering )
+   {
+   iCiphering = aCiphering;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::SetOwnPhoneNumberText
+// Sets the call header own phone number text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamEmergencyCallHeaderData::SetOwnPhoneNumberText( 
+   const TDesC& aOwnPhoneNumberText )
+   {
+   iOwnPhoneNumberText.Set( aOwnPhoneNumberText );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::LabelText
+// Returns the call header label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamEmergencyCallHeaderData::LabelText() const
+   {
+   return iLabelText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::HeaderText
+// Returns the call header text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamEmergencyCallHeaderData::HeaderText() const
+   {
+   return iHeaderText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::Ciphering
+// Returns the call header ciphering
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamEmergencyCallHeaderData::Ciphering() const
+   {
+   return iCiphering;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::OwnPhoneNumberText
+// Returns the call header own phone number text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& 
+TPhoneCmdParamEmergencyCallHeaderData::OwnPhoneNumberText() const
+   {
+   return iOwnPhoneNumberText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::SetCipheringIndicatorAllowed
+// Sets the ciphering indicator allowed status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamEmergencyCallHeaderData::SetCipheringIndicatorAllowed( 
+    TBool aAllowed )
+    {
+    iCipheringIndicatorAllowed = aAllowed;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamEmergencyCallHeaderData::CipheringIndicatorAllowed
+// Returns the ciphering indicator allowed status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamEmergencyCallHeaderData::CipheringIndicatorAllowed() const    
+    {
+    return iCipheringIndicatorAllowed;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamglobalnote.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamGlobalNote class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <avkon.hrh>
+#include "tphonecmdparamglobalnote.h"
+#include "phoneui.pan" 
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamGlobalNote::TPhoneCmdParamGlobalNote
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamGlobalNote::TPhoneCmdParamGlobalNote():
+    TPhoneCommandParam(),
+    iType( EAknGlobalErrorNote ),
+    iTextResourceId( 0 ),
+    iText( KNullDesC ),
+    iTone( EAvkonSIDErrorTone ),
+    iWaitforReady ( EFalse ),
+    iSoftkeys( 0 ),
+    iTimeout( 0 )
+    {
+    iParamId = EPhoneParamIdGlobalNote;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::SetType
+// Sets the global note type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamGlobalNote::SetType( TAknGlobalNoteType aType )
+   {
+   iType = aType;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::SetTextResourceId
+// Sets the global note resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamGlobalNote::SetTextResourceId( 
+   TInt aTextResourceId )
+   {
+    __ASSERT_DEBUG( aTextResourceId, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+   iTextResourceId = aTextResourceId;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::SetText
+// Sets the global note text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamGlobalNote::SetText( 
+   const TDesC& aText )
+   {
+   iText.Set( aText );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::SetTone
+// Sets the global note tone
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamGlobalNote::SetTone( TInt aTone )
+   {
+   iTone = aTone;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::SetWaitForReady
+// Sets the note to wait for completed
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamGlobalNote::SetWaitForReady( TBool aStatus )
+   {
+   iWaitforReady = aStatus;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::SetSoftkeys
+// Sets the global note softkeys
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamGlobalNote::SetSoftkeys( TInt aSoftkeys )
+   {
+   iSoftkeys = aSoftkeys;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::SetTimeout
+// Sets the timeout value for a note.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamGlobalNote::SetTimeout( TInt aTimeout )
+{
+    iTimeout = aTimeout;
+}
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::Type
+// Returns the global note type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TAknGlobalNoteType TPhoneCmdParamGlobalNote::Type() const
+   {
+   return iType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::TextResourceId
+// Returns the global note text resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamGlobalNote::TextResourceId() const
+   {
+   return iTextResourceId;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::Text
+// Returns the global note text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamGlobalNote::Text() const
+   {
+   return iText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::Tone
+// Returns the note tone
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamGlobalNote::Tone() const
+   {
+   return iTone;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::WaitForReady
+// Returns the status of wait for completed
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamGlobalNote::WaitForReady() const
+   {
+   return iWaitforReady;
+   }
+   
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::Softkeys
+// Returns the note softkeys
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamGlobalNote::Softkeys() const
+   {
+   return iSoftkeys;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamGlobalNote::Timeout
+// Returns the timeout value.
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamGlobalNote::Timeout() const
+    {
+    return iTimeout;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamincallindicatordata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamIncallIndicatorData class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamincallindicatordata.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::TPhoneCmdParamIncallIndicatorData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C 
+TPhoneCmdParamIncallIndicatorData::TPhoneCmdParamIncallIndicatorData() :
+    iCallState( 0 ),
+    iMode( 0 ),
+    iMute( EFalse ),
+    iCiphering( EFalse ),
+    iEmergency( EFalse ),
+    iLine2( EFalse ),
+    iLittleBubbleVisible( ETrue ), 
+    iCipheringIndicatorAllowed( ETrue )
+    {
+    iParamId = EPhoneParamIdIncallIndicatorData;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetCallState
+// Sets the incall indicator call state
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetCallState( 
+   TInt aCallState )
+   {
+   iCallState = aCallState;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetMode
+// Sets the incall indicator mode
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetMode( TInt aMode )
+   {
+   iMode = aMode;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetMute
+// Sets the incall indicator mute status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetMute( 
+   TBool aMute )
+   {
+   iMute = aMute;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetCiphering
+// Sets the incall indicator ciphering status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetCiphering( 
+   TBool aCiphering )
+   {
+   iCiphering = aCiphering;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetEmergency
+// Sets the incall indicator emergency status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetEmergency( 
+   TBool aEmergency )
+   {
+   iEmergency = aEmergency;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetMute
+// Sets the incall indicator mute status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetLine2( 
+   TBool aLine2 )
+   {
+   iLine2 = aLine2;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetLittleBubbleVisible
+// Sets the little bubble visible or hidden
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetLittleBubbleVisible( 
+   TBool aVisible )
+   {
+   iLittleBubbleVisible = aVisible;
+   }
+   
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::CallState
+// Returns the incall indicator call state
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamIncallIndicatorData::CallState() const
+   {
+   return iCallState;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::Mode
+// Returns the incall indicator mode
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamIncallIndicatorData::Mode() const
+   {
+   return iMode;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::Mute
+// Returns the incall indicator mute
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamIncallIndicatorData::Mute() const
+   {
+   return iMute;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::Ciphering
+// Returns the incall indicator ciphering status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamIncallIndicatorData::Ciphering() const
+   {
+   return iCiphering;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::Emergency
+// Returns the incall indicator emergency status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamIncallIndicatorData::Emergency() const
+   {
+   return iEmergency;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::Line2
+// Returns the incall indicator line2
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamIncallIndicatorData::Line2() const
+   {
+   return iLine2;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::LittleBubbleVisible
+// Returns the little bubble visible status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamIncallIndicatorData::LittleBubbleVisible() const
+   {
+   return iLittleBubbleVisible;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::SetCipheringIndicatorAllowed
+// Sets the ciphering indicator allowed status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamIncallIndicatorData::SetCipheringIndicatorAllowed( 
+    TBool aAllowed )
+    {
+    iCipheringIndicatorAllowed = aAllowed;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamIncallIndicatorData::CipheringIndicatorAllowed
+// Returns the ciphering indicator allowed status
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamIncallIndicatorData::CipheringIndicatorAllowed() const    
+    {
+    return iCipheringIndicatorAllowed;
+    }
+    
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparaminteger.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamInteger class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparaminteger.h"    
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamInteger::TPhoneCmdParamInteger
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamInteger::TPhoneCmdParamInteger():
+    TPhoneCommandParam(),
+    iInteger( 0 )
+    {
+    iParamId = EPhoneParamIdInteger;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamInteger::SetInteger
+// Sets the integer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamInteger::SetInteger( TInt aInteger )
+   {
+   iInteger = aInteger;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamInteger::Integer
+// Returns the integer 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamInteger::Integer() const
+   {
+   return iInteger;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamkeycapture.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamKeyCapture class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "tphonecmdparamkeycapture.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C TPhoneCmdParamKeyCapture::TPhoneCmdParamKeyCapture() :
+    TPhoneCommandParam(),
+    iKey( EStdKeyNull ),
+    iKeyCode( EKeyNull ),
+    iCaptureType( EPhoneKeyAllEvents )
+    {
+    iParamId = EPhoneParamIdKeyCapture;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyCapture::SetKey
+// Sets the key scan code
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamKeyCapture::SetKey( 
+   TStdScanCode aKey )
+   {
+   iKey = aKey;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyCapture::SetKeyCode
+// Sets the key code
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamKeyCapture::SetKeyCode( TKeyCode aKeyCode )
+   {
+   iKeyCode = aKeyCode;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyCapture::SetCaptureType
+// Sets the key capture type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamKeyCapture::SetCaptureType( 
+   TPhoneCaptureType aCaptureType )
+   {
+   iCaptureType = aCaptureType;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyCapture::Key
+// Returns the key scan code
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TStdScanCode TPhoneCmdParamKeyCapture::Key() const
+   {
+   return iKey;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyCapture::KeyCode
+// Returns the key code
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TKeyCode TPhoneCmdParamKeyCapture::KeyCode() const
+   {
+   return iKeyCode;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyCapture::CaptureType
+// Returns the key capture type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneCaptureType TPhoneCmdParamKeyCapture::CaptureType() const
+   {
+   return iCaptureType;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamkeyevent.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamKeyEvent class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "tphonecmdparamkeyevent.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C TPhoneCmdParamKeyEvent::TPhoneCmdParamKeyEvent() :
+    TPhoneCommandParam(),
+    iEventCode( EEventNull )
+    {
+    iParamId = EPhoneParamIdKeyEvent;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyEvent::SetKeyEvent
+// Sets the key event
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamKeyEvent::SetKeyEvent( const TKeyEvent& aKeyEvent )
+   {
+   iKeyEvent = aKeyEvent;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyEvent::SetEventCode
+// Sets the key event code
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamKeyEvent::SetEventCode( TEventCode aEventCode )
+   {
+   iEventCode = aEventCode;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyEvent::KeyEvent
+// Returns the key event
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TKeyEvent TPhoneCmdParamKeyEvent::KeyEvent() const
+   {
+   return iKeyEvent;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamKeyEvent::EventCode
+// Returns the key event code
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TEventCode TPhoneCmdParamKeyEvent::EventCode() const
+   {
+   return iEventCode;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparammessageeditor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamMessageEditor class.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "tphonecmdparammessageeditor.h"   
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C TPhoneCmdParamMessageEditor::TPhoneCmdParamMessageEditor() :
+    TPhoneCommandParam(),
+    iMessageData( NULL )
+    {
+    iParamId = EPhoneParamIdMessageEditor;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamMessageEditor::SetMessageData
+// Sets message data for the message editor
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamMessageEditor::SetMessageData( 
+   CMessageData* aMessageData )
+   {
+    __ASSERT_DEBUG( aMessageData,
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+   iMessageData = aMessageData;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamMessageEditor::MessageData
+// Returns message data for the message editor
+// ---------------------------------------------------------
+//
+EXPORT_C CMessageData* TPhoneCmdParamMessageEditor::MessageData() const
+   {
+    __ASSERT_DEBUG( iMessageData, Panic( EPhoneUtilsInvariant ) );
+   return iMessageData;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamnote.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamNote class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamnote.h" 
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamNote::TPhoneCmdParamNote
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamNote::TPhoneCmdParamNote():
+    TPhoneCommandParam(),
+    iType( EPhoneNoteCustom ),
+    iResourceId( 0 ),
+    iTextResourceId( 0 ),
+    iText( KNullDesC ),
+    iTone( CAknNoteDialog::ENoTone ),
+    iTimeout( CAknNoteDialog::ENoTimeout )
+    {
+    iParamId = EPhoneParamIdNote;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::SetType
+// Sets the note type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamNote::SetType( TPhoneNoteType aType )
+   {
+   iType = aType;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::SetResourceId
+// Sets the note resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamNote::SetResourceId( TInt aResourceId )
+   {
+   __ASSERT_DEBUG( aResourceId, Panic( EPhoneUtilsParameterNotInitialized ) );
+   iResourceId = aResourceId;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::SetTextResourceId
+// Sets the note text resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamNote::SetTextResourceId( TInt aTextResourceId )
+    {
+    __ASSERT_DEBUG( aTextResourceId,
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iTextResourceId = aTextResourceId;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::SetText
+// Sets the note text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamNote::SetText( const TDesC& aText )
+   {
+   iText.Set( aText );   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::SetTone
+// Sets the note tone
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamNote::SetTone( CAknNoteDialog::TTone aTone )
+   {
+   iTone = aTone;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::SetTimeout
+// Sets the note timeout
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamNote::SetTimeout( 
+   CAknNoteDialog::TTimeout aTimeout )
+   {
+   iTimeout = aTimeout;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::Type
+// Returns the note type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneNoteType TPhoneCmdParamNote::Type() const
+   {
+   return iType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::ResourceId
+// Returns the note resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamNote::ResourceId() const
+    {
+    return iResourceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::TextResourceId
+// Returns the note text resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamNote::TextResourceId() const
+    {
+    return iTextResourceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::Text
+// Returns the note text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamNote::Text() const
+   {
+   return iText;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::Tone
+// Returns the note tone
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CAknNoteDialog::TTone TPhoneCmdParamNote::Tone() const
+   {
+   return iTone;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNote::Timeout
+// Returns the note timeout
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CAknNoteDialog::TTimeout TPhoneCmdParamNote::Timeout() const
+   {
+   return iTimeout;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamnumberentryobserver.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamNumberEntryObserver class.
+*
+*/
+
+// INCLUDE FILES
+
+#include "tphonecmdparamnumberentryobserver.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+EXPORT_C TPhoneCmdParamNumberEntryObserver::TPhoneCmdParamNumberEntryObserver() :
+    TPhoneCommandParam()
+    {
+    iParamId = EPhoneNumberEntryObserver;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNumberEntryObserver::SetObserver
+// Sets the key event
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamNumberEntryObserver::SetObserver( TCallBack aCallBack )
+   {
+   iCallBack = aCallBack;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamNumberEntryObserver::Observer
+// Returns the observer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TCallBack TPhoneCmdParamNumberEntryObserver::Observer()
+   {
+   return iCallBack;
+   }
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparampointer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamPointer class.
+*
+*/
+
+// INCLUDE FILES
+#include "tphonecmdparampointer.h"    
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamPointer::TPhoneCmdParamPointer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamPointer::TPhoneCmdParamPointer():
+    TPhoneCommandParam(),
+    iPointer( NULL )
+    {
+    iParamId = EPhoneParamIdPointer;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamPointer::SetPointer
+// Sets the address pointer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamPointer::SetPointer( TAny* aPointer )
+   {
+   iPointer = aPointer;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamPointer::Pointer
+// Returns the address pointer
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TAny* TPhoneCmdParamPointer::Pointer() const
+   {
+   return iPointer;
+   }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamprogressnote.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamProgressNote class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamprogressnote.h" 
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamProgressNote::TPhoneCmdParamProgressNote
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamProgressNote::TPhoneCmdParamProgressNote():
+    TPhoneCommandParam(),
+    iResourceId( 0 ),
+    iWaitTime( 0 )
+    {
+    iParamId = EPhoneParamIdProgressNote;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamProgressNote::SetResourceId
+// Sets the note resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamProgressNote::SetResourceId( TInt aResourceId )
+    {
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneUtilsParameterNotInitialized ) );
+    iResourceId = aResourceId;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamProgressNote::SetWaitTime
+// Sets the note timeout
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamProgressNote::SetWaitTime( 
+   TTimeIntervalMicroSeconds32 aWaitTime )
+    {
+    iWaitTime = aWaitTime;   
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamProgressNote::ResourceId
+// Returns the note resource ID
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamProgressNote::ResourceId() const
+    {
+    __ASSERT_DEBUG( iResourceId, Panic( EPhoneUtilsInvariant ) );
+    return iResourceId;
+    }
+
+  // ---------------------------------------------------------
+// TPhoneCmdParamProgressNote::WaitTime
+// Returns the note timeout
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TTimeIntervalMicroSeconds32 TPhoneCmdParamProgressNote::WaitTime() const
+    {
+    return iWaitTime;
+    } 
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamquery.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,436 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamQuery class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamquery.h"
+#include "phoneui.pan"
+
+const TInt KUninitializedTimeOutCmd = -1;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamQuery::TPhoneCmdParamQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamQuery::TPhoneCmdParamQuery():
+    TPhoneCommandParam(),
+    iDialogResourceId( 0 ),
+    iDialogPrompt( KNullDesC ),
+    iDefaultCbaResourceId( 0 ), 
+    iContentCbaResourceId( 0 ), 
+    iDataText( NULL ),
+    iQueryType( EPhoneQueryDialog ),
+    iSendKeyEnabled( EFalse ),
+    iTimeOut( 0 ),
+    iTone( 0 ),
+    iCustomCmdForTimeOut( KUninitializedTimeOutCmd ),
+    iCommandObserver( NULL ),
+    iItemTextArray( NULL )
+    {
+    iParamId = EPhoneParamIdQuery;
+    }
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamQuery::TPhoneCmdParamQuery
+// C++ copy constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamQuery::TPhoneCmdParamQuery( 
+        const TPhoneCmdParamQuery& aParam )
+    {
+    iParamId = aParam.iParamId;
+    iDialogResourceId = aParam.iDialogResourceId;
+    iDialogPrompt.Set( aParam.iDialogPrompt );
+    iDefaultCbaResourceId = aParam.iDefaultCbaResourceId;
+    iContentCbaResourceId = aParam.iContentCbaResourceId;
+    iDataText = aParam.iDataText;
+    iQueryType= aParam.iQueryType;
+    iSendKeyEnabled = aParam.iSendKeyEnabled;
+    iTimeOut = aParam.iTimeOut;
+    iTone = aParam.iTone;
+    iCustomCmdForTimeOut = aParam.iCustomCmdForTimeOut;
+    iCommandObserver = aParam.iCommandObserver;
+    iItemTextArray = aParam.iItemTextArray;
+    for ( TInt i = aParam.iCbaCommandMappings.Count() - 1; 0 <= i; i-- )
+        {
+        iCbaCommandMappings[i] = aParam.iCbaCommandMappings[i];
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamQuery::operator=
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamQuery& TPhoneCmdParamQuery::operator=( 
+        const TPhoneCmdParamQuery& aParam )
+    {
+    if ( this != &aParam )
+        {
+        iParamId = aParam.iParamId;
+        iDialogResourceId = aParam.iDialogResourceId;
+        iDialogPrompt.Set( aParam.iDialogPrompt );
+        iDefaultCbaResourceId = aParam.iDefaultCbaResourceId;
+        iContentCbaResourceId = aParam.iContentCbaResourceId;
+        iDataText = aParam.iDataText;
+        iQueryType= aParam.iQueryType;
+        iSendKeyEnabled = aParam.iSendKeyEnabled;
+        iTimeOut = aParam.iTimeOut;
+        iTone = aParam.iTone;
+        iCustomCmdForTimeOut = aParam.iCustomCmdForTimeOut;
+        iCommandObserver = aParam.iCommandObserver;
+        iItemTextArray = aParam.iItemTextArray;
+        for ( TInt i = aParam.iCbaCommandMappings.Count() - 1; 0 <= i; i-- )
+            {
+            iCbaCommandMappings[i] = aParam.iCbaCommandMappings[i];
+            }
+        }
+    
+    return *this;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetQueryResourceId
+// Sets the query dialog resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetQueryResourceId( TInt aDialogResourceId )
+    {
+    __ASSERT_DEBUG( aDialogResourceId, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iDialogResourceId = aDialogResourceId;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::QueryResourceId
+// Returns the query dialog's resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamQuery::QueryResourceId() const
+    {   
+    return iDialogResourceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetQueryPrompt
+// Sets the query dialog's prompt text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetQueryPrompt( const TDesC& aDialogPrompt )
+   {
+   iDialogPrompt.Set( aDialogPrompt );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::QueryPrompt
+// Returns the query dialog's prompt text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamQuery::QueryPrompt() const
+   {
+   return iDialogPrompt;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetDefaultCba
+// Sets the default CBA resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetDefaultCba( TInt aCbaResourceId )
+   {
+   iDefaultCbaResourceId = aCbaResourceId;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::DefaultCba
+// Returns the default CBA resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamQuery::DefaultCba() const
+   {
+   return iDefaultCbaResourceId;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetContentCba
+// Sets the content CBA resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetContentCba( TInt aCbaResourceId )
+   {
+   iContentCbaResourceId = aCbaResourceId;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::ContentCba
+// Returns the content CBA resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamQuery::ContentCba() const
+   {
+   return iContentCbaResourceId;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetDataText
+// Sets the data text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetDataText( TDes* aDataText )
+    {
+    __ASSERT_DEBUG( aDataText, Panic( EPhoneUtilsParameterNotInitialized ) );
+    iDataText = aDataText;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::DataText
+// Returns the data text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TDes* TPhoneCmdParamQuery::DataText() const
+    {
+    return iDataText;
+    }
+   
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetQueryType
+// Sets the query type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetQueryType( TPhoneQueryType aQueryType )
+    {
+    iQueryType = aQueryType;        
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::QueryType
+// Returns the query type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneQueryType TPhoneCmdParamQuery::QueryType() const
+    {
+    return iQueryType;    
+    }
+    
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetSendKeyEnabled
+// Sets the send key enabled status for the query
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetSendKeyEnabled( TBool aSendKeyEnabled )
+    {
+    iSendKeyEnabled = aSendKeyEnabled;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SendKeyEnabled
+// Returns the send key enabled status for the query
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamQuery::SendKeyEnabled() const
+    {
+    return iSendKeyEnabled;    
+    }
+    
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetCommandParamId
+// Sets the query command param id
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetCommandParamId( TPhoneCommandParam::TPhoneParamId aParamId )
+   {
+   iParamId = aParamId;
+   }
+   
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetTimeOut
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetTimeOut( TInt aTimeOut )
+    {
+    iTimeOut = aTimeOut;
+    }   
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::TimeOut
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamQuery::TimeOut() const
+    {
+    return iTimeOut; 
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetTone
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetTone( TInt aTone )
+    {
+    __ASSERT_DEBUG( 0 <= aTone , Panic( EPhoneUtilsInvalidArgument ) );
+    if ( 0 <= iTone )
+        {
+        iTone = aTone;
+        }
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::Tone
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamQuery::Tone() const
+    {
+    return iTone;
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetCbaCommandMapping
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetCbaCommandMapping( 
+        TInt aCbaCommandId, TInt aCustomCommandId )
+    {
+    TCbaCommandMapping unallocatedMapping = TCbaCommandMapping();
+    TBool mappingCreated = EFalse;
+    TInt maxNumOfMappings = iCbaCommandMappings.Count();
+    
+    for ( TInt i = 0; i < maxNumOfMappings && !mappingCreated; i++ )
+        {
+        if ( iCbaCommandMappings[i] == unallocatedMapping || 
+             iCbaCommandMappings[i].CbaCommandId() == aCbaCommandId )
+            {
+            mappingCreated = ETrue;
+            TCbaCommandMapping mapping( aCbaCommandId, aCustomCommandId );
+            iCbaCommandMappings[i] = mapping;
+            }
+        }
+    
+    __ASSERT_DEBUG( mappingCreated, Panic( EPhoneUtilsIndexOutOfBounds ) );
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::CbaCommandMapping
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamQuery::CbaCommandMapping( 
+        TInt aCbaCommandId ) const
+    {
+    TInt maxNumOfMappings = iCbaCommandMappings.Count(); 
+    for ( TInt i = 0; i < maxNumOfMappings; i++ )
+        {
+        if ( iCbaCommandMappings[i].CbaCommandId() == aCbaCommandId )
+            {
+            return iCbaCommandMappings[i].CustomCommandId();
+            }
+        }
+    return aCbaCommandId;
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetCustomCommandForTimeOut
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetCustomCommandForTimeOut( 
+        TInt aCustomCommandId )
+    {
+    iCustomCmdForTimeOut = aCustomCommandId;
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::GetCustomCommandForTimeOut
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamQuery::GetCustomCommandForTimeOut( 
+        TInt& aCustomCommandId ) const
+    {
+    if ( KUninitializedTimeOutCmd == iCustomCmdForTimeOut )
+        {
+        return KErrNotFound;
+        }
+    else
+        {
+        aCustomCommandId = iCustomCmdForTimeOut;
+        return KErrNone;
+        }
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetQueryCommandObserver
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetQueryCommandObserver( 
+        MPhoneQueryCommandObserver& aObserver )
+    {
+    iCommandObserver = &aObserver;
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::QueryCommandObserver
+// ---------------------------------------------------------
+//
+EXPORT_C MPhoneQueryCommandObserver* 
+    TPhoneCmdParamQuery::QueryCommandObserver()
+    {
+    return iCommandObserver;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::SetItemTextArrayForListQuery
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamQuery::SetItemTextArrayForListQuery( 
+        MDesCArray& aItemTextArray )
+    {
+    iItemTextArray = &aItemTextArray;
+    }
+
+
+// ---------------------------------------------------------
+// TPhoneCmdParamQuery::ItemTextArrayForListQuery
+// ---------------------------------------------------------
+//
+EXPORT_C MDesCArray* TPhoneCmdParamQuery::ItemTextArrayForListQuery() const
+    {
+    return iItemTextArray;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamreconnectquery.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamReconnectQuery class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <ccauireconnectquery.h>
+
+#include "tphonecmdparamreconnectquery.h" 
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::TPhoneCmdParamReconnectQuery
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamReconnectQuery::TPhoneCmdParamReconnectQuery( 
+    MCaUiReconnectQueryObserver& aObserver ):
+    TPhoneCommandParam(),
+    iObserver( aObserver ),
+    iContactMatcher( NULL ),
+    iPhoneNumber( KNullDesC ),
+    iIncludeVideoCallOption( EFalse )
+    {
+    iParamId = EPhoneParamIdReconnectQuery;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::SetContactMatcher
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamReconnectQuery::SetContactMatcher( CPhCntMatcher* aPhCntMatcher )
+    {
+    __ASSERT_DEBUG( aPhCntMatcher, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iContactMatcher = aPhCntMatcher;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::SetPhoneNumber
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamReconnectQuery::SetPhoneNumber( const TPtrC aPhoneNumber )
+    {
+    iPhoneNumber.Set( aPhoneNumber );   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::SetIncludeVideoOption
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamReconnectQuery::SetIncludeVideoOption( 
+    const TBool aIncludeVideoCallOption )
+    {
+    iIncludeVideoCallOption = aIncludeVideoCallOption;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::ReconnectQueryObserver
+// ---------------------------------------------------------
+//
+EXPORT_C MCaUiReconnectQueryObserver& TPhoneCmdParamReconnectQuery::ReconnectQueryObserver() const
+    {
+    return iObserver;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::ContactMatcher
+// ---------------------------------------------------------
+//
+EXPORT_C CPhCntMatcher* TPhoneCmdParamReconnectQuery::ContactMatcher() const
+    {
+    return iContactMatcher;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::PhoneNumber
+// ---------------------------------------------------------
+//
+EXPORT_C const TPtrC TPhoneCmdParamReconnectQuery::PhoneNumber() const
+    {
+    return iPhoneNumber;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamReconnectQuery::IncludeVideoCallOption
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamReconnectQuery::IncludeVideoCallOption() const
+    {
+    return iIncludeVideoCallOption;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamringtone.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamRingTone class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamringtone.h" 
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamRingTone::TPhoneCmdParamRingTone
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamRingTone::TPhoneCmdParamRingTone() :
+    TPhoneCommandParam(),
+    iRingTone( KNullDesC ),
+    iTextToSay( KNullDesC ),
+    iType( EPhoneRingToneProfile ),
+    iVolume( 0 ),
+    iRingingType( 0 ),
+    iIsCallerText( EFalse ),
+    iIsCallerImage( EFalse )
+    {
+    iParamId = EPhoneParamIdRingTone;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::SetType
+// Sets the ring tone type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamRingTone::SetType( 
+   TPhoneRingToneType aType )
+   {
+   iType = aType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::SetVolume
+// Sets the ring tone volume
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamRingTone::SetVolume( TInt aVolume )
+   {
+   iVolume = aVolume;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::SetRingingType
+// Sets the ring tone ringing type 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamRingTone::SetRingingType( TInt aRingingType )
+   {
+   iRingingType = aRingingType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::SetRingTone
+// Sets the ring tone
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamRingTone::SetRingTone( const TDesC& aRingTone )
+   {
+   iRingTone.Set( aRingTone );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::SetTextToSay
+// Sets the text to say
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamRingTone::SetTextToSay( const TDesC& aTextToSay )
+   {
+   iTextToSay.Set( aTextToSay );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::Type
+// Returns the ring tone type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneRingToneType TPhoneCmdParamRingTone::Type() const
+   {
+   return iType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::Volume
+// Returns the ring tone volume
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamRingTone::Volume() const
+   {
+   return iVolume;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::RingingType
+// Returns the ring tone ringing type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamRingTone::RingingType() const
+   {
+   return iRingingType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::RingTone
+// Returns the ring tone
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamRingTone::RingTone() const
+   {
+   return iRingTone;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::TextToSay
+// Returns the text to say
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamRingTone::TextToSay() const
+   {
+   return iTextToSay;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::SetCallerTextStatus
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamRingTone::SetCallerTextStatus( TBool aStatus )
+    {
+    iIsCallerText = aStatus;
+    }
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::IsCallerText
+// 
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamRingTone::IsCallerText()
+    {
+    return iIsCallerText;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::SetCallerImageStatus
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamRingTone::SetCallerImageStatus( TBool aStatus )
+    {
+    iIsCallerImage = aStatus;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamRingTone::IsCallerImage
+//
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamRingTone::IsCallerImage()
+    {
+    return iIsCallerImage;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamsfidata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamSfiData class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamsfidata.h"   
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamSfiData::TPhoneCmdParamSfiData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamSfiData::TPhoneCmdParamSfiData() :
+    TPhoneCommandParam(),
+    iNumber( KNullDesC ),
+    iName( KNullDesC )
+    {
+    iParamId = EPhoneParamIdSfiData;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSfiData::SetLabelText
+// Sets the call header label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSfiData::SetNumber( 
+   const TDesC& aNumber )
+   {
+   iNumber.Set( aNumber );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSfiData::SetShortLabelText
+// Sets the call header short label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSfiData::SetName( 
+   const TDesC& aName )
+   {
+   iName.Set( aName );
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSfiData::LabelText
+// Returns the call header label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamSfiData::Number() const
+   {
+   return iNumber;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSfiData::ShortLabelText
+// Returns the call header short label text
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC& TPhoneCmdParamSfiData::Name() const
+   {
+   return iName;
+   }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamsingleitemfetch.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamSingleItemFetch class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamsingleitemfetch.h"
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::TPhoneCmdParamSingleItemFetch
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamSingleItemFetch::TPhoneCmdParamSingleItemFetch():
+    TPhoneCommandParam(),
+    iType( CPhCntSingleItemFetch::EFetchDtmf ),
+    iTitlePaneResourceId( 0 ), 
+    iCbaResourceId( 0 ), 
+    iString( NULL )
+    {
+    iParamId = EPhoneParamIdSingleItemFetch;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::SetType
+// Sets the single item fetch type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSingleItemFetch::SetType( 
+    CPhCntSingleItemFetch::TFetchType aType )
+    {
+    iType = aType;        
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::Type
+// Returns the single item fetch type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C CPhCntSingleItemFetch::TFetchType 
+    TPhoneCmdParamSingleItemFetch::Type()
+    {
+    return iType;    
+    }
+    
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::SetTitlePaneResourceId
+// Sets the title pane resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSingleItemFetch::SetTitlePaneResourceId( 
+   TInt aTitlePaneResourceId )
+    {
+    __ASSERT_DEBUG( aTitlePaneResourceId, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iTitlePaneResourceId = aTitlePaneResourceId;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::TitleResourceId
+// Returns the title pane resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamSingleItemFetch::TitlePaneResourceId() const
+    {
+    __ASSERT_DEBUG( iTitlePaneResourceId, 
+        Panic( EPhoneUtilsInvariant ) );
+    return iTitlePaneResourceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::SetCbaResourceId
+// Sets the single item fetch dialog CBA resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSingleItemFetch::SetCbaResourceId( 
+   TInt aCbaResourceId )
+    {
+    __ASSERT_DEBUG( aCbaResourceId, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iCbaResourceId = aCbaResourceId;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::CbaResourceId
+// Returns the single item fetch dialog CBA resource id
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamSingleItemFetch::CbaResourceId() const
+    {
+    __ASSERT_DEBUG( iCbaResourceId, 
+        Panic( EPhoneUtilsInvariant ) );
+    return iCbaResourceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::SetString
+// Sets the string for the single item fetch dialog
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSingleItemFetch::SetString( TDes* aString )
+    {
+    __ASSERT_DEBUG( aString, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iString = aString;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSingleItemFetch::String
+// Returns the string for the single item fetch dialog
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TDes* TPhoneCmdParamSingleItemFetch::String() const
+    {
+    __ASSERT_DEBUG( iString, 
+        Panic( EPhoneUtilsInvariant ) );
+    return iString;
+    }
+   
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamspeeddial.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamSpeedDial class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamspeeddial.h"   
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamSpeedDial::TPhoneCmdParamSpeedDial
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamSpeedDial::TPhoneCmdParamSpeedDial() :
+    TPhoneCommandParam(),
+    iPhoneNumber( NULL ),
+    iNumberType( EPhoneNumberTypeNotFound ),
+    iLocation( KErrNotFound ),
+    iServiceId( 0 )
+    {
+    iParamId = EPhoneParamIdSpeedDial;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::SetPhoneNumber
+// Sets the phone number.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSpeedDial::SetPhoneNumber( TPtr* aPhoneNumber )
+    {
+    __ASSERT_DEBUG( aPhoneNumber, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iPhoneNumber = aPhoneNumber;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::PhoneNumber
+// Returns the phone number.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPtr* TPhoneCmdParamSpeedDial::PhoneNumber()
+    {
+    __ASSERT_DEBUG( iPhoneNumber, 
+        Panic( EPhoneUtilsInvariant ) );
+    return iPhoneNumber;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::SetNumberType
+// Sets the phone number's type.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSpeedDial::SetNumberType( TPhoneNumberType aNumberType )
+   {
+   iNumberType = aNumberType;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::NumberType
+// Returns the phone number's type.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneNumberType TPhoneCmdParamSpeedDial::NumberType()
+   {
+   return iNumberType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::SetLocation
+// Sets the speed dial location.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSpeedDial::SetLocation( TInt aLocation )
+    {
+    __ASSERT_DEBUG( aLocation >= 0, 
+        Panic( EPhoneUtilsParameterNotInitialized ) );
+    iLocation = aLocation;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::Location
+// Returns the speed dial location.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TInt TPhoneCmdParamSpeedDial::Location()
+    {
+    __ASSERT_DEBUG( iLocation >= 0, 
+        Panic( EPhoneUtilsInvariant ) );
+    return iLocation;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::SetServiceId
+// Sets the serviceId
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSpeedDial::SetServiceId( TUint aServiceId )
+    {
+    iServiceId = aServiceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSpeedDial::ServiceId
+// Returns the serviceId
+// ---------------------------------------------------------
+//
+EXPORT_C TUint TPhoneCmdParamSpeedDial::ServiceId() const
+    {
+    return iServiceId;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamstring.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamString class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamstring.h"   
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamString::TPhoneCmdParamString
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamString::TPhoneCmdParamString() :
+    TPhoneCommandParam(),
+    iString( NULL )
+    {
+    iParamId = EPhoneParamIdString;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamString::SetString
+// Sets the string
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamString::SetString( TPtr* aString )
+    {
+    __ASSERT_DEBUG( aString, Panic( EPhoneUtilsParameterNotInitialized ) );
+    iString = aString;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamString::String
+// Returns the string
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPtr* TPhoneCmdParamString::String()
+    {
+    __ASSERT_DEBUG( iString, Panic( EPhoneUtilsInvariant ) );
+    return iString;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecmdparamtranseffect.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamTransEffect class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamtranseffect.h" 
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamTransEffect::TPhoneCmdParamTransEffect
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamTransEffect::TPhoneCmdParamTransEffect():
+    iType( EPhoneTransEffectNone )
+    {
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamTransEffect::SetType
+// Sets the note type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamTransEffect::SetType( TPhoneTransEffectType aType )
+   {
+   iType = aType;   
+   }
+
+ 
+// ---------------------------------------------------------
+// TPhoneCmdParamTransEffect::Type
+// Returns the note type
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneTransEffectType TPhoneCmdParamTransEffect::Type() const
+   {
+   return iType;
+   }
+  
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonecommandparam.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCommandParam class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecommandparam.h"
+#include "phoneui.pan"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCommandParam::TPhoneCommandParam
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCommandParam::TPhoneCommandParam()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TPhoneCommandParam::ParamId
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCommandParam::TPhoneParamId TPhoneCommandParam::ParamId() const
+    {
+    __ASSERT_DEBUG( iParamId, Panic( EPhoneUtilsInvariant ) );
+    return iParamId;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiutils/src/tphonetouchbuttonconfig.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Touch button configuration.
+*
+*/
+
+// INCLUDE FILES
+#include "cphonecenrepproxy.h"
+#include <barsread.h>
+#include <coemain.h>
+
+#include "tphonetouchbuttonconfig.h"
+#include "phoneui.pan"
+
+// CenRep keys
+const TUid KCRUidTelTouchButtonsVariation = {0x2001B2E6};
+const TUint32 KTelButtonsIncomingCall = 1;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructs and returns an application object.
+// ---------------------------------------------------------------------------
+//
+TPhoneTouchButtonConfig::TPhoneTouchButtonConfig()
+    {
+    for ( TInt i = 0; i < iConfiguration.Count(); i++ )
+        {
+        iConfiguration[i] = KErrNotFound;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReadConfiguration
+// ---------------------------------------------------------------------------
+//
+TInt TPhoneTouchButtonConfig::ReadConfiguration()
+    {
+    TFixedArray<TInt,EPhoneButtonConfigCount> keys;
+            
+    TRAPD( err,
+        {
+        // read configuration key values
+        ReadCenRepKeysL( keys );
+        // read button set resource ids
+        ReadConfigResourceL( keys );        
+        } );
+    
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// ReadCenRepKeysL
+// ---------------------------------------------------------------------------
+//
+void TPhoneTouchButtonConfig::ReadCenRepKeysL( 
+    TFixedArray<TInt,KTelButtonsConfigKeyCount>& aKeyValues ) const
+    {
+    for ( TInt i = 0; i < KTelButtonsConfigKeyCount; i ++ )
+        {
+        TInt key = MapToCenRepKey(i);
+        if ( key != KErrNotFound )
+            {
+            const TInt err = CPhoneCenRepProxy::Instance()->GetInt(
+                    KCRUidTelTouchButtonsVariation, key, aKeyValues[i] );
+            aKeyValues[i] -= 1; // map to range 0..n
+            if ( err )
+                {
+                aKeyValues[i] = 0; // default
+                }
+            }
+        else
+            {
+            aKeyValues[i] = 0; // default
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReadConfigResourceL
+// ---------------------------------------------------------------------------
+//
+void TPhoneTouchButtonConfig::ReadConfigResourceL( 
+    const TFixedArray<TInt,KTelButtonsConfigKeyCount>& /*aKeyValues*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// MapToCenRepKey
+// ---------------------------------------------------------------------------
+//
+TInt TPhoneTouchButtonConfig::MapToCenRepKey( TInt aButtons ) const
+    {
+    switch ( aButtons )
+        {
+        case EPhoneConfigIncomingCallButtons:
+            return KTelButtonsIncomingCall;
+        default:
+            return KErrNotFound;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ResourceId
+// ---------------------------------------------------------------------------
+//
+TInt TPhoneTouchButtonConfig::ResourceId(
+    TPhoneUIConfigurableButtons aButtons,
+    TInt aDefaultResourceId )  const
+    {
+    if ( iConfiguration[aButtons] != KErrNotFound )
+        {
+        return iConfiguration[aButtons];    
+        }
+    else
+        {
+        return aDefaultResourceId;
+        }
+    
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/bwins/phoneuiqtviewu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+EXPORTS
+	?setExpandAction@PhoneUIQtView@@UAEXHH@Z @ 1 NONAME ; void PhoneUIQtView::setExpandAction(int, int)
+	?keyPressed@PhoneUIQtView@@IAEXPAVQKeyEvent@@@Z @ 2 NONAME ; void PhoneUIQtView::keyPressed(class QKeyEvent *)
+	?volumeSliderChanged@PhoneUIQtView@@QAEXH@Z @ 3 NONAME ; void PhoneUIQtView::volumeSliderChanged(int)
+	?menuReference@PhoneUIQtView@@UAEAAVHbMenu@@XZ @ 4 NONAME ; class HbMenu & PhoneUIQtView::menuReference(void)
+	?qt_metacast@PhoneUIQtView@@UAEPAXPBD@Z @ 5 NONAME ; void * PhoneUIQtView::qt_metacast(char const *)
+	?clearParticipantListActions@PhoneUIQtView@@UAEXXZ @ 6 NONAME ; void PhoneUIQtView::clearParticipantListActions(void)
+	?icon@PhoneAction@@QBE?AVHbIcon@@XZ @ 7 NONAME ; class HbIcon PhoneAction::icon(void) const
+	?setBackButtonVisible@PhoneUIQtView@@UAEX_N@Z @ 8 NONAME ; void PhoneUIQtView::setBackButtonVisible(bool)
+	?addBubbleCommand@PhoneUIQtView@@UAEXHABVPhoneAction@@@Z @ 9 NONAME ; void PhoneUIQtView::addBubbleCommand(int, class PhoneAction const &)
+	?shutdownPhoneApp@PhoneUIQtView@@UAEXXZ @ 10 NONAME ; void PhoneUIQtView::shutdownPhoneApp(void)
+	?showToolbar@PhoneUIQtView@@UAEXXZ @ 11 NONAME ; void PhoneUIQtView::showToolbar(void)
+	?clearBubbleCommands@PhoneUIQtView@@UAEXH@Z @ 12 NONAME ; void PhoneUIQtView::clearBubbleCommands(int)
+	?eventFilter@PhoneUIQtView@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 13 NONAME ; bool PhoneUIQtView::eventFilter(class QObject *, class QEvent *)
+	??0PhoneUIQtView@@QAE@AAVHbMainWindow@@PAVQGraphicsItem@@@Z @ 14 NONAME ; PhoneUIQtView::PhoneUIQtView(class HbMainWindow &, class QGraphicsItem *)
+	?metaObject@PhoneUIQtView@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * PhoneUIQtView::metaObject(void) const
+	??1PhoneAction@@QAE@XZ @ 16 NONAME ; PhoneAction::~PhoneAction(void)
+	?staticMetaObject@PhoneUIQtView@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const PhoneUIQtView::staticMetaObject
+	?setText@PhoneAction@@QAEXVQString@@@Z @ 18 NONAME ; void PhoneAction::setText(class QString)
+	?setDisabled@PhoneAction@@QAEX_N@Z @ 19 NONAME ; void PhoneAction::setDisabled(bool)
+	?setCommand@PhoneAction@@QAEXH@Z @ 20 NONAME ; void PhoneAction::setCommand(int)
+	??1PhoneUIQtView@@UAE@XZ @ 21 NONAME ; PhoneUIQtView::~PhoneUIQtView(void)
+	?tr@PhoneUIQtView@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString PhoneUIQtView::tr(char const *, char const *)
+	?onEditorContentChanged@PhoneUIQtView@@QAEXXZ @ 23 NONAME ; void PhoneUIQtView::onEditorContentChanged(void)
+	?hideDialpad@PhoneUIQtView@@UAEXXZ @ 24 NONAME ; void PhoneUIQtView::hideDialpad(void)
+	?bringToForeground@PhoneUIQtView@@UAEXXZ @ 25 NONAME ; void PhoneUIQtView::bringToForeground(void)
+	?volumeSliderValue@PhoneUIQtView@@UAEHXZ @ 26 NONAME ; int PhoneUIQtView::volumeSliderValue(void)
+	?setToolbarActions@PhoneUIQtView@@UAEXABV?$QList@PAVPhoneAction@@@@@Z @ 27 NONAME ; void PhoneUIQtView::setToolbarActions(class QList<class PhoneAction *> const &)
+	?text@PhoneAction@@QBE?AVQString@@XZ @ 28 NONAME ; class QString PhoneAction::text(void) const
+	??_EPhoneUIQtView@@UAE@I@Z @ 29 NONAME ; PhoneUIQtView::~PhoneUIQtView(unsigned int)
+	?setMenuActions@PhoneUIQtView@@UAEXABV?$QList@PAVPhoneAction@@@@@Z @ 30 NONAME ; void PhoneUIQtView::setMenuActions(class QList<class PhoneAction *> const &)
+	?trUtf8@PhoneUIQtView@@SA?AVQString@@PBD0H@Z @ 31 NONAME ; class QString PhoneUIQtView::trUtf8(char const *, char const *, int)
+	?isDialpadVisible@PhoneUIQtView@@UAE_NXZ @ 32 NONAME ; bool PhoneUIQtView::isDialpadVisible(void)
+	?bubbleManager@PhoneUIQtView@@UAEAAVBubbleManagerIF@@XZ @ 33 NONAME ; class BubbleManagerIF & PhoneUIQtView::bubbleManager(void)
+	?command@PhoneUIQtView@@IAEXH@Z @ 34 NONAME ; void PhoneUIQtView::command(int)
+	?dialpadText@PhoneUIQtView@@UAE?AVQString@@XZ @ 35 NONAME ; class QString PhoneUIQtView::dialpadText(void)
+	?backButtonClicked@PhoneUIQtView@@QAEXXZ @ 36 NONAME ; void PhoneUIQtView::backButtonClicked(void)
+	?dialpadIsAboutToClose@PhoneUIQtView@@IAEXXZ @ 37 NONAME ; void PhoneUIQtView::dialpadIsAboutToClose(void)
+	?trUtf8@PhoneUIQtView@@SA?AVQString@@PBD0@Z @ 38 NONAME ; class QString PhoneUIQtView::trUtf8(char const *, char const *)
+	?tr@PhoneUIQtView@@SA?AVQString@@PBD0H@Z @ 39 NONAME ; class QString PhoneUIQtView::tr(char const *, char const *, int)
+	?createToolBarActions@PhoneUIQtView@@AAEXXZ @ 40 NONAME ; void PhoneUIQtView::createToolBarActions(void)
+	?addParticipantListAction@PhoneUIQtView@@UAEXHABVQString@@ABVHbIcon@@@Z @ 41 NONAME ; void PhoneUIQtView::addParticipantListAction(int, class QString const &, class HbIcon const &)
+	?actionRole@PhoneAction@@QBE?AW4ActionRole@1@XZ @ 42 NONAME ; enum PhoneAction::ActionRole PhoneAction::actionRole(void) const
+	?setDialpadPosition@PhoneUIQtView@@AAEXXZ @ 43 NONAME ; void PhoneUIQtView::setDialpadPosition(void)
+	?setActionRole@PhoneUIQtView@@CAXABVPhoneAction@@AAVHbAction@@@Z @ 44 NONAME ; void PhoneUIQtView::setActionRole(class PhoneAction const &, class HbAction &)
+	?command@PhoneAction@@QBEHXZ @ 45 NONAME ; int PhoneAction::command(void) const
+	?hideToolbar@PhoneUIQtView@@UAEXXZ @ 46 NONAME ; void PhoneUIQtView::hideToolbar(void)
+	?qt_metacall@PhoneUIQtView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 47 NONAME ; int PhoneUIQtView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?setActionRole@PhoneAction@@QAEXW4ActionRole@1@@Z @ 48 NONAME ; void PhoneAction::setActionRole(enum PhoneAction::ActionRole)
+	?dialpadClosed@PhoneUIQtView@@QAEXXZ @ 49 NONAME ; void PhoneUIQtView::dialpadClosed(void)
+	?removeExpandAction@PhoneUIQtView@@UAEXH@Z @ 50 NONAME ; void PhoneUIQtView::removeExpandAction(int)
+	?showDialpad@PhoneUIQtView@@UAEXXZ @ 51 NONAME ; void PhoneUIQtView::showDialpad(void)
+	?removeVolumeSlider@PhoneUIQtView@@UAEXXZ @ 52 NONAME ; void PhoneUIQtView::removeVolumeSlider(void)
+	?handleOrientationChange@PhoneUIQtView@@QAEXW4Orientation@Qt@@@Z @ 53 NONAME ; void PhoneUIQtView::handleOrientationChange(enum Qt::Orientation)
+	?setIcon@PhoneAction@@QAEXVHbIcon@@@Z @ 54 NONAME ; void PhoneAction::setIcon(class HbIcon)
+	?volumeSliderClosed@PhoneUIQtView@@QAEXXZ @ 55 NONAME ; void PhoneUIQtView::volumeSliderClosed(void)
+	?getStaticMetaObject@PhoneUIQtView@@SAABUQMetaObject@@XZ @ 56 NONAME ; struct QMetaObject const & PhoneUIQtView::getStaticMetaObject(void)
+	??0PhoneAction@@QAE@XZ @ 57 NONAME ; PhoneAction::PhoneAction(void)
+	?keyReleased@PhoneUIQtView@@IAEXPAVQKeyEvent@@@Z @ 58 NONAME ; void PhoneUIQtView::keyReleased(class QKeyEvent *)
+	?setVolumeSliderValue@PhoneUIQtView@@UAEXHHHH@Z @ 59 NONAME ; void PhoneUIQtView::setVolumeSliderValue(int, int, int, int)
+	?clearAndHideDialpad@PhoneUIQtView@@UAEXXZ @ 60 NONAME ; void PhoneUIQtView::clearAndHideDialpad(void)
+	?isDisabled@PhoneAction@@QBE_NXZ @ 61 NONAME ; bool PhoneAction::isDisabled(void) const
+	?networkNameChanged@PhoneUIQtView@@QAEXW4NetworkMode@QSystemNetworkInfo@QtMobility@@ABVQString@@@Z @ 62 NONAME ; void PhoneUIQtView::networkNameChanged(enum QtMobility::QSystemNetworkInfo::NetworkMode, class QString const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/eabi/phoneuiqtviewu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,95 @@
+EXPORTS
+	_ZN11PhoneAction10setCommandEi @ 1 NONAME
+	_ZN11PhoneAction11setDisabledEb @ 2 NONAME
+	_ZN11PhoneAction13setActionRoleENS_10ActionRoleE @ 3 NONAME
+	_ZN11PhoneAction7setIconE6HbIcon @ 4 NONAME
+	_ZN11PhoneAction7setTextE7QString @ 5 NONAME
+	_ZN11PhoneActionC1Ev @ 6 NONAME
+	_ZN11PhoneActionC2Ev @ 7 NONAME
+	_ZN11PhoneActionD1Ev @ 8 NONAME
+	_ZN11PhoneActionD2Ev @ 9 NONAME
+	_ZN13PhoneUIQtView10keyPressedEP9QKeyEvent @ 10 NONAME
+	_ZN13PhoneUIQtView11dialpadTextEv @ 11 NONAME
+	_ZN13PhoneUIQtView11eventFilterEP7QObjectP6QEvent @ 12 NONAME
+	_ZN13PhoneUIQtView11hideDialpadEv @ 13 NONAME
+	_ZN13PhoneUIQtView11hideToolbarEv @ 14 NONAME
+	_ZN13PhoneUIQtView11keyReleasedEP9QKeyEvent @ 15 NONAME
+	_ZN13PhoneUIQtView11qt_metacallEN11QMetaObject4CallEiPPv @ 16 NONAME
+	_ZN13PhoneUIQtView11qt_metacastEPKc @ 17 NONAME
+	_ZN13PhoneUIQtView11showDialpadEv @ 18 NONAME
+	_ZN13PhoneUIQtView11showToolbarEv @ 19 NONAME
+	_ZN13PhoneUIQtView13bubbleManagerEv @ 20 NONAME
+	_ZN13PhoneUIQtView13dialpadClosedEv @ 21 NONAME
+	_ZN13PhoneUIQtView13menuReferenceEv @ 22 NONAME
+	_ZN13PhoneUIQtView13setActionRoleERK11PhoneActionR8HbAction @ 23 NONAME
+	_ZN13PhoneUIQtView14setMenuActionsERK5QListIP11PhoneActionE @ 24 NONAME
+	_ZN13PhoneUIQtView15setExpandActionEii @ 25 NONAME
+	_ZN13PhoneUIQtView16addBubbleCommandEiRK11PhoneAction @ 26 NONAME
+	_ZN13PhoneUIQtView16isDialpadVisibleEv @ 27 NONAME
+	_ZN13PhoneUIQtView16shutdownPhoneAppEv @ 28 NONAME
+	_ZN13PhoneUIQtView16staticMetaObjectE @ 29 NONAME DATA 16
+	_ZN13PhoneUIQtView17backButtonClickedEv @ 30 NONAME
+	_ZN13PhoneUIQtView17bringToForegroundEv @ 31 NONAME
+	_ZN13PhoneUIQtView17setToolbarActionsERK5QListIP11PhoneActionE @ 32 NONAME
+	_ZN13PhoneUIQtView17volumeSliderValueEv @ 33 NONAME
+	_ZN13PhoneUIQtView18removeExpandActionEi @ 34 NONAME
+	_ZN13PhoneUIQtView18removeVolumeSliderEv @ 35 NONAME
+	_ZN13PhoneUIQtView18setDialpadPositionEv @ 36 NONAME
+	_ZN13PhoneUIQtView18volumeSliderClosedEv @ 37 NONAME
+	_ZN13PhoneUIQtView19clearAndHideDialpadEv @ 38 NONAME
+	_ZN13PhoneUIQtView19clearBubbleCommandsEi @ 39 NONAME
+	_ZN13PhoneUIQtView19getStaticMetaObjectEv @ 40 NONAME
+	_ZN13PhoneUIQtView19volumeSliderChangedEi @ 41 NONAME
+	_ZN13PhoneUIQtView20createToolBarActionsEv @ 42 NONAME
+	_ZN13PhoneUIQtView20setBackButtonVisibleEb @ 43 NONAME
+	_ZN13PhoneUIQtView20setVolumeSliderValueEiiii @ 44 NONAME
+	_ZN13PhoneUIQtView21dialpadIsAboutToCloseEv @ 45 NONAME
+	_ZN13PhoneUIQtView22onEditorContentChangedEv @ 46 NONAME
+	_ZN13PhoneUIQtView23handleOrientationChangeEN2Qt11OrientationE @ 47 NONAME
+	_ZN13PhoneUIQtView24addParticipantListActionEiRK7QStringRK6HbIcon @ 48 NONAME
+	_ZN13PhoneUIQtView27clearParticipantListActionsEv @ 49 NONAME
+	_ZN13PhoneUIQtView7commandEi @ 50 NONAME
+	_ZN13PhoneUIQtViewC1ER12HbMainWindowP13QGraphicsItem @ 51 NONAME
+	_ZN13PhoneUIQtViewC2ER12HbMainWindowP13QGraphicsItem @ 52 NONAME
+	_ZN13PhoneUIQtViewD0Ev @ 53 NONAME
+	_ZN13PhoneUIQtViewD1Ev @ 54 NONAME
+	_ZN13PhoneUIQtViewD2Ev @ 55 NONAME
+	_ZNK11PhoneAction10actionRoleEv @ 56 NONAME
+	_ZNK11PhoneAction10isDisabledEv @ 57 NONAME
+	_ZNK11PhoneAction4iconEv @ 58 NONAME
+	_ZNK11PhoneAction4textEv @ 59 NONAME
+	_ZNK11PhoneAction7commandEv @ 60 NONAME
+	_ZNK13PhoneUIQtView10metaObjectEv @ 61 NONAME
+	_ZTI13PhoneUIQtView @ 62 NONAME
+	_ZTV13PhoneUIQtView @ 63 NONAME
+	_ZThn16_N13PhoneUIQtViewD0Ev @ 64 NONAME
+	_ZThn16_N13PhoneUIQtViewD1Ev @ 65 NONAME
+	_ZThn28_N13PhoneUIQtView11dialpadTextEv @ 66 NONAME
+	_ZThn28_N13PhoneUIQtView11hideDialpadEv @ 67 NONAME
+	_ZThn28_N13PhoneUIQtView11hideToolbarEv @ 68 NONAME
+	_ZThn28_N13PhoneUIQtView11showDialpadEv @ 69 NONAME
+	_ZThn28_N13PhoneUIQtView11showToolbarEv @ 70 NONAME
+	_ZThn28_N13PhoneUIQtView13bubbleManagerEv @ 71 NONAME
+	_ZThn28_N13PhoneUIQtView13menuReferenceEv @ 72 NONAME
+	_ZThn28_N13PhoneUIQtView14setMenuActionsERK5QListIP11PhoneActionE @ 73 NONAME
+	_ZThn28_N13PhoneUIQtView15setExpandActionEii @ 74 NONAME
+	_ZThn28_N13PhoneUIQtView16addBubbleCommandEiRK11PhoneAction @ 75 NONAME
+	_ZThn28_N13PhoneUIQtView16isDialpadVisibleEv @ 76 NONAME
+	_ZThn28_N13PhoneUIQtView16shutdownPhoneAppEv @ 77 NONAME
+	_ZThn28_N13PhoneUIQtView17bringToForegroundEv @ 78 NONAME
+	_ZThn28_N13PhoneUIQtView17setToolbarActionsERK5QListIP11PhoneActionE @ 79 NONAME
+	_ZThn28_N13PhoneUIQtView17volumeSliderValueEv @ 80 NONAME
+	_ZThn28_N13PhoneUIQtView18removeExpandActionEi @ 81 NONAME
+	_ZThn28_N13PhoneUIQtView18removeVolumeSliderEv @ 82 NONAME
+	_ZThn28_N13PhoneUIQtView19clearAndHideDialpadEv @ 83 NONAME
+	_ZThn28_N13PhoneUIQtView19clearBubbleCommandsEi @ 84 NONAME
+	_ZThn28_N13PhoneUIQtView20setBackButtonVisibleEb @ 85 NONAME
+	_ZThn28_N13PhoneUIQtView20setVolumeSliderValueEiiii @ 86 NONAME
+	_ZThn28_N13PhoneUIQtView24addParticipantListActionEiRK7QStringRK6HbIcon @ 87 NONAME
+	_ZThn28_N13PhoneUIQtView27clearParticipantListActionsEv @ 88 NONAME
+	_ZThn8_N13PhoneUIQtViewD0Ev @ 89 NONAME
+	_ZThn8_N13PhoneUIQtViewD1Ev @ 90 NONAME
+	_ZN13PhoneUIQtView18networkNameChangedEN10QtMobility18QSystemNetworkInfo11NetworkModeERK7QString @ 91 NONAME
+	_ZN13PhoneUIQtView15windowActivatedEv @ 92 NONAME
+	_ZN13PhoneUIQtView17windowDeactivatedEv @ 93 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/inc/phoneaction.h	Fri Jun 04 10:19:18 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:  Actions and associated translated texts.
+*
+*/
+
+#ifndef PHONEACTION_H
+#define PHONEACTION_H
+
+#include <hbicon.h>
+
+#ifdef BUILD_PHONEUIQTVIEW
+#define PHONEACTION_EXPORT Q_DECL_EXPORT
+#else
+#define PHONEACTION_EXPORT Q_DECL_IMPORT
+#endif
+
+class PHONEACTION_EXPORT PhoneAction
+{
+    
+public:    
+
+    enum ActionType {
+        LeftButton = 1,
+        RightButton,
+        Text,
+        ToolbarButton1,
+        ToolbarButton2,
+        ToolbarButton3,
+        ToolbarButton4        
+    };
+    
+    enum ActionRole {
+        None,   // no specific role - default button
+        Accept, // positive action - green button
+        Decline // negative action - red button
+    };
+
+    PhoneAction ();
+    ~PhoneAction ();
+    void setText (QString text);
+    QString text () const;
+    void setCommand (int command);
+    int command () const;
+    HbIcon icon () const;
+    void setIcon (HbIcon icon);
+    void setDisabled(bool disabled);
+    bool isDisabled() const;
+    void setActionRole(ActionRole role);
+    ActionRole actionRole() const;
+    
+private:
+
+    QString m_text;
+    int m_command;
+    HbIcon m_icon;
+    bool m_disabled;
+    ActionRole m_role;
+};
+
+#endif // PHONEACTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/inc/phoneuiqtview.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,376 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone UI's Qt view.
+*
+*/
+
+#ifndef PHONEUIQTVIEW_H
+#define PHONEUIQTVIEW_H
+
+#include <QObject>
+#include <hbview.h>
+#include "phoneuiqtviewif.h"
+#include <bubblemanagerif.h>
+#include <qsysteminfo.h>
+
+class BubbleManager;
+class HbAction;
+class QSignalMapper;
+class HbToolBar;
+class HbVolumeSliderPopup;
+class Dialpad;
+class XqKeyCapture;
+
+#ifdef BUILD_PHONEUIQTVIEW
+#define PHONEUIQTVIEW_EXPORT Q_DECL_EXPORT
+#else
+#define PHONEUIQTVIEW_EXPORT Q_DECL_IMPORT
+#endif
+
+using namespace QtMobility;
+
+
+class PHONEUIQTVIEW_EXPORT PhoneUIQtView : public HbView, public PhoneUIQtViewIF
+{
+    Q_OBJECT
+
+public:
+
+    /*!
+       Constructor
+    */
+    PhoneUIQtView (HbMainWindow &window, QGraphicsItem *parent = 0);
+    
+    /*!
+       Destructor
+    */
+    virtual ~PhoneUIQtView ();
+            
+    /*!
+        \fn void PhoneUIQtView::bubbleManager ()
+        
+        Returns BubbleManager interface.
+    */
+    BubbleManagerIF& bubbleManager();
+    
+    /*!
+        \fn void PhoneUIQtView::addBubbleCommand ()
+        
+        Adds new command to bubble. Command id will be emitted as
+        a parameter from view's command(int) signal.
+    */
+    void addBubbleCommand (int bubbleId, const PhoneAction& action);
+
+    /*!
+        \fn void PhoneUIQtView::clearBubbleCommands ()
+        
+        Clears commands from bubble.
+    */
+    void clearBubbleCommands (int bubbleId);
+    
+    /*!
+        \fn void PhoneUIQtView::addParticipantListAction ()
+        
+        Adds new patricipant list command to conference bubble. 
+    */
+    void addParticipantListAction(int commandId, const QString &text, const HbIcon &icon);
+
+    /*!
+        \fn void PhoneUIQtView::clearBubbleCommands ()
+        
+        Clears participant list commands from conference bubble.
+    */
+    void clearParticipantListActions();
+    
+    /*!
+        \fn void PhoneUIQtViewIF::setToolbarActions()
+        
+       Sets toolbar actions.
+    */
+    void setToolbarActions(const QList<PhoneAction*>& actions);
+    
+    /*!
+        \fn void PhoneUIQtView::hideToolbar ()
+        
+        Hides toolbar.
+    */
+    void hideToolbar ();
+    
+    /*!
+        \fn void PhoneUIQtView::showToolbar ()
+        
+        Shows toolbar.
+    */
+    void showToolbar ();
+
+    /*!
+        \fn void PhoneUIQtView::volumeSliderValue ()
+        
+        Returns HbVolumeSliderPopup's volume value.
+        If this volume slider isn't active -1 is returned.
+    */
+    int volumeSliderValue ();
+
+    /*!
+        \fn void PhoneUIQtView::setVolumeSliderValue (int value)
+        
+        Sets slider value to HbVolumeSliderPopup.
+    */
+    void setVolumeSliderValue (
+            int value,
+            int commandId, 
+            int maxVolumeValue, 
+            int minVolumeValue);
+
+    /*!
+        \fn void PhoneUIQtView::removeVolumeSlider ()
+        
+        Removes HbVolumeSliderPopup.
+    */
+    void removeVolumeSlider ();
+
+    /*!
+        \fn void PhoneUIQtView::setExpandAction ()
+        
+        Sets expand action.
+    */
+    void setExpandAction(int bubbleId, int commandId);
+    
+        /*!
+        \fn void PhoneUIQtView::removeExpandAction ()
+        
+        Removes expand action.
+    */    
+    void removeExpandAction(int bubbleId);
+    
+    /*!
+        \fn void PhoneUIQtView::showDialpad()
+        
+        Shows dialpad widget.
+    */    
+    void showDialpad();
+    
+    /*!
+        \fn void PhoneUIQtView::hideDialpad()
+        
+        Hides dialer widget.
+    */    
+    void hideDialpad();
+    
+    /*!
+        \fn void PhoneUIQtView::isDialpadVisible()
+        
+        Checks is dialpad visible.
+    */    
+    bool isDialpadVisible();
+    
+    /*!
+        \fn void PhoneUIQtView::dialpadText()
+        
+        Returns content of the dialpad.
+    */  
+    QString dialpadText();
+    
+    /*!
+        \fn void PhoneUIQtView::dialpadString()
+        
+        Clears and hides dialpad.
+    */
+    void clearAndHideDialpad();
+    
+    /*!
+        \fn void PhoneUIQtView::bringToForeground()
+        
+        Brings to foreground.
+    */
+    void bringToForeground();
+    
+    /*!
+        \fn void PhoneUIQtViewIF::setToolbarActions()
+        
+       Sets menu actions for call handling.
+    */
+    void setMenuActions(const QList<PhoneAction*>& actions);
+    
+    /*!
+        \fn void PhoneUIQtView::setBackButtonVisible()
+        
+        Set the Back command visibility in TitleBar
+    */
+    void setBackButtonVisible(bool visible);
+    
+    /*!
+        \fn void PhoneUIQtViewIF::menuReference()
+        
+        Returns HbMenu reference.
+    */
+    HbMenu &menuReference();
+
+public slots:
+
+    /*!
+        \fn void PhoneUIQtView::volumeSliderClosed ()
+        
+        HbVolumeSliderPopup calls this method when slider
+        is going to be closed.
+    */
+    void volumeSliderClosed ();
+    
+    /*!
+        \fn void PhoneUIQtView::volumeSliderChanged (int value)
+        
+        HbVolumeSliderPopup calls this method when it's value is changed.
+    */
+    void volumeSliderChanged(int value);
+
+    /*!
+        \fn void PhoneUIQtView::handleOrientationChange(Qt::Orientation orientation)
+        
+        HbMainWindow calls this method when orientation is changed.
+    */
+    void handleOrientationChange(Qt::Orientation orientation);
+        
+    /*!
+        \fn void PhoneUIQtView::backButtonClicked(Qt::Orientation orientation)
+        
+        HbMainWindow calls this method when back softkey is clicked.
+    */    
+    void backButtonClicked();
+    
+    /*!
+        \fn void PhoneUIQtView::onEditorContentChanged()
+        
+        Dialpad calls this method when dialpad content is changed.
+    */
+    void onEditorContentChanged();
+    
+    /*!
+        \fn void dialpadClosed()
+        
+        Dialpad calls this method when dialpad is closed.
+    */
+    void dialpadClosed();
+
+    /*!
+        \fn void PhoneUIQtView::shutdownPhoneApp()
+        
+        Shutdown phone application.
+    */
+    void shutdownPhoneApp();
+    
+    /*!
+        \fn void PhoneUIQtView::networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName)
+        
+        Network name change is informed via this method.
+    */
+    void networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName);
+    
+   
+signals:
+
+    /*!
+        \fn void keyPressed (QKeyEvent *event)
+        
+        This signal is emitted when key is pressed down.
+    */
+    void keyPressed (QKeyEvent *event);
+
+    /*!
+        \fn void keyPressed (QKeyEvent *event)
+        
+        This signal is emitted when key is released.
+    */
+    void keyReleased (QKeyEvent *event);
+    
+    /*!
+        \fn void command(int command)
+        
+        This signal is emitted when UI action is handled.
+    */
+    void command (int command);
+    
+    /*!
+        \fn void dialpadIsAboutToClose()
+        
+        This signal is emitted when dialpad is about to close.
+    */
+    void dialpadIsAboutToClose();
+    
+    /*!
+         \fn void windowActivated();
+         
+         This signal is emitted when window is activated
+     */
+    void windowActivated();
+    
+    /*!
+         \fn void windowDeactivated();
+         
+         This signal is emitted when window is deactivated
+     */
+    void windowDeactivated();
+    
+protected:
+
+    /*!
+        \fn void eventFilter(int command)
+        
+        Handles key events.
+    */
+    bool eventFilter(QObject * watched, QEvent * event);
+    
+private:
+
+    /*!
+        \fn void setDialpadPosition(int command)
+        
+        Sets dialpad position.
+    */
+    void setDialpadPosition();
+
+    /*!
+        \fn void setActionRole()
+        
+        Sets action role.
+    */    
+    static void setActionRole(const PhoneAction& pa, HbAction& action);
+
+    /*!
+        \fn void createToolBarActions()
+        
+        Creates tool bar actions.
+    */
+    void createToolBarActions();
+    
+private:
+    HbMainWindow        &m_window;
+    BubbleManager       *m_bubbleManager;
+    QMap<int , QSignalMapper *> m_bubbleMap;
+    QMap<int , QList<HbAction *> *> m_bubbleActionMap;
+    QSignalMapper       *m_signalMapper;
+    QList<HbAction *>   m_toolbarActions;
+    HbVolumeSliderPopup *m_volumeSlider;
+    QSignalMapper       *m_expandSignalMapper;
+    QMap<int , HbAction*> m_expandActionMap;
+    QSignalMapper       *m_participantListSignalMapper;
+    QList<HbAction *>   m_participantListActions;
+    int                 m_volumeCommandId;
+    HbAction            *m_backAction;
+    Dialpad             *m_dialpad;
+    QSignalMapper       *m_menuSignalMapper;
+    XqKeyCapture        *m_keyCapture;
+    QSystemNetworkInfo  *m_networkInfo;
+};
+
+#endif // PHONEUIQTVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/inc/phoneuiqtviewif.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,208 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone UI Qt view's interface.
+*
+*/
+
+#ifndef PHONEUIQTVIEWIF_H
+#define PHONEUIQTVIEWIF_H
+
+#include <bubblemanagerif.h>
+
+class QKeyEvent;
+class QString;
+class HbIcon;
+class HbAction;
+class HbMenu;
+class PhoneAction;
+
+class PhoneUIQtViewIF
+{
+
+public:
+        
+    /*!
+        \fn void PhoneUIQtViewIF::bubbleManager ()
+        
+        Returns reference to BubbleManager's interface.
+    */
+    virtual BubbleManagerIF& bubbleManager () = 0;
+    
+    /*!
+        \fn void PhoneUIQtViewIF::addBubbleCommand ()
+        
+        Adds new command to bubble. Command id will be emitted as
+        a parameter from view's command(int) signal.
+    */
+    virtual void addBubbleCommand ( 
+        int bubbleId,
+        const PhoneAction& action ) = 0;
+    
+    /*!
+        \fn void PhoneUIQtViewIF::clearBubbleCommands ()
+        
+        Clears commands from bubble.
+    */
+    virtual void clearBubbleCommands (int bubbleId) = 0;
+
+    /*!
+        \fn void PhoneUIQtView::addParticipantListAction ()
+        
+        Adds new patricipant list command to conference bubble. 
+    */
+    virtual void addParticipantListAction(
+            int commandId,  
+            const QString &text, 
+            const HbIcon &icon) = 0;
+
+    /*!
+        \fn void PhoneUIQtView::clearBubbleCommands ()
+        
+        Clears participant list commands from conference bubble.
+    */
+    virtual void clearParticipantListActions() = 0;
+    
+    /*!
+        \fn void PhoneUIQtViewIF::setToolbarActions()
+        
+        Sets toolbar actions.
+    */
+    virtual void setToolbarActions(const QList<PhoneAction*>& actions) = 0;    
+    
+    /*!
+        \fn void PhoneUIQtViewIF::hideToolbar ()
+        
+        Hides toolbar.
+    */
+    virtual void hideToolbar () = 0;
+    
+    /*!
+        \fn void PhoneUIQtViewIF::showToolbar ()
+        
+        Shows toolbar.
+    */
+    virtual void showToolbar () = 0;
+    
+    /*!
+        \fn int PhoneUIQtViewIF::volumeSliderValue ()
+        
+        Returns HbVolumeSliderPopup's volume value.
+        If this volume slider isn't active -1 is returned.
+    */
+    virtual int volumeSliderValue () = 0;
+    
+    /*!
+        \fn void PhoneUIQtViewIF::removeVolumeSlider ()
+        
+        Removes HbVolumeSliderPopup.
+    */
+    virtual void removeVolumeSlider () = 0;
+
+    /*!
+        \fn void PhoneUIQtViewIF::setVolumeSliderValue (int value)
+        
+        Sets slider value to HbVolumeSliderPopup.
+    */
+    virtual void setVolumeSliderValue (
+            int value, 
+            int commandId, 
+            int maxVolumeValue, 
+            int minVolumeValue) = 0;
+
+    /*!
+        \fn void PhoneUIQtViewIF::setExpandAction ()
+        
+        Sets expand action.
+    */
+    virtual void setExpandAction(int bubbleId, int commandId) = 0;
+    
+    /*!
+        \fn void PhoneUIQtViewIF::removeExpandAction ()
+        
+        Removes expand action.
+    */      
+    virtual void removeExpandAction(int bubbleId) = 0;
+
+    /*!
+        \fn void PhoneUIQtView::showDialpad()
+        
+        Shows dialpad widget.
+    */    
+    virtual void showDialpad() = 0;
+    
+    /*!
+        \fn void PhoneUIQtView::hideDialpad()
+        
+        Hides dialpad widget.
+    */    
+    virtual void hideDialpad() = 0;
+    
+    /*!
+        \fn void PhoneUIQtView::isDialpadVisible()
+        
+        Check is dialpad visible.
+    */    
+    virtual bool isDialpadVisible() = 0;
+
+    /*!
+        \fn void PhoneUIQtView::dialpadString()
+        
+        Returns content of the dialpad.
+    */  
+    virtual QString dialpadText() = 0;
+    
+    /*!
+        \fn void PhoneUIQtView::dialpadString()
+        
+        Clears and hides dialpad.
+    */
+    virtual void clearAndHideDialpad() = 0;
+    
+    /*!
+        \fn void PhoneUIQtView::bringToForeground()
+        
+        Brings to foreground.
+    */
+    virtual void bringToForeground() = 0;
+    
+    /*!
+        \fn void PhoneUIQtViewIF::setToolbarActions()
+        
+       Sets menu actions.
+    */
+    virtual void setMenuActions(const QList<PhoneAction*>& actions) = 0;
+      
+    /*!
+        \fn void PhoneUIQtView::shutdownPhoneApp()
+        
+        Shutdown phone application.
+    */
+    virtual void shutdownPhoneApp() = 0;
+    
+    /*
+       \fn void PhoneUIQtView::setBackButtonVisible()
+       
+       Set the Back command visibility in TitleBar
+    */
+    virtual void setBackButtonVisible(bool visible) = 0;
+	    
+    /*!
+        \fn void PhoneUIQtViewIF::setToolbarActions()
+        
+       Returns HbMenu reference.
+    */
+    virtual HbMenu &menuReference() = 0;
+};
+
+#endif // PHONEUIQTVIEWIF_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/phoneuiqtview.pri	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+HEADERS += ./inc/phoneuiqtviewif.h
+HEADERS += ./inc/phoneuiqtview.h
+HEADERS += ./inc/phoneaction.h
+
+SOURCES += ./src/phoneuiqtview.cpp
+SOURCES += ./src/phoneaction.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/phoneuiview2.pro	Fri Jun 04 10:19:18 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: Project file for building Phone qt view component
+#
+#
+
+TEMPLATE = lib
+TARGET = phoneuiqtview
+CONFIG += hb mobility
+MOBILITY += systeminfo
+
+symbian {
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA =1
+    TARGET.UID3 = 0x101F4D18
+    DEFINES += FT_SYMBIAN_INTEGRATION
+    DEFINES += BUILD_PHONEUIQTVIEW
+    
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    INCLUDEPATH += ../../inc \
+                   ../phoneuiutils/inc
+
+    LIBS += -lphoneuiutils \
+            -lbubblemanager2 \
+            -lxqserviceutil \
+            -ldialpad \
+            -lxqkeycapture
+
+    defFiles = \
+        "$${LITERAL_HASH}ifdef WINS" \
+            "DEFFILE bwins/phoneuiqtview.def" \
+        "$${LITERAL_HASH}else" \
+            "DEFFILE eabi/phoneuiqtview.def" \
+        "$${LITERAL_HASH}endif"
+    
+    MMP_RULES += defFiles
+}
+
+# Input
+include(phoneuiqtview.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/src/phoneaction.cpp	Fri Jun 04 10:19:18 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:  Actions and associated translated texts.
+*
+*/
+
+#include "phoneaction.h"
+
+PhoneAction::PhoneAction () : 
+    m_text (QString ()), m_command (-1), m_icon (HbIcon ()), m_disabled(false),
+    m_role(PhoneAction::None)
+{
+}
+
+PhoneAction::~PhoneAction ()
+{
+}
+
+QString PhoneAction::text () const
+{
+    return m_text;
+}
+
+void PhoneAction::setText (QString text)
+{
+    m_text = text;
+}
+
+int PhoneAction::command () const
+{
+    return m_command;
+}
+
+void PhoneAction::setCommand (int command)
+{
+    m_command = command;
+}
+
+HbIcon PhoneAction::icon () const
+{
+    return m_icon;
+}
+
+void PhoneAction::setIcon (HbIcon icon)
+{
+    m_icon = icon;
+}
+
+void PhoneAction::setDisabled(bool disabled)
+{
+    m_disabled = disabled;
+}
+
+bool PhoneAction::isDisabled() const
+{
+    return m_disabled;
+}
+
+void PhoneAction::setActionRole(ActionRole role)
+{
+    m_role = role;
+}
+
+PhoneAction::ActionRole PhoneAction::actionRole() const
+{
+    return m_role;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/src/phoneuiqtview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,522 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone UI's Qt view.
+*
+*/
+#include <hbinstance.h>
+#include <QSignalMapper>
+#include <hbaction.h>
+#include <hbtoolbar.h>
+#include <hbvolumesliderpopup.h>
+#include <hbnamespace.h>
+#include <bubblemanager2.h>
+#include <hblineedit.h>
+#include <hbmenu.h>
+
+#include <xqserviceutil.h>
+#include <xqkeycapture.h>
+#include <dialpad.h>
+
+#include "phoneuiqtview.h"
+#include "phoneaction.h"
+#include "qtphonelog.h"
+
+PhoneUIQtView::PhoneUIQtView (HbMainWindow &window, QGraphicsItem *parent) :
+    HbView (parent),
+    m_window(window),
+    m_volumeSlider (0),
+    m_expandSignalMapper(0),
+    m_participantListSignalMapper(0),
+    m_volumeCommandId(0),
+    m_keyCapture(0),
+    m_networkInfo(0)
+{
+    // Set network name
+    m_networkInfo = new QSystemNetworkInfo(this);
+    QString networkName = m_networkInfo->networkName(QSystemNetworkInfo::GsmMode);
+    connect(m_networkInfo, SIGNAL (networkNameChanged(QSystemNetworkInfo::NetworkMode,QString)), this, SLOT(networkNameChanged(QSystemNetworkInfo::NetworkMode, QString)));
+    setTitle(networkName);
+
+    // Capturing long press of end key
+    m_keyCapture = new XqKeyCapture();
+    m_keyCapture->captureLongKey(Qt::Key_No);
+    m_keyCapture->captureKey(Qt::Key_No);
+    
+    // Dialpad
+    m_dialpad = new Dialpad(m_window);
+    m_dialpad->setCallButtonEnabled(false);
+    m_dialpad->setTapOutsideDismiss(true);
+    connect(&m_dialpad->editor(),SIGNAL(contentsChanged()),
+            SLOT(onEditorContentChanged()));
+    connect(m_dialpad,SIGNAL(aboutToClose()),this,
+                SLOT(dialpadClosed()));
+                
+    // Call handling widget
+    m_bubbleManager = new BubbleManager (this);
+    setWidget(m_bubbleManager);
+
+    // Set event filter
+    m_window.installEventFilter(this);
+
+    m_signalMapper = new QSignalMapper (this);
+    connect(m_signalMapper, SIGNAL (mapped (int)), this, SIGNAL (command (int)));
+    connect(&m_window,SIGNAL(orientationChanged(Qt::Orientation)),
+            this,SLOT(handleOrientationChange(Qt::Orientation)));
+
+    m_menuSignalMapper = new QSignalMapper(this);
+    connect(m_menuSignalMapper, SIGNAL(mapped(int)), this, SIGNAL(command(int)));
+
+    m_bubbleManager->handleOrientationChange(m_window.orientation());
+
+    // change exit softkey to back button
+    m_backAction = new HbAction(Hb::BackNaviAction, this);
+    connect(m_backAction, SIGNAL(triggered()), this, SLOT(backButtonClicked()));
+    setNavigationAction(m_backAction);
+
+    createToolBarActions();
+}
+
+PhoneUIQtView::~PhoneUIQtView ()
+{
+
+    foreach (HbAction *action, m_toolbarActions ) {
+        delete action;
+    }
+    m_window.removeEventFilter(this);
+    delete m_volumeSlider;
+    delete m_dialpad;
+}
+
+BubbleManagerIF& PhoneUIQtView::bubbleManager()
+{
+    return *m_bubbleManager;
+}
+
+void PhoneUIQtView::addBubbleCommand (
+    int bubbleId,
+    const PhoneAction& action )
+{
+    HbAction* bubbleAction = new HbAction ();
+    bubbleAction->setText (action.text());
+    bubbleAction->setIcon (action.icon());
+    setActionRole(action,*bubbleAction);
+    m_bubbleManager->addAction (bubbleId, bubbleAction);
+
+    QList<int> bubbles = m_bubbleMap.keys();
+    bool found(false);
+
+    for ( int i=0; i<bubbles.size(); ++i ) {
+        if (bubbleId==bubbles[i]){
+            connect(bubbleAction, SIGNAL (triggered ()), m_bubbleMap.value(bubbleId), SLOT (map ()));
+            m_bubbleMap.value(bubbleId)->setMapping(bubbleAction, action.command());
+            m_bubbleActionMap.value(bubbleId)->append(bubbleAction);
+            found = true;
+        }
+    }
+
+    if (!found) {
+        QSignalMapper *mapper = new QSignalMapper();
+        connect(mapper, SIGNAL (mapped (int)), this, SIGNAL (command (int)));
+        connect(bubbleAction, SIGNAL (triggered ()), mapper, SLOT (map ()));
+        mapper->setMapping (bubbleAction, action.command());
+        QList<HbAction *> *actionList = new QList<HbAction *>();
+        actionList->append( bubbleAction );
+        m_bubbleActionMap.insert(bubbleId,actionList);
+        m_bubbleMap.insert(bubbleId,mapper);
+    }
+}
+
+void PhoneUIQtView::addParticipantListAction(
+    int commandId,
+    const QString& text,
+    const HbIcon& icon)
+{
+    HbAction* action = new HbAction ();
+    action->setText (text);
+    action->setIcon (icon);
+    m_bubbleManager->addParticipantListAction(action);
+
+    if (!m_participantListSignalMapper) {
+        m_participantListSignalMapper = new QSignalMapper();
+        connect(m_participantListSignalMapper, SIGNAL (mapped (int)), this, SIGNAL (command (int)));
+    }
+
+    connect(action, SIGNAL (triggered ()), m_participantListSignalMapper, SLOT (map ()));
+    m_participantListSignalMapper->setMapping (action, commandId);
+    m_participantListActions.append( action );
+}
+
+void PhoneUIQtView::clearParticipantListActions()
+{
+
+    if (m_participantListSignalMapper) {
+        m_bubbleManager->clearParticipantListActions();
+
+        foreach (HbAction *action, m_participantListActions ) {
+            m_participantListSignalMapper->removeMappings(action);
+            delete action;
+        }
+
+        m_participantListActions.clear();
+        delete m_participantListSignalMapper;
+        m_participantListSignalMapper = 0;
+    }
+
+}
+
+void PhoneUIQtView::clearBubbleCommands (int bubbleId)
+{
+    m_bubbleManager->clearActions (bubbleId);
+    QSignalMapper *mapper = m_bubbleMap.value(bubbleId);
+
+    if (mapper) {
+        QList<HbAction *> *actions = m_bubbleActionMap.value(bubbleId);
+
+        foreach (HbAction *action, *actions ) {
+            mapper->removeMappings(action);
+            delete action;
+        }
+
+        actions->clear();
+        m_bubbleMap.remove(bubbleId);
+        m_bubbleActionMap.remove(bubbleId);
+        delete mapper;
+        delete actions;
+    }
+
+}
+
+void PhoneUIQtView::setToolbarActions(const QList<PhoneAction*>& actions)
+{
+    // clear current toolbar actions
+    for (int i=0;i<toolBar()->actions().count();++i) {
+        m_signalMapper->removeMappings(
+                static_cast<HbAction*>(toolBar()->actions().at(i)));
+    }
+
+    QList<QAction*> toolBarActions = toolBar()->actions();
+
+    if (toolBarActions.size()<actions.size()) {
+        for (int i=toolBarActions.size(); i<actions.size(); ++i) {
+            toolBar()->addAction(m_toolbarActions.at(i));
+        }
+    } else if (toolBarActions.size()>actions.size()) {
+        for (int i=toolBarActions.size(); 0<i; --i) {
+            if (i>actions.size()) {
+                HbAction* action = static_cast<HbAction*>(toolBarActions.at(i-1));
+                toolBar()->removeAction(action);
+            }
+        }
+    }
+
+    for (int i=0; i<toolBar()->actions().size(); ++i) {
+
+        if (i<actions.count()) {
+            HbAction* action = static_cast<HbAction*>(toolBar()->actions().at(i));
+            action->setText(actions.at(i)->text());
+            action->setIcon(actions.at(i)->icon());
+            action->setDisabled(actions.at(i)->isDisabled());
+
+            m_signalMapper->setMapping(action, actions.at(i)->command());
+        }
+    }
+
+    if ( m_window.orientation() == Qt::Horizontal ) {
+        toolBar()->setOrientation(Qt::Horizontal);
+    }
+    // update toolbar
+    toolBar()->update();
+}
+
+void PhoneUIQtView::hideToolbar ()
+{
+    toolBar()->hide ();
+}
+
+void PhoneUIQtView::showToolbar ()
+{
+    setFocus();
+    toolBar()->show();
+}
+
+int PhoneUIQtView::volumeSliderValue ()
+{
+    if (m_volumeSlider) {
+        return m_volumeSlider->value ();
+    } else {
+        return -1;
+    }
+}
+
+void PhoneUIQtView::removeVolumeSlider ()
+{
+    if (m_volumeSlider) {
+        if (m_volumeSlider->isVisible()) {
+            m_volumeSlider->hide();
+        }
+        m_volumeSlider->deleteLater();
+        m_volumeSlider = 0;
+    }
+}
+
+void PhoneUIQtView::volumeSliderClosed ()
+{
+    removeVolumeSlider();
+}
+
+void PhoneUIQtView::setVolumeSliderValue (
+        int value, int commandId, int maxVolumeValue, int minVolumeValue)
+{
+    m_volumeCommandId = commandId;
+
+    if (!m_volumeSlider) {
+        m_volumeSlider = new HbVolumeSliderPopup ();
+        m_volumeSlider->setDismissPolicy(HbDialog::TapOutside);
+        m_volumeSlider->setTimeout (10000); // TODO: 10 seconds for now, replace with correct value when spec is ready and says what it is
+        connect(m_volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(volumeSliderChanged(int)));
+        connect(m_volumeSlider, SIGNAL(aboutToClose()), this, SLOT(volumeSliderClosed()));
+    }
+
+
+    if (m_volumeSlider->minimum() != minVolumeValue ||
+            m_volumeSlider->maximum() !=  maxVolumeValue  ) {
+        m_volumeSlider->setRange (minVolumeValue, maxVolumeValue);
+    }
+
+    if (value != m_volumeSlider->value())
+        m_volumeSlider->setValue (value);
+
+    if (false == m_volumeSlider->isVisible()) {
+        m_volumeSlider->show();
+    }
+}
+
+void PhoneUIQtView::volumeSliderChanged(int value)
+{
+    Q_UNUSED (value);
+    emit command (m_volumeCommandId);
+}
+
+void PhoneUIQtView::setExpandAction(int bubbleId, int commandId)
+{
+    removeExpandAction(bubbleId);
+
+    HbAction* action = new HbAction();
+    m_bubbleManager->setExpandAction(bubbleId, action);
+
+    if (!m_expandSignalMapper) {
+        m_expandSignalMapper = new QSignalMapper(this);
+        connect(m_expandSignalMapper, SIGNAL (mapped (int)),
+                this, SIGNAL (command (int)));
+    }
+
+    connect(action, SIGNAL (triggered ()), m_expandSignalMapper, SLOT (map ()));
+    m_expandSignalMapper->setMapping(action, commandId);
+
+    m_expandActionMap.insert(bubbleId,action);
+}
+
+void PhoneUIQtView::removeExpandAction(int bubbleId)
+{
+    if (m_expandActionMap.contains(bubbleId)) {
+        m_bubbleManager->setExpandAction(bubbleId, 0);
+        HbAction* action = m_expandActionMap.value(bubbleId);
+        m_expandSignalMapper->removeMappings(action);
+        m_expandActionMap.remove(bubbleId);
+        delete action;
+    }
+}
+
+void PhoneUIQtView::showDialpad()
+{
+    if (false == m_dialpad->isVisible()) {
+        setDialpadPosition();
+        m_dialpad->openDialpad();
+    }
+}
+
+void PhoneUIQtView::hideDialpad()
+{
+    if (true == m_dialpad->isVisible())
+        m_dialpad->closeDialpad();
+}
+
+bool PhoneUIQtView::isDialpadVisible()
+{
+    return m_dialpad->isVisible();
+}
+
+QString PhoneUIQtView::dialpadText()
+{
+    return m_dialpad->editor().text();
+}
+
+void PhoneUIQtView::clearAndHideDialpad()
+{
+    m_dialpad->editor().setText(QString(""));
+    hideDialpad();
+}
+
+void PhoneUIQtView::bringToForeground()
+{
+    m_window.show();
+    m_window.raise();
+}
+
+void PhoneUIQtView::setMenuActions(const QList<PhoneAction*>& actions)
+{
+
+    for (int i=menu()->actions().count(); 0<i; --i) {
+        HbAction* action = static_cast<HbAction*>(menu()->actions().at(i-1));
+        m_menuSignalMapper->removeMappings(action);
+        menu()->removeAction(action);
+        delete action;
+    }
+
+    for (int i=0; i<actions.count(); ++i) {
+        HbAction* action = new HbAction();
+        action->setText(actions.at(i)->text());
+        menu()->addAction(action);
+        connect(action, SIGNAL(triggered()), m_menuSignalMapper, SLOT(map()));
+        m_menuSignalMapper->setMapping(action, actions.at(i)->command());
+    }
+
+}
+
+HbMenu &PhoneUIQtView::menuReference()
+{
+    return *menu();
+}
+
+void PhoneUIQtView::handleOrientationChange(Qt::Orientation orientation)
+{
+    if (orientation==Qt::Horizontal) {
+        toolBar()->setOrientation(Qt::Horizontal);
+    }
+
+    m_bubbleManager->handleOrientationChange(orientation);
+
+    setDialpadPosition();
+}
+
+void PhoneUIQtView::backButtonClicked()
+{
+    XQServiceUtil::toBackground(true);
+}
+
+void PhoneUIQtView::onEditorContentChanged()
+{
+    m_dialpad->setCallButtonEnabled(
+        m_dialpad->editor().text().length());
+}
+
+void PhoneUIQtView::dialpadClosed()
+{
+    emit dialpadIsAboutToClose();
+}
+
+bool PhoneUIQtView::eventFilter(QObject * /*watched*/, QEvent * event)
+{
+    PHONE_DEBUG2("PhoneUIQtView::eventFilter event type:", event->type());
+    if(event->type() == QEvent::KeyPress) {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        PHONE_DEBUG2("PhoneUIQtView::eventFilter pressed key:", keyEvent->key());
+        PHONE_DEBUG2("PhoneUIQtView::eventFilter isAutoRepeat:", keyEvent->isAutoRepeat());
+        emit keyPressed(keyEvent);        
+        keyEvent->accept();
+        
+        return false;
+    } else if(event->type() == QEvent::KeyRelease) {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        PHONE_DEBUG2("PhoneUIQtView::eventFilter released key:", keyEvent->key());
+        emit keyReleased(keyEvent);
+        keyEvent->accept();
+        
+        return false;
+    } else if (event->type() == QEvent::WindowActivate){
+        PHONE_DEBUG("PhoneUIQtView::eventFilter WindowActivate");
+        emit windowActivated();
+        return false;
+    } else if (event->type() == QEvent::WindowDeactivate){
+        PHONE_DEBUG("PhoneUIQtView::eventFilter WindowDeactivate");
+        emit windowDeactivated();
+        return false;
+    }else{
+        return false;
+    }
+}
+
+void PhoneUIQtView::setDialpadPosition()
+{
+    // workaround to tsw error JMKN-83NAPU (fix coming in MCL wk14)
+    // QRectF screenRect(m_window.layoutRect());
+    QRectF screenRect = (m_window.orientation() == Qt::Horizontal) ?
+                        QRectF(0,0,640,360) : QRectF(0,0,360,640);
+                        	
+    if (m_window.orientation() == Qt::Horizontal) {
+            // dialpad takes half of the screen
+        m_dialpad->setPos(QPointF(screenRect.width()/2,
+                                  this->scenePos().y()));
+        m_dialpad->setPreferredSize(screenRect.width()/2,
+                                           (screenRect.height()-scenePos().y()));
+    } else {
+        // dialpad takes 65% of the screen height
+        qreal screenHeight = screenRect.height();
+        m_dialpad->setPos(QPointF(0,
+                                  screenHeight/2.25));
+        m_dialpad->setPreferredSize(screenRect.width(),
+                                    screenHeight-screenHeight/2.25);
+    }
+}
+
+void PhoneUIQtView::setActionRole(const PhoneAction& pa, HbAction& action)
+{
+    if (pa.actionRole()==PhoneAction::Accept) {
+        action.setSoftKeyRole(QAction::PositiveSoftKey);
+    } else if (pa.actionRole()==PhoneAction::Decline) {
+        action.setSoftKeyRole(QAction::NegativeSoftKey);
+    }
+}
+
+void PhoneUIQtView::createToolBarActions()
+{
+    for (int i=0;i<4;++i) {
+        HbAction* action = new HbAction();
+        connect(action, SIGNAL(triggered()), m_signalMapper, SLOT(map()));
+        m_toolbarActions.append(action);
+    }
+}
+
+void PhoneUIQtView::shutdownPhoneApp()
+{
+    PHONE_DEBUG("PhoneUIQtView::shutdownPhoneApp");
+    QCoreApplication::quit();
+}
+
+void PhoneUIQtView::setBackButtonVisible(bool visible)
+{
+    if (visible) {
+        setNavigationAction(m_backAction);
+        }
+    else {
+        setNavigationAction(0);
+    }
+}
+
+void PhoneUIQtView::networkNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName)
+{
+    if(mode == QSystemNetworkInfo::GsmMode) {
+        setTitle(netName);
+    }	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/runtests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+del \epoc32\winscw\c\private\ea9bef3f\ut_phoneuiqtview.log
+\epoc32\release\winscw\udeb\ut_phoneuiqtview.exe -o ut_phoneuiqtview.log
+type \epoc32\winscw\c\private\ea9bef3f\ut_phoneuiqtview.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/unit.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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
+SUBDIRS += ut_phoneuiqtview
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbtoolbar.cpp	Fri Jun 04 10:19:18 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: 
+*
+*/
+#include "hbtoolbar.h"
+#include <hbaction.h>
+
+bool m_clearCalled;
+bool m_hideCalled;
+bool m_showCalled;
+bool m_clearActionsCalled;
+bool m_setOrientationCalled;
+bool m_toolBarUpdateCalled;
+HbAction *m_action;
+QList<QAction*> m_actions;
+
+HbToolBar::HbToolBar (QObject *parent)
+{
+    Q_UNUSED (parent);
+    reset ();
+}
+
+void HbToolBar::reset ()
+{
+    m_clearCalled = false;
+    m_hideCalled = false;
+    m_showCalled = false;
+    m_clearActionsCalled = false;
+    m_toolBarUpdateCalled = false;
+    m_action = 0;
+}
+
+void HbToolBar::clear ()
+{
+    m_clearCalled = true;	
+}
+
+void HbToolBar::hide ()
+{
+    m_hideCalled = true;	
+}
+
+void HbToolBar::show ()
+{
+    m_showCalled = true;
+}
+
+void HbToolBar::addAction (HbAction *action)
+{
+    m_action = action;
+    m_actions.append(action);
+}
+
+void HbToolBar::clearActions ()
+{
+    m_clearActionsCalled = true;
+}
+
+void HbToolBar::setOrientation(Qt::Orientation orientation)
+{
+    m_setOrientationCalled = true;
+}
+
+void HbToolBar::removeAction(HbAction *action)
+{
+    m_actions.removeOne(action);
+}
+
+QList<QAction*> HbToolBar::actions() const
+{
+    return m_actions;	
+}
+
+void HbToolBar::update()
+{
+    m_toolBarUpdateCalled = true;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbtoolbar.h	Fri Jun 04 10:19:18 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 HBTOOLBAR_H
+#define HBTOOLBAR_H
+
+#include <QObject>
+#include <QAction>
+
+class HbAction;
+
+extern bool m_clearCalled;
+extern bool m_hideCalled;
+extern bool m_showCalled;
+extern bool m_clearActionsCalled;
+extern bool m_setOrientationCalled;
+extern bool m_toolBarUpdateCalled;
+extern HbAction *m_action;
+extern QList<QAction*> m_actions;
+
+
+class HbToolBar : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    HbToolBar (QObject *parent = 0);    
+    virtual ~HbToolBar () {};
+    void reset ();
+    void clear ();
+    void hide ();
+    void show ();
+    void addAction (HbAction *action);
+    void clearActions ();
+    void setOrientation(Qt::Orientation orientation);
+    void removeAction(HbAction *action);
+    QList<QAction*> actions() const;
+    void update();
+
+private:
+    
+};
+
+#endif // HBTOOLBAR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbvolumesliderpopup.cpp	Fri Jun 04 10:19:18 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: 
+*
+*/
+
+#include "hbvolumesliderpopup.h"
+
+bool m_volumeSliderContructorCalled;
+bool m_volumeSliderDesctructorCalled;
+int m_sliderValue;
+int m_sliderRangeMin;
+int m_sliderRangeMax;
+bool m_volumeSliderSetValueCalled;
+bool m_volumeSliderValueCalled;
+bool m_volumeSliderSetRangeCalled;
+bool m_volumeSliderSetTimeoutCalled;
+int m_sliderTimeout;
+bool m_volumeSliderShowCalled;
+bool m_isVisible;
+bool m_volumeSliderHideCalled;
+
+HbVolumeSliderPopup::HbVolumeSliderPopup ()
+{
+    m_volumeSliderContructorCalled = true;
+    m_volumeSliderDesctructorCalled = false;
+    m_sliderValue = -1;
+    m_sliderRangeMin = -1;
+    m_sliderRangeMax = -1;
+    m_volumeSliderSetValueCalled = false;
+    m_volumeSliderValueCalled = false;
+    m_volumeSliderSetRangeCalled = false;
+    m_volumeSliderSetTimeoutCalled = false;
+    m_sliderTimeout = -1;
+    m_volumeSliderShowCalled = false;
+}
+
+HbVolumeSliderPopup::~HbVolumeSliderPopup ()
+{
+    m_volumeSliderDesctructorCalled = true;
+    m_volumeSliderContructorCalled = false;
+    m_sliderValue = -1;
+    m_sliderRangeMin = -1;
+    m_sliderRangeMax = -1;
+    m_volumeSliderSetValueCalled = false;
+    m_volumeSliderValueCalled = false;
+    m_volumeSliderSetRangeCalled = false;
+    m_volumeSliderSetTimeoutCalled = false;
+    m_sliderTimeout = -1;
+    m_volumeSliderShowCalled = false;
+    
+    emit aboutToClose ();
+}
+
+void HbVolumeSliderPopup::setValue (int value)
+{
+    m_volumeSliderSetValueCalled = true;
+    m_sliderValue = value;
+}
+
+int HbVolumeSliderPopup::value ()
+{
+    m_volumeSliderValueCalled = true;
+    return m_sliderValue;
+}
+
+void HbVolumeSliderPopup::setRange (int min, int max)
+{
+    m_volumeSliderSetRangeCalled = true;
+    m_sliderRangeMin = min;
+    m_sliderRangeMax = max;
+}
+
+void HbVolumeSliderPopup::setTimeout (int time)
+{
+    m_volumeSliderSetTimeoutCalled = true;
+    m_sliderTimeout = time;	
+}
+
+void HbVolumeSliderPopup::show ()
+{
+    m_volumeSliderShowCalled = true;
+    m_isVisible = true;
+}
+
+void HbVolumeSliderPopup::hide()
+{
+    m_volumeSliderHideCalled = true;
+    m_isVisible = false;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/hbvolumesliderpopup.h	Fri Jun 04 10:19:18 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: 
+*
+*/
+
+#ifndef HBVOLUMESLIDERPOPUP_H
+#define HBVOLUMESLIDERPOPUP_H
+
+#include <QObject>
+#include <hbpopup.h>
+
+extern bool m_volumeSliderContructorCalled;
+extern bool m_volumeSliderDesctructorCalled;
+extern bool m_volumeSliderSetValueCalled;
+extern int m_sliderValue;
+extern bool m_volumeSliderValueCalled;
+extern bool m_volumeSliderSetRangeCalled;
+extern int m_sliderRangeMin;
+extern int m_sliderRangeMax;
+extern bool m_volumeSliderSetTimeoutCalled;
+extern int m_sliderTimeout;
+extern bool m_volumeSliderShowCalled;
+extern bool m_isVisible;
+extern bool m_volumeSliderHideCalled;
+
+class HbVolumeSliderPopup : public QObject
+{
+    Q_OBJECT
+    
+public:
+    HbVolumeSliderPopup ();
+    ~HbVolumeSliderPopup ();
+    
+    void setValue (int value);
+    int value ();
+    void setRange (int min, int max);
+    void setTimeout (int time);
+    void show();
+    void hide();
+    void setDismissPolicy( HbPopup::DismissPolicy value ) {;};
+    int minimum() {return m_sliderRangeMin;};
+    int maximum() {return m_sliderRangeMax;};
+    bool isVisible() {return m_isVisible;};
+    
+    
+signals:
+    void aboutToClose ();
+    void valueChanged (int);
+
+};
+
+#endif // HBVOLUMESLIDERPOPUP_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "qsysteminfo.h"
+
+QSystemNetworkInfo::QSystemNetworkInfo(QObject *parent) : QObject(parent)
+{
+	
+}
+
+QString QSystemNetworkInfo::networkName(QSystemNetworkInfo::NetworkMode mode)
+{
+    QString networkName = "Unit test network";
+    return networkName;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/qsysteminfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* 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 QSYSTEMINFO_H
+#define QSYSTEMINFO_H
+
+#include <QObject>
+
+namespace QtMobility {
+	
+}
+
+class QSystemNetworkInfo : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    enum NetworkMode {
+        UnknownMode=0,
+        GsmMode,
+        CdmaMode,
+        WcdmaMode,
+        WlanMode,
+        EthernetMode,
+        BluetoothMode,
+        WimaxMode
+    };
+    
+    QSystemNetworkInfo (QObject *parent = 0);
+    virtual ~QSystemNetworkInfo () {};
+    static QString networkName(QSystemNetworkInfo::NetworkMode mode);
+    	
+signals:
+	  void networkNameChanged(QSystemNetworkInfo::NetworkMode,const QString &);
+
+private:
+    
+};
+
+#endif // QSYSTEMINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,424 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneUIQtView.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QVariant>
+#include <QKeyEvent>
+#include <QTimer>
+#include <QShortcutEvent>
+#include <QSignalSpy>
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbmainwindow.h>
+#include <bubblemanagerif.h>
+#define protected public
+#include "phoneuiqtview.h"
+#undef public
+#include "phoneaction.h"
+#include <hbtoolbar.h>
+#include <hbvolumesliderpopup.h>
+#include <hbaction.h>
+#include "xqserviceutil.h"
+#include "phoneaction.h"
+
+//CONSTANTS
+static const int KMAXVOLUME = 10;
+static const int KMINVOLUME = 0;
+static const int KVOLUMECOMMAND = 5;
+
+bool m_qtimer_stop_called;
+QString m_networkName;
+
+#define PHONE_QT_VIEW_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestPhoneUIQtView : public QObject
+{
+    Q_OBJECT
+    
+public:
+    TestPhoneUIQtView ();
+    ~TestPhoneUIQtView ();
+
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase (); 
+    void init ();
+    void cleanup ();
+    
+private slots:
+    void testAddBubbleCommand ();
+    void testHideToolbar ();
+    void testShowToolbar ();
+    void testAddToolbarActions ();
+    void testSetVolumeSliderValue ();
+    void testRemoveVolumeSlider ();
+    void testVolumeSliderValue ();
+    void testVolumeSliderChanged ();
+    void testParticipantListAction ();
+    void testSetExpandAction ();
+    void testPhoneAction ();
+    void testSetOrientation ();
+    void testBackButtonClicked();
+    void testShowDialpad();
+    void testDialpadText();
+    void testSetMenuActions();
+    void testLongEndKeyPressEventOutsideTelephony();
+    void testNetworkNameChanged();
+
+private:
+    int createCallHeader();
+
+private:
+    PhoneUIQtView *m_view; // class under test
+    HbMainWindow *m_main_window;
+
+};
+
+void QTimer::stop()
+{
+    m_qtimer_stop_called = true;   
+}
+    
+TestPhoneUIQtView::TestPhoneUIQtView ()
+{    
+}
+
+TestPhoneUIQtView::~TestPhoneUIQtView ()
+{
+}
+
+void TestPhoneUIQtView::initTestCase ()
+{	
+    m_main_window = new HbMainWindow();
+    m_view = new PhoneUIQtView(*m_main_window);
+    QCOMPARE(m_networkName, QString("Unit test network"));
+}
+
+void TestPhoneUIQtView::cleanupTestCase ()
+{
+    delete m_view;
+}
+
+void TestPhoneUIQtView::init ()
+{
+    m_qtimer_stop_called = false;
+}
+
+void TestPhoneUIQtView::cleanup ()
+{
+}
+
+void TestPhoneUIQtView::testAddBubbleCommand ()
+{
+    m_view->bubbleManager ().startChanges ();
+    int bubbleId = createCallHeader();
+    int bubbleId2 = createCallHeader();
+    
+    PhoneAction action1;
+    action1.setText("Command 1");
+    action1.setCommand(1);
+    action1.setActionRole(PhoneAction::None);
+    
+    PhoneAction action2;
+    action2.setText("Command 2");
+    action2.setCommand(2);
+    action2.setActionRole(PhoneAction::Accept);
+    
+    PhoneAction action3;
+    action3.setText("Command 3");
+    action3.setCommand(3);
+    action3.setActionRole(PhoneAction::Decline);
+    
+    m_view->addBubbleCommand (bubbleId, action1);
+    m_view->addBubbleCommand (bubbleId, action2);
+    m_view->addBubbleCommand (bubbleId2, action3);
+    m_view->bubbleManager ().endChanges ();
+    
+    m_view->bubbleManager ().startChanges ();
+    m_view->clearBubbleCommands (bubbleId);
+    m_view->clearBubbleCommands (bubbleId2);
+    m_view->clearBubbleCommands (bubbleId2);
+    m_view->bubbleManager ().endChanges ();
+}
+
+void TestPhoneUIQtView::testHideToolbar ()
+{
+    m_view->hideToolbar ();
+    QCOMPARE (m_hideCalled, true);	
+}
+
+void TestPhoneUIQtView::testShowToolbar ()
+{
+    m_view->showToolbar ();
+    QCOMPARE (m_showCalled, true);
+}
+
+void TestPhoneUIQtView::testAddToolbarActions ()
+{
+    m_actions.clear();
+    HbIcon icon ("foo.jpg");
+    PhoneAction *testAction = new PhoneAction ();
+    testAction->setIcon(icon);
+    testAction->setText("foo");
+    testAction->setCommand(20);
+    QList<PhoneAction*> actions;
+    actions.append(testAction);
+    
+    m_view->setToolbarActions(actions);
+    QCOMPARE (m_action->icon(), icon);
+    QCOMPARE(true, m_toolBarUpdateCalled);
+    
+    m_view->setToolbarActions(actions);
+    
+    m_toolBarUpdateCalled = false;
+    PhoneAction *testAction2 = new PhoneAction ();
+    testAction2->setIcon(icon);
+    testAction2->setText("foo2");
+    testAction2->setCommand(21);
+    actions.append(testAction2);
+    
+    m_view->setToolbarActions(actions);
+    QCOMPARE(true, m_toolBarUpdateCalled);
+    actions.removeOne(testAction2);
+    
+    m_toolBarUpdateCalled = false;
+    m_view->setToolbarActions(actions);
+    QCOMPARE(true, m_toolBarUpdateCalled);
+    
+    actions.clear();
+    delete testAction;
+    delete testAction2;
+}
+
+void TestPhoneUIQtView::testSetVolumeSliderValue ()
+{
+    m_view->setVolumeSliderValue (1, KVOLUMECOMMAND, KMAXVOLUME, KMINVOLUME);
+    QCOMPARE (m_volumeSliderContructorCalled, true);
+    QCOMPARE (m_sliderRangeMin, KMINVOLUME);
+    QCOMPARE (m_sliderRangeMax, KMAXVOLUME);
+    QCOMPARE (m_volumeSliderSetTimeoutCalled, true);
+    QCOMPARE (m_sliderTimeout, 10000);
+    QCOMPARE (m_volumeSliderSetValueCalled, true);
+    QCOMPARE (m_sliderValue, 1);
+    QCOMPARE (m_volumeSliderShowCalled, true);
+    
+    // reset values
+    m_volumeSliderContructorCalled = false;
+    m_volumeSliderSetValueCalled = false;
+    m_sliderRangeMin = -1;
+    m_sliderRangeMax = -1;
+    m_volumeSliderSetTimeoutCalled = false;
+    m_sliderTimeout = -1;
+    m_volumeSliderSetValueCalled = false;
+    m_sliderValue = -1;
+    m_volumeSliderShowCalled = false;
+
+    // The second call shouldn't create a new instance
+    m_view->setVolumeSliderValue (2, KVOLUMECOMMAND, KMAXVOLUME, KMINVOLUME);
+    QCOMPARE (m_volumeSliderContructorCalled, false);
+    QCOMPARE (m_sliderRangeMin, KMINVOLUME);
+    QCOMPARE (m_sliderRangeMax, KMAXVOLUME);
+    QCOMPARE (m_volumeSliderSetTimeoutCalled, false);
+    QCOMPARE (m_sliderTimeout, -1);
+    QCOMPARE (m_volumeSliderSetValueCalled, true);
+    QCOMPARE (m_sliderValue, 2);
+    QCOMPARE (m_volumeSliderShowCalled, false);
+}
+
+void TestPhoneUIQtView::testRemoveVolumeSlider ()
+{
+    m_view->setVolumeSliderValue (1, KVOLUMECOMMAND, KMAXVOLUME, KMINVOLUME);
+    m_view->removeVolumeSlider ();
+    QCOMPARE (m_volumeSliderHideCalled, true);
+}
+
+void TestPhoneUIQtView::testVolumeSliderValue ()
+{
+    m_sliderValue = -1;
+    int value = m_view->volumeSliderValue ();
+    QCOMPARE (m_sliderValue, -1);
+    m_view->setVolumeSliderValue (3, KVOLUMECOMMAND, KMAXVOLUME, KMINVOLUME);
+    value = m_view->volumeSliderValue ();
+    QCOMPARE (m_volumeSliderValueCalled, true);
+    QCOMPARE (value, 3);
+}
+
+void TestPhoneUIQtView::testVolumeSliderChanged ()
+{
+    m_view->setVolumeSliderValue (3, KVOLUMECOMMAND, KMAXVOLUME, KMINVOLUME);
+    QSignalSpy spy (m_view, SIGNAL(command(int)));
+    m_view->volumeSliderChanged (1);
+    QCOMPARE (spy.count(), 1);
+    int command = qvariant_cast<int>(spy.at (0).at (0));
+    QCOMPARE (command, (int)KVOLUMECOMMAND);
+}
+
+void TestPhoneUIQtView::testParticipantListAction ()
+{
+    m_view->bubbleManager ().startChanges ();
+    m_view->addParticipantListAction (1,"Command 1", HbIcon ());
+    m_view->addParticipantListAction (2,"Command 2", HbIcon ());
+    m_view->bubbleManager ().endChanges ();
+
+    m_view->bubbleManager ().startChanges ();
+    m_view->clearParticipantListActions ();
+    m_view->clearParticipantListActions ();
+    m_view->bubbleManager ().endChanges ();
+}
+
+void TestPhoneUIQtView::testSetExpandAction ()
+{
+    m_view->bubbleManager ().startChanges ();
+    int bubbleId = createCallHeader();
+    int bubbleId2 = createCallHeader();
+
+    m_view->setExpandAction(bubbleId, 1);
+    m_view->setExpandAction(bubbleId2, 2);
+    m_view->bubbleManager ().endChanges ();
+
+    m_view->bubbleManager ().startChanges ();
+    m_view->removeExpandAction(bubbleId);
+    m_view->removeExpandAction(bubbleId2);
+    m_view->bubbleManager().removeCallHeader(bubbleId);
+    m_view->bubbleManager().removeCallHeader(bubbleId2);
+    m_view->bubbleManager ().endChanges ();
+}
+
+void TestPhoneUIQtView::testPhoneAction ()
+{
+    PhoneAction *action = new PhoneAction ();
+    QString string("Action");
+    action->setText(string);
+    HbIcon icon;
+    action->setIcon(icon);
+    int commandId(1);
+    action->setCommand(commandId);
+    action->setDisabled(true);
+    QCOMPARE( string, action->text() );
+    QCOMPARE( icon, action->icon() );
+    QCOMPARE( commandId, action->command() );
+    QCOMPARE( true, action->isDisabled() );
+    delete action;
+}
+
+void TestPhoneUIQtView::testSetOrientation ()
+{
+
+    m_setOrientationCalled = false;
+    
+    m_view->handleOrientationChange(Qt::Vertical);
+    QVERIFY( false == m_setOrientationCalled );
+    
+    m_view->handleOrientationChange(Qt::Horizontal);
+    QVERIFY( true == m_setOrientationCalled );
+    
+}
+
+void TestPhoneUIQtView::testBackButtonClicked()
+{
+    // not possible to mock xqservice because it is in \epoc32\include
+    // calling backButtonClicked would send this test background.
+    // m_view->backButtonClicked();
+}
+
+void TestPhoneUIQtView::testShowDialpad()
+{
+    m_view->hideDialpad();
+    m_view->showDialpad();
+    m_view->showDialpad();
+    QVERIFY(true == m_view->isDialpadVisible());
+    m_view->hideDialpad();
+}
+
+void TestPhoneUIQtView::testDialpadText()
+{
+    m_view->showDialpad();
+    QVERIFY(QString("") == m_view->dialpadText());
+    m_view->clearAndHideDialpad();
+}
+
+void TestPhoneUIQtView::testSetMenuActions()
+{
+    QList<PhoneAction*> actions;
+    m_view->setMenuActions(actions);
+    
+    PhoneAction* phoneAction = new PhoneAction; 
+    phoneAction->setText(QString("test"));
+    phoneAction->setCommand(1);
+    actions.append(phoneAction);
+    
+    m_view->setMenuActions(actions);
+    qDeleteAll(actions);
+    actions.clear();
+    
+    m_view->setMenuActions(actions);
+}
+
+//Private methods
+int TestPhoneUIQtView::createCallHeader ()
+{
+    int bubble = m_view->bubbleManager().createCallHeader ();
+
+    return bubble;
+}
+
+void TestPhoneUIQtView::testLongEndKeyPressEventOutsideTelephony()
+{
+    /*QSignalSpy spy(m_view, SIGNAL(endKeyLongPress()));
+    QKeyEvent* event = new QKeyEvent(QEvent::ShortcutOverride, Qt::Key_No, Qt::NoModifier);
+
+    bool returnValue = m_view->eventFilter(new QObject(), event);
+
+    QVERIFY(returnValue == true);
+    QCOMPARE(spy.count(), 1);*/
+}
+
+void TestPhoneUIQtView::testNetworkNameChanged()
+{
+    // Title is changed only for GmsMode
+    m_view->networkNameChanged(QSystemNetworkInfo::GsmMode, QString("test"));
+    QCOMPARE(m_networkName, QString("test"));
+
+    // Other modes shouldn't affect the title
+    m_view->networkNameChanged(QSystemNetworkInfo::CdmaMode, QString("another operator"));
+    QCOMPARE(m_networkName, QString("test"));
+}
+
+void HbView::setTitle (const QString &title)
+{
+    m_networkName = title;
+}
+
+PHONE_QT_VIEW_TEST_MAIN(TestPhoneUIQtView)
+Q_DECLARE_METATYPE(QKeyEvent *)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/ut_phoneuiqtview.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEA9BEF3F
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+CONFIG += hb qtestlib //mobility
+//MOBILITY += systeminfo
+
+symbian {
+
+    INCLUDEPATH += /epoc32/include/platform/mw \
+                   /epoc32/include/platform/app \
+                   /epoc32/include/mw \
+                   ../../../phoneuiutils/inc/ \
+                   ../../inc/ \
+                   ../../../../inc \
+                   ./
+
+    LIBS += -lbubblemanager2 \
+            -lxqserviceutil \
+            -ldialpad \
+            -lxqkeycapture
+
+    DEFINES += FT_SYMBIAN_INTEGRATION
+} else:win32 {
+    INCLUDEPATH += c:/hb/include/hbcore \
+        c:/hb/include/hbwidgets \
+        ../../inc/ \
+        ../../../../inc \
+        .
+
+    LIBS += -lbubblemanager2
+}
+
+DEFINES += BUILD_PHONEUIQTVIEW
+
+# Input
+HEADERS += ../../inc/phoneuiqtview.h \
+           ../../inc/phoneuiqtviewif.h \
+           ../../inc/phoneaction.h \
+           hbtoolbar.h \
+           hbvolumesliderpopup.h \
+           qsysteminfo.h
+SOURCES += ../../src/phoneuiqtview.cpp \
+           ../../src/phoneaction.cpp \
+           unit_tests.cpp \
+           hbtoolbar.cpp \
+           hbvolumesliderpopup.cpp \
+           qsysteminfo.cpp 
+           
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/bwins/phoneuivoipextensionu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,10 @@
+EXPORTS
+	?NewPhoneUIStateMachineFactoryL@@YAPAVCPhoneUIStateMachineFactoryBase@@XZ @ 1 NONAME ; class CPhoneUIStateMachineFactoryBase * NewPhoneUIStateMachineFactoryL(void)
+	?SetServiceId@TPhoneCmdParamSelector@@QAEXI@Z @ 2 NONAME ; void TPhoneCmdParamSelector::SetServiceId(unsigned int)
+	?RegStatus@TPhoneCmdParamSelector@@QAEHXZ @ 3 NONAME ; int TPhoneCmdParamSelector::RegStatus(void)
+	?CallType@TPhoneCmdParamSelector@@QAE?AW4TPhoneSsCallType@@XZ @ 4 NONAME ; enum TPhoneSsCallType TPhoneCmdParamSelector::CallType(void)
+	?SetCallType@TPhoneCmdParamSelector@@QAEXW4TPhoneSsCallType@@@Z @ 5 NONAME ; void TPhoneCmdParamSelector::SetCallType(enum TPhoneSsCallType)
+	?SetRegStatus@TPhoneCmdParamSelector@@QAEXH@Z @ 6 NONAME ; void TPhoneCmdParamSelector::SetRegStatus(int)
+	??0TPhoneCmdParamSelector@@QAE@XZ @ 7 NONAME ; TPhoneCmdParamSelector::TPhoneCmdParamSelector(void)
+	?ServiceId@TPhoneCmdParamSelector@@QAEIXZ @ 8 NONAME ; unsigned int TPhoneCmdParamSelector::ServiceId(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/eabi/phoneuivoipextensionu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,11 @@
+EXPORTS
+	_Z30NewPhoneUIStateMachineFactoryLv @ 1 NONAME
+	_ZN22TPhoneCmdParamSelector11SetCallTypeE16TPhoneSsCallType @ 2 NONAME
+	_ZN22TPhoneCmdParamSelector12SetRegStatusEi @ 3 NONAME
+	_ZN22TPhoneCmdParamSelector12SetServiceIdEj @ 4 NONAME
+	_ZN22TPhoneCmdParamSelector8CallTypeEv @ 5 NONAME
+	_ZN22TPhoneCmdParamSelector9RegStatusEv @ 6 NONAME
+	_ZN22TPhoneCmdParamSelector9ServiceIdEv @ 7 NONAME
+	_ZN22TPhoneCmdParamSelectorC1Ev @ 8 NONAME
+	_ZN22TPhoneCmdParamSelectorC2Ev @ 9 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  PhoneUiVoipExtension bld files
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+
+DEFAULT
+
+PRJ_EXPORTS
+../group/phoneuivoipextension_stub.sis          /epoc32/data/z/system/install/phoneuivoipextension_stub.sis
+
+PRJ_MMPFILES
+phoneuivoipextension.mmp
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/group/phoneuivoipextension.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   This mmp file defines the PhoneUIVoIPExtension polymorphic interface
+*   DLL module, which contains all the VoIP specific implementations 
+*   of variant classes.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+// Capability assignment.
+// <-- QT PHONE START --> 
+CAPABILITY CAP_GENERAL_DLL
+//CAPABILITY CAP_APPLICATION MultiMediaDD NetworkControl PowerMgmt DRM DiskAdmin
+// <-- QT PHONE END --> 
+
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          phoneuivoipextension.dll
+TARGETTYPE      dll
+
+UID             0x101F7CA9  0x10207905
+
+SOURCEPATH      ../src
+
+SOURCE          cphoneresourceresolvervoip.cpp
+SOURCE          cphonestatealertingvoip.cpp
+SOURCE          cphonestatecallsetupvoip.cpp
+SOURCE          cphonestateidlevoip.cpp
+SOURCE          cphonestateincomingvoip.cpp
+SOURCE          cphonestatemachinevoip.cpp
+SOURCE          cphonestatesinglevoip.cpp
+SOURCE          cphoneuistatemachinefactoryvoip.cpp
+SOURCE          cphonecustomizationvoip.cpp
+SOURCE          cphonevoiperrormessageshandler.cpp
+SOURCE          cphonemenuextensionwrapper.cpp
+SOURCE          cphoneextensionhandler.cpp
+SOURCE          tphonecmdparamselector.cpp
+// <-- QT PHONE START -->
+//SOURCE          tphonetouchpanewrapper.cpp
+// <-- QT PHONE END -->
+SOURCE          cphonetransferdialercontroller.cpp
+SOURCE          cphoneviewcustomizationvoip.cpp
+SOURCE          cphonestateutilsvoip.cpp
+SOURCE          cphoneunattendedtransfercmdhandler.cpp
+// <-- QT PHONE START -->
+//SOURCE          cphonevcchandler.cpp
+// <-- QT PHONE END -->
+SOURCE          cphonenewcallcmdhandler.cpp
+SOURCE          cphonecallforwardqueryhandler.cpp
+
+// <-- QT PHONE START -->
+/* Languages */
+/*LANG SC
+
+#ifndef __SECURE_DATA__ 
+SOURCEPATH      ../srcdata
+
+// load protocol specific resources
+RESOURCE        phoneuivoip.rss
+#else
+// Resources
+
+SOURCEPATH      ../srcdata
+
+START RESOURCE  phoneuivoip.rss
+TARGETPATH APP_RESOURCE_DIR 
+HEADER
+LANGUAGE_IDS
+END  // RESOURCE
+
+#endif // __SECURE_DATA__
+*/
+// <-- QT PHONE END -->
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../phoneuicontrol/inc
+USERINCLUDE     ../../phoneuistates/inc
+// <-- QT PHONE START -->
+USERINCLUDE     ../../phoneuiqtviewadapter/inc
+//USERINCLUDE     ../../phoneuiview/inc
+// <-- QT PHONE END -->
+USERINCLUDE     ../../phoneui/inc
+USERINCLUDE     ../../phoneuiutils/inc
+USERINCLUDE     ../../phoneui2/srcdata
+USERINCLUDE     ../../phoneui2/loc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+LIBRARY         bafl.lib
+// <-- QT PHONE START -->
+//LIBRARY         cch.lib 
+// <-- QT PHONE END -->
+// <-- QT PHONE START --> 
+LIBRARY         phonestringloader.lib
+//LIBRARY         commonengine.lib //StringLoader 
+// <-- QT PHONE END -->
+LIBRARY         cone.lib
+LIBRARY         ecom.lib
+LIBRARY         eikcoctl.lib // CEikMenuPane
+LIBRARY         engineinfo.lib
+LIBRARY         euser.lib
+LIBRARY         featmgr.lib // FeatureManager
+LIBRARY         phoneclient.lib 
+LIBRARY         phoneengine.lib
+LIBRARY         phoneuicontrol.lib
+LIBRARY         phoneuistates.lib
+LIBRARY         phoneuiutils.lib
+LIBRARY         serviceprovidersettings.lib
+LIBRARY         serviceselector.lib
+// <-- QT PHONE START -->
+//LIBRARY         vccuipropertyhandler.lib //For VCC Usage
+// <-- QT PHONE END -->
+LIBRARY         ws32.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/group/phoneuivoipextension_stub.pkg	Fri Jun 04 10:19:18 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: For packing phoneuivoipextension component.
+;
+; Languages
+&EN
+
+; Header
+#{"PhoneUIVoIPExtension"}, (0x10207905), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+;
+;  PhoneUIVoIPExtension
+;
+"" - "z:\sys\bin\PhoneUIVoIPExtension.dll"
+"" - "z:\resource\apps\phoneuivoip.rsc"
Binary file phoneapp/phoneuivoipextension/group/phoneuivoipextension_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonecallforwardqueryhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Handles queries related to call forwarding.
+*
+*/
+
+
+#ifndef C_CPHONECALLFORWARDQUERYHANDLER_H
+#define C_CPHONECALLFORWARDQUERYHANDLER_H
+
+#include <e32base.h>
+#include <pevirtualengine.h>
+#include "mphonequerycommandobserver.h"
+
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+class CPhoneStateUtilsVoip;
+
+/**
+ *  Handles queries related to call forwarding.
+ *
+ *  @lib PhoneUIVoIPExtension.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPhoneCallForwardQueryHandler ) : 
+        public CBase,
+        public MPhoneQueryCommandObserver
+    {
+
+public:
+
+    /**
+     * Enum for query types.
+     */
+    enum TQueryType
+        {
+        EPhoneQueryNotSet,
+        EPhoneQueryAddToContacts,
+        EPhoneMovedPermanently,
+        EPhoneMultipleChoices
+        };
+    
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneCallForwardQueryHandler* NewL( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneCallForwardQueryHandler* NewLC( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CPhoneCallForwardQueryHandler();
+
+    /**
+     * Shows moved permanently query. 
+     * @param aCallId Id of the call
+     */
+    void ShowMovedPermanentlyQueryL( TInt aCallId );
+ 
+    /**
+     * Shows multiple choices query. 
+     * @param aCallId Id of the call
+     */
+    void ShowMultipleChoicesQueryL( TInt aCallId );
+
+protected:
+    
+// From MPhoneQueryCommandObserver
+    /**
+     * Processes query commands
+     * @param aCommandId A command id.
+     */
+    void ProcessCommandL( TInt aCommandId  );
+    
+private:
+
+    CPhoneCallForwardQueryHandler(         
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+
+    void ConstructL();
+     
+    /**
+     * Adds string to contacts.
+     * @param aCreateNew ETrue creates new contact,
+     *                   EFalse updates exiting contact. 
+     */
+    void AddToContacsL( TBool aCreateNew );
+          
+    /**
+     * Saves address to contacts.
+     */
+    void SaveAddressToContactsL();
+
+    /**
+     * Shows call is being forwarded information note.
+     */
+    void ShowCallForwardedNoteL();
+ 
+    /**
+     * Resets multiple choices item text array.
+     * @param aAddressArray New items for array.
+     */
+    void ResetMultipleChoicesArrayL(
+            const MDesC8Array& aAddressArray );
+
+    /**
+     * Shows info note "Call is being forwarded" and starts
+     * call forward to selected address.
+     * @param aIndex Array index for address where call is being
+     *               forwarded.
+     */
+    void ForwardCallToAddressL( TInt aIndex );
+    
+private: // data
+
+    /**
+     * Interface to the state machine.
+     * Not own.
+     */
+    MPhoneStateMachine& iStateMachine;
+    
+    /**
+     * Interface to the phone ui view.
+     * Not own.
+     */
+    MPhoneViewCommandHandle& iViewCommandHandle;
+    
+    /**
+     * Address array.
+     * Not own.
+     */
+    const CDesC8Array* iAddressArray;
+
+    /**
+     * Address array.
+     * Own.
+     */
+    CDesC16ArrayFlat* iMultipleChoicesArray;
+    
+    /**
+     * Call id
+     */
+    TInt iCallId;
+    
+    /**
+     * Query type
+     */
+    TInt iQueryType;
+
+    /**
+     * Flag to check is command already processed.
+     */
+    TBool iCommandProcessed;
+    };
+
+
+#endif // C_CPHONECALLFORWARDQUERYHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonecustomizationvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,404 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  VoIP-specific customization class.
+*
+*/
+
+
+#ifndef C_CPHONECUSTOMIZATIONVOIP_H
+#define C_CPHONECUSTOMIZATIONVOIP_H
+
+// INCLUDES
+#include <settingsinternalcrkeys.h>
+#include <telmenuextension.h>
+#include <spdefinitions.h>
+#include "mphonecustomization.h"
+#include "mphonebuttoncustomization.h"
+
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+class CPhoneExtensionHandler;
+class MPhoneDialerController;
+class CPhoneViewCustomizationVoip;
+class CPhoneStateUtilsVoip;
+class CPhoneUnattendedTransferCmdHandler;
+class CPhoneNewCallCmdHandler;
+class CEikMenuPaneItem;
+class CCoeEnv;
+class CPhoneCallForwardQueryHandler;
+
+// CONSTANTS
+
+const TInt KMaxVoIPServiceName = 100;
+
+// CLASS DECLARATION
+/**
+*  VoIP-specific customization class.
+*/
+NONSHARABLE_CLASS( CPhoneCustomizationVoip ): public CBase, 
+        public MPhoneCustomization, public MPhoneButtonCustomization
+    {
+    public: // Data
+    
+    /**
+     * Features for multicall case
+     */    
+    enum TFeature
+        {
+        EFeatureNone,
+        EFeatureConference,
+        EFeatureTransfer
+        };
+    public:      
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneCustomizationVoip();
+
+        /**
+        * Creates the VoIP-specific utility class
+        * @param aStateMachine: a container of state objects
+        * @return an instance of class CPhoneCustomizationVoip
+        */
+        static CPhoneCustomizationVoip* NewL( 
+            MPhoneStateMachine& aStateMachine,
+            MPhoneViewCommandHandle& aViewCommandHandle );
+        
+// from base class MPhoneCustomization  
+        
+        /**
+        * From MPhoneCustomization.
+        * Customizes menu bar.
+        * @param    aResourceId     Menu bar resource identifier.
+        * @param    aMenuBar        Menu bar.
+        */
+        void CustomizeMenuBarL( TInt aResourceId, CEikMenuBar* aMenuBar );
+        
+        /**
+        * From MPhoneCustomization.
+        * Customizes menu pane.
+        * @param    aResourceId     Menu pane resource identifier.
+        * @param    aMenuPane       Menu pane.
+        */
+        void CustomizeMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+        
+        /**
+        * From MPhoneCustomization.
+        * Customizes call header texts shown in a call bubble.
+        * @param    aCallId             Call identifier.
+        * @param    aHeaderData         Call header data to be modified.
+        * @param    aInCallNumberText   In call number text (Call 1, Call 2...).
+        */
+        void ModifyCallHeaderTexts( TInt aCallId, 
+            TPhoneCmdParamCallHeaderData* aHeaderData, 
+            const TDesC& aInCallNumberText );
+        
+        /**
+        * From MPhoneCustomization.
+        * Handles custom menu commands.
+        * @param aCommand Command id.
+        * @return ETrue if command handled.
+        */
+        TBool HandleCommandL( TInt aCommand );
+        
+        /**
+        * From MPhoneCustomization.
+        * Checks is alphanumeric mode allowed for number entry/
+        * dialer.
+        * @return ETrue if allowed.     
+        */
+        TBool AllowAlphaNumericMode(); 
+        
+        /**
+        * From MPhoneCustomization.
+        * Returns resource id for soft keys.
+        * @return Resource id.
+        */
+        TInt CustomizeSoftKeys();
+        
+        /**
+        * From MPhoneCustomization.
+        * Returns text resource id for private call header.
+        * @return Resource id.
+        */
+        TInt CustomizeCallHeaderText();
+        
+        /**
+        * From MPhoneCustomization.
+        * Returns text resource id for busy note.
+        * @return Resource id.
+        */
+        TInt CustomizeBusyNoteText();
+        
+        /**
+        * From MPhoneCustomization.
+        * Handles calls from number entry.
+        * @return ETrue when call is handled by customization.
+        *         EFalse otherwice.
+        */        
+        TBool HandleCallFromNumberEntryL();
+        
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Id of the message 
+        * @param aCallId  The call id of the call
+        * @return ETrue if message was handled
+        */
+        TBool HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );
+
+        /**
+        * Handles dial by unknown service id.
+        * @param aNumber   Number/Address 
+        */
+        void HandleDialL( const TDesC& aNumber );
+
+// from base class MPhoneButtonCustomization
+        /**
+        * From MPhoneButtonCustomization.
+        * Customizes touch pane buttons.
+        * @param aTouchPane Interface to add and dimm
+        *                   bubble touch pane buttons.
+        */
+        void CustomizeTouchPaneButtons(
+                        /*MBubbleTouchPaneInterface& aTouchPane*/ );
+    protected:
+
+        CPhoneCustomizationVoip( 
+            MPhoneStateMachine& aStateMachine,
+            MPhoneViewCommandHandle& aViewCommandHandle );
+        
+        virtual void ConstructL();
+        
+    private:        
+        /**
+        * VoIP supported check.
+        */
+        TBool VoIPSupportedL();
+        
+        /**
+        * Get VoIP services
+        * @param aVoipServiceIds On return, contains the list of VoIP services
+        */
+        void GetVoIPServiceIdsL( RIdArray& aVoipServiceIds ) const;
+
+        /**
+        * Get the service provider name
+        * @param aServiceId The service, whose name is requested
+        * @param aServiceName On return, contains the service name
+        */
+        void GetVoipServiceNameL( TServiceId aServiceId, TDes& aServiceName ) const;
+        
+        /**
+        * Modifies menu when there is active call.
+        * @param aResourceId Menu resource id.
+        * @param aMenuPane Menu pane
+        */
+        void ModifyInCallMenuL( TInt aResourceId, CEikMenuPane& aMenuPane );
+        
+        /**
+         * Modifies menu when there is dialer/number entry shown.
+         * 
+         * @param   aResourceId     Menu pane resource identifier.
+         * @param   aMenuPane       Menu pane.
+         */
+        void ModifyNumberAcquisitionMenuL( 
+            TInt aResourceId, CEikMenuPane& aMenuPane );
+        
+        /**
+         * Inserts "Internet call" menu item to the given menu pane.
+         * 
+         * @param   aResourceId     Menu pane resource identifier.
+         * @param   aMenuPane       Menu pane. 
+         */
+        void InsertInternetCallMenuItemL( TInt aResourceId, 
+            CEikMenuPane& aMenuPane );
+        
+        /**
+         * Inserts menu item for changing between alpha and numeric input 
+         * modes to the given menu pane.
+         * 
+         * @param   aMenuPane       Menu pane. 
+         */
+        void InsertTextInputModeChangeMenuItemL( CEikMenuPane& aMenuPane );
+        
+        /**
+        * Resolves active calls from phoneengine.
+        * @param aArray Active call array.
+        */
+        void GetActiveCallArrayL( 
+                RArray<CTelMenuExtension::TCallInfo>& aArray );
+        
+        /**
+        * Resolves most active call.
+        * This is used to determine which plug-in customizes menu pane 
+        * and handles command.
+        * @param aArray Active call array.
+        */
+        TInt ResolveMostActiveCallL( 
+                const RArray<CTelMenuExtension::TCallInfo>& aArray );
+
+        /**
+         * Returns service id for activest call
+         * by active call array.
+         * @param aArray Active call array.
+         * @return Service id.
+         */
+        TUint ServiceIdForActivestCallL(
+                const RArray<CTelMenuExtension::TCallInfo>& aArray );
+        
+        /**
+        * Checks is feature supported.
+        * @since    S60 v5.1
+        * @param    aFeature A feature to be checked.
+        * @return   ETrue if feature supported.
+        */  
+        TBool IsFeatureSupported( TFeature aFeature );  
+        
+        /**
+        * Checks is feature supported by call type.
+        * E.g. Conference not supported if held voip call
+        * and active CS call.
+        * @since    S60 v5.1
+        * @leave    Leaves if check not succeed.
+        * @param    aFeature A feature to be checked.
+        * @return   ETrue if feature supported.
+        */  
+        TBool CheckFeatureSupportByCallTypeL( 
+                TFeature aFeature );
+
+        /**
+        * Shows "Enabling %U service" wait note 
+        */
+        void LaunchEnablingServiceNoteL();
+         
+        /**
+        * Show global ErrorNote
+        * @param aResourceId resource id to be resolved
+        */
+        void SendGlobalErrorNoteL( TInt aResourceId );
+        
+        /**
+        * Show global InfoNote
+        * @param aResourceId resource id to be resolved
+        */
+        void SendGlobalInfoNoteL( TInt aResourceId );
+        
+        /**
+        * Fits URI to call bubble lines.
+        * @param aCLIText Full caller address.
+        * @param aSipURI returns first line of bubble.
+        * @param aSipURIDomainPart returns second line of bubble.
+        */
+        void HandleURIFittingToCallBubble( const TDesC& aCLIText,
+                   TDes& aSipURI, TDes& aSipURIDomainPart );
+        
+        /**
+         * Returns VoIP state utils.
+         * @return VoIP state utils.
+         */
+        CPhoneStateUtilsVoip& StateUtils();
+        
+        /**
+        * Take care of actions when callsecurestatus 
+        * change.
+        * @param aCallId CallId of the call.
+        */ 
+        void HandleCallSecureStatusChangeL( TInt aCallId );
+        
+        /**
+         * Creates menu pane item with specified command and text resource 
+         * identifiers.
+         * 
+         * @param   aCommandId      Command identifier.
+         * @param   aTextResourceId Text resource identifier.
+         * @return  Menu pane item. 
+         */
+        CEikMenuPaneItem* CreateMenuPaneItemLC( 
+            TInt aCommandId, TInt aTextResourceId ) const;
+        
+        /**
+         * Creates a VoIP menu pane item with specified command and text resource 
+         * @param   aCommandId      Command identifier.
+         * @param   aTextResourceId Text resource identifier.
+         * @return  Menu pane item. 
+         */
+        CEikMenuPaneItem* CreateMenuPaneItemLC( 
+            TInt aCommandId, TServiceId aServiceId ) const;
+        
+        /**
+        * Adds handover menu item to menu.
+        * @param aResourceId menu resource
+        * @param aMenuPane Menu pane.
+        */
+        void AddHandoverMenuItemIfNeededL( 
+            TInt aResourceId, CEikMenuPane& aMenuPane );
+
+        /**
+        * Gets phone number from the phone number entry.
+        * @return  Phone number
+        */
+        HBufC* PhoneNumberFromEntryLC() const;
+        
+    private: // Data
+                
+        /** 
+         * Control environment.
+         */
+        CCoeEnv& iCoeEnv;
+        
+        /** 
+         * Interface for setting and getting active state
+         */
+        MPhoneStateMachine& iStateMachine;
+        
+        /** 
+         * Reference to the Phone UI View command handle
+         */
+        MPhoneViewCommandHandle& iViewCommandHandle;
+        
+        /**
+         * Extension handler.
+         * Own.
+         */
+        CPhoneExtensionHandler* iExtensionHandler;
+
+        /**
+         * Phone view customization.
+         */
+        CPhoneViewCustomizationVoip* iPhoneViewCustomization;
+        
+        /**
+         * Unattended transfer command handler.
+         */
+        CPhoneUnattendedTransferCmdHandler* iTransferCmdHandler;
+        
+        /**
+         * New Internet call command handler.
+         */
+        CPhoneNewCallCmdHandler* iNewCallCmdHandler;
+        
+        /**
+         * Call forward handler.
+         */
+        CPhoneCallForwardQueryHandler* iCallForwardHandler;
+        
+    };
+
+#endif // C_CPHONECUSTOMIZATIONVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphoneextensionhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Extension handler class.
+*
+*/
+
+
+#ifndef C_CPHONEEXTENSIONHANDLER_H
+#define C_CPHONEEXTENSIONHANDLER_H
+
+// INCLUDES
+#include <telmenuextension.h>
+#include <spdefinitions.h>
+ 
+// FORWARD DECLARATIONS
+class CPhMenuExtensionWrapper;
+
+// CLASS DECLARATION
+/**
+*  Extension handler class
+*/
+NONSHARABLE_CLASS( CPhoneExtensionHandler ): public CBase
+    {
+        
+    public:      
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneExtensionHandler();
+
+        /**
+         * Creates the extension handler class
+         */
+        static CPhoneExtensionHandler* NewL();
+                        
+        /**
+         * Modifies menu when there is active call.
+         * @param aServiceId Service id of the call.
+         * @param aArray Active call array
+         * @param aResourceId Menu resource id.
+         * @param aMenuPane Menu pane
+         */
+        void ModifyInCallMenuL( 
+                TUint aServiceId,
+                RArray<CTelMenuExtension::TCallInfo>& aArray, 
+                TInt aResourceId, 
+                CEikMenuPane& aMenuPane );
+
+        /**
+         * Handles custom menu command.
+         * @param aServiceId Service id of the call.
+         * @param aCommand Command id.
+         * @return ETrue if command handled.
+         */
+        TBool HandleCommandL( 
+                TUint aServiceId,
+                TInt aCommand );
+            
+    protected:
+
+        CPhoneExtensionHandler();
+        
+        void ConstructL();
+        
+    private:                
+        
+        
+        /**
+         * Resolves extensions implementation uid for 
+         * given service id.
+         * @leave KErrNotFound if extension not exists for service.
+         * @param aServiceId Service id
+         * @param aPropertyName Service table property name.
+         * @return Implementaion uid.
+         */
+        TUid ResolveImplementationUidL( TUint32 aServiceId, 
+                                        TServicePropertyName aPropertyName );
+
+        /**
+         * Adds unattended transfer menu item to menu.
+         * @param aMenuPane Menu pane.
+         */
+        void AddUnattendedTransferMenuItemL( CEikMenuPane& aMenuPane );
+
+        /**
+         * Returns menu extension by service id.
+         * @leave Leaves if not found.
+         * @param  aServiceId Service id of call
+         */
+        CTelMenuExtension* MenuExtensionL( TUint aServiceId );
+        
+        
+    private: // Data
+
+        
+        /**
+         * Menu extension plugins.
+         * Own.
+         */
+        RPointerArray<CPhMenuExtensionWrapper> iPlugins;
+    };
+
+#endif // C_CPHONEVOIPUTILITY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonemenuextensionwrapper.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of CPhMenuExtensionWrapper class.
+*
+*/
+
+
+
+#ifndef C_CPHONEMENUEXTENSIONWRAPPER_H
+#define C_CPHONEMENUEXTENSIONWRAPPER_H
+
+#include <e32base.h>
+#include <telmenuextension.h>
+
+/**
+ *  Provides container friendly interface for extension plugin handling.
+ *    
+ *  @lib PhoneUIVoIPExtension.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPhMenuExtensionWrapper ) : public CTelMenuExtension
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param   aImplementationUid  An Ecom plugin implementation identifier.
+     */
+    static CPhMenuExtensionWrapper* NewL( TUid aImplementationUid );
+
+    /**
+     * Two-phased constructor.
+     * @param   aImplementationUid  An Ecom plugin implementation identifier.
+     */
+    static CPhMenuExtensionWrapper* NewLC( TUid aImplementationUid );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CPhMenuExtensionWrapper();
+
+    /**
+     * Provides comparison algorithm for CPhMenuExtensionWrapper objects using
+     * extension plugin implementation identifier as a search key.
+     * 
+     * @param   aKey        A search key.
+     * @param   aWrapper    An object to match with a key.
+     * @since   S60 v5.1
+     * @return  ETrue if match, EFalse otherwise.
+     */
+    static TBool MatchByUid( 
+        const TUid* aKey, const CPhMenuExtensionWrapper& aWrapper );
+    
+    // from base class CTelMenuExtension
+
+    /**
+    * From CTelMenuExtension.
+    * @see CTelMenuExtension.
+    */
+    void ModifyExtensionsCallMenuL( 
+            const RArray<CTelMenuExtension::TCallInfo>& aCallArray,
+            CEikMenuPane& aMenuPane );
+
+    /**
+    * From CTelMenuExtension.
+    * @see CTelMenuExtension.
+    */
+    void ModifyExtensionsTouchPaneButtonsL( 
+            const RArray<CTelMenuExtension::TCallInfo>& aCallArray,
+            MTelTouchPaneExtension& aTouchPane );
+    
+    /**
+    * From CTelMenuExtension.
+    * @see CTelMenuExtension.
+    */
+    TBool HandleCommandL( TInt aCommand );
+
+private:
+
+    CPhMenuExtensionWrapper() {};
+    
+    CPhMenuExtensionWrapper( TUid aImplementationUid );
+
+    void ConstructL();
+    
+    /**
+     * Creates menu extension plugin.
+     * @since   S60 v5.1
+     * @return A new menu extension plugin instance.
+     */
+    CTelMenuExtension* CreateMenuExtensionL() const;
+    
+    /**
+     * Returns identifier of the wrapped extension plugin.
+     * @since   S60 v5.1
+     * @return Identifier of the extension plugin.
+     */
+    TUid Identifier() const;
+
+private: // data
+
+    /**
+     * Extension plugin identifier.
+     */
+    TUid iPluginUid;
+
+    /**
+     * Menu extension plugin.
+     * Own.
+     */
+    CTelMenuExtension* iPlugin;
+
+    };
+
+#endif // C_CPHONEMENUEXTENSIONWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonenewcallcmdhandler.h	Fri Jun 04 10:19:18 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: Handles commands related to new call.
+*
+*/
+
+
+#ifndef C_CPHONENEWCALLCMDHANDLER_H
+#define C_CPHONENEWCALLCMDHANDLER_H
+
+#include <e32base.h>
+
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+class CPhoneStateUtilsVoip;
+
+/**
+ *  Handles commands related to new Internet call.
+ *
+ *  @lib PhoneUIVoIPExtension.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPhoneNewCallCmdHandler ) : public CBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneNewCallCmdHandler* NewL( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneNewCallCmdHandler* NewLC( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CPhoneNewCallCmdHandler();
+
+    /**
+     * Handles VoIP commands related to new call.
+     * @param   aCommand    VoIP command identifier.
+     */
+    void HandleCommandL( TInt aCommand );
+    
+private:
+
+    CPhoneNewCallCmdHandler(         
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+
+    void ConstructL();
+
+    /**
+     * Shows new call query. 
+     */
+    void ShowNewCallQueryL();
+     
+    /**
+     * Starts new call. 
+     */
+    void DoNewCallL();
+          
+    /**
+     * Opens single item contact fetch.
+     * @param   aFetchType  Type of the fetch.
+     */
+    void OpenSingleItemContactFetchL( TInt aFetchType );
+
+    /**
+     * Returns VoIP state utils.
+     * @return VoIP state utils.
+     */    
+    CPhoneStateUtilsVoip& StateUtils();
+    
+private: // data
+
+    /**
+     * Interface to the state machine.
+     * Not own.
+     */
+    MPhoneStateMachine& iStateMachine;
+    
+    /**
+     * Interface to the phone ui view.
+     * Not own.
+     */
+    MPhoneViewCommandHandle& iViewCommandHandle;
+    };
+
+
+#endif // C_CPHONENEWCALLCMDHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphoneresourceresolvervoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Concrete resource resolver for VoIP specific PhoneUI resources.
+*
+*/
+
+
+#ifndef __CPHONERESOURCERESOLVERVOIP_H
+#define __CPHONERESOURCERESOLVERVOIP_H
+
+//  INCLUDES
+#include "cphoneresourceresolvergsm.h"
+
+
+// FORWARD DECLARATIONS
+class MPhoneResourceResolverRegister;
+
+// CLASS DECLARATION
+/**
+*  Concrete resource resolver for VoIP specific phoneapp resources.
+*/
+NONSHARABLE_CLASS( CPhoneResourceResolverVoIP ): public CPhoneResourceResolverGSM
+
+    {
+    public: // Constructors and destructor
+        /**
+        * Virtual Destructor
+        * @param None
+        * @return None
+        */
+        virtual ~CPhoneResourceResolverVoIP();
+
+        /**
+        * NewL function for creating the resolver.
+        * @param aMainResourceResolver: Pointer to the main resolver.
+        * @return CPhoneResourceResolver*
+        */
+        static CPhoneResourceResolverVoIP* NewL();
+    
+    public: // From MPhoneResourceResolver
+        /**
+        * Resolve resource id of given resource.
+        * @param aEnumUid: Uid of enumeration which contains needed 
+        *                  resource definition.
+        * @param aResource: ID of needed resource ( from enumeration ).
+        * @return Resource id.
+        */
+        TInt ResolveResourceID( const TInt& aResource ) const;       
+
+    protected:    // Constructors and destructor        
+        /**
+        * Protected constructor.
+        * @param None
+        * @return None
+        */
+        CPhoneResourceResolverVoIP();
+        
+        /**
+        * Two phase construction - Second phase.
+        * @param aMainResourceResolver: Pointer to the main resolver.
+        * @return None
+        */
+        void ConstructL();
+
+    protected: // Data
+
+        TInt iVoIPResourceOffset;       
+  
+    };
+
+#endif      // CPHONERESOURCERESOLVERVOIP_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonestatealertingvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     VoIP -specific Alerting state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATEALERTINGVOIP_H
+#define CPHONESTATEALERTINGVOIP_H
+
+// INCLUDES
+#include "cphonealerting.h"
+
+// CLASS DECLARATION
+/**
+*  VoIP -specific Alerting state
+*/
+NONSHARABLE_CLASS( CPhoneStateAlertingVoIP ): public CPhoneAlerting
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStateAlertingVoIP();
+
+        /**
+        * Creates the VoIP -specific Alerting state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneCallSetup
+        */
+        static CPhoneStateAlertingVoIP* NewL( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneCustomization& aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+
+          
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneStateAlertingVoIP( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneCustomization& aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+   
+        
+    private:
+
+        /**
+        * Handle EPEMessageConnected
+        */
+        void HandleConnectedL( TInt aCallId );
+        
+    };
+
+#endif // CPHONESTATEALERTINGVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonestatecallsetupvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     VoIP -specific Call setup state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATECALLSETUPVOIP_H
+#define CPHONESTATECALLSETUPVOIP_H
+
+// INCLUDES
+#include "cphonecallsetup.h"
+
+// CLASS DECLARATION
+/**
+*  VoIP -specific Call setup state
+*/
+NONSHARABLE_CLASS( CPhoneStateCallSetupVoIP ): public CPhoneCallSetup
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStateCallSetupVoIP();
+
+        /**
+        * Creates the VoIP -specific Call Setup state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneCallSetup
+        */
+        static CPhoneStateCallSetupVoIP* NewL( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneCustomization& aPhoneCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        virtual void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );       
+
+          
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneStateCallSetupVoIP( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneCustomization& aPhoneCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+        
+    private:
+
+        /**
+        * Handle EPEMessageConnecting
+        */
+        void HandleConnectingL( TInt aCallId );
+        
+    };
+
+#endif // CPHONESTATECALLSETUPVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonestateidlevoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     VoIP-specific idle state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATEIDLEVOIP_H
+#define CPHONESTATEIDLEVOIP_H
+
+// INCLUDES
+#include <settingsinternalcrkeys.h>
+#include "cphoneidle.h"
+
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+class MPhoneCustomization;
+class CPhoneStateUtilsVoip;
+
+// CLASS DECLARATION
+/**
+*  VoIP-specific idle state
+*/
+NONSHARABLE_CLASS( CPhoneStateIdleVoIP ): public CPhoneIdle
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStateIdleVoIP();
+
+        /**
+        * Creates the VoIP-specific Idle state class
+        * @param    aStateMachine       A container of state objects.
+        * @param    aViewCommandHandle  Handle to the PhoneUIView.
+        * @param    aCustomization      Handle to the phone customization.
+        * @return   An instance of class CPhoneStateIdleVoIP.
+        */
+        static CPhoneStateIdleVoIP* NewL( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle, 
+            MPhoneCustomization& aCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );  
+
+        /**
+        * Handles commands.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        *          (ETrue) or not (EFalse)
+        */
+        TBool HandleCommandL( TInt aCommand );
+            
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneStateIdleVoIP( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle, 
+            MPhoneCustomization& aCustomization );
+        
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+
+        /**
+         * Handles send command. 
+         */
+        void HandleSendCommandL();
+        
+        /**
+        * Dial the specified number. 
+        */
+        void DialL( const TDesC& aNumber, 
+            TPhoneNumberType aNumberType,
+            TDialInitiationMethod aDialMethod );
+
+        /**
+        * A message handling function for EPEMessageDialling
+        * @param aCallId: the call id of the call
+        */
+        void HandleDialingL( TInt aCallId );
+        
+        TBool IsEmergencyNumber( const TDesC& sString );
+
+    private:
+
+        /**
+         * Returns VoIP state utils.
+         * @return VoIP state utils.
+         */
+        CPhoneStateUtilsVoip& StateUtils();
+    };
+
+#endif // CPHONESTATEIDLEVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonestateincomingvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     VoIP-specific incoming state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATEINCOMINGVOIP_H
+#define CPHONESTATEINCOMINGVOIP_H
+
+// INCLUDES
+#include "cphoneincoming.h"
+
+// CLASS DECLARATION
+/**
+*  VoIP-specific incoming state
+*/
+NONSHARABLE_CLASS( CPhoneStateIncomingVoIP ): public CPhoneIncoming
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStateIncomingVoIP();
+        
+        /**
+        * Creates the VoIP specific Incoming state class
+        * @param aStateMachine: a state machine
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneEmergency
+        */
+        static CPhoneStateIncomingVoIP* NewL( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneCustomization& aPhoneCustomization );    
+                        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneStateIncomingVoIP( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle,
+            MPhoneCustomization& aPhoneCustomization );
+                    
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+
+        /**
+        * Handles long hash key
+        */
+        virtual void HandleLongHashL();
+
+        /**
+        * Handles audio play stoping
+        */        
+        virtual void HandleAudioPlayStoppedL();
+    };
+
+#endif // CPHONESTATEINCOMINGVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonestatemachinevoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       The class implements a VoIP-specific state machine
+*
+*/
+
+
+#ifndef CPHONESTATEMACHINEVOIP_H
+#define CPHONESTATEMACHINEVOIP_H
+
+//  INCLUDES
+#include "cphonestatemachinegsm.h"
+
+// FORWARD DECLARATIONS
+class CPhoneCustomizationVoip;
+class CPhoneVoIPErrorMessagesHandler;
+class CPhoneStateUtilsVoip;
+
+// CLASS DECLARATION
+
+/**
+ *  The class implements a VoIP-specific state machine.
+ */
+NONSHARABLE_CLASS( CPhoneStateMachineVoIP ): public CPhoneStateMachineGSM
+    {
+    public:
+
+        /**
+         * Destructor.
+         */
+        virtual ~CPhoneStateMachineVoIP();
+
+        /**
+         * Creates the only instance of state machine class.
+         * @param   aViewCommandHandle  A handle to the Phone UI view.
+         * @return  An instance of class CPhoneStateMachine.
+         */
+        static CPhoneStateMachineVoIP* NewL(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+
+        /**
+         * Returns active state.
+         */
+        MPhoneState* State();
+
+        /**
+         * Sets voip error message handler.
+         * @param   aErrorHandler   Voip error message handler.
+         */
+        void SetVoipErrorMessageHandler(
+            CPhoneVoIPErrorMessagesHandler& aErrorHandler );
+
+        /**
+         * Returns error message handler instance.
+         * @return  Voip error message handler.
+         */
+        CPhoneVoIPErrorMessagesHandler& VoipErrorMessageHandler() const;
+        
+        /**
+         * Returns utility class for voip states.
+         * @return  Voip state utils.
+         */
+        CPhoneStateUtilsVoip& StateUtils();
+
+    private:
+
+        /**
+         * By default EPOC constructor is private.
+         */
+        CPhoneStateMachineVoIP(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+
+        /**
+         * ConstructL()
+         */
+        void ConstructL();
+
+    private: // Data
+
+        /**
+         * Voip customization.
+         * Own.
+         */
+        CPhoneCustomizationVoip* iVoipCustomization;
+
+        /**
+         * Voip error message handler.
+         * Now own.
+         */
+        CPhoneVoIPErrorMessagesHandler* iVoipErrorMessageHandler;
+        
+        /**
+         * Voip state utils.
+         * Own.
+         */
+        CPhoneStateUtilsVoip* iStateUtils;
+
+    };
+
+#endif      // CPHONESTATEMACHINEVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonestatesinglevoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     VoIP-specific single state implementation.
+*
+*/
+
+
+#ifndef CPHONESTATESINGLEVOIP_H
+#define CPHONESTATESINGLEVOIP_H
+
+// INCLUDES
+#include "cphonesinglecall.h"
+
+// CLASS DECLARATION
+class CPhoneStateUtilsVoip;
+
+/**
+*  VoIP-specific single state
+*/
+NONSHARABLE_CLASS( CPhoneStateSingleVoIP ): public CPhoneSingleCall
+    {
+    public:  
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneStateSingleVoIP();
+        
+        /**
+        * Creates the VoIP specific Single state class.
+        * @param    aStateMachine       A state machine.
+        * @param    aViewCommandHandle  Handle to the PhoneUIView.
+        * @param    aCustomization      Handle to the phone customization.
+        * @return   An instance of class CPhoneStateSingleVoIP.
+        */
+        static CPhoneStateSingleVoIP* NewL( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle, 
+            MPhoneCustomization& aCustomization );
+
+        /**
+        * A message handling function for Phone Engine messages
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        */
+        void HandlePhoneEngineMessageL(
+            const TInt aMessage, 
+            TInt aCallId );
+            
+        /**
+        * Handles commands.
+        * @param aCommand It is the code of the command to be handled.
+        * @returns boolean value was the command handled by the state 
+        *          (ETrue) or not (EFalse)
+        */
+        TBool HandleCommandL( TInt aCommand );
+
+        /**
+        * Handle processed (short, long) key messages from the key event
+        * handler
+        * @param aMessage a key message
+        * @param aCode key event code
+        */
+        void HandleKeyMessageL( TPhoneKeyEventMessages aMessage,
+                TKeyCode aKeyCode );
+                        
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneStateSingleVoIP( 
+            MPhoneStateMachine& aStateMachine, 
+            MPhoneViewCommandHandle& aViewCommandHandle, 
+            MPhoneCustomization& aCustomization );
+                    
+        /**
+        * ConstructL()
+        */
+        virtual void ConstructL();
+
+    private:
+        
+        /**
+         * Start calling
+         */
+        void StartCallingL();
+        
+        /**
+         * Launches unattended call transfer acceptance query dialog.
+         */
+        void LaunchUnattendedTransferAcceptanceQueryL();
+        
+        /**
+         * Resolves dialog text to be shown in unattended call transfer query
+         * dialog.
+         * @param    aQueryText  On return contains resolved query text.
+         */
+        void ResolveUnattendedTransferAcceptanceQueryDialogTextL( 
+            RBuf& aQueryText ) const;
+        
+        /**
+         * Handles user response to unattended transfer request.
+         * @param    aRequestAccepted    ETrue if request is accepted, 
+         * EFalse otherwise.
+         */
+        void HandleUnattendedTransferRequestResponseL( TBool aRequestAccepted );
+   
+        /**
+         * Returns VoIP state utils.
+         * @return VoIP state utils.
+         */
+        CPhoneStateUtilsVoip& StateUtils();
+    };
+
+#endif // CPHONESTATESINGLEVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonestateutilsvoip.h	Fri Jun 04 10:19:18 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:  Utility class for voip-states.
+*
+*/
+
+
+#ifndef C_CPHONESTATEUTILSVOIP_H
+#define C_CPHONESTATEUTILSVOIP_H
+
+#include <e32base.h>
+
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+class CPhCltEmergencyCall;
+class CConvergedServiceSelector;
+
+/**
+ *  Provides common utility functions for voip-states.
+ *
+ *  @lib PhoneUIVoIPExtension.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPhoneStateUtilsVoip ) : public CBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneStateUtilsVoip* NewL( MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+    
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneStateUtilsVoip* NewLC( MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CPhoneStateUtilsVoip();
+
+    /**
+     * Dials a VoIP call.
+     * 
+     * @param   aNumber     Phone number.
+     * @param   aServiceId  Service identifier.
+     */
+    void DialVoIPL( const TDesC& aNumber, TUint aServiceId = 0 );
+    
+    /**
+     * Checks is VoIP preferred call type. If VoIP is preferred, service 
+     * identifier is returned by the parameter aServiceId.
+     * 
+     * @param   aServiceId  Service identifier.
+     * @return  ETrue if VoIP is preferred, EFalse otherwise.
+     */
+    TBool IsVoipPreferredCall( TUint& aServiceId );
+    
+    /**
+     * Checks whether number entry contain VoIP number.
+     * 
+     * @return  ETrue if number entry contains VoIP number, EFalse otherwise.
+     */
+    TBool IsVoipNumber();
+
+    /**
+     * Selects VoIP service and makes dial.
+     * 
+     * @param  aNumber      Phone number.
+     * @param  aServiceId   Service identifier for the call.
+     */
+    void SelectServiceAndDialL( const TDesC& aNumber = KNullDesC,
+        TUint aServiceId = 0 );
+
+    /**
+     * Checks is the given number valid emergency number.
+     * 
+     * @param   aNumber     Number to be checked.
+     * @return  ETrue if number is emergency number, EFalse otherwise.
+     */
+    TBool IsEmergencyNumber( const TDesC& aNumber ) const;
+    
+private:
+
+    CPhoneStateUtilsVoip( MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+
+    void ConstructL();
+
+private: // data
+
+    /** 
+     * Number entry string buffer.
+     * Own.
+     */
+    HBufC* iBuffer;
+
+    /** 
+     * Phone client emergency call.
+     * Own.
+     */
+    CPhCltEmergencyCall* iEmergencyCall;
+    
+    /** 
+     * Service selector.
+     * Own.
+     */
+    CConvergedServiceSelector* iServiceSelector;
+    
+    /**
+     * Interface to the state machine.
+     * Not own.
+     */
+    MPhoneStateMachine& iStateMachine;
+    
+    /**
+     * Interface to the phone ui view.
+     * Not own.
+     */
+    MPhoneViewCommandHandle& iViewCommandHandle;
+    };
+
+
+#endif // C_CPHONESTATEUTILSVOIP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonetransferdialercontroller.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     Unattended transfer dialer customization
+*     controller
+*
+*/
+
+
+#ifndef CPHONETRANSFERDIALERCONTROLLER_H_
+#define CPHONETRANSFERDIALERCONTROLLER_H_
+
+// INCLUDES
+#include <aknbutton.h>
+#include "mphonedialercontroller.h"
+
+// FORWARD DECLARATIONS
+class CAknToolbar; 
+
+/**
+*  VoIP unattended transfer dialer customization
+*/
+NONSHARABLE_CLASS( CPhoneTransferDialerController ): public CBase,
+                                       public MPhoneDialerController
+    {
+    public:      
+
+        static CPhoneTransferDialerController* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneTransferDialerController();
+
+    public: // From MDialerController
+    
+        
+        /**
+        * Initializes the controller. 
+        * @param    aToolbar    CAknToolbar instance.
+        * @since    S60 v5.1
+        */ 
+        void InitializeL( CAknToolbar& aToolbar );
+        
+        /**
+        * Returns Cba resource id
+        * @return Resource Id of the softkeys
+        * @since S60 v5.1
+        */
+        TInt CbaResourceId() const;
+        
+        /**
+        * Returns Menu resource id
+        * @return Id of the menu resource
+        * @since S60 v5.1
+        */
+        TInt MenuResourceId() const;
+        
+        /**
+        * Returns number entry prompt text
+        * @return Reference to text to be shown on number entry
+        * @since S60 v5.1
+        */
+        const TDesC& NumberEntryPromptTextL();
+        
+        /**
+        * Handles the number entry empty event
+        * @param aEmpty ETrue if numberentry is empty
+        * @since S60 v5.1
+        */
+        void HandleNumberEntryIsEmpty( TBool aEmpty );
+        
+        /**
+        * Sets visibility of buttons created by the implementation
+        * @param aShow ETrue if numberentry is empty
+        * @since S60 v5.1
+        */
+        void ShowButtons( TBool aShow );
+        
+    private:
+    
+        /**
+         * Creates instance of CAKnButton
+         * @param aNormalIconId Button normal icon id
+         * @param aNormalMaskId Mask id
+         * @param aTooltipText Reference to tooltip text
+         * @param aSkinIconId Skin icon id
+         * @return Pointer to created button instance
+         */
+        CAknButton* CreateButtonLC( TInt aNormalIconId,
+                                    TInt aNormalMaskId,
+                                    const TDesC& aTooltipText, 
+                                    const TAknsItemID& aSkinIconId ) const; 
+        
+        /**
+         * Returns tool tip for specific command
+         * @param aCommandId Command id which the tooltip text 
+         * is needed
+         * @return Pointer to descriptor containing tooltip text
+         */
+        HBufC* GetTooltipTextL( TInt aCommandId ) const; 
+        
+        TAknsItemID SkinId( TInt aIconIndex ) const;
+
+    protected:
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        CPhoneTransferDialerController();
+            
+    private: // Data
+    
+        // Pointer to CAknToolbar, Not own
+        CAknToolbar* iToolbar;
+        
+        // ETrue if number entry input field is empty
+        TBool iNumberEntryIsEmpty;
+        
+        // Number entry prompt text ("Address:")
+        HBufC* iNumberEntryPromptText;
+        
+        // ETrue if initialized 
+        TBool iIsInitialized;
+      
+    };
+
+#endif /*CPHONETRANSFERDIALERCONTROLLER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphoneuistatemachinefactoryvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of CPhoneUIStateMachineFactoryVoIP class.
+*
+*/
+
+
+#ifndef CPHONEUISTATEMACHINEFACTORYVOIP_H
+#define CPHONEUISTATEMACHINEFACTORYVOIP_H
+
+// INCLUDES
+#include "cphoneuistatemachinefactorybase.h"
+
+/**
+* This class implements VoIP-specific variant of the PhoneUIStateMachine factory.
+*/
+NONSHARABLE_CLASS( CPhoneUIStateMachineFactoryVoIP ):   
+    public CPhoneUIStateMachineFactoryBase
+    {
+    public: // From MPhoneUIStateMachineFactory
+
+        /**
+        * See MPhoneUIStateMachineFactory for details
+        */
+        MPhoneStateMachine* CreatePhoneStateMachineL(
+            MPhoneViewCommandHandle* aViewCommandHandle );
+
+        /**
+        * See MPhoneUIStateMachineFactory for details
+        */
+        CPhoneResourceResolverBase* CreatePhoneResourceResolverL();
+        
+        /**
+        * See MPhoneUIStateMachineFactory for details
+        */
+        CPhoneErrorMessagesHandler* CreatePhoneErrorMessagesHandlerL(
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneStateMachine* aStateMachine );
+    };
+
+#endif      // CPHONEUISTATEMACHINEFACTORYVOIP_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphoneunattendedtransfercmdhandler.h	Fri Jun 04 10:19:18 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: Handles commands related to unattended transfer.
+*
+*/
+
+
+#ifndef C_CPHONEUNATTENDEDTRANSFERCMDHANDLER_H
+#define C_CPHONEUNATTENDEDTRANSFERCMDHANDLER_H
+
+#include <e32base.h>
+
+class CPhoneTransferDialerController;
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+
+/**
+ *  Handles commands related to unattended transfer.
+ *
+ *  @lib PhoneUIVoIPExtension.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPhoneUnattendedTransferCmdHandler ) : public CBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneUnattendedTransferCmdHandler* NewL( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+
+    /**
+     * Two-phased constructor.
+     * @param    aStateMachine       Handle to the state machine.
+     * @param    aViewCommandHandle  Handle to the PhoneUIView.
+     */
+    static CPhoneUnattendedTransferCmdHandler* NewLC( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CPhoneUnattendedTransferCmdHandler();
+
+    /**
+     * Handles VoIP commands related to unattended transfer.
+     * @param   aCommand    VoIP command identifier.
+     */
+    void HandleCommandL( TInt aCommand );
+    
+private:
+
+    CPhoneUnattendedTransferCmdHandler(         
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle );
+
+    void ConstructL();
+
+    /**
+     * Shows customized dialer for adding unattended transfer target address. 
+     */
+    void ShowTransferDialerL();
+     
+    /**
+     * Starts unattended transfer. 
+     */
+    void DoUnattendedTransferL();
+     
+    /**
+     * Closes transfer dialer view.
+     */
+    void CloseTransferDialerL();
+          
+    /**
+     * Opens single item contact fetch.
+     * @param   aFetchType  Type of the fetch.
+     */
+    void OpenSingleItemContactFetchL( TInt aFetchType );
+    
+    /**
+     * Shows "Waiting acceptance..."-note
+     */
+    void ShowWaitingAcceptanceNoteL();
+    
+private: // data
+
+    /**
+     * Unattended transfer dialer customization.
+     */
+    CPhoneTransferDialerController* iTransferDialerController;
+
+    /**
+     * Interface to the state machine.
+     * Not own.
+     */
+    MPhoneStateMachine& iStateMachine;
+    
+    /**
+     * Interface to the phone ui view.
+     * Not own.
+     */
+    MPhoneViewCommandHandle& iViewCommandHandle;
+    };
+
+
+#endif // C_CPHONEUNATTENDEDTRANSFERCMDHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonevcchandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Voice call continuity (VCC)-specific class.
+*
+*/
+
+#ifndef C_CPHONEVCCHANDLER_H
+#define C_CPHONEVCCHANDLER_H
+
+// INCLUDES
+#include <telmenuextension.h>
+#include <vccuipspropertylistener.h>
+
+// FORWARD DECLARATIONS
+class MPhoneStateMachine;
+class MPhoneViewCommandHandle;
+class CPhoneTimer;
+class CEikMenuPane;
+
+// CLASS DECLARATION
+/**
+*  VoIP vcc-specific class
+*/
+NONSHARABLE_CLASS( CPhoneVccHandler ): public CBase, 
+        public MVccPsPropertyListenerObserver
+    {
+    public:      
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneVccHandler();
+
+        /**
+        * Creates the VCC-specific VoIP class
+        * @param aStateMachine: a container of state objects
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneVccHandler
+        */
+        static CPhoneVccHandler* NewL( 
+            MPhoneStateMachine& aStateMachine,
+            MPhoneViewCommandHandle& aViewCommandHandle );
+      
+        /**
+        * StartManualHandover
+        * @param aCommand a command parameter
+        */
+        void StartManualHandoverL( TInt aCommand );
+        
+        /**
+        * Adds Manual Handover menu item to menu.
+        * @param aArray Active call array.
+        * @param aResourceId Menu bar resource identifier.
+        * @param aMenuPane Menu pane.
+        */
+        void AddHandoverMenuItemL( 
+            RArray<CTelMenuExtension::TCallInfo>& aArray, 
+            TInt aResourceId,
+            CEikMenuPane& aMenuPane );
+         
+    protected:
+
+        CPhoneVccHandler( 
+            MPhoneStateMachine& aStateMachine,
+            MPhoneViewCommandHandle& aViewCommandHandle );
+        
+        void ConstructL();
+        
+    private:        
+     
+        /**
+        * StartHandoverNoteTimerL
+        */        
+        void StartHandoverNoteTimerL();
+       
+        /**
+        * CancelHandoverNoteTimer if running
+        */ 
+        void CancelHandoverNoteTimerL();
+        
+        /**
+        * Callback function for launching Handover wait note
+        * This is called when HO note timer timeout is
+        * reached
+        * @param aAny - not used
+        */
+        static TInt HandoverNoteTimerCallbackL( TAny* aAny );
+        
+        /**
+        * StartHandoverNoteTimerL
+        */ 
+        void RemoveHandoverNoteL();
+        
+        /**
+        * HandoverInProgressNote
+        * @param aCommand a command parameter
+        */
+        void HandoverInProgressNoteL( TInt aCommand );
+
+        // From MVccPsPropertyListenerObserver        
+        /**
+        *  Gets called when PS key is changed
+        * @param aKeyId 
+        * @param aValue 
+        **/
+        void VccPropertyChangedL( const TUint aKeyId,
+                                    const TInt aValue );
+        
+        /**
+        * returns notification tone mode (off=0 or on=1), or 0 in error situations
+        */            
+         TInt GetHoNotifToneModeL();
+     
+         /**
+         * GetVccServiceIdL
+         */             
+         TInt GetVccServiceIdL();
+         
+    private: // Data
+                
+        /** 
+         * Interface for setting and getting active state
+         */
+        MPhoneStateMachine& iStateMachine;
+        
+        /** 
+         * Reference to the Phone UI View command handle
+         */
+        MPhoneViewCommandHandle& iViewCommandHandle;
+        
+        // Timer.
+        CPhoneTimer* iHandoverNoteTimer;
+        
+        // Handover is ready
+        TBool iVccHoReady;
+        
+        // Handover not available
+        TBool iVccUnavailable;
+        
+        // Handover allowed WLAN to GSM
+        TBool iVccHoAllowedToGsm;
+        
+        // Handover allowed GSM to WLAN
+        TBool iVccHoAllowedToWlan;
+        
+        // Handover not allowed if multicall
+        TBool iNoHoIfMultiCall;
+        
+        // Listens for the hand-over commands
+        CVccUiPsPropertyListener* iPropListener; 
+        };
+
+#endif // C_CPHONEVCCHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphoneviewcustomizationvoip.h	Fri Jun 04 10:19:18 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: VoIP-specific view customization implementation.
+*
+*/
+
+#ifndef C_CPHONEVIEWCUSTOMIZATIONVOIP_H
+#define C_CPHONEVIEWCUSTOMIZATIONVOIP_H
+
+#include <e32base.h>
+#include "mphoneviewcustomization.h"
+#include "phoneviewcommanddefinitions.h"
+
+class CConvergedServiceSelector;
+class MPhoneViewBlockingDialogObserver;
+class TPhoneCommandParam;
+class MPhoneCustomization;
+
+/**
+ *  Voip-specific view customization implementation.
+ *  
+ *  @lib PhoneUIVoIPExtension.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPhoneViewCustomizationVoip ) 
+        : public CBase, public MPhoneViewCustomization
+    {
+
+public:
+    
+    /**
+     * Two-phased constructor.
+     * @param aCustomization: Handle to phone customization 
+     */
+    static CPhoneViewCustomizationVoip* NewL( 
+        MPhoneCustomization& aCustomization );
+    
+    /**
+     * Two-phased constructor.
+     * @param aCustomization: Handle to phone customization
+     */
+    static CPhoneViewCustomizationVoip* NewLC( 
+        MPhoneCustomization& aCustomization );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CPhoneViewCustomizationVoip();
+
+// from base class MPhoneViewCustomization
+    
+    /**
+     * From MPhoneViewCustomization.
+     * Handles custom view commands.
+     * 
+     * @param   aBlockingObserver   Blocking dialog observer.
+     * @param   aCmdId              Command identifier.
+     * @param   aCommandParam       Command parameter.
+     * @return  ETrue if command was handled.
+     */
+    TBool HandleCommandL( 
+        MPhoneViewBlockingDialogObserver& aBlockingObserver,
+        TPhoneViewCommandId aCmdId,
+        TPhoneCommandParam* aCommandParam );
+    
+
+    /**
+     * From MPhoneViewCustomization.
+     * Removes blocking dialogs.
+     */
+    void RemoveDialog();
+
+private:
+
+    CPhoneViewCustomizationVoip( MPhoneCustomization& aCustomization );
+
+    void ConstructL();
+    
+    /**
+     * Makes service selection.
+     * @param   aBlockingObserver   Blocking dialog observer.
+     * @param   aCommandParam       A command parameter.
+     * @return  ETrue if service was selected.
+     */
+    TBool SelectVoipService( 
+        MPhoneViewBlockingDialogObserver& aBlockingObserver,
+        TPhoneCommandParam* aCommandParam );
+
+private: // data
+
+    /** 
+     * Service selector.
+     * Own.
+     */
+    CConvergedServiceSelector* iServiceSelector; 
+    
+    /*
+     * Handle to customization
+     */
+    MPhoneCustomization& iPhoneCustomization;
+    };
+
+#endif // C_CPHONEVIEWCUSTOMIZATIONVOIP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/cphonevoiperrormessageshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       Class that does processing for Phone Engine messages that are common
+*       for all VoIP states. Most of the GSM states are intressed of these 
+*       messages but due to the class architecture they don't have any single
+*       state class to be put into. This class exists to minimize duplicate
+*       code so that not every VoIP class need to implement these same handlings
+*       for the same messages.
+*
+*/
+
+
+#ifndef __CPHONEVOIPERRORMESSAGESHANDLER_H
+#define __CPHONEVOIPERRORMESSAGESHANDLER_H
+
+// INCLUDES
+#include <w32std.h>
+#include "cphoneerrormessageshandler.h"
+
+// FORWARD DECLARATIONS
+class MPhoneErrorMessagesHandlerRegister;
+class MPhoneViewCommandHandle;
+class CPhoneCustomizationVoip;
+
+// CLASS DECLARATION
+
+/**
+* Class that does processing for Phone Engine error messages that are common
+* for all protocols.
+*
+*/
+NONSHARABLE_CLASS( CPhoneVoIPErrorMessagesHandler ): public CPhoneErrorMessagesHandler
+    {
+    public:
+        /**
+        * Creates the error handler instance
+        * @param aPhoneState: active state
+        * @param aViewCommandHandle: handle to the PhoneUIView
+        * @return an instance of class CPhoneErrorMessagesHandler
+        */
+        static CPhoneVoIPErrorMessagesHandler* NewL(            
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneStateMachine* aPhoneStateMachine );
+
+    public: //From MPhoneErrorMessagesHandler
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhoneVoIPErrorMessagesHandler();
+
+        /**
+        * Shows error specific notes, ie. error, warning and info notes
+        * related to the given error.
+        * @param aErrorInfo - Error info from Phone Engine
+        */
+        void ShowErrorSpecificNoteL( const TPEErrorInfo& aErrorInfo );
+       
+        
+    public:
+           
+        /**
+        * Shows global error note 
+        * @param aResourceId Text resource id for error note
+        * @param aText Text to be shown in error text
+        */
+        void SendGlobalErrorNoteWithTextL( TInt aResourceId, RBuf& aText );
+           
+        /**
+        * Gets name of specific service provider
+        * @param aServiceName Contains service provider name on return
+        * @param aServiceId Id of the service
+        */
+        void GetServiceProviderNameL( RBuf& aServiceName, TUint32 aServiceId );
+        
+        /**
+        * Shows error note that contains service name
+        * @param aResourceId Text resource id for error note
+        * @param aServiceId Id of the service which name will be shown on note
+        */
+        void ShowErrorNoteWithServiceNameL( 
+            TInt aResourceId, 
+            TUint32 aServiceId );
+        
+    protected:
+        
+        CPhoneVoIPErrorMessagesHandler( 
+            MPhoneViewCommandHandle* aViewCommandHandle,
+            MPhoneStateMachine* aPhoneStateMachine );
+            
+        void ConstructL();
+
+    private:
+
+        /**
+        * Return ETrue if voip call.
+        */
+        TBool IsVoIPCall( const TInt aCallId ) const;        
+        
+        /**
+        * Handle hold and resume error notes.
+        */
+        void HandleHoldErrorNotesL( const TInt aCallId, TBool aHold );
+        
+        /**
+        * Return remote info data, if available
+        * @param aCallid call id
+        * @param aData the returned remote info data
+        */
+        void GetRemoteInfoDataL( TInt aCallId, TDes& aData ) const;
+        
+        /**
+        * Shows service registration specific error notes
+        * @param aErrorCode - CCH error code  
+        */
+        void ShowRegistrationErrorNotesL( TInt aErrorCode );
+        
+        /**
+         * Check if Swap operation has failed
+         * @ret Return ETrue if Swap has failed
+         */
+        TBool HasSwapFailed() const;
+            
+    };
+
+#endif // CPHONEVOIPERRORMESSAGESHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/phonestatedefinitionsvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*   VoIP-specific phone state definitions.
+*
+*/
+
+
+#ifndef PHONESTATEDEFINITIONSVOIP_H
+#define PHONESTATEDEFINITIONSVOIP_H
+
+// INCLUDES
+
+#include "phoneconstants.h"
+#include "phonestatedefinitions.h"
+#include "phonestatedefinitionsgsm.h"
+#include "phoneviewcommanddefinitions.h"
+
+// DATA TYPES
+
+typedef TPhoneStateId TPhoneStateVoIPId;
+
+/**
+* View command definiations
+*/
+enum
+    {
+    EPhoneViewServiceSelection = EPhoneAmountOfCommands
+    };
+
+enum
+    { 
+    EPhoneStateVoIPIdle = EPhoneStateGSMLast,
+    EPhoneStateVoIPCallSetup
+    };
+
+#endif      // PHONESTATEDEFINITIONSVOIP_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/tphonecmdparamselector.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*   See class description.
+*
+*/
+
+#ifndef TPHONECMDPARAMSELECTOR_H
+#define TPHONECMDPARAMSELECTOR_H
+
+//  INCLUDES
+#include "tphonecommandparamvoip.h"
+
+// DATA TYPES
+
+/**
+* Phone number types
+*
+* EPhoneNumberTypeNotFound - phone number's type was not found
+* EPhoneNumberTypeCS - CS call can be made to the phone number
+* EPhoneNumberTypeVideo - video call can be made to the phone number
+* EPhoneCallTypeVoip - voip call can be made to the number/address
+*/
+enum TPhoneSsCallType
+{
+    EPhoneCallTypeNotFound = -1,
+    EPhoneCallTypeCS = 0,
+    EPhoneCallTypeVideo,
+    EPhoneCallTypeVoip
+};
+
+// CLASS DECLARATION
+
+/**
+*  A service selection parameter class.
+*  
+*/
+class TPhoneCmdParamSelector : public TPhoneUICommandParam
+    {
+    public:  
+        
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C TPhoneCmdParamSelector();
+
+    public: 
+        
+        /**
+        * Sets the service id.
+        * @param aServiceId Service id
+        */
+        IMPORT_C void SetServiceId( const TUint aServiceId );
+
+        /**
+        * Returns the service id.
+        * @return Returns the service id.
+        */
+        IMPORT_C TUint ServiceId();
+        
+        /**
+        * Sets the call type.
+        * @param aCallType call type
+        */
+        IMPORT_C void SetCallType( TPhoneSsCallType aCallType );
+        
+        /**
+        * Returns the call type.
+        * @return phone call type
+        */
+        IMPORT_C TPhoneSsCallType CallType();
+        
+        /**
+        * Sets the registration status.
+        * @param aEnabled registration status to be set.
+        */
+        IMPORT_C void SetRegStatus( TBool aEnabled );
+        
+        /**
+        * Returns the registration status.
+        * @return ETrue if service registered.
+        */
+        IMPORT_C TBool RegStatus();
+
+
+    private:   
+
+        /**
+        * The service id
+        */
+        TUint iServiceId;
+        
+        /**
+        * The call type
+        */
+        TPhoneSsCallType iCallType;
+        
+        /**
+        * Registration status
+        */
+        TBool iEnabled;
+    };
+
+#endif      // TPHONECMDPARAMSELECTOR_H   
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/tphonecommandparamvoip.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for voip command parameter classes.
+*
+*/
+
+#ifndef TPHONECOMMANDPARAMVOIP_H
+#define TPHONECOMMANDPARAMVOIP_H
+
+//  INCLUDES
+#include <e32std.h>
+#include "tphonecommandparam.h"
+
+
+// CLASS DECLARATION
+
+/**
+*  A base class for voip command parameter.
+*  
+*/
+class TPhoneCommandParamVoip : public TPhoneCommandParam
+    {
+    public: // enum
+
+    /** 
+     * TPhoneParamIdVoip is list of possible voip 
+     * phone ui command parameters 
+     */
+    enum TPhoneParamIdVoip
+        {
+        EPhoneParamIdSelector = EPhoneParamIdLast
+        };
+
+    };
+
+#endif // TPHONECOMMANDPARAMVOIP_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/inc/tphonetouchpanewrapper.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Wrapper class to touch pane interface.
+*
+*/
+
+
+#ifndef TPHONETOUCHPANEWRAPPER_H
+#define TPHONETOUCHPANEWRAPPER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <teltouchpaneextension.h>
+
+/**
+ * Wrapper class to touch pane interface.
+ *
+ * @since S60 5.1
+ */
+NONSHARABLE_CLASS( TPhTouchPaneWrapper ): public MTelTouchPaneExtension
+    {
+
+public:
+    TPhTouchPaneWrapper();
+     
+    /**
+     * Returns number of buttons in touch pane.
+     *
+     * @since S60 v5.1
+     * @return Button count.
+     */
+    TInt NumberOfButtonsInPane()  const;
+
+    /**
+     * Returns command id assinged to button in given position.
+     * If button is toggling, currently active command is 
+     * returned.
+     *
+     * @since S60 v5.1
+     * @param aButtonIndex Button index starting 0.
+     * @return Command id assigned to given position.
+     */
+    TInt ButtonCommandId( TInt aButtonIndex )  const;
+
+    /**
+     * Sets button dimmed.
+     *
+     * @since S60 v5.1
+     * @param aCommand Command id.
+     * @param aDimmed  ETrue to set dimmed, EFalse to undim.
+     */
+    void SetButtonDimmed( TInt aCommand, TBool aDimmed );
+
+private:
+    
+    };
+
+
+#endif TPHONETOUCHPANEWRAPPER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonecallforwardqueryhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,370 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneCallForwardQueryHandler class.
+*
+*/
+
+#include <featmgr.h>
+#include <StringLoader.h>
+#include <mpeengineinfo.h>
+
+#include "cphonecallforwardqueryhandler.h"
+#include "cphonelogger.h"
+#include "mphonestatemachine.h"
+#include "phonerssvoip.h"
+#include "phoneappvoipcommands.hrh"
+#include "cphonestate.h"
+#include "cphonestateincall.h"
+#include "tphonecmdparamcustomdialer.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamglobalnote.h"
+#include "cphonemainresourceresolver.h"
+#include "cphonestatemachinevoip.h"
+#include "tphonecmdparamstring.h"
+#include "phoneviewcommanddefinitions.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::CPhoneCallForwardQueryHandler
+// C++ constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneCallForwardQueryHandler::CPhoneCallForwardQueryHandler( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    : iStateMachine( aStateMachine ), 
+      iViewCommandHandle( aViewCommandHandle ),
+      iMultipleChoicesArray( NULL )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::NewL
+// ---------------------------------------------------------------------------
+//
+CPhoneCallForwardQueryHandler* CPhoneCallForwardQueryHandler::NewL(
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneCallForwardQueryHandler* self = 
+        CPhoneCallForwardQueryHandler::NewLC( 
+            aStateMachine, aViewCommandHandle );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::NewLC
+// ---------------------------------------------------------------------------
+//
+CPhoneCallForwardQueryHandler* CPhoneCallForwardQueryHandler::NewLC(
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneCallForwardQueryHandler* self = 
+        new( ELeave ) CPhoneCallForwardQueryHandler( 
+            aStateMachine, aViewCommandHandle );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::~CPhoneCallForwardQueryHandler
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneCallForwardQueryHandler::~CPhoneCallForwardQueryHandler()
+    {
+    delete iMultipleChoicesArray;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::ShowMovedPermanentlyQueryL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::ShowMovedPermanentlyQueryL(
+        TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCallForwardQueryHandler::ShowMovedPermanentlyQueryL" )
+        
+    iCallId = aCallId;
+    iAddressArray = iStateMachine.PhoneEngineInfo()->
+        ForwardAddressChoices( aCallId );
+    
+    if ( NULL == iAddressArray )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    
+    iQueryType = EPhoneMovedPermanently;
+    TPhoneCmdParamQuery queryParam;
+    queryParam.SetQueryCommandObserver( *this );
+    queryParam.SetTone( EAvkonSIDInformationTone );
+    queryParam.SetQueryType( EPhoneGlobalQueryDialog );
+  
+    HBufC* queryPrompt = StringLoader::LoadLC( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                    EPhoneVoIPMovedPermanentlyQueryHeader ));
+   
+    queryParam.SetQueryPrompt( *queryPrompt );
+
+    queryParam.SetDefaultCba(             
+        CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPMovedPermanentlySoftkeys ) );
+  
+    iCommandProcessed = EFalse;
+    
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewShowQuery, &queryParam );
+    
+    CleanupStack::PopAndDestroy( queryPrompt );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::ShowMultipleChoicesQueryL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::ShowMultipleChoicesQueryL(
+        TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCallForwardQueryHandler::ShowMultipleChoicesQueryL" )
+        
+    iCallId = aCallId;
+    iAddressArray = iStateMachine.PhoneEngineInfo()->
+        ForwardAddressChoices( aCallId );
+    
+    if ( NULL == iAddressArray )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    
+    ResetMultipleChoicesArrayL( *iAddressArray );
+    
+    iQueryType = EPhoneMultipleChoices;
+    TPhoneCmdParamQuery queryParam;
+    queryParam.SetQueryCommandObserver( *this );
+    queryParam.SetTone( EAvkonSIDInformationTone );
+    queryParam.SetQueryType( EPhoneCustomListQueryDialog );
+    queryParam.SetItemTextArrayForListQuery( 
+            static_cast<MDesCArray&> ( *iMultipleChoicesArray ) );
+
+    queryParam.SetQueryResourceId( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                    EPhoneVoIPMultipleChoicesListQuery ) );
+
+    iCommandProcessed = EFalse;
+    
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewShowQuery, &queryParam );
+    
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::AddToContacsL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::AddToContacsL(
+        TBool aCreateNew )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCallForwardQueryHandler::AddToContacsL" )
+    
+    if ( !iAddressArray ||
+          0 == iAddressArray->Count() )
+        {
+        User::Leave( KErrNotFound );
+        }
+        
+    HBufC* buf = HBufC::NewLC( iAddressArray->MdcaPoint(0).Length() );
+    buf->Des().Copy( iAddressArray->MdcaPoint(0) );
+    TPtr ptr( buf->Des() );
+
+    iCommandProcessed = EFalse;
+    
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+    iViewCommandHandle.ExecuteCommandL(
+        aCreateNew ? EPhoneViewAddContactByString :
+                     EPhoneViewUpdateContactByString,
+        &stringParam );   
+    
+    CleanupStack::PopAndDestroy( buf );
+    
+    // Forward call to array index 0
+    ForwardCallToAddressL( 0 );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::SaveAddressToContactsL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::SaveAddressToContactsL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+       "CPhoneCallForwardQueryHandler::SaveAddressToContactsL" )
+    
+    TPhoneCmdParamQuery queryDialogParam;
+    iQueryType = EPhoneQueryAddToContacts;
+    queryDialogParam.SetQueryCommandObserver( *this );
+    queryDialogParam.SetQueryType( EPhoneContactsListQuery );
+    queryDialogParam.SetQueryResourceId(
+           CPhoneMainResourceResolver::Instance()->
+               ResolveResourceID( EPhoneAddtoContactsListQuery )  );
+    
+    iCommandProcessed = EFalse;
+    
+    // Display dialog        
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewShowQuery,
+       &queryDialogParam );
+       
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::ProcessCommandL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::ProcessCommandL(
+        TInt aCommandId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+       "CPhoneCallForwardQueryHandler::ProcessCommandL" )
+    
+    if ( iCommandProcessed )
+        {
+        return;
+        }
+    
+    iCommandProcessed = ETrue;
+    
+    if ( iQueryType == EPhoneQueryAddToContacts )
+        {
+        switch ( aCommandId )
+            {          
+            case EPhoneNumberAcqCmdSave:
+                AddToContacsL( ETrue );     
+                break;
+                
+            case EPhoneNumberAcqCmdAddToName:
+                AddToContacsL( EFalse );     
+                break;
+            case EAknSoftkeyCancel:
+                iStateMachine.SendPhoneEngineMessage( 
+                        MPEPhoneModel::EPEMessageRelease );     
+                break;
+            }
+        }
+    else if ( iQueryType == EPhoneMovedPermanently )
+        {
+        switch ( aCommandId )
+            {          
+            case EAknSoftkeyOk:
+                SaveAddressToContactsL();     
+                break;
+                
+            default:
+                iStateMachine.SendPhoneEngineMessage( 
+                        MPEPhoneModel::EPEMessageRelease );  
+                break;
+            }
+        }
+    else if ( iQueryType == EPhoneMultipleChoices )
+        {
+        if ( iAddressArray && aCommandId >= 0 && 
+             aCommandId < iAddressArray->MdcaCount() )
+            {
+            ForwardCallToAddressL( aCommandId );
+            }
+        else
+            {
+            iStateMachine.SendPhoneEngineMessage( 
+                    MPEPhoneModel::EPEMessageRelease );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::ShowCallForwardedNoteL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::ShowCallForwardedNoteL()
+    {
+    __LOGMETHODSTARTEND(PhoneUIVoIPExtension, 
+            "CPhoneCallForwardQueryHandler::ShowCallForwardedNoteL( ) ");
+   
+    CPhoneState* phoneState = 
+        static_cast< CPhoneState* >( iStateMachine.State() );       
+            
+    phoneState->SendGlobalInfoNoteL( EPhoneRemoteForwarding );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::ResetMultipleChoicesArrayL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::ResetMultipleChoicesArrayL(
+        const MDesC8Array& aAddressArray )
+    {
+    __LOGMETHODSTARTEND(PhoneUIVoIPExtension, 
+            "CPhoneCallForwardQueryHandler::ResetMultipleChoicesArrayL( ) ");
+   
+    delete iMultipleChoicesArray;
+    iMultipleChoicesArray = NULL;
+    
+    iMultipleChoicesArray = 
+        new(ELeave) CDesC16ArrayFlat( aAddressArray.MdcaCount() );
+    
+    for ( TInt i=0; i< aAddressArray.MdcaCount() ; i++ )
+        {
+        HBufC* buf = HBufC::NewLC( aAddressArray.MdcaPoint(i).Length() );
+        buf->Des().Copy( aAddressArray.MdcaPoint(i) );
+        iMultipleChoicesArray->AppendL( *buf );
+        CleanupStack::PopAndDestroy( buf );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCallForwardQueryHandler::ForwardCallToAddressL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCallForwardQueryHandler::ForwardCallToAddressL(
+        TInt aIndex )
+    {
+    __LOGMETHODSTARTEND(PhoneUIVoIPExtension, 
+            "CPhoneCallForwardQueryHandler::ForwardCallToAddressL( ) ");
+   
+    ShowCallForwardedNoteL();
+    iStateMachine.PhoneEngineInfo()->SetForwardAddressIndex( aIndex );
+    iStateMachine.SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageForwardCallToAddress );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1393 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneCustomizationVoip class.
+*
+*/
+
+
+// INCLUDES
+#include <eikmenup.h>
+#include <spsettings.h>
+#include <spentry.h>
+#include <spproperty.h>
+#include <mpeengineinfo.h>
+#include "phoneresourceids.h"
+#include <avkon.rsg>
+#include <StringLoader.h>
+#include <featmgr.h>
+
+#include "cphonecustomizationvoip.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamstring.h"
+#include "cphonemainresourceresolver.h"
+#include "mphonestatemachine.h"
+#include "cphonelogger.h"
+#include "cphonecenrepproxy.h"
+#include "phoneui.pan"
+#include "mphoneviewcommandhandle.h"
+#include "tphonecmdparamdynmenu.h"
+#include "phoneappvoipcommands.hrh"
+#include "phonerssvoip.h"
+#include "tphonecmdparamcallstatedata.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamcallheaderdata.h"
+#include "cphoneextensionhandler.h"
+#include "cphonestate.h"
+#include "tphonecmdparamglobalnote.h"
+#include "cphonestatemachinevoip.h"
+#include "cphonevoiperrormessageshandler.h"
+#include "cphoneviewcustomizationvoip.h"
+#include "cphonestateutilsvoip.h"
+#include "cphoneunattendedtransfercmdhandler.h"
+#include "tphonecmdparampointer.h"
+#include "cphonenewcallcmdhandler.h"
+#include "cphonecallforwardqueryhandler.h"
+#include "cphonekeys.h"
+
+// CONSTANTS
+const TInt KMaxLengthForSIPURIFirstLine = 15;
+const TInt KMaxLengthForSIPURITwoLines = 30;
+const TInt KMaxLengthForSIPURI = 256;
+
+_LIT( KVoipAt, "@" );
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneCustomizationVoip::CPhoneCustomizationVoip( 
+    MPhoneStateMachine& aStateMachine,
+    MPhoneViewCommandHandle& aViewCommandHandle ) : 
+    iCoeEnv( *CCoeEnv::Static() ),
+    iStateMachine( aStateMachine ),
+    iViewCommandHandle( aViewCommandHandle )
+    {
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::~CPhoneCustomizationVoip()
+// Destructor
+// -----------------------------------------------------------
+//
+CPhoneCustomizationVoip::~CPhoneCustomizationVoip()
+    {
+    delete iCallForwardHandler;
+    delete iExtensionHandler;
+    delete iPhoneViewCustomization;
+    delete iTransferCmdHandler;
+    delete iNewCallCmdHandler;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::ConstructL()
+// Constructor
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::ConstructL()
+    {
+    // Set view customization
+    iPhoneViewCustomization = CPhoneViewCustomizationVoip::NewL( *this );
+    TPhoneCmdParamPointer pointerParam;
+    pointerParam.SetPointer( 
+        static_cast<MPhoneViewCustomization*>( iPhoneViewCustomization ) );
+    iViewCommandHandle.ExecuteCommand( EPhoneViewSetViewCustomization, 
+        &pointerParam );
+    // Set touch button customization
+    pointerParam.SetPointer( 
+        static_cast<MPhoneButtonCustomization*>( this ) );
+    iViewCommandHandle.ExecuteCommand( EPhoneViewSetButtonCustomization, 
+        &pointerParam );
+    
+    // Set phone customization
+    pointerParam.SetPointer( static_cast<MPhoneCustomization*>( this ) );
+    iViewCommandHandle.ExecuteCommand( EPhoneViewSetPhoneCustomization, 
+        &pointerParam );
+    
+    iExtensionHandler = CPhoneExtensionHandler::NewL();
+    iTransferCmdHandler = CPhoneUnattendedTransferCmdHandler::NewL( 
+        iStateMachine, iViewCommandHandle );
+        
+    iNewCallCmdHandler = CPhoneNewCallCmdHandler::NewL( 
+        iStateMachine, iViewCommandHandle );
+        
+    iCallForwardHandler = CPhoneCallForwardQueryHandler::NewL( 
+        iStateMachine, iViewCommandHandle );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::NewL()
+// Constructor
+// -----------------------------------------------------------
+//
+CPhoneCustomizationVoip* CPhoneCustomizationVoip::NewL( 
+    MPhoneStateMachine& aStateMachine,
+    MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneCustomizationVoip* self = new (ELeave) CPhoneCustomizationVoip( 
+        aStateMachine,
+        aViewCommandHandle );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::CustomizeMenuBarL
+// -----------------------------------------------------------
+// 
+void CPhoneCustomizationVoip::CustomizeMenuBarL(
+        TInt aResourceId, CEikMenuBar* aMenuBar )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CustomizeMenuBarL" );
+    
+    if ( 0 == aResourceId || !aMenuBar )
+        {
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlParameterNotInitialized ) );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::CustomizeMenuPaneL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::CustomizeMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+          "CPhoneCustomizationVoip::CustomizeMenuPaneL" );
+    
+    CEikMenuPane* menuPane = aMenuPane;
+    RArray<TInt> menuItemArray;
+    CleanupClosePushL( menuItemArray );
+
+    // Menu items to array
+    TInt menuItemCount = menuPane->NumberOfItemsInPane();
+    for ( TInt i( 0 ); i < menuItemCount; i++ )
+        {
+        menuItemArray.Append( menuPane->MenuItemCommandId( i ) );
+        }
+
+    // Menu items to be deleted 
+    for ( TInt i( 0 ); i < menuItemArray.Count(); i++ )
+        {
+        switch( menuItemArray[ i ] )
+            {
+            case EPhoneDialerCmdTouchInput:
+                {
+                if ( !AllowAlphaNumericMode() )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
+                    }
+                break;
+                }
+            case EPhoneInCallCmdTransfer:
+                {
+                if ( ! IsFeatureSupported( EFeatureTransfer ) )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
+                    }
+                break;
+                }
+            case EPhoneInCallCmdCreateConference:
+                {
+                if ( ! IsFeatureSupported( EFeatureConference ) )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
+                    }
+                break;
+                }
+            case EPhoneInCallCmdNewCall:
+                {
+                if ( !FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) &&
+                     AllowAlphaNumericMode() &&
+                     R_PHONEUI_NEW_CALL_MENU_VOIP != aResourceId )
+                    {
+                        
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] ); 
+                    
+                    HBufC* string = StringLoader::LoadLC( 
+                          CPhoneMainResourceResolver::Instance()->
+                          ResolveResourceID( EPhoneVoIPNewCallMenuOption ) );
+                          
+                    CEikMenuPaneItem::SData data;
+                    data.iCascadeId=R_PHONEUI_NEW_CALL_MENU_VOIP; //r_phoneui_new_call_menu_voip
+                    data.iText = *string;
+                    data.iFlags=0;
+                    data.iCommandId = 0;             
+                    
+                    menuPane->InsertMenuItemL( data, i );
+                    
+                    CleanupStack::PopAndDestroy( string ); 
+                    }
+                break;
+                }
+            default: 
+                break;
+            }
+        }
+
+    CleanupStack::PopAndDestroy( &menuItemArray );    
+
+    // Added HO menu items if needed
+    AddHandoverMenuItemIfNeededL( aResourceId, *aMenuPane );
+    
+    if ( iViewCommandHandle.HandleCommandL( 
+            EPhoneViewGetNumberEntryIsVisibleStatus ) != 
+            EPhoneViewResponseSuccess )
+        {
+        // Handle call menu without dialer/number entry
+        TRAP_IGNORE( ModifyInCallMenuL( aResourceId, *aMenuPane ) );
+        }
+    else
+        {
+        // Handle dialer/number entry options menu modification
+        ModifyNumberAcquisitionMenuL( aResourceId, *aMenuPane );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::ModifyCallHeaderTexts
+// Formats and fits VoIP address and possible display name into two lines to 
+// be shown on a call bubble. These two lines are placed on CLI and CNAP 
+// fields of the TPhoneCmdParamCallHeaderData. In a call bubble CLI-field is 
+// placed as a first line and CNAP-field is placed as a second line. 
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::ModifyCallHeaderTexts( TInt aCallId, 
+        TPhoneCmdParamCallHeaderData* aCommandParam,
+        const TDesC& aInCallNumberText ) 
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::ModifyCallHeaderTexts" );
+    
+    MPEEngineInfo& engineInfo = *iStateMachine.PhoneEngineInfo();
+    
+    if ( EPECallTypeVoIP == engineInfo.CallType( aCallId ) ) 
+        {
+        const TBool contactInfoAvailable = 
+            engineInfo.RemoteName( aCallId ).Length() ||
+            engineInfo.RemoteCompanyName( aCallId ).Length();
+        
+        if ( !contactInfoAvailable )
+            {
+            if ( EPEStateRinging == aCommandParam->CallState() )
+                {
+                if ( KNullDesC() != engineInfo.RemotePartyName( aCallId ) )
+                    {
+                    // Telephone UI specification, 4.2.1 Call identification:
+                    // display name is used as the CLI if available.
+                    aCommandParam->SetCLIText( 
+                        engineInfo.RemotePartyName( aCallId ), 
+                        TPhoneCmdParamCallHeaderData::ERight );
+                    // use line reserved for CNAP to show SIP URI
+                    aCommandParam->SetCNAPText( 
+                        engineInfo.RemotePhoneNumber( aCallId ), 
+                        TPhoneCmdParamCallHeaderData::ERight
+                       );
+                    }
+                else
+                    {
+                    TBuf<KMaxLengthForSIPURI> sipURI;
+                    TBuf<KMaxLengthForSIPURI> sipURIDomainPart;
+                    HandleURIFittingToCallBubble( 
+                        aCommandParam->CLIText(),
+                        sipURI,
+                        sipURIDomainPart );
+                    
+                    aCommandParam->SetCLIText( sipURI, TPhoneCmdParamCallHeaderData::ERight );
+                    aCommandParam->SetCNAPText( sipURIDomainPart,
+                        TPhoneCmdParamCallHeaderData::ERight );
+                    }
+                }
+            else
+                {
+                if ( KNullDesC() == engineInfo.RemotePartyName( aCallId ) )
+                    {
+                    // Display name not available, set incall number text as a
+                    // CLI text. Text could be 'Call 1', 'Call 2', ...
+                    aCommandParam->SetCLIText( aInCallNumberText,
+                        TPhoneCmdParamCallHeaderData::ERight );
+                    aCommandParam->SetCNAPText( 
+                        aCommandParam->CNAPText(),
+                        TPhoneCmdParamCallHeaderData::ERight );
+                    }
+                }
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+         "CPhoneCustomizationVoip::HandleCommandL" );
+    
+    TBool handled( EFalse );
+    switch( aCommand )
+        {
+        case EPhoneNumberAcqCmdInternetCall:
+            {
+            StateUtils().SelectServiceAndDialL();
+            handled = ETrue;
+            }
+            break;
+        case EPhoneInCallCmdNewInternetCall:
+        case EPhoneCmdNewInternetCallOk:
+        case EPhoneCmdNewInternetCallSearch:
+        case EPhoneCmdNewInternetCallContactFetch: 
+            {
+            iNewCallCmdHandler->HandleCommandL( aCommand );
+            handled = ETrue;
+            }
+            break;
+        case EPhoneInCallCmdUnattendedTransfer:
+        case EPhoneCmdTransferDialerOk:
+        case EPhoneCmdTransferDialerExit:
+        case EPhoneCmdTransferDialerSearch:
+        case EPhoneCmdTransferDialerContactFetch:
+            // intended fall-through
+            iTransferCmdHandler->HandleCommandL( aCommand );
+            handled = ETrue;
+            break;
+        case EPhoneCmdCancelServiceEnabling:
+            {
+            iStateMachine.SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageDisableService );
+            handled = ETrue;
+            }
+            break;
+        case EPhoneCmdServiceEnablingTimedOut:
+            {
+            iStateMachine.SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageDisableService ); 
+  
+            TUint32 serviceId = 
+                iStateMachine.PhoneEngineInfo()->ServiceIdCommand();
+            static_cast<CPhoneStateMachineVoIP&>( iStateMachine ).
+                VoipErrorMessageHandler().ShowErrorNoteWithServiceNameL( 
+                    EPhoneVoIPServiceUnavailable, serviceId );
+                    
+            handled = ETrue;
+            }
+            break;
+            
+        case EPhoneCmdHandoverToGsm:
+            handled = ETrue;
+            break;
+
+        
+        case EPhoneCmdHandoverToWlan:
+            handled = ETrue;
+            break;
+            
+        default:
+            {
+            RArray<CTelMenuExtension::TCallInfo> array;
+            CleanupClosePushL( array );
+            GetActiveCallArrayL( array );
+            
+            // Let extensions handle custom commands
+            TRAP_IGNORE( handled = iExtensionHandler->HandleCommandL( 
+                    ServiceIdForActivestCallL( array ),
+                    aCommand ) );
+
+            CleanupStack::PopAndDestroy( &array );
+            }
+            break;
+        }
+    
+    return handled;
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::AllowAlphaNumericMode
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::AllowAlphaNumericMode()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::AllowAlphaNumericMode" );
+    
+    TBool alphaModeSupported( EFalse );
+    TRAP_IGNORE( alphaModeSupported = VoIPSupportedL() );
+    
+    return alphaModeSupported;
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::CustomizeSoftKeys
+// -----------------------------------------------------------
+//
+TInt CPhoneCustomizationVoip::CustomizeSoftKeys()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CustomizeSoftKeys" );
+    
+    return CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneVoIPNumberAcqInternetSoftkey );
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::CustomizeCallHeaderText
+// -----------------------------------------------------------
+//
+TInt CPhoneCustomizationVoip::CustomizeCallHeaderText()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CustomizeCallHeaderText" );
+    
+    return EPhoneVoIPPrivateAddress;
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::CustomizeBusyNoteText
+// -----------------------------------------------------------
+//
+TInt CPhoneCustomizationVoip::CustomizeBusyNoteText()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CustomizeBusyNoteText" );
+    
+    TInt resource( EPhoneNumberBusy );
+    
+    const TPECallType callType =
+        iStateMachine.PhoneEngineInfo()->CallTypeCommand();
+    if ( callType == EPECallTypeVoIP )
+        {
+        resource = EPhoneVoIPNumberBusy;
+        }
+    
+    return resource;
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::HandleCallFromNumberEntryL
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::HandleCallFromNumberEntryL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::HandleCallFromNumberEntryL" );
+    
+    TBool handled = EFalse;
+    
+    if ( StateUtils().IsVoipNumber() )
+        {
+        // Dial voip because invalid string for cs call in number entry/dialer.
+        StateUtils().SelectServiceAndDialL();
+        handled = ETrue;
+        }
+    
+    return handled;
+    }
+
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::HandlePhoneEngineMessageL(
+        const TInt aMessage, 
+        TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::HandlePhoneEngineMessageL" );
+    
+    TBool handled = ETrue;
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageServiceEnabled:
+        case MEngineMonitor::EPEMessageServiceDisabled:
+            {
+            iViewCommandHandle.ExecuteCommandL( 
+                    EPhoneViewRemoveGlobalWaitNote );
+            break;
+            }
+        case MEngineMonitor::EPEMessageServiceEnabling:
+            {
+            LaunchEnablingServiceNoteL();
+            break; 
+            }
+        case MEngineMonitor::EPEMessageNoService:
+            {
+            SendGlobalErrorNoteL( EPhoneVoIPNoService );
+            break; 
+            }
+        case MEngineMonitor::EPEMessageMovedPermanently:
+            {
+            iCallForwardHandler->
+                ShowMovedPermanentlyQueryL( aCallId );
+            break;
+            }    
+        case MEngineMonitor::EPEMessageMultipleChoices:
+            {
+            iCallForwardHandler->
+                ShowMultipleChoicesQueryL( aCallId );
+            break;
+            }
+        case MEngineMonitor::EPEMessageCallSecureStatusChanged:
+            {
+            HandleCallSecureStatusChangeL( aCallId );
+            break;
+            }
+        case MEngineMonitor::EPEMessageTransferring:
+            {
+            iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+            CPhoneState* phoneState = 
+                static_cast< CPhoneState* >( iStateMachine.State() );    
+            SendGlobalInfoNoteL( EPhoneInCallTransferred );
+            break; 
+            }
+        case MEngineMonitor::EPEMessageRemoteForwarding:
+            {
+            SendGlobalErrorNoteL( EPhoneRemoteForwarding );
+            break; 
+            }
+        default:
+            handled = EFalse;
+            break;
+        }
+    return handled;
+    }
+
+// -----------------------------------------------------------
+// From class MPhoneCustomization.
+// CPhoneCustomizationVoip::HandleDialL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::HandleDialL( const TDesC& aNumber )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::HandleDialL" );
+        
+    StateUtils().SelectServiceAndDialL( aNumber, NULL );
+    }
+
+// -----------------------------------------------------------
+// From class MPhoneButtonCustomization.
+// CPhoneCustomizationVoip::CustomizeTouchPaneButtons
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::CustomizeTouchPaneButtons()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CustomizeTouchPaneButtons" );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::VoIPSupportedL
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::VoIPSupportedL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::VoIPSupportedL" );
+    
+    TBool voipSupported( EFalse );
+    
+    CSPSettings* serviceProviderSettings = CSPSettings::NewL();
+    voipSupported = serviceProviderSettings->IsFeatureSupported( 
+        ESupportInternetCallFeature );            
+    delete serviceProviderSettings;
+    
+    return voipSupported;   
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::ModifyInCallMenuL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::ModifyInCallMenuL( TInt aResourceId, CEikMenuPane& aMenuPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::ModifyInCallMenuL" );
+    
+    if ( aResourceId != R_AVKON_MENUPANE_FEP_DEFAULT &&
+        aResourceId != R_AVKON_MENUPANE_EDITTEXT_DEFAULT &&
+        aResourceId != R_AVKON_MENUPANE_LANGUAGE_DEFAULT )
+        {
+        RArray<CTelMenuExtension::TCallInfo> array;
+        CleanupClosePushL( array );
+        
+        GetActiveCallArrayL( array );
+
+        // Use extensions for menu modifications 
+        iExtensionHandler->ModifyInCallMenuL(
+                ServiceIdForActivestCallL( array ),
+                array,
+                aResourceId,
+                aMenuPane );
+        
+        __PHONELOG( EBasic, PhoneUIVoIPExtension,
+            "CPhoneCustomizationVoip::ModifyInCallMenuL() plugin exists" );
+        
+        CleanupStack::PopAndDestroy( &array );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::ModifyNumberAcquisitionMenuL
+// This function is called when user opens menu from dialler/number entry.
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::ModifyNumberAcquisitionMenuL(
+        TInt aResourceId, CEikMenuPane& aMenuPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::ModifyNumberAcquisitionMenuL");
+    
+    if ( ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU ||
+           aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_MENU ||
+           aResourceId == R_PHONEUIDIALER_OPTIONS_MENU ) &&
+           VoIPSupportedL() )
+        {
+        InsertInternetCallMenuItemL( aResourceId, aMenuPane );
+        }
+    
+    if ( ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_MENU ||
+           aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_MENU_VOIP ||
+           aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_MENU_VOIP_WITH_SERVICE_NUMBER ) &&
+           VoIPSupportedL() )
+        {
+        InsertTextInputModeChangeMenuItemL( aMenuPane );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::InsertInternetCallMenuItemL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::InsertInternetCallMenuItemL( 
+        TInt aResourceId, CEikMenuPane& aMenuPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::InsertInternetCallMenuItemL" );
+
+    // get VoIP services
+    RIdArray voipServices;
+    CleanupClosePushL( voipServices );
+    GetVoIPServiceIdsL( voipServices );
+    
+    CEikMenuPaneItem* voipMenuItem = NULL;
+    
+    if ( 1 == voipServices.Count() )
+        {
+        voipMenuItem = CreateMenuPaneItemLC( 
+            EPhoneNumberAcqCmdInternetCall,
+            voipServices[0] );
+        }
+    else
+        {
+        voipMenuItem = CreateMenuPaneItemLC( 
+            EPhoneNumberAcqCmdInternetCall,
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( EPhoneVoIPCallTypeInternet ) );
+        }
+
+    HBufC* phoneNumber = PhoneNumberFromEntryLC();
+
+    if ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU )
+        {
+        if ( !CPhoneKeys::Validate( phoneNumber->Des() ) )
+            {
+            TInt index(KErrNotFound);
+            if ( aMenuPane.MenuItemExists( EPhoneNumberAcqCmdCall, index ) )
+                {
+                aMenuPane.DeleteMenuItem( EPhoneNumberAcqCmdCall );
+                }
+            
+            if ( aMenuPane.MenuItemExists( EPhoneNumberAcqCmdVideoCall, index ) )
+                {
+                aMenuPane.DeleteMenuItem( EPhoneNumberAcqCmdVideoCall );
+                }
+            }
+        
+        aMenuPane.AddMenuItemL( voipMenuItem->iData );
+        }
+    else if ( iStateMachine.PhoneEngineInfo()->PhoneNumberIsServiceCode() )
+        {
+        // When user writes string recognized as service code (eg.*#31# -> clir off)
+        // call menu is not visible. Internet call must still be possible so 
+        // internet call option is added here to the menu.
+        
+        // If number entry is empty don't add internet call option 
+        if ( phoneNumber->Length() )
+            {
+            // Internet call item must be on the top of the menu
+            aMenuPane.InsertMenuItemL( voipMenuItem->iData, 0 );
+            }
+        }
+    
+    CleanupStack::PopAndDestroy( 3, &voipServices );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::InsertTextInputModeChangeMenuItemL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::InsertTextInputModeChangeMenuItemL( 
+        CEikMenuPane& aMenuPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::InsertTextInputModeChangeMenuItemL" );
+    
+    TInt modeChangeOptionIndex = KErrNotFound;
+    if ( aMenuPane.MenuItemExists( 
+             EPhoneNumberAcqCmdToggleNeAlphaMode, modeChangeOptionIndex ) ||
+         aMenuPane.MenuItemExists( 
+             EPhoneNumberAcqCmdToggleNeNumericMode, modeChangeOptionIndex ) )
+        {
+        __PHONELOG( EBasic, PhoneUIVoIPExtension,
+            "InsertTextInputModeChangeMenuItemL, MENU ITEM ALREADY EXISTS" );
+        __ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlInvariant ) );
+        }
+    
+    CEikMenuPaneItem* menuItem = NULL;
+    TBool numberEntryInNumericMode = iViewCommandHandle.HandleCommandL( 
+        EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess;
+    if ( numberEntryInNumericMode )
+        {
+        menuItem = CreateMenuPaneItemLC( 
+            EPhoneNumberAcqCmdToggleNeAlphaMode,
+            R_PHONEUI_NUMBERACQ_OPTIONS_MENU_ITEM_ALPHA_MODE );
+        }
+    else
+        {
+        menuItem = CreateMenuPaneItemLC( 
+            EPhoneNumberAcqCmdToggleNeNumericMode,
+            R_PHONEUI_NUMBERACQ_OPTIONS_MENU_ITEM_NUMERIC_MODE );
+        }
+    
+    // alpha/numeric mode option is always second item in number entry menu
+    const TInt KTextInputModeChangeMenuItemIndex = 1;
+    aMenuPane.InsertMenuItemL( 
+        menuItem->iData, KTextInputModeChangeMenuItemIndex );
+    CleanupStack::PopAndDestroy( menuItem );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::GetActiveCallArrayL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::GetActiveCallArrayL( 
+        RArray<CTelMenuExtension::TCallInfo>& aArray )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::GetActiveCallArrayL");
+    
+    MPEEngineInfo* engineInfo = iStateMachine.PhoneEngine()->EngineInfo();
+    
+    for( TInt i = 0; i < KPEMaximumNumberOfCalls; i++ )
+        {
+        CTelMenuExtension::TCallInfo callInfo;
+        callInfo.iCallId = i;
+        callInfo.iServiceId = engineInfo->ServiceId( i );
+        callInfo.iCallType = CTelMenuExtension::EUninitialized;
+
+        switch( engineInfo->CallType( i ) )
+            {
+            case EPECallTypeUninitialized:
+                callInfo.iCallType = CTelMenuExtension::EUninitialized;
+                break;
+            case EPECallTypeCSVoice:
+                callInfo.iCallType = CTelMenuExtension::ECsVoice;
+                break;
+            case EPECallTypeVideo:
+                callInfo.iCallType = CTelMenuExtension::ECsVideo;
+                break;
+            case EPECallTypeVoIP:
+                callInfo.iCallType = CTelMenuExtension::EPsVoice;
+                break;
+            default:
+                break;
+            }
+        
+        callInfo.iCallState = CTelMenuExtension::ENone;
+        
+        // Convert call bubble indications to call states
+        switch( engineInfo->CallState( i ) )
+            {
+            // Call states                        0 - 499
+            case EPEStateDialing:
+            case EPEStateEmergencyDialing:
+            case EPEStateConnecting:
+                callInfo.iCallState = CTelMenuExtension::EOutgoing;
+                break;
+            case EPEStateAnswering:
+            case EPEStateRinging:
+                callInfo.iCallState = CTelMenuExtension::EIncoming;
+                break;
+
+            case EPEStateConnectedConference:
+            case EPEStateConnected:
+                callInfo.iCallState = CTelMenuExtension::EActive;
+                break;
+
+            case EPEStateHeldConference:
+            case EPEStateHeld:
+                callInfo.iCallState = CTelMenuExtension::EOnHold;
+                break;
+            
+            case EPEStateHangingUpConference:
+            case EPEStateRejecting:
+            case EPEStateHangingUp:
+            case EPEStateDisconnecting:
+                callInfo.iCallState = CTelMenuExtension::EDisconnecting;
+                break;
+                
+            case EPEStateUnknown:
+            case EPEStateIdle:
+            case EPEStateConferenceIdle:
+                break;
+                
+            // conference
+            case EPEStateCreatingConference:
+            case EPEStateSwappingConference:
+            case EPEStateResumeHoldConference:
+            // misc states.
+            case EPEStateMaximumState:
+            default:
+                User::Leave( KErrNotReady );
+                break;
+            }
+
+        if( callInfo.iCallState != CTelMenuExtension::ENone )
+            {
+            aArray.Append( callInfo );                                   
+            }
+
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::ResolveMostActiveCallL
+// -----------------------------------------------------------
+//
+TInt CPhoneCustomizationVoip::ResolveMostActiveCallL( 
+        const RArray<CTelMenuExtension::TCallInfo>& aArray )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::ResolveMostActiveCallL" );
+    
+    TInt incomingCallId( KErrNotFound );
+    TInt activeCallId( KErrNotFound );
+    TInt onholdCallId( KErrNotFound );
+    TInt disconnectingCallId( KErrNotFound );
+    
+    for( TInt i = 0; i < aArray.Count(); i++ )
+        {
+        if( aArray[i].iCallState == CTelMenuExtension::EOutgoing )
+            {
+            // Always most active call
+            return aArray[i].iCallId;
+            }
+        else if( aArray[i].iCallState == CTelMenuExtension::EActive )
+            {
+            activeCallId = aArray[i].iCallId;
+            }
+        else if( aArray[i].iCallState == CTelMenuExtension::EIncoming )
+            {
+            incomingCallId = aArray[i].iCallId;
+            }
+        else if( aArray[i].iCallState == CTelMenuExtension::EOnHold )
+            {
+            onholdCallId = aArray[i].iCallId;
+            }
+        else if( aArray[i].iCallState == CTelMenuExtension::EDisconnecting )
+            {
+            disconnectingCallId = aArray[i].iCallId;
+            }
+        }
+    
+    if( activeCallId != KErrNotFound )
+        {
+        return activeCallId;
+        }
+    else if( incomingCallId != KErrNotFound )
+        {
+        return incomingCallId;
+        }
+    else if( onholdCallId != KErrNotFound )
+        {
+        return onholdCallId;
+        }
+    else if( disconnectingCallId != KErrNotFound )
+        {
+        return disconnectingCallId;
+        }
+    else
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    return KErrNotFound;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::ServiceIdForActivestCallL
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+TUint CPhoneCustomizationVoip::ServiceIdForActivestCallL(
+        const RArray<CTelMenuExtension::TCallInfo>& aCallArray )
+    {   
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::ServiceIdForActivestCallL" );
+    
+    const TInt KActiveCallId = ResolveMostActiveCallL( aCallArray );
+     
+    MPEEngineInfo* engineInfo = iStateMachine.PhoneEngine()->EngineInfo();
+    
+    // Return service id for activest call
+    return engineInfo->ServiceId( KActiveCallId ); 
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::IsFeatureSupported()
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::IsFeatureSupported( TFeature aFeature )
+    { 
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::IsFeatureSupported" );
+    
+    TBool ret( EFalse );
+
+    TRAP_IGNORE( ret = CheckFeatureSupportByCallTypeL( aFeature ) );
+    
+    __PHONELOG1( EBasic, PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::IsFeatureSupported =%d", ret  );
+    
+    return ret;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::CheckFeatureSupportByCallTypeL()
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::CheckFeatureSupportByCallTypeL( 
+        TFeature aFeature )
+    { 
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CheckFeatureSupportByCallTypeL" );
+    
+    if ( aFeature != EFeatureConference &&
+         aFeature != EFeatureTransfer )
+        {
+        return ETrue;
+        }
+    
+    RArray<CTelMenuExtension::TCallInfo> array;
+    CleanupClosePushL( array );
+    GetActiveCallArrayL( array );
+    __PHONELOG1( EBasic, PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CheckFeatureSupportByCallTypeL CallCount=%d", 
+        array.Count()  );
+    
+    TBool supported( ETrue );
+    TInt firstCallType = CTelMenuExtension::EUninitialized;
+    for( TInt i = 0; i < array.Count(); i++ )
+        {
+        if( array[i].iCallState == CTelMenuExtension::EOutgoing ||
+            array[i].iCallState == CTelMenuExtension::EActive ||
+            array[i].iCallState == CTelMenuExtension::EOnHold )
+            {
+            if( firstCallType == CTelMenuExtension::EUninitialized )
+                {
+                // Memorize first found call type
+                firstCallType = array[i].iCallType;
+                }
+            else if( firstCallType != array[i].iCallType )
+                {
+                // Found different call type
+                supported = EFalse;
+                break;
+                }
+            }
+
+        }
+    
+    CleanupStack::PopAndDestroy( &array );
+
+    return supported;
+    }
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::LaunchEnablingServiceNoteL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::LaunchEnablingServiceNoteL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::LaunchEnablingServiceNoteL" )
+    
+    TPhoneCmdParamQuery queryParam;
+    queryParam.SetQueryType( EPhoneGlobalWaitNote );
+    queryParam.SetCommandParamId( 
+        TPhoneCommandParam::EPhoneParamIdGlobalWaitNote );
+    
+    RBuf serviceName;
+    CleanupClosePushL( serviceName );
+    TUint32 serviceId = 
+        iStateMachine.PhoneEngineInfo()->ServiceIdCommand(); 
+    static_cast<CPhoneStateMachineVoIP&>( iStateMachine ).
+        VoipErrorMessageHandler().GetServiceProviderNameL( 
+        serviceName, serviceId );
+    
+    RBuf noteText;
+    CleanupClosePushL( noteText );
+    noteText.Assign( StringLoader::LoadL( 
+    CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+        EPhoneVoIPEnablingServiceWaitNoteText ), serviceName ) );
+    
+    queryParam.SetDataText( &noteText );  
+    queryParam.SetDefaultCba( R_AVKON_SOFTKEYS_CANCEL );
+    
+    const TInt KEnableServiceTimeOutInMilliSecs = 60000;
+    queryParam.SetTimeOut( KEnableServiceTimeOutInMilliSecs );
+
+    // configure custom command mappings for user responses
+    queryParam.SetCbaCommandMapping( 
+        EAknSoftkeyCancel, EPhoneCmdCancelServiceEnabling );
+    queryParam.SetCbaCommandMapping( 
+        KErrCancel, EPhoneCmdCancelServiceEnabling );
+    queryParam.SetCustomCommandForTimeOut( EPhoneCmdServiceEnablingTimedOut ); 
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewShowQuery, &queryParam );
+     
+    CleanupStack::PopAndDestroy( &noteText );
+    CleanupStack::PopAndDestroy( &serviceName ); 
+    }
+
+
+// ---------------------------------------------------------
+//  CPhoneCustomizationVoip::SendGlobalErrorNoteL
+// ---------------------------------------------------------
+//
+void CPhoneCustomizationVoip::SendGlobalErrorNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::SendGlobalErrorNoteL" );
+    
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    
+    CPhoneState* phoneState = 
+        static_cast< CPhoneState* >( iStateMachine.State() );       
+            
+    phoneState->SendGlobalErrorNoteL( aResourceId );        
+    }
+
+
+// ---------------------------------------------------------
+//  CPhoneCustomizationVoip::SendGlobalInfoNoteL
+// ---------------------------------------------------------
+//
+void CPhoneCustomizationVoip::SendGlobalInfoNoteL( TInt aResourceId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::SendGlobalInfoNoteL" );
+    
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+    
+    CPhoneState* phoneState = 
+        static_cast< CPhoneState* >( iStateMachine.State() );       
+    
+    phoneState->SendGlobalInfoNoteL( aResourceId );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::HandleURIFittingToCallBubble
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::HandleURIFittingToCallBubble( 
+    const TDesC& aCLIText, TDes& aSipURI, TDes& aSipURIDomainPart )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension,
+        "CPhoneCustomizationVoip::HandleURIFittingToCallBubble" );
+    
+    TInt cliLength = aCLIText.Length();
+    if ( KMaxLengthForSIPURIFirstLine > cliLength )
+        {
+        aSipURI.Copy( aCLIText );
+        aSipURIDomainPart.Copy( KNullDesC );
+        }
+    else if ( KMaxLengthForSIPURITwoLines > cliLength )
+        {
+        aSipURI.Copy( aCLIText.Mid( 0, KMaxLengthForSIPURIFirstLine ) );
+        aSipURIDomainPart.Copy( aCLIText.Mid( KMaxLengthForSIPURIFirstLine,
+            cliLength-KMaxLengthForSIPURIFirstLine ) );
+        }
+    else  
+        {
+        TInt atPosition = aCLIText.Find( KVoipAt );
+        if ( atPosition == KErrNotFound )
+            {
+            atPosition = KMaxLengthForSIPURIFirstLine;
+            }
+        aSipURI.Copy( aCLIText.Mid( 0, atPosition ) );
+        aSipURIDomainPart.Copy( aCLIText.Mid( atPosition,
+            ( cliLength-atPosition ) ) );
+        }      
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::StateUtils
+// -----------------------------------------------------------
+//
+CPhoneStateUtilsVoip& CPhoneCustomizationVoip::StateUtils()
+    {
+    return static_cast<CPhoneStateMachineVoIP&>( iStateMachine ).StateUtils();
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::HandleSecureStatusChangeL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::HandleCallSecureStatusChangeL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::HandleCallSecureStatusChangeL" );
+    
+    if ( KErrNotFound < aCallId )
+        {
+        if ( ( EPECallTypeVoIP == 
+            iStateMachine.PhoneEngineInfo()->CallType( aCallId ) ) &&
+            !iStateMachine.PhoneEngineInfo()->IsSecureCall( aCallId ) ) 
+            {
+            TInt state = iStateMachine.PhoneEngineInfo()->CallState( 
+                aCallId );
+            switch ( state )
+                {      
+                case EPEStateConnected:
+                    {
+                    iViewCommandHandle.ExecuteCommand( 
+                        EPhoneViewCipheringInfoChangePlayTone );
+                    break;
+                    }
+                case EPEStateDialing:
+                    {
+                    SendGlobalInfoNoteL( 
+                        EPhoneSSNotificationTextVoipSipsFailed );
+                    break;
+                    }
+                default:
+                    break;
+                
+                }
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::CreateMenuPaneItemLC
+// -----------------------------------------------------------
+//
+CEikMenuPaneItem* CPhoneCustomizationVoip::CreateMenuPaneItemLC( 
+        TInt aCommandId, TInt aTextResourceId ) const
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CreateMenuPaneItemLC" );
+    
+    CEikMenuPaneItem::SData data;
+    data.iCommandId = aCommandId;
+    data.iCascadeId = 0;
+    data.iFlags = 0;
+    iCoeEnv.ReadResourceL( data.iText, aTextResourceId );    
+    data.iExtraText = KNullDesC();
+    
+    CEikMenuPaneItem* menuItem = new ( ELeave ) CEikMenuPaneItem();
+    CleanupStack::PushL( menuItem );
+    menuItem->iData = data;
+    
+    return menuItem;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::CreateMenuPaneItemLC
+// -----------------------------------------------------------
+//
+CEikMenuPaneItem* CPhoneCustomizationVoip::CreateMenuPaneItemLC(
+    TInt aCommandId, TServiceId aServiceId ) const
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CreateMenuPaneItemLC" );
+
+    CEikMenuPaneItem::SData data;
+    data.iCommandId = aCommandId;
+    data.iCascadeId = 0;
+    data.iFlags = 0;
+    data.iExtraText = KNullDesC();
+
+    // insert service name
+    TBuf<KMaxVoIPServiceName> serviceName;
+    GetVoipServiceNameL( aServiceId, serviceName );
+    
+    HBufC* callText = StringLoader::LoadLC(
+        CPhoneMainResourceResolver::Instance()
+            ->ResolveResourceID( EPhoneVoIPNumberAcqXSPCall ),
+        serviceName );
+    
+    data.iText.Append( *callText );
+    
+    CleanupStack::PopAndDestroy( callText );
+
+    CEikMenuPaneItem* menuItem = new ( ELeave ) CEikMenuPaneItem();
+    CleanupStack::PushL( menuItem );
+    menuItem->iData = data;
+
+    return menuItem;
+    }
+
+    
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL( TInt /*aResourceId*/,
+        CEikMenuPane& /*aMenuPane*/ )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::AddHandoverMenuItemIfNeededL" );
+    }
+    
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::GetVoIPServiceIdsL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::GetVoIPServiceIdsL( RIdArray& aVoipServiceIds ) const
+    {
+    aVoipServiceIds.Reset();
+
+    // Fetch the settings api.
+    CSPSettings* settingsApi = CSPSettings::NewLC();
+        
+    // read all service ids to array
+    RIdArray idArray;
+    CleanupClosePushL( idArray );
+        
+    if ( KErrNone == settingsApi->FindServiceIdsL( idArray ) )
+        {
+        // go throught all the services and check if any
+        // of them supports internet call
+        for ( TInt i = 0; idArray.Count() > i; i++)
+            {
+            // check if the service supports internet call
+            CSPProperty* property = CSPProperty::NewLC();
+
+            // get attribute mask of the service
+            TRAPD( error, error = settingsApi->FindPropertyL( idArray[i],
+                EPropertyServiceAttributeMask, *property ) );
+
+            if ( KErrNone == error )
+                {
+                // read the value of mask property
+                TInt mask = 0;
+                error = property->GetValue( mask );
+                if ( KErrNone == error )
+                    {
+                    if ( ( mask & ESupportsInternetCall )
+                        && ( mask & EIsVisibleInCallMenu ) )
+                        {
+                        aVoipServiceIds.Append( idArray[i] );
+                        }
+                    }
+                }
+            CleanupStack::PopAndDestroy( property );
+            }
+        }
+
+    CleanupStack::PopAndDestroy( 2, settingsApi );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::GetVoIPServiceIdsL
+// -----------------------------------------------------------
+//
+void CPhoneCustomizationVoip::GetVoipServiceNameL( TServiceId aServiceId, TDes& aServiceName ) const
+    {
+    CSPSettings* settingsApi = CSPSettings::NewLC();
+    CSPProperty* property = CSPProperty::NewLC();
+
+    settingsApi->FindPropertyL( aServiceId, EServiceName, *property );
+    property->GetValue( aServiceName );
+    
+    CleanupStack::PopAndDestroy( 2, settingsApi );
+    }
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::PhoneNumberFromEntryLC
+// -----------------------------------------------------------
+//
+HBufC* CPhoneCustomizationVoip::PhoneNumberFromEntryLC() const
+    {
+    HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+    
+    TPtr ptr( phoneNumber->Des() );
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+    iViewCommandHandle.ExecuteCommand(
+        EPhoneViewGetNumberFromEntry,
+        &stringParam );
+    
+    return phoneNumber;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphoneextensionhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneExtensionHandler class.
+*
+*/
+
+// INCLUDES
+
+#include <eikmenup.h>
+#include <spsettings.h>
+#include <spentry.h>
+#include <spproperty.h>
+#include "phoneresourceids.h"
+#include <avkon.rsg>
+#include <StringLoader.h>
+
+#include "cphoneextensionhandler.h"
+#include "cphonemainresourceresolver.h"
+#include "cphonelogger.h"
+#include "phoneappvoipcommands.hrh"
+#include "phonerssvoip.h"
+#include "cphonemenuextensionwrapper.h"
+#include "tphonetouchpanewrapper.h" 
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneExtensionHandler::CPhoneExtensionHandler()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneExtensionHandler::~CPhoneStateIdleVoIP()
+// Destructor
+// -----------------------------------------------------------
+//
+CPhoneExtensionHandler::~CPhoneExtensionHandler()
+    {    
+    iPlugins.ResetAndDestroy();
+    REComSession::FinalClose();
+    }
+
+// -----------------------------------------------------------
+// CPhoneExtensionHandler::ConstructL()
+// Constructor
+// -----------------------------------------------------------
+//
+void CPhoneExtensionHandler::ConstructL()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneExtensionHandler::NewL()
+// Constructor
+// -----------------------------------------------------------
+//
+CPhoneExtensionHandler* CPhoneExtensionHandler::NewL( )
+    {
+    CPhoneExtensionHandler* self = new (ELeave) CPhoneExtensionHandler();
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneExtensionHandler::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneExtensionHandler::HandleCommandL( 
+        TUint aServiceId,
+        TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneExtensionHandler::HandleCommandL" );
+    
+    CTelMenuExtension* interface = MenuExtensionL( aServiceId );
+    
+    return interface->HandleCommandL( aCommand );
+    }
+
+// -----------------------------------------------------------
+// CPhoneExtensionHandler::ModifyInCallMenuL
+// -----------------------------------------------------------
+//
+void CPhoneExtensionHandler::ModifyInCallMenuL(
+        TUint aServiceId,
+        RArray<CTelMenuExtension::TCallInfo>& aArray,
+        TInt aResourceId, 
+        CEikMenuPane& aMenuPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneExtensionHandler::ModifyInCallMenuL" );
+    
+    if ( aResourceId != R_AVKON_MENUPANE_FEP_DEFAULT &&
+        aResourceId != R_AVKON_MENUPANE_EDITTEXT_DEFAULT &&
+        aResourceId != R_AVKON_MENUPANE_LANGUAGE_DEFAULT &&
+        R_PHONEUI_NEW_CALL_MENU_VOIP != aResourceId )
+        {
+
+        // Load xSP ECOM plugin 
+        CTelMenuExtension* interface = MenuExtensionL( aServiceId );
+        
+        __PHONELOG( EBasic, PhoneUIVoIPExtension, 
+            "CPhoneExtensionHandler::ModifyInCallMenuL, plugin exists" );
+        // Add unattended transfer option to menu
+        AddUnattendedTransferMenuItemL( aMenuPane );
+        
+        // Let plugin modify menu pane
+        interface->ModifyExtensionsCallMenuL( aArray, aMenuPane );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneExtensionHandler::ResolveImplementationUidL
+// -----------------------------------------------------------
+//
+TUid CPhoneExtensionHandler::ResolveImplementationUidL( 
+        TUint32 aServiceId, TServicePropertyName aPropertyName )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneExtensionHandler::ResolveImplementationUidL" );
+    
+    TUid implUid = { 0 };
+    CSPEntry* entry = CSPEntry::NewLC();
+
+    CSPSettings* spSettings = CSPSettings::NewLC(); 
+    
+    User::LeaveIfError(
+        spSettings->FindEntryL( aServiceId, *entry ) ); 
+
+    CleanupStack::PopAndDestroy( spSettings ); 
+
+    const CSPProperty* property = NULL;
+    User::LeaveIfError( entry->GetProperty( property, aPropertyName ) );
+    
+    if ( property ) 
+        {
+        TInt temp(0);
+        User::LeaveIfError( property->GetValue( temp ) );
+        implUid.iUid = temp;
+        }
+
+    CleanupStack::PopAndDestroy( entry );
+    return implUid;
+    }
+
+// -----------------------------------------------------------
+// CPhoneExtensionHandler::AddUnattendedTransferMenuItem
+// -----------------------------------------------------------
+//
+void CPhoneExtensionHandler::AddUnattendedTransferMenuItemL( 
+        CEikMenuPane& aMenuPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneExtensionHandler::AddUnattendedTransferMenuItemL" );
+    
+    HBufC* string = StringLoader::LoadLC( 
+        CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneVoIPUnattendedTransferOption ) );
+    CEikMenuPaneItem::SData data;
+    data.iCascadeId=0;
+    data.iText = *string;
+    data.iFlags=0;
+    data.iCommandId = EPhoneInCallCmdUnattendedTransfer;
+ 
+    // Try to find index of EPhoneInCallCmdGoToIdle command
+    // unattended transfer item will be placed above it if found
+    TInt index = KErrNotFound;
+    TInt menuItemCount = aMenuPane.NumberOfItemsInPane();
+    for ( TInt i= 0 ; i < menuItemCount; i++ )
+        {
+        if ( aMenuPane.MenuItemCommandId( i ) == EPhoneInCallCmdGoToIdle )
+            {
+            index = i;
+            break;
+            }
+        }
+   
+    if ( KErrNotFound < index )
+        {
+        aMenuPane.InsertMenuItemL( data, index );  
+        }
+    else
+        {
+        aMenuPane.AddMenuItemL( data ); 
+        }
+   
+    CleanupStack::PopAndDestroy( string );   
+    }
+
+// ----------------------------------------------------------
+// CPhoneExtensionHandler::MenuExtensionL
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CTelMenuExtension* CPhoneExtensionHandler::MenuExtensionL( TUint aServiceId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneExtensionHandler::MenuExtensionL" );
+    
+    TUid pluginUid = ResolveImplementationUidL( aServiceId, 
+        EPropertyCallMenuHandlerPluginId );
+    
+    CPhMenuExtensionWrapper* wrapper = NULL;
+    TInt pluginInd = 
+        iPlugins.Find( pluginUid, CPhMenuExtensionWrapper::MatchByUid );
+    if ( KErrNotFound == pluginInd )
+        {
+        wrapper = CPhMenuExtensionWrapper::NewLC( pluginUid );
+        iPlugins.AppendL( wrapper );
+        CleanupStack::Pop( wrapper );
+        }
+    else
+        {
+        wrapper = iPlugins[pluginInd];
+        }
+    
+    __ASSERT_ALWAYS( NULL != wrapper, User::Leave( KErrNotFound ) );
+    return wrapper;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonemenuextensionwrapper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhMenuExtensionWrapper class.
+*
+*/
+
+
+#include "cphonemenuextensionwrapper.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::CPhMenuExtensionWrapper
+// ---------------------------------------------------------------------------
+//
+CPhMenuExtensionWrapper::CPhMenuExtensionWrapper( 
+        TUid aImplementationUid )
+    : 
+    iPluginUid( aImplementationUid )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhMenuExtensionWrapper::ConstructL()
+    {
+    iPlugin = CreateMenuExtensionL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::NewL
+// ---------------------------------------------------------------------------
+//
+CPhMenuExtensionWrapper* CPhMenuExtensionWrapper::NewL( 
+        TUid aImplementationUid )
+    {
+    CPhMenuExtensionWrapper* self = 
+        CPhMenuExtensionWrapper::NewLC( aImplementationUid );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::NewLC
+// ---------------------------------------------------------------------------
+//
+CPhMenuExtensionWrapper* CPhMenuExtensionWrapper::NewLC( 
+        TUid aImplementationUid )
+    {
+    CPhMenuExtensionWrapper* self = 
+        new( ELeave ) CPhMenuExtensionWrapper( aImplementationUid );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::~CPhMenuExtensionWrapper
+// ---------------------------------------------------------------------------
+//
+CPhMenuExtensionWrapper::~CPhMenuExtensionWrapper()
+    {
+    delete iPlugin;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::MatchByUid
+// ---------------------------------------------------------------------------
+//
+TBool CPhMenuExtensionWrapper::MatchByUid( 
+        const TUid* aKey, const CPhMenuExtensionWrapper& aWrapper )
+    {
+    if ( aKey )
+        {
+        return ( aWrapper.Identifier() == *aKey );
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From class CTelMenuExtension.
+// ---------------------------------------------------------------------------
+//
+void CPhMenuExtensionWrapper::ModifyExtensionsCallMenuL( 
+        const RArray<CTelMenuExtension::TCallInfo>& aCallArray,
+        CEikMenuPane& aMenuPane )
+    {
+    iPlugin->ModifyExtensionsCallMenuL( aCallArray, aMenuPane );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CTelMenuExtension.
+// ---------------------------------------------------------------------------
+//
+void CPhMenuExtensionWrapper::ModifyExtensionsTouchPaneButtonsL( 
+        const RArray<CTelMenuExtension::TCallInfo>& aCallArray,
+        MTelTouchPaneExtension& aTouchPane )
+    {
+    iPlugin->ModifyExtensionsTouchPaneButtonsL( aCallArray, aTouchPane );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CTelMenuExtension.
+// ---------------------------------------------------------------------------
+//
+TBool CPhMenuExtensionWrapper::HandleCommandL( TInt aCommand )
+    {
+    return iPlugin->HandleCommandL( aCommand );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::CreateContactExtensionL
+// Needed for testing with mock technique.
+// ---------------------------------------------------------------------------
+//
+CTelMenuExtension* 
+    CPhMenuExtensionWrapper::CreateMenuExtensionL() const
+    {
+    return CTelMenuExtension::NewL( iPluginUid );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhMenuExtensionWrapper::Identifier
+// ---------------------------------------------------------------------------
+//
+TUid CPhMenuExtensionWrapper::Identifier() const
+    {
+    return iPluginUid;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonenewcallcmdhandler.cpp	Fri Jun 04 10:19:18 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: Implementation of CPhoneNewCallCmdHandler class.
+*
+*/
+
+#include <featmgr.h>
+
+#include "cphonenewcallcmdhandler.h"
+#include "cphonelogger.h"
+#include "mphonestatemachine.h"
+#include "phonerssvoip.h"
+#include "phoneappvoipcommands.hrh"
+#include "cphonestate.h"
+#include "cphonestateincall.h"
+#include "tphonecmdparamcustomdialer.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamglobalnote.h"
+#include "cphonemainresourceresolver.h"
+#include "cphonestatemachinevoip.h"
+#include "cphonestateutilsvoip.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::CPhoneNewCallCmdHandler
+// C++ constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneNewCallCmdHandler::CPhoneNewCallCmdHandler( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    : iStateMachine( aStateMachine ), iViewCommandHandle( aViewCommandHandle )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneNewCallCmdHandler::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::NewL
+// ---------------------------------------------------------------------------
+//
+CPhoneNewCallCmdHandler* CPhoneNewCallCmdHandler::NewL(
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneNewCallCmdHandler* self = 
+        CPhoneNewCallCmdHandler::NewLC( 
+            aStateMachine, aViewCommandHandle );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::NewLC
+// ---------------------------------------------------------------------------
+//
+CPhoneNewCallCmdHandler* CPhoneNewCallCmdHandler::NewLC(
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneNewCallCmdHandler* self = 
+        new( ELeave ) CPhoneNewCallCmdHandler( 
+            aStateMachine, aViewCommandHandle );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::~CPhoneNewCallCmdHandler
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneNewCallCmdHandler::~CPhoneNewCallCmdHandler()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::HandleCommandL
+// ---------------------------------------------------------------------------
+//
+void CPhoneNewCallCmdHandler::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+            "CPhoneNewCallCmdHandler::HandleCommandL" )
+    
+    switch ( aCommand )
+        {
+        case EPhoneInCallCmdNewInternetCall:
+            ShowNewCallQueryL();
+            break;
+        
+        case EPhoneCmdNewInternetCallOk:
+            DoNewCallL();     
+            break;
+        
+        case EPhoneCmdNewInternetCallSearch:
+            OpenSingleItemContactFetchL( 
+                EPhoneCmdNewInternetCallContactFetch ); 
+            break;
+        
+        case EPhoneCmdNewInternetCallContactFetch:
+            {
+            TBuf<KPhoneNumberEntryBufferSize> fetchContent;    
+            fetchContent = iViewCommandHandle.FetchContent();
+               
+            StateUtils().SelectServiceAndDialL( fetchContent );
+            break;
+            }
+        
+        default:
+            __PHONELOG( EOnlyFatal, PhoneUIVoIPExtension, 
+                "CPhoneNewCallCmdHandler::HandleCommandL, DEFAULT" );
+            ASSERT( EFalse );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::ShowNewCallQueryL
+// ---------------------------------------------------------------------------
+//
+void CPhoneNewCallCmdHandler::ShowNewCallQueryL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneNewCallCmdHandler::ShowNewCallQueryL" )
+    
+    if ( !FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        CPhoneState* phoneState = 
+            static_cast<CPhoneState*>( iStateMachine.State() );
+        
+        HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+        TPtr ptr( text->Des() );
+        // Pre-populate the query with the number entry contents, if it exists
+        if ( phoneState->IsNumberEntryUsedL() )
+            {
+            // get the number entry contents
+            TPhoneCmdParamString stringParam;
+            stringParam.SetString( &ptr );
+            iViewCommandHandle.ExecuteCommandL(
+                EPhoneViewGetLocalizedNumberFromEntry,
+                &stringParam );
+            }
+        
+        TPhoneCmdParamQuery queryDialogParam;
+        queryDialogParam.SetQueryType( EPhoneTextQueryDialog );
+        queryDialogParam.SetQueryResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPNewCallQuery ) );
+        
+        queryDialogParam.SetDefaultCba( CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPNewCallQueryEmptySoftkeys ) );
+        
+        queryDialogParam.SetContentCba( CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPNewCallQueryNotEmptySoftkeys ) );
+        
+        queryDialogParam.SetDataText( &ptr );
+        queryDialogParam.SetSendKeyEnabled( ETrue );
+        
+        // Display dialog        
+        iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewShowQuery, &queryDialogParam );
+        
+        CleanupStack::PopAndDestroy( text );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::DoNewCallL
+// ---------------------------------------------------------------------------
+//
+void CPhoneNewCallCmdHandler::DoNewCallL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneNewCallCmdHandler::DoNewCallL" )
+    
+    // First get the string from dialog
+    TPhoneCmdParamString string;
+    HBufC* content = HBufC::NewLC( KPEPhoneNumberMaxLength );
+    TPtr ptr( content->Des() );
+    string.SetString( &ptr );   
+
+    iViewCommandHandle.ExecuteCommandL( 
+        EPhoneViewGetTextQueryContent, &string );
+
+    // Dial new voip call
+    StateUtils().SelectServiceAndDialL( ptr );
+    
+    CleanupStack::PopAndDestroy( content );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneNewCallCmdHandler::OpenSingleItemContactFetchL
+// ---------------------------------------------------------------------------
+//
+void CPhoneNewCallCmdHandler::OpenSingleItemContactFetchL( 
+        TInt aFetchType )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+       "CPhoneNewCallCmdHandler::OpenSingleItemContactFetchL" )
+    
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( aFetchType );
+    
+    iViewCommandHandle.HandleCommandL( 
+        EPhoneViewOpenSingleItemFetchDialog, 
+        &integerParam );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneNewCallCmdHandler::StateUtils
+// -----------------------------------------------------------
+//
+CPhoneStateUtilsVoip& CPhoneNewCallCmdHandler::StateUtils()
+    {
+    return static_cast<CPhoneStateMachineVoIP&>( 
+        iStateMachine ).StateUtils();
+    }
+     
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphoneresourceresolvervoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,297 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneResolverVoIP class.
+*
+*/
+
+
+// INCLUDE FILES
+#include <bautils.h>
+#include <AknUtils.h>
+#include "phoneresourceids.h"
+#include <data_caging_path_literals.hrh>
+#include "cphoneresourceresolvervoip.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssvoip.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverVoIP::CPhoneResourceResolverVoIP
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhoneResourceResolverVoIP::CPhoneResourceResolverVoIP()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneRourceResolverVoIP::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneResourceResolverVoIP::ConstructL()
+    {
+    // Register resolver
+    CPhoneMainResourceResolver::Instance()->RegisterResolver( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverVoIP::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhoneResourceResolverVoIP* CPhoneResourceResolverVoIP::NewL()
+    {
+    CPhoneResourceResolverVoIP* self =
+        new( ELeave ) CPhoneResourceResolverVoIP();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CPhoneResourceResolverVoIP::~CPhoneResourceResolverVoIP()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneResourceResolverVoIP::ResolveResourceID
+// Resolve resource id of given resource.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPhoneResourceResolverVoIP::ResolveResourceID(
+    const TInt& aResource ) const
+    {
+    TInt retVal( KErrNotFound );
+
+    switch( aResource )
+        {
+        case EPhoneVoIPNumberAcqMenubar:
+            retVal = R_PHONEUI_NUMBERACQ_MENUBAR_VOIP;
+            break;
+
+        case EPhoneVoIPNumberAcqMenubarWithServiceNumber:
+            retVal = R_PHONEUI_NUMBERACQ_MENUBAR_VOIP_WITH_SERVICE_NUMBER;
+            break;
+
+        case EPhoneVoIPNumberAcqOkMenubar:
+            retVal = R_PHONEUI_NUMBERACQ_OK_MENUBAR_VOIP;
+            break;
+
+        case EPhoneVoIPNumberAcqOkMenubarWithServiceNumber:
+            retVal = R_PHONEUI_NUMBERACQ_OK_MENUBAR_VOIP_WITH_SERVICE_NUMBER;
+            break;
+
+        case EPhoneVoIPNumberAcqInternetSoftkey:
+            retVal = R_PHONEUI_NUMBERACQ_INTERNETCALL_CBA;
+            break;
+
+        case EPhoneVoIPPrivateAddress:
+            retVal = R_PHONEUI_VOIP_PRIVATE_ADDRESS;
+            break;
+
+        case EPhoneVoIPNoAudioSupport:
+            retVal = R_PHONE_VOIP_NO_AUDIO_SUPPORT;
+            break;
+
+        case EPhoneVoIPNoService:
+            retVal = R_PHONE_VOIP_NO_VOIP_SERVICE_ERROR;
+            break;
+
+        case EPhoneRemoteForwarding: 
+            retVal = R_PHONE_VOIP_CALL_BEING_FORWARDED;
+            break;
+
+        case EPhoneVoIPServiceUnavailable:
+            retVal = R_NO_SERVICE_AVAILABLE_INFO;
+            break;
+
+        case EPhoneVoIPAddressNotInUse:
+            retVal = R_PHONE_VOIP_ADDRESS_NOT_IN_USE;
+            break;
+
+        case EPhoneVoIPRequestTimeOut:
+            retVal = R_PHONE_VOIP_REQUEST_TIME_OUT;
+            break;
+
+        case EPhoneVoIPInvalidRecipientAddress:
+            retVal = R_PHONE_VOIP_INVALID_RECIPIENT_ADDRESS;
+            break;
+
+        case EPhoneVoIPNumberBusy:
+            retVal = R_PHONE_VOIP_NUMBER_BUSY;
+            break;
+
+        case EPhoneVoIPNotFound:
+            retVal = R_PHONE_VOIP_NOT_FOUND;
+            break;
+
+        case EPhoneVoIPNoAnswer:
+            retVal = R_PHONE_VOIP_NO_ANSWER;
+            break;
+
+        case EPhoneSSNotificationTextVoipSipsFailed:
+            retVal = R_PHONE_SS_NOTIFICATION_TEXT_VOIP_SIPS_FAILED;
+            break;
+
+        case EPhoneVoIPNetworkError:
+            retVal = R_VOIP_NETWORK_ERROR_NOTE;
+            break;
+            
+        case EPhoneVoIPHoldFail:
+            retVal = R_VOIP_HOLD_FAILED;
+            break;
+            
+        case EPhoneVoIPHoldNumberFail:
+            retVal = R_VOIP_HOLD_NUMBER_FAILED;
+            break;
+            
+        case EPhoneVoIPResumeFail:
+            retVal = R_VOIP_RESUME_FAILED;
+            break;
+            
+        case EPhoneVoIPResumeNumberFail:
+            retVal = R_VOIP_RESUME_NUMBER_FAILED;
+            break;
+            
+        case EPhoneVoIPSwapFail:
+            retVal = R_VOIP_SWAP_FAILED;
+            break;
+        
+        case EPhoneVoIPConferenceHoldFail:
+            retVal = R_VOIP_CONFERENCE_HOLD_FAILED;
+            break;
+        
+        case EPhoneVoIPConferenceResumeFail:
+            retVal = R_VOIP_CONFERENCE_RESUME_FAILED;
+            break;
+
+        case EPhoneVoIPTransferFail:
+            retVal = R_VOIP_TRANSFER_FAILED_NOTE;
+            break;
+        case EPhoneVoIPWaitingAcceptanceNote:
+            retVal = R_VOIP_TRANSFER_WAITING_ACCEPTENCE;
+            break;
+        case EPhoneVoIPCallTypeInternet:
+            retVal = R_VOIP_CALL_TYPE_INTERNET;
+            break;
+        case EPhoneVoIPNumberAcqXSPCall:
+            break;
+        case EPhoneVoIPUnattendedTransferOption:  
+            retVal = R_VOIP_UNATTENDED_TRANSFER_OPTION;       
+            break;
+        case EPhoneVoIPUnattendedTransferAcceptanceQueryIdentified:
+            retVal = R_PHONE_VOIP_TRANSFER_ACCEPT;
+            break;
+        case EPhoneVoIPUnattendedTransferAcceptanceQueryAnonymous:
+            retVal = R_PHONE_VOIP_TRANSFER_ACCEPT_CLI;
+            break;
+        case EPhoneVoIPUnattendedTransferAcceptanceQueryHeader:
+            retVal = R_PHONE_VOIP_QUERY_ACC_ID_HEADER;
+            break;
+        case EPhoneVoIPTransferAddress:
+            retVal = R_VOIP_TRANSFER_ADDRESS;
+            break;
+        case EPhoneVoIPTransferDialerNumberEntryEmptyMenubar:
+            retVal = R_PHONEUIDIALER_NUMBERENTRY_EMPTY_TRANSFER_MENUBAR;
+            break;
+        case EPhoneVoIPTransferDialerNumberEntryNotEmptyMenubar:
+            retVal = R_PHONEUIDIALER_NUMBERENTRY_NOT_EMPTY_TRANSFER_MENUBAR;
+            break;
+        case EPhoneVoIPTransferDialerSoftkeys:
+            retVal = R_PHONEUI_TRANSFER_DIALER_SOFTKEYS_OPTIONS_CANCEL;
+            break;
+        case EPhoneVoIPTransferAddressQuery:
+            retVal = R_PHONE_TRANSFER_VOIP_CALL_QUERY;
+            break;
+        case EPhoneVoIPTransferAddressQueryEmptySoftkeys:
+            retVal = R_PHONE_VOIP_SOFTKEYS_SEARCH_CANCEL;
+            break;
+        case EPhoneVoIPTransferAddressQueryNotEmptySoftkeys:
+            retVal = R_PHONE_VOIP_SOFTKEYS_OK_CANCEL;
+            break;
+        case EPhoneVoIPNewCallQuery:
+            retVal = R_PHONE_NEW_VOIP_CALL_QUERY;
+            break;
+        case EPhoneVoIPNewCallQueryEmptySoftkeys:
+            retVal = R_PHONE_NEW_VOIP_CALL_SOFTKEYS_SEARCH_CANCEL;
+            break;
+        case EPhoneVoIPNewCallQueryNotEmptySoftkeys:
+            retVal = R_PHONE_VOIP_NEW_CALL_SOFTKEYS_OK_CANCEL;
+            break;
+        case EPhoneVoIPEnablingServiceWaitNoteText:
+            retVal = R_PHONE_VOIP_CONNECTING_SERVICE;
+            break;
+        case EPhoneVoIPAuthenticationFailed:
+            retVal = R_PHONEUI_VOIP_ERROR_NOTE_AUTHENTICATION_FAILED;
+            break;   
+        case EPhoneVoIPHandoverToWlanOption:  
+            retVal = R_VOIP_HANDOVER_TO_WLAN_OPTION;      
+            break;
+        case EPhoneVoIPHandoverToGsmOption:  
+            retVal = R_VOIP_HANDOVER_TO_GSM_OPTION;
+            break;      
+        case EPhoneVoIPNewCallMenuOption:  
+            retVal = R_PHONE_VOIP_NEW_CALL_OPTION;       
+            break;  
+        case EPhoneVoIPErrorInConnection:
+            retVal = R_PHONEUI_VOIP_ERROR_IN_CONNECTION;
+            break;
+        case EPhoneVoIPWaitHandoverFromWlan:  
+            retVal = R_VOIP_VCC_WAIT_HO_FROM_WLAN;      
+            break;
+        case EPhoneVoIPWaitHandoverFromGsm:  
+            retVal = R_VOIP_VCC_WAIT_HO_FROM_GSM;      
+            break;      
+        case EPhoneVoIPHandoverFail:
+            retVal = R_VOIP_VCC_INFO_HO_FAILED;
+            break;
+        case EPhoneVoIPMovedPermanentlyQueryHeader:
+            retVal = R_PHONEUI_VOIP_QUERY_HEADER_MOVED_PERMANENTLY;
+            break;
+        case EPhoneVoIPMovedPermanentlySoftkeys:
+            //retVal = R_PHONE_VOIP_SOFTKEYS_OK_END_CALL;
+            retVal = R_AVKON_SOFTKEYS_OK_CANCEL;
+            break;
+        case EPhoneVoIPMultipleChoicesListQuery:
+            retVal = R_PHONE_VOIP_MULTIPLE_CHOICES_LIST_QUERY;
+            break;
+        case EPhoneVoIPNoConnectionsDefined:
+            retVal = R_PHONE_VOIP_NO_CONNECTIONS_DEFINED;
+            break;
+        case EPhoneVoIPNoConnectionsAvailable:
+            retVal = R_PHONE_VOIP_NO_CONNECTIONS_AVAILABLE;
+            break;
+        case EPhoneVoIPCallsNotSupported:
+            retVal = R_PHONE_VOIP_CONNECTION_DOES_NOT_SUPPORT_CALLS;
+            break;
+        case EPhoneVoIPNotAvailableWhenConnecting:
+            retVal = R_PHONE_VOIP_CONNECTION_NOT_AVAILABLE_DURING_ALR;
+            break;
+        case EPhoneVoIPDefectiveSettings:
+            retVal = R_PHONE_VOIP_CREATING_CONN_FAILED_PERMANENTLY;
+            break;
+        default:
+            retVal = CPhoneResourceResolverGSM::ResolveResourceID( aResource );
+            break;
+        }
+
+    return retVal;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestatealertingvoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateAlertingVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include <mpeengineinfo.h>
+
+#include "cphonestatealertingvoip.h"
+#include "phonelogger.h"
+#include "mphonestatemachine.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneStateAlertingVoIP::CPhoneStateAlertingVoIP( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aPhoneCustomization ) : 
+    CPhoneAlerting( &aStateMachine, &aViewCommandHandle, &aPhoneCustomization )
+    {
+    
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateAlertingVoIP::~CPhoneStateAlertingVoIP()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneStateAlertingVoIP::~CPhoneStateAlertingVoIP()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateAlertingVoIP::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStateAlertingVoIP::ConstructL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneStateAlertingVoIP::ConstructL()");
+    CPhoneAlerting::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateAlertingVoIP::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateAlertingVoIP* CPhoneStateAlertingVoIP::NewL( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aPhoneCustomization )
+    {
+    CPhoneStateAlertingVoIP* self = new (ELeave) 
+        CPhoneStateAlertingVoIP( aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateAlertingVoIP::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneStateAlertingVoIP::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateAlertingVoIP::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnectedL( aCallId );
+            break;
+        
+        default:
+            CPhoneAlerting::HandlePhoneEngineMessageL( 
+                aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateAlertingVoIP::HandleConnectedL
+// -----------------------------------------------------------
+//
+void CPhoneStateAlertingVoIP::HandleConnectedL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateAlertingVoIP::HandleConnectedL() ");
+
+    if( iStateMachine->PhoneEngineInfo()->CallType( aCallId ) == EPECallTypeVoIP )
+        {
+        SetCallHeaderType( EPECallTypeVoIP );
+        }
+
+    CPhoneAlerting::HandleConnectedL( aCallId );        
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestatecallsetupvoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateCallSetupVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include <mpeengineinfo.h>
+
+#include "cphonestatecallsetupvoip.h"
+#include "phonelogger.h"
+#include "mphonestatemachine.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneStateCallSetupVoIP::CPhoneStateCallSetupVoIP( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aPhoneCustomization ) : 
+    CPhoneCallSetup( &aStateMachine, &aViewCommandHandle, &aPhoneCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetupVoIP::~CPhoneStateCallSetupVoIP()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneStateCallSetupVoIP::~CPhoneStateCallSetupVoIP()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetupVoIP::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetupVoIP::ConstructL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneStateCallSetupVoIP::ConstructL()");
+    CPhoneCallSetup::ConstructL();
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetupVoIP::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateCallSetupVoIP* CPhoneStateCallSetupVoIP::NewL( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aPhoneCustomization )
+    {
+    CPhoneStateCallSetupVoIP* self = new (ELeave) 
+        CPhoneStateCallSetupVoIP( aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetupVoIP::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetupVoIP::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateCallSetupVoIP::HandlePhoneEngineMessageL() ");
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageConnecting:
+            HandleConnectingL( aCallId );
+            break;
+        
+        default:
+            CPhoneCallSetup::HandlePhoneEngineMessageL( 
+                aMessage, aCallId );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateCallSetupVoIP::HandleConnectingL
+// -----------------------------------------------------------
+//
+void CPhoneStateCallSetupVoIP::HandleConnectingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateCallSetupVoIP::HandleConnectingL() ");
+
+    if( iStateMachine->PhoneEngineInfo()->CallType( aCallId ) == EPECallTypeVoIP )
+        {
+        SetCallHeaderType( EPECallTypeVoIP );   
+        }
+        
+    CPhoneCallSetup::HandleConnectingL( aCallId );      
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestateidlevoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,291 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateIdleVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include <mpeengineinfo.h>       
+#include "pevirtualengine.h"
+#include <featmgr.h>
+                                  
+#include "cphonestateidlevoip.h"
+#include "phoneappvoipcommands.hrh"
+#include "phonerssvoip.h"
+#include "tphonecmdparaminteger.h"
+#include "cphonemainresourceresolver.h"
+#include "mphonestatemachine.h"
+#include "cphonelogger.h"
+#include "phoneui.pan"
+#include "cphonecustomizationvoip.h"
+#include "tphonecmdparamspeeddial.h"
+#include "cphonecenrepproxy.h"
+#include "cphonestateutilsvoip.h"
+#include "cphonestatemachinevoip.h"
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneStateIdleVoIP::CPhoneStateIdleVoIP( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aCustomization ) : 
+    CPhoneIdle( &aStateMachine, &aViewCommandHandle, &aCustomization )
+    {
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::~CPhoneStateIdleVoIP()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateIdleVoIP::~CPhoneStateIdleVoIP()
+    {
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStateIdleVoIP::ConstructL()
+    {
+    CPhoneIdle::ConstructL();
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateIdleVoIP* CPhoneStateIdleVoIP::NewL( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aCustomization )
+    {
+    CPhoneStateIdleVoIP* self = new (ELeave) CPhoneStateIdleVoIP( 
+        aStateMachine, aViewCommandHandle, aCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdleVoIP::HandlePhoneEngineMessageL( 
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    switch ( aMessage )
+        {           
+        default:
+            CPhoneIdle::HandlePhoneEngineMessageL( aMessage, aCallId );
+            break;
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneStateIdleVoIP::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneStateIdleVoIP::HandleCommandL() ");
+
+    TBool commandStatus( ETrue );
+
+    switch( aCommand )
+        {       
+        case EPhoneNumberAcqCmdInternetCall:
+            {
+            StateUtils().SelectServiceAndDialL();
+            }
+            break;
+
+        default:
+            commandStatus = CPhoneIdle::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::HandleSendCommandL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdleVoIP::HandleSendCommandL()
+    {
+    __LOGMETHODSTARTEND( 
+        PhoneUIVoIPExtension, "CPhoneStateIdleVoIP::HandleSendCommandL()" );
+    
+    HBufC* phoneNumber = PhoneNumberFromEntryLC();
+     
+    if ( !IsSimOk() || IsEmergencyNumber( *phoneNumber ) )
+        {
+        CPhoneIdle::HandleSendCommandL();         
+        }  
+    else if ( IsSpeedDialNumber( *phoneNumber ) )
+        {
+        SpeedDialL( (*phoneNumber)[0], EDialMethodSendCommand );
+        }
+    else
+        {
+        TUint serviceId( 0 );
+        CPhoneStateUtilsVoip& utils = StateUtils();
+        if ( utils.IsVoipPreferredCall( serviceId ) &&
+             !iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() )
+            {
+            utils.SelectServiceAndDialL( KNullDesC, serviceId );
+            }
+        else
+            {
+            if ( utils.IsVoipNumber() )
+                {
+                utils.SelectServiceAndDialL();
+                }
+            else
+                {
+                CPhoneIdle::HandleSendCommandL();
+                }
+            }        
+        }
+    
+    CleanupStack::PopAndDestroy( phoneNumber );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::HandleDialingL
+// -----------------------------------------------------------
+//
+void CPhoneStateIdleVoIP::HandleDialingL( TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneStateIdleVoIP::HandleDialingL( ) ");
+
+    if( iStateMachine->PhoneEngineInfo()->CallType( aCallId ) == EPECallTypeVoIP )
+        {
+        SetCallHeaderType( EPECallTypeVoIP );       
+        }
+
+    CPhoneIdle::HandleDialingL( aCallId );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::DialL
+// -----------------------------------------------------------
+//   
+void CPhoneStateIdleVoIP::DialL( 
+        const TDesC& aNumber, 
+        TPhoneNumberType aNumberType,
+        TDialInitiationMethod aDialMethod )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+                         "CPhoneStateIdleVoIP::DialL( ) ");
+    if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
+        {
+        CPhoneStateUtilsVoip& utils = StateUtils();
+
+        // When speed dialling to voice mailbox, service id comes from vmbx
+        TUint serviceId = iStateMachine->PhoneEngineInfo()->ServiceIdCommand();
+        
+        if ( serviceId != KUnknownService && EPhoneNumberTypeNotFound != aNumberType )
+            {
+            if ( EPhoneNumberTypeVoip == aNumberType )
+                {
+                utils.DialVoIPL( aNumber, serviceId );
+                }
+            else
+                {
+                CPhoneIdle::DialL( aNumber, aNumberType, aDialMethod );
+                }
+            }
+        else if( utils.IsVoipPreferredCall( serviceId ) )
+            {
+            // Because IsVoipPreferredCall assumes that Send key is pressed,
+            // we only use serviceId given by it when dial method is SendCommand
+            if ( EDialMethodSendCommand == aDialMethod ) 
+                {
+                utils.SelectServiceAndDialL( aNumber, serviceId );
+                }
+            else
+                {
+                // One key dialing is done based on number type even
+                // if VoIP is preferred call.
+                CPhoneIdle::DialL( aNumber, aNumberType, aDialMethod );
+                }
+            }
+        else
+            {
+            if ( EPhoneNumberTypeVoip == aNumberType )
+                {
+                utils.SelectServiceAndDialL( aNumber );
+                }
+            else
+                {
+                CPhoneIdle::DialL( aNumber, aNumberType, aDialMethod );
+                }
+            }
+        }
+    else
+        {
+        CPhoneIdle::DialL( aNumber, aNumberType, aDialMethod );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoip::IsEmergencyNumber()
+// -----------------------------------------------------------
+//
+TBool CPhoneStateIdleVoIP::IsEmergencyNumber( const TDesC& aNumber )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateIdleVoIP::IsEmergencyNumber" );
+    
+    return StateUtils().IsEmergencyNumber( aNumber );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::StateUtils
+// -----------------------------------------------------------
+//
+CPhoneStateUtilsVoip& CPhoneStateIdleVoIP::StateUtils()
+    {
+    return static_cast<CPhoneStateMachineVoIP&>( 
+        *iStateMachine ).StateUtils();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestateincomingvoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateIncomingVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include <mpeengineinfo.h>
+#include "cphonestateincomingvoip.h"
+#include "phonelogger.h"
+#include "cphonecustomizationvoip.h"
+#include "phonerssbase.h"
+#include "mphonestatemachine.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneStateIncomingVoIP::CPhoneStateIncomingVoIP( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aPhoneCustomization ) : 
+    CPhoneIncoming( &aStateMachine, &aViewCommandHandle, &aPhoneCustomization )
+    {
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIncomingVoIP::~CPhoneStateIncomingVoIP()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneStateIncomingVoIP::~CPhoneStateIncomingVoIP()
+    {
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIncomingVoIP::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStateIncomingVoIP::ConstructL()
+    {
+    __LOGMETHODSTARTEND( 
+        PhoneUIVoIPExtension, "CPhoneStateIncomingVoIP::ConstructL()");
+    
+    CPhoneIncoming::ConstructL();
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIncomingVoIP::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateIncomingVoIP* CPhoneStateIncomingVoIP::NewL( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aPhoneCustomization )
+    {
+    CPhoneStateIncomingVoIP* self = new (ELeave) CPhoneStateIncomingVoIP( 
+        aStateMachine, aViewCommandHandle, aPhoneCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIncomingVoIP::HandleLongHashL
+// -----------------------------------------------------------
+//
+ void CPhoneStateIncomingVoIP::HandleLongHashL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension,
+        "CPhoneStateIncomingVoIP::HandleLongHashL( ) ");
+
+    CPhoneState::HandleLongHashL();
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateIncomingVoIP::HandleAudioPlayStoppedL
+// -----------------------------------------------------------
+//
+void CPhoneStateIncomingVoIP::HandleAudioPlayStoppedL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl,
+        "CPhoneStateIncomingVoIP::HandleAudioPlayStoppedL()" );
+    
+    // Update the CBA
+    if ( iStateMachine->PhoneEngineInfo()->
+            CallType( iRingingCallId ) == EPECallTypeVoIP )
+        {
+        TInt resourceId = EPhoneCallHandlingIncomingRejectCBA;
+        
+        if ( IsNumberEntryVisibleL() && !IsOnScreenDialerSupported() )
+            {
+            resourceId = EPhoneNumberAcqCBA;
+            }
+        
+        iCbaManager->SetCbaL( resourceId );
+        }
+    else
+        {
+        CPhoneIncoming::HandleAudioPlayStoppedL();    
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestatemachinevoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,221 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateMachineVoIP class.
+*
+*/
+
+// INCLUDE FILES
+#include "cphonestatemachinevoip.h"
+#include "phonelogger.h"
+#include "phonestatedefinitionsvoip.h"
+#include "cphonestateidlevoip.h"
+#include "cphonestateincomingvoip.h"
+#include "cphonestatecallsetupvoip.h"
+#include "cphonestatesinglevoip.h"
+#include "cphonestatealertingvoip.h"
+#include "cphonecustomizationvoip.h"
+#include "cphonevoiperrormessageshandler.h"
+#include "cphonestateutilsvoip.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::CPhoneStateMachineVoIP
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------------------------
+//
+CPhoneStateMachineVoIP::CPhoneStateMachineVoIP(
+    MPhoneViewCommandHandle* aViewCommandHandle ) :
+    CPhoneStateMachineGSM( aViewCommandHandle )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::~CPhoneStateMachineVoIP()
+// Destructor
+// (other items were commented in a header).
+// ---------------------------------------------------------------------------
+//
+CPhoneStateMachineVoIP::~CPhoneStateMachineVoIP()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateMachineVoIP::~CPhoneStateMachineVoIP()" );
+    
+    delete iVoipCustomization;
+    delete iStateUtils;
+    Dll::FreeTls();
+    }
+    
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::ConstructL
+// Constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------------------------
+//
+void CPhoneStateMachineVoIP::ConstructL()
+    {
+    __LOGMETHODSTARTEND( 
+        PhoneUIVoIPExtension, "CPhoneStateMachineVoIP::ConstructL()" );
+    
+    iVoipCustomization = CPhoneCustomizationVoip::NewL( *this, *iViewCommandHandle );
+    iCustomization = iVoipCustomization;
+    iStateUtils = CPhoneStateUtilsVoip::NewL( *this, *iViewCommandHandle );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::State
+// ---------------------------------------------------------------------------
+//
+MPhoneState* CPhoneStateMachineVoIP::State()
+    {
+    __LOGMETHODSTARTEND( 
+        PhoneUIVoIPExtension, "CPhoneStateMachineVoIP::State()" );
+    
+    TInt err( KErrNone );
+    TBool madeStateTransition( EFalse );
+    TBool deleteOldState( ETrue );
+
+    if( iOldStateId != iNewStateId )
+        {
+        if( iOldStateId == EPhoneStateIdle ||
+            iOldStateId == EPhoneStateEmergency )
+            {
+            deleteOldState = EFalse;
+            }
+        if ( deleteOldState )
+            {
+            // Possible that derived class has been deleted iState,
+            // so this delete statement may be useless.
+            delete iState;
+            iState = NULL;                      
+            }
+
+        // State transition need to be made - construct new state and
+        // destruct old
+        switch( iNewStateId )
+            {
+            case EPhoneStateCallSetup:
+                TRAP( err, iState = CPhoneStateCallSetupVoIP::NewL( 
+                    *this, *iViewCommandHandle, *iVoipCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+
+            case EPhoneStateIdle:
+                if( iIdleState == NULL )
+                    {
+                    TRAP( err, iIdleState = CPhoneStateIdleVoIP::NewL( 
+                        *this, *iViewCommandHandle, *iVoipCustomization ) );
+                    __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                    }
+                iState = iIdleState;
+                madeStateTransition = ETrue;
+                break;                     
+
+            case EPhoneStateIncoming:
+                TRAP( err, iState = CPhoneStateIncomingVoIP::NewL( 
+                    *this, *iViewCommandHandle, *iVoipCustomization ) );
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;                     
+
+            case EPhoneStateSingle:
+                TRAP( err, iState = CPhoneStateSingleVoIP::NewL( 
+                    *this, *iViewCommandHandle, *iVoipCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+
+            case EPhoneStateAlerting:
+                TRAP( err, iState = CPhoneStateAlertingVoIP::NewL(
+                    *this, *iViewCommandHandle, *iVoipCustomization ));
+                __ASSERT_ALWAYS( KErrNone == err, User::Invariant() );
+                madeStateTransition = ETrue;
+                break;
+
+            default:
+                iState = CPhoneStateMachineGSM::State();
+                break;
+            }
+        }
+
+    if ( madeStateTransition )
+        {
+        iOldStateId = iNewStateId;
+        }
+
+    return iState;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::SetVoipErrorMessageHandler
+// ---------------------------------------------------------------------------
+//
+void CPhoneStateMachineVoIP::SetVoipErrorMessageHandler( 
+        CPhoneVoIPErrorMessagesHandler& iErrorHandler )
+    {
+    iVoipErrorMessageHandler = &iErrorHandler;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::VoipErrorMessageHandler
+// ---------------------------------------------------------------------------
+//
+CPhoneVoIPErrorMessagesHandler& 
+        CPhoneStateMachineVoIP::VoipErrorMessageHandler() const
+    {
+    __ASSERT_DEBUG( NULL != iVoipErrorMessageHandler, User::Invariant() );
+    return *iVoipErrorMessageHandler;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::StateUtils
+// ---------------------------------------------------------------------------
+//
+CPhoneStateUtilsVoip& CPhoneStateMachineVoIP::StateUtils()
+    {
+    return *iStateUtils;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateMachineVoIP::NewL()
+// Constructor
+// (other items were commented in a header).
+// ---------------------------------------------------------------------------
+//
+CPhoneStateMachineVoIP* CPhoneStateMachineVoIP::NewL(
+        MPhoneViewCommandHandle* aViewCommandHandle )
+    {
+    __LOGMETHODSTARTEND( 
+        PhoneUIVoIPExtension, "CPhoneStateMachineVoIP::NewL()" );
+    
+    CPhoneStateMachineVoIP* self = 
+        new (ELeave) CPhoneStateMachineVoIP( aViewCommandHandle );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestatesinglevoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,387 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneStateSingleVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include <StringLoader.h>
+#include <avkon.rsg>
+#include <mpeengineinfo.h>
+#include "cphonestatesinglevoip.h"
+#include "phonelogger.h"
+#include "cphonecustomizationvoip.h"
+
+#include "phoneappvoipcommands.hrh"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamboolean.h"
+#include "tphonecmdparamstring.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssvoip.h"
+
+#include "tphonecmdparamselector.h"
+#include "mphonestatemachine.h"
+#include "tphonecmdparamcustomdialer.h"
+#include "cphonetransferdialercontroller.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamglobalnote.h"
+#include "cphonestateutilsvoip.h"
+#include "cphonestatemachinevoip.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneStateSingleVoIP::CPhoneStateSingleVoIP( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aCustomization ) : 
+    CPhoneSingleCall( &aStateMachine, &aViewCommandHandle, &aCustomization )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::~CPhoneStateSingleVoIP()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+
+CPhoneStateSingleVoIP::~CPhoneStateSingleVoIP()
+    { 
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::ConstructL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+void CPhoneStateSingleVoIP::ConstructL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateSingleVoIP::ConstructL()" )
+    CPhoneSingleCall::ConstructL(); 
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::NewL()
+// Constructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneStateSingleVoIP* CPhoneStateSingleVoIP::NewL( 
+    MPhoneStateMachine& aStateMachine, 
+    MPhoneViewCommandHandle& aViewCommandHandle,
+    MPhoneCustomization& aCustomization )
+    {
+    CPhoneStateSingleVoIP* self = new (ELeave) 
+        CPhoneStateSingleVoIP( aStateMachine, aViewCommandHandle, aCustomization );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::HandlePhoneEngineMessageL
+// -----------------------------------------------------------
+//
+void CPhoneStateSingleVoIP::HandlePhoneEngineMessageL( 
+    const TInt aMessage, 
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateSingleVoIP::HandlePhoneEngineMessageL() ")
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageUnattendedTransferRequest:
+            LaunchUnattendedTransferAcceptanceQueryL();
+            break;
+        default:
+            CPhoneSingleCall::HandlePhoneEngineMessageL( 
+                aMessage, aCallId );
+            break;
+        }
+    }
+ 
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::HandleCommandL
+// -----------------------------------------------------------
+//
+TBool CPhoneStateSingleVoIP::HandleCommandL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateSingleVoIP::HandleCommandL()" )
+
+    TBool commandStatus( ETrue );
+
+    switch( aCommand )
+        {
+        case EPhoneNumberAcqCmdInternetCall:
+            StateUtils().SelectServiceAndDialL();
+            break;
+        
+        case EPhoneNumberAcqCmdSendCommand:
+            StartCallingL();
+            break;
+         
+        case EPhoneCmdAcceptUnattendedTransfer:
+            HandleUnattendedTransferRequestResponseL( ETrue );
+            break;
+        
+        case EPhoneCmdRejectUnattendedTransfer:
+            HandleUnattendedTransferRequestResponseL( EFalse );
+            break;
+        default:
+            commandStatus = CPhoneSingleCall::HandleCommandL( aCommand );
+            break;
+        }
+
+    return commandStatus;
+    } 
+  
+// -----------------------------------------------------------
+// CPhoneStateIdleVoIP::HandleKeyMessageL
+// -----------------------------------------------------------
+//
+void CPhoneStateSingleVoIP::HandleKeyMessageL( 
+    TPhoneKeyEventMessages aMessage,
+    TKeyCode aKeyCode  )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateSingleVoIP::HandleKeyMessageL()" )
+    switch ( aKeyCode )
+        {
+        // send-key
+        case EKeyYes:
+            {
+            TPhoneCmdParamInteger numberEntryCountParam;
+            iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount,
+            &numberEntryCountParam );
+            TInt neLength( numberEntryCountParam.Integer() );
+                 
+            if( IsNumberEntryVisibleL() && neLength )
+                {
+                if ( IsOnScreenDialerSupported() &&  
+                     ( IsDTMFEditorVisibleL() ||
+                       IsCustomizedDialerVisibleL() ) )
+                    {
+                    return;
+                    }
+                    
+                StartCallingL();
+                }
+            else
+                {
+                //Calls ToggleHoldL, if number entry isn't used.
+                CPhoneSingleCall::HandleKeyMessageL( aMessage, aKeyCode );
+                }
+            }
+            break;
+            
+        default:
+            CPhoneSingleCall::HandleKeyMessageL( aMessage, aKeyCode );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::StartCallingL
+// -----------------------------------------------------------
+//
+void CPhoneStateSingleVoIP::StartCallingL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateSingleVoIP::StartCallingL()" )
+    
+    TUint serviceId( 0 );
+    CPhoneStateUtilsVoip& utililty = StateUtils();
+    if ( utililty.IsVoipPreferredCall( serviceId ) )
+        {
+        utililty.SelectServiceAndDialL( KNullDesC, serviceId );         
+        }
+    else
+        {
+        if ( utililty.IsVoipNumber() )
+            {
+            utililty.SelectServiceAndDialL();
+            }
+        else
+            {
+            if ( IsNumberEntryUsedL() )
+                {
+                // handle send key short press
+                HBufC* phoneNumber = PhoneNumberFromEntryLC();
+                
+                if ( !IsSimOk() )
+                    {
+                    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( 
+                            *phoneNumber ) ;
+                    iStateMachine->SendPhoneEngineMessage( 
+                            MPEPhoneModel::EPEMessageCheckEmergencyNumber );
+                    CleanupStack::PopAndDestroy( phoneNumber );
+                    return;
+                    }
+                
+                // call the number
+                iStateMachine->PhoneEngineInfo()->SetPhoneNumber( 
+                        *phoneNumber );
+                DialVoiceCallL();
+
+                CleanupStack::PopAndDestroy( phoneNumber );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::LaunchUnattendedTransferAcceptanceQueryL
+// Dialog is constructed based on S60 In-Call Operations UI Specification, 
+// Section 2.26.
+// -----------------------------------------------------------
+//
+void CPhoneStateSingleVoIP::LaunchUnattendedTransferAcceptanceQueryL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateSingleVoIP::LaunchUnattendedTransferAcceptanceQueryL() ")
+    
+    TPhoneCmdParamQuery queryParam;
+    queryParam.SetQueryType( EPhoneGlobalMsgQuery );
+    queryParam.SetCommandParamId( 
+        TPhoneCommandParam::EPhoneParamIdUnattendedTransferAcceptanceQuery );
+    
+    HBufC* msgHeader = 
+        StringLoader::LoadLC( CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( 
+                EPhoneVoIPUnattendedTransferAcceptanceQueryHeader ) );
+    queryParam.SetQueryPrompt( *msgHeader );
+    
+    RBuf queryText;
+    CleanupClosePushL( queryText );
+    ResolveUnattendedTransferAcceptanceQueryDialogTextL( queryText );
+    queryParam.SetDataText( &queryText );
+    
+    queryParam.SetDefaultCba( R_AVKON_SOFTKEYS_ACCEPT_REJECT );
+    
+    const TInt KAcceptTransferQueryTimeoutInSec = 7;
+    queryParam.SetTimeOut( KAcceptTransferQueryTimeoutInSec );
+    
+    queryParam.SetTone( EAvkonSIDDefaultSound );
+    
+    // configure custom command mappings for user responses
+    queryParam.SetCbaCommandMapping( 
+        EAknSoftkeyYes, EPhoneCmdAcceptUnattendedTransfer );
+    queryParam.SetCbaCommandMapping( 
+        EAknSoftkeyOk, EPhoneCmdAcceptUnattendedTransfer );
+    queryParam.SetCbaCommandMapping( 
+        EAknSoftkeyNo, EPhoneCmdRejectUnattendedTransfer );
+    queryParam.SetCbaCommandMapping( 
+        EAknSoftkeyCancel, EPhoneCmdRejectUnattendedTransfer );
+    queryParam.SetCustomCommandForTimeOut( EPhoneCmdRejectUnattendedTransfer );
+    
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, &queryParam );
+    
+    CleanupStack::PopAndDestroy( &queryText );
+    CleanupStack::PopAndDestroy( msgHeader );
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::ResolveUnattendedTransferAcceptanceQueryDialogTextL
+// -----------------------------------------------------------
+//
+void CPhoneStateSingleVoIP::ResolveUnattendedTransferAcceptanceQueryDialogTextL( 
+        RBuf& aQueryText ) const
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+    "CPhoneStateSingleVoIP::ResolveUnattendedTransferAcceptanceQueryDialogTextL")
+    
+    aQueryText.Close();
+    
+    MPEEngineInfo* info = iStateMachine->PhoneEngineInfo();
+    const TPEPhoneNumber& transferorAddr = info->RemotePhoneNumber( CallId() );
+    const TPEPhoneNumber& transferTarget = 
+        info->UnattendedTransferTarget( CallId() );
+    
+    if ( KNullDesC() == transferorAddr )
+        {
+        // transfer initiator is anonymous
+        aQueryText.Assign( StringLoader::LoadL( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                EPhoneVoIPUnattendedTransferAcceptanceQueryAnonymous ), 
+            transferTarget ) );
+        }
+    else
+        {
+        const TInt KGranularity = 2;
+        CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( KGranularity );
+        CleanupStack::PushL( array );
+        array->AppendL( transferorAddr );
+        array->AppendL( transferTarget );
+        aQueryText.Assign( StringLoader::LoadL( 
+            CPhoneMainResourceResolver::Instance()->ResolveResourceID( 
+                EPhoneVoIPUnattendedTransferAcceptanceQueryIdentified ), 
+            *array ) );
+        CleanupStack::PopAndDestroy( array );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::HandleUnattendedTransferRequestResponseL
+// -----------------------------------------------------------
+//
+void CPhoneStateSingleVoIP::HandleUnattendedTransferRequestResponseL( 
+        TBool aRequestAccepted )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateSingleVoIP::HandleUnattendedTransferRequestResponseL" )
+    
+    iStateMachine->SetCallId( CallId() );
+    
+    if ( aRequestAccepted )
+        {        
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageAcceptUnattendedTransfer );
+        MPEEngineInfo* info = iStateMachine->PhoneEngineInfo();
+        const TPEPhoneNumber& transferTarget = 
+            info->UnattendedTransferTarget( CallId() );
+ 
+        TUint32 serviceId = iStateMachine->PhoneEngineInfo()->
+            ServiceId( CallId() );
+        StateUtils().SelectServiceAndDialL( transferTarget, serviceId );
+        }
+    else
+        {
+        iStateMachine->SendPhoneEngineMessage( 
+            MPEPhoneModel::EPEMessageRejectUnattendedTransfer );
+        }
+    }
+
+
+// -----------------------------------------------------------
+// CPhoneStateSingleVoIP::StateUtils
+// -----------------------------------------------------------
+//
+CPhoneStateUtilsVoip& CPhoneStateSingleVoIP::StateUtils()
+    {
+    return static_cast<CPhoneStateMachineVoIP&>( 
+        *iStateMachine ).StateUtils();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonestateutilsvoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,268 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Utility class for Voip-states.
+*
+*/
+
+#include <cphcltemergencycall.h>
+#include <mpeengineinfo.h>
+#include <cconvergedserviceselector.h>
+#include "cphonestateutilsvoip.h"
+#include "cphonelogger.h"
+#include "phoneconstants.h"
+#include "mphonestatemachine.h"
+#include "mphoneviewcommandhandle.h"
+#include "phoneui.pan"
+#include "tphonecmdparamstring.h"
+#include "cphonekeys.h"
+#include "tphonecmdparamselector.h"
+#include "phonestatedefinitionsvoip.h"
+
+const TInt KServiceId1 = 1;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::CPhoneStateUtilsVoip
+// C++ constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneStateUtilsVoip::CPhoneStateUtilsVoip( MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+        : 
+        iStateMachine( aStateMachine ), 
+        iViewCommandHandle( aViewCommandHandle )
+    {
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneStateUtilsVoip::ConstructL()
+    {
+    iBuffer = HBufC::NewL( KPhoneNumberEntryBufferSize );
+    iEmergencyCall = CPhCltEmergencyCall::NewL( NULL );
+    iServiceSelector = CConvergedServiceSelector::NewL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::NewL
+// ---------------------------------------------------------------------------
+//
+CPhoneStateUtilsVoip* CPhoneStateUtilsVoip::NewL( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneStateUtilsVoip* self = CPhoneStateUtilsVoip::NewLC( 
+        aStateMachine, aViewCommandHandle );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::NewLC
+// ---------------------------------------------------------------------------
+//
+CPhoneStateUtilsVoip* CPhoneStateUtilsVoip::NewLC( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneStateUtilsVoip* self = new( ELeave ) CPhoneStateUtilsVoip( 
+        aStateMachine, aViewCommandHandle );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::~CPhoneStateUtilsVoip
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneStateUtilsVoip::~CPhoneStateUtilsVoip()
+    {
+    delete iBuffer;
+    delete iEmergencyCall;
+    delete iServiceSelector;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::DialVoIPL
+// ---------------------------------------------------------------------------
+//
+void CPhoneStateUtilsVoip::DialVoIPL( const TDesC& aNumber, TUint aServiceId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateUtilsVoip::DialVoIPL" );
+    
+    __ASSERT_DEBUG( 
+        iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) );
+    
+    if ( 0 == aNumber.Compare( KNullDesC ) )
+        {
+        // Get the number entry contents
+        HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+        TPtr ptr( phoneNumber->Des() );
+        TPhoneCmdParamString stringParam;
+        stringParam.SetString( &ptr );
+        iViewCommandHandle.ExecuteCommand(
+            EPhoneViewGetNumberFromEntry,
+            &stringParam );
+    
+        // Set the phone number
+        iStateMachine.PhoneEngineInfo()->SetPhoneNumber( ptr );
+        
+        CleanupStack::PopAndDestroy( phoneNumber );
+        }
+    else
+        {
+        iStateMachine.PhoneEngineInfo()->SetPhoneNumber( aNumber );
+        }
+    
+    // Make a call
+    iStateMachine.PhoneEngineInfo()->SetServiceIdCommand( aServiceId );
+    iStateMachine.PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeVoIP );
+    iStateMachine.SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::IsVoipPreferredCall
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneStateUtilsVoip::IsVoipPreferredCall( TUint& aServiceId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateUtilsVoip::IsVoipPreferredCall" );
+    
+    TBool isVoipPrefered( EFalse );
+    
+    CConvergedServiceSelector::TSsResult results;
+    TInt result = iServiceSelector->GetCallingServiceByCallType( results,
+        CConvergedServiceSelector::ESsVoiceCall, 0, ETrue );
+    
+    if ( KErrNone == result && 
+         CConvergedServiceSelector::ESsVoipCall == results.iCallType )
+        {
+        __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+            "CPhoneStateUtilsVoip::IsVoipPreferred ETrue" );
+        aServiceId = results.iServiceId;
+        isVoipPrefered = ETrue;
+        }
+    
+    return isVoipPrefered;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::IsVoipNumberL
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneStateUtilsVoip::IsVoipNumber()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateUtilsVoip::IsVoipNumberL" );
+    
+    TBool isVoipNumber = EFalse;
+    
+    TPtr ptr( iBuffer->Des() );
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+    iViewCommandHandle.ExecuteCommand( 
+        EPhoneViewGetNumberFromEntry, &stringParam );
+    
+    isVoipNumber = !CPhoneKeys::Validate( ptr );
+    
+    return isVoipNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::SelectServiceAndDialL
+// ---------------------------------------------------------------------------
+//
+void CPhoneStateUtilsVoip::SelectServiceAndDialL( 
+        const TDesC& aNumber,
+        TUint aServiceId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateIdleVoIP::SelectServiceAndDialL" );
+    
+    TPhoneCmdParamSelector params;
+    
+    // Get the number entry contents
+    TPtr ptr( iBuffer->Des() );
+    TPhoneCmdParamString stringParam;
+    stringParam.SetString( &ptr );
+    iViewCommandHandle.ExecuteCommand(
+        EPhoneViewGetNumberFromEntry,
+        &stringParam );
+    
+    // Check the string 
+    TBool emergencyNumber = ( 0 == aNumber.Compare( KNullDesC ) ?
+        IsEmergencyNumber( ptr ) :
+        IsEmergencyNumber( aNumber ) );
+    
+    if ( emergencyNumber )
+        {
+        if ( 0 == aNumber.Compare( KNullDesC ) )
+            {
+            // Set the phone number from number entry
+            iStateMachine.PhoneEngineInfo()->SetPhoneNumber( ptr );
+            }
+        else
+            {
+            iStateMachine.PhoneEngineInfo()->SetPhoneNumber( aNumber );
+            }
+        
+        // Make a emergency call
+        iStateMachine.PhoneEngineInfo()->SetServiceIdCommand( KServiceId1 );
+        iStateMachine.PhoneEngineInfo()->SetCallTypeCommand( 
+            EPECallTypeCSVoice );
+        iStateMachine.SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial );
+        }
+    else if ( 0 != aServiceId )
+        {
+        // Service id is known
+        DialVoIPL( aNumber, aServiceId );
+        }
+    else if ( EPhoneViewResponseSuccess == iViewCommandHandle.HandleCommandL( 
+            EPhoneViewServiceSelection, &params ) )
+        {
+        DialVoIPL( aNumber, params.ServiceId() );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneStateUtilsVoip::IsEmergencyNumber
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneStateUtilsVoip::IsEmergencyNumber( const TDesC& aNumber  ) const
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneStateUtilsVoip::IsEmergencyNumber" );
+    
+    TBool emergencyNumber( EFalse );
+    TInt error = iEmergencyCall->IsEmergencyPhoneNumber( aNumber, emergencyNumber );
+    
+    return ( KErrNone == error && emergencyNumber );  
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonetransferdialercontroller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,247 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneTransferDialerController class.
+*
+*/
+
+
+// INCLUDES
+#include <e32base.h>
+
+#include <akntoolbar.h>
+#include <AknsItemID.h>
+#include <StringLoader.h>
+#include "phoneresourceids.h"
+#include "phoneui.pan"
+#include "phonelogger.h"
+#include <data_caging_path_literals.hrh>
+#include "cphonetransferdialercontroller.h"
+#include "cphonemainresourceresolver.h"
+#include "phonerssvoip.h"
+#include "phoneappcommands.hrh"
+#include "phoneappvoipcommands.hrh"
+
+
+// CONSTANTS
+_LIT ( KPhoneMifFileName, "phoneui.mif" );
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//  
+CPhoneTransferDialerController::CPhoneTransferDialerController()
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::~CPhoneTransferDialerController()
+// Destructor
+// -----------------------------------------------------------
+//
+CPhoneTransferDialerController::~CPhoneTransferDialerController()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneTransferDialerController::~CPhoneTransferDialerController()");
+    delete iNumberEntryPromptText;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::NewL()
+// Constructor
+// -----------------------------------------------------------
+//
+CPhoneTransferDialerController* CPhoneTransferDialerController::NewL()
+    {
+    CPhoneTransferDialerController* self = new (ELeave) 
+        CPhoneTransferDialerController();
+  
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::Initialize
+// -----------------------------------------------------------
+//
+void CPhoneTransferDialerController::InitializeL( CAknToolbar& aToolbar )
+    {  
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneTransferDialerController::InitializeL()"); 
+    
+    if ( !iIsInitialized )
+        {    
+        __PHONELOG1( 
+                EAll, 
+                PhoneUIVoIPExtension, 
+                "Toolbar control count:=%d", 
+                aToolbar.CountComponentControls());
+        iToolbar = &aToolbar;
+        iIsInitialized = ETrue;
+        }
+   
+    iNumberEntryIsEmpty = ETrue;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::CbaResourceId
+// -----------------------------------------------------------
+//
+TInt CPhoneTransferDialerController::CbaResourceId() const
+    {
+    return EPhoneVoIPTransferDialerSoftkeys;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::MenuResourceId
+// -----------------------------------------------------------
+//
+TInt CPhoneTransferDialerController::MenuResourceId() const
+    {
+    if ( iNumberEntryIsEmpty )
+        {
+        return EPhoneVoIPTransferDialerNumberEntryEmptyMenubar;
+        }
+    else
+        {
+        return EPhoneVoIPTransferDialerNumberEntryNotEmptyMenubar;
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::NumberEntryPromptTextL
+// -----------------------------------------------------------
+//
+const TDesC& CPhoneTransferDialerController::NumberEntryPromptTextL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneTransferDialerController::NumberEntryPromptTextL()");
+    if ( !iNumberEntryPromptText )
+        {
+        iNumberEntryPromptText = StringLoader::LoadL( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPTransferAddress ) );
+        }  
+    
+    return *iNumberEntryPromptText;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::HandleNumberEntryIsEmpty
+// -----------------------------------------------------------
+//
+void CPhoneTransferDialerController::HandleNumberEntryIsEmpty( TBool aIsEmpty )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneTransferDialerController::HandleNumberEntryIsEmpty()");
+    __ASSERT_DEBUG( iToolbar, Panic( EPhoneCtrlInvariant ) );
+    iToolbar->SetItemDimmed( EPhoneCmdTransferDialerOk, aIsEmpty, EFalse );
+    iToolbar->SetItemDimmed( EPhoneCmdTransferDialerSearch, !aIsEmpty, EFalse );
+    iToolbar->SetItemDimmed( EPhoneDialerCmdClear, aIsEmpty, EFalse );
+    iNumberEntryIsEmpty = aIsEmpty;
+    }
+
+// -----------------------------------------------------------
+// CPhoneTransferDialerController::ShowButtons
+// -----------------------------------------------------------
+//
+void CPhoneTransferDialerController::ShowButtons( TBool aShow )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneTransferDialerController::ShowButtons()");
+    __ASSERT_DEBUG( iToolbar, Panic( EPhoneCtrlInvariant ) );
+    if ( aShow )
+        {
+        iToolbar->SetItemDimmed( EPhoneCmdTransferDialerOk, ETrue, EFalse ); 
+        iToolbar->SetItemDimmed( EPhoneCmdTransferDialerSearch, EFalse, EFalse ); 
+        iToolbar->SetItemDimmed( EPhoneDialerCmdClear, ETrue, EFalse ); 
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// PhoneTransferDialerController::CreateButtonLC
+// ---------------------------------------------------------------------------
+//
+CAknButton* CPhoneTransferDialerController::CreateButtonLC( 
+    TInt aNormalIconId,
+    TInt aNormalMaskId,
+    const TDesC& aTooltipText,
+    const TAknsItemID& aSkinIconId ) const
+    {   
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneTransferDialerController::CreateButtonLC()");
+    TFileName mifPath( KDriveZ );
+    mifPath.Append( KDC_APP_BITMAP_DIR );
+    mifPath.Append( KPhoneMifFileName );
+
+    CAknButton* button = CAknButton::NewLC( 
+        mifPath,
+        aNormalIconId,
+        aNormalMaskId,
+        -1, -1, // dimmed
+        -1, -1, // pressed
+        -1, -1, // hover
+        KNullDesC,
+        aTooltipText, // help
+        0, // flags
+        0, // state flags
+        aSkinIconId );
+                                                                 
+    button->SetFocusing( EFalse );
+    button->SetBackground( iToolbar );
+
+    return button;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneTransferDialerController::GetTooltipText
+//
+// Tooltip texts for toolbar buttons
+// ---------------------------------------------------------------------------
+//
+HBufC* CPhoneTransferDialerController::GetTooltipTextL( TInt aCommandId ) const
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneTransferDialerController::GetTooltipTextL()");
+    TInt resourceId = 0;
+    HBufC* tooltip = NULL;
+    switch( aCommandId )
+        {                            
+        case EPhoneCmdTransferDialerOk:
+            resourceId = R_VOIP_DIALER_TOOLTIP_ACCEPT;
+            break;    
+        case EPhoneCmdTransferDialerSearch:
+            resourceId = R_VOIP_DIALER_TOOLTIP_SEARCH;
+            break;                      
+       default:
+           tooltip = KNullDesC().Alloc();
+           break;
+       }
+           
+    if ( resourceId )
+        {
+        tooltip = StringLoader::LoadL( resourceId, CCoeEnv::Static() );
+        }
+    return tooltip;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneTransferDialerController::SkinId
+// ---------------------------------------------------------------------------
+//    
+TAknsItemID CPhoneTransferDialerController::SkinId( TInt /*aIconIndex*/ ) const
+    {
+    TAknsItemID skinId;
+    skinId = KAknsIIDNone; 
+    return skinId;  
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphoneuistatemachinefactoryvoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneUIStateMachineFactoryVoIP class.
+*
+*/
+
+
+// INCLUDES
+#include "cphoneuistatemachinefactoryvoip.h"
+#include "cphonestatemachinevoip.h"
+#include "cphoneresourceresolvervoip.h"
+#include "cphonevoiperrormessageshandler.h"
+#include "cphoneerrormessageshandler.h"
+#include "mphoneviewcommandhandle.h"
+
+// -----------------------------------------------------------
+// CPhoneUIStateMachineFactoryVoIP::CreatePhoneStateMachineL()
+// Create instance of CPhoneStateMachine class.
+// (other items were commented in a header).
+// -----------------------------------------------------------
+MPhoneStateMachine* CPhoneUIStateMachineFactoryVoIP::CreatePhoneStateMachineL(
+    MPhoneViewCommandHandle* aViewCommandHandle ) 
+    {
+    return CPhoneStateMachineVoIP::NewL( aViewCommandHandle );
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIStateMachineFactoryVoIP::CreatePhoneResourceResolverL
+// Create instance of CPhoneResourceResolverBase class.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneResourceResolverBase*
+    CPhoneUIStateMachineFactoryVoIP::CreatePhoneResourceResolverL()
+    {
+    return CPhoneResourceResolverVoIP::NewL();
+    }
+
+// ---------------------------------------------------------
+// CPhoneUIStateMachineFactoryVoIP::CreatePhoneErrorMessagesHandlerL
+// Create instance of CPhoneErrorMessagerHandler class.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+CPhoneErrorMessagesHandler*
+    CPhoneUIStateMachineFactoryVoIP::CreatePhoneErrorMessagesHandlerL( 
+        MPhoneViewCommandHandle* aViewCommandHandle,
+        MPhoneStateMachine* aPhoneStateMachine )
+    {
+    return CPhoneVoIPErrorMessagesHandler::NewL( aViewCommandHandle, 
+                                                 aPhoneStateMachine );
+    }
+
+// ---------------------------------------------------------
+// Polymorphic DLL entry point for ordinal 1.
+// ---------------------------------------------------------
+EXPORT_C CPhoneUIStateMachineFactoryBase* NewPhoneUIStateMachineFactoryL() 
+    {
+    return new( ELeave ) CPhoneUIStateMachineFactoryVoIP;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphoneunattendedtransfercmdhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,317 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneUnattendedTransferCmdHandler class.
+*
+*/
+
+#include <featmgr.h>
+#include <mpeengineinfo.h>
+#include "cphoneunattendedtransfercmdhandler.h"
+
+#include "cphonelogger.h"
+#include "mphonestatemachine.h"
+#include "cphonetransferdialercontroller.h"
+#include "phonerssvoip.h"
+#include "phoneappvoipcommands.hrh"
+#include "cphonestate.h"
+#include "cphonestateincall.h"
+#include "tphonecmdparamcustomdialer.h"
+#include "tphonecmdparaminteger.h"
+#include "tphonecmdparamstring.h"
+#include "tphonecmdparamquery.h"
+#include "tphonecmdparamglobalnote.h"
+#include "cphonemainresourceresolver.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::CPhoneUnattendedTransferCmdHandler
+// C++ constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneUnattendedTransferCmdHandler::CPhoneUnattendedTransferCmdHandler( 
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    : iStateMachine( aStateMachine ), iViewCommandHandle( aViewCommandHandle )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneUnattendedTransferCmdHandler::ConstructL()
+    {
+    iTransferDialerController = CPhoneTransferDialerController::NewL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::NewL
+// ---------------------------------------------------------------------------
+//
+CPhoneUnattendedTransferCmdHandler* CPhoneUnattendedTransferCmdHandler::NewL(
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneUnattendedTransferCmdHandler* self = 
+        CPhoneUnattendedTransferCmdHandler::NewLC( 
+            aStateMachine, aViewCommandHandle );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::NewLC
+// ---------------------------------------------------------------------------
+//
+CPhoneUnattendedTransferCmdHandler* CPhoneUnattendedTransferCmdHandler::NewLC(
+        MPhoneStateMachine& aStateMachine,
+        MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneUnattendedTransferCmdHandler* self = 
+        new( ELeave ) CPhoneUnattendedTransferCmdHandler( 
+            aStateMachine, aViewCommandHandle );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::~CPhoneUnattendedTransferCmdHandler
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneUnattendedTransferCmdHandler::~CPhoneUnattendedTransferCmdHandler()
+    {
+    delete iTransferDialerController;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::HandleCommandL
+// ---------------------------------------------------------------------------
+//
+void CPhoneUnattendedTransferCmdHandler::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EPhoneInCallCmdUnattendedTransfer:
+            ShowTransferDialerL();               
+            break;
+        
+        case EPhoneCmdTransferDialerOk:
+            DoUnattendedTransferL();     
+            break;
+        
+        case EPhoneCmdTransferDialerExit:
+            CloseTransferDialerL();
+            break;
+        
+        case EPhoneCmdTransferDialerSearch:
+            OpenSingleItemContactFetchL( 
+                EPhoneCmdTransferDialerContactFetch ); 
+            break;
+        
+        case EPhoneCmdTransferDialerContactFetch:
+            {
+            TBuf<KPhoneNumberEntryBufferSize> fetchContent;    
+            fetchContent = iViewCommandHandle.FetchContent();
+            
+            // Set transfer to address to the phoneengine
+            iStateMachine.PhoneEngineInfo()->
+                SetTransferTargetCommand( fetchContent );
+            iStateMachine.SendPhoneEngineMessage( 
+                MPEPhoneModel::EPEMessageDoUnattendedTransfer );
+            
+            ShowWaitingAcceptanceNoteL();
+            }
+            break;
+        
+        default:
+            __PHONELOG( EOnlyFatal, PhoneUIVoIPExtension, 
+                "CPhoneUnattendedTransferCmdHandler::HandleCommandL, DEFAULT" );    
+            ASSERT( EFalse );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::ShowTransferDialerL
+// ---------------------------------------------------------------------------
+//
+void CPhoneUnattendedTransferCmdHandler::ShowTransferDialerL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneUnattendedTransferCmdHandler::ShowTransferDialerL" )
+    
+    CPhoneState* phoneState = static_cast<CPhoneState*>( iStateMachine.State() );
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
+        {
+        TPhoneCmdParamCustomDialer customDialerParam;
+        customDialerParam.SetDialerController( iTransferDialerController );
+           
+        // Set dialer to transfer mode.
+        iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewShowCustomizedDialer,
+            &customDialerParam );
+        
+        // Open transfer dialer
+        phoneState->BeginTransEffectLC( ENumberEntryCreate );
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewCreateNumberEntry );
+        phoneState->EndTransEffect();
+        
+        // Update CBA to transfer dialer CBA
+        TPhoneCmdParamInteger resourceId;
+        resourceId.SetInteger( CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( iTransferDialerController->CbaResourceId() ) );
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewUpdateCba,
+            &resourceId );
+        }
+    else
+        {
+        HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
+        TPtr ptr( text->Des() );
+        // Pre-populate the query with the number entry contents, if it exists
+        if ( phoneState->IsNumberEntryUsedL() )
+            {
+            // get the number entry contents
+            TPhoneCmdParamString stringParam;
+            stringParam.SetString( &ptr );
+            iViewCommandHandle.ExecuteCommandL(
+                EPhoneViewGetLocalizedNumberFromEntry,
+                &stringParam );
+            }
+        
+        TPhoneCmdParamQuery queryDialogParam;
+        queryDialogParam.SetQueryType( EPhoneGenericTextQuery );
+        queryDialogParam.SetQueryResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPTransferAddressQuery ) );
+        
+        queryDialogParam.SetDefaultCba( CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPTransferAddressQueryEmptySoftkeys ) );
+        
+        queryDialogParam.SetContentCba( CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( EPhoneVoIPTransferAddressQueryNotEmptySoftkeys ) );
+        
+        queryDialogParam.SetDataText( &ptr );
+        queryDialogParam.SetSendKeyEnabled( ETrue );
+        
+        // Display dialog        
+        iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewShowQuery, &queryDialogParam );
+        
+        CleanupStack::PopAndDestroy( text );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::DoUnattendedTransferL
+// ---------------------------------------------------------------------------
+//
+void CPhoneUnattendedTransferCmdHandler::DoUnattendedTransferL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneUnattendedTransferCmdHandler::DoUnattendedTransferL" )
+    
+    // First get the transfer to address from dialog
+    TPhoneCmdParamString transferTarget;
+    HBufC* content = HBufC::NewLC( KPEPhoneNumberMaxLength );
+    TPtr ptr( content->Des() );
+    transferTarget.SetString( &ptr );
+    CPhoneState* phoneState = 
+        static_cast< CPhoneState* >( iStateMachine.State() );    
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) && 
+         phoneState->IsCustomizedDialerVisibleL() )
+        {
+        iViewCommandHandle.ExecuteCommand(
+            EPhoneViewGetNumberFromEntry,
+            &transferTarget );  
+        
+        phoneState->CloseCustomizedDialerL();
+        }
+    else
+        {
+        iViewCommandHandle.ExecuteCommandL( 
+            EPhoneViewGetTextQueryContent, &transferTarget );
+        }
+    
+    // Set transfer to address to the phoneengine
+    iStateMachine.PhoneEngineInfo()->SetTransferTargetCommand( ptr );
+    iStateMachine.SendPhoneEngineMessage( 
+        MPEPhoneModel::EPEMessageDoUnattendedTransfer );
+    
+    ShowWaitingAcceptanceNoteL();
+    CleanupStack::PopAndDestroy( content );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::CloseTransferDialerL
+// ---------------------------------------------------------------------------
+//
+void CPhoneUnattendedTransferCmdHandler::CloseTransferDialerL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneUnattendedTransferCmdHandler::CloseTransferDialerL" )
+    
+    CPhoneState* phoneState = 
+        static_cast< CPhoneState* >( iStateMachine.State() );
+    phoneState->CloseCustomizedDialerL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::OpenSingleItemContactFetchL
+// ---------------------------------------------------------------------------
+//
+void CPhoneUnattendedTransferCmdHandler::OpenSingleItemContactFetchL( 
+        TInt aFetchType )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+       "CPhoneUnattendedTransferCmdHandler::OpenSingleItemContactFetchL" )
+    
+    TPhoneCmdParamInteger integerParam;
+    integerParam.SetInteger( aFetchType );
+    
+    iViewCommandHandle.HandleCommandL( 
+        EPhoneViewOpenSingleItemFetchDialog, 
+        &integerParam );
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL
+// ---------------------------------------------------------------------------
+//
+void CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL" )
+    // Show "Waiting acceptance..." note
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    globalNoteParam.SetType( EAknGlobalWaitNote );
+    globalNoteParam.SetTone( EAvkonSIDNoSound );
+    globalNoteParam.SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY );
+    globalNoteParam.SetTextResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneVoIPWaitingAcceptanceNote ) );
+    iViewCommandHandle.ExecuteCommandL( 
+        EPhoneViewShowGlobalNote, &globalNoteParam );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonevcchandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,553 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneVccHandler class.
+*
+*/
+
+// INCLUDES
+#include "phoneresourceids.h"
+#include <StringLoader.h>
+#include <avkon.rsg>
+#include <mpeengineinfo.h>
+#include <eikmenup.h>
+#include <vccuipsproperty.h>
+#include "cphonevcchandler.h"
+#include "cphonetimer.h"
+#include "cphonestate.h"
+#include "cphonemainresourceresolver.h"
+#include "phonelogger.h"
+#include "cphonelogger.h"
+#include "mphoneviewcommandhandle.h"
+#include "mphonestatemachine.h"
+#include "phonerssvoip.h"
+#include "phoneappvoipcommands.hrh"
+#include "tphonecmdparamglobalnote.h"
+
+// For HO notification tone setting read
+#include <spproperty.h>
+#include <spsettings.h>
+#include <spentry.h>
+#include <spdefinitions.h>
+
+
+// CONSTANTS
+// 1,5 Second in microseconds
+const TInt KPhoneShowNoteTime = 1500000;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneVccHandler::CPhoneVccHandler( 
+    MPhoneStateMachine& aStateMachine,
+    MPhoneViewCommandHandle& aViewCommandHandle ) : 
+    iStateMachine( aStateMachine ),
+    iViewCommandHandle( aViewCommandHandle ), iVccHoReady( ETrue )
+    {
+    }
+
+// -----------------------------------------------------------
+// CPhoneVccHandler::~CPhoneStateIdleVoIP()
+// Destructor
+// -----------------------------------------------------------
+//
+CPhoneVccHandler::~CPhoneVccHandler()
+    {
+    delete iPropListener;
+    TRAPD( err, CancelHandoverNoteTimerL() );
+    if ( err != KErrNone )
+        {
+        __PHONELOG( EBasic, PhoneUIVoIPExtension,
+              "CPhoneVccHandler::~CPhoneVccHandler, leave" );
+        }
+     }
+
+// -----------------------------------------------------------
+// CPhoneVccHandler::ConstructL()
+// Constructor
+// -----------------------------------------------------------
+//
+void CPhoneVccHandler::ConstructL()
+    {
+    iPropListener = CVccUiPsPropertyListener::NewL( KVccPropKeyHoStatus );
+    iPropListener->AddObserverL( *this );
+    iPropListener->Start();
+    }
+
+// -----------------------------------------------------------
+// CPhoneVccHandler::NewL()
+// Constructor
+// -----------------------------------------------------------
+//
+CPhoneVccHandler* CPhoneVccHandler::NewL( 
+    MPhoneStateMachine& aStateMachine,
+    MPhoneViewCommandHandle& aViewCommandHandle )
+    {
+    CPhoneVccHandler* self = new (ELeave) CPhoneVccHandler( 
+        aStateMachine,
+        aViewCommandHandle );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneVccHandler::StartManualHandover
+// -----------------------------------------------------------
+//
+void CPhoneVccHandler::StartManualHandoverL( TInt aCommand )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+         "CPhoneVccHandler::StartManualHandoverL()" )
+         
+    HandoverInProgressNoteL( aCommand );
+
+    CVccUiPsProperty* prop = CVccUiPsProperty::NewL();
+    CleanupStack::PushL( prop );
+    
+    if ( aCommand == EPhoneVoIPWaitHandoverFromGsm )
+        {
+        prop->NotifySubscriberL( EVccManualStartCsToPsHoRequest );    
+        }
+    else
+        {
+        prop->NotifySubscriberL( EVccManualStartPsToCsHoRequest );    
+        }
+    
+    CleanupStack::PopAndDestroy(prop);
+    iVccHoReady = EFalse;
+    }
+
+// -----------------------------------------------------------
+// CPhoneVccHandler::AddHandoverMenuItem
+// -----------------------------------------------------------
+//
+void CPhoneVccHandler::AddHandoverMenuItemL( 
+        RArray<CTelMenuExtension::TCallInfo>& aArray,
+        TInt /*aResourceId*/,
+        CEikMenuPane& aMenuPane )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVccHandler::AddHandoverMenuItemL()");       
+    TInt activeCallId( KErrNotFound );
+        
+    for( TInt i = 0; i < aArray.Count(); i++ )
+        {
+        if( aArray[i].iCallState == CTelMenuExtension::EActive )
+            {
+            activeCallId = aArray[i].iCallId;
+            }
+        }
+        
+    if ( activeCallId != KErrNotFound )
+        {
+        // Vcc not available or Multicall not available
+        if ( iVccUnavailable || aArray.Count() > 1 && iNoHoIfMultiCall )
+            {
+            return;    
+            }
+
+        TPECallType callType = 
+            iStateMachine.PhoneEngineInfo()->CallType( activeCallId );
+            
+        CEikMenuPaneItem::SData data;
+        data.iCascadeId=0;
+        data.iFlags=0;
+        HBufC* string = NULL;
+        
+        if ( callType == EPECallTypeVoIP && iVccHoAllowedToGsm )
+            {
+            string = StringLoader::LoadLC( 
+              CPhoneMainResourceResolver::Instance()->
+              ResolveResourceID( EPhoneVoIPHandoverToGsmOption ) );
+
+            data.iCommandId = EPhoneCmdHandoverToGsm;
+                
+            }
+        else if ( callType == EPECallTypeCSVoice && iVccHoAllowedToWlan )
+            {  
+            string = StringLoader::LoadLC( 
+              CPhoneMainResourceResolver::Instance()->
+              ResolveResourceID( EPhoneVoIPHandoverToWlanOption ) );
+
+            data.iCommandId = EPhoneCmdHandoverToWlan;
+            }
+        else
+            {
+            // Not add menu item
+            return;    
+            }
+        
+        data.iText = *string;
+        // Try to find index of EPhoneInCallCmdGoToIdle command
+        // handover item will be placed above it if found
+             
+        TInt index( KErrNotFound );
+      
+        if ( aMenuPane.MenuItemExists( EPhoneInCallCmdGoToIdle, index) )
+            {
+            aMenuPane.InsertMenuItemL( data, index );  
+            }
+        else
+            {
+            aMenuPane.AddMenuItemL( data ); 
+            }
+       
+        CleanupStack::PopAndDestroy( string );
+        } 
+    }
+
+// ---------------------------------------------------------
+// CPhoneVccHandler::StartHandoverNoteTimerL
+// ---------------------------------------------------------
+//
+void CPhoneVccHandler::StartHandoverNoteTimerL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVccHandler::StartHandoverNoteTimerL()");
+
+    if( !iHandoverNoteTimer )
+        {
+        iHandoverNoteTimer = CPhoneTimer::NewL();          
+        }
+        
+    iHandoverNoteTimer->After( KPhoneShowNoteTime,
+        TCallBack( HandoverNoteTimerCallbackL, this ) );
+    }
+
+// ---------------------------------------------------------
+// CPhoneVccHandler::CancelHandoverNoteTimerL
+// ---------------------------------------------------------
+//
+void CPhoneVccHandler::CancelHandoverNoteTimerL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVccHandler::CancelHandoverNoteTimerL()");
+    if ( iHandoverNoteTimer ) 
+        {
+        delete iHandoverNoteTimer;
+        iHandoverNoteTimer = NULL;
+        }
+    RemoveHandoverNoteL();
+    } 
+
+// ---------------------------------------------------------
+// CPhoneVccHandler::HandoverNoteTimerCallbackL
+// ---------------------------------------------------------
+//
+TInt CPhoneVccHandler::HandoverNoteTimerCallbackL( TAny* aAny )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVccHandler::HandoverNoteTimerCallbackL()");
+    
+    reinterpret_cast<CPhoneVccHandler*>( aAny )->
+        CancelHandoverNoteTimerL();
+
+    return KErrNone;        
+    }
+
+// ---------------------------------------------------------
+// CPhoneVccHandler::RemoveHandoverNoteL
+// ---------------------------------------------------------
+//
+void CPhoneVccHandler::RemoveHandoverNoteL()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVccHandler::RemoveHandoverNoteL()");
+        
+    if ( iVccHoReady && !iHandoverNoteTimer )
+        {
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveGlobalNote );            
+        } 
+    }
+    
+// -----------------------------------------------------------
+// CPhoneVccHandler::HandoverInProgressNoteL
+// -----------------------------------------------------------
+//
+void CPhoneVccHandler::HandoverInProgressNoteL( TInt aCommand )
+    {
+     TPhoneCmdParamGlobalNote globalNoteParam;  
+          
+// Check notification tone user setting
+     TInt tone = GetHoNotifToneModeL();
+    
+      if ( tone == 1 )
+           {
+           globalNoteParam.SetTone( EAvkonSIDConfirmationTone );
+           }
+       else
+           {
+           globalNoteParam.SetTone( EAvkonSIDNoSound );
+           }
+
+     globalNoteParam.SetType( EAknGlobalWaitNote );
+     globalNoteParam.SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY );
+     globalNoteParam.SetTextResourceId( 
+                 CPhoneMainResourceResolver::Instance()->
+                 ResolveResourceID( aCommand ) );
+                                    
+     iViewCommandHandle.ExecuteCommandL( 
+                 EPhoneViewShowGlobalNote, &globalNoteParam ); 
+                 
+     StartHandoverNoteTimerL();   
+    }    
+ 
+// -----------------------------------------------------------------------------
+// CPhoneVccHandler::VccPropertyChangedL
+// Gets called when PS key is changed
+// -----------------------------------------------------------------------------
+//
+void CPhoneVccHandler::VccPropertyChangedL( const TUint aKeyId,
+                                    const TInt aValue ) 
+    {            
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVccHandler::VccPropertyChangedL() ");
+   
+    __PHONELOG1( EBasic, EPhoneControl,
+            "CPhoneVccHandler::VccPropertyChangedL - key: %d", aValue );
+
+    
+    if( aKeyId == KVccPropKeyHoStatus )
+        {
+        switch( aValue )
+            {               
+            case EVccCsToPsHoFailure:
+            case EVccPsToCsHoFailure:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO fail" );
+                // Remove handover note if handover is in progress
+                if( !iVccHoReady )
+                    {
+                    iVccHoReady = ETrue;
+                    CPhoneState* phoneState = 
+                               static_cast< CPhoneState* >( iStateMachine.State() ); 
+                    CancelHandoverNoteTimerL();
+                    phoneState->SendGlobalInfoNoteL( EPhoneVoIPHandoverFail );
+                    }
+                 }
+                break;
+            case EVccCsToPsHoSuccessful:
+            case EVccPsToCsHoSuccessful:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO Success" );   
+                iVccHoReady = ETrue;
+                RemoveHandoverNoteL();
+                }
+                break;
+            case EVccCsToPsHoStarted:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- CsToPsHoStarted" );
+                // Do not show if manually started since the wait note is 
+                // already visible
+                if ( iVccHoReady )
+                    {
+                    iVccHoReady = EFalse;
+                    HandoverInProgressNoteL( EPhoneVoIPWaitHandoverFromGsm );
+                    }
+                }
+                break;
+            case EVccPsToCsHoStarted: 
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- PsToCsHoStarted" );
+                // Do not show if manually started since the wait note is 
+                // already visible
+                if ( iVccHoReady )
+                    {
+                    iVccHoReady = EFalse;
+                    HandoverInProgressNoteL( EPhoneVoIPWaitHandoverFromWlan);
+                    }
+                }
+                break;
+            case EVccPsToCsHoInprogress: 
+            case EVccCsToPsHoInprogress:
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HoInprogress" );
+                // Do nothing
+                break;
+            case EVccHoUnavailable:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO Unavailable" );
+                iVccUnavailable = ETrue;
+                break;
+                }
+            case EVccHoStateIdle:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- HO IDLE" );
+                iVccHoAllowedToGsm = ETrue;
+                iVccHoAllowedToWlan = ETrue;
+                iNoHoIfMultiCall = EFalse;
+                iVccUnavailable = EFalse;
+                break;
+                }
+            case EVccCsToPsNotAllowed:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccCsToPsNotAllowed" );
+                iVccHoAllowedToWlan = EFalse;
+                iVccHoAllowedToGsm = ETrue;
+                iNoHoIfMultiCall = EFalse;
+                iVccUnavailable = EFalse;
+                break;
+                }
+            
+            case EVccPsToCsNotAllowed:
+               {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccPsToCsNotAllowed" );
+                iVccHoAllowedToGsm = EFalse;
+                iVccHoAllowedToWlan = ETrue;
+                iNoHoIfMultiCall = EFalse;
+                iVccUnavailable = EFalse;
+                break;
+                }
+                
+            case EVccHoStateIdleIfSingleCall:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccHoStateIdleIfSingleCall" );
+                iNoHoIfMultiCall = ETrue;
+                iVccHoAllowedToGsm = ETrue;
+                iVccHoAllowedToWlan = ETrue;
+                iVccUnavailable = EFalse;
+                break;
+                }
+            case EVccHoAllowedToCsIfSingleCall:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccHoAllowedToCsIfSingleCall" );
+                iNoHoIfMultiCall = ETrue;
+                iVccHoAllowedToWlan = EFalse;
+                iVccHoAllowedToGsm = ETrue;
+                iVccUnavailable = EFalse;
+                break;
+                }
+            case EVccHoAllowedToPsIfSingleCall:
+                {
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                    "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- EVccHoAllowedToPsIfSingleCall" );
+                iNoHoIfMultiCall = ETrue;
+                iVccHoAllowedToGsm = EFalse;
+                iVccHoAllowedToWlan = ETrue;
+                iVccUnavailable = EFalse;              
+                break;
+                }
+                    
+            default:
+
+                __PHONELOG( EBasic, PhoneUIVoIPExtension,
+                        "CPhoneVccHandler::VccPropertyChangedL VccPropertyChangedL -- default" );
+                break;
+            }       
+        }
+    }
+// ---------------------------------------------------------------------------
+// Gets HO notification tone setting value
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneVccHandler::GetHoNotifToneModeL()
+    {
+    // Find out VCC service id
+     CSPProperty* property = CSPProperty::NewLC();
+    
+    CSPSettings* settings = CSPSettings::NewLC();
+    
+    TInt vccServiceId = GetVccServiceIdL();
+    
+    //get the VCC enabled VoIP service id. 
+    TInt err = settings->FindPropertyL( 
+            vccServiceId, ESubPropertyVccDtVoipServiceId, *property ); 
+    
+    TInt voipId;
+    TInt error = property->GetValue( voipId );
+    
+    // Find and get the HO notification tone property
+    TInt tone = 0;
+    RBuf value;
+    value.CreateL( 1 );
+   
+    err = settings->FindPropertyL( 
+            voipId, ESubPropertyVccHoNotificationToneMode, *property ); 
+    
+    if ( !err )
+        {
+        HBufC* temp;
+        property->GetValue( value );
+        temp = value.AllocL();
+        TLex temp2( *temp );
+        temp2.Val( tone );
+        delete temp;
+        }
+    value.Close();
+    
+    // Set to default (0 = off) in case of invalid value
+    if ( !( tone == 0 || tone == 1 ))
+        {
+        tone = 0;
+        }
+  
+    CleanupStack::PopAndDestroy( settings );
+    CleanupStack::PopAndDestroy( property ); 
+
+       
+   
+    return tone;
+    }
+
+// ---------------------------------------------------------------------------
+// For finding out VCC service id.
+// ---------------------------------------------------------------------------
+//
+TInt CPhoneVccHandler::GetVccServiceIdL()
+    {
+    TInt vccServiceId( KErrNotFound );
+    //  Array of service provider IDs
+    // is defined as: typedef RArray<TServiceId> RIdArray
+    // in spdefinitions.h
+    RIdArray serviceIdArray;
+    CleanupClosePushL( serviceIdArray );
+
+    CSPSettings* settings = CSPSettings::NewLC();
+    settings->FindServiceIdsL( serviceIdArray );
+
+    TBool foundEntry( EFalse );
+     
+      for ( TInt i( 0 ); i < serviceIdArray.Count() && !foundEntry; i++ )
+           {
+            CSPProperty* property = CSPProperty::NewLC(); 
+             TInt error = settings->FindPropertyL( serviceIdArray[i], ESubPropertyVccVDI, *property ); 
+           
+              if( error == KErrNone )
+                  {
+                  vccServiceId =  serviceIdArray[i];
+                  foundEntry = ETrue;
+                   }
+                 CleanupStack::PopAndDestroy( property );
+           }
+      CleanupStack::PopAndDestroy( settings );
+      CleanupStack::PopAndDestroy( &serviceIdArray );  
+      
+      return vccServiceId;
+    }
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphoneviewcustomizationvoip.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: VoIP-specific view customization implementation.
+*
+*/
+
+#include <cconvergedserviceselector.h>
+#include "cphoneviewcustomizationvoip.h"
+#include "mphoneviewblockingdialogobserver.h"
+#include "phonestatedefinitionsvoip.h"
+#include "tphonecmdparamselector.h"
+#include "tphonecommandparam.h"
+#include "cphonelogger.h"
+#include "mphonecustomization.h"
+#include "phoneappvoipcommands.hrh"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPhoneViewCustomizationVoip::CPhoneViewCustomizationVoip
+// C++ constructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneViewCustomizationVoip::CPhoneViewCustomizationVoip(
+        MPhoneCustomization& aCustomization ) :
+    iPhoneCustomization( aCustomization )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewCustomizationVoip::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewCustomizationVoip::ConstructL()
+    {
+    iServiceSelector = CConvergedServiceSelector::NewL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewCustomizationVoip::NewL
+// ---------------------------------------------------------------------------
+//
+CPhoneViewCustomizationVoip* CPhoneViewCustomizationVoip::NewL(
+        MPhoneCustomization& aCustomization )
+    {
+    CPhoneViewCustomizationVoip* self = CPhoneViewCustomizationVoip::NewLC(
+        aCustomization );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewCustomizationVoip::NewLC
+// ---------------------------------------------------------------------------
+//
+CPhoneViewCustomizationVoip* CPhoneViewCustomizationVoip::NewLC(
+        MPhoneCustomization& aCustomization )
+    {
+    CPhoneViewCustomizationVoip* self = 
+        new( ELeave ) CPhoneViewCustomizationVoip( aCustomization );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewCustomizationVoip::~CPhoneViewCustomizationVoip
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhoneViewCustomizationVoip::~CPhoneViewCustomizationVoip()
+    {
+    delete iServiceSelector;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MPhoneViewCustomization.
+// CPhoneViewCustomizationVoip::HandleCommandL
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewCustomizationVoip::HandleCommandL(
+        MPhoneViewBlockingDialogObserver& aBlockingObserver,
+        TPhoneViewCommandId aCmdId,
+        TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneViewCustomizationVoip::HandleCommandL" );
+    
+    TBool isCommandHandled( EFalse );
+    
+    switch ( aCmdId )
+        {
+        case EPhoneViewServiceSelection:
+            {
+            isCommandHandled = SelectVoipService( 
+                aBlockingObserver, aCommandParam );
+            }
+            break;
+        case EPhoneViewOpenCallHandling:
+            {
+            // Close transfer dialer
+            iPhoneCustomization.HandleCommandL( 
+                EPhoneCmdTransferDialerExit );
+            isCommandHandled = ETrue;
+            }
+            break;
+        default:
+            break;
+        }
+    
+    return isCommandHandled;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MPhoneViewCustomization.
+// CPhoneViewCustomizationVoip::RemoveDialog
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewCustomizationVoip::RemoveDialog()
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneViewCustomizationVoip::RemoveDialog" );
+    
+    // Dismiss service selector queries, if necessary
+    iServiceSelector->CancelSelection();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhoneViewCustomizationVoip::SelectVoipService
+// ---------------------------------------------------------------------------
+//
+TBool CPhoneViewCustomizationVoip::SelectVoipService(
+        MPhoneViewBlockingDialogObserver& aBlockingObserver,
+        TPhoneCommandParam* aCommandParam )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneViewCustomizationVoip::SelectVoipService" );
+    
+    // Indicate that the service selection is blocking key events 
+    // from the Phone.
+    aBlockingObserver.SetBlockingDialogIsDisplayed( ETrue );
+    
+    CConvergedServiceSelector::TSsResult results;
+    TInt selectionResult = iServiceSelector->GetCallingServiceByCallType( 
+        results, CConvergedServiceSelector::ESsVoipCall, 0, EFalse );
+    
+    if ( KErrNone == selectionResult )
+        {
+        TPhoneCmdParamSelector* selectorContent =
+            static_cast<TPhoneCmdParamSelector*>( aCommandParam );
+        selectorContent->SetRegStatus( results.iServiceEnabled );
+        selectorContent->SetServiceId( results.iServiceId );
+        }
+    
+    // Reset the flag
+    aBlockingObserver.SetBlockingDialogIsDisplayed( EFalse );
+    
+    return ( KErrNone == selectionResult );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/cphonevoiperrormessageshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,529 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPhoneVoIPErrorMessagesHandler class.
+*
+*/
+
+// INCLUDES
+
+#include <ccpdefs.h>
+#include <mpeengineinfo.h>
+#include <StringLoader.h>
+#include <spsettings.h>
+#include <spentry.h>
+#include <telephonydomainpskeys.h>
+#include <UikonInternalPSKeys.h>
+#include <aknnotedialog.h>
+#include "cphonevoiperrormessageshandler.h"
+#include "cphonemainerrormessageshandler.h"
+#include "cphoneerrormessageshandler.h"
+#include "cphonestatehandle.h"
+#include "phonerssvoip.h"
+#include "phonelogger.h"
+#include "tphonecmdparamglobalnote.h"
+#include "tphonecmdparaminteger.h"
+#include "cphonemainresourceresolver.h"
+#include "phoneui.pan"
+#include "cphonepubsubproxy.h"
+#include "tphonecmdparamboolean.h"
+#include "cphonestatemachinevoip.h"
+#include "cphonecustomizationvoip.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPhoneVoIPErrorMessagesHandler::CPhoneVoIPErrorMessagesHandler(
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneStateMachine* aPhoneStateMachine ) :
+    CPhoneErrorMessagesHandler( aViewCommandHandle, aPhoneStateMachine )
+    {
+    static_cast<CPhoneStateMachineVoIP*>( iStateMachine )->
+        SetVoipErrorMessageHandler( *this );
+    }
+
+// -----------------------------------------------------------
+// CPhoneErrorMessagesHandler::~CPhoneErrorMessagesHandler()
+// Destructor
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+CPhoneVoIPErrorMessagesHandler::~CPhoneVoIPErrorMessagesHandler()
+    {
+     
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::ConstructL()
+    {
+    // Register error handler
+    CPhoneMainErrorMessagesHandler::Instance()->
+        RegisterErrorMessagesHandler( this );
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::NewL()
+// Constructor
+// -----------------------------------------------------------
+//
+CPhoneVoIPErrorMessagesHandler* CPhoneVoIPErrorMessagesHandler::NewL(
+    MPhoneViewCommandHandle* aViewCommandHandle,
+    MPhoneStateMachine* aPhoneStateMachine )
+    {
+    CPhoneVoIPErrorMessagesHandler* self =
+        new( ELeave ) CPhoneVoIPErrorMessagesHandler(
+            aViewCommandHandle,
+            aPhoneStateMachine );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::ShowErrorSpecificNoteL
+// -----------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::ShowErrorSpecificNoteL( 
+    const TPEErrorInfo& aErrorInfo )
+    {
+    __LOGMETHODSTARTEND(PhoneUIVoIPExtension, "CPhoneVoipErrorMessagesHandler::ShowErrorSpecificNoteL()");
+
+    __PHONELOG1( EBasic, PhoneUIVoIPExtension,
+            "CPhoneVoIPErrorMessagesHandler::ShowErrorSpecificNoteL - aErrorInfo.iErrorCode =%d ",
+            aErrorInfo.iErrorCode);
+
+    if ( aErrorInfo.iErrorType == EPECcp && IsVoIPCall( aErrorInfo.iCallId ) )
+        {
+        switch( aErrorInfo.iErrorCode )
+            {
+            case ECCPErrorNotAcceptable:
+            case ECCPErrorCCServiceNotImplemented:
+                SendGlobalErrorNoteL( EPhoneVoIPNoAudioSupport );
+                break;
+
+            case ECCPLocalResumeFail:
+                if ( HasSwapFailed() )
+                    {
+                    SendGlobalErrorNoteL( EPhoneVoIPSwapFail );
+                    }
+                else
+                    {
+                    HandleHoldErrorNotesL( aErrorInfo.iCallId, EFalse );
+                    }
+                break;
+            case ECCPLocalHoldFail:
+                if ( HasSwapFailed() )
+                    {
+                    SendGlobalErrorNoteL( EPhoneVoIPSwapFail );
+                    }
+                else
+                    {
+                    HandleHoldErrorNotesL( aErrorInfo.iCallId, ETrue );
+                    }
+                break;
+
+            case ECCPServerFailure:
+            case ECCPErrorNetworkBusy:
+                SendGlobalErrorNoteL( EPhoneVoIPNoService );
+                break;
+
+            case ECCPErrorNotReached:
+                SendGlobalErrorNoteL( EPhoneVoIPNotFound );
+                break;
+            case ECCPErrorCCIncompatibleDestination:
+                SendGlobalErrorNoteL( EPhoneVoIPAddressNotInUse );
+                break;
+
+            case ECCPErrorTimedOut:
+            case ECCPErrorCCNoRouteToDestination:
+                SendGlobalErrorNoteL( EPhoneVoIPRequestTimeOut );
+                break;
+
+            case KErrArgument:
+            case ECCPErrorInvalidPhoneNumber:
+            case ECCPErrorInvalidURI:
+                SendGlobalErrorNoteL( EPhoneVoIPInvalidRecipientAddress );
+                break;
+
+            case ECCPErrorBusy:
+            case ECCPErrorCCCallRejected:
+                SendGlobalErrorNoteL( EPhoneVoIPNumberBusy );
+                break;
+
+            case ECCPErrorMovedPermanently:
+                SendGlobalErrorNoteL( EPhoneVoIPAddressNotInUse );
+                break;
+
+            case ECCPErrorCCUserNotResponding:
+            case ECCPErrorNotResponding:
+
+                SendGlobalErrorNoteL( EPhoneVoIPNoAnswer );
+                break;
+  
+            case ECCPGlobalFailure:
+                SendGlobalErrorNoteL( EPhoneVoIPErrorInConnection );
+                break;
+
+            case ECCPSecureCallFailed:    
+            case ECCPErrorUnacceptableChannel:
+                SendGlobalErrorNoteL( EPhoneSSNotificationTextVoipSipsFailed );
+                break;
+
+            case ECCPErrorNetworkOutOfOrder:
+            case ECCPErrorMedia:
+                SendGlobalErrorNoteL( EPhoneVoIPNetworkError );
+                break;
+                 
+            case ECCPTransferFailed:
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
+                SendGlobalErrorNoteL( EPhoneVoIPTransferFail );
+                break;
+
+            case ECCPErrorNoService:
+                {
+                TInt serviceID = iStateMachine->PhoneEngineInfo()->ServiceId(
+                    aErrorInfo.iCallId );
+                ShowErrorNoteWithServiceNameL( EPhoneVoIPServiceUnavailable,
+                    serviceID );
+                }
+                break;
+            default:
+                CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL( aErrorInfo );
+                break;
+            }
+        }
+    else if ( aErrorInfo.iErrorType == EPECch )
+        {
+        ShowRegistrationErrorNotesL( aErrorInfo.iErrorCode );   
+        }
+    else
+        {
+        CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL( aErrorInfo );
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoipErrorMessagesHandler::IsVoIPCall
+// -----------------------------------------------------------
+//
+TBool CPhoneVoIPErrorMessagesHandler::IsVoIPCall( const TInt aCallId ) const
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneVoIPErrorMessagesHandler::IsVoipCall() ");
+
+    if( aCallId == KErrNotFound )
+        {
+        // Illegal call id, check call type command
+        return ( iStateMachine->PhoneEngineInfo()->CallTypeCommand()
+            == EPECallTypeVoIP );
+        }
+
+    return ( iStateMachine->PhoneEngineInfo()
+        ->CallType( aCallId )== EPECallTypeVoIP );
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoipErrorMessagesHandler::HandleHoldErrorNotesL
+// -----------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::HandleHoldErrorNotesL( 
+    const TInt aCallId, TBool aHold )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, "CPhoneVoIPErrorMessagesHandler::HandleHoldNoteL()");
+    
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    HBufC* text = HBufC::NewLC( KPhoneContactNameMaxLength );
+    TPtr tmp = text->Des();
+
+    // Should add name( or RemotePartyName or CompanyName) to Note, if someone found
+    GetRemoteInfoDataL( aCallId, tmp );
+    
+    if ( text->Length() )
+        {
+        // RemotePartyName, CompanyName or RemoteName found
+        // Resource text which will use found text will be loaded later
+        TInt resource( EPhoneVoIPResumeFail );
+        if ( aHold )
+            {
+            resource = EPhoneVoIPHoldFail;    
+            }
+        
+        // qtn_voip_resume_failed / qtn_voip_hold_failed
+        globalNoteParam.SetTextResourceId(
+            CPhoneMainResourceResolver::Instance()->
+                ResolveResourceID( resource ) );
+        }
+    else
+        {
+        // Decides note with call id
+        // Resource is loaded here
+        TInt resource = EPhoneVoIPResumeNumberFail;
+        if ( aHold )
+            {
+            resource = EPhoneVoIPHoldNumberFail;    
+            }
+        
+        // qtn_voip_resume_number_failed / qtn_voip_hold_number_failed
+        const TInt tmpResourceId = CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( resource );
+        
+        TInt callId = aCallId;
+        callId++; // Real call id index starts from 0, increase value by one
+        CleanupStack::PopAndDestroy( text ); // Delete reserver buffer
+        text = StringLoader::LoadLC( 
+                tmpResourceId, 
+                callId, 
+                CCoeEnv::Static() ); // Load new buffer
+
+        }
+     
+    globalNoteParam.SetText( *text );
+    globalNoteParam.SetType( EAknGlobalConfirmationNote );
+    globalNoteParam.SetTone( EAvkonSIDInformationTone );
+            
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+    
+    CleanupStack::PopAndDestroy( text );
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL
+// -----------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL( 
+    TInt aCallId,
+    TDes& aData ) const 
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+            "CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL()" );
+    __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
+            Panic( EPhoneCtrlInvariant ) );
+
+    // Note next if-statements are in priority order so be careful if you change order
+    // or add new if-statements.
+    if ( iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() )
+        {
+        __PHONELOG1( EBasic, PhoneUIVoIPExtension, 
+            "CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - remote name = %S", 
+            &iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ) );
+
+        if ( iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length()
+             < KPhoneContactNameMaxLength )
+            {
+            // Display the contact name if it is available
+            aData.Copy( iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ) );
+            }
+        }
+    else if ( iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() )
+         {
+         __PHONELOG1( EBasic, PhoneUIVoIPExtension, 
+             "CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - remote company name = %S", 
+             &iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
+         
+         if ( iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length()
+              < KPhoneContactNameMaxLength )
+             {            
+             // Display the company name if it is available
+             aData.Copy( iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ) );
+             }
+         }
+    else if( iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ).Length() )
+        {
+        __PHONELOG1( EBasic, PhoneUIVoIPExtension, 
+            "CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - remote party name = %S", 
+            &iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ) );
+        
+        if ( iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ).Length()
+             < KPhoneContactNameMaxLength )
+            {            
+            // Display the remote party name if it is available
+            aData.Copy( iStateMachine->PhoneEngineInfo()->RemotePartyName( aCallId ) );
+            }
+        }
+    else
+        {
+        __PHONELOG( EBasic, PhoneUIVoIPExtension, 
+            "CPhoneVoIPErrorMessagesHandler::GetRemoteInfoDataL - not found" );
+        aData.Zero();
+        }
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL
+// -----------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL( 
+    TInt /*aErrorCode*/ )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+              "CPhoneVoIPErrorMessagesHandler::ShowRegistrationErrorNotesL()" );
+    // Dismiss service enabling wait note
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalWaitNote );    
+    }
+
+// ---------------------------------------------------------
+//  CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteWithTextL
+// ---------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteWithTextL( 
+    TInt aResourceId,
+    RBuf& aText )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVoIPErrorMessagesHandler::SendGlobalErrorNoteL()" );
+    __ASSERT_DEBUG( aResourceId, Panic( EPhoneCtrlParameterNotInitialized ) );
+
+    if ( CPhonePubSubProxy::Instance()->Value( 
+            KPSUidUikon, KUikGlobalNotesAllowed ) == 1 )
+        {
+        // Re-enable global notes
+        TPhoneCmdParamBoolean globalNotifierParam;
+        globalNotifierParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL( 
+             EPhoneViewSetGlobalNotifiersDisabled,
+            &globalNotifierParam );
+            
+        TPhoneCmdParamGlobalNote globalNoteParam;
+        globalNoteParam.SetType( EAknGlobalErrorNote );
+        globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
+            ResolveResourceID( aResourceId ) );
+        globalNoteParam.SetText( aText );
+        globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
+
+        iViewCommandHandle->ExecuteCommandL(  
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+        } 
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::GetServiceProviderNameL
+// -----------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::GetServiceProviderNameL( 
+    RBuf& aServiceName, 
+    TUint32 aServiceId )
+    { 
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+                 "CPhoneVoIPErrorMessagesHandler::GetServiceProviderNameL" )
+    CSPEntry* serviceEntry = CSPEntry::NewLC();
+    
+    CSPSettings* serviceProviderSettings = CSPSettings::NewLC();
+    
+    User::LeaveIfError(
+        serviceProviderSettings->FindEntryL( aServiceId, *serviceEntry ) );
+    
+    User::LeaveIfError(
+        aServiceName.Create( serviceEntry->GetServiceName() ) );
+      
+    CleanupStack::PopAndDestroy( serviceProviderSettings );
+    CleanupStack::PopAndDestroy( serviceEntry );
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::ShowErrorNoteContainingServiceNameL
+// -----------------------------------------------------------
+//
+void CPhoneVoIPErrorMessagesHandler::ShowErrorNoteWithServiceNameL( 
+    TInt aResourceId, 
+    TUint32 aServiceId )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneVoIPErrorMessagesHandler::ShowErrorNoteWithServiceNameL" )
+    RBuf serviceName;
+    CleanupClosePushL( serviceName );
+    GetServiceProviderNameL( serviceName, aServiceId );
+    SendGlobalErrorNoteWithTextL( aResourceId, serviceName );
+    CleanupStack::PopAndDestroy( &serviceName );
+    }
+
+// -----------------------------------------------------------
+// CPhoneVoIPErrorMessagesHandler::HasSwapFailed
+// -----------------------------------------------------------
+//
+TBool CPhoneVoIPErrorMessagesHandler::HasSwapFailed() const
+    {
+    TPEState callState( EPEStateUnknown );
+    TPECallType callType( EPECallTypeUninitialized );
+    TPEState confCallState( EPEStateUnknown );
+    
+    TInt connectedCalls( 0 );
+    TInt heldCalls( 0 );
+    TInt voipCalls( 0 );
+    TBool ret( EFalse );
+    
+    for ( TInt i=0; i < KPEMaximumNumberOfVoiceCalls; i++ )
+        {
+        callState = iStateMachine->PhoneEngineInfo()->CallState( i );
+        callType = iStateMachine->PhoneEngineInfo()->CallType( i );
+        
+        if ( EPEStateConnected == callState )
+            {
+            connectedCalls++;
+            
+            if ( EPECallTypeVoIP == callType )
+                {
+                voipCalls++;
+                }
+            }
+        else if ( EPEStateHeld == callState )
+            {
+            heldCalls++;
+            
+            if ( EPECallTypeVoIP == callType )
+                {
+                voipCalls++;
+                }
+            }
+        }
+    
+    confCallState = iStateMachine->PhoneEngineInfo()->CallState( KPEConferenceCallID );
+
+    // At least one of the calls is VoIP call (conference or single)
+    if ( voipCalls )
+        {
+        if ( EPEStateConferenceIdle == confCallState )
+            {
+            // Look for connected/hold and hold/hold combinations
+            if ( ( 1 == connectedCalls && 1 == heldCalls ) ||
+                   2 == heldCalls )
+                {
+                ret = ETrue;
+                }
+            }
+        /* Check scenario that the other call is conference
+         * 1) Putting VoIP call on hold fails, as a result there is a single connected 
+         *    call and conference is on hold
+         * 2) Resuming VoIP call fails, all calls are on hold (because conference is 
+         *    first put on hold successfully)
+         */
+        else if ( ( 1 == connectedCalls && EPEStateHeldConference == confCallState ) ||
+                 ( 0 == connectedCalls && EPEStateHeldConference == confCallState ) )
+            {
+            ret = ETrue;
+            }
+        }
+
+    __PHONELOG1( EBasic, PhoneUIVoIPExtension, "CPhoneVoIPErrorMessagesHandler::HasSwapFailed() returned %D", ret );
+    
+    return ret;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/tphonecmdparamselector.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhoneCmdParamSelector class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonecmdparamselector.h"   
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhoneCmdParamSelector::TPhoneCmdParamSelector
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPhoneCmdParamSelector::TPhoneCmdParamSelector() :
+    TPhoneCommandParam(),
+    iServiceId( NULL ),
+    iCallType( EPhoneCallTypeNotFound ),
+    iEnabled( EFalse )
+    {
+    iParamId = (TPhoneCommandParam::TPhoneParamId)
+                    TPhoneCommandParamVoip::EPhoneParamIdSelector;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSelector::SetPhoneNumber
+// Sets the service id.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSelector::SetServiceId( const TUint aServiceId )
+    {
+    iServiceId = aServiceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSelector::ServiceId
+// Returns the service id.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TUint TPhoneCmdParamSelector::ServiceId()
+    {
+    return iServiceId;
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSelector::SetCallType
+// Sets the call type.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSelector::SetCallType( TPhoneSsCallType aCallType )
+   {
+   iCallType = aCallType;   
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSelector::NumberType
+// Returns the call type.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TPhoneSsCallType TPhoneCmdParamSelector::CallType()
+   {
+   return iCallType;
+   }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSelector::SetLocation
+// Sets the registration status.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C void TPhoneCmdParamSelector::SetRegStatus( TBool aEnabled )
+    {
+    iEnabled = aEnabled;   
+    }
+
+// ---------------------------------------------------------
+// TPhoneCmdParamSelector::RegStatus
+// Returns the registration status.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+EXPORT_C TBool TPhoneCmdParamSelector::RegStatus()
+    {
+    return iEnabled;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/src/tphonetouchpanewrapper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of TPhTouchPaneWrapper class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "tphonetouchpanewrapper.h"   
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// TPhTouchPaneWrapper::TPhTouchPaneWrapper
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TPhTouchPaneWrapper::TPhTouchPaneWrapper()
+    {
+    }
+
+// ---------------------------------------------------------
+// TPhTouchPaneWrapper::TPhTouchPaneWrapper
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt TPhTouchPaneWrapper::NumberOfButtonsInPane() const
+    {
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------
+// TPhTouchPaneWrapper::ButtonCommandId
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+TInt TPhTouchPaneWrapper::ButtonCommandId( 
+        TInt /*aButtonIndex*/ ) const
+    {
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------
+// TPhTouchPaneWrapper::SetButtonDimmed
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void TPhTouchPaneWrapper::SetButtonDimmed( TInt /*aCommand*/, TBool /*aDimmed*/ )
+   {
+   }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuivoipextension/srcdata/phoneuivoip.rss	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1385 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     This file contains all the resources for the module.
+*     All definitions for components used in phone application.
+*     Positions, sizes, texts, etc.
+*
+*/
+
+
+NAME    PHVO
+
+#include    <eikon.rh>
+#include    <avkon.loc>
+#include    <avkon.hrh>
+#include    <avkon.rsg>
+#include    <avkon.rh>
+
+#include    "phoneui.rh"
+#include    "phoneui.hrh"
+#include    <phoneappvoipcommands.hrh>
+
+// VoIP loc file
+#include    <voip.loc>
+#include    <callui.loc>
+
+// GSM loc files
+#include    <phone.loc>
+#include    <callheadertexts.loc>
+#include    <incallmenuandsoftkeys.loc>
+#include    <callterminationnote.loc>
+#include    <incalloperations.loc>
+#include    <numberentry.loc>
+#include    <multicallhandling.loc>
+#include    <mobileoriginatedcalls.loc>
+#include    <dtmfsignalling.loc>
+#include    <dialer.loc>
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+RESOURCE TBUF
+    {
+    buf = "";
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_menubar_voip
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_menubar_voip
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu_voip;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_menubar_voip_with_service_number
+//    Default menubar shown when number acquistion view is active
+//    and service number is enterer to number acquistion.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_menubar_voip_with_service_number
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_options_menu_voip_with_service_number;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_menu_voip
+//    Number Acquisition view options menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_options_menu_voip
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            cascade = r_phoneui_numberacq_options_call_menu_voip;
+            txt = text_number_call;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendMessage;
+            txt = qtn_nren_send_message;
+            },
+
+        MENU_ITEM 
+            {
+            command = EPhoneDialerCmdTouchInput; 
+            txt = qtn_dialer_touch_input_options;
+            },  
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;       
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu_voip;           
+            txt = qtn_phob_opt_save_to_pb;
+            flags = EEikMenuItemSeparatorAfter;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_menu_voip_with_service_number
+//    Number Acquisition view options menu pane when service number
+//    is used.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_options_menu_voip_with_service_number
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendMessage;
+            txt = qtn_nren_send_message;
+            },
+
+        MENU_ITEM 
+            {
+            command = EPhoneDialerCmdTouchInput; 
+            txt = qtn_dialer_touch_input_options;
+            },  
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;          
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu_voip;         
+            txt = qtn_phob_opt_save_to_pb;
+            flags = EEikMenuItemSeparatorAfter;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_menu_item_alpha_mode
+//    Number acquisition menu option item text "Alpha mode".
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_numberacq_options_menu_item_alpha_mode
+    {
+    buf = qtn_editing_shift_menu_alpha;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_menu_item_numeric_mode
+//    Number acquisition menu option item text "Numeric mode".
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_numberacq_options_menu_item_numeric_mode
+    {
+    buf = qtn_editing_shift_menu_numbers;
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_call_menu_voip
+//    Number Acquisition view options call menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_options_call_menu_voip
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            txt = qtn_call_sub_voice;
+            },
+        MENU_ITEM
+            {
+            command =EPhoneNumberAcqCmdVideoCall;
+            txt = qtn_call_out_going_video_call;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdInternetCall;
+            txt =  qtn_voip_call_type_internet;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_internetcall_cba
+//    It contains softkey definitions for number acquisition
+//    if videocall_menu_visibilite feature ON.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_numberacq_internetcall_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneNumberAcqCmdInternetCall;
+            txt = qtn_voip_call_type_internet;
+            },
+
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyContextOptions;
+            txt = text_softkey_options;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_menubar_voip_with_service_number
+//    Default menubar shown when number acquistion view is active
+//    and service number is entered.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_ok_menubar_voip_with_service_number
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_ok_options_menu_voip_with_service_number;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_options_menu_voip_with_service_number
+//    Number Acquisition view ok_options menu pane when service
+//    number is entered.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_ok_options_menu_voip_with_service_number
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSendCommand;
+            txt = text_nren_send_com;
+            },
+
+        MENU_ITEM 
+             {
+             command = EPhoneDialerCmdTouchInput; 
+             txt = qtn_dialer_touch_input_options;
+             },  
+
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;           
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu_voip;          
+            txt = qtn_phob_opt_save_to_pb;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_menubar_voip
+//    Default menubar shown when number acquistion view is active.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneui_numberacq_ok_menubar_voip
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneui_numberacq_ok_options_menu_voip;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//
+//    r_phoneui_numberacq_ok_options_menu_voip
+//    Number Acquisition view ok_options menu pane.
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_ok_options_menu_voip
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdCall;
+            cascade = r_phoneui_numberacq_options_call_menu_voip;
+            txt = text_number_call;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToContacts;          
+            cascade = r_phoneui_numberacq_options_add_to_contacts_menu_voip;          
+            txt = qtn_phob_opt_save_to_pb;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_add_to_contacts_menu_voip
+//    Number Acquisition view options add to contacts menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_numberacq_options_add_to_contacts_menu_voip
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdSave;
+            txt =  qtn_phob_opt_save_to_pb_new;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneNumberAcqCmdAddToName;
+            txt =  qtn_phob_opt_save_to_pb_old;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//
+//    r_phoneui_voip_private_address
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF64 r_phoneui_voip_private_address
+    {
+    buf = qtn_voip_private_address;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_voip_error_note_authentication_failed
+//    Displayed when authetication fails.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_voip_error_note_authentication_failed
+    {
+    buf = qtn_voip_error_note_authentication_failed;
+    }
+// -----------------------------------------------------------------------------
+//    r_voip_defective_settings_note
+//    Displayed when registering is failed due to incomplete or wrong settings.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_voip_defective_settings_note
+    {
+    buf = qtn_voip_defective_settings_note;
+    }
+// -----------------------------------------------------------------------------
+//    r_voip_no_connections_available_note
+//    Displayed when there the terminal is not within network coverage
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_voip_no_connections_available_note
+    {
+    buf = qtn_voip_no_connections_available_note;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_voip_no_connections_defined
+//    Displayed if there are no access points in service’s destination.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_voip_no_connections_defined
+    {
+    buf = qtn_voip_no_connections_defined;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_voip_network_error_note
+//    Displayed  when recived following error codes from SIP
+//      SIP: 500 (Internal Server Error)
+//      SIP: 501 (Not Implemented)
+//      SIP: 502 (Bad Gateway)
+//      SIP: 503 (Service Unavailable)
+//      SIP: 504 (Server Time-out)
+//      SIP: 505 (Version not supported)
+//      SIP: 513 (Message Too Large)
+//      SIP: 580 (Precondition Failure)
+//      SIP: 482 (Loop Detected)
+//      SIP: 483 (Too Many Hops)
+//      SIP: 5xx
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_voip_network_error_note
+    {
+    buf = qtn_voip_network_error_note;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_voip_error_in_connection
+//    Displayed when the service is in enabled and registered state. The user
+//    tries to call but access point does not support calls.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_voip_error_in_connection
+    {
+    buf = qtn_voip_error_in_connection;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_no_service_available_info
+//    Displayed when recived following error codes from SIP
+//      SIP: 401 (Unauthorized)
+//      SIP: 402 (Payment Required)
+//      SIP: 403 (Forbidden)
+//      SIP: 407 (Proxy Authentication Required)
+//      SIP: 423 (Interval Too Brief)
+//      SIP: 489 (Bad Event)
+//      SIP: 494 (Security Agreement Required)
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_no_service_available_info
+    {
+    buf = qtn_no_service_available_info;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_no_audio_support
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_no_audio_support
+    {
+    buf = qtn_voip_recipient_restricts_call;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_no_voip_service_error
+//    It is error note text when voip is not possible
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_no_voip_service_error
+    {
+    buf = qtn_voip_no_voip_service_info;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_address_not_in_use
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_address_not_in_use
+    {
+    buf = qtn_voip_address_not_in_use;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_no_service_available_info
+//    Displayed when recived following error codes from SIP
+//      SIP: 401 (Unauthorized)
+//      SIP: 402 (Payment Required)
+//      SIP: 403 (Forbidden)
+//      SIP: 407 (Proxy Authentication Required)
+//      SIP: 423 (Interval Too Brief)
+//      SIP: 489 (Bad Event)
+//      SIP: 494 (Security Agreement Required)
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_no_service_available_info
+    {
+    buf = qtn_no_service_available_info;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_request_time_out
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_request_time_out
+    {
+    buf = qtn_voip_request_time_out;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_invalid_recipient_address
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_invalid_recipient_address
+    {
+    buf = qtn_voip_err_invalid_address;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_number_busy
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_number_busy
+    {
+    buf = qtn_voip_address_busy;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_not_found
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_not_found
+    {
+    buf = qtn_voip_not_found;
+    }
+
+
+// -----------------------------------------------------------------------------
+//    r_phone_voip_no_answer
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_no_answer
+    {
+    buf = qtn_voip_no_answer;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_phone_ss_notification_text_voip_sips_failed
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF  r_phone_ss_notification_text_voip_sips_failed
+    {
+    buf = qtn_voip_rel2_sips_failed;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_voip_network_error_note
+//    Displayed  when recived following error codes from SIP
+//      SIP: 500 (Internal Server Error)
+//      SIP: 501 (Not Implemented)
+//      SIP: 502 (Bad Gateway)
+//      SIP: 503 (Service Unavailable)
+//      SIP: 504 (Server Time-out)
+//      SIP: 505 (Version not supported)
+//      SIP: 513 (Message Too Large)
+//      SIP: 580 (Precondition Failure)
+//      SIP: 482 (Loop Detected)
+//      SIP: 483 (Too Many Hops)
+//      SIP: 5xx
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_network_error_note
+    {
+    buf = qtn_voip_network_error_note;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_hold_failed string "Putting %U on hold failed"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_hold_failed
+    {
+    buf = qtn_voip_hold_failed;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_hold_number_failed "Putting Call %N on hold failed"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_hold_number_failed
+    {
+    buf = qtn_voip_hold_number_failed;
+    } 
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_resume_failed "Resuming %U failed"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_resume_failed
+    {
+    buf = qtn_voip_resume_failed;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_resume_number_failed "Resuming Call %N failed"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_resume_number_failed
+    {
+    buf = qtn_voip_resume_number_failed;
+    } 
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_swap_failed "Swapping of calls failed"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_swap_failed
+    {
+    buf = qtn_voip_swap_failed;
+    } 
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_conference_hold_failed "Putting conference call on hold failed"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_conference_hold_failed
+    {
+    buf = qtn_voip_conference_hold_failed;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_conference_resume_failed "Resuming conference call failed"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_conference_resume_failed
+    {
+    buf = qtn_voip_conference_resume_failed;
+    }
+    
+// -----------------------------------------------------------------------------
+//
+//     r_voip_transfer_failed-note  "Transfer request rejected"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_transfer_failed_note
+    {
+    buf = qtn_voip_info_transfer_req_rejected;
+    }
+// -----------------------------------------------------------------------------
+//
+//     r_voip_transfer_waiting_acceptence-note  "Transfer waiting acceptanse"  
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_transfer_waiting_acceptence
+    {
+    buf = qtn_voip_wait_waiting_accept;
+    }
+// -----------------------------------------------------------------------------
+//
+//     r_voip_call_type_internet  "Internet call"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_call_type_internet
+    {
+    buf = qtn_voip_call_type_internet;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_unattended_transfer_option "Unattended transfer"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_unattended_transfer_option
+    {
+    buf = qtn_incal_unattended_transfer_option;
+    }
+
+// -----------------------------------------------------------------------------
+//    qtn_voip_query_acc_id_header "Transfer request:"
+//    Header text for unattended transfer acceptance query. 
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_query_acc_id_header
+    {
+    buf = qtn_voip_query_acc_id_header;
+    }
+
+// -----------------------------------------------------------------------------
+//    qtn_voip_query_accept_identified 
+//    "%1U asks acceptance to transfer call to %1U"
+//    Confirmation text for unattended transfer acceptance query when 
+//    transferor is known.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_transfer_accept
+    {
+    buf = qtn_voip_query_accept_identified;
+    }
+    
+// -----------------------------------------------------------------------------
+//    qtn_voip_query_accept_cli_restricted 
+//    "Anonymous asks acceptance to transfer call to %U"
+//    Confirmation text for unattended transfer acceptance query when 
+//    transferor is anonymous.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_transfer_accept_cli
+    {
+    buf = qtn_voip_query_accept_cli_restricted;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_transfer_address "Address:"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_transfer_address
+    {
+    buf = qtn_voip_transfer_address;
+    }
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneuidialer_numberentry_empty_transfer_menubar
+//    Default menubar shown when touch transfer view is active and
+//    number entry is empty
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneuidialer_numberentry_empty_transfer_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneuidialer_numberentry_empty_transfer_options_menu ;
+            }
+        };
+    }
+
+// ----------------------------------------------------------------
+//   
+//    r_phoneuidialer_numberentry_not_empty_transfer_menubar
+//    Default menubar shown when touch transfer view is active and
+//    number entry is empty
+//
+// ----------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_phoneuidialer_numberentry_not_empty_transfer_menubar
+    {
+    titles=
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_phoneuidialer_numberentry_not_empty_transfer_options_menu ;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_phoneuidialer_numberentry_empty_transfer_options_menu
+//   Menu for Dialer transfer view when number entry is 
+//   empty
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneuidialer_numberentry_empty_transfer_options_menu 
+    {
+    items = 
+        {
+        MENU_ITEM 
+            {
+            command = EPhoneCmdTransferDialerSearch; 
+            txt = qtn_options_find;
+            },      
+        MENU_ITEM 
+            {
+            command = EPhoneDialerCmdTouchInput; 
+            txt = qtn_dialer_touch_input_options;
+            },       
+        MENU_ITEM 
+            {
+            command = EAknCmdEditItemPlaceHolder;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt = qtn_options_help;
+            },
+        MENU_ITEM 
+            {
+            command = EPhoneCmdTransferDialerExit; 
+            txt = qtn_options_exit;
+            }
+        };
+    } 
+
+// ---------------------------------------------------------
+//   
+//   r_phoneuidialer_numberentry_not_empty_transfer_options_menu 
+//   Menu for Dialer transfer view when number entry is not 
+//   empty
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneuidialer_numberentry_not_empty_transfer_options_menu 
+    {
+    items = 
+        {   
+        MENU_ITEM 
+            {
+            command = EPhoneCmdTransferDialerOk; 
+            txt = text_softkey_accept;
+            }, 
+        MENU_ITEM 
+            {
+            command = EPhoneDialerCmdTouchInput; 
+            txt = qtn_dialer_touch_input_options;
+            },       
+        MENU_ITEM 
+            {
+            command = EAknCmdEditItemPlaceHolder;
+            }, 
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdHelp; 
+            txt = qtn_options_help;
+            },
+        MENU_ITEM 
+            {
+            command = EPhoneCmdTransferDialerExit; 
+            txt = qtn_options_exit;
+            }
+        };
+    } 
+
+// -----------------------------------------------------------------------------
+//   
+//   r_phoneui_transfer_dialer_softkeys_options_cancel
+//    It is softkeys for transfer dialer
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phoneui_transfer_dialer_softkeys_options_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdOptions;
+            txt = text_softkey_option;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdTransferDialerExit;
+            txt = text_softkey_cancel;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_dialer_tooltip_accept "Accept"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_dialer_tooltip_accept
+    {
+    buf = text_softkey_accept;
+    } 
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_dialer_tooltip_search "Search"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_dialer_tooltip_search
+    {
+    buf = text_softkey_find;
+    } 
+
+// -----------------------------------------------------------------------------
+//   
+//    r_voip_phone_unattended_transfer_query_softkeys_search_cancel
+//    Softkeys buttons for unattended transfer query when 
+//    text query is empty.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phone_voip_softkeys_search_cancel
+     {
+     buttons =
+         {
+         CBA_BUTTON
+             {
+             id = EPhoneCmdTransferDialerSearch;
+             txt = text_softkey_find;
+             },
+         CBA_BUTTON
+             {
+             id = EAknSoftkeyCancel;
+             txt = text_softkey_cancel;
+             },
+         CBA_BUTTON
+             {
+             id = EPhoneCmdTransferDialerSearch;
+             }            
+         };
+     }
+
+// -----------------------------------------------------------------------------
+//   
+//    r_phone_new_voip_call_softkeys_search_cancel
+//    Softkeys buttons for new Internet call query when 
+//    text query is empty.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_phone_new_voip_call_softkeys_search_cancel
+     {
+     buttons =
+         {
+         CBA_BUTTON
+             {
+             id = EPhoneCmdNewInternetCallSearch;
+             txt = text_softkey_find;
+             },
+         CBA_BUTTON
+             {
+             id = EAknSoftkeyCancel;
+             txt = text_softkey_cancel;
+             },
+         CBA_BUTTON
+             {
+             id = EPhoneCmdNewInternetCallSearch;
+             }            
+         };
+     }
+
+// ---------------------------------------------------------
+//   
+//    r_voip_phone_unattended_transfer_query_softkeys_ok_cancel
+//    Softkeys buttons for unattended transfer query when 
+//    user has entered something to text query.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phone_voip_softkeys_ok_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdTransferDialerOk;
+            txt = text_softkey_ok;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdTransferDialerOk;
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_phone_voip_new_call_softkeys_ok_cancel
+//    Softkeys buttons for new call query when 
+//    user has entered something to text query.
+//
+// ---------------------------------------------------------
+//
+RESOURCE CBA r_phone_voip_new_call_softkeys_ok_cancel
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneCmdNewInternetCallOk;
+            txt = text_softkey_new_call;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyCancel;
+            txt = text_softkey_cancel;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneCmdNewInternetCallOk;
+            }
+        };
+    }
+
+//-----------------------------------------------------------------------------
+//   
+//    r_phone_transfer_voip_call_query
+//    It is data query used to ask phone number from user.
+//    Unattended transfer
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_transfer_voip_call_query  
+     {
+     flags = EGeneralQueryFlags;
+     buttons = R_AVKON_SOFTKEYS_EMPTY;
+     items =
+         {
+         DLG_LINE
+             {
+             type = EAknCtQuery;
+             id = EGeneralQuery;
+             control = AVKON_DATA_QUERY 
+                 { 
+                 layout = EDataLayout;
+                 label = qtn_voip_transfer_address;
+                 control = EDWIN 
+                     { 
+                     flags = EEikEdwinNoHorizScrolling | 
+                             EEikEdwinResizable; 
+                     maxlength = 100; 
+                     width = 6; 
+                     lines = 1;   
+                     default_case=EAknEditorLowerCase;
+                     allowed_case_modes=EAknEditorLowerCase |
+                         EAknEditorUpperCase;
+                     allowed_input_modes = EAknEditorTextInputMode |
+                                           EAknEditorNumericInputMode;
+                     default_input_mode = EAknEditorTextInputMode;
+                     special_character_table = 
+                         R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG;
+                     };
+                 };
+             }
+         };
+     }     
+
+//-----------------------------------------------------------------------------
+//   
+//    r_phone_new_voip_call_query
+//    It is data query used to ask phone number from user.
+//    New Internet call
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_phone_new_voip_call_query  
+     {
+     flags = EGeneralQueryFlags | EEikDialogFlagNoShadow;
+     buttons = r_phone_new_voip_call_softkeys_search_cancel;
+     items =
+         {
+         DLG_LINE
+             {
+             type = EAknCtQuery;
+             id = EGeneralQuery;
+             control = AVKON_DATA_QUERY 
+                 { 
+                 layout = EDataLayout;
+                 label = qtn_voip_transfer_address;
+                 control = EDWIN 
+                     { 
+                     flags = EEikEdwinNoHorizScrolling | 
+                             EEikEdwinResizable; 
+                     maxlength = 100; 
+                     width = 6; 
+                     lines = 1;   
+                     default_case=EAknEditorLowerCase;
+                     allowed_case_modes=EAknEditorLowerCase |
+                         EAknEditorUpperCase;
+                     allowed_input_modes = EAknEditorTextInputMode |
+                                           EAknEditorNumericInputMode;
+                     default_input_mode = EAknEditorTextInputMode;
+                     special_character_table = 
+                         R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG;
+                     };
+                 };
+             }
+         };
+     }     
+
+
+//-----------------------------------------------------------------------------
+//   
+//    r_phone_voip_registering "Registering to service" 
+//    
+//    Wait note text when service registration in progress during call setup
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_registering
+    {
+    buf = qtn_voip_rel2_registering_to_service;
+    }
+    
+//-----------------------------------------------------------------------------
+//   
+//    qtn_voip_rel2_call_being_forwarded "Call is being forwarded" 
+//    
+//    Info note text when call is being forwarded
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_call_being_forwarded
+    {
+    buf = qtn_voip_rel2_call_being_forwarded;
+    }
+    
+// ---------------------------------------------------------
+//
+//    r_phoneui_new_call_menu_voip
+//    Number Acquisition view options new call menu pane.
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_phoneui_new_call_menu_voip
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewCall;
+            txt = qtn_voip_call_type_cs;
+            },
+        MENU_ITEM
+            {
+            command = EPhoneInCallCmdNewInternetCall;
+            txt = qtn_voip_call_type_internet;
+            }
+        };
+    }
+
+//-----------------------------------------------------------------------------
+//   
+//    r_phone_voip_new_call_option 
+//    
+//    New call option text
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_new_call_option
+    {
+    buf = qtn_incal_new_call_option;
+    }
+
+// -----------------------------------------------------------------------------
+//    r_phoneui_voip_query_header_moved_permanently
+//    Header text for moved permanently query.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_voip_query_header_moved_permanently
+    {
+    buf = qtn_voip_rel2_save_new_address_query;
+    }
+
+// ---------------------------------------------------------
+//   
+//    r_phone_voip_multiple_choices_list_query
+//    Multiple choices list query resource
+// ---------------------------------------------------------
+//
+RESOURCE AVKON_LIST_QUERY r_phone_voip_multiple_choices_list_query
+    {
+    flags = EEikDialogFlagNoDrag | 
+            EEikDialogFlagNoTitleBar |
+            EEikDialogFlagCbaButtons;
+            
+    softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;
+    
+    items =
+        {
+        AVKON_LIST_QUERY_DLG_LINE 
+            {
+            control = AVKON_LIST_QUERY_CONTROL
+                {
+                listtype = EAknCtSinglePopupMenuListBox;
+                  heading = qtn_voip_rel2_popup_title_forward_call_to;
+                listbox = AVKON_LIST_QUERY_LIST
+                    {
+                    };
+                };
+            }
+        };
+    }
+    
+// -----------------------------------------------------------------------------
+//
+//     r_voip_handover_to_wlan_option "Handover to WLAN"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_handover_to_wlan_option
+    {
+    buf = qtn_incal_vcc_ho_to_wlan_option;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_handover_to_gsm_option "Handover to GSM"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_handover_to_gsm_option
+    {
+    buf = qtn_incal_vcc_ho_to_gsm_option;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_vcc_wait_ho_from_wlan "Handover from WLAN to GSM"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_vcc_wait_ho_from_wlan
+    {
+    buf = qtn_vcc_wait_ho_from_wlan;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_vcc_wait_ho_from_gsm "Handover from GSM to WLAN"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_voip_vcc_wait_ho_from_gsm
+    {
+    buf = qtn_vcc_wait_ho_from_gsm;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//     r_voip_vcc_info_ho_failed "Handover failed"
+//
+// -----------------------------------------------------------------------------
+//    
+RESOURCE TBUF  r_voip_vcc_info_ho_failed
+    {
+    buf = qtn_vcc_info_ho_failed;
+    }
+    
+    
+//-----------------------------------------------------------------------------
+//   
+//    r_phone_voip_connecting_service "Connecting %U" 
+//    
+//    Wait note text when service registration in progress during call setup
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_connecting_service
+    {
+    buf = qtn_ipcomm_connecting_servicename_wait_note;
+    }
+
+//-----------------------------------------------------------------------------
+//   
+//    r_phone_voip_no_connections_defined "No connections defined for %U" 
+//    
+//    Shown when user tries to connect service and there are no connections
+//    defined in settings.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_no_connections_defined
+    {
+    buf = qtn_ipcomm_no_conn_defined_note;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_phone_voip_no_connections_available "No connections available for %U"
+//
+//    Shown when user tries to connect to service outside service tab and
+//    access points defined for service are not available.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_no_connections_available
+    {
+    buf = qtn_ipcomm_no_conn_available_note;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_phone_voip_connection_does_not_support_calls
+//    "%U connection does not support calls"
+//
+//    Shown in case when user tries to call using a service which does not 
+//    support internet call or service is connected via 2G.  
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_connection_does_not_support_calls
+    {
+    buf = qtn_ipcomm_conn_supports_no_calls_note;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_phone_voip_connection_not_available_during_alr
+//    "%U not available when connecting"
+//
+//    Shown when user tries to create an internet call outside service tab when
+//    service is either creating connection or performing application 
+//    level roaming.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_connection_not_available_during_alr
+    {
+    buf = qtn_ipcomm_not_available_during_alr;
+    }
+
+//-----------------------------------------------------------------------------
+//
+//    r_phone_voip_creating_conn_failed_permanently
+//    "Connecting %U failed due to defective settings. 
+//    Contact your service provider."
+//   
+//    Shown when connection tried outside service tab fails due to incomplete 
+//    settings which will most definetely prevent the registration.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phone_voip_creating_conn_failed_permanently
+    {
+    buf = qtn_ipcomm_creating_conn_failed_permanently;
+    } 
+
+//-----------------------------------------------------------------------------
+//
+//    r_phoneui_numberacq_options_menu_item_xsp
+//    "%U call"
+//   
+//    Number acquisition menu item text for call submenu in options menu
+//    Shown when there is only one VoIP service, whose provider ID is
+//    inserted in the string.
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_phoneui_numberacq_options_call_menu_item_xsp
+    {
+    buf = qtn_call_sub_voip_with_name;
+    }
+    
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/data/silence.rul	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,133 @@
+<script xmlns="http://www.nokia.com/ns/cep/script/1.0/"
+xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
+    <!-- Must have sensor interaction active -->
+    <if>
+        <equals>
+            <contextRef source='Sensor' type='Setting.Active'/>
+            <string>Off</string>
+        </equals>
+        <actions>
+        </actions>
+    </if>
+    <!-- Check if we have incoming call and we receive a double tap event -->
+    <elseIf>
+        <and>
+            <!-- Must have a ringin call and receive new double tap event or orientation event from sensor -->
+            <equals>
+                <contextRef source='Call' type='State'/>
+                <string>Ringing</string>
+            </equals>
+            <or>
+                <and>
+                    <!-- Check that double tap interaction is set -->
+                    <equals>
+                        <contextRef source='Sensor' type='Setting.TappingInteraction.SilenceCalls'/>
+                        <string>On</string>
+                    </equals>
+                    <contextUpdated>
+                        <contextRef source='Sensor' type='Event.DoubleTap'/>
+        	          </contextUpdated>
+                </and>
+    	          <and>
+                    <!-- Check that turning interaction is set -->
+                    <equals>
+                        <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceCalls'/>
+                        <string>On</string>
+                    </equals>
+                    <!-- ...and previous orientation is not 'Undefined' ... -->
+                    <notEqual>
+                        <contextRef source='Sensor' type='Event.Orientation.Previous'/>
+                        <string>Undefined</string>
+                    </notEqual>
+		                <contextChanged>
+		                    <contextRef source='Sensor' type='Event.Orientation'/>
+		    	    	    </contextChanged>
+    	        	    <equals>
+                        <contextRef source='Sensor' type='Event.Orientation'/>
+                    	  <string>DisplayDownwards</string>
+    	              </equals>
+    	          </and>
+            </or>
+        </and>
+        <actions>
+            <!-- Silence ringing tone -->
+            <Phone Command='Silence'/>
+            <!-- Vibra feedback -->
+            <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
+        </actions>
+    </elseIf>
+    <!-- Check if we just have incoming call -->
+    <elseIf>
+        <and>
+            <!-- Check that the feature has not yet been enabled -->
+            <notEqual>
+                <contextRef source='Sensor' type='Event.AutoRotateAndDoubleTap'/>
+                <string>Enabled</string>
+            </notEqual>
+            <equals>
+                <contextRef source='Call' type='State'/>
+                <string>Ringing</string>
+            </equals>
+        </and>
+        <actions>
+            <!-- Activate double tap events from sensor -->
+            <publishContext>
+                <contextRef source='Sensor'
+                    type='Event'
+                    value='DoubleTap.Activate'/>
+            </publishContext>
+            <!-- Activate orientation events from sensor -->
+            <publishContext>
+                <contextRef source='Sensor'
+                    type='Event'
+                    value='Orientation.Activate'/>
+            </publishContext>
+            
+            <!-- Mark feature as 'Enabled' -->
+            <publishContext>
+                <contextRef source="Sensor" type="Event.AutoRotateAndDoubleTap" value="Enabled"/>
+            </publishContext>
+        
+        </actions>
+    </elseIf>
+    <!-- If we have call in 'Connected' or 'Disconnected' state -->
+    <elseIf>
+        <!-- Check that the feature has not already been disabled -->
+        <and>
+            <notEqual>
+                <contextRef source='Sensor' type='Event.AutoRotateAndDoubleTap'/>
+                <string>Disabled</string>
+            </notEqual>
+            <or>
+                <equals>
+                    <contextRef source='Call' type='State'/>
+                    <string>Connected</string>
+                </equals>
+                <equals>
+                    <contextRef source='Call' type='State'/>
+                    <string>Disconnected</string>
+                </equals>
+            </or>
+        </and>
+        <actions>
+            <!-- Deactivate double tap events from sensor -->
+            <publishContext>
+                <contextRef source='Sensor'
+                    type='Event'
+                    value='DoubleTap.Deactivate'/>
+            </publishContext>
+            <!-- Deactivate orientation events from sensor -->
+            <publishContext>
+                <contextRef source='Sensor'
+                    type='Event'
+                    value='Orientation.Deactivate'/>
+            </publishContext>
+            
+            <!-- Mark feature as 'Disabled' -->
+            <publishContext>
+                <contextRef source="Sensor" type="Event.AutoRotateAndDoubleTap" value="Disabled"/>
+            </publishContext>
+        
+        </actions>
+    </elseIf>
+</script>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/data/silenceactionplugin.pkg	Fri Jun 04 10:19:18 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: For packing silence action plugin.
+;
+; Languages
+&EN
+
+; Header
+#{"silenceactionplugin"}, (0x10282E76), 10, 1, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+"\epoc32\RELEASE\armv5\UREL\silenceactionplugin.dll"-"z:\sys\bin\silenceactionplugin.dll"
+"\epoc32\data\z\resource\plugins\silenceactionplugin.rsc"-"z:\resource\plugins\silenceactionplugin.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/data/silenceactionplugin.rss	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Registery info for Silence action plugin.
+*
+*/
+
+
+#include <ecom/registryinfo.rh>
+#include <cfactionpluginconst.hrh>
+
+#include "silenceactionpluginconst.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = KSilenceActionPluginDllUid;
+    // Declare array of interface info
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented            
+            interface_uid = KActionPluginInterfaceUid;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KSilenceActionPluginImplementationUid;
+                    version_no         = 1;
+                    display_name       = "";
+                    default_data       = "";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
Binary file phoneapp/silenceactionplugin/data/silenceactionplugin_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/data/silenceactionplugin_stub.pkg	Fri Jun 04 10:19:18 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: For packing silence action plugin stub.
+;
+; Languages
+&EN
+
+; Header
+#{"silenceactionplugin"}, (0x10282E76), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+""-"z:\sys\bin\silenceactionplugin.dll"
+""-"z:\resource\plugins\silenceactionplugin.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Build file for silence action plugin.
+*
+*/
+
+
+#ifdef RD_CONTEXT_FRAMEWORK
+#include  <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../data/silence.rul\
+    /epoc32/release/winscw/udeb/z/private/10282bc4/rules/silence.rul
+
+../data/silence.rul\
+    /epoc32/data/z/private/10282bc4/rules/silence.rul
+
+../data/silenceactionplugin_stub.sis\
+    /epoc32/data/z/system/install/silenceactionplugin_stub.sis
+    
+../rom/silenceactionplugin.iby\
+    CORE_APP_LAYER_IBY_EXPORT_PATH(silenceactionplugin.iby)
+
+PRJ_MMPFILES
+silenceactionplugin.mmp
+
+PRJ_TESTMMPFILES
+#endif // RD_CONTEXT_FRAMEWORK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/group/silenceactionplugin.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for the SilenceActionPlugIn
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include "../inc/silenceactionpluginconst.hrh"
+
+TARGET          silenceactionplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009D8D KSilenceActionPluginDllUid
+CAPABILITY      ALL -TCB
+
+SOURCEPATH      ../src
+SOURCE          main.cpp
+SOURCE          silenceactionplugin.cpp
+SOURCE          silenceaction.cpp
+
+USERINCLUDE     .
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../data
+START RESOURCE  silenceactionplugin.rss
+TARGET          silenceactionplugin.rsc
+TARGETPATH      /resource/plugins
+END
+
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+LIBRARY         bafl.lib
+LIBRARY         cfactivatorengine.lib
+LIBRARY         phoneclient.lib
+LIBRARY         cfservices.lib
+
+#ifdef LOGGING_MODE_FILE
+LIBRARY         flogger.lib
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/inc/logger.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A plug-in for silencing the rigning tones.
+*
+*/
+
+
+#ifndef LOGGER_H
+#define LOGGER_H
+
+#include <e32debug.h>  // RDebug::Print
+
+/**
+* Logging macros,
+* see silenceactionpluginconst.hrh.
+*/
+
+#ifdef LOGGING_ENABLED
+
+#ifndef LOGGING_MODE_FILE
+
+#define LOG_1( a ) RDebug::Print( a )
+#define LOG_2( a, b ) RDebug::Print( a, b )
+#define LOG_3( a, b, c ) RDebug::Print( a, b, c )
+#define LOG_RAW( a ) RDebug::RawPrint( a )
+#define ENABLE_LOG
+
+#else
+
+#include <flogger.h>
+#include <f32file.h>
+
+_LIT( KFullPath, "c:\\logs\\silenceplugin\\" );
+
+LOCAL_C void EnableLogging()
+    {
+    RFs fs;
+    TInt err = fs.Connect();
+    if( err == KErrNone )
+        {
+        fs.MkDirAll( KFullPath );
+        }
+    fs.Close();
+    }
+
+_LIT( KDir, "silenceplugin" );
+_LIT( KFile, "silence.txt" );
+
+#define LOG_1( a ) RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, a )
+#define LOG_2( a, b ) RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, a, b )
+#define LOG_3( a, b, c ) RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, a, b, c )
+#define LOG_RAW( a ) RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, a )
+#define ENABLE_LOG EnableLogging()
+
+#endif // LOGGING_MODE_FILE
+
+#else
+
+#define LOG_1( a )
+#define LOG_2( a, b )
+#define LOG_3( a, b, c )
+#define LOG_RAW( a )
+#define ENABLE_LOG
+
+#endif // LOGGING_ENABLED
+
+#endif // LOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/inc/msilenceactionobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A plug-in for silencing the rigning tones.
+*
+*/
+
+
+
+#ifndef M_SILENCEACTIONOBSERVER_H
+#define M_SILENCEACTIONOBSERVER_H
+
+/**
+* Silence action observer interface.
+*
+* @lib -
+* @since S60 4.0
+*/
+NONSHARABLE_CLASS( MSilenceActionObserver )
+    {
+    public:
+    
+        /**
+        * Notifies that ringing tone silence
+        * action is completed.
+        * 
+        * @since S60 4.0
+        */
+        virtual void MuteActionCompleted() = 0;
+    };
+    
+#endif // M_SILENCEACTIONOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/inc/silenceaction.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A plug-in for silencing the rigning tones.
+*
+*/
+
+
+
+#ifndef C_SILENCEPLUGIN_H
+#define C_SILENCEPLUGIN_H
+
+#include <e32base.h>
+#include <rphcltserver.h>
+#include <cphcltcommandhandler.h>
+
+#include "msilenceactionobserver.h"
+
+// FORWARD DECLARATIONS
+class CPhCltCommandHandler;
+
+/**
+* Mutes ringing tone by commanding phoneclient.
+* 
+* @lib silenceactionplugin.lib
+* @since S60 3.2
+*/
+NONSHARABLE_CLASS( CSilenceAction ): public CActive
+    {
+    public:
+    
+        // Two phased constructors
+        static CSilenceAction* NewL( MSilenceActionObserver& aObserver );
+        static CSilenceAction* NewLC( MSilenceActionObserver& aObserver );
+            
+        // Destructor
+        ~CSilenceAction();
+        
+    public: // New methods
+    
+        void ActionMuteRingingTone();
+
+    private: // From base classes
+    
+        // @see CActive
+        void RunL();
+    
+        // @see CActive
+        void DoCancel();
+    
+        // @see CActive
+        TInt RunError( TInt aError );
+        
+    private:
+    
+        // C++ constrcutor
+        CSilenceAction( MSilenceActionObserver& aObserver );
+        
+        // Second phase constructor.
+        void ConstructL();  
+        
+    private:
+    
+        // Silence observer.
+        MSilenceActionObserver& iObserver;
+        
+        // phone client handles phone call operations.
+        CPhCltCommandHandler* iPhoneClient;
+
+    };
+    
+#endif // C_SILENCEPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/inc/silenceactionplugin.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  An action plug-in for silencing the ringing tones.
+*
+*/
+
+
+
+#ifndef C_SILENCEACTIONPLUGIN_H
+#define C_SILENCEACTIONPLUGIN_H
+
+// INCLUDES
+#include <cfactionplugin.h> 
+#include <e32base.h>
+
+#include "msilenceactionobserver.h"
+
+// FORWARD DECLARATIONS
+class CCFActionIndication;
+class CSilenceAction;
+
+// CLASS DECLARATION
+
+/**
+* Class CActionPlugIn.
+*
+* Provides control for silencing the ringing tones.
+* Triggered when the conditions from the rule file are valid.
+*/
+class CSilenceActionPlugIn : 
+    public CCFActionPlugIn,
+    public MSilenceActionObserver
+    {
+    public: // Constructors and destructor
+
+        static CSilenceActionPlugIn* NewL();
+        static CSilenceActionPlugIn* NewLC();
+
+        ~CSilenceActionPlugIn();
+
+    public: // From CCFActionPlugIn
+
+        // @see CCFActionPlugIn
+        void InitializeL();
+
+        // @see CCFActionPlugIn
+        TExecutionTime ExecuteL(
+            CCFActionIndication* aActionIndication );
+                    
+        // @see CCFActionPlugIn
+        void GetActionsL( CDesCArray& aActionList ) const;
+        
+        // @see CCFActionPlugIn
+        const TSecurityPolicy& SecurityPolicy() const;
+        
+    private: // From MSilenceActionObserver
+        
+        // @see MSilenceActionObserver
+        void MuteActionCompleted();
+        
+    protected:
+
+        // C++ constrcutor
+        CSilenceActionPlugIn();
+        
+    private: // New functions
+        
+        void DoCancel();
+        
+        void RunL();
+                    
+    private: // Data
+        
+        // Silence action.
+        CSilenceAction* iSilence;
+    };
+
+#endif // C_SILENCEACTIONPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/inc/silenceactionpluginconst.hrh	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A header file for both the C++ compiler and the resource compiler.
+*
+*/
+
+
+
+#ifndef SILENCEACTIONPLUGINCONST_HRH
+#define SILENCEACTIONPLUGINCONST_HRH
+
+
+// Plug-in specific UIDs (ECom)
+#define KSilenceActionPluginDllUid 0x10282E76
+#define KSilenceActionPluginImplementationUid 0x10282E77
+
+/**
+* Defines that logging of plugin is enabled.
+*/
+#undef LOGGING_ENABLED
+
+/**
+* Defines current logging mode in a file.
+* Otherwise RDebug is used.
+*/
+#undef LOGGING_MODE_FILE
+
+#endif // SILENCEACTIONPLUGINCONST_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/rom/silenceactionplugin.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for the SilenceActionPlugIn
+*
+*/
+
+
+#ifndef __SILENCEACTIONPLUGIN_IBY__
+#define __SILENCEACTIONPLUGIN_IBY__
+
+#ifdef RD_CONTEXT_FRAMEWORK
+
+ECOM_PLUGIN( silenceactionplugin.dll, silenceactionplugin.rsc )
+data=\epoc32\data\Z\private\10282BC4\Rules\silence.rul    private\10282BC4\Rules\silence.rul
+data=ZSYSTEM\install\silenceactionplugin_stub.sis     System\Install\silenceactionplugin_stub.sis
+
+#endif  // RD_CONTEXT_FRAMEWORK
+
+#endif // __SILENCEACTIONPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/src/main.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A plug-in for silencing the rigning tones.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "silenceactionplugin.h"
+#include "silenceactionpluginconst.hrh"
+
+// Provides a key value pair table, this is used to identify
+// the correct construction function for the requested interface.
+const TImplementationProxy ImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 
+        KSilenceActionPluginImplementationUid, 
+        CSilenceActionPlugIn::NewL )
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+    {
+    aTableCount 
+        = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/src/silenceaction.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A plug-in for silencing the rigning tones.
+*
+*/
+
+
+#include "silenceaction.h"
+#include "logger.h"
+
+// CONSTANTS
+
+
+// -----------------------------------------------------------------------------
+// CSilenceAction::NewL
+// -----------------------------------------------------------------------------
+// 
+CSilenceAction* CSilenceAction::NewL( MSilenceActionObserver& aObserver )
+    {
+    CSilenceAction* self = CSilenceAction::NewLC( aObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSilenceAction::NewLC
+// -----------------------------------------------------------------------------
+// 
+CSilenceAction* CSilenceAction::NewLC( MSilenceActionObserver& aObserver )
+    {
+    CSilenceAction* self = new( ELeave ) CSilenceAction( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    return self;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSilenceAction Destructor.
+// -----------------------------------------------------------------------------
+//
+CSilenceAction::~CSilenceAction()
+    {
+    Cancel();
+        
+    if ( iPhoneClient )
+        {
+        delete iPhoneClient; 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSilenceAction constructor.
+// -----------------------------------------------------------------------------
+//
+CSilenceAction::CSilenceAction( MSilenceActionObserver& aObserver ):
+    CActive( EPriorityStandard ),
+    iObserver( aObserver )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CSilenceAction::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSilenceAction::ConstructL( )
+    {
+    LOG_1( _L("->CSilenceAction::ConstructL: START") );     
+
+    iPhoneClient = CPhCltCommandHandler::NewL();
+
+    LOG_1( _L("<-CSilenceAction::ConstructL: END") );
+    }
+
+//-----------------------------------------------------------------------------
+// CSilenceAction::ActionMuteRingingToneL
+//-----------------------------------------------------------------------------
+// 
+void CSilenceAction::ActionMuteRingingTone( )
+    {
+    LOG_1( _L("->CSilenceAction::ActionMuteRingingTone: START") );
+    if ( !IsActive() ) 
+        {
+        iPhoneClient->MuteRingingTone(iStatus);
+        SetActive();
+        }
+    LOG_1( _L("<-CSilenceAction::ActionMuteRingingTone: END") );
+    }
+//-----------------------------------------------------------------------------
+// CSilenceAction::RunL
+//-----------------------------------------------------------------------------
+//
+void CSilenceAction::RunL()
+    {
+    iObserver.MuteActionCompleted();
+    LOG_2( _L("CSilenceAction::RunL iStatus: %d"), iStatus.Int() );
+    }
+
+//-----------------------------------------------------------------------------
+// CSilenceAction::DoCancel
+//-----------------------------------------------------------------------------
+//
+void CSilenceAction::DoCancel()
+    {
+    LOG_1( _L("->CSilenceAction::DoCancel: START") );
+    iPhoneClient->CancelAsyncRequest( EPhCltCommandMuteRingingTone );
+    LOG_1( _L("<-CSilenceAction::DoCancel: END") );
+    }
+        
+//-----------------------------------------------------------------------------
+// CSilenceAction::RunError
+//-----------------------------------------------------------------------------
+//
+TInt CSilenceAction::RunError( TInt aError )
+    {
+    LOG_2( _L("CSilenceAction::RunError aError: %d"), aError );
+    return aError;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/silenceactionplugin/src/silenceactionplugin.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A plug-in for silencing the rigning tones.
+*
+*/
+
+
+// INCLUDE FILES
+#include <badesca.h>
+#include <cfactionindication.h>
+
+#include "silenceactionplugin.h"
+#include "logger.h"
+#include "silenceaction.h"
+
+// LOCAL CONSTANTS AND MACROS
+
+// Supported action identifiers.
+_LIT( KPhoneId,     "Phone" );
+
+_LIT( KActionIdCommand,     "Command" );
+
+_LIT( KActionCommand,     "Silence" );
+
+// Capabilities
+_LIT_SECURITY_POLICY_PASS( KSecurityPolicy );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSilenceActionPlugIn::CSilenceActionPlugIn
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CSilenceActionPlugIn::CSilenceActionPlugIn( ) 
+                                : CCFActionPlugIn()                                  
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSilenceActionPlugIn::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSilenceActionPlugIn* CSilenceActionPlugIn::NewL( )
+    {
+    CSilenceActionPlugIn* self = CSilenceActionPlugIn::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+  
+// -----------------------------------------------------------------------------
+// CSilenceActionPlugIn::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSilenceActionPlugIn* CSilenceActionPlugIn::NewLC( )
+    {
+    CSilenceActionPlugIn* self = new( ELeave ) CSilenceActionPlugIn();
+    CleanupStack::PushL( self );
+    return self;
+    }
+  
+
+// -----------------------------------------------------------------------------
+// CSilenceActionPlugIn::~CSilenceActionPlugIn
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CSilenceActionPlugIn::~CSilenceActionPlugIn()
+    {
+    if ( iSilence )
+        {
+        delete iSilence;
+        iSilence = NULL;   
+        }
+    }
+
+// METHODS
+
+//-----------------------------------------------------------------------------
+// CSilenceActionPlugIn::InitializeL
+//-----------------------------------------------------------------------------
+//
+void CSilenceActionPlugIn::InitializeL()
+    {
+    LOG_1( _L("CSilenceActionPlugIn::InitializeL: START") );
+    iSilence = CSilenceAction::NewL( *this );
+    LOG_1( _L("CSilenceActionPlugIn::InitializeL: END") );
+    }
+
+//-----------------------------------------------------------------------------
+// CSilenceActionPlugIn::ExecuteL
+// Triggers an action.
+//-----------------------------------------------------------------------------
+//
+CCFActionPlugIn::TExecutionTime CSilenceActionPlugIn::ExecuteL(
+    CCFActionIndication* aActionIndication )
+    {
+    LOG_1( _L("CSilenceActionPlugIn::ExecuteL: START") );
+    
+    CCFActionPlugIn::TExecutionTime time = CCFActionPlugIn::ENone;
+    const RKeyValueArray& parameters = aActionIndication->Parameters();
+    
+    TInt count = parameters.Count();
+    
+    for( TInt i = 0; i < count; i++ )
+        {
+        TPtrC actionId( KNullDesC );
+        TPtrC commandId( KNullDesC );
+        
+        actionId.Set( parameters[i]->Key() );
+        commandId.Set( parameters[i]->Value() );
+
+        if( ( actionId.CompareF( KActionIdCommand ) == KErrNone ) && 
+            ( commandId.CompareF( KActionCommand ) == KErrNone ) )
+            {
+            LOG_1( _L("CSilenceActionPlugIn::ExecuteL->ActionMuteRingingTone") );
+            iSilence->ActionMuteRingingTone();
+            time = CCFActionPlugIn::ESmall;
+            }
+        else
+            {
+            LOG_1( _L("CSilenceActionPlugIn::ExecuteL->Do nothing") );
+            time = CCFActionPlugIn::ENone;
+            }
+        }
+        
+    LOG_1( _L("CSilenceActionPlugIn::ExecuteL: END") );
+    return time;
+    }
+
+//-----------------------------------------------------------------------------
+// CSilenceActionPlugIn::MuteActionCompleted
+// Notifies CCFActionPlugIn base class that async request has been completed. 
+//-----------------------------------------------------------------------------
+//
+void CSilenceActionPlugIn::MuteActionCompleted()
+    {
+    AsyncExecutionCompleted();
+    }
+
+//-----------------------------------------------------------------------------
+// CSilenceActionPlugIn::GetActionsL
+// Gets all the actions the plugin can perform.
+//-----------------------------------------------------------------------------
+//
+void CSilenceActionPlugIn::GetActionsL( CDesCArray& aActionList ) const
+    {
+    LOG_1( _L("CSilenceActionPlugIn::GetActionsL: START") );
+    aActionList.AppendL( KPhoneId );
+    LOG_1( _L("CSilenceActionPlugIn::GetActionsL: END") );
+    }
+
+//-----------------------------------------------------------------------------
+// CSilenceActionPlugIn::SecurityPolicy
+// Returns the capabilities required by the plugin.
+//-----------------------------------------------------------------------------
+//
+const TSecurityPolicy& CSilenceActionPlugIn::SecurityPolicy() const
+    {
+    LOG_1( _L("CSilenceActionPlugIn::SecurityPolicy") );
+    return KSecurityPolicy;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/bwins/audiohandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,25 @@
+EXPORTS
+	??1CPEGsmAudioData@@UAE@XZ @ 1 NONAME ; CPEGsmAudioData::~CPEGsmAudioData(void)
+	??1CPEAudioData@@UAE@XZ @ 2 NONAME ; CPEAudioData::~CPEAudioData(void)
+	?HandleCallStarting@CPEAudioData@@UAEHH@Z @ 3 NONAME ; int CPEAudioData::HandleCallStarting(int)
+	??0CPEAudioFactory@@IAE@XZ @ 4 NONAME ; CPEAudioFactory::CPEAudioFactory(void)
+	?SetAudioOutput@CPEAudioData@@UAEHW4TPEAudioOutput@@H@Z @ 5 NONAME ; int CPEAudioData::SetAudioOutput(enum TPEAudioOutput, int)
+	?HandleDTMFEvent@CPEGsmAudioData@@UAEXW4TCCEDtmfEvent@MCCEDtmfObserver@@HVTChar@@@Z @ 6 NONAME ; void CPEGsmAudioData::HandleDTMFEvent(enum MCCEDtmfObserver::TCCEDtmfEvent, int, class TChar)
+	?GetAudioVolumeSync@CPEAudioData@@UBEXAAH@Z @ 7 NONAME ; void CPEAudioData::GetAudioVolumeSync(int &) const
+	?SetAudioMuteSync@CPEAudioData@@UAEXH@Z @ 8 NONAME ; void CPEAudioData::SetAudioMuteSync(int)
+	?HandleEnergencyCallStarting@CPEAudioData@@UAEHXZ @ 9 NONAME ; int CPEAudioData::HandleEnergencyCallStarting(void)
+	?StopInbandTonePlay@CPEGsmAudioData@@QAEXXZ @ 10 NONAME ; void CPEGsmAudioData::StopInbandTonePlay(void)
+	?CreateTelephonyAudioRoutingL@CPEAudioFactory@@UAEPAVCTelephonyAudioRouting@@AAVMTelephonyAudioRoutingObserver@@@Z @ 11 NONAME ; class CTelephonyAudioRouting * CPEAudioFactory::CreateTelephonyAudioRoutingL(class MTelephonyAudioRoutingObserver &)
+	?PlayDtmfTone@CPEGsmAudioData@@QBEXABVTChar@@@Z @ 12 NONAME ; void CPEGsmAudioData::PlayDtmfTone(class TChar const &) const
+	?CreateAudioToneUtilityL@CPEAudioFactory@@UAEPAVCPEAudioToneUtility@@AAVMMdaAudioToneObserver@@@Z @ 13 NONAME ; class CPEAudioToneUtility * CPEAudioFactory::CreateAudioToneUtilityL(class MMdaAudioToneObserver &)
+	?CallAudioRoutePreferenceChanged@CPEAudioData@@UAEHXZ @ 14 NONAME ; int CPEAudioData::CallAudioRoutePreferenceChanged(void)
+	?HandleCallEnding@CPEAudioData@@UAEXXZ @ 15 NONAME ; void CPEAudioData::HandleCallEnding(void)
+	?NewLC@CPEAudioFactory@@SAPAV1@XZ @ 16 NONAME ; class CPEAudioFactory * CPEAudioFactory::NewLC(void)
+	?StartUp@CPEAudioData@@UAEXXZ @ 17 NONAME ; void CPEAudioData::StartUp(void)
+	?GetAudioMuteSync@CPEAudioData@@UBEXAAH@Z @ 18 NONAME ; void CPEAudioData::GetAudioMuteSync(int &) const
+	?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@@Z @ 19 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &)
+	?StopDtmfTonePlay@CPEGsmAudioData@@UAEXXZ @ 20 NONAME ; void CPEGsmAudioData::StopDtmfTonePlay(void)
+	?NewL@CPEGsmAudioData@@SAPAV1@AAVMPEPhoneModelInternal@@AAVRFs@@AAVCPEAudioFactory@@@Z @ 21 NONAME ; class CPEGsmAudioData * CPEGsmAudioData::NewL(class MPEPhoneModelInternal &, class RFs &, class CPEAudioFactory &)
+	?SetAudioVolumeSync@CPEAudioData@@UAEXH@Z @ 22 NONAME ; void CPEAudioData::SetAudioVolumeSync(int)
+	?PlayInbandTone@CPEGsmAudioData@@QAEXXZ @ 23 NONAME ; void CPEGsmAudioData::PlayInbandTone(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/data/audiohandling_stub.pkg	Fri Jun 04 10:19:18 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: For packing audio handling component.
+;
+; audiohandling_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"audiohandling"},(0x1000A832),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\audiohandling.dll"
+""-"z:\resource\defaultbeep.rsc" 
\ No newline at end of file
Binary file phoneengine/audiohandling/data/audiohandling_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/data/defaultbeep.rss	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,245 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains default beep sequences.
+*
+*/
+
+
+#include "defaultbeep.rh"
+#include <uikon.rh>
+
+RESOURCE SEQ_LOOP ringtone
+{
+    repeats = 3;
+    tones = 
+    {
+        SEQ_2TONES
+        {
+            duration    = 1000 ;
+            freq1       = SEQ_FREQ_C1;
+            vol1        = SEQ_VOL_MP;
+            freq2       = SEQ_FREQ_C2;
+            vol2        = SEQ_VOL_MP;
+        },  
+        SEQ_2TONES
+        {
+            duration    = 1000 ;
+            freq1       = SEQ_FREQ_D1;
+            vol1        = SEQ_VOL_MP;
+            freq2       = SEQ_FREQ_B2;
+            vol2        = SEQ_VOL_MP;
+        },  
+        SEQ_2TONES
+        {
+            duration    = 1000 ;
+            freq1       = SEQ_FREQ_E1;
+            vol1        = SEQ_VOL_MP;
+            freq2       = SEQ_FREQ_C2;
+            vol2        = SEQ_VOL_MP;
+        },  
+        SEQ_2TONES
+        {
+            duration    = 1000 ;
+            freq1       = SEQ_FREQ_F1;
+            vol1        = SEQ_VOL_MP;
+            freq2       = SEQ_FREQ_C2;
+            vol2        = SEQ_VOL_MP;
+        },  
+        SEQ_2TONES
+        {
+            duration    = 1000 ;
+            freq1       = SEQ_FREQ_G1;
+            vol1        = SEQ_VOL_MP;
+            freq2       = SEQ_FREQ_C2;
+            vol2        = SEQ_VOL_MP;
+        },
+        SEQ_2TONES
+        {
+            duration    = 1000 ;
+            freq1       = SEQ_FREQ_A2;
+            vol1        = SEQ_VOL_MP;
+            freq2       = SEQ_FREQ_C2;
+            vol2        = SEQ_VOL_MP;
+        },  
+        SEQ_2TONES
+        {
+            duration    = 1000 ;
+            freq1       = SEQ_FREQ_B2;
+            vol1        = SEQ_VOL_MP;
+            freq2       = SEQ_FREQ_C2;
+            vol2        = SEQ_VOL_MP;
+        }       
+
+    };
+
+}
+
+STRUCT VAR_ARRAY
+    {
+    WORD sequence [];
+    }
+
+RESOURCE VAR_ARRAY r_net_busy
+    {
+    // ETSI spec says 425Hz on 500ms, off 500ms.
+    // Seems to be close but on/off time is 480ms. 
+    sequence={0,17,10,5,6,78,50,64,50,6,11};
+    // 0  = OPCODE_SEQUENCE_START
+    // 17 = OPCODE_DURATION_UNIT
+    // 10 = duration unit => tone duration is 10ms * tone_tick
+    // 5  = OPCODE_REPEAT
+    // 6  = repeat 6 times sequence between OPCODE_REPEAT and OPCODE_REPEATEND  
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1  = 425Hz
+    // 50 = tone_tick = 500ms
+    // 64-64=0=AUD_TONE_FREQ_OFF         = 0Hz
+    // 50 = tone_tick = 50ms
+    // 6  = OPCODE_REPEATEND
+    // 11 = OPCODE_END
+    }
+ 
+RESOURCE VAR_ARRAY r_net_reorder
+    {
+    // Don't know if this is defined in ETSI spec at all
+    sequence={0,17,10,5,3,93,25,64,25,6,11};
+    // 0  = OPCODE_SEQUENCE_START
+    // 17 = OPCODE_DURATION_UNIT
+    // 10 = duration unit => tone duration is 10ms * tone_tick
+    // 5  = OPCODE_REPEAT
+    // 3  = repeat 3 times sequence between OPCODE_REPEAT and OPCODE_REPEATEND  
+    // 93-64=29=AUD_TONE_RING_FREQ_E0    = 330Hz
+    // 25 = tone_tick = 250ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 25 = tone_tick = 250ms
+    // 6  = OPCODE_REPEATEND
+    // 11 = OPCODE_END
+    }
+
+RESOURCE VAR_ARRAY r_net_congestion
+    {
+    // ETSI spec says 425Hz on 200ms, off 200ms
+    // Seems to be so (but repeated only 15 times):
+    sequence={0,17,10,5,15,78,20,64,20,6,11};
+    // 0  = OPCODE_SEQUENCE_START
+    // 17 = OPCODE_DURATION_UNIT
+    // 10 = duration unit => tone duration is 10ms * tone_tick
+    // 5  = OPCODE_REPEAT
+    // 15  = repeat 15 times sequence between OPCODE_REPEAT and OPCODE_REPEATEND  
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1  = 425Hz
+    // 20 = tone_tick = 200ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 20 = tone_tick = 200ms
+    // 6  = OPCODE_REPEATEND
+    // 11 = OPCODE_END
+    }
+
+RESOURCE VAR_ARRAY r_net_special_information
+    {
+    sequence={0,17,10,5,3,79,33,80,33,81,33,64,50,64,50,6,11};
+    // 0  = OPCODE_SEQUENCE_START
+    // 17 = OPCODE_DURATION_UNIT
+    // 10 = duration unit => tone duration is 10ms * tone_tick
+    // 5  = OPCODE_REPEAT
+    // 3  = repeat 3 times sequence between OPCODE_REPEAT and OPCODE_REPEATEND  
+    // 79-64=15=AUD_TONE_NETWORK_FREQ_2  = 950Hz
+    // 33 = tone_tick = 330ms
+    // 80-64=16=AUD_TONE_NETWORK_FREQ_3  = 1400Hz
+    // 33 = tone_tick = 330ms
+    // 81-64=17=AUD_TONE_NETWORK_FREQ_4  = 1800Hz
+    // 33 = tone_tick = 330ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 50 = tone_tick = 500ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 50 = tone_tick = 500ms  
+    // 6  = OPCODE_REPEATEND
+    // 11 = OPCODE_END
+    }
+
+RESOURCE VAR_ARRAY r_net_radio_not_available
+    {
+    // ETSI spec says: 425Mhz on 200ms, off 200ms, 3 bursts
+    // Seems to be so:
+    sequence={0,17,10,5,3,78,20,64,20,6,11};
+    // 0  = OPCODE_SEQUENCE_START
+    // 17 = OPCODE_DURATION_UNIT
+    // 10 = duration unit => tone duration is 10ms * tone_tick
+    // 5  = OPCODE_REPEAT
+    // 3  = repeat 3 times sequence between OPCODE_REPEAT and OPCODE_REPEATEND  
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1 = 425Hz
+    // 20 = tone_tick = 200ms
+    // 64-64=0=AUD_TONE_FREQ_OFF
+    // 20 = tone_tick = 200ms
+    // 6  = OPCODE_REPEATEND
+    // 11 = OPCODE_END
+    }
+
+RESOURCE VAR_ARRAY r_net_ring_going
+    {
+    // ETSI spec says 425Hz Tone on 1s, silence 4s
+    // Seems to be so:
+    sequence={0,17,10,2,252,78,100,5,4,64,100,6,7,11};
+    // 0  = OPCODE_SEQUENCE_START
+    // 17 = OPCODE_DURATION_UNIT
+    // 10 = duration unit => tone duration is 10ms * tone_tick
+    // 2  = OPCODE_CONTINUE_MASK (obsolete from DCT4 onwards)
+    // 252 = continue mask value
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1  = 425Hz
+    // 100 = tone_tick = 1000ms
+    // 5 = OPCODE_REPEAT
+    // 4 = repeat 4 times sequence between OPCODE_REPEAT and OPCODE_REPEATEND
+    // 64-64=0=AUD_TONE_FREQ_OFF
+    // 100 = tone_tick = 1000ms
+    // 7 = OPCODE_RESTART
+    // 11 = OPCODE_END
+    }
+
+RESOURCE VAR_ARRAY r_net_call_waiting
+    {
+    // Seems to be so:
+    sequence={0,17,10,78,20,64,60,78,20,64,100,64,100,64,100,78,20,64,60,78,20,11};
+    // 0  = OPCODE_SEQUENCE_START
+    // 17 = OPCODE_DURATION_UNIT
+    // 10 = duration unit => tone duration is 10ms * tone_tick
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1  = 425Hz
+    // 20 = tone_tick = 200ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 60 = tone_tick = 600ms
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1  = 425Hz
+    // 20 = tone_tick = 200ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 100 = tone_tick = 1000ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 100 = tone_tick = 1000ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 100 = tone_tick = 1000ms
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1  = 425Hz
+    // 20 = tone_tick = 200ms
+    // 64-64 = 0 = AUD_TONE_FREQ_OFF     = 0Hz
+    // 60 = tone_tick = 600ms
+    // 78-64=14=AUD_TONE_NETWORK_FREQ_1  = 425Hz
+    // 20 = tone_tick = 200ms
+    // 11 = OPCODE_END
+    }
+
+RESOURCE VAR_ARRAY r_data_call_tone
+    {
+    sequence={0,17,6,2,252,10,8,5,8,84,3,89,3,6,10,247,64,50,7,11};
+    }
+RESOURCE VAR_ARRAY r_no_sound_sequence
+    {
+    sequence={0,17,6,5,252,10,8,64,50,10,247,64,100,06,11};
+    }
+RESOURCE VAR_ARRAY r_beep_sequence
+    {
+    sequence={0,17,6,10,8,115,10,64,40,10,247,5,252,64,100,10,8,64,50,10,247,6,11};
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/eabi/audiohandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+EXPORTS
+	_ZN12CPEAudioData14SetAudioOutputE14TPEAudioOutputi @ 1 NONAME
+	_ZN12CPEAudioData16HandleCallEndingEv @ 2 NONAME
+	_ZN12CPEAudioData16SetAudioMuteSyncEi @ 3 NONAME
+	_ZN12CPEAudioData18HandleCallStartingEi @ 4 NONAME
+	_ZN12CPEAudioData18SetAudioVolumeSyncEi @ 5 NONAME
+	_ZN12CPEAudioData27HandleEnergencyCallStartingEv @ 6 NONAME
+	_ZN12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 7 NONAME
+	_ZN12CPEAudioData7StartUpEv @ 8 NONAME
+	_ZN12CPEAudioDataD0Ev @ 9 NONAME
+	_ZN12CPEAudioDataD1Ev @ 10 NONAME
+	_ZN12CPEAudioDataD2Ev @ 11 NONAME
+	_ZN15CPEAudioFactory23CreateAudioToneUtilityLER21MMdaAudioToneObserver @ 12 NONAME
+	_ZN15CPEAudioFactory28CreateTelephonyAudioRoutingLER30MTelephonyAudioRoutingObserver @ 13 NONAME
+	_ZN15CPEAudioFactory5NewLCEv @ 14 NONAME
+	_ZN15CPEAudioFactoryC1Ev @ 15 NONAME
+	_ZN15CPEAudioFactoryC2Ev @ 16 NONAME
+	_ZN15CPEGsmAudioData14PlayInbandToneEv @ 17 NONAME
+	_ZN15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 18 NONAME
+	_ZN15CPEGsmAudioData16StopDtmfTonePlayEv @ 19 NONAME
+	_ZN15CPEGsmAudioData18StopInbandTonePlayEv @ 20 NONAME
+	_ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFs @ 21 NONAME
+	_ZN15CPEGsmAudioData4NewLER21MPEPhoneModelInternalR3RFsR15CPEAudioFactory @ 22 NONAME
+	_ZN15CPEGsmAudioDataD0Ev @ 23 NONAME
+	_ZN15CPEGsmAudioDataD1Ev @ 24 NONAME
+	_ZN15CPEGsmAudioDataD2Ev @ 25 NONAME
+	_ZNK12CPEAudioData16GetAudioMuteSyncERi @ 26 NONAME
+	_ZNK12CPEAudioData18GetAudioVolumeSyncERi @ 27 NONAME
+	_ZNK15CPEGsmAudioData12PlayDtmfToneERK5TChar @ 28 NONAME
+	_ZTI12CPEAudioData @ 29 NONAME
+	_ZTI15CPEGsmAudioData @ 30 NONAME
+	_ZTI22CPEAudioDtmfTonePlayer @ 31 NONAME
+	_ZTI22CPEAudioRoutingMonitor @ 32 NONAME
+	_ZTI24CPEAudioInbandTonePlayer @ 33 NONAME
+	_ZTI26CPECallAudioRoutingHandler @ 34 NONAME
+	_ZTV12CPEAudioData @ 35 NONAME
+	_ZTV15CPEGsmAudioData @ 36 NONAME
+	_ZTV22CPEAudioDtmfTonePlayer @ 37 NONAME
+	_ZTV22CPEAudioRoutingMonitor @ 38 NONAME
+	_ZTV24CPEAudioInbandTonePlayer @ 39 NONAME
+	_ZTV26CPECallAudioRoutingHandler @ 40 NONAME
+	_ZThn4_N12CPEAudioData14SetAudioOutputE14TPEAudioOutputi @ 41 NONAME
+	_ZThn4_N12CPEAudioData16HandleCallEndingEv @ 42 NONAME
+	_ZThn4_N12CPEAudioData16SetAudioMuteSyncEi @ 43 NONAME
+	_ZThn4_N12CPEAudioData18HandleCallStartingEi @ 44 NONAME
+	_ZThn4_N12CPEAudioData18SetAudioVolumeSyncEi @ 45 NONAME
+	_ZThn4_N12CPEAudioData27HandleEnergencyCallStartingEv @ 46 NONAME
+	_ZThn4_N12CPEAudioData31CallAudioRoutePreferenceChangedEv @ 47 NONAME
+	_ZThn4_N12CPEAudioData7StartUpEv @ 48 NONAME
+	_ZThn4_N15CPEGsmAudioData16StopDtmfTonePlayEv @ 49 NONAME
+	_ZThn4_NK12CPEAudioData16GetAudioMuteSyncERi @ 50 NONAME
+	_ZThn4_NK12CPEAudioData18GetAudioVolumeSyncERi @ 51 NONAME
+	_ZThn68_N15CPEGsmAudioData15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 52 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/group/audiohandling.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for Audio Handling dll
+*
+*/
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET          audiohandling.dll    
+TARGETTYPE      DLL                
+UID             0x1000008D 0x1000A832        
+VENDORID        VID_DEFAULT
+
+CAPABILITY  CAP_GENERAL_DLL
+
+
+#ifndef WINSCW 
+EpocAllowDllData
+#endif
+
+
+//MACRO     UNIT_TESTING    //defined if running T_AudoHandlingMT tests
+SOURCEPATH      ../src
+    
+SOURCE          cpeaudiodata.cpp        
+SOURCE          cpegsmaudiodata.cpp
+SOURCE          cpeaudiodtmftoneplayer.cpp
+SOURCE          cpeaudioinbandtoneplayer.cpp
+SOURCE          cpeaudioroutingmonitor.cpp
+SOURCE          peaudiohandlingpanic.cpp
+SOURCE        cpecallaudioroutinghandler.cpp
+SOURCE          cpeaudiofactory.cpp
+SOURCE        cpeaudiotoneutilityimpl.cpp 
+SOURCE        cpeaudioeffect.cpp
+
+START RESOURCE  ../data/defaultbeep.rss
+TARGETPATH      RESOURCE_FILES_DIR
+HEADER
+END
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../inc       // PhoneEngine private headers
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+SYSTEMINCLUDE   /epoc32/include/mda/client
+SYSTEMINCLUDE   /epoc32/include/mmf/server
+SYSTEMINCLUDE   /epoc32/include/mmf/common
+
+
+MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_GLIB_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/stdapis/stlport
+
+LIBRARY         bafl.lib
+LIBRARY         cce.lib
+LIBRARY         telephonyaudiorouting.lib
+LIBRARY         efsrv.lib
+LIBRARY         engineinfo.lib
+LIBRARY         etel.lib
+LIBRARY         euser.lib 
+LIBRARY         flogger.lib
+LIBRARY         mediaclientaudio.lib
+LIBRARY         mmfdevsound.lib
+
+LIBRARY         tmsfactory.lib
+LIBRARY         tmsapi.lib
+LIBRARY         libglib.lib
+
+LANG            SC
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  AudioHandling bld file
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/cpeaudiodata.h              |../../inc/cpeaudiodata.h
+../inc/cpegsmaudiodata.h           |../../inc/cpegsmaudiodata.h
+../inc/mpeaudiodata.h              |../../inc/mpeaudiodata.h
+../inc/cpeaudiofactory.h           |../../inc/cpeaudiofactory.h
+
+
+// SIS stubs
+../data/audiohandling_stub.sis      /epoc32/data/z/system/install/audiohandling_stub.sis
+
+ 
+PRJ_MMPFILES
+audiohandling.mmp
+
+#endif // RD_PHONE_N
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/audiodataproxy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the class CPEAudioDataProxy.
+*
+*/
+
+
+#ifndef AUDIODATAPROXY_H
+#define AUDIODATAPROXY_H
+
+//  INCLUDES
+#include "mpeaudiodata.h"
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+IMPORT_C MPEAudioData* CreateL( MPEPhoneModelInternal& aPhoneModel, 
+    RMobilePhone& aPhone, RDosServer& aDosServer, RMmCustomAPI& aCustomPhone ); 
+
+// FORWARD DECLARATIONS
+// None.
+
+// CLASS DECLARATION
+// None.
+
+#endif      // AUDIODATAPROXY_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudiodata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,293 @@
+/*
+* Copyright (c) 2002-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:  This file contains the header file of the class CPEAudioData
+*                 which is the interface class for Audio Handling Module
+*
+*/
+
+
+#ifndef CPEAUDIODATA_H
+#define CPEAUDIODATA_H
+
+//  INCLUDES
+#include "mpeaudiodata.h"
+#include <PSVariables.h>
+
+#include <TelephonyAudioRouting.h>
+#include <tmseffect.h>
+#include <tmseffectobsrvr.h>
+
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+using namespace TMS;
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+class CPEAudioDtmfTonePlayer;
+class CPEAudioRoutingMonitor;
+class CPECallAudioRoutingHandler;
+class CPEAudioFactory;
+class CTelephonyAudioRouting;
+class CPEAudioEffect;
+
+// CLASS DECLARATION
+
+/**
+*  This file contains the header file of the class CPEAudioData,
+*  which is an interface class to audio
+*  properties of the system
+*
+*  @lib audiohandling.lib
+*  @since S60_5.0
+*/
+class CPEAudioData : public CBase,
+                     public MPEAudioData,
+                     public TMSEffectObserver
+    {
+
+    public:
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPEAudioData();
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CPEAudioData( MPEPhoneModelInternal& aPhoneModel );
+
+    public: // from MPEAudioData
+
+        /**
+        * Retrieves Audio mute synchronously.
+        * @param  aAudioMute, audio mute is returned in this parameter.
+        */
+        IMPORT_C void GetAudioMuteSync( TBool& aAudioMute ) const;
+
+        /**
+        * Retrieves Audio volume synchronously.
+        * @param  aAudioVolume, audio volume is returned in this parameter.
+        */
+        IMPORT_C void GetAudioVolumeSync( TInt& aAudioVolume ) const;
+
+        /**
+        * Makes synchronous request to set Audio Mute.
+        * @param  aAudioMute, mute to be set.
+        */
+        IMPORT_C void SetAudioMuteSync( const TBool aAudioMute );
+
+        /**
+        * Makes synchronous request to set Audio Volume.
+        * @param  aAudioVolume, volume to be set.
+        */
+        IMPORT_C void SetAudioVolumeSync( const TInt aAudioVolume );
+
+        /**
+        * Makes request to Telephony Audio Routing to set audio output path
+        * @param aOutput, audio output path
+        * @param aShowNote, audio note status
+        * @return KErrNone or possible errorcode.
+        */
+        IMPORT_C TInt SetAudioOutput(
+            const TPEAudioOutput aOutput,
+            TBool aShowNote );
+
+        /**
+        * Gets volume levels, audio mute, audio mode and audio volume
+        * at startup and starts monitors.
+        * @param  None.
+        * @return None.
+        */
+        IMPORT_C void StartUp();
+
+        /**
+        * Handles call audio route preference changed
+        */
+        IMPORT_C TInt CallAudioRoutePreferenceChanged();
+
+        /**
+        * Initialises call audio route when call is alerting or answered
+        */
+        IMPORT_C TInt HandleCallStarting( TBool aVideoCall );
+
+        /**
+        * Initialises energency call audio route
+        */
+        IMPORT_C TInt HandleEnergencyCallStarting();
+
+        /**
+        * Ends call audio route when call disconnected
+        */
+        IMPORT_C void HandleCallEnding();
+
+    public: // new
+
+        /**
+        * Sends AudioHandlingError message to PhoneEngine and saves
+        * errorcode to member variable.
+        * @param  aErrorCode, errorcode that is saved to member variable.
+        * @return None.
+        */
+        void SendErrorMessage( const TInt aErrorCode );
+
+        /**
+        * Forwards message given as parameter to PhoneEngine.
+        * @param  aMessage, message to be forwarded.
+        * @return None.
+        */
+        void SendMessage(
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+
+        /**
+        * Forwards message given as parameter to Phone Engine
+        * @param  aMessage, message to be forwarded.
+        * @param  aOutput, audio output path that is saved in member variable.
+        * @return None.
+        */
+        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+                          const CTelephonyAudioRouting::TAudioOutput aOutput );
+
+        /**
+        * Forwards message given as parameter to Phone Engine
+        * @param  aMessage, message to be forwarded.
+        * @param  aOutput, audio output path that is saved in member variable.
+        * @return None.
+        */
+        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+                          CTelephonyAudioRouting& aTelephonyAudioRouting );
+
+        /**
+        * Sets value of audio routing preference
+        */
+        void SetRoutePreference( TBool aShowNote );
+
+        /**
+        * Return value of audio routing preference
+        */
+        CTelephonyAudioRouting::TAudioOutput RoutePreference();
+
+        /**
+        * Return value of previous output
+        */
+        CTelephonyAudioRouting::TAudioOutput PreviousOutput();
+
+        /**
+        * Return value of current output
+        */
+        CTelephonyAudioRouting::TAudioOutput Output();
+
+        /**
+        * Return status of wired accessory availability
+        */
+        TBool IsWiredAvailable();
+
+        /**
+        * Return status of BT accessory availability
+        */
+        TBool IsBTAvailable();
+
+        /**
+        * Return status of TTY accessory availability
+        */
+        TBool IsTTYAvailable();
+
+        /**
+        * Set new audio route to TAR
+        */
+        void SetTAROutput( CTelephonyAudioRouting::TAudioOutput aOutput,
+                           TBool aShowNote );
+
+        /**
+         * From TMSEffectObserver
+         */
+    void EffectsEvent(const TMSEffect& tmseffect, TMSSignalEvent event);
+
+    protected:
+
+        /**
+        * By default Symbian 2nd phase constructor is private, but we use
+        * it at generalized class.
+        */
+        void ConstructL( CPEAudioFactory& aAudioFactory );
+
+    protected:  // New functions
+
+        /**
+         * Updates volume on DataStore and if aSendMsg==ETrue sends
+         * notification to engine monitor.
+         * @since S60 v5.0
+         * @param aVolume New volume value.
+         * @param aSendMsg ETrue will send notification.
+         */
+        virtual void DoHandleVolumeChange( TInt aVolume, TBool aSendMsg=EFalse );
+
+    private:
+
+        /**
+        * Gets all audio volume value and update member variable
+        */
+        void InitializeAudioVolume();
+
+
+        /**
+        * Makes request to Telephony Audio Routing to get available audio outputs
+        * @return list of available outputs
+        */
+        TArray< TPEAudioOutput> GetAvailableOutputs(
+                CTelephonyAudioRouting& aTelephonyAudioRouting );
+
+        /**
+        * Converts TAR route value to PE value
+        */
+        TPEAudioOutput ConvertToPE( CTelephonyAudioRouting::TAudioOutput aOutput );
+
+        /**
+        * Converts PE route value to TAR value
+        */
+        CTelephonyAudioRouting::TAudioOutput ConvertToTAR( TPEAudioOutput aOutput );
+
+    protected:
+        // CPhoneModel object which owns this object.
+        MPEPhoneModelInternal& iPhoneModel;
+        // Audio Routing Monitor
+        CPEAudioRoutingMonitor* iAudioRoutingMonitor;
+        // Audio Routing Handler
+        CPECallAudioRoutingHandler* iAudioRoutingHandler;
+        // Telephony Audio Routing interface
+        CTelephonyAudioRouting* iAudioRouting;
+        // Available Audio Outputs
+        RArray<TPEAudioOutput> iPEavailableOutputs;
+        //Flag to indicate whether is Call audio route initialized
+        TBool iRouteInitialized;
+
+        CPEAudioEffect* iAudioEffect;
+     };
+
+#endif      // CPEAUDIODATA_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudiodtmftoneplayer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the class CPEAudioDtmfTonePlayer, 
+*                that plays DTMF tones using media server.
+*
+*/
+
+
+#ifndef CPEAUDIODTMFTONEPLAYER_H
+#define CPEAUDIODTMFTONEPLAYER_H
+
+// INCLUDES
+#include    <e32base.h>
+#include    <sounddevice.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CMMFDevSound;
+
+// CLASS DECLARATION
+
+/**
+*  plays DTMF tones using media server
+*
+*  @lib audiohandling.lib
+*  @since Series60_2.7
+*/
+class CPEAudioDtmfTonePlayer 
+    : public CBase, 
+      public MDevSoundObserver
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPEAudioDtmfTonePlayer* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPEAudioDtmfTonePlayer();
+
+    public:
+
+        /**
+        * Sets volume.
+        * @since Series60_2.7
+        * @param aVolume volume value or KDtmfSilent.
+        * @return None.
+        */
+        void SetVolume( TInt aVolume );
+
+        /**
+        * Starts playing given dtmf tone infinitely.
+        * @since Series60_2.7
+        * @param aTone Tone to be played.
+        * @return None.
+        */
+        void PlayDtmfTone( TChar aTone );
+
+        /**
+        * Cancels playing.
+        * @since Series60_2.7
+        * @param None.
+        * @return None.
+        */
+        void Cancel();
+        
+    public: //From MDevSoundObserver
+          /**
+          * See MDevSoundObserver
+          */
+           void InitializeComplete( TInt aError );
+
+          /**
+          * See MDevSoundObserver
+          */
+           void ToneFinished( TInt aError );
+
+          /**
+          * See MDevSoundObserver
+          */
+           void BufferToBeFilled( CMMFBuffer* aBuffer );
+
+          /**
+          * See MDevSoundObserver
+          */
+           void PlayError( TInt aError );
+
+          /**
+          * See MDevSoundObserver
+          */
+           void BufferToBeEmptied( CMMFBuffer* aBuffer );
+
+          /**
+          * See MDevSoundObserver
+          */
+           void RecordError( TInt aError );
+
+          /**
+          * See MDevSoundObserver
+          */
+           void ConvertError( TInt aError );
+          /**
+          * See MDevSoundObserver
+          */       
+          void DeviceMessage( TUid aMessageType, const TDesC8& aMsg );   
+          
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CPEAudioDtmfTonePlayer();
+
+        void ConstructL();
+
+
+        /**
+        * Normalize tone.
+        * @since Series60_2.7
+        * @param aTone dtmf tone.
+        * @return None.
+        */
+        void Normalize( TChar& aTone );
+
+  
+        
+    private: //new functions
+        
+        /**
+         * Converts the given value to the one that matches tha range used by 
+         * CMMFDevSound. The CMMFDevSound uses valuess that can from 0 to the
+         * value returned by a call to CMMFDevSound::MaxVolume().
+         */
+        TInt ConvertVolume( TInt aVolume );
+    
+    protected:    // Data
+
+        // Current volume setting.
+        TInt iVolume;
+        
+        // DTMF player instance
+        CMMFDevSound*        iDTMFPlayer;
+
+    };
+
+#endif      // CPEAUDIODTMFTONEPLAYER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudioeffect.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,93 @@
+/*
+ * 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: Audio Effects handler
+ *
+ */
+
+#ifndef CPEAUDIOEFFECT_H
+#define CPEAUDIOEFFECT_H
+
+#include <e32base.h>
+#include <tmseffectobsrvr.h>
+
+namespace TMS {
+//FORWARD DECLARATIONS
+class TMSFactory;
+} //namespace TMS
+
+using namespace TMS;
+
+/**
+ *  Starts and stops TMS audio streams.
+ *  If the activation fails then there is a retry timer which
+ *  will try the activation later.
+ */
+NONSHARABLE_CLASS(CPEAudioEffect) : public CBase
+    {
+public:
+
+    /**
+     * Two-phased constructing.
+     */
+    static CPEAudioEffect* NewL(TMSEffectObserver& aObserver);
+
+    /**
+     * Two-phased constructing.
+     */
+    static CPEAudioEffect* NewLC(TMSEffectObserver& aObserver);
+
+    /**
+     * C++ default destructor.
+     */
+    virtual ~CPEAudioEffect();
+
+    /**
+     * Set muted.
+     */
+    TInt SetMuteState(TBool aMute);
+    /**
+     * Get mute.
+     */
+    TBool MuteState() const;
+
+    /**
+     * Set volume.
+     */
+    void SetVolume(TInt aVolume);
+
+    /**
+     * Get volume.
+     */
+    TInt Volume() const;
+
+public:
+    // Functions from base classes
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    CPEAudioEffect();
+
+    void ConstructL(TMSEffectObserver& aObserver);
+
+private:
+    // data
+    TMSFactory* iFactory;
+    TMSEffect* iGlobalVol;
+    TMSEffect* iGlobalGain;
+    };
+
+#endif // CPEAUDIOEFFECT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudiofactory.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the class CPEAudioFactory 
+*                which is used to create CTelephonyAudioRouting
+*
+*/
+
+
+#ifndef CPEAUDIOFACTORY_H
+#define CPEAUDIOFACTORY_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CTelephonyAudioRouting;
+class MTelephonyAudioRoutingObserver;
+class CPEAudioToneUtility;
+class MMdaAudioToneObserver;
+
+
+// CLASS DECLARATION
+
+/**
+*  This file contains the header file of the class CPEAudioFactory, 
+*  which is used to create CTelephonyAudioRouting
+*
+*  @lib audiohandling.lib
+*  @since Series60_5.0
+*/  
+
+NONSHARABLE_CLASS( CPEAudioFactory ) : public CBase
+    {
+    public: 
+        
+        IMPORT_C static CPEAudioFactory* NewLC();
+                
+       
+        /**
+        * creates CTelephonyAudioRouting.
+        * @since S60 v5.0
+        * @param  aAudioRoutingObserver, needed when creating CTelephonyAudioRouting.
+        */
+        IMPORT_C virtual CTelephonyAudioRouting* CreateTelephonyAudioRoutingL( 
+            MTelephonyAudioRoutingObserver& aAudioRoutingObserver );
+        
+        /**
+         * Creates CPEAudioToneUtility.
+         * @since S60 v5.0
+         * @param aToneObserver Observer of the CMdaAudioToneUtility
+         */
+        IMPORT_C virtual CPEAudioToneUtility* CreateAudioToneUtilityL(
+            MMdaAudioToneObserver& aToneObserver );
+    
+protected:
+        IMPORT_C CPEAudioFactory();
+    };    
+         
+#endif      // CPEAudioFactory_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudioinbandtoneplayer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the class CPEAudioInbandTonePlayer, that plays DTMF tones 
+*                using media server
+*
+*/
+
+
+#ifndef CPEAUDIOINBANDTONEPLAYER_H
+#define CPEAUDIOINBANDTONEPLAYER_H
+
+// INCLUDES
+#include <pevirtualengine.h>
+#include <e32base.h>
+#include <mdaaudiotoneplayer.h>
+#include <ccpdefs.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPEAudioToneUtility;
+class CPEAudioData;
+class CPEAudioFactory;
+
+// CLASS DECLARATION
+
+/**
+*  This class is used to play inband tones using media server.
+*
+*  @lib audiohandling.lib
+*  @since Series60_5.0
+*/
+class CPEAudioInbandTonePlayer 
+    : public CBase, 
+      private MMdaAudioToneObserver
+    {
+    public:  // Constructors and destructor      
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPEAudioInbandTonePlayer* NewL( 
+            CPEAudioData& aOwner, 
+            RFs& aFsSession,
+            CPEAudioFactory& aFactory );
+        
+        /**
+        * Destructor.
+        */
+        ~CPEAudioInbandTonePlayer();
+
+        /**
+        * Plays given tone. Originates from CCP plugin.
+        * @param aTone inband tone needed to play
+        */
+        void PlayInbandTone( TCCPTone aTone );
+
+        /**
+        * Cancels playing.
+        */
+        void Cancel();
+
+        /**
+         * Sets volume.
+         * @since    S60 5.0
+         * @param    aVolume     Volume in 0...10 scale.
+         */
+        void SetVolume( TInt aVolume );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPEAudioInbandTonePlayer( 
+            CPEAudioData& aOwner, 
+            RFs& aFsSession );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( CPEAudioFactory& aFactory );
+
+        /**
+        * Playes current tone.
+        * @since Series60_2.7
+        * @param None.
+        * @return None.
+        */
+        void PlayCurrentTone();
+
+        //From MMdaAudioToneObserver
+        /**
+        * Handles completion of preparation.
+        * @since Series60_2.7
+        * @param aError Isn't used.
+        * @return None.
+        */
+        void MatoPrepareComplete( TInt aError );
+
+        //From MMdaAudioToneObserver
+        /**
+        * Handles completion of playing.
+        * @since Series60_2.7
+        * @param aError Isn't used.
+        * @return None.
+        */
+        void MatoPlayComplete( TInt aError );
+        
+        /**
+         * Calculates media server volume level.
+         * @since   Series S60 5.1
+         * @param   aVolume     Volume level in 0...10 scale.
+         * @return  Volume level in media server scale.
+         */
+        TInt CalculateMediaServerVolume( TInt aVolume ) const;
+        
+        /**
+         * Updates tone player's volume to the current audio volume level.
+         * @since   Series S60 5.1
+         */
+        void UpdateTonePlayerVolume();
+        
+    private:    // Data
+
+        // Currently playing, NULL or tone sequence.
+        CPEAudioToneUtility* iCurrent;
+        //Member variable for inband tone
+        TCCPTone iToneName;
+        // Owner of this object
+        CPEAudioData& iOwner;
+        // Current volume setting.
+        //NetworkBusy sequence
+        HBufC8* iResourceBusySeq;
+        //NetworkBusy sequence
+        HBufC8* iResourceReorderSeq;
+        //NetworkBusy sequence
+        HBufC8* iResourceCongestionSeq;
+        //NetworkBusy sequence
+        HBufC8* iResourceSpecialSeq;
+        //NetworkBusy sequence
+        HBufC8* iResourceRadioPathSeq;
+        //NetworkBusy sequence
+        HBufC8* iResourceRingGoingSeq;
+        //CallWaiting sequence
+        HBufC8* iResourceCallWaitingSeq;
+        //Ringing type
+        TProfileRingingType iRingingType;
+        //Data call tone sequence
+        HBufC8* iPlayDataSequence;
+        //Data call silent sequence
+        HBufC8* iPlayNoSoundSequence;
+        //Data call beep sequence
+        HBufC8* iPlayBeepSequence;
+        //Handle to a file server session
+        RFs& iFsSession;
+
+    };
+
+#endif      // CPEAUDIOINBANDTONEPLAYER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudioroutingmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEAudioRoutingMonitor class.
+*
+*/
+
+
+#ifndef CPEAUDIOROUTINGMONITOR_H
+#define CPEAUDIOROUTINGMONITOR_H
+
+// INCLUDES
+#include <MTelephonyAudioRoutingObserver.h>
+
+// FORWARD DECLARATIONS
+class CPEAudioData;
+class CTelephonyAudioRouting;
+
+// CLASS DECLARATION
+
+/**
+*  Monitors audio path selection
+*
+*  @lib audiohandling.lib
+*  @since Series60_4.0
+*/  
+class CPEAudioRoutingMonitor : public CBase, 
+                               public MTelephonyAudioRoutingObserver
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPEAudioRoutingMonitor* NewL( CPEAudioData& aOwner );
+        
+        /**
+        * Destructor.
+        */
+        ~CPEAudioRoutingMonitor();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPEAudioRoutingMonitor( CPEAudioData& aOwner );
+
+    public: // Methods from MTelephonyAudioRoutingObserver
+
+        /**
+        * Available audio outputs have changed.
+        * @since Series 60 3.0
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        void AvailableOutputsChanged( 
+            CTelephonyAudioRouting& aTelephonyAudioRouting );
+        
+        /**
+        * Current output has changed.
+        * @since Series 60 3.0
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        void OutputChanged( CTelephonyAudioRouting& aTelephonyAudioRouting );
+        
+        /**
+        * Completion message for SetOutput request.
+        * @since Series 60 3.0
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        void SetOutputComplete( CTelephonyAudioRouting& aTelephonyAudioRouting, 
+                                TInt aError );
+                       
+    private: 
+    
+        // Owner of this object
+        CPEAudioData& iOwner;
+    };
+
+#endif // CPEAUDIOROUTINGMONITOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudiotoneutility.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for playing audio tones.
+*
+*/
+
+
+#ifndef CPEAUDIOTONEUTILITY_H
+#define CPEAUDIOTONEUTILITY_H
+
+#include <e32base.h>
+#include <mdaaudiotoneplayer.h>
+
+/**
+ *  Interface to wrap CMdaAudioToneUtility.
+ *  
+ *  @lib AudioHandling
+ *  @since S60 5.0
+ */
+class CPEAudioToneUtility : public CBase
+    {
+
+public:
+    /**
+     * See CMdaAudioToneUtility::PrepareToPlayDesSequence.
+     */
+    virtual void PrepareToPlayDesSequence( 
+        const TDesC8& aSequence ) = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::State.
+     */
+    virtual TMdaAudioToneUtilityState State() = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::CancelPlay.
+     */
+    virtual void CancelPlay() = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::MaxVolume.
+     */
+    virtual TInt MaxVolume() = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::SetVolume.
+     */
+    virtual void SetVolume( TInt aVolume ) = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::SetRepeats.
+     */
+    virtual void SetRepeats(
+        TInt aRepeatNumberOfTimes, 
+        const TTimeIntervalMicroSeconds& aTrailingSilence ) = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::SetPriority.
+     */    
+    virtual void SetPriority(
+        TInt aPriority, 
+        TMdaPriorityPreference aPref) = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::SetVolumeRamp.
+     */ 
+    virtual void SetVolumeRamp( 
+        const TTimeIntervalMicroSeconds& aRampDuration) = 0;
+    
+    /**
+     * See CMdaAudioToneUtility::SetVolumeRamp.
+     */
+    virtual void Play() = 0;
+
+    /**
+     * See CMdaAudioToneUtility::CancelPrepare.
+     */
+    virtual void CancelPrepare() = 0;
+
+    };
+    
+#endif // CPEAUDIOTONEUTILITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpeaudiotoneutilityimpl.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements CPEAudioToneUtility interface
+*
+*/
+
+#ifndef CPEAUDIOTONEUTILITYIMPL_H
+#define CPEAUDIOTONEUTILITYIMPL_H
+
+#include <e32base.h>
+
+#include "cpeaudiotoneutility.h"
+
+class MMdaAudioToneObserver;
+class CMdaAudioToneUtility;
+
+/**
+ *  Wraps CMdaAudioToneUtility.
+ *  To ease module testing.
+ *
+ *  @lib AudioHandling
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CPEAudioToneUtilityImpl ) : public CPEAudioToneUtility
+    {
+public:
+
+    static CPEAudioToneUtilityImpl* NewL(
+        MMdaAudioToneObserver& aToneObserver );  
+
+    /**
+    * Destructor.
+    */
+    virtual ~CPEAudioToneUtilityImpl();
+
+// from base class CPEAudioToneUtility
+
+    /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    void PrepareToPlayDesSequence( const TDesC8& aSequence );
+    
+    /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    TMdaAudioToneUtilityState State();
+    
+    /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    void CancelPlay();
+     
+     /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    TInt MaxVolume();
+    
+     /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    void SetVolume( TInt aVolume );
+     
+     /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    void SetRepeats(
+        TInt aRepeatNumberOfTimes, 
+        const TTimeIntervalMicroSeconds& aTrailingSilence );
+        
+    /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    void SetPriority(
+        TInt aPriority, 
+        TMdaPriorityPreference aPref);
+    
+    /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    void SetVolumeRamp( 
+        const TTimeIntervalMicroSeconds& aRampDuration );
+    
+    /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     *
+     * @since S60 5.0
+     */
+    void Play();
+    
+    /**
+     * From CPEAudioToneUtility
+     * @see CMdaAudioToneUtility
+     */
+    void CancelPrepare();
+    
+private:
+
+    CPEAudioToneUtilityImpl();
+
+    void ConstructL( MMdaAudioToneObserver& aToneObserver );
+
+private: // data
+
+    /**
+     * Own.
+     * For playing tones.
+     */
+    CMdaAudioToneUtility* iToneUtility;
+
+    };
+
+#endif // CPEAUDIOTONEUTILITYIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpecallaudioroutinghandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPECallAudioRoutingHandler class.
+*
+*/
+
+
+#ifndef CPECALLAUDIOROUTINGHANDLER_H
+#define CPECALLAUDIOROUTINGHANDLER_H
+
+// INCLUDES
+#include <e32base.h>
+ 
+// FORWARD DECLARATIONS
+class CPEAudioData;
+class CTelephonyAudioRouting;
+
+// CLASS DECLARATION
+
+/**
+*  Monitors audio path selection
+*
+*  @lib audiohandling.lib
+*  @since Series60_4.0
+*/  
+class CPECallAudioRoutingHandler : public CBase 
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPECallAudioRoutingHandler* NewL( CPEAudioData& aOwner );
+        
+        /**
+        * Destructor.
+        */
+        ~CPECallAudioRoutingHandler();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPECallAudioRoutingHandler( CPEAudioData& aOwner );
+
+    public:
+    
+        /**
+        * Audio output is set.
+        * @since Series 60 3.0
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        TInt HandleAudioRoutingCallInit( TBool aVideoCall );
+        /**
+        * Available audio outputs have changed.
+        * @since Series 60 3.0
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        TInt HandleAudioRoutingAvailableChanged();
+        
+        /**
+        * Audio route preference value have changed.
+        * @since Series 60 3.0
+        * @param ?arg1 ?description
+        * @return ?description
+        */        
+        TInt HandleAudioRoutePreferenceChanged();
+        
+        /**
+        * Answer to handset operation status is updated.
+        * @since Series 60 3.0
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        void SetAnswerToHandset( TBool aStatus );
+        
+    private: 
+    
+        // Owner of this object
+        CPEAudioData& iOwner;
+        
+        // AnswerToHandset
+        TBool iAnswerToHandset;
+        
+        // Video call status
+        TBool iAnyVideoCall;
+    };
+
+#endif // CPECALLAUDIOROUTINGHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cpegsmaudiodata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the class CPEGsmAudioDatar, 
+*                which is an GSM specific interface class to audio properties of the system
+*
+*/
+
+
+#ifndef CPEGSMAUDIODATA_H
+#define CPEGSMAUDIODATA_H
+
+//  INCLUDES
+#include "cpeaudiodata.h"
+#include <pevirtualengine.h>
+#include <e32base.h>
+#include <mccedtmfobserver.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+
+// DATA TYPES
+// None.
+
+
+// FUNCTION PROTOTYPES
+// None.
+
+
+// FORWARD DECLARATIONS
+class CPEAudioInbandTonePlayer;
+class CPEAudioFactory;
+class MPEClientInformation;
+
+// CLASS DECLARATION
+
+/**
+*  This file contains the header file of the class CPEGsmAudioData, 
+*
+*  @lib Audiohandling.lib
+*  @since Series60_2.7
+*/
+class CPEGsmAudioData : public CPEAudioData,
+                        public MCCEDtmfObserver
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPEGsmAudioData* NewL( MPEPhoneModelInternal& aPhoneModel,
+                                               RFs& aFsSession );                                  
+           
+                                               
+        /**
+        * Two-phased constructor for testing purposes
+        */        
+        IMPORT_C static CPEGsmAudioData* NewL( MPEPhoneModelInternal& aPhoneModel,
+                                               RFs& aFsSession,
+                                               CPEAudioFactory& aAudioFactory );                          
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPEGsmAudioData();
+        
+    public: // From MCCEDtmfObserver
+                                       
+        /**
+        * All the occurred DTMF events are notified through this interface
+        *
+        * @since S60 3.2
+        * @param aEvent Event code
+        * @param aError Error code
+        * @param aTone tone 
+        * @return none
+        */
+        IMPORT_C void HandleDTMFEvent( const MCCEDtmfObserver::TCCEDtmfEvent aEvent, 
+                                       const TInt aError, 
+                                       const TChar aTone );
+
+    public: // New functions
+
+        /**
+        * Plays the given dtmf tone
+        * @since Series60_2.7
+        * @param  aTone, dtmf tone to be played
+        * @param  aVolume, dtmf tones volume
+        * @return None.  
+        */
+        IMPORT_C void PlayDtmfTone( const TChar& aTone ) const; 
+
+        /**
+        * Stops the playing of dtmf tone
+        * @since Series60_2.7
+        * @param  None.
+        * @return None.  
+        */
+        IMPORT_C void StopDtmfTonePlay(); 
+
+        /**
+        * Plays given tone.
+        * @since Series60_2.7
+        * @param aToneName Tone sequence's name to be played.
+        * @return None.
+        */
+        IMPORT_C void PlayInbandTone();
+
+        /**
+        * Stops the playing of inband tone
+        * @since Series60_2.7
+        * @param  None.
+        * @return None.  
+        */
+        IMPORT_C void StopInbandTonePlay(); 
+
+    protected:  // From CPEAudioData
+        
+        void DoHandleVolumeChange( TInt aVolume, TBool aSendMsg=EFalse );
+    
+    private:
+        /**
+        * C++ default constructor.
+        */
+        CPEGsmAudioData( MPEPhoneModelInternal& aPhoneModel,
+                         RFs& aFsSession );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(CPEAudioFactory& aAudioFactory);
+
+        /**
+        * Checks if a DTMF tone may be played locally
+        * The check is performed to prevent local play of dtmf tones sent by SAT application
+        * during a SAT originated call
+        *
+        * @return ETrue: local play is allowed,
+        *         EFalse: local play is not allowed
+        */
+        TBool DtmfLocalPlayAllowed() const;
+
+    private:    //Data
+    
+        // CPEAudioDtmfTonePlayer is called to play the dtmf tones
+        CPEAudioDtmfTonePlayer* iDtmfTonePlayer;
+        // CPEAudioInbandTonePlayer is called to play the inband tones
+        CPEAudioInbandTonePlayer* iInbandTonePlayer;
+        // handle to a file server session
+        RFs& iFsSession;
+
+    };
+
+#endif      //CPEGSMAUDIODATA_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/cperingingtonedefinition.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the definition file for the hard coded beeb sound for the class CPERingingTonePlayer. 
+*                Beeb sound is played when no file based sounds can be played.
+*
+*/
+
+
+#ifndef CPERINGINGTONEDEFINITION_H
+#define CPERINGINGTONEDEFINITION_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// CLASS DECLARATION
+
+/**
+*
+*  @lib audiohandling.lib
+*  @since Series60_2.7
+*/
+class TLitPtrC8
+    {
+public:
+    inline const TDesC8* operator&() const;
+    inline operator const TDesC8&() const;
+    inline const TDesC8& operator()() const;
+    inline operator const __TRefDesC8() const;
+public:
+    TUint iTypeLength;
+    const TUint8 *iPtr;
+    };
+
+// Template class TLitC8
+inline const TDesC8* TLitPtrC8::operator&() const
+    {
+    return REINTERPRET_CAST(const TDesC8*,this);
+    }
+inline const TDesC8& TLitPtrC8::operator()() const
+    {
+    return *operator&();
+    }
+inline TLitPtrC8::operator const TDesC8&() const
+    {
+    return *operator&();
+    }
+inline TLitPtrC8::operator const __TRefDesC8() const
+    {
+    return *operator&();
+    }
+
+#define _LIT8DATA( name, data ) const static TLitPtrC8 name = { ( sizeof( data ) | ( 1 << 28 ) ), REINTERPRET_CAST( const TUint8*, data ) }
+
+// Signature definitions
+#define SEQ_SIG1 0x5153
+#define SEQ_SIG2 0x434E    
+#define SEQ_SIG    SEQ_SIG1,SEQ_SIG2, // Signature = "SQNC" ASCII
+
+// Commands
+#define SEQ_CMD_RET         -1
+#define SEQ_CMD_STARTLOOP   -2,
+#define SEQ_CMD_ENDLOOP     -3,
+
+#endif //CPERINGINGTONEDEFINITION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/defaultbeep.rh	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  None.
+*
+*/
+
+
+// Note frequencies
+#define SEQ_FREQ_A0      440
+#define SEQ_FREQ_AsBf0   466  // 466.1637615 A#, Bb
+#define SEQ_FREQ_B0      494  // 493.8833013
+#define SEQ_FREQ_C0      523  // 523.2511306
+#define SEQ_FREQ_CsDf0   554  // 554.365262 C#, Db, etc.
+#define SEQ_FREQ_D0      587  // 587.3295358
+#define SEQ_FREQ_DsEf0   622  // 622.2539674
+#define SEQ_FREQ_E0      659  // 659.2551138
+#define SEQ_FREQ_F0      698  // 698.4564629
+#define SEQ_FREQ_FsGf0   740  // 739.9888454
+#define SEQ_FREQ_G0      784  // 783.990872
+#define SEQ_FREQ_GsAf0   831  // 830.6093952
+#define SEQ_FREQ_A1      880
+#define SEQ_FREQ_AsBf1   932  // 932.327523
+#define SEQ_FREQ_B1      988  // 987.7666025
+#define SEQ_FREQ_C1      1047 // 1046.502261
+#define SEQ_FREQ_CsDf1   1109 // 1108.730524
+#define SEQ_FREQ_D1      1175 // 1174.659072
+#define SEQ_FREQ_DsEf1   1245 // 1244.507935
+#define SEQ_FREQ_E1      1319 // 1318.510228
+#define SEQ_FREQ_F1      1397 // 1396.912926
+#define SEQ_FREQ_FsGf1   1480 // 1479.977691
+#define SEQ_FREQ_G1      1568 // 1567.981744
+#define SEQ_FREQ_GsAf1   1661 // 1661.21879
+#define SEQ_FREQ_A2      1760
+#define SEQ_FREQ_AsBf2   1865 // 1864.655046
+#define SEQ_FREQ_B2      1976 // 1975.533205
+#define SEQ_FREQ_C2      2093 // 2093.004522
+#define SEQ_FREQ_CsDf2   2217 // 2217.461048
+#define SEQ_FREQ_D2      2349 // 2349.318143
+#define SEQ_FREQ_DsEf2   2489 // 2489.01587
+#define SEQ_FREQ_E2      2673 // 2637.020455
+#define SEQ_FREQ_F2      2794 // 2793.825851
+#define SEQ_FREQ_FsGf2   2960 // 2959.955382
+#define SEQ_FREQ_G2      3136 // 3135.963488
+#define SEQ_FREQ_GsAf2   3322 // 3322.437581
+#define SEQ_FREQ_A3      3520
+#define SEQ_FREQ_AsBf3   3729 // 3729.310092
+
+// Volume defines
+#define SEQ_VOL_F        32767 // Forte = Loud
+#define SEQ_VOL_MF       24575 // Mezzo forte = Medium loud
+#define SEQ_VOL_MP       16383 // Mezzo piano = Medium soft
+#define SEQ_VOL_P         8191 // Piano = Soft
+
+
+STRUCT SEQ_2TONES
+{
+    WORD duration;
+    WORD freq1;
+    WORD vol1;
+    WORD freq2;
+    WORD vol2;
+}
+
+STRUCT SEQ_LOOP
+{
+    WORD repeats;
+    STRUCT tones[];
+}
+
+
+#define SEQ_DATA(A) SEQ_SIG A SEQ_CMD_RET
+#define SEQ_VAL(N) N,
+#define SEQ_LOOP(NUMBEROFTIMES,DATA) SEQ_CMD_STARTLOOP SEQ_VAL(NUMBEROFTIMES) DATA SEQ_CMD_ENDLOOP
+#define SEQ_TONE(DUR,F1,V1) SEQ_VAL(DUR) SEQ_VAL(F1) SEQ_VAL(V1) SEQ_VAL(0) SEQ_VAL(0)
+#define SEQ_2TONES(DUR,F1,V1,F2,V2) SEQ_VAL(DUR) SEQ_VAL(F1) SEQ_VAL(V1) SEQ_VAL(F2) SEQ_VAL(V2)
+#define SEQ_SILENCE(DUR) SEQ_VAL(DUR) SEQ_VAL(0) SEQ_VAL(0) SEQ_VAL(0) SEQ_VAL(0)
+
+// DUR = number samples@8kHz hence 8000 = 1 second
+// F1/F2 = frequency in Hz - can use note definitions above
+// V1/V1 = volume in range 0-32767 - can use volume definitions above
+// When playing two tones, sum of volumes should not be greater than 32767
+// e.g. can use MF+P or MP+MP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/inc/mpeaudiodata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2002-2004,2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class for Audiohandling
+*
+*/
+
+
+#ifndef MPEAUDIODATA_H
+#define MPEAUDIODATA_H
+
+//  INCLUDES
+#include <pevirtualengine.h>
+#include <e32base.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// CLASS DECLARATION
+/**
+*  Interface class for audiohandling
+*  
+*  @lib audiohandling.lib
+*  @since S60_5.0
+*/
+class MPEAudioData 
+    {
+    public: // New functions
+        
+        /**
+        * Retrieves Audio mute synchronously.
+        * @param  aAudioMute, audio mute is returned in this parameter.
+        */
+        virtual void GetAudioMuteSync( TBool& aAudioMute ) const = 0;
+
+        /**
+        * Retrieves Audio volume synchronously.
+        * @param  aAudioVolume, audio volume is returned in this parameter.
+        */
+        virtual void GetAudioVolumeSync( TInt& aAudioVolume ) const = 0;
+      
+        /**
+        * Handles call audio route preference changed
+        */
+        virtual TInt CallAudioRoutePreferenceChanged() = 0;
+ 
+        /**
+        * Stops the playing of dtmf tone
+        */
+        virtual void StopDtmfTonePlay() = 0; 
+
+        /**
+        * Makes synchronous request to set Audio Mute.
+        * @param  aAudioMute, mute to be set.
+        */
+        virtual void SetAudioMuteSync( const TBool aAudioMute ) = 0;
+
+        /**
+        * Makes synchronous request to set Audio Volume.
+        * @param  aAudioVolume, volume to be set.
+        */
+        virtual void SetAudioVolumeSync( const TInt aAudioVolume ) = 0;
+        
+        /**
+        * Makes request to Telephony Audio Routing to set audio output path
+        * @param aOutput, audio output path
+        * @param aShowNote, Show note status
+        * @return KErrNone or possible errorcode.
+        */
+        virtual TInt SetAudioOutput( const TPEAudioOutput aAudioMute,
+                                     TBool aShowNote ) = 0;
+        
+         /**
+        * Gets volume levels at startup.
+        */
+        virtual void StartUp() = 0;
+        
+        /**
+        * Initialises call audio route when call is alerting or answered
+        */
+        virtual TInt HandleCallStarting( TBool aVideoCall ) = 0;
+        
+        /**
+        * Initialises energency call audio route
+        */
+        virtual TInt HandleEnergencyCallStarting() = 0;
+        
+        /**
+        * Ends call audio route when call disconnected
+        */
+        virtual void HandleCallEnding() = 0;
+
+    };
+
+#endif    // MPEAUDIODATA_H     
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudiodata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,697 @@
+/*
+ * Copyright (c) 2002-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: This module contains the implementation of AudioData class
+ *              member functions
+ *
+ */
+
+// INCLUDE FILES
+#include "cpeaudiodata.h"
+
+#include <AudioPreference.h>
+#include <mpephonemodelinternal.h>
+#include <mpedatastore.h>
+#include <mpeexternaldatahandler.h>
+#include <talogger.h>
+#include <telmicmutestatuspskeys.h>
+#include <PSVariables.h>
+#include <tms.h>
+#include <tmseffectobsrvr.h>
+#include <tmsglobalvoleffect.h>
+#include "pepanic.pan"
+#include "cpeaudiodtmftoneplayer.h"
+#include "cpeaudioroutingmonitor.h"
+#include "cpecallaudioroutinghandler.h"
+#include "cpeaudiofactory.h"
+#include "cpeaudioeffect.h"
+
+#include <telinternalpskeys.h>
+
+// CONSTANTS
+//Mute Value for volume
+const TInt KPEMaxVolume = 10;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::CPEAudioData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEAudioData::CPEAudioData(MPEPhoneModelInternal& aPhoneModel) :
+    iPhoneModel(aPhoneModel)
+    {
+    iRouteInitialized = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::ConstructL
+// Symbian 2nd phase constructor can leave
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::ConstructL(CPEAudioFactory& aAudioFactory)
+    {
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioData::ConstructL start" );
+    iAudioRoutingMonitor = CPEAudioRoutingMonitor::NewL(*this);
+    iAudioRouting = aAudioFactory.CreateTelephonyAudioRoutingL(
+            *iAudioRoutingMonitor);
+    iAudioRoutingHandler = CPECallAudioRoutingHandler::NewL(*this);
+    iAudioEffect = CPEAudioEffect::NewL(*this);
+
+    InitializeAudioVolume();
+
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioData::ConstructL  complete" );
+    }
+
+// Destructor
+EXPORT_C CPEAudioData::~CPEAudioData()
+    {
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioData::~CPEAudioData" );
+
+    delete iAudioRouting;
+    delete iAudioRoutingMonitor;
+    delete iAudioRoutingHandler;
+
+    iPEavailableOutputs.Close();
+
+    delete iAudioEffect;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::InitializeAudioVolume
+// Gets audio volume value
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::InitializeAudioVolume()
+    {
+    TInt volume = iAudioEffect->Volume();
+    iPhoneModel.DataStore()->SetAudioVolume(volume);
+
+    TEFLOGSTRING2( KTAINT,
+            "AUD CPEAudioData::InitializeAudioVolumes, volume = %d",
+            volume );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::GetAudioMuteSync
+// Creates synchronous request to get Audio Mute value.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::GetAudioMuteSync(TBool& aAudioMute) const
+    {
+    aAudioMute = iAudioEffect->MuteState();
+    TEFLOGSTRING2(
+            KTAREQIN,
+            "AUD CPEAudioData::GetAudioMuteSync: value = %d",
+            aAudioMute);
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::GetAudioVolumeSync
+// Creates synchronous request to get audio volume.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::GetAudioVolumeSync(TInt& aAudioVolume) const
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioData::GetAudioVolumeSync" );
+    aAudioVolume = iAudioEffect->Volume();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SendErrorMessage
+// Saves errorcode to member variable and sends error notification to PhoneEngine.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::SendErrorMessage(const TInt aErrorCode)
+    {
+    iPhoneModel.DataStore()->SetErrorCode(aErrorCode);
+    TEFLOGSTRING(
+            KTAREQOUT,
+            "AUD CPEAudioData::SendErrorMessage: iPhoneModel.SendMessage( MEngineMonitor::EPEMessageAudioHandlingError )" );
+    iPhoneModel.SendMessage(MEngineMonitor::EPEMessageAudioHandlingError);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SendMessage
+// Forwards message to PhoneEngine.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::SendMessage(
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage)
+    {
+    TEFLOGSTRING2( KTAREQIN,
+            "AUD CPEAudioData::SendMessage: aMessage = %d", aMessage );
+
+    if (aMessage == MEngineMonitor::EPEMessageAudioVolumeChanged)
+        {
+        // update volume
+        TInt volume = iPhoneModel.DataStore()->AudioVolume();
+        TEFLOGSTRING2( KTAINT,
+                "AUD CPEAudioData::SendMessage: volume = %d",
+                volume );
+        }
+
+    iPhoneModel.SendMessage(aMessage);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SendMessage
+// Forwards message to PhoneEngine. Output mode is saved.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::SendMessage(
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        const CTelephonyAudioRouting::TAudioOutput aOutput)
+    {
+    TEFLOGSTRING3(
+            KTAREQIN,
+            "AUD CPEAudioData::SendMessage: aMessage = %d, aOutput = %d",
+            aMessage, aOutput );
+
+    // BT long key press requires manual re-route to handset or loudspeaker
+    if (aOutput == CTelephonyAudioRouting::ENone
+            && iAudioRouting->PreviousOutput()
+                    == CTelephonyAudioRouting::EBTAudioAccessory)
+        {
+        SetRoutePreference(ETrue);
+        }
+    else
+        {
+        // update the audio values in engineinfo
+        TBool status;
+        iAudioRouting->GetShowNote(status);
+        iPhoneModel.DataStore()->SetAudioOutput(ConvertToPE(aOutput),
+                ConvertToPE(PreviousOutput()), status);
+        iPhoneModel.SendMessage(aMessage);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SendMessage
+// Forwards message to PhoneEngine.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::SendMessage(
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        CTelephonyAudioRouting& aTelephonyAudioRouting)
+    {
+    TEFLOGSTRING2(
+            KTAREQIN,
+            "AUD CPEAudioData::SendMessage: aMessage = %d, available outputs changed ", aMessage );
+    iPhoneModel.DataStore()->SetAvailableAudioOutputs(GetAvailableOutputs(
+            aTelephonyAudioRouting));
+
+    if (iRouteInitialized && aMessage
+            == MEngineMonitor::EPEMessageAvailableAudioOutputsChanged)
+        {
+        iAudioRoutingHandler->HandleAudioRoutingAvailableChanged();
+        }
+
+    iPhoneModel.SendMessage(aMessage);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SetAudioMuteSync
+// Creates synchronous request to set audio mute.
+// EPEMessageAudioMuteChanged message is sent when gain is changed
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::SetAudioMuteSync(const TBool aAudioMute) // Mute value to be set
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioData::SetAudioMuteSync" );
+
+    if (aAudioMute)
+        {
+        iPhoneModel.DataStore()->SetAudioMute(aAudioMute);
+        SendMessage(MEngineMonitor::EPEMessageAudioMuteChanged);
+        TInt err = iAudioEffect->SetMuteState(ETrue);
+        TEFLOGSTRING2(
+                KTAREQOUT,
+                "AUD CPEAudioData::SetAudioMuteSync: error = %d",
+                err );
+        }
+    else
+        {
+        iPhoneModel.DataStore()->SetAudioMute(aAudioMute);
+        SendMessage(MEngineMonitor::EPEMessageAudioMuteChanged);
+        TInt err = iAudioEffect->SetMuteState(EFalse);
+        TEFLOGSTRING2(
+                KTAREQOUT,
+                "AUD CPEAudioData::SetAudioMuteSync: error = %d",
+                err );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SetAudioVolumeSync
+// Creates synchronous request to set audio volume.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::SetAudioVolumeSync(const TInt aAudioVolume) // Volume to be set
+    {
+    TEFLOGSTRING2(
+            KTAREQIN,
+            "AUD CPEAudioData::SetAudioVolumeSync, aAudioVolume = %d",
+            aAudioVolume );
+
+    if (aAudioVolume <= KPEMaxVolume)
+        {
+        TEFLOGSTRING2( KTAINT,
+                "AUD CPEAudioData::SetAudioVolumeSync, aAudioVolume = %d",
+                aAudioVolume );
+
+        iAudioEffect->SetVolume(aAudioVolume);
+        }
+    DoHandleVolumeChange(aAudioVolume, ETrue);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SetAudioOutput
+// Makes request to Telephony Audio Routing to set audio output path
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEAudioData::SetAudioOutput(const TPEAudioOutput aOutput,
+        TBool aShowNote)
+    {
+    TEFLOGSTRING2(
+            KTAREQIN,
+            "AUD CPEAudioData::SetAudioOutput: aOutput = %d",
+            aOutput );
+
+    TInt error(KErrNone);
+
+    TEFLOGSTRING2( KTAERROR,
+            "AUD CPEAudioData::SetAudioOutput: iRouteInitialized (%d)"
+            , iRouteInitialized );
+
+    if (iRouteInitialized && iPhoneModel.DataStore()->AudioOutputAvailable(
+            aOutput))
+        {
+        SetTAROutput(ConvertToTAR(aOutput), aShowNote);
+        }
+    else
+        {
+        if (aOutput == EPEHandset)
+            {
+            iAudioRoutingHandler->SetAnswerToHandset(ETrue);
+            }
+        else
+            {
+            TEFLOGSTRING2( KTAERROR,
+                    "AUD CPEAudioData::SetAudioOutput: Requested audio path not available (%d)"
+                    , aOutput );
+            error = KErrArgument;
+            }
+        }
+
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SetTAROutput
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::SetTAROutput(CTelephonyAudioRouting::TAudioOutput aOutput,
+        TBool aShowNote)
+    {
+    TEFLOGSTRING2(
+            KTAREQIN,
+            "AUD CPEAudioData::SetTAROutput: aOutput = %d",
+            aOutput );
+
+#if defined(__WINSCW__ ) && !defined(UNIT_TESTING)
+    iAudioRouting->SetShowNote(aShowNote);
+    SendMessage(MEngineMonitor::EPEMessageAudioOutputChanged, aOutput);
+#else
+    CTelephonyAudioRouting::TAudioOutput output = iAudioRouting->Output();
+
+    if ( output == aOutput )
+        {
+        // audio routing cannot changed
+        TEFLOGSTRING2( KTAERROR,
+                "AUD CPEAudioData::SetTAROutput: audio path already (%d)"
+                , aOutput );
+        return;
+        }
+    iAudioRouting->SetShowNote( aShowNote );
+    TRAPD( err, iAudioRouting->SetOutputL( aOutput ) );
+
+    if( err )
+        {
+        TEFLOGSTRING2( KTAERROR,
+                "AUD CPEAudioData::SetTAROutput:Leave.1 (%d)", err );
+        switch ( aOutput )
+            {
+            case CTelephonyAudioRouting::ELoudspeaker:
+            case CTelephonyAudioRouting::EWiredAudioAccessory:
+            case CTelephonyAudioRouting::EBTAudioAccessory:
+                // if leave try handset
+                TRAPD( err2, iAudioRouting->SetOutputL( CTelephonyAudioRouting::EHandset ) );
+                if( err2 )
+                    {
+                    TEFLOGSTRING2( KTAERROR,
+                            "AUD CPEAudioData::SetTAROutput:Leave.2 (%d)", err );
+                    }
+                break;
+            default:
+                // None
+                break;
+            }
+        }
+#endif
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::StartUp
+// Gets initial values and inializes TAR
+// StartUpL methods.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::StartUp()
+    {
+    TEFLOGSTRING( KTAREQIN, "AUD CPEAudioData::StartUp" );
+    // get available audio output paths and current audio output
+    iPhoneModel.DataStore()->SetAvailableAudioOutputs(GetAvailableOutputs(
+            *iAudioRouting));
+    iPhoneModel.DataStore()->SetAudioOutput(ConvertToPE(
+            iAudioRouting->Output()), ConvertToPE(
+            iAudioRouting->PreviousOutput()), EFalse);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::GetAvailableOutputs
+// Gets Available Outputs from Audio routing framework
+// Return list of available outputs
+// -----------------------------------------------------------------------------
+//
+TArray<TPEAudioOutput> CPEAudioData::GetAvailableOutputs(
+        CTelephonyAudioRouting& aTelephonyAudioRouting)
+    {
+    TEFLOGSTRING( KTAREQOUT,
+            "AUD CPEAudioData::GetAvailableOutputs > CTelephonyAudioRouting::AvailableOutputs()" );
+    TArray<CTelephonyAudioRouting::TAudioOutput> availableOutputs =
+            aTelephonyAudioRouting.AvailableOutputs();
+
+    iPEavailableOutputs.Reset();
+
+    for (TInt j = 0; j < availableOutputs.Count(); j++)
+        {
+        iPEavailableOutputs.Append(ConvertToPE(availableOutputs[j]));
+        TEFLOGSTRING3( KTAINT,
+                "AUD CPEAudioData::GetAvailableOutputs, index: %d, available: %d",
+                j,
+                availableOutputs[j] );
+        }
+
+    return iPEavailableOutputs.Array();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::HandleCallStarting
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEAudioData::HandleCallStarting(TBool aVideoCall)
+    {
+    TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::HandleCallStarting()" );
+    TInt ret(KErrNone);
+
+    if (!iRouteInitialized) // if route not already initialized
+        { // Not new route init for multi calls
+        iRouteInitialized = ETrue;
+        ret = iAudioRoutingHandler->HandleAudioRoutingCallInit(aVideoCall);
+        }
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::HandleEnergencyCallStarting
+// Can be called, if new call is created before previous call is idle state
+// One used situation is that emergency call is dialed during the video call or
+// voice call. Audio routing have to initialized when emergency is dialing state
+// even previous call(voice or video) haven't got idle yet.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEAudioData::HandleEnergencyCallStarting()
+    {
+    TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::HandleCallSwitching()" );
+    TInt ret(KErrNone);
+
+    // Always new route init
+    ret = iAudioRoutingHandler->HandleAudioRoutingCallInit(EFalse);
+    iRouteInitialized = ETrue;
+
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::HandleCallEnding()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEAudioData::HandleCallEnding()
+    {
+    TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::HandleCallEnding()" );
+
+    if (iRouteInitialized)
+        {
+        iRouteInitialized = EFalse;
+        TEFLOGSTRING( KTAMESINT,
+                "AUD CPEAudioData::HandleCallEnding() > CTelephonyAudioRouting::ENotActive" );
+        SetTAROutput(CTelephonyAudioRouting::ENotActive, EFalse);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::CallAudioRoutePreferenceChanged()
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEAudioData::CallAudioRoutePreferenceChanged()
+    {
+    TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::CallAudioRoutePreferenceChanged()" );
+    if (iRouteInitialized)
+        {
+        return iAudioRoutingHandler->HandleAudioRoutePreferenceChanged();
+        }
+    return KErrNotReady;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::PreviousOutput
+// -----------------------------------------------------------------------------
+//
+CTelephonyAudioRouting::TAudioOutput CPEAudioData::PreviousOutput()
+    {
+    return iAudioRouting->PreviousOutput();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::Output
+// -----------------------------------------------------------------------------
+//
+CTelephonyAudioRouting::TAudioOutput CPEAudioData::Output()
+    {
+    return iAudioRouting->Output();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::SetRoutePreference
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::SetRoutePreference(TBool aShowNote)
+    {
+    TEFLOGSTRING( KTAMESINT, "AUD CPEAudioData::SetRoutePreference()" );
+    CTelephonyAudioRouting::TAudioOutput output =
+            CTelephonyAudioRouting::EHandset;
+
+    const TInt outputPreference =
+            iPhoneModel.DataStore()->AudioOutputPreference();
+    if (outputPreference == EPSAudioPublic)
+        {
+        output = CTelephonyAudioRouting::ELoudspeaker;
+        }
+    TInt error;
+    iAudioRouting->SetShowNote(aShowNote);
+    TRAP( error, iAudioRouting->SetOutputL( output ) );
+    TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::SetRoutePreference() err %d", error );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::RoutePreference
+// -----------------------------------------------------------------------------
+//
+CTelephonyAudioRouting::TAudioOutput CPEAudioData::RoutePreference()
+    {
+    CTelephonyAudioRouting::TAudioOutput output =
+            CTelephonyAudioRouting::EHandset;
+
+    const TInt outputPreference =
+            iPhoneModel.DataStore()->AudioOutputPreference();
+    if (outputPreference == EPSAudioPublic)
+        {
+        output = CTelephonyAudioRouting::ELoudspeaker;
+        }
+    TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::RoutePreference() output %d", output );
+    return output;
+    }
+// -----------------------------------------------------------------------------
+// CPEAudioData::IsWiredAvailable
+// -----------------------------------------------------------------------------
+//
+TBool CPEAudioData::IsWiredAvailable()
+    {
+    return iPhoneModel.DataStore()->AudioOutputAvailable(
+            EPEWiredAudioAccessory);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::IsBTAvailable
+// -----------------------------------------------------------------------------
+//
+TBool CPEAudioData::IsBTAvailable()
+    {
+    return iPhoneModel.DataStore()->AudioOutputAvailable(EPEBTAudioAccessory);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::IsTTYAvailable
+// -----------------------------------------------------------------------------
+//
+TBool CPEAudioData::IsTTYAvailable()
+    {
+    return iPhoneModel.DataStore()->AudioOutputAvailable(EPETTY);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::ConvertToPE
+// -----------------------------------------------------------------------------
+//
+TPEAudioOutput CPEAudioData::ConvertToPE(
+        CTelephonyAudioRouting::TAudioOutput aOutput)
+    {
+    TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::ConvertToPE, aOutput %d", aOutput );
+    TPEAudioOutput newOutput(EPENotActive);
+
+    switch (aOutput)
+        {
+        case CTelephonyAudioRouting::ENotActive:
+            newOutput = EPENotActive;
+            break;
+        case CTelephonyAudioRouting::EHandset:
+            newOutput = EPEHandset;
+            break;
+        case CTelephonyAudioRouting::ELoudspeaker:
+            newOutput = EPELoudspeaker;
+            break;
+        case CTelephonyAudioRouting::EWiredAudioAccessory:
+            newOutput = EPEWiredAudioAccessory;
+            break;
+        case CTelephonyAudioRouting::EBTAudioAccessory:
+            newOutput = EPEBTAudioAccessory;
+            break;
+        case CTelephonyAudioRouting::ETTY:
+            newOutput = EPETTY;
+            break;
+        default:
+            break;
+        }
+
+    return newOutput;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::ConvertToTAR
+// -----------------------------------------------------------------------------
+//
+CTelephonyAudioRouting::TAudioOutput CPEAudioData::ConvertToTAR(
+        TPEAudioOutput aOutput)
+    {
+    TEFLOGSTRING2( KTAMESINT, "AUD CPEAudioData::ConvertToTAR, aOutput %d", aOutput );
+
+    CTelephonyAudioRouting::TAudioOutput newOutput(
+            CTelephonyAudioRouting::ENotActive);
+
+    switch (aOutput)
+        {
+        case EPENotActive:
+            newOutput = CTelephonyAudioRouting::ENotActive;
+            break;
+        case EPEHandset:
+            newOutput = CTelephonyAudioRouting::EHandset;
+            break;
+        case EPELoudspeaker:
+            newOutput = CTelephonyAudioRouting::ELoudspeaker;
+            break;
+        case EPEWiredAudioAccessory:
+            newOutput = CTelephonyAudioRouting::EWiredAudioAccessory;
+            break;
+        case EPEBTAudioAccessory:
+            newOutput = CTelephonyAudioRouting::EBTAudioAccessory;
+            break;
+        case EPETTY:
+            newOutput = CTelephonyAudioRouting::ETTY;
+            break;
+        default:
+            break;
+        }
+    return newOutput;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::DoHandleVolumeChange
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::DoHandleVolumeChange(TInt aVolume, TBool aSendMsg)
+    {
+    iPhoneModel.DataStore()->SetAudioVolume(aVolume);
+
+    if (aSendMsg)
+        {
+        SendMessage(MEngineMonitor::EPEMessageAudioVolumeChanged);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioData::EffectsEvent
+// -----------------------------------------------------------------------------
+//
+void CPEAudioData::EffectsEvent(const TMSEffect& tmseffect,
+        TMSSignalEvent event)
+    {
+    TMSEffectType effecttype;
+    const_cast<TMSEffect&>(tmseffect).GetType(effecttype);
+
+    if (effecttype == TMS_EFFECT_GLOBAL_VOL &&
+            event.type == TMS_EVENT_EFFECT_VOL_CHANGED)
+        {
+        TMSVolumeEventChangeData* vd;
+        vd = static_cast<TMSVolumeEventChangeData*>(event.event_data);
+
+        // If volume change event has been triggered by routing change, we
+        // do not want to send EPEMessageAudioVolumeChanged message.
+        if (!vd->output_changed)
+            {
+            DoHandleVolumeChange(iAudioEffect->Volume(), ETrue);
+            }
+        else
+            {
+            DoHandleVolumeChange(iAudioEffect->Volume(), EFalse);
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudiodtmftoneplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,308 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEAudioDtmfTonePlayer class 
+*                member functions
+*
+*/
+
+
+// INCLUDE FILES
+#include    "cpeaudiodtmftoneplayer.h"
+#include    "pepanic.pan"
+#include    <utility.h>
+#include    <mdaaudiotoneplayer.h>
+#include    <talogger.h>
+#include    <AudioPreference.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None
+
+// CONSTANTS
+const TInt KDtmfPauseAfterTone = 100000;
+const TInt KDtmfToneZero = 0;
+const TInt KBufSize = 10;
+_LIT( KPhoneTone_Asterisk, "*+w" );
+
+const TInt KMaxVolumeLevel = 10;
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None. 
+
+// ==================== LOCAL FUNCTIONS =====================================
+// None
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEAudioDtmfTonePlayer* CPEAudioDtmfTonePlayer::NewL()
+    {
+    CPEAudioDtmfTonePlayer* self = 
+        new ( ELeave ) CPEAudioDtmfTonePlayer;
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+//Destructor
+CPEAudioDtmfTonePlayer::~CPEAudioDtmfTonePlayer()
+    {
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioDtmfTonePlayer::~CPEAudioDtmfTonePlayer");
+    Cancel();
+    delete iDTMFPlayer;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::CPEAudioDtmfTonePlayer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEAudioDtmfTonePlayer::CPEAudioDtmfTonePlayer()
+    {
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioDtmfTonePlayer::CPEAudioDtmfTonePlayer");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioDtmfTonePlayer::ConstructL start");
+    TMMFPrioritySettings dtmfClickPlayerPrioritySettings;  
+    iDTMFPlayer = CMMFDevSound::NewL();
+    
+    iDTMFPlayer->InitializeL( *this, EMMFStateTonePlaying );
+    
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioDtmfTonePlayer::ConstructL completed");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::SetVolume
+// Sets the volume level that is used when the dtmf tone is played.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::SetVolume( 
+        TInt aVolume  //Volume to be set
+        )
+    {
+    TInt vol = ConvertVolume( aVolume );
+        
+    if ( vol != iVolume )
+        {
+        iVolume = vol;
+        iDTMFPlayer->SetVolume( iVolume );
+        TEFLOGSTRING2( KTAINT, "AUD CPEAudioDtmfTonePlayer::SetVolume, iVolume = %d", 
+            iVolume );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::PlayDtmfTone
+// Searches the given DTMF tone from iToneArray and calls PlayCurrentTone -member function.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::PlayDtmfTone( 
+        TChar aTone )
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioDtmfTonePlayer::PlayDtmfTone");
+    Cancel();
+    Normalize( aTone ); 
+
+    // DTMF signalling.
+    if ( iDTMFPlayer )
+        {
+        TBuf<KBufSize> key; 
+        key.Append( aTone );
+        TEFLOGSTRING( KTAREQOUT, "AUD CPEAudioDtmfTonePlayer::PlayDtmfTone > CMMFDevSound::PlayDTMFStringL");
+        TRAP_IGNORE( iDTMFPlayer->PlayDTMFStringL( key ) ); 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::Cancel
+// Cancels the currently playing tone.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::Cancel()
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::Cancel");
+    iDTMFPlayer->Stop();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::Normalize
+// Lowers case for chars and if its '*','+', or 'w' sets it to asterisk char ('*').
+// -----------------------------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::Normalize( 
+        TChar& aTone )
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioDtmfTonePlayer::Normalize");
+    aTone.LowerCase();
+
+    TPtrC ast( KPhoneTone_Asterisk );
+
+    if ( ast.Locate( aTone ) != KErrNotFound )
+        {
+        aTone = ast[ 0 ];
+        TEFLOGSTRING( KTAINT, "AUD CPEAudioDtmfTonePlayer::Normalize");
+        }
+    }
+    
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::InitializeComplete
+// ---------------------------------------------------------
+//
+ void CPEAudioDtmfTonePlayer::InitializeComplete(  
+    TInt aError )
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::InitializeComplete");
+    __ASSERT_DEBUG( aError == KErrNone , Panic( EPEPanicAudioInitializeError ) );
+      
+    if( aError == KErrNone)
+        {
+        TMMFPrioritySettings dtmfClickPlayerSettings;
+
+        dtmfClickPlayerSettings.iPref = 
+                  ( TMdaPriorityPreference ) KAudioPrefKeyDownDTMF;
+        dtmfClickPlayerSettings.iPriority = KAudioPriorityDtmfKeyPress; 
+        dtmfClickPlayerSettings.iState = EMMFStateTonePlaying; 
+      
+        iDTMFPlayer->SetPrioritySettings( dtmfClickPlayerSettings );         
+      
+        TTimeIntervalMicroSeconds32 length( KMdaInfiniteDurationDTMFToneOnLength );
+        TTimeIntervalMicroSeconds32 pause( KDtmfPauseAfterTone );
+        TTimeIntervalMicroSeconds32 zero( KDtmfToneZero );
+      
+        iDTMFPlayer->SetDTMFLengths( length, pause, zero  );
+
+        iDTMFPlayer->SetToneRepeats( 
+                            KMdaAudioToneRepeatForever, 
+                            TTimeIntervalMicroSeconds( KDtmfToneZero ) );              
+        // Must initialize volume to dtmf player. Otherwise it will be
+        // 5 by default in audio SW.
+        iDTMFPlayer->SetVolume( iVolume );
+        }
+
+
+    }
+
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::ToneFinished
+// ---------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::ToneFinished( 
+    TInt /*aError*/ )
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::ToneFinished");
+    }
+
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::BufferToBeFilled
+// ---------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::BufferToBeFilled( CMMFBuffer* /*aBuffer*/ )
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::BufferToBeFilled");
+    }
+
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::PlayError
+// ---------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::PlayError( TInt /*aError*/ )
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::PlayError");
+    }
+
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::BufferToBeEmptied
+// ---------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::BufferToBeEmptied( CMMFBuffer* /*aBuffer*/ )
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::BufferToBeEmptied");
+    }
+
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::RecordError
+// ---------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::RecordError( TInt /*aError*/ )
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::RecordError");
+    }
+
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::ConvertError
+// ---------------------------------------------------------
+//
+void CPEAudioDtmfTonePlayer::ConvertError( TInt /*aError*/ )  
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::ConvertError");
+    }
+    
+// ---------------------------------------------------------
+// CPEAudioDtmfTonePlayer::DeviceMessage
+// ---------------------------------------------------------
+//  
+void CPEAudioDtmfTonePlayer::DeviceMessage( TUid /*aMessageType*/, 
+                                         const TDesC8& /*aMsg*/ )
+    {
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::DeviceMessage");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioDtmfTonePlayer::ConvertVolume
+// -----------------------------------------------------------------------------
+//  
+TInt CPEAudioDtmfTonePlayer::ConvertVolume( TInt aVolume )
+    { 
+    TEFLOGSTRING( KTAREQEND, "AUD CPEAudioDtmfTonePlayer::ConvertVolume");
+    TInt result = iDTMFPlayer->MaxVolume() * aVolume / KMaxVolumeLevel;    
+    
+    TEFLOGSTRING3( KTAREQEND, 
+            "AUD CPEAudioDtmfTonePlayer::ConvertVolume, result = %d, maxVol=%d", 
+            result, iDTMFPlayer->MaxVolume() );
+    return result;
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+// None.
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudioeffect.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,153 @@
+/*
+ * 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:  TMS AudioEffect.
+ *
+ */
+
+#include <glib.h>
+#include <tms.h>
+#include <tmsfactory.h>
+#include <tmsglobalvoleffect.h>
+#include <tmsglobalgaineffect.h>
+#include "cpeaudioeffect.h"
+#include "pepanic.pan"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPEAudioEffect* CPEAudioEffect::NewL(TMSEffectObserver& aObserver)
+    {
+    CPEAudioEffect* self = CPEAudioEffect::NewLC(aObserver);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPEAudioEffect* CPEAudioEffect::NewLC(TMSEffectObserver& aObserver)
+    {
+    CPEAudioEffect* self = new (ELeave) CPEAudioEffect();
+    CleanupStack::PushL(self);
+    self->ConstructL(aObserver);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CPEAudioEffect::CPEAudioEffect
+// ---------------------------------------------------------------------------
+//
+CPEAudioEffect::CPEAudioEffect()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CPEAudioEffect::ConstructL(TMSEffectObserver& aObserver)
+    {
+    TMSVer* v = NULL;
+    TInt err(KErrNotFound);
+    TMSFactory::CreateFactory(iFactory, *v);
+    if (iFactory)
+        {
+        err = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_GAIN, iGlobalGain);
+        err |= iFactory->CreateEffect(TMS_EFFECT_GLOBAL_VOL, iGlobalVol);
+        }
+    if (err)
+        {
+        User::Leave(KErrNotFound);
+        }
+    err = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->AddObserver(aObserver,
+            NULL);
+    User::LeaveIfError(err);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPEAudioEffect::~CPEAudioEffect()
+    {
+    iFactory->DeleteEffect(iGlobalGain);
+    iFactory->DeleteEffect(iGlobalVol);
+    delete iFactory;
+    }
+
+// ---------------------------------------------------------------------------
+// CPEAudioEffect::SetMuteState(TBool aMute)
+// ---------------------------------------------------------------------------
+//
+TInt CPEAudioEffect::SetMuteState(TBool aMute)
+    {
+    __ASSERT_DEBUG(iGlobalGain, Panic(EPEPanicBadHandle));
+    guint value(0);
+    TInt err(KErrNotFound);
+    if (aMute)
+        {
+        err = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->SetLevel(0);
+        }
+    else
+        {
+        err = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetMaxLevel(
+                value);
+        if (err == TMS_RESULT_SUCCESS)
+            {
+            err = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->SetLevel(
+                    value);
+            }
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// CPEAudioEffect::SetUnmuted
+// ---------------------------------------------------------------------------
+//
+TBool CPEAudioEffect::MuteState() const
+    {
+    __ASSERT_DEBUG(iGlobalGain, Panic(EPEPanicBadHandle));
+    guint value;
+    static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetLevel(value);
+    return (value == 0) ? ETrue : EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CPEAudioEffect::SetVolume
+// ---------------------------------------------------------------------------
+//
+void CPEAudioEffect::SetVolume(TInt aVolume)
+    {
+    __ASSERT_DEBUG(iGlobalVol, Panic(EPEPanicBadHandle));
+    static_cast<TMSGlobalVolEffect*>(iGlobalVol)->SetLevel(aVolume);
+    }
+
+// ---------------------------------------------------------------------------
+// CPEAudioEffect::Volume
+// ---------------------------------------------------------------------------
+//
+TInt CPEAudioEffect::Volume() const
+    {
+    __ASSERT_DEBUG(iGlobalVol, Panic(EPEPanicBadHandle));
+    guint value(0);
+    static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetLevel(value);
+    return value;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudiofactory.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEAudioFactory class 
+*                member functions
+*
+*/
+
+
+// INCLUDES
+#include "cpeaudiofactory.h"
+#include "cpeaudiotoneutilityimpl.h"
+#include <TelephonyAudioRouting.h>
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS =====================================
+//None.
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// Static constructor
+// -----------------------------------------------------------------------------
+// 
+EXPORT_C CPEAudioFactory* CPEAudioFactory::NewLC()
+    {
+    CPEAudioFactory* self = new( ELeave )CPEAudioFactory();
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// C++ constructor
+// -----------------------------------------------------------------------------
+//  
+EXPORT_C CPEAudioFactory::CPEAudioFactory()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioFactory::CreateTelephonyAudioRoutingL
+// creates CTelephonyAudioRouting instance.
+// -----------------------------------------------------------------------------
+//   
+EXPORT_C CTelephonyAudioRouting* CPEAudioFactory::CreateTelephonyAudioRoutingL( 
+    MTelephonyAudioRoutingObserver& aAudioRoutingObserver )
+    {
+    return CTelephonyAudioRouting::NewL( aAudioRoutingObserver );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioFactory::CreateAudioToneUtilityL
+// creates CPEAudioToneUtility instance.
+// -----------------------------------------------------------------------------
+// 
+EXPORT_C CPEAudioToneUtility* CPEAudioFactory::CreateAudioToneUtilityL(
+    MMdaAudioToneObserver& aToneObserver )
+    {
+    return CPEAudioToneUtilityImpl::NewL( aToneObserver );
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudioinbandtoneplayer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,610 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEAudioInbandTonePlayer class 
+*                member functions
+*
+*/
+
+ 
+//  INCLUDE FILES
+#include    "cpeaudiodata.h" // CPEAudioData header
+#include    "cpeaudioinbandtoneplayer.h"
+#include    "cpeaudiofactory.h"
+#include    "cpeaudiotoneutility.h"
+#include    <AudioPreference.h>
+#include    <barsc.h> 
+#include    <barsread.h>
+#include    <data_caging_path_literals.hrh> 
+#include    <defaultbeep.rsg>           
+#include    <pepanic.pan>
+#include    <talogger.h>    
+
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None
+
+// CONSTANTS
+const TInt KPhoneInbandVolumeMax = 10;
+const TInt KPhoneInbandVolumeMin = 0;
+const TInt KPhoneInbandToneZero = 0;
+const TInt KPhoneInbandToneNoRepeat = 0;
+const TInt KPhoneInbandToneRepeatOnce = 1;
+
+// Resourcefile destination.
+_LIT( KSystemDefaultbeepRscDrive, "Z:" );
+_LIT( KSystemDefaultbeepRscFile, "DEFAULTBEEP.rSC" );
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEAudioInbandTonePlayer* CPEAudioInbandTonePlayer::NewL
+    (
+    CPEAudioData& aOwner,     // ref. to class owner
+    RFs& aFsSession,
+    CPEAudioFactory& aAudioFactory
+    )
+    {
+    CPEAudioInbandTonePlayer* self = 
+        new ( ELeave ) CPEAudioInbandTonePlayer( aOwner, aFsSession );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aAudioFactory );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+//Destructor
+CPEAudioInbandTonePlayer::~CPEAudioInbandTonePlayer()
+    {
+    delete iPlayBeepSequence;
+    delete iPlayNoSoundSequence;
+    delete iPlayDataSequence;
+    delete iResourceCallWaitingSeq;
+    delete iResourceRingGoingSeq;
+    delete iResourceRadioPathSeq;
+    delete iResourceSpecialSeq;
+    delete iResourceCongestionSeq;
+    delete iResourceReorderSeq;
+    delete iResourceBusySeq;
+    delete iCurrent;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::CPEAudioInbandTonePlayer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEAudioInbandTonePlayer::CPEAudioInbandTonePlayer
+    (
+    CPEAudioData& aOwner,     // ref. to class owner
+    RFs& aFsSession
+    ):iOwner( aOwner ),
+      iFsSession( aFsSession )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::ConstructL(
+    CPEAudioFactory& aFactory )
+    {
+    TEFLOGSTRING( KTAOBJECT, "AUD CPEAudioInbandTonePlayer::ConstructL()" );
+    iCurrent = aFactory.CreateAudioToneUtilityL( *this );
+
+
+    //Get the inband tone sequences from resource and and store to member variables
+    RResourceFile resourceFile;
+
+    TFileName fileName( KSystemDefaultbeepRscDrive );
+    fileName.Append( KDC_RESOURCE_FILES_DIR );
+    fileName.Append( KSystemDefaultbeepRscFile );
+
+    resourceFile.OpenL( iFsSession, fileName );
+    CleanupClosePushL( resourceFile );
+
+    HBufC8* resourceBusy = resourceFile.AllocReadL( R_NET_BUSY );
+    HBufC8* resourceReorder = resourceFile.AllocReadL( R_NET_REORDER );
+    HBufC8* resourceCongestion = resourceFile.AllocReadL( R_NET_CONGESTION );
+    HBufC8* resourceSpecial = resourceFile.AllocReadL( R_NET_SPECIAL_INFORMATION );
+    HBufC8* resourceRadioPath = resourceFile.AllocReadL( R_NET_RADIO_NOT_AVAILABLE );
+    HBufC8* resourceRingGoing = resourceFile.AllocReadL( R_NET_RING_GOING );
+    HBufC8* resourceCallWaiting = resourceFile.AllocReadL( R_NET_CALL_WAITING );
+    HBufC8* dataCallTone = resourceFile.AllocReadL( R_DATA_CALL_TONE );
+    HBufC8* noSoundSequence = resourceFile.AllocReadL( R_NO_SOUND_SEQUENCE );
+    HBufC8* beepSequence = resourceFile.AllocReadL( R_BEEP_SEQUENCE );
+    
+    CleanupStack::PopAndDestroy( &resourceFile );
+
+    TResourceReader reader;
+    TInt i(0);
+    TInt length(0);
+
+    //SubscriberBusy
+    reader.SetBuffer( resourceBusy );
+    length = reader.ReadInt16();
+    iResourceBusySeq = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendBusy(iResourceBusySeq->Des());
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendBusy.Append(reader.ReadUint16());
+        }
+    
+    //Reorder
+    reader.SetBuffer( resourceReorder );
+    length = reader.ReadInt16();
+    iResourceReorderSeq = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendReorder(iResourceReorderSeq->Des());
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendReorder.Append(reader.ReadUint16());
+        }
+
+    //Congestion
+    reader.SetBuffer( resourceCongestion );
+    length = reader.ReadInt16();
+    iResourceCongestionSeq = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendCongestion(iResourceCongestionSeq->Des());
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendCongestion.Append(reader.ReadUint16());
+        }
+    
+    //Special Information
+    reader.SetBuffer( resourceSpecial );
+    length = reader.ReadInt16();
+    iResourceSpecialSeq = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendSpecial(iResourceSpecialSeq->Des());
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendSpecial.Append(reader.ReadUint16());
+        }
+    
+    //RadioPathNotAvailable
+    reader.SetBuffer( resourceRadioPath );
+    length = reader.ReadInt16();
+    iResourceRadioPathSeq = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendRadio(iResourceRadioPathSeq->Des());
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendRadio.Append(reader.ReadUint16());
+        }
+    
+    //RemoteAlertingTone
+    reader.SetBuffer( resourceRingGoing );
+    length = reader.ReadInt16();
+    iResourceRingGoingSeq = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendRingGoing(iResourceRingGoingSeq->Des());
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendRingGoing.Append(reader.ReadUint16());
+        }
+    //CallWaitingTone
+    reader.SetBuffer( resourceCallWaiting );
+    length = reader.ReadInt16();
+    iResourceCallWaitingSeq = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendCallWaiting(iResourceCallWaitingSeq->Des());
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendCallWaiting.Append(reader.ReadUint16());
+        }
+
+    //DataCalTone
+    reader.SetBuffer( dataCallTone );
+    length = reader.ReadInt16();
+    iPlayDataSequence = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendDataCallTone( iPlayDataSequence->Des() );
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendDataCallTone.Append(reader.ReadUint16());
+        }
+
+    //NoSoundSequence
+    reader.SetBuffer( noSoundSequence );
+    length = reader.ReadInt16();
+    iPlayNoSoundSequence = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendNoSoundSequence( iPlayNoSoundSequence->Des() );
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendNoSoundSequence.Append(reader.ReadUint16());
+        }
+
+    //BeepSequence
+    reader.SetBuffer( beepSequence );
+    length = reader.ReadInt16();
+    iPlayBeepSequence = HBufC8::NewL( length );
+    //Tptr modifies member variables (HBufC8) length so it includes the memory edited by Append()
+    TPtr8 appendBeepSequence( iPlayBeepSequence->Des() );
+
+    for( i = 0 ; i < length ; i++ )
+        {
+        appendBeepSequence.Append(reader.ReadUint16());
+        }
+
+    delete dataCallTone;
+    delete noSoundSequence;
+    delete beepSequence;
+    delete resourceBusy;
+    delete resourceReorder;
+    delete resourceCongestion;
+    delete resourceSpecial;
+    delete resourceRadioPath;
+    delete resourceRingGoing;
+    delete resourceCallWaiting;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::PlayInbandTone
+// Searches the given Inband tone from iToneArray and calls PlayCurrentTone -member function.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::PlayInbandTone( 
+        TCCPTone aTone )
+    {
+    //Stop playing if there is something playing
+    Cancel();
+
+    UpdateTonePlayerVolume();
+    
+    iToneName = aTone;
+
+    TPtr8 resourceBusySeq = iResourceBusySeq -> Des();
+    TPtr8 resourceRadioPathSeq = iResourceRadioPathSeq -> Des();
+    TPtr8 resourceCongestionSeq = iResourceCongestionSeq -> Des();
+    TPtr8 resourceSpecialSeq = iResourceSpecialSeq -> Des();
+    TPtr8 resourceReorderSeq = iResourceReorderSeq->Des();
+    TPtr8 resourceRingGoingSeq = iResourceRingGoingSeq -> Des();
+    TPtr8 resourceCallWaitingSeq = iResourceCallWaitingSeq -> Des();
+
+    TEFLOGSTRING( KTAREQOUT, 
+        "AUD CPEAudioInbandTonePlayer::PlayInbandTone: CMdaAudioToneUtility->PrepareToPlayDesSequence()" );
+    switch( aTone )
+        {
+        case ECCPToneUserBusy:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: iResourceBusySeq" );
+            iCurrent->PrepareToPlayDesSequence( resourceBusySeq );
+            break;
+        case ECCPToneRadioPathNotAvailable:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: iResourceRadioPathSeq" );
+            iCurrent->PrepareToPlayDesSequence( resourceRadioPathSeq );
+            break;
+        case ECCPToneCongestion:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: iResourceCongestionSeq" );
+            iCurrent->PrepareToPlayDesSequence( resourceCongestionSeq );
+            break;
+        case ECCPToneSpecialInformation:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: iResourceSpecialSeq" );
+            iCurrent->PrepareToPlayDesSequence( resourceSpecialSeq );
+            break;
+        case ECCPReorder:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: iResourceReorderSeq" );
+            iCurrent->PrepareToPlayDesSequence( resourceReorderSeq );
+            break;
+        case ECCPRemoteAlerting:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: iResourceRingGoingSeq" );
+            iCurrent->PrepareToPlayDesSequence( resourceRingGoingSeq );
+            break;
+        case ECCPCallWaiting:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: iResourceCallWaitingSeq" );
+            iCurrent->PrepareToPlayDesSequence( resourceCallWaitingSeq );
+            break;
+        case ECCPNoSoundSequence:
+            TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: called ECCPNoSoundSequence " );
+            break;
+        default:
+            TEFLOGSTRING2( KTAINT, "AUD CPEAudioInbandTonePlayer::PlayInbandTone: No InbandTone defined to play with: %d", aTone );
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicNotCompleted ) );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::Cancel
+// Cancels the currently playing tone.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::Cancel()
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioInbandTonePlayer::Cancel()");
+    if ( iCurrent )
+        {
+        if ( iCurrent->State() == EMdaAudioToneUtilityNotReady )
+            {
+            // Prepare is called, but toneplayer's state is not yet prepare,
+            // then cancel to prepare is needed.
+            TEFLOGSTRING( KTAREQOUT, 
+                "AUD CPEAudioInbandTonePlayer::Cancel: CMdaAudioToneUtility->CancelPrepare");
+            iCurrent->CancelPrepare();
+            }
+        else
+            {
+            TEFLOGSTRING( KTAREQOUT, 
+                "AUD CPEAudioInbandTonePlayer::Cancel: CMdaAudioToneUtility->CancelPlay");
+            iCurrent->CancelPlay();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::PlayCurrentTone
+// Cancels the currently playing tone.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::PlayCurrentTone()
+    {
+    if ( iCurrent )
+        {
+        if ( iCurrent->State() == EMdaAudioToneUtilityPrepared )
+            {
+
+            UpdateTonePlayerVolume();
+
+            TEFLOGSTRING( KTAREQOUT, 
+                "AUD CPEAudioInbandTonePlayer::PlayCurrentTone(): CMdaAudioToneUtility->SetPriority()");
+
+            switch( iToneName )
+                {
+                case ECCPToneUserBusy:
+                     iCurrent->SetRepeats( 
+                        KMdaAudioToneRepeatForever, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityNetMsg,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefBusy ) );
+                    break;
+                case ECCPToneRadioPathNotAvailable:
+                    iCurrent->SetRepeats( 
+                        KPhoneInbandToneRepeatOnce, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityNetMsg,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefRadioNotAvailable ) );
+                    break;
+                case ECCPToneCongestion:
+                    iCurrent->SetRepeats( 
+                        KMdaAudioToneRepeatForever, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityNetMsg,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefCongestion ) );
+                    break;
+                case ECCPToneSpecialInformation:
+                    iCurrent->SetRepeats( 
+                        KMdaAudioToneRepeatForever, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityNetMsg,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefSpecialInformation ) );
+                    break;
+                case ECCPReorder:
+                    iCurrent->SetRepeats( 
+                        KMdaAudioToneRepeatForever, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityNetMsg,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefReorder ) );
+                    break;
+                case ECCPRemoteAlerting:
+                    iCurrent->SetRepeats( 
+                        KMdaAudioToneRepeatForever, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityNetMsg,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefRingGoing ) );
+                    break;
+                case ECCPCallWaiting:
+                    iCurrent->SetRepeats( 
+                        KPhoneInbandToneNoRepeat, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityNetMsg,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefCallWaiting ));
+                    break;
+                case ECCPDataCallTone: //EProfileRingingTypeRinging, EProfileRingingTypeAscending, EProfileRingingTypeRingingOnce
+                    iCurrent->SetRepeats( 
+                        KMdaAudioToneRepeatForever, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityPhoneCall,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefIncomingDataCall ) );
+                    
+                    if ( iRingingType == EProfileRingingTypeAscending )
+                        {
+                        iCurrent->SetVolumeRamp( 
+                            TTimeIntervalMicroSeconds( KPERingingToneRampDuration ) );
+                        }
+                    else
+                        {
+                        //EProfileRingingTypeRinging, EProfileRingingTypeRingingOnce
+                        iCurrent->SetVolumeRamp( 
+                            TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                        }
+                    if ( iRingingType == EProfileRingingTypeRingingOnce )
+                        {
+                        iCurrent->SetRepeats( 
+                            KPhoneInbandToneNoRepeat, 
+                            TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                        }
+                    break;
+                case ECCPNoSoundSequence:
+                case ECCPBeepSequence:
+                    iCurrent->SetRepeats( 
+                        KMdaAudioToneRepeatForever, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetPriority(
+                        KAudioPriorityPhoneCall,
+                        static_cast < TMdaPriorityPreference > ( KAudioPrefIncomingCall ) );
+                    iCurrent->SetRepeats( 
+                        KPhoneInbandToneNoRepeat, 
+                        TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    iCurrent->SetVolumeRamp( TTimeIntervalMicroSeconds( KPhoneInbandToneZero ) );
+                    break;
+                default:
+                    TEFLOGSTRING2( KTAREQOUT, 
+                        "AUD CPEAudioInbandTonePlayer::PlayCurrentTone: No InbandTone defined to set priority with %d", 
+                        iToneName);
+                    break;
+                }
+
+            #ifdef __WINS__
+                    TEFLOGSTRING( KTAMESINT, 
+                        "AUD CPEAudioInbandTonePlayer::PlayCurrentTone: Ignored call to CMdaAudioToneUtility->Play(), because can't play in WINS");
+            #else
+                    //Play the tone
+                    TEFLOGSTRING( KTAREQOUT, 
+                        "AUD CPEAudioInbandTonePlayer::PlayCurrentTone: CMdaAudioToneUtility->Play() called");
+                    iCurrent->Play();
+            #endif
+            } // State()
+        } //iCurrent
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::MatoPrepareComplete
+// Updates flag values and plays current inbandtone.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::MatoPrepareComplete( TInt aError )
+    {
+
+    if( aError == KErrNone )
+        {
+        PlayCurrentTone();
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAREQIN, 
+            "AUD CPEAudioInbandTonePlayer::MatoPrepareComplete: aError = %d", 
+            aError );
+        }
+
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::SetVolume
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::SetVolume( TInt aVolume )
+    {
+    TInt safeVolume = 
+        Max( Min( aVolume, KPhoneInbandVolumeMax ), KPhoneInbandVolumeMin );
+    
+    TEFLOGSTRING2( KTAREQIN, 
+        "AUD CPEAudioInbandTonePlayer::SetVolume: VOLUME = %d", safeVolume );
+    
+    if ( iCurrent && EMdaAudioToneUtilityNotReady != iCurrent->State() )
+        {
+        TInt mediaServerVolume = CalculateMediaServerVolume( safeVolume );
+        TEFLOGSTRING2( KTAREQIN, 
+            "AUD CPEAudioInbandTonePlayer::SetVolume: MEDIA SERVER VOLUME = %d", 
+            mediaServerVolume );
+        iCurrent->SetVolume( mediaServerVolume );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::MatoPlayComplete
+// -
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::MatoPlayComplete( TInt aError )
+    {
+ 
+    if( aError != KErrNone )
+        {
+        TEFLOGSTRING2( KTAREQIN, 
+            "CPEAudioInbandTonePlayer::MatoPlayComplete: aError = %d",
+            aError );
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::CalculateMediaServerVolume
+// -----------------------------------------------------------------------------
+//
+TInt CPEAudioInbandTonePlayer::CalculateMediaServerVolume( TInt aVolume ) const
+    {
+    // Our volume level scale is 0...10, media server's can be anything. 
+    // This scales the volume to correct level.
+    return ( iCurrent->MaxVolume() * aVolume ) / 
+        ( KPhoneInbandVolumeMax - KPhoneInbandVolumeMin );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEAudioInbandTonePlayer::UpdateTonePlayerVolume
+// -----------------------------------------------------------------------------
+//
+void CPEAudioInbandTonePlayer::UpdateTonePlayerVolume()
+    {
+    TInt volume( KPhoneInbandVolumeMin );
+    iOwner.GetAudioVolumeSync( volume );
+    SetVolume( volume );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudioroutingmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEAudioRoutingMonitor class 
+*                member functions
+*
+*/
+
+
+// INCLUDES
+#include "talogger.h"
+#include "cpeaudioroutingmonitor.h"
+#include "cpeaudiodata.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS =====================================
+//None.
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPEAudioRoutingMonitor::CPEAudioRoutingMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEAudioRoutingMonitor::CPEAudioRoutingMonitor( 
+    CPEAudioData& aOwner )
+    : iOwner( aOwner )
+    { 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioRoutingMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEAudioRoutingMonitor* CPEAudioRoutingMonitor::NewL( 
+    CPEAudioData& aOwner )
+    {
+    CPEAudioRoutingMonitor* self = 
+        new ( ELeave ) CPEAudioRoutingMonitor( aOwner );
+    
+    return self;
+    }
+
+CPEAudioRoutingMonitor::~CPEAudioRoutingMonitor()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioRoutingMonitor::AvailableOutputsChanged
+// AvailableOutput mode changed event received.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioRoutingMonitor::AvailableOutputsChanged( 
+    CTelephonyAudioRouting& aTelephonyAudioRouting )
+    {
+    TEFLOGSTRING( KTAINT,
+        "AUD CPEAudioRoutingMonitor::AvailableOutputsChanged" );
+    iOwner.SendMessage( MEngineMonitor::EPEMessageAvailableAudioOutputsChanged, 
+                        aTelephonyAudioRouting );
+    }
+        
+// -----------------------------------------------------------------------------
+// CPEAudioRoutingMonitor::OutputChanged
+// Output mode changed event received.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioRoutingMonitor::OutputChanged( 
+    CTelephonyAudioRouting& aTelephonyAudioRouting )
+    {
+    TEFLOGSTRING( KTAINT, "AUD CPEAudioRoutingMonitor::OutputChanged" );
+    iOwner.SendMessage( MEngineMonitor::EPEMessageAudioOutputChanged, 
+                        aTelephonyAudioRouting.Output() );
+    }
+        
+// -----------------------------------------------------------------------------
+// CPEAudioRoutingMonitor::SetOutputComplete
+// OutputComplete mode changed event received.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioRoutingMonitor::SetOutputComplete( 
+    CTelephonyAudioRouting& aTelephonyAudioRouting, 
+    TInt aError )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "AUD CPEAudioRoutingMonitor::SetOutputComplete, aError: %d",
+        aError );
+    if ( aError == KErrNone )
+        {
+        iOwner.SendMessage( MEngineMonitor::EPEMessageAudioOutputChanged, 
+                            aTelephonyAudioRouting.Output() );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR,
+            "AUD CPEAUDIOROUTINGMONITOR::SETOUTPUTCOMPLETE SETOUTPUTL FAILED" );
+        }
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+//None
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpeaudiotoneutilityimpl.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements CPEAudioToneUtility interface
+*
+*/
+
+#include <mdaaudiotoneplayer.h>
+#include "cpeaudiotoneutilityimpl.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPEAudioToneUtilityImpl::CPEAudioToneUtilityImpl()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase construcotor
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::ConstructL(
+    MMdaAudioToneObserver& aToneObserver )
+    {
+    iToneUtility = CMdaAudioToneUtility::NewL( aToneObserver );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPEAudioToneUtilityImpl* CPEAudioToneUtilityImpl::NewL(
+    MMdaAudioToneObserver& aToneObserver )
+    {
+    CPEAudioToneUtilityImpl* self = new( ELeave ) CPEAudioToneUtilityImpl;
+    CleanupStack::PushL( self );
+    self->ConstructL( aToneObserver );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPEAudioToneUtilityImpl::~CPEAudioToneUtilityImpl()
+    {
+    delete iToneUtility;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::PrepareToPlayDesSequence( 
+    const TDesC8& aSequence )
+    {
+    iToneUtility->PrepareToPlayDesSequence( aSequence );   
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+TMdaAudioToneUtilityState CPEAudioToneUtilityImpl::State()
+    {
+    return iToneUtility->State();    
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::CancelPlay()
+    {
+    // Do state specific cancellations, this way we do not end up in a
+    // endless play state if CancelPlay() is called during preparation.
+    if ( EMdaAudioToneUtilityPlaying == iToneUtility->State() )
+        {
+        iToneUtility->CancelPlay();
+        }
+    else if ( EMdaAudioToneUtilityPrepared == iToneUtility->State() )
+        {
+        iToneUtility->CancelPrepare();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+TInt CPEAudioToneUtilityImpl::MaxVolume()
+    {
+    return iToneUtility->MaxVolume();
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::SetVolume( TInt aVolume )
+    {
+    iToneUtility->SetVolume( aVolume );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::SetRepeats(
+    TInt aRepeatNumberOfTimes, 
+    const TTimeIntervalMicroSeconds& aTrailingSilence )
+    {
+    iToneUtility->SetRepeats( aRepeatNumberOfTimes, aTrailingSilence );
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//    
+void CPEAudioToneUtilityImpl::SetPriority(
+    TInt aPriority, 
+    TMdaPriorityPreference aPref)
+    {
+    iToneUtility->SetPriority( aPriority, aPref );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::SetVolumeRamp( 
+    const TTimeIntervalMicroSeconds& aRampDuration )
+    {
+    iToneUtility->SetVolumeRamp( aRampDuration );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::Play()
+    {
+    iToneUtility->Play();
+    }
+
+// ---------------------------------------------------------------------------
+// From class CPEAudioToneUtility
+// ---------------------------------------------------------------------------
+//
+void CPEAudioToneUtilityImpl::CancelPrepare()
+    {
+    iToneUtility->CancelPrepare();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpecallaudioroutinghandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPECallAudioRoutingHandler class 
+*                member functions
+*
+*/
+
+
+// INCLUDES
+#include <talogger.h>
+#include "cpecallaudioroutinghandler.h"
+#include "cpeaudiodata.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS =====================================
+//None.
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPECallAudioRoutingHandler::CPECallAudioRoutingHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPECallAudioRoutingHandler::CPECallAudioRoutingHandler( 
+    CPEAudioData& aOwner )
+    : iOwner( aOwner )
+    { 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioRoutingMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPECallAudioRoutingHandler* CPECallAudioRoutingHandler::NewL( 
+    CPEAudioData& aOwner )
+    {
+    CPECallAudioRoutingHandler* self = 
+        new ( ELeave ) CPECallAudioRoutingHandler( aOwner );
+    
+    return self;
+    }
+
+CPECallAudioRoutingHandler::~CPECallAudioRoutingHandler()
+    {
+    }
+ 
+ 
+// -----------------------------------------------------------------------------
+// CPECallAudioRoutingHandler::HandleAudioRoutingCallInit
+// -----------------------------------------------------------------------------
+//
+TInt CPECallAudioRoutingHandler::HandleAudioRoutingCallInit( TBool aVideoCall )
+    {
+  
+    TInt error = KErrNone;
+    CTelephonyAudioRouting::TAudioOutput curOutput = iOwner.Output();
+    CTelephonyAudioRouting::TAudioOutput newOutput = curOutput;
+
+    TEFLOGSTRING2( KTAINT, 
+        "AUD CPECallAudioRoutingHandler::HandleAudioRoutingCallInit > : isVideo = %d", aVideoCall );
+    iAnyVideoCall = aVideoCall;
+    
+    // Wired headset has top priority
+    if ( iOwner.IsWiredAvailable() )
+        {
+        newOutput = CTelephonyAudioRouting::EWiredAudioAccessory;
+        }
+    else if ( iOwner.IsBTAvailable() ) 
+        {
+        if ( iAnswerToHandset )  
+            {
+            newOutput = iOwner.RoutePreference();
+            }
+        else
+            {
+            newOutput = CTelephonyAudioRouting::EBTAudioAccessory;
+            }            
+        }
+    else if ( iOwner.IsTTYAvailable() )
+        {
+        newOutput = CTelephonyAudioRouting::ETTY;
+        }
+    else
+        {
+        if ( iAnyVideoCall )
+            {
+            if ( iAnswerToHandset )
+                {
+                newOutput = CTelephonyAudioRouting::EHandset;
+                }
+            else
+                {
+                newOutput = CTelephonyAudioRouting::ELoudspeaker;        
+                }               
+            }
+        else
+            {
+            newOutput = iOwner.RoutePreference();
+            } 
+        }
+    SetAnswerToHandset( EFalse );
+    
+    if ( newOutput != curOutput )
+        {
+        iOwner.SetTAROutput( newOutput, EFalse );    
+        TEFLOGSTRING2( KTAINT, 
+        "AUD CPECallAudioRoutingHandler::HandleAudioRoutingCallInit: new output = %d", newOutput );
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAINT, 
+        "AUD CPECallAudioRoutingHandler::HandleAudioRoutingCallInit: Already output = %d", curOutput );
+        }        
+ 
+    return error;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallAudioRoutingHandler::HandleAudioRoutingAvailableChanged
+// Handles accessory mode changed message from AudioHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+TInt CPECallAudioRoutingHandler::HandleAudioRoutingAvailableChanged()
+    {
+    TInt error = KErrNone;
+       
+    CTelephonyAudioRouting::TAudioOutput curOutput = iOwner.Output();
+    CTelephonyAudioRouting::TAudioOutput newOutput = curOutput;
+    
+    
+    switch ( curOutput )
+        {
+        case CTelephonyAudioRouting::ENotActive:
+            // None
+             break;
+        case CTelephonyAudioRouting::EHandset:
+        case CTelephonyAudioRouting::ELoudspeaker:
+            // Wired audio accessory connected during call
+            if ( iOwner.IsWiredAvailable() )
+                {
+                newOutput = CTelephonyAudioRouting::EWiredAudioAccessory;
+                }
+            // BT comes available during call   
+            else if ( iOwner.IsBTAvailable() )
+                {
+                newOutput = CTelephonyAudioRouting::EBTAudioAccessory;
+                }
+            else if ( iOwner.IsTTYAvailable() )                 
+                {
+                newOutput = CTelephonyAudioRouting::ETTY;
+                }
+            else
+                {
+                // No changes
+                }   
+            break;
+        case CTelephonyAudioRouting::EWiredAudioAccessory:
+            if ( iOwner.IsBTAvailable() )
+                {
+                // Not allowed direct from wired to BTA
+                // or BTA comes available during wired, No changes
+                }
+            if ( iOwner.IsWiredAvailable() )
+                {
+                // No changes
+                }
+            else if ( iAnyVideoCall )
+                {
+                newOutput = CTelephonyAudioRouting::ELoudspeaker;
+                }
+            else                
+                {
+                // Wired detach
+                newOutput = iOwner.RoutePreference();
+                }   
+            break;
+        case CTelephonyAudioRouting::EBTAudioAccessory:
+            if ( iOwner.IsWiredAvailable() )
+                {
+                newOutput = CTelephonyAudioRouting::EWiredAudioAccessory;
+                }
+            else if ( iOwner.IsBTAvailable() )  
+                {
+                // No changes
+                }
+            else
+                {
+                newOutput = iOwner.RoutePreference();
+                }           
+            break;
+        case CTelephonyAudioRouting::ETTY:
+            if ( iOwner.IsTTYAvailable()  )
+                {
+                // No changes
+                }
+            else
+                {
+                newOutput = iOwner.RoutePreference();
+                }
+            break;
+       default:
+            break;     
+        }
+    
+   if ( newOutput != curOutput )
+        {
+        iOwner.SetTAROutput( newOutput, ETrue );    
+        TEFLOGSTRING2( KTAINT, 
+        "PE CPECallAudioRoutingHandler::HandleAudioRoutingAvailableChanged: new output = %d", newOutput );
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAINT, 
+        "PE CPECallAudioRoutingHandler::HandleAudioRoutingAvailableChanged: Already output = %d", curOutput );
+        }     
+      
+    return error;
+    }    
+
+// -----------------------------------------------------------------------------
+// CPECallAudioRoutingHandler::HandleAudioRoutePreferenceChanged
+// Handles route preference mode changed message from AudioHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+TInt CPECallAudioRoutingHandler::HandleAudioRoutePreferenceChanged()
+    {
+    TInt error = KErrNone;
+    CTelephonyAudioRouting::TAudioOutput curOutput = iOwner.Output();
+    CTelephonyAudioRouting::TAudioOutput newOutput = curOutput;
+    
+    if ( !iAnyVideoCall &&
+         curOutput != CTelephonyAudioRouting::EWiredAudioAccessory &&
+         curOutput != CTelephonyAudioRouting::EBTAudioAccessory )
+        {
+        newOutput = iOwner.RoutePreference();
+        }
+    if ( newOutput != curOutput )
+        {
+        iOwner.SetTAROutput( newOutput, ETrue );    
+        TEFLOGSTRING2( KTAINT, 
+        "PE CPECallAudioRoutingHandler::HandleAudioRoutePreferenceChanged: new output = %d", newOutput );
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAINT, 
+        "PE CPECallAudioRoutingHandler::HandleAudioRoutePreferenceChanged: Already output = %d", curOutput );
+        }        
+    return error;
+    }
+// -----------------------------------------------------------------------------
+// CPECallAudioRoutingHandler::SetAnswerToHandset
+//  
+// -----------------------------------------------------------------------------
+//
+void  CPECallAudioRoutingHandler::SetAnswerToHandset( TBool aStatus )
+    {
+    iAnswerToHandset = aStatus;
+    }
+ 
+ 
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+//None
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/cpegsmaudiodata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,311 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEGsmAudioData class 
+*                member functions
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeaudiodtmftoneplayer.h" 
+#include "cpeaudiofactory.h"    
+#include "cpeaudioinbandtoneplayer.h"   
+#include "cpegsmaudiodata.h"    
+#include <ccpdefs.h>    
+#include <mpeclientinformation.h>   
+#include <mpedatastore.h>   
+#include <mpephonemodelinternal.h>  
+#include <talogger.h>   
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::CPEGsmAudioData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEGsmAudioData::CPEGsmAudioData
+        ( 
+        MPEPhoneModelInternal& aPhoneModel,
+        RFs& aFsSession
+        ) : CPEAudioData( aPhoneModel ),
+            iFsSession( aFsSession )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEGsmAudioData::ConstructL( CPEAudioFactory& aAudioFactory )
+    {    
+    CPEAudioData::ConstructL( aAudioFactory );     
+    
+    iInbandTonePlayer = 
+        CPEAudioInbandTonePlayer::NewL( *this, iFsSession, aAudioFactory );
+    TInt volume = iPhoneModel.DataStore()->AudioVolume(); 
+    iInbandTonePlayer->SetVolume( volume );
+    
+    iDtmfTonePlayer = CPEAudioDtmfTonePlayer::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPEGsmAudioData* CPEGsmAudioData::NewL
+        ( 
+        MPEPhoneModelInternal& aPhoneModel,
+        RFs& aFsSession
+        )
+    {
+    CPEGsmAudioData* self = new ( ELeave ) 
+        CPEGsmAudioData ( aPhoneModel, aFsSession );
+    CleanupStack::PushL( self );
+    
+    CPEAudioFactory* factory = CPEAudioFactory::NewLC();
+    self->ConstructL(*factory);
+    CleanupStack::PopAndDestroy( factory );
+    
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::NewL
+// Two-phased constructor for testing purposes.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPEGsmAudioData* CPEGsmAudioData::NewL
+        ( 
+        MPEPhoneModelInternal& aPhoneModel,
+        RFs& aFsSession,
+        CPEAudioFactory& aAudioFactory  
+        )
+    {
+    CPEGsmAudioData* self = new ( ELeave ) 
+        CPEGsmAudioData ( aPhoneModel, aFsSession );
+    CleanupStack::PushL( self );
+    
+    self->ConstructL(aAudioFactory);    
+    CleanupStack::Pop( self );
+    return self;
+    }        
+    
+// Destructor
+EXPORT_C CPEGsmAudioData::~CPEGsmAudioData
+        (
+        // None.
+        )
+    {
+    delete iDtmfTonePlayer;
+    delete iInbandTonePlayer;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::PlayDtmfTone
+// Starts to play the given tone from dtmf player. 
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEGsmAudioData::PlayDtmfTone
+        ( 
+        const TChar& aTone //DTMF tone to play
+        ) const
+    {
+    TInt volume;  //DTMF tone volume
+    volume = iPhoneModel.DataStore()->KeypadVolume();
+
+    TEFLOGSTRING3( KTAREQIN, 
+        "AUD CPEGsmAudioData::PlayDtmfTone, aTone = %s, volume = %d", 
+        &aTone, 
+        volume );
+
+    iDtmfTonePlayer->SetVolume( volume );
+    iDtmfTonePlayer->PlayDtmfTone( aTone );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::StopDtmfTonePlay
+// Stops the playing of dtmf tone. 
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEGsmAudioData::StopDtmfTonePlay
+        (
+        )
+    {
+    TEFLOGSTRING( KTAREQIN, "AUD CPEGsmAudioData::StopDtmfTonePlay" );
+    iDtmfTonePlayer->Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::StopInbandTonePlay
+// Stops the playing of inband tone. 
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEGsmAudioData::StopInbandTonePlay
+        ( 
+        )
+    {
+    TEFLOGSTRING( KTAREQIN, "AUD CPEGsmAudioData::StopInbandTonePlay" );
+    iInbandTonePlayer->Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::PlayInbandTone
+// Starts to play the given tone from inband player.
+// -----------------------------------------------------------------------------
+//
+
+EXPORT_C void CPEGsmAudioData::PlayInbandTone()
+    {
+    TCCPTone tone = iPhoneModel.DataStore()->InbandTone();
+
+    TEFLOGSTRING2( KTAREQIN, 
+        "AUD CPEGsmAudioData::PlayInbandTone, tone = %d", 
+        tone );
+    iInbandTonePlayer->PlayInbandTone( tone );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::HandleDtmfEvent
+// From MCCEDtmfObserver.
+// All the occurred DTMF events are notified through this interface.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEGsmAudioData::HandleDTMFEvent( const MCCEDtmfObserver::TCCEDtmfEvent aEvent, 
+                                                const TInt aError, 
+                                                const TChar aTone )
+    {
+    TEFLOGSTRING3( 
+        KTAMESIN, 
+        "AUD CPEGsmAudioData::HandleDtmfEvent: aEvent %d, aError %d", 
+        aEvent, 
+        aError );
+        
+    if( aError == KErrNone )
+        {
+        switch( aEvent )
+            {                
+            case ECCEDtmfManualStart:
+            case ECCEDtmfSequenceStart:
+                if ( DtmfLocalPlayAllowed() )
+                    {
+                    TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: PlayDtmfTone" );
+                    PlayDtmfTone( aTone );
+                    }
+                else
+                    {
+                    TEFLOGSTRING( KTAERROR, "AUD CPEGSMAUDIODATA::HANDLEDTMFEVENT ! LOCAL PLAY NOT ALLOWED" );
+                    }
+
+                break;
+                
+            case ECCEDtmfManualStop:
+            case ECCEDtmfSequenceStop:
+            case ECCEDtmfManualAbort:
+            case ECCEDtmfSequenceAbort:
+            case ECCEDtmfStopInDtmfString:
+            case ECCEDtmfStringSendingCompleted:
+            default:
+                TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: StopDtmfTonePlay" );
+                //Stop tone playing
+                StopDtmfTonePlay();
+                break;
+            }
+        }
+    else
+        {
+        TEFLOGSTRING( KTAINT, "AUD CPEGsmAudioData::HandleDTMFEvent: Error case" );
+        //Stop tone playing
+        StopDtmfTonePlay();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::DtmfLocalPlayAllowed
+// Checks if a DTMF tone may be played locally
+// -----------------------------------------------------------------------------
+//
+TBool CPEGsmAudioData::DtmfLocalPlayAllowed() const
+    {
+    TBool localPlayAllowed( ETrue );
+    
+    // Check if dtmf string sending was requested by user
+    if ( iPhoneModel.DataStore()->DtmfString() == KNullDesC )
+        {
+        // No dtmf string was defined - assuming dtmf string sending was initiated
+        // by third party. Proceed to check if a connected SAT originated call exists
+        for( TInt callId = 0; callId < KPEMaximumNumberOfVoiceCalls; callId++ )
+            {
+            if( iPhoneModel.DataStore()->CallOrigin( callId ) == EPECallOriginSAT    
+                && iPhoneModel.DataStore()->CallState( callId ) == EPEStateConnected )
+                {
+                // SAT call is in connected state - prevent dtmf local play
+                localPlayAllowed = EFalse;
+                break;
+                }
+            }
+        }
+
+    return localPlayAllowed;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmAudioData::DoHandleVolumeChange
+// -----------------------------------------------------------------------------
+//
+void CPEGsmAudioData::DoHandleVolumeChange( TInt aVolume, TBool aSendMsg)
+
+    {
+    iInbandTonePlayer->SetVolume( aVolume );
+    CPEAudioData::DoHandleVolumeChange(aVolume , aSendMsg);
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+// None
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/audiohandling/src/peaudiohandlingpanic.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of audiohanling panic function
+*
+*/
+
+
+// INCLUDE FILES
+#include <pepanic.pan>
+#include "e32std.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS ========================================
+
+// -----------------------------------------------------------------------------
+// Panic
+// Creates audiohandling panic
+// Returns: None.
+// -----------------------------------------------------------------------------
+//
+GLDEF_C void Panic
+        ( 
+        TPEPanic aPanic 
+        )
+    {
+    _LIT( text, "AudioHandling Panic!" );
+    User::Panic( text, aPanic );
+    }
+
+// ==================== MEMBER FUNCTIONS =======================================
+// None.
+
+// ================= OTHER EXPORTED FUNCTIONS ==================================
+// None.
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/bwins/callhandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,79 @@
+EXPORTS
+	?NewL@CPECallHandling@@SAPAV1@AAVMPEPhoneModelInternal@@AAVCCCE@@AAVMCCEDtmfInterface@@@Z @ 1 NONAME ; class CPECallHandling * CPECallHandling::NewL(class MPEPhoneModelInternal &, class CCCE &, class MCCEDtmfInterface &)
+	?ErrorOccurred@CPEConferenceCall@@UAEXW4TCCPConferenceCallError@@@Z @ 2 NONAME ; void CPEConferenceCall::ErrorOccurred(enum TCCPConferenceCallError)
+	?DialEmergencyCall@CPECallHandling@@UAEXABV?$TBuf@$0GE@@@@Z @ 3 NONAME ; void CPECallHandling::DialEmergencyCall(class TBuf<100> const &)
+	?HangUp@CPECallHandling@@UAEHHW4TPEHangUpOptions@@@Z @ 4 NONAME ; int CPECallHandling::HangUp(int, enum TPEHangUpOptions)
+	?TransferCalls@CPECallHandling@@UAEHXZ @ 5 NONAME ; int CPECallHandling::TransferCalls(void)
+	?TerminateAllConnections@CPECallHandling@@UAEHXZ @ 6 NONAME ; int CPECallHandling::TerminateAllConnections(void)
+	?GetCallIdByState@CPECallHandling@@UBEHI@Z @ 7 NONAME ; int CPECallHandling::GetCallIdByState(unsigned int) const
+	?CallForwardEventOccurred@CPESupplementaryServicesMonitor@@UAEXW4TCCESsCallForwardEvent@MCCESsObserver@@ABVTDesC16@@@Z @ 8 NONAME ; void CPESupplementaryServicesMonitor::CallForwardEventOccurred(enum MCCESsObserver::TCCESsCallForwardEvent, class TDesC16 const &)
+	?CallDurationChanged@CPESingleCallObserver@@UAEXVTTimeIntervalSeconds@@@Z @ 9 NONAME ; void CPESingleCallObserver::CallDurationChanged(class TTimeIntervalSeconds)
+	?IsCallByCallId@CPECallArrayOwner@@UBEHH@Z @ 10 NONAME ; int CPECallArrayOwner::IsCallByCallId(int) const
+	?DoUnattendedTransfer@CPECallHandling@@UAEHABVTDesC16@@@Z @ 11 NONAME ; int CPECallHandling::DoUnattendedTransfer(class TDesC16 const &)
+	?DialCall@CPECallHandling@@UAEHABV?$TBuf@$0GE@@@AAH@Z @ 12 NONAME ; int CPECallHandling::DialCall(class TBuf<100> const &, int &)
+	?GetCallState@CPECallHandling@@UAEIH@Z @ 13 NONAME ; unsigned int CPECallHandling::GetCallState(int)
+	?GetCallInfo@CPECallHandling@@UAEHAAVTMobileCallInfoV3@RMobileCall@@H@Z @ 14 NONAME ; int CPECallHandling::GetCallInfo(class RMobileCall::TMobileCallInfoV3 &, int)
+	?RejectCall@CPECallHandling@@UAEHXZ @ 15 NONAME ; int CPECallHandling::RejectCall(void)
+	?AddConferenceMember@CPECallHandling@@UAEHXZ @ 16 NONAME ; int CPECallHandling::AddConferenceMember(void)
+	?DropMember@CPECallHandling@@UAEHH@Z @ 17 NONAME ; int CPECallHandling::DropMember(int)
+	?SwapCalls@CPECallHandling@@UAEHXZ @ 18 NONAME ; int CPECallHandling::SwapCalls(void)
+	?ErrorOccurred@CPESingleCallObserver@@UAEXW4TCCPError@@@Z @ 19 NONAME ; void CPESingleCallObserver::ErrorOccurred(enum TCCPError)
+	?SendErrorMessage@CPECall@@UAEXH@Z @ 20 NONAME ; void CPECall::SendErrorMessage(int)
+	?RejectUnattendedTransfer@CPECallHandling@@UAEHXZ @ 21 NONAME ; int CPECallHandling::RejectUnattendedTransfer(void)
+	?HoldCall@CPECallHandling@@UAEHXZ @ 22 NONAME ; int CPECallHandling::HoldCall(void)
+	?CLIEventOccurred@CPESupplementaryServicesMonitor@@UAEXW4TCCESsCLIEvent@MCCESsObserver@@@Z @ 23 NONAME ; void CPESupplementaryServicesMonitor::CLIEventOccurred(enum MCCESsObserver::TCCESsCLIEvent)
+	?ResumeCall@CPECallHandling@@UAEHXZ @ 24 NONAME ; int CPECallHandling::ResumeCall(void)
+	?GetLifeTime@CPECallHandling@@UAEHAAVTDes8@@@Z @ 25 NONAME ; int CPECallHandling::GetLifeTime(class TDes8 &)
+	?CallByCallId@CPECallArrayOwner@@UBEPAVMPECall@@H@Z @ 26 NONAME ; class MPECall * CPECallArrayOwner::CallByCallId(int) const
+	?GetCallDuration@CPECallHandling@@UAEHAAVTTimeIntervalSeconds@@H@Z @ 27 NONAME ; int CPECallHandling::GetCallDuration(class TTimeIntervalSeconds &, int)
+	?AnswerCall@CPECallHandling@@UAEHXZ @ 28 NONAME ; int CPECallHandling::AnswerCall(void)
+	??1CPECall@@MAE@XZ @ 29 NONAME ; CPECall::~CPECall(void)
+	?ActiveCallCount@CPECallArrayOwner@@UBEHXZ @ 30 NONAME ; int CPECallArrayOwner::ActiveCallCount(void) const
+	?NewL@CPEConferenceCall@@SAPAV1@AAVMPEMessageSender@@AAVCCCE@@@Z @ 31 NONAME ; class CPEConferenceCall * CPEConferenceCall::NewL(class MPEMessageSender &, class CCCE &)
+	?StartUp@CPECallHandling@@UAEXXZ @ 32 NONAME ; void CPECallHandling::StartUp(void)
+	?NotifyCurrentActiveALSLine@CPESupplementaryServicesMonitor@@UAEXH@Z @ 33 NONAME ; void CPESupplementaryServicesMonitor::NotifyCurrentActiveALSLine(int)
+	?GetCallTerminatedDiagnostics@CPECallHandling@@UBEHAAV?$TBuf@$0IA@@@@Z @ 34 NONAME ; int CPECallHandling::GetCallTerminatedDiagnostics(class TBuf<128> &) const
+	?GetNumberOfCalls@CPECallHandling@@UAEHXZ @ 35 NONAME ; int CPECallHandling::GetNumberOfCalls(void)
+	?CallCugEventOccurred@CPESupplementaryServicesMonitor@@UAEXW4TCCESsCugEvent@MCCESsObserver@@@Z @ 36 NONAME ; void CPESupplementaryServicesMonitor::CallCugEventOccurred(enum MCCESsObserver::TCCESsCugEvent)
+	?ConnectedCalls@CPECallHandling@@QAEHXZ @ 37 NONAME ; int CPECallHandling::ConnectedCalls(void)
+	?HandleDTMFEvent@CPEDtmfHandling@@UAEXW4TCCEDtmfEvent@MCCEDtmfObserver@@HVTChar@@@Z @ 38 NONAME ; void CPEDtmfHandling::HandleDTMFEvent(enum MCCEDtmfObserver::TCCEDtmfEvent, int, class TChar)
+	?BuildConference@CPECallHandling@@UAEHXZ @ 39 NONAME ; int CPECallHandling::BuildConference(void)
+	?VoiceCallDataByState@CPECallHandling@@QBEPAVCPESingleCall@@IAAH@Z @ 40 NONAME ; class CPESingleCall * CPECallHandling::VoiceCallDataByState(unsigned int, int &) const
+	?CallStateChanged@CPEConferenceCall@@UAEXW4TCCEConferenceCallState@MCCEConferenceCallObserver@@@Z @ 41 NONAME ; void CPEConferenceCall::CallStateChanged(enum MCCEConferenceCallObserver::TCCEConferenceCallState)
+	?IsCallInState@CPECallHandling@@UBEHI@Z @ 42 NONAME ; int CPECallHandling::IsCallInState(unsigned int) const
+	??0CPEDtmfHandling@@IAE@AAVCPECallHandling@@AAVMCCEDtmfInterface@@@Z @ 43 NONAME ; CPEDtmfHandling::CPEDtmfHandling(class CPECallHandling &, class MCCEDtmfInterface &)
+	?CallEventOccurred@CPESingleCallObserver@@UAEXW4TCCECallEvent@MCCECallObserver@@@Z @ 44 NONAME ; void CPESingleCallObserver::CallEventOccurred(enum MCCECallObserver::TCCECallEvent)
+	?StopDtmfTone@CPECallHandling@@UAEHXZ @ 45 NONAME ; int CPECallHandling::StopDtmfTone(void)
+	?GoOneToOne@CPECallHandling@@UAEHH@Z @ 46 NONAME ; int CPECallHandling::GoOneToOne(int)
+	?UpdatePhoneIdentity@CPECallHandling@@UAEHW4TPEMessagesFromPhoneEngine@MEngineMonitor@@@Z @ 47 NONAME ; int CPECallHandling::UpdatePhoneIdentity(enum MEngineMonitor::TPEMessagesFromPhoneEngine)
+	?CallStateChangedWithInband@CPESingleCallObserver@@UAEXW4TCallState@CCPCall@@@Z @ 48 NONAME ; void CPESingleCallObserver::CallStateChangedWithInband(enum CCPCall::TCallState)
+	?GetMissedCall@CPECallHandling@@UAEHAAHH@Z @ 49 NONAME ; int CPECallHandling::GetMissedCall(int &, int)
+	??1CPECallHandling@@UAE@XZ @ 50 NONAME ; CPECallHandling::~CPECallHandling(void)
+	?ReleaseAll@CPECallHandling@@UAEHXZ @ 51 NONAME ; int CPECallHandling::ReleaseAll(void)
+	?CancelDtmfPlay@CPECallHandling@@UAEXXZ @ 52 NONAME ; void CPECallHandling::CancelDtmfPlay(void)
+	?CallStateChanged@CPESingleCallObserver@@UAEXW4TCallState@CCPCall@@@Z @ 53 NONAME ; void CPESingleCallObserver::CallStateChanged(enum CCPCall::TCallState)
+	?StopDtmfSending@CPECallHandling@@UAEXXZ @ 54 NONAME ; void CPECallHandling::StopDtmfSending(void)
+	?CallTerminatedError@CPECallHandling@@UAEHH@Z @ 55 NONAME ; int CPECallHandling::CallTerminatedError(int)
+	?CallByName@CPECallArrayOwner@@UBEPAVMPECall@@ABV?$TBuf@$0IA@@@@Z @ 56 NONAME ; class MPECall * CPECallArrayOwner::CallByName(class TBuf<128> const &) const
+	?CallEventOccurred@CPEConferenceCall@@UAEXW4TCCEConferenceCallEvent@MCCEConferenceCallObserver@@PAVMCCECall@@@Z @ 57 NONAME ; void CPEConferenceCall::CallEventOccurred(enum MCCEConferenceCallObserver::TCCEConferenceCallEvent, class MCCECall *)
+	?ConstructL@CPEDtmfHandling@@MAEXXZ @ 58 NONAME ; void CPEDtmfHandling::ConstructL(void)
+	?SendDtmf@CPECallHandling@@UAEHABV?$TBuf@$0GE@@@@Z @ 59 NONAME ; int CPECallHandling::SendDtmf(class TBuf<100> const &)
+	?ContinueDtmfSending@CPECallHandling@@UAEXXZ @ 60 NONAME ; void CPECallHandling::ContinueDtmfSending(void)
+	?CallOwner@CPECallHandling@@UBEAAVMPECallOwner@@XZ @ 61 NONAME ; class MPECallOwner & CPECallHandling::CallOwner(void) const
+	?CallByState@CPECallArrayOwner@@UBEPAVMPECall@@I@Z @ 62 NONAME ; class MPECall * CPECallArrayOwner::CallByState(unsigned int) const
+	?NewL@CPEConferenceCall@@SAPAV1@AAVMPEMessageSender@@AAVMCCEConferenceCall@@@Z @ 63 NONAME ; class CPEConferenceCall * CPEConferenceCall::NewL(class MPEMessageSender &, class MCCEConferenceCall &)
+	?IsCallByState@CPECallArrayOwner@@UBEHI@Z @ 64 NONAME ; int CPECallArrayOwner::IsCallByState(unsigned int) const
+	?AcceptUnattendedTransfer@CPECallHandling@@UAEHXZ @ 65 NONAME ; int CPECallHandling::AcceptUnattendedTransfer(void)
+	?HandleTransfer@CPESingleCallObserver@@UAEXHABVTDesC16@@@Z @ 66 NONAME ; void CPESingleCallObserver::HandleTransfer(int, class TDesC16 const &)
+	?ReplaceActive@CPECallHandling@@UAEHXZ @ 67 NONAME ; int CPECallHandling::ReplaceActive(void)
+	?CallCapsChanged@CPESingleCallObserver@@UAEXW4TCCECallControlCaps@MCCECallObserver@@@Z @ 68 NONAME ; void CPESingleCallObserver::CallCapsChanged(enum MCCECallObserver::TCCECallControlCaps)
+	?NewL@CPEDtmfHandling@@SAPAV1@AAVCPECallHandling@@AAVMCCEDtmfInterface@@@Z @ 69 NONAME ; class CPEDtmfHandling * CPEDtmfHandling::NewL(class CPECallHandling &, class MCCEDtmfInterface &)
+	?StartDtmfTone@CPECallHandling@@UAEHABVTChar@@@Z @ 70 NONAME ; int CPECallHandling::StartDtmfTone(class TChar const &)
+	?DialMultimedia@CPECallHandling@@UAEHABV?$TBuf@$0GE@@@AAH@Z @ 71 NONAME ; int CPECallHandling::DialMultimedia(class TBuf<100> const &, int &)
+	?SetActiveLine@CPECallHandling@@UAEXXZ @ 72 NONAME ; void CPECallHandling::SetActiveLine(void)
+	?BarringEventOccurred@CPESupplementaryServicesMonitor@@UAEXW4TCCESsBarringEvent@MCCESsObserver@@@Z @ 73 NONAME ; void CPESupplementaryServicesMonitor::BarringEventOccurred(enum MCCESsObserver::TCCESsBarringEvent)
+	??0CPECall@@IAE@AAVMPEMessageSender@@@Z @ 74 NONAME ; CPECall::CPECall(class MPEMessageSender &)
+	?ForwardCallToAddress@CPECallHandling@@UAEHH@Z @ 75 NONAME ; int CPECallHandling::ForwardCallToAddress(int)
+	??1CPEDtmfHandling@@UAE@XZ @ 76 NONAME ; CPEDtmfHandling::~CPEDtmfHandling(void)
+	?CallCapsChanged@CPEConferenceCall@@UAEXW4TCCEConferenceCallCaps@MCCEConferenceCallObserver@@@Z @ 77 NONAME ; void CPEConferenceCall::CallCapsChanged(enum MCCEConferenceCallObserver::TCCEConferenceCallCaps)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/data/callhandling_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing call handling component.
+;
+; callhandling_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"callhandling"},(0x1000A82F),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\callhandling.dll"
\ No newline at end of file
Binary file phoneengine/callhandling/data/callhandling_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/eabi/callhandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,168 @@
+EXPORTS
+	_ZN15CPECallHandling10AnswerCallEv @ 1 NONAME
+	_ZN15CPECallHandling10DropMemberEi @ 2 NONAME
+	_ZN15CPECallHandling10GoOneToOneEi @ 3 NONAME
+	_ZN15CPECallHandling10RejectCallEv @ 4 NONAME
+	_ZN15CPECallHandling10ReleaseAllEv @ 5 NONAME
+	_ZN15CPECallHandling10ResumeCallEv @ 6 NONAME
+	_ZN15CPECallHandling11GetCallInfoERN11RMobileCall17TMobileCallInfoV3Ei @ 7 NONAME
+	_ZN15CPECallHandling11GetLifeTimeER5TDes8 @ 8 NONAME
+	_ZN15CPECallHandling12GetCallStateEi @ 9 NONAME
+	_ZN15CPECallHandling12StopDtmfToneEv @ 10 NONAME
+	_ZN15CPECallHandling13GetMissedCallERii @ 11 NONAME
+	_ZN15CPECallHandling13ReplaceActiveEv @ 12 NONAME
+	_ZN15CPECallHandling13SetActiveLineEv @ 13 NONAME
+	_ZN15CPECallHandling13StartDtmfToneERK5TChar @ 14 NONAME
+	_ZN15CPECallHandling13TransferCallsEv @ 15 NONAME
+	_ZN15CPECallHandling14CancelDtmfPlayEv @ 16 NONAME
+	_ZN15CPECallHandling14ConnectedCallsEv @ 17 NONAME
+	_ZN15CPECallHandling14DialMultimediaERK4TBufILi100EERi @ 18 NONAME
+	_ZN15CPECallHandling15BuildConferenceEv @ 19 NONAME
+	_ZN15CPECallHandling15GetCallDurationER20TTimeIntervalSecondsi @ 20 NONAME
+	_ZN15CPECallHandling15StopDtmfSendingEv @ 21 NONAME
+	_ZN15CPECallHandling16GetNumberOfCallsEv @ 22 NONAME
+	_ZN15CPECallHandling17DialEmergencyCallERK4TBufILi100EE @ 23 NONAME
+	_ZN15CPECallHandling19AddConferenceMemberEv @ 24 NONAME
+	_ZN15CPECallHandling19CallTerminatedErrorEi @ 25 NONAME
+	_ZN15CPECallHandling19ContinueDtmfSendingEv @ 26 NONAME
+	_ZN15CPECallHandling19UpdatePhoneIdentityEN14MEngineMonitor26TPEMessagesFromPhoneEngineE @ 27 NONAME
+	_ZN15CPECallHandling20DoUnattendedTransferERK7TDesC16 @ 28 NONAME
+	_ZN15CPECallHandling20ForwardCallToAddressEi @ 29 NONAME
+	_ZN15CPECallHandling23TerminateAllConnectionsEv @ 30 NONAME
+	_ZN15CPECallHandling24AcceptUnattendedTransferEv @ 31 NONAME
+	_ZN15CPECallHandling24RejectUnattendedTransferEv @ 32 NONAME
+	_ZN15CPECallHandling4NewLER21MPEPhoneModelInternalR4CCCER17MCCEDtmfInterface @ 33 NONAME
+	_ZN15CPECallHandling6HangUpEi16TPEHangUpOptions @ 34 NONAME
+	_ZN15CPECallHandling7StartUpEv @ 35 NONAME
+	_ZN15CPECallHandling8DialCallERK4TBufILi100EERi @ 36 NONAME
+	_ZN15CPECallHandling8HoldCallEv @ 37 NONAME
+	_ZN15CPECallHandling8SendDtmfERK4TBufILi100EE @ 38 NONAME
+	_ZN15CPECallHandling9SwapCallsEv @ 39 NONAME
+	_ZN15CPECallHandlingD0Ev @ 40 NONAME
+	_ZN15CPECallHandlingD1Ev @ 41 NONAME
+	_ZN15CPECallHandlingD2Ev @ 42 NONAME
+	_ZN15CPEDtmfHandling10ConstructLEv @ 43 NONAME
+	_ZN15CPEDtmfHandling15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 44 NONAME
+	_ZN15CPEDtmfHandling4NewLER15CPECallHandlingR17MCCEDtmfInterface @ 45 NONAME
+	_ZN15CPEDtmfHandlingC1ER15CPECallHandlingR17MCCEDtmfInterface @ 46 NONAME
+	_ZN15CPEDtmfHandlingC2ER15CPECallHandlingR17MCCEDtmfInterface @ 47 NONAME
+	_ZN15CPEDtmfHandlingD0Ev @ 48 NONAME
+	_ZN15CPEDtmfHandlingD1Ev @ 49 NONAME
+	_ZN15CPEDtmfHandlingD2Ev @ 50 NONAME
+	_ZN17CPEConferenceCall13ErrorOccurredE23TCCPConferenceCallError @ 51 NONAME
+	_ZN17CPEConferenceCall15CallCapsChangedEN26MCCEConferenceCallObserver22TCCEConferenceCallCapsE @ 52 NONAME
+	_ZN17CPEConferenceCall16CallStateChangedEN26MCCEConferenceCallObserver23TCCEConferenceCallStateE @ 53 NONAME
+	_ZN17CPEConferenceCall17CallEventOccurredEN26MCCEConferenceCallObserver23TCCEConferenceCallEventEP8MCCECall @ 54 NONAME
+	_ZN21CPESingleCallObserver13ErrorOccurredE9TCCPError @ 55 NONAME
+	_ZN21CPESingleCallObserver14HandleTransferEiRK7TDesC16 @ 56 NONAME
+	_ZN21CPESingleCallObserver15CallCapsChangedEN16MCCECallObserver19TCCECallControlCapsE @ 57 NONAME
+	_ZN21CPESingleCallObserver16CallStateChangedEN7CCPCall10TCallStateE @ 58 NONAME
+	_ZN21CPESingleCallObserver17CallEventOccurredEN16MCCECallObserver13TCCECallEventE @ 59 NONAME
+	_ZN21CPESingleCallObserver19CallDurationChangedE20TTimeIntervalSeconds @ 60 NONAME
+	_ZN21CPESingleCallObserver26CallStateChangedWithInbandEN7CCPCall10TCallStateE @ 61 NONAME
+	_ZN31CPESupplementaryServicesMonitor16CLIEventOccurredEN14MCCESsObserver14TCCESsCLIEventE @ 62 NONAME
+	_ZN31CPESupplementaryServicesMonitor20BarringEventOccurredEN14MCCESsObserver18TCCESsBarringEventE @ 63 NONAME
+	_ZN31CPESupplementaryServicesMonitor20CallCugEventOccurredEN14MCCESsObserver14TCCESsCugEventE @ 64 NONAME
+	_ZN31CPESupplementaryServicesMonitor24CallForwardEventOccurredEN14MCCESsObserver22TCCESsCallForwardEventERK7TDesC16 @ 65 NONAME
+	_ZN31CPESupplementaryServicesMonitor26NotifyCurrentActiveALSLineEi @ 66 NONAME
+	_ZN7CPECall16SendErrorMessageEi @ 67 NONAME
+	_ZN7CPECallC1ER16MPEMessageSender @ 68 NONAME
+	_ZN7CPECallC2ER16MPEMessageSender @ 69 NONAME
+	_ZN7CPECallD0Ev @ 70 NONAME
+	_ZN7CPECallD1Ev @ 71 NONAME
+	_ZN7CPECallD2Ev @ 72 NONAME
+	_ZNK15CPECallHandling13IsCallInStateEj @ 73 NONAME
+	_ZNK15CPECallHandling16GetCallIdByStateEj @ 74 NONAME
+	_ZNK15CPECallHandling20VoiceCallDataByStateEjRi @ 75 NONAME
+	_ZNK15CPECallHandling28GetCallTerminatedDiagnosticsER4TBufILi128EE @ 76 NONAME
+	_ZNK15CPECallHandling9CallOwnerEv @ 77 NONAME
+	_ZNK17CPECallArrayOwner10CallByNameERK4TBufILi128EE @ 78 NONAME
+	_ZNK17CPECallArrayOwner11CallByStateEj @ 79 NONAME
+	_ZNK17CPECallArrayOwner12CallByCallIdEi @ 80 NONAME
+	_ZNK17CPECallArrayOwner13IsCallByStateEj @ 81 NONAME
+	_ZNK17CPECallArrayOwner14IsCallByCallIdEi @ 82 NONAME
+	_ZNK17CPECallArrayOwner15ActiveCallCountEv @ 83 NONAME
+	_ZTI13CPESingleCall @ 84 NONAME
+	_ZTI15CPECallHandling @ 85 NONAME
+	_ZTI15CPEDtmfHandling @ 86 NONAME
+	_ZTI17CPECallArrayOwner @ 87 NONAME
+	_ZTI17CPEConferenceCall @ 88 NONAME
+	_ZTI18CPEGprsTermination @ 89 NONAME
+	_ZTI18CPESystemCallState @ 90 NONAME
+	_ZTI20CPEVideoCallHandling @ 91 NONAME
+	_ZTI21CPESingleCallObserver @ 92 NONAME
+	_ZTI31CPESupplementaryServicesMonitor @ 93 NONAME
+	_ZTI7CPECall @ 94 NONAME
+	_ZTV13CPESingleCall @ 95 NONAME
+	_ZTV15CPECallHandling @ 96 NONAME
+	_ZTV15CPEDtmfHandling @ 97 NONAME
+	_ZTV17CPECallArrayOwner @ 98 NONAME
+	_ZTV17CPEConferenceCall @ 99 NONAME
+	_ZTV18CPEGprsTermination @ 100 NONAME
+	_ZTV18CPESystemCallState @ 101 NONAME
+	_ZTV20CPEVideoCallHandling @ 102 NONAME
+	_ZTV21CPESingleCallObserver @ 103 NONAME
+	_ZTV31CPESupplementaryServicesMonitor @ 104 NONAME
+	_ZTV7CPECall @ 105 NONAME
+	_ZThn24_N17CPEConferenceCall13ErrorOccurredE23TCCPConferenceCallError @ 106 NONAME
+	_ZThn24_N17CPEConferenceCall15CallCapsChangedEN26MCCEConferenceCallObserver22TCCEConferenceCallCapsE @ 107 NONAME
+	_ZThn24_N17CPEConferenceCall16CallStateChangedEN26MCCEConferenceCallObserver23TCCEConferenceCallStateE @ 108 NONAME
+	_ZThn24_N17CPEConferenceCall17CallEventOccurredEN26MCCEConferenceCallObserver23TCCEConferenceCallEventEP8MCCECall @ 109 NONAME
+	_ZThn24_N21CPESingleCallObserver13ErrorOccurredE9TCCPError @ 110 NONAME
+	_ZThn24_N21CPESingleCallObserver14HandleTransferEiRK7TDesC16 @ 111 NONAME
+	_ZThn24_N21CPESingleCallObserver15CallCapsChangedEN16MCCECallObserver19TCCECallControlCapsE @ 112 NONAME
+	_ZThn24_N21CPESingleCallObserver16CallStateChangedEN7CCPCall10TCallStateE @ 113 NONAME
+	_ZThn24_N21CPESingleCallObserver17CallEventOccurredEN16MCCECallObserver13TCCECallEventE @ 114 NONAME
+	_ZThn24_N21CPESingleCallObserver19CallDurationChangedE20TTimeIntervalSeconds @ 115 NONAME
+	_ZThn24_N21CPESingleCallObserver26CallStateChangedWithInbandEN7CCPCall10TCallStateE @ 116 NONAME
+	_ZThn4_N15CPEDtmfHandling15HandleDTMFEventEN16MCCEDtmfObserver13TCCEDtmfEventEi5TChar @ 117 NONAME
+	_ZThn4_NK17CPECallArrayOwner10CallByNameERK4TBufILi128EE @ 118 NONAME
+	_ZThn4_NK17CPECallArrayOwner11CallByStateEj @ 119 NONAME
+	_ZThn4_NK17CPECallArrayOwner12CallByCallIdEi @ 120 NONAME
+	_ZThn4_NK17CPECallArrayOwner13IsCallByStateEj @ 121 NONAME
+	_ZThn4_NK17CPECallArrayOwner14IsCallByCallIdEi @ 122 NONAME
+	_ZThn4_NK17CPECallArrayOwner15ActiveCallCountEv @ 123 NONAME
+	_ZThn8_N15CPECallHandling10AnswerCallEv @ 124 NONAME
+	_ZThn8_N15CPECallHandling10DropMemberEi @ 125 NONAME
+	_ZThn8_N15CPECallHandling10GoOneToOneEi @ 126 NONAME
+	_ZThn8_N15CPECallHandling10RejectCallEv @ 127 NONAME
+	_ZThn8_N15CPECallHandling10ReleaseAllEv @ 128 NONAME
+	_ZThn8_N15CPECallHandling10ResumeCallEv @ 129 NONAME
+	_ZThn8_N15CPECallHandling11GetCallInfoERN11RMobileCall17TMobileCallInfoV3Ei @ 130 NONAME
+	_ZThn8_N15CPECallHandling11GetLifeTimeER5TDes8 @ 131 NONAME
+	_ZThn8_N15CPECallHandling12GetCallStateEi @ 132 NONAME
+	_ZThn8_N15CPECallHandling12StopDtmfToneEv @ 133 NONAME
+	_ZThn8_N15CPECallHandling13GetMissedCallERii @ 134 NONAME
+	_ZThn8_N15CPECallHandling13ReplaceActiveEv @ 135 NONAME
+	_ZThn8_N15CPECallHandling13SetActiveLineEv @ 136 NONAME
+	_ZThn8_N15CPECallHandling13StartDtmfToneERK5TChar @ 137 NONAME
+	_ZThn8_N15CPECallHandling13TransferCallsEv @ 138 NONAME
+	_ZThn8_N15CPECallHandling14CancelDtmfPlayEv @ 139 NONAME
+	_ZThn8_N15CPECallHandling14DialMultimediaERK4TBufILi100EERi @ 140 NONAME
+	_ZThn8_N15CPECallHandling15BuildConferenceEv @ 141 NONAME
+	_ZThn8_N15CPECallHandling15GetCallDurationER20TTimeIntervalSecondsi @ 142 NONAME
+	_ZThn8_N15CPECallHandling15StopDtmfSendingEv @ 143 NONAME
+	_ZThn8_N15CPECallHandling16GetNumberOfCallsEv @ 144 NONAME
+	_ZThn8_N15CPECallHandling17DialEmergencyCallERK4TBufILi100EE @ 145 NONAME
+	_ZThn8_N15CPECallHandling19AddConferenceMemberEv @ 146 NONAME
+	_ZThn8_N15CPECallHandling19CallTerminatedErrorEi @ 147 NONAME
+	_ZThn8_N15CPECallHandling19ContinueDtmfSendingEv @ 148 NONAME
+	_ZThn8_N15CPECallHandling19UpdatePhoneIdentityEN14MEngineMonitor26TPEMessagesFromPhoneEngineE @ 149 NONAME
+	_ZThn8_N15CPECallHandling20DoUnattendedTransferERK7TDesC16 @ 150 NONAME
+	_ZThn8_N15CPECallHandling20ForwardCallToAddressEi @ 151 NONAME
+	_ZThn8_N15CPECallHandling23TerminateAllConnectionsEv @ 152 NONAME
+	_ZThn8_N15CPECallHandling24AcceptUnattendedTransferEv @ 153 NONAME
+	_ZThn8_N15CPECallHandling24RejectUnattendedTransferEv @ 154 NONAME
+	_ZThn8_N15CPECallHandling6HangUpEi16TPEHangUpOptions @ 155 NONAME
+	_ZThn8_N15CPECallHandling7StartUpEv @ 156 NONAME
+	_ZThn8_N15CPECallHandling8DialCallERK4TBufILi100EERi @ 157 NONAME
+	_ZThn8_N15CPECallHandling8HoldCallEv @ 158 NONAME
+	_ZThn8_N15CPECallHandling8SendDtmfERK4TBufILi100EE @ 159 NONAME
+	_ZThn8_N15CPECallHandling9SwapCallsEv @ 160 NONAME
+	_ZThn8_N15CPECallHandlingD0Ev @ 161 NONAME
+	_ZThn8_N15CPECallHandlingD1Ev @ 162 NONAME
+	_ZThn8_NK15CPECallHandling13IsCallInStateEj @ 163 NONAME
+	_ZThn8_NK15CPECallHandling16GetCallIdByStateEj @ 164 NONAME
+	_ZThn8_NK15CPECallHandling28GetCallTerminatedDiagnosticsER4TBufILi128EE @ 165 NONAME
+	_ZThn8_NK15CPECallHandling9CallOwnerEv @ 166 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CallHandling bld file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/mpecallhandling.h            |../../inc/mpecallhandling.h
+../inc/cpecallhandling.h            |../../inc/cpecallhandling.h
+../inc/mpecallowner.h               |../../inc/mpecallowner.h
+../inc/mpecallinitialiser.h         |../../inc/mpecallinitialiser.h
+../inc/mpemessagesender.h           |../../inc/mpemessagesender.h
+../inc/mpecall.h                    |../../inc/mpecall.h
+
+// SIS stubs
+../data/callhandling_stub.sis       /epoc32/data/z/system/install/callhandling_stub.sis
+
+PRJ_MMPFILES
+callhandling.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/group/callhandling.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for Call Handling dll
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          callhandling.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x1000A82F
+VENDORID        VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH      ../src
+
+SOURCE      cpecall.cpp
+SOURCE      cpesinglecall.cpp
+SOURCE      cpesinglecallobserver.cpp
+SOURCE      cpecallhandling.cpp
+SOURCE      cpedtmfhandling.cpp
+SOURCE      cpeconferencecall.cpp 
+SOURCE      pecallhandlingpanic.cpp
+SOURCE      cpesupplementaryservicesmonitor.cpp
+SOURCE      cpecallarrayowner.cpp
+SOURCE      cpegprstermination.cpp
+SOURCE      cpesystemcallstate.cpp
+SOURCE      cpevideocallhandling.cpp
+SOURCE      cpecceobserver.cpp
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../inc       // PhoneEngine private headers
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+SYSTEMINCLUDE   /epoc32/include/kernel
+
+LIBRARY callprovider.lib
+LIBRARY cce.lib
+LIBRARY ecom.lib    // ECOM plugin usage.
+LIBRARY engineinfo.lib
+LIBRARY etelmm.lib //TO BE REMOVED! STILL USED BY CPECallHandling.
+LIBRARY euser.lib
+LIBRARY featmgr.lib // Feature manager. 
+LIBRARY flogger.lib
+LIBRARY phonesettings.lib
+
+LANG            SC
+START WINS
+BASEADDRESS 0x10040000
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpecall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPECall object
+*
+*/
+
+
+#ifndef CPECALL_H
+#define CPECALL_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+#include <mccecall.h>
+#include <mccecallobserver.h>
+#include <mpecall.h>
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None. 
+
+// FORWARD DECLARATIONS
+class MPEMessageSender;
+class MCCECallObserver;
+
+// CLASS DECLARATION
+
+/**
+*  Create call handling requests to Call Command object
+*  @lib CallHandling.lib
+*  @since Series60_4.0
+*/
+class CPECall 
+        : public CBase,
+          public MPECall
+    {
+    protected: //Constructors and descructor
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CPECall( MPEMessageSender& aOwner );
+
+        /**
+        * Destructor.
+        */
+        virtual IMPORT_C ~CPECall();
+              
+    public:    //New functions
+        
+        /**
+        * Reroutes call messages from other objects to call handling object
+        * @param aMessage The message code of the message
+        */    
+        virtual void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+        
+        /**
+        * Reroutes error messages from other objects to call handling object
+        * @param aErrorCode The error code of the failed operation
+        */        
+        IMPORT_C virtual void SendErrorMessage( const TInt aErrorCode );
+        
+        /**
+        * Returns call error code and cause.
+        * @param aErrorCode, the error code stored after previous unsuccessful request
+        */
+        virtual void GetErrorCode( TInt& aErrorCode ) const;
+        
+        /**
+        * Sets call status information
+        * @param aCallState the status of the current call
+        */    
+        virtual void SetCallState( const TPEState aCallState );
+
+        /**
+        * Returns call status information
+        * @return the status of the current call
+        */    
+        virtual TPEState GetCallState() const;
+
+        /**
+        * Sets call ID number
+        * @param aCallId, the call id number
+        */    
+        virtual void SetCallId( const TInt aCallId );
+        
+        /**
+        * Returns call id number
+        * @return the call id number
+        */    
+        virtual TInt GetCallId() const;
+
+    protected:
+
+        // Reference to owner of this class
+        MPEMessageSender& iOwner;
+        // The id number of the call
+        TInt iCallId;
+        // The current state of the call
+        TInt iCallState;
+        // Includes possible error code of the call.
+        TInt iErrorCode;
+    };
+
+#endif // CPECALLDATA_H
+
+//    End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpecallarrayowner.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPECallArrayOwner object
+*
+*/
+
+
+#ifndef CPECALLARRAYOWNER_H
+#define CPECALLARRAYOWNER_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+#include <mccecall.h>
+#include <mpecallowner.h>
+#include "cpesinglecall.h"
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None. 
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class MPEMessageSender;
+class CCCE;
+
+/**
+*  Create call handling requests to Call Command object
+*  @lib CallHandling.lib
+*  @since Series60_4.0
+*/
+class CPECallArrayOwner 
+        : public CBase,
+          public MPECallOwner
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        virtual ~CPECallArrayOwner();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPECallArrayOwner* NewL( 
+            CCCE& iConvergedCallEngine, 
+            MPEMessageSender& aOwner );
+
+    private: //Constructors and descructor
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL(
+            CCCE& iConvergedCallEngine, 
+            MPEMessageSender& aOwner );
+    
+        /**
+        * C++ default constructor.
+        */
+        CPECallArrayOwner();
+
+    public:    //New functions
+    
+        /**
+        * 
+        * @param aCallId, the call id number
+        */    
+        CPESingleCall* CreateCallL( MPEMessageSender& aOwner );
+        
+        /**
+        * 
+        * @param aCallId, the call id number
+        */    
+        CPESingleCall* GetCallObject( const TInt aCallId ) const;
+
+        /**
+        * 
+        * @param aIndex, index to call array
+        */    
+        CPESingleCall* GetCallObjectByIndex( const TInt aIndex ) const;
+
+        /**
+        * 
+        * @param aCallId, the call id number
+        */    
+        TInt DeleteCallObject( const TInt aCallId );
+        
+        /**
+        * Return call count
+        * @param None
+        */ 
+        TInt Count() const;
+        
+        /**
+        * Create data call object
+        * @param aOwner
+        */ 
+        CPESingleCall* CreateDataCallL( MPEMessageSender& aOwner );
+        
+        /**
+        * returns CPESingleCall call object by State, NULL if not found.
+        * @param aState
+        */ 
+        CPESingleCall* CallPointerByState( TPEState aState ) const;
+        
+        /**
+        * returns CPESingleCall call object by Name, NULL if not found.
+        * @param aState
+        */
+        CPESingleCall* CallPointerByName( const TName& aName ) const;
+       
+    public:    // MPECallArrayOwner
+        
+        /**
+        * returns ETrue if call object found by state, NULL if not found.
+        * @param aState, the wanted call state.
+        */ 
+        IMPORT_C TBool IsCallByState( 
+            const TPEState aState ) const;
+        
+        /**
+        * returns ETrue if call object found by call ID, NULL if not found.
+        * @param aCallId, the wanted call id.
+        */    
+        IMPORT_C TBool IsCallByCallId( 
+            const TInt aCallId ) const;
+            
+        /**
+        * returns pointer to MPECall object by CallId, NULL if not found.
+        * @param aName, the wanted name.
+        */    
+        IMPORT_C MPECall* CallByName( 
+            const TName& aName ) const;
+        
+        /**
+        * Return active call count, other then idle state.
+        * @param None
+        */ 
+        IMPORT_C TInt ActiveCallCount() const;
+        
+        /**
+        * returns pointer to MPECall object by CallId, NULL if not found.
+        * @param aCallId, the call id number
+        */    
+        IMPORT_C MPECall* CallByCallId( const TInt aCallId ) const;
+        
+        /**
+        * returns pointer to MPECall object by state, NULL if not found.
+        * @param aState
+        */ 
+        IMPORT_C MPECall* CallByState( TPEState aState ) const;
+
+    private:
+        
+        /**
+        * Create emergency call object
+        * @param aOwner
+        */    
+        CPESingleCall* CreateEmergencyCallL( MPEMessageSender& aOwner );
+        
+    private: // Data
+
+        // RPointerArray object which contains CPESingleCall objects.
+        RPointerArray<CPESingleCall>* iCallArray; 
+
+    };
+
+#endif // CPECALLARRAYOWNER_H
+
+//    End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpecallhandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,696 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPECallHandling class.
+*
+*/
+
+
+#ifndef CPECALLHANDLING_H
+#define CPECALLHANDLING_H
+
+//INCLUDES
+#include <etel.h>
+#include <etelmm.h>
+#include <ccce.h>
+#include <pevirtualengine.h>
+#include <mpemessagesender.h>
+#include <mccedtmfinterface.h>
+#include "mpecallinitialiser.h"
+#include <mpecallhandling.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPEVideoCallHandling;
+class MPEPhoneModelInternal;
+class CPELine;
+class CPEDtmfHandling;
+class CPESingleCall;
+class CPEConferenceCall;
+class CPESupplementaryServicesMonitor;
+class CPECallArrayOwner;
+class CPsetSAObserver;
+class CCCECallParameters;
+class CPECCEObserver;
+class CPESystemCallState;
+
+// CLASS DECLARATION
+
+/**
+* CPECallHandling Handles voice call related events from phone engine.
+*
+*  @lib callhandling.lib
+*  @since Series60_4.0
+*/
+class CPECallHandling 
+        : public CBase, 
+          public MPEMessageSender,
+          public MPECallHandling,
+          public MPECallInitialiser
+    {
+    public: //Constructors and descructor
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPECallHandling* NewL( MPEPhoneModelInternal& aModel, 
+            CCCE& aConvergedCallEngine,
+            MCCEDtmfInterface& aDtmfInterface );
+
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPECallHandling();
+
+    protected:  // Constructors and destructor
+        /**
+        * C++ default constructor.
+        */
+        CPECallHandling( MPEPhoneModelInternal& aModel,
+            CCCE& aConvergedCallEngine,
+            MCCEDtmfInterface& aDtmfInterface );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    public: // From MPEMessageSender
+    
+        /**
+        * Reroutes error message to Phone Engine, usable by call objects
+        * @param aCallId Identification number of the call.
+        * @param aErrorCode, the error code stored after previous unsuccessful request
+        */
+        void SendErrorMessage( 
+            const TInt aCallId, 
+            const TInt aErrorCode );
+        
+        /**
+        * Reroutes messages to Phone Engine, usable by call objects
+        * @param aMessage Message id.
+        * @param aCallId Identification number of the call.
+        */
+        void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+            const TInt aCallId );
+            
+        /**
+        * Reroutes call messages
+        * @param aMessage The message code of the message
+        * @param aName Name of call fill be maped to call id
+        */  
+        void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+            const TName& aName );
+        
+        /**
+         * Reroutes call messages.
+         * @param aMessage specifies the event that has taken place
+         */
+        void HandleInternalMessage(
+            TInt aMessage );
+
+    public: // From MPEMonitorCommandOwner
+        /**
+        * Reroutes error messages to Phone Engine, usable by other than call objects
+        * @param aErrorCode, the error code stored after previous unsuccessful request
+        */
+        void SendErrorMessage( 
+            const TInt aErrorCode );
+
+        /**
+        * Reroutes messages to Phone Engine, usable by other than call objects
+        * @param aMessage The message code of the message
+        */    
+        void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+
+    public: // From MPECallHandling
+        /**
+        * Starts monitoring incoming calls for voice and data call.
+        */
+        IMPORT_C void StartUp();
+
+        /**
+        * Makes answer request to the Multimode ETel. 
+        * @since Series60_4.0
+        * @param None.
+        * @return Error code.
+        */
+        IMPORT_C TInt AnswerCall();
+
+        /**
+        * Creates dialing request to the Multimode ETel. 
+        * @since Series60_4.0
+        * @param aNumber The telephone number to be called.
+        * @param aCallId Identification number of the call.
+        * @return Error (KErrNone is success).
+        */
+        IMPORT_C TInt DialCall( const TPEPhoneNumber& aNumber,TInt& aCallId );
+
+        /**
+        * Creates dialing request to the Multimode ETel. 
+        * @since Series60_4.0
+        * @param aNumber The telephone number to be called.
+        * @param aCallId Identification number of the call.
+        * @return Error (KErrNone is success).
+        */
+        IMPORT_C TInt DialMultimedia( const TPEPhoneNumber& aNumber,TInt& aCallId );
+
+        /**
+        * Returns call duration time.
+        * @since Series60_4.0
+        * @param aDuration Call duration.
+        * @param aCallId Identification number of the call.
+        * @return Error code (KErrNone or KErrNotFound).
+        */    
+        IMPORT_C TInt GetCallDuration( TTimeIntervalSeconds& aDuration, TInt aCallId );
+
+        /**
+        * Returns information of the call.
+        * @since Series60_4.0
+        * @param aCallInfo Current call information.
+        * @param aCallId Identification number of the call.
+        * @return Error code (KErrNone or KErrNotFound).
+        */
+        IMPORT_C  TInt GetCallInfo( 
+            RMobileCall::TMobileCallInfoV3& aCallInfo, 
+            TInt aCallId );
+
+        /**
+        * Returns state of the call.
+        * @since Series60_4.0
+        * @param aCallid Identification number of the call.
+        * @return Call state ( EPEStateUnknown is error).
+        */
+        IMPORT_C TPEState GetCallState( TInt aCallId );
+
+        /**
+        * Returns the missed voice call indicator. 
+        * @since Series60_4.0
+        * @param  aMissedCall, missed call indicator.
+        * @param aCallId, call idendificator.
+        * @return KErrNone or KErrNotFound.
+        */
+        IMPORT_C TInt GetMissedCall( TBool& aMissedCall, TInt aCallId );
+
+        /**
+        * Returns number of non-idle calls
+        * @since Series60_4.0
+        * @param  None.
+        * @return Number of current voice calls.
+        */
+        IMPORT_C TInt GetNumberOfCalls();
+
+        /**
+        * Returns remote alerting tone status (is it played by network or not).
+        * @since Series60_4.0
+        * @param aToneStatus Status of remote alerting tone play.
+        * @return None.
+        */
+       /* IMPORT_C void GetRemoteAlertingToneStatus( 
+            RMmCustomAPI::TRemoteAlertingToneStatus& aToneStatus );*/
+        
+        /**
+        * Makes HangUp request to the CCE. 
+        * @since Series60_4.0
+        * @param aCallId Identification number of the call to be rejected.
+        * @param aAutoResumeOption if options for autoresume.
+        * @return Error (KErrNone is success).
+        */
+        IMPORT_C TInt HangUp( TInt aCallId, TPEHangUpOptions aAutoResumeOption );
+
+        /**
+        * Determines if there is a call in given state.
+        * @since Series60_4.0
+        * @param aState Call state search key.
+        * @return TBool, ETrue is there is a call; otherwise EFalse.
+        */
+        IMPORT_C TBool IsCallInState( TPEState aState ) const;
+        
+        /**
+        * Determines if there is a call in given state.
+        * @since Series60_4.0
+        * @param aState Call state search key.
+        * @return callid is there is a call; otherwise KPECallIdNotUsed( -1 ).
+        */
+        IMPORT_C TInt GetCallIdByState( TPEState aState ) const;
+
+        /**
+        * Makes reject request to the Multimode ETel 
+        * @return Return possible error code
+        */
+        IMPORT_C TInt RejectCall( );
+
+        /**
+        * Makes HangUp requests for all call to the Multimode ETel. 
+        * @return Error (KErrNotFound if there is not a call and KErrNone if there one call at least).
+        */
+        IMPORT_C TInt ReleaseAll();
+
+        /**
+        * Set Dynamic Hscsd parameters.
+        * @param const TInt aRxSlots, Hscsd data call received timeslots amount
+                 const TInt aCallId, data call id.  
+        * @return KErrNone or KErrNotFound.
+        */
+        IMPORT_C TInt SetDynamicHscsdParams( TInt aRxSlots, TInt aCallId );
+
+        /**
+        * Terminate all connection request. 
+        */
+        IMPORT_C TInt TerminateAllConnections();
+        
+        /**
+        * Asks phone identity parameters from the mmetel.
+        * @param aMessage Reply message to the phone application.
+        * @return Error (KErrNone or KErrNotFound).
+        */
+        IMPORT_C TInt UpdatePhoneIdentity( 
+            MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+
+        /**
+        * Sets active line
+        */
+        IMPORT_C void SetActiveLine();
+
+        /**
+        * Makes transfer request to the Multimode ETel 
+        * @param None.
+        * @return Return possible error code
+        */
+        IMPORT_C TInt BuildConference();
+        
+        /**
+        * Swaps connected and held calls
+        * @since Series60_4.0
+        * @param  None.
+        * @return KErrNone or KErrNotFound.
+        */
+        IMPORT_C TInt SwapCalls();
+        
+        /**
+        * Add conference member.
+        * @return possible error code from the CallHandling subsystem.
+        */
+        IMPORT_C TInt AddConferenceMember();
+
+        /**
+        * Drops one member from the conference call
+        * @since Series60_4.0
+        * @param aCallid It is the Call Id of the call to be dropped
+        * @return Return possible error code
+        */
+        IMPORT_C TInt DropMember( TInt aCallId );
+
+        /**
+        * Splits one member from the conference call. 
+        * @since Series60_4.0
+        * @param aCallid It is the index number of the call to be splited. 
+        * @return Return possible error code
+        */
+        IMPORT_C TInt GoOneToOne( TInt aCallId );
+
+        /**
+        * Makes hold request for the connected call
+        * @return KErrNone if request was sent successfully
+        *         KErrGsmNotAllowed if no connected call was found
+        */
+        IMPORT_C TInt HoldCall();
+
+        /**
+        * Makes resume request for the held call
+        * @return KErrNone if request was sent successfully
+        *         KErrGsmNotAllowed if no held call was found
+        */
+        IMPORT_C TInt ResumeCall();
+
+        /**
+        * Makes transfer request to the Multimode ETel 
+        * @since Series60_4.0
+        * @param None. 
+        * @return KErrNone or KErrNotFound.
+        */
+        IMPORT_C TInt TransferCalls();
+
+        /**
+        * Creates emergency call request to the Multimode ETel 
+        * @since Series60_4.0
+        * @param None. 
+        * @return None.
+        */
+        IMPORT_C void DialEmergencyCall( const TPEPhoneNumber& aEmergencyNumber );
+
+        /**
+        * Returns call terminated diagnostics of a call
+        * Info is valid only for Idle call
+        * @since Series60_4.0
+        * @param aCallName, TName information of a call
+        * @return Return diagnostics info
+        */
+        IMPORT_C TInt GetCallTerminatedDiagnostics( 
+            TName& aCallName ) const;
+
+        /**
+        * Returns call terminated error
+        * @since Series60_4.0
+        * @return Return errorCode
+        */        
+        IMPORT_C TInt CallTerminatedError( const TInt aCallId );
+        
+        /**
+        * This method gets the lifetime of the MS. The lifetime information 
+        * includes the manufacturing date of the MS and the total amount of airtime use.
+        * @param aLifeTimeInfo Life time information
+        * @return Get succeeded or not.
+        */
+        IMPORT_C TBool GetLifeTime( TDes8& aLifeTimeInfo );
+        
+        /**
+        * Replace active call with waiting call. 
+        * @since Series60_5.0
+        * @return Error (KErrNone is success).
+        */
+        IMPORT_C TInt ReplaceActive();
+        
+        /**
+        * This method gets the reference to MPECallOwner object.
+        * @since Series60_4.0
+        * @param  None.
+        * @return None.
+        */
+        IMPORT_C MPECallOwner& CallOwner() const;
+
+        /**
+         * Accepts unattended transfer request. 
+         * @since    Series 60 v5.1
+         * @return   System wide error code.
+         */
+        IMPORT_C TInt AcceptUnattendedTransfer();
+        
+        /**
+         * Rejects unattended transfer request. 
+         * @since    Series 60 v5.1
+         * @return   System wide error code.
+         */
+        IMPORT_C TInt RejectUnattendedTransfer();
+
+        /**
+        * Does unattended transfer to the connected VoIP call 
+        * @since Series60_5.1
+        * @param aTransferTarget Address of the transfer target
+        * @return Error (KErrNone is success).
+        */
+        IMPORT_C TInt DoUnattendedTransfer( const TDesC& aTransferTarget );
+
+        /**
+        * Starts call forwarding. 
+        * @since Series60_5.1
+        * @param aIndex A array index for a selected address.
+        * @return Error (KErrNone is success).
+        */
+        IMPORT_C TInt ForwardCallToAddress( TInt aIndex );
+
+    public: // From MPECallHandling - DTMF related
+        /**
+        * Cancels Dtmf string sending.
+        */
+        IMPORT_C void CancelDtmfPlay();        
+
+        /**
+        * Allows a client to continue dtmf string sending when 
+        * it was stopped by use of 'w' char in the string.
+        */
+        IMPORT_C void ContinueDtmfSending();
+
+        /**
+        * Sends dtmf string.
+        * @param aDtmfString String to be sent.
+        * @return Symbian OS error code
+        */
+        IMPORT_C TInt SendDtmf( const TPEDtmfString& aDtmfString );
+
+        /**
+        * Sends dtmf tone
+        * @param aTone Tone to be sent.
+        * @return Error (KErrNone or KErrNotFound).
+        */
+        IMPORT_C TInt StartDtmfTone( const TChar& aTone );
+
+        /**
+        * Allows a client to cancel the sending of a dtmf string when 
+        * it was stopped by use of 'w' char in the string.
+        */
+        IMPORT_C void StopDtmfSending();
+
+        /**
+        * Stops sending dtmf tone.
+        * @return Error (KErrNone or KErrNotFound).
+        */
+        IMPORT_C TInt StopDtmfTone();
+
+    public: // From base class MPECallInitialiser
+
+        /**
+        * @see MPECallInitialiser::InitVoiceCall
+        */
+        void InitVoiceCall( MCCECall& aNewCall );
+        
+        /**
+        * @see MPECallInitialiser::InitVideoCall
+        */
+        void InitVideoCall( MCCECall& aNewCall );
+
+        /**
+        * @see MPECallInitialiser::InitConferenceCall
+        */
+        void InitConferenceCall( MCCEConferenceCall& aConference );
+
+    public:
+        /**
+        * Tells if there is any connected calls.
+        * @return Indication of connected call(s) (EFalse is no calls, ETrue is connected call(s)).
+        */
+        TBool ConnectedCalls();
+
+        /**
+        * Returns voice call object by state.
+        * @param aState Call state search key.
+        * @param aIndex Index of the found call object (-1 is not found).
+        * @param aGetCommandObject (if ETrue then find by command object state).
+        * @return Call object (NULL is not found).
+        */
+        CPESingleCall* VoiceCallDataByState( 
+            TPEState aState, 
+            TInt& aIndex ) const;
+        
+        /**
+        * SetCallParams.
+        * @param None.
+        * @return None.
+        */
+        void SetCallParams( TInt aCallId );
+
+        /**
+        * Creates CPECallData objects
+        * @since Series60_4.0
+        * @param None. 
+        * @return None. 
+        */
+        void CreateCallDataArraysL();
+
+        /**
+        * Create conference call
+        */
+        void CreateConferenceCallL( CPESingleCall& aCall1, CPESingleCall& aCall2 );
+        
+        /**
+        * Returns number of conference members
+        * @since Series60_4.0
+        * @param aCount It is variable, where number of participants is returned
+        * @return Return possible error code
+        */
+        TInt GetNumberOfParticipants( TInt& aCount );
+
+        /**
+        * Returns added or removed members TName information and CallId
+        * @since Series60_4.0
+        * @param aCallId, Conference calls CallId
+        * @param aCallName, TName information of dropped or added call
+        * @param aMemberCallId, CallId of the added or dropped call
+        * @return Return errorCode
+        */
+        TInt GetConferenceMemberNameAndId( TName& aCallName, TInt& aMemberCallId );
+
+        /**
+        * Get call control caps
+        * @since Series60_4.0
+        * @param aCallControlCaps, the call control caps.
+        * @return KErrNone or KErrNotFound.
+        */        
+        TInt GetCallControlCaps( TPECallControlCaps& aCallControlCaps, TInt aCallId );
+     
+        /**
+        * Returns Conference capabilities
+        * @since Series60_4.0
+        * @param aCallId, call identification number
+        * @param aCaps, capabilities are returned in this variable
+        * @return Return errorCode
+        */
+        TInt GetConferenceCallCaps( TUint32& aCaps );
+        
+        /**
+        * Create new CPESingleCall object to CPECallArrayOwner and open new MCCECall ojcte to CCE.
+        * @param None.
+        * @return returns pointer to CPESingleCall objecte.
+        */
+        CPESingleCall* OpenNewCallL( const TPEPhoneNumber& aNumber );
+
+        /**
+        * Adds one member to the conference call ( TRAPPED METHOD )
+        * @since Series60_4.0
+        * @param aCallid It is the index number of the call to be added
+        * @return Return possible error code
+        */
+        TInt AddMember( TInt aCallId );
+    
+        /**
+        * Adds one member to the conference call
+        * @since Series60_4.0
+        * @param aCallid It is the index number of the call to be added
+        */
+        void AddMemberL( TInt aCallId );
+        
+        /**
+        * Get call's secure status.
+        * @param aCallid.
+        * @return TBool ETrue if security is enabled, else EFalse.
+        */
+        TBool IsSecureCall( const TInt aCallId ) const;
+        
+        /** 
+        * Update System Agent setting for call forward.
+        * @since Series60_4.0
+        */
+        void UpdateSaSetting();
+        
+        /** 
+        * Defines basic service code for divert notification.
+        * @since Series60_4.0
+        * @param aLineType used line type
+        * @param call reference to call object
+        * @return Returns the basuc service code. 
+        */ 
+        TInt DefineDivertBsc( CCCECallParameters::TCCELineType aLineType, 
+                              CPESingleCall* call );
+
+        /**
+        * Check if dial allowed   
+        * @param aMultimediaDial. Is new dial multimedia
+        * @return ETrue if dial allowed
+        */
+        TBool IsDialAllowed( TBool aMultimediaDial );
+
+        /**
+        * Get call's secure specified status.
+        * @param aCallid.
+        * @return TBool ETrue if security is specified, else EFalse.
+        */
+        TBool SecureSpecified( const TInt aCallId ) const; 
+        
+        /**
+        * Initialise conference call info.
+        * @param call reference to call object
+        * @param call reference to call object
+        * @return None.
+        */
+        void InitialiseConferenceCallInfo( 
+            MCCECall& aCall1, 
+            MCCECall& aCall2 );
+        
+        /**
+        * Handle auto resume.
+        */
+        void HandleAutoResume();
+        
+    private:
+        
+        /**
+        * Delete's call object and reset's datastore.
+        * @param aCallid.
+        */
+        TInt ReleaseCallObject( const TInt aCallId  ); 
+        
+        /**
+         * Set call origin to datastore.
+         * @param aCallid.
+         * @param aCall reference to call object
+         */
+        void SetCallOrigin( const TInt aCallId, const MCCECall& aCall ) const;
+
+    protected:
+        // Phone model instance which owns this object.
+        MPEPhoneModelInternal& iModel;
+        // Handle to converged call engine (CCE) interface
+        CCCE& iConvergedCallEngine;
+        // Video call handling object handles video call operations.
+        CPEVideoCallHandling* iVideoCallHandling;
+        // CPEDtmfHandling object handles dtmf commands
+        CPEDtmfHandling* iDtmfHandling;   
+        // Member variable for CallHandling Errorcode
+        TInt iErrorCode;
+        // Call parameters for dialing
+        CCCECallParameters* iCallOpenParams;
+        
+        
+        //Create conference call CPEConferenceCall object
+        CPEConferenceCall* iConferenceCall;
+        // Supplementary Service Monitor
+        CPESupplementaryServicesMonitor* iSupplementaryServicesMonitor;
+        // Call array owner
+        CPECallArrayOwner* iCallArrayOwner;
+        // CCE dtmf interface
+        MCCEDtmfInterface& iDtmfInterface;
+        // Active line
+        CCCECallParameters::TCCELineType iActiveLine;
+        // Owned system agent observer. 
+        CPsetSAObserver* iPsetSAObserver;
+        // Emergency number
+        TPEPhoneNumber iEmergencyNumber;
+        // ReplaceActive       
+        TBool iReplaceActive;
+        // Status of dial, before dialing state
+        TBool iDialRequest;
+
+        /**
+         * CCE observer.
+         */
+        CPECCEObserver* iCCEObserver;
+        // System Call State
+        CPESystemCallState* iSystemCallState;
+    };
+
+#endif    // CPECALLHANDLING_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpecceobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observes CCE
+*
+*/
+
+
+#ifndef CCCEOBSERVER_H
+#define CCCEOBSERVER_H
+
+#include <e32base.h>
+#include <mcceobserver.h>
+
+class MPECallInitialiser;
+class MPEPhoneModelInternal;
+
+/**
+ *  Observes CCE
+ *
+ *  @lib callhandling.lib
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPECCEObserver ): public CBase, public MCCEObserver
+    {
+public:
+
+    static CPECCEObserver* NewL( 
+        MPECallInitialiser& aCallInitialiser,
+        MPEPhoneModelInternal& aPhoneModel );
+    
+    static CPECCEObserver* NewLC( 
+        MPECallInitialiser& aCallInitialiser,
+        MPEPhoneModelInternal& aPhoneModel );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CPECCEObserver();
+
+    /**
+     * ?description
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    
+// Methods from base class MCCEObserver
+    
+    /**
+     * @see MCCEObserver::IncomingCall
+     */
+    void IncomingCall( MCCECall& aCall );
+    
+    /**
+     * @see MCCEObserver::IncomingCall
+     */
+    void MOCallCreated( MCCECall& aCall );
+
+    /**
+     * @see MCCEObserver::ConferenceCallCreated
+     */
+    void ConferenceCallCreated( MCCEConferenceCall& aConferenceCall );
+    
+    /**
+     * @see MCCEObserver::IncomingCall
+     */
+    void DataPortName( TName& aPortName );
+
+private:
+
+    CPECCEObserver( 
+        MPECallInitialiser& aCallInitialiser,
+        MPEPhoneModelInternal& aPhoneModel );
+    
+    void NotifyCallInitialiser( MCCECall& aCall );
+
+private: // data
+    
+    /**
+     * Incoming and external call initialiser
+     */
+    MPECallInitialiser& iCallInitialiser;
+    
+    /**
+     * Phone model
+     */
+    MPEPhoneModelInternal& iPhoneModel;
+
+    };
+
+#endif // CCCEOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpeconferencecall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,232 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEConferenceCallData object
+*
+*/
+
+
+#ifndef CPECONFERENCECALLDATA_H
+#define CPECONFERENCECALLDATA_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+#include <ccce.h>
+#include <mcceconferencecall.h>
+#include <mcceconferencecallobserver.h>
+#include "cpecall.h"
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEMessageSender;
+
+// CLASS DECLARATION
+
+/**
+* This class handles Conference Calls. It forwards events and messages to CPECallHandling class
+* and uses Converged Call Engine interface to pass requests and receive event indications.
+*
+* @lib CallHandling.lib
+* @since Series60_4.0
+*/
+class CPEConferenceCall 
+        : public CPECall, 
+          public MCCEConferenceCallObserver
+    {
+    public: // Constructors and destructors
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPEConferenceCall* NewL( 
+            MPEMessageSender& aOwner,
+            CCCE& aConvergedCallEngine );
+        
+        /**
+        * Two-phased constructor.
+        * Conference call is made outof telephony control
+        */
+        IMPORT_C static CPEConferenceCall* NewL( 
+            MPEMessageSender& aOwner,
+            MCCEConferenceCall& aCall );
+            
+        /**
+        * Destructor.
+        */
+        virtual ~CPEConferenceCall();
+      
+    public:
+    
+        /**
+        * Forwards message given as parameter to Phone Engine object
+        *
+        * @param  aMessage is the message to be forwarded
+        */
+        virtual void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ); 
+        
+        /**
+        * Forwards message given as parameter to Phone Engine object
+        *
+        * @param  aMessage is the message to be forwarded
+        */
+        virtual void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+            const TName& aName );
+
+        
+   public: // From MCCEConferenceCallObserver
+   
+        /**
+        * A ConferenceCall event has occurred.
+        *
+        * @param aEvent Occurred event.
+        * @param aReferredCall Pointer to call that the event refers to. 
+        * Used e.g. for 
+        * MCCEConferenceCall::AddCallL and 
+        * MCCEConferenceCall::RemoveCallL
+        * Default value is NULL.
+        */
+        IMPORT_C void CallEventOccurred( 
+            const MCCEConferenceCallObserver::TCCEConferenceCallEvent aEvent,
+            MCCECall* aReferredCall = NULL  );
+    
+        /**
+        * Conference state has changed.
+        *
+        * @param aStateContains the state of the conference call
+        */
+        IMPORT_C void CallStateChanged( 
+                     const MCCEConferenceCallObserver::TCCEConferenceCallState aState );
+    
+    
+        /**
+        * Conference capabilities have changed.
+        * @param aCaps Updated call control capabilities
+        */
+        IMPORT_C void CallCapsChanged( 
+                     const MCCEConferenceCallObserver::TCCEConferenceCallCaps aCaps );
+
+        /**
+        * CallDurationChanged
+        *
+        * @param aDuration
+        */
+        void CallDurationChanged( const TTimeIntervalSeconds aDuration );
+
+        /**
+        * An error has occurred regarding the conference.
+        *
+        * @param aError Occurred error code. 
+        */
+        IMPORT_C void ErrorOccurred( TCCPConferenceCallError aError );
+
+            
+    public:   // New Functions
+    
+        /**
+        * Adds new member to Conference Call
+        *
+        * @param aCall the new call to be added
+        */
+        void AddCallL( MCCECall& aCall );
+
+        /**
+        * Returns Conference duration
+        *
+        * @param  TTimeIntervalSeconds& aDuration, current conference duration
+        */
+        void GetCallDuration( TTimeIntervalSeconds& aDuration );
+        
+        /**
+        * Creates hangup request to call command object
+        */    
+        TInt HangUp();
+
+        /**
+        * Calls MMEtel's syncronic method to find out the count of Conference members
+        * @return the number of members
+        */
+        TInt EnumerateCalls();
+
+        /**
+        * Returns conference call capabilities
+        * @return the capabilities of this conference call
+        */
+        MCCEConferenceCallObserver::TCCEConferenceCallCaps CallCaps();
+
+        /**
+        * Swaps Conference Call between Active and Held states
+        * @param  aSwap it tell that swapping
+        * @return None
+        */
+        TInt Swap();
+        
+        /**
+        * Returns that members name, which was added to or removed from Conference Call
+        * @since Series60_4.0
+        * @param   aCallName In this parameter is returned the TName information of member
+        * @return None
+        */
+        void GetConferenceMemberName( TName& aCallName ) const;
+        
+        /**
+        * Go one to one
+        * @param  aCall
+        * @return None
+        */
+        void GoOneToOneL( MCCECall& aCall );
+
+    protected:
+    
+        /**
+        * C++ default constructor.
+        */
+        CPEConferenceCall( MPEMessageSender& aOwner, MCCEConferenceCall& aCall );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL( CCCE& aConvergedCallEngine );
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    protected:    // Data
+        // Conference Call object. This class calls it's syncronic methods
+        MCCEConferenceCall* iConferenceCall;
+        // When added or removed event occurs, members name and callid is saved in these variables
+        TName iCallName;
+        // Conference calls capabilities
+        MCCEConferenceCallObserver::TCCEConferenceCallCaps iCaps;
+        //Current conference duration
+        TTimeIntervalSeconds iDuration;
+        //Last conference duration
+        TTimeIntervalSeconds iLastConferenceDuration;
+    };
+
+#endif      // CPECONFERENCECALLDATA_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpedtmfhandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEDtmfHandling class.
+*
+*/
+
+
+
+#ifndef CPEDTMFHANDLING_H
+#define CPEDTMFHANDLING_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+#include <mccedtmfobserver.h>
+
+//CONSTANTS
+//None.
+
+// MACROS
+//None.
+
+// DATA TYPES
+//None.
+
+// FUNCTION PROTOTYPES
+//None.
+
+// FORWARD DECLARATIONS
+class CPECallHandling;
+class MCCEDtmfInterface;
+class CCCE;
+
+// CLASS DECLARATION
+
+/**
+*  Handles dtmf commands.
+*
+*  @lib callhandling.lib
+*  @since Series60_4.0
+*/
+class CPEDtmfHandling : public CBase,
+                        public MCCEDtmfObserver
+    {
+    public: //Constructors and descructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPEDtmfHandling* NewL( 
+            CPECallHandling& aOwner, 
+            MCCEDtmfInterface& aDtmfInterface );
+
+        /**
+        * Destructor.
+        */
+        virtual IMPORT_C ~CPEDtmfHandling();
+
+    protected:  //Constructors and descructor
+        /**
+        * C++ default constructor.
+        */
+        IMPORT_C CPEDtmfHandling( 
+            CPECallHandling& aOwner, 
+            MCCEDtmfInterface& aDtmfInterface );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        virtual IMPORT_C void ConstructL();
+
+    public: // From MCCEDtmfObserver
+                                       
+        /**
+        * All the occurred DTMF events are notified through this interface
+        *
+        * @since S60 3.2
+        * @param aEvent Event code
+        * @param aError Error code
+        * @param aTone tone 
+        * @return none
+        */
+        IMPORT_C void HandleDTMFEvent( const MCCEDtmfObserver::TCCEDtmfEvent aEvent, 
+                                       const TInt aError, 
+                                       const TChar aTone );
+                   
+    public: // New functions
+
+        /**
+        * Cancels Dtmf String sending
+        * @since Series60_4.0
+        * @param  None.
+        * @return None.
+        */
+        void CancelDtmfString();
+
+        /**
+        * Allows a client to continue the sending of a dtmf string when it was
+        * stopped by use of 'w' char in the string
+        * @since Series60_4.0
+        * @param  None.
+        * @return None.
+        */
+        void ContinueDtmfSending();
+
+        /**
+        * Send dtmf string to the etel 
+        * @since Series60_4.0
+        * @param  aTones dtmf string
+        * @return None.
+        */
+        TInt SendDtmfString( const TDesC& aTones );
+
+        /**
+        * allows a client initiate the sending of a DTMF tone
+        * @since Series60_4.0
+        * @param  aTone dtmf tone
+        * @return None.
+        */
+        TInt StartDtmfTone( const TChar& aTone ) const;
+
+        /**
+        * Allows a client to cancel the sending of a dtmf string when it was 
+        * stopped by use of 'w' char in the string
+        * @since Series60_4.0
+        * @param  None.
+        * @return None.
+        */
+        void StopDtmfSending();
+
+        /**
+        * allows a client terminate the sending of a DTMF tone
+        * @since Series60_4.0
+        * @param  None.
+        * @return None.
+        */
+        TInt StopDtmfTone() const;
+
+    protected:
+    
+        // CPECallHandling object which owns this Sender
+        CPECallHandling& iOwner;
+        // MCCEDtmfInterface& object which make dtmf requests to the mmetel.
+        MCCEDtmfInterface& iDtmfInterface;
+};
+
+#endif // CPEDTMFHANDLING_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpegprstermination.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GPRS termination active object definition.
+*
+*/
+
+
+
+#ifndef CPEGPRSTERMINATION_H
+#define CPEGPRSTERMINATION_H
+
+//  INCLUDES
+#include    <e32base.h>
+
+ 
+// CLASS DECLARATION
+
+/**
+* Active object for terminating GPRS connections.
+* @since 4.0
+*/
+class CPEGprsTermination 
+    : public CActive
+    {
+    public: // Constructors and destructor.
+
+        /**
+        * Constructor.
+        */
+        CPEGprsTermination();
+
+        /**
+        * Destructor.
+        */
+        ~CPEGprsTermination();
+
+    public: // New functions
+        
+        /**
+        * Starts termination.
+        */
+        void StartL();
+
+        /**
+        * Checks if it is terminating connections 
+        * (or just preparing for that).
+        * @return ETrue if terminating.
+        */
+        TBool IsTerminating() const;
+
+    private: // Functions from base classes
+
+        /**
+        * @see CActive::RunL.
+        */
+        void RunL();
+
+        /**
+        * @see CActive::DoCancel.
+        */
+        void DoCancel();
+
+    private:
+
+    };
+
+#endif      // CPEGPRSTERMINATION_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpesinglecall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPESingleCall object
+*
+*/
+
+
+#ifndef CPESINGLECALL_H
+#define CPESINGLECALL_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+
+#include "cpesinglecallobserver.h"
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None. 
+
+// FORWARD DECLARATIONS
+class MPEMessageSender;
+
+// CLASS DECLARATION
+
+/**
+*  Create call handling requests to Call Command object
+*  @lib CallHandling.lib
+*  @since Series60_5.0
+*/
+class CPESingleCall
+        : public CPESingleCallObserver
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        ~CPESingleCall();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPESingleCall* NewL( MPEMessageSender& aOwner );
+
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CPESingleCall( MPEMessageSender& aOwner );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+    public:     // Overwrite CPECall::SendMessage
+        /**
+        * Reroutes call messages from other objects to CPEPhoneData object.
+        * @param const TInt aMessage, message code of the message.
+        * @return
+        */            
+        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+
+    public:    //New functions
+    
+        /**
+        * Creates answer request to data call command object
+        * @return possible error code
+        */    
+        TInt Answer();
+        
+        /**
+        * Creates dial request to call command object
+        * @param aNumber remote number    
+        * @return possible error code
+        */                
+        virtual TInt Dial( const RMobileCall::TTelNumberC& aNumber );
+
+        /**
+        * Disables FDN checking for SIM ATK originated calls
+        */  
+        void DisableFDNCheck();
+        
+        /**
+        * Creates deflect request to cce call object
+        * @param aMobileAddress the address of the remote party
+        * @param aDeflectType determinates the destination of the deflected call.
+        */    
+        void Deflect( 
+            const RMobilePhone::TMobileAddress& aMobileAddress, 
+            const RMobileCall::TMobileCallDeflect& aDeflectType );
+        
+        /**
+        * Creates emergency dial request to cce call  object
+        * @param aEmergencyNumber an emergency number to dial
+        */        
+        void DialEmergency( const TPEPhoneNumber& aEmergencyNumber );
+
+        /**
+        * Gets call control caps
+        * @param aCallControlCaps is the value of the call control caps
+        */    
+        //void IMPORT_C GetCallControlCaps( TPECallControlCaps& aCallControlCaps );
+
+        /**
+        * Creates hold request to cce call  object
+        * @return possible error code
+        */    
+        TInt Hold();
+
+        /**
+        * Creates resume request to cce call  object
+        * @return possible error code
+        */    
+        TInt Resume();
+
+        /**
+        * Creates swap request to cce call  object
+        * @return possible error code
+        */    
+        TInt Swap();
+
+        /**
+        * Creates transfer request to cce call  object
+        */    
+        void Transfer( const TDesC& aTransferTarget );
+        
+        /**
+        * Returns the inband tone needed to play in state transition
+        */    
+        TCCPTone Tone();
+        
+        /**
+        * Creates hangup request to cce call  object
+        * @return possible error code
+        */ 
+        TInt HangUp();
+        
+        /**
+        * Offers call parameters
+        * @param aCallInfo the current call information.
+        * @return KErrNone or possible error code from the GetMobileCallInfo method.
+        */
+        TInt GetCallInfo( RMobileCall::TMobileCallInfoV3& aCallInfo );
+
+        /**
+        * Sets Missed call indicator.
+        * @param aMissed, Missed call indicator. 
+        * @return KErrNone.
+        */
+        void SetMissedCall( TBool aMissed );
+
+        /**
+        * Gets Missed call indicator.
+        * @param aMissedCall, Missed call indicator. 
+        * @return KErrNone.
+        */
+        TInt GetMissedCall( TBool& aMissedCall ) const;
+        
+        /**
+        * Get call's secure status.
+        * @param None.
+        * @return TBool ETrue if security is enabled, else EFalse.
+        */
+        TBool IsSecureCall() const;
+
+        /**
+        * Get call's secure specified status.
+        * @param None.
+        * @return TBool ETrue if secure specified
+        */
+        TBool SecureSpecified() const;
+        
+        /**
+         * Accepts unattended transfer request.
+         * @return  System wide error code.
+         */
+        TInt AcceptUnattendedTransfer();
+        
+        /**
+         * Rejects unattended transfer request.
+         * @return  System wide error code.
+         */
+        TInt RejectUnattendedTransfer();
+
+        /**
+        * Creates unattended transfer request to cce call  object
+        * @param aTransferTo Target address of the transfer
+        * @return System wide error code
+        */   
+        TInt UnattendedTransfer( const TDesC& aTransferTo ) const;
+        
+        /**
+         * Starts call forwarding to selected address.
+         *
+         * @param aIndex Address index.
+         * @return System wide error code.
+         */
+        TInt ForwardCallToAddress( TInt aIndex );
+        
+    protected:
+    
+        // Phone information from the etel          
+        RTelServer::TPhoneInfo iPhoneInfo;
+        // The information of the current call 
+        RMobileCall::TMobileCallInfoV3 iCallInfo;
+        // Missed call indicator
+        TBool iMissedCall;
+        
+    };
+
+#endif // CPESINGLECALL_H
+
+//    End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpesinglecallobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPESingleCallObserver object
+*
+*/
+
+
+#ifndef CPESINGLECALLOBSERVER_H
+#define CPESINGLECALLOBSERVER_H
+
+//INCLUDES
+#include <mccecall.h>
+#include <mccecallobserver.h>
+#include <pevirtualengine.h>
+
+#include "cpecall.h"
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None. 
+
+// FORWARD DECLARATIONS
+class MPEMessageSender;
+
+// CLASS DECLARATION
+
+/**
+*  Create call handling requests to Call Command object
+*  @lib CallHandling.lib
+*  @since Series60_4.0
+*/
+class CPESingleCallObserver
+        : public CPECall, 
+          public MCCECallObserver
+    {
+    protected: //Constructors and descructor
+        /**
+        * C++ default constructor.
+        */
+        CPESingleCallObserver( MPEMessageSender& aOwner );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPESingleCallObserver();
+
+    public:    // from MCCECallObserver
+    
+        /**
+        * Call errors are notified using this interface. 
+        *
+        * @since S60 v3.2
+        * @param aError Occurred error as integer,
+        * return none
+        */
+        IMPORT_C void ErrorOccurred( const TCCPError aError );
+        
+        /**
+        * Call state notificfation. 
+        * TODO: The observer need to verify the correctness of given state.
+        * CCE will do at least basic call state change checking but also the client 
+        * needs to verify the correctness.
+        *
+        * @since S60 v3.2
+        * @param aState New state of the call
+        * return none
+        */
+        IMPORT_C void CallStateChanged( const CCPCall::TCallState aState );
+
+        /**
+        * The state of the call has changed with inband tone, meaning network is not playing 
+        * the tone relating to the state.
+        * @since S60 3.2
+        * @param aState Call state.
+        * @return none
+        */
+        IMPORT_C void CallStateChangedWithInband( const CCPCall::TCallState aState );
+
+        /**
+        * An event for the call has occurred. 
+        * TODO: the observer need to verify event correcness.
+        *
+        * @since S60 v3.2
+        * @param aEvent Occurred call event
+        * return none
+        */
+        IMPORT_C void CallEventOccurred( const MCCECallObserver::TCCECallEvent aEvent );
+        
+        /**
+        * Notifies observer the change in call duration.
+        *
+        * @since S60 v3.2
+        * @param aDuration Duration of the call in seconds
+        * return none
+        */
+        IMPORT_C void CallDurationChanged( const TTimeIntervalSeconds aDuration );
+        
+        /**
+        * Notifies observer about the changes in call control caps.
+        *
+        * @since S60 v3.2
+        * @param aCaps Contains updated call control capability flags
+        * return none
+        */
+        IMPORT_C void CallCapsChanged( const MCCECallObserver::TCCECallControlCaps aCaps );
+        
+        /**
+        * Notifies observer about transfer made by remote end
+        *
+        * @since S60 v3.2
+        * @param aAttended ETrue: if transfer type is attended, EFalse: type is unattended
+        * @param aDestination Address where the call is to be transferred. Given as received in CCE 
+        * observer needs to verify the address, e.g. it can be KNullDesC.
+        * TODO anonymous transfer target - quess cannot be occurring? 
+        * A-B -> B-C, C has requested anonymity in network???
+        */
+        IMPORT_C void HandleTransfer( const TBool aAttended, 
+                                      const TDesC& aDestination );
+       
+    public:    //New functions 
+                     
+        /**
+        * Returns call duration time
+        * @param aDuration the duration value of the call
+        */    
+        void GetCallDuration( TTimeIntervalSeconds& aDuration );
+
+        /**
+        * Returns call control capabilities
+        * @param aCallControlCaps call control capabilities
+        */    
+        void GetCallControlCaps( 
+            MCCECallObserver::TCCECallControlCaps& aCallControlCaps ) const;
+   
+        /**
+        * Returns the reference to the call object handle. Handle is owned by a derived object.
+        * @return Reference to the call object handle
+        */            
+        MCCECall& Call();
+
+        /**
+        * Sets the reference to the call object handle. Handle is owned by a derived object.
+        * @return Reference to the call object handle
+        */            
+        void SetCall( MCCECall& aCall );
+                
+        /**
+        * Sets Missed call indicator.
+        * @param aMissed, Missed call indicator. 
+        * @return KErrNone.
+        */
+        virtual void SetMissedCall( TBool aMissed ) = 0;
+
+        /**
+         * Returns transfer target from last received unattended transfer
+         * request.
+         * @return   Transfer target.
+         */
+        const TPEPhoneNumber& UnattendedTransferTarget() const;
+        
+        /**
+         * Returns array of possible addresses from the received call forward 
+         * request or NULL if addresses are not available.
+         * @return   Address array.
+         */
+        const CDesC8Array* ForwardAddressChoices() const;
+
+    protected:
+
+        // Includes dialled number
+        TPEPhoneNumber iDialledNumber; // Mihin tätä on tarkoitus käyttää?
+        // Call duration time.
+        TTimeIntervalSeconds iDuration;
+        // iControlCaps contains the new capabilities 
+        MCCECallObserver::TCCECallControlCaps iControlCaps;
+        // handle to mobile call object
+        MCCECall* iCall;
+        
+        /**
+         * Transfer target from previous last unattended transfer reqeust.
+         */
+        TPEPhoneNumber iTransferTarget;
+    };
+
+#endif // CPESINGLECALLOBSERVER_H
+
+//    End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpesupplementaryservicesmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPESupplementaryServicesMonitor object
+*
+*/
+
+
+#ifndef CPESUPPLEMENTARYSERVICESMONITOR_H
+#define CPESUPPLEMENTARYSERVICESMONITOR_H
+
+//INCLUDES
+#include <e32base.h>
+#include <pevirtualengine.h>
+#include <mccessobserver.h>
+ 
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEMessageSender;
+class MPEDataStore;
+
+// CLASS DECLARATION
+
+/**
+* Monitors Supplementary Services
+*
+* @lib CallHandling.lib
+* @since Series60_4.0
+*/
+class CPESupplementaryServicesMonitor  
+        : public MCCESsObserver,
+          public CBase
+    {
+    public:    //Constructors and descructor
+
+        /**
+        * C++ default constructor.
+        */
+        CPESupplementaryServicesMonitor( 
+            MPEMessageSender& aOwner,
+            MPEDataStore& aDataStore );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPESupplementaryServicesMonitor();
+
+    public:
+                                        
+        /**
+        From MCCESsObserver
+        */
+        IMPORT_C void BarringEventOccurred( const MCCESsObserver::TCCESsBarringEvent aBarringEvent );
+
+        /**
+        From MCCESsObserver
+        */
+        IMPORT_C void CLIEventOccurred( const MCCESsObserver::TCCESsCLIEvent aCallLineEvent );
+
+        /**
+        From MCCESsObserver
+        */
+        IMPORT_C void CallForwardEventOccurred( 
+                            const MCCESsObserver::TCCESsCallForwardEvent aCallForwardEvent,
+                            const TDesC& aRemoteAddress );
+
+        /**
+        From MCCESsObserver
+        */
+        IMPORT_C void CallCugEventOccurred( const MCCESsObserver::TCCESsCugEvent aCugEvent );
+
+        /**
+        From MCCESsObserver
+        */
+        IMPORT_C void NotifyCurrentActiveALSLine( TInt aLine );
+
+    private:
+        // Owner of this object
+        MPEMessageSender& iOwner;
+        // Data store
+        MPEDataStore& iDataStore;
+
+     };
+#endif // CPESUPPLEMENTARYSERVICESMONITOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpesystemcallstate.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPESystemCallState object
+*
+*/
+
+
+#ifndef CPESYSTEMCALLSTATE_H
+#define CPESYSTEMCALLSTATE_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+#include <e32property.h>
+#include "mpedatastore.h"
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None. 
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class CPECallArrayOwner;
+class MPEDataStore;
+class CPESingleCall;
+
+/**
+*  Create call handling requests to Call Command object
+*  @lib CallHandling.lib
+*  @since Series60_4.0
+*/
+class CPESystemCallState 
+        : public CBase
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        ~CPESystemCallState();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPESystemCallState* NewL( 
+                CPECallArrayOwner& aCallArrayOwner,
+                MPEDataStore& aDataStore );
+
+    private: //Constructors and descructor
+    
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+        /**
+        * C++ default constructor.
+        */
+        CPESystemCallState(
+                CPECallArrayOwner& aCallArrayOwner,
+                MPEDataStore& aDataStore );
+
+    public:    //New functions
+    
+        /**
+        * NotifySystemCallStateChanged.
+        */
+        void NotifySystemCallStateChanged( 
+                MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+                TInt aCallId );
+    
+    private:    //New functions
+    
+        /**
+        * HandleIncoming.
+        */
+        void HandleIncoming( TInt aCallId );
+        
+        /**
+        * HandleDialling.
+        */
+        void HandleDialling( TInt aCallId );
+        
+        /**
+        * HandleConnected.
+        */
+        void HandleConnected( TInt aCallId );
+        
+        /**
+        * HandleDisconnecting.
+        */
+        void HandleDisconnecting( TInt aCallId );
+        
+        /**
+        * HandleIdle.
+        */
+        void HandleIdle( TInt aCallId );
+        
+        /**
+        * HandleHeld.
+        */
+        void HandleHeld( TInt aCallId );
+        
+        /**
+        * HandleAnswering.
+        */
+        void HandleAnswering( TInt aCallId );
+        
+        /**
+        * HandleConnecting.
+        */
+        void HandleConnecting( TInt aCallId );
+        
+        /**
+        * HandleCallControlCapsChanged.
+        */
+        void HandleCallControlCapsChanged();
+        
+        /**
+        * SetCallInformatioAPICallType.
+        */
+        void SetCallInformatioAPICallType( CPESingleCall& aCallData );
+        
+        /**
+        * HandleRemotePartyChanged.
+        */
+        void HandleRemotePartyChanged( TInt aCallId );
+
+    private:
+
+        // Call array owner
+        CPECallArrayOwner& iCallArrayOwner;
+        // MPEDataStore
+        MPEDataStore& iDataStore;
+        // TPSCTsyCallState
+        TPSCTsyCallState iCallStateTsy;
+        // TPSCTsyCallType
+        TPSCTsyCallType iCallTypeTsy;
+        // P&S property for call state
+        RProperty iCallStateProperty;
+        // Current call state value
+        TPSCTsyCallState iCallStateInCenRep;
+        // Current call type value
+        TPSCTsyCallType iCallTypeInCenRep;
+        // P&S property for call type
+        RProperty iCallTypeProperty;
+
+    };
+
+#endif // CPESYSTEMCALLSTATE_H
+
+//    End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/cpevideocallhandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,356 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEVideoCallHandling object
+*
+*/
+
+
+#ifndef CPEVIDEOCALLHANDLING_H
+#define CPEVIDEOCALLHANDLING_H
+
+//INCLUDES
+#include <e32base.h>
+#include <mpemessagesender.h>
+
+// CONSTANTS
+const TInt KPEDataCallIdBase( KPEMaximumNumberOfVoiceCalls +
+         KPEMaximumNumberOfConferenceCalls );
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPESingleCall;
+class MPEPhoneModelInternal;
+class MPEMessageSender;
+class CCCE;
+class MCCECall;
+class CPECallArrayOwner;
+class CPEGprsTermination;
+class MPEMonitorCommandOwner;
+class MPEDataStore;
+
+// CLASS DECLARATION
+
+/**
+* Handles video call related events from phone engine
+*
+* @lib CallHandlingGsm.lib
+* @since Series60_4.0
+*/
+class CPEVideoCallHandling : public CBase,
+                             public MPEMessageSender
+    {
+    public: // Constructors and destructor
+        /**
+        * Two-phased constructor
+        */
+        static CPEVideoCallHandling* NewL( 
+                MPEMessageSender& aOwner,
+                MPEPhoneModelInternal& aModel, 
+                CCCE& aConvergedCallEngine,
+                CPECallArrayOwner& aCallArrayOwner );
+
+        /**
+        * Destructor
+        */
+        virtual ~CPEVideoCallHandling();
+
+    public:    // New functions
+        
+        /**
+        * Makes answer request.
+        * @return Symbian OS error code
+        */
+        TInt AnswerCall();
+
+        /**
+        * Returns call terminated error
+        * @param aCallId, call identification number
+        * @return Return errorCode
+        */        
+        TInt CallTerminatedError( const TInt aCallId );
+
+        /**
+        * Checks if there are any connected calls
+        */
+        TBool ConnectedCalls();
+
+        /**
+        * Checks if the call has reserved serial communications data port for use
+        * @param aCallId, call identification number
+        * @return ETrue if the data port is reserved for use or EFalse if not
+        */
+        TBool DataPortInUse( TInt aCallId ) const;
+
+        /**
+        * Creates dialing request.
+        * @param aNumber, the telephone number to be called
+        * @return Symbian OS error code
+        */
+        TInt DialCall( const TPEPhoneNumber& aNumber, TInt& aCallId );
+        
+        /**
+        * Makes HangUp request. 
+        * @param aCallId, call identification number
+        * @return Symbian OS error code
+        */
+        TInt HangUp( TInt aCallId );
+
+        /**
+        * Initializes a single video call
+        * @param aCall handle to converged call engine call object
+        */
+        void InitCall( MCCECall& aCall );
+
+        /**
+        * Checks if the data call is a multimedia call
+        * @param aCallId, call identification number
+        * @return TBool, ETrue if this is a multimedia call, EFalse if not
+        */
+        TBool IsMultimedia( TInt aCallId ) const;
+
+        /**
+        * Notifies system for changes to the call state.
+        * @param aMessage, message id
+        * @param aCallId, call identification number
+        */
+        void NotifySystemCallStateChanged( 
+            MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+            TInt aCallId );
+
+        /**
+        * Makes resume request to the Multimode ETel 
+        * @param aCallId, call identification number
+        * @return Symbian OS error code
+        */
+        TInt ResumeCall( TInt aCallId );
+
+        /**
+        * Makes terminate all connection request.
+        * @return KErrNone if operation was successful
+        * @return KerrNotFound if there is not a call 
+        * @return KErrServerBusy if similar request is already being serviced 
+        * @return KErrGeneral
+        * @return KErrNotSupported if feature is not supported
+        */
+        TInt TerminateAllConnections();
+
+        /**
+        * Starts monitoring incoming data calls
+        */
+        void StartUp();
+
+        /**
+        * Swaps connected and held calls
+        * @return Symbian OS error code
+        */
+        TInt SwapCalls();
+
+        /**
+        * Checks is phonenumber available
+        * @param aCallId, call identification number
+        */
+        TBool IsPhoneNumberAvailable( const TInt aCallId );
+
+        /**
+        * Video Call By State
+        */
+        CPESingleCall* VideoCallByState( TPEState aState );
+                                              
+        /**
+        * Video Call By call id
+        */
+        CPESingleCall* VideoCallById( TInt aCallId );
+        
+        /**
+         * Replace active video call with a waiting video call
+         * NOT SUPPORTED AS OF 5.1
+         */
+        TInt ReplaceActive( TInt aCallId  );
+
+        /**
+        * Returns the number of non-idle data calls
+        * @return Number of calls. 
+        */
+        TInt GetNumberOfCalls ();
+        
+        /**
+        * Get the call state
+        * @paramaCallId, call identification number
+        * @return the call state. 
+        */
+        TPEState GetCallState ( TInt aCallId );
+        
+        /**
+        * Returns information of the data call
+        * @param aCallInfo, call info.
+        * @param aCallId, call identification number
+        * @return Symbian OS error code
+        */  
+        TInt GetCallInfo( RMobileCall::TMobileCallInfoV3& aCallInfo, TInt aCallId );
+        
+        /**
+        * Finds data call name given the call id
+        * @param aCallId, call identification number
+        * @return data call name
+        */
+        TName& VideoCallName( const TInt aCallId );
+        
+        /**
+        * Returns call duration time
+        * @param aDuration the duration value of the call
+        * @return KErrNone or KErrNotFound.
+        */    
+        TInt GetCallDuration( TTimeIntervalSeconds& aDuration, TInt aCallId );
+        
+        /**
+        * Makes reject request. 
+        * @return Symbian OS error code
+        */
+        TInt RejectCall( );
+
+        /**
+        * Makes HangUp requests for all calls
+        * @return Symbian OS error code (KErrNotFound if there are no calls to release)
+        */
+        TInt ReleaseAll();
+
+    public:    // From MPEMessageSender
+
+        /**
+        * Reroutes error message to Phone Engine, usable by call objects
+        * @param aCallId Identification number of the call.
+        * @param aErrorCode, the error code stored after previous unsuccessful request
+        */
+        void SendErrorMessage( 
+            const TInt aCallId, 
+            const TInt aErrorCode );
+        
+        /**
+        * Overrides CPEDataCallHandling::SendMessage to provide internal handling for gsm events
+        * @param aMessage, message id
+        */
+        void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+            const TInt aCallId );
+                  
+        /**
+        * Reroutes call messages
+        * @param aMessage The message code of the message
+        * @param aName Name of call fill be maped to call id
+        */  
+        void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+            const TName& aName );
+       
+        /**
+        * Reroutes call messages.
+        * @param aMessage specifies the event that has taken place
+        */
+        void HandleInternalMessage(
+            TInt aMessage );
+        
+    private:
+        /**
+        * C++ default constructor
+        */
+        CPEVideoCallHandling( MPEMessageSender& aOwner,
+                              MPEPhoneModelInternal& aModel, 
+                              CCCE& aConvergedCallEngine,
+                              CPECallArrayOwner& aCallArrayOwner );
+
+        /**
+        * By default Symbian 2nd phase constructor is private
+        */
+        void ConstructL();
+          
+        /**
+        * SetCallParams.
+        * @param None.
+        * @return None.
+        */
+        void SetCallParams( TInt aCallId );
+        
+        /**
+        * Create new CPESingleCall object to CPECallArrayOwner and open new MCCECall ojcte to CCE.
+        * @param None.
+        * @return returns pointer to CPESingleCall objecte.
+        */
+        CPESingleCall* OpenNewCallL( const TPEPhoneNumber& aNumber );
+        
+        /**
+        * Returns data call object by state
+        * @param aState, call state
+        * @return pointer to data call object
+        */
+        CPESingleCall* VideoCallByState( const TPEState aState ) const;
+        
+        /**
+        * Returns data call object by name
+        * @param aName, call name
+        * @return pointer to data call
+        */
+        CPESingleCall* VideoCallByName( const TName& aName );
+        
+        /**
+        * Checks if there are any data calls in the specified state
+        * @param aState, call state
+        * @return TBool, ETrue if there is a data call in the specified state
+        *                EFalse if there is no data call in the specified state
+        */
+        TBool VideoCallInState( const TPEState& aState ) const;
+        
+        /**
+        * Delete's call object and reset's datastore.
+        * @param aCallid.
+        */
+        TInt ReleaseCallObject( const TInt aCallId  ); 
+        
+    private: // Data
+    
+        // Reference to owner of this class
+        MPEMessageSender& iOwner;
+        // Reference to phone model
+        MPEPhoneModelInternal& iModel;
+        // Etel phone connection.
+        CCCE& iConvergedCallEngine;
+        // Data call name stored for Video Call Manager use
+        TName iDataCallName;
+        // Call array owner
+        CPECallArrayOwner& iCallArrayOwner;
+        // Reference to data store
+        MPEDataStore& iDataStore;
+        // Restore Cause Video Call Reject 
+        TBool iRestoreCauseVTCallReject;
+        
+        // Owned GPRS termination instance.
+        CPEGprsTermination* iGprsInterface;
+        /*
+         * Call parameters for dialing
+         * Own.
+         */
+        CCCECallParameters* iCallOpenParams;
+
+};
+
+#endif // CPEVIDEOCALLHANDLING_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/mpecall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the MPESingleCall class.
+*
+*/
+
+
+
+#ifndef MPECALL_H
+#define MPECALL_H
+
+//INCLUDES
+
+// CLASS DECLARATION
+
+/**
+*  Abstract base class for call.
+*
+*  @lib CallHandling.lib
+*/
+class MPECall
+    {
+    public:
+
+        /**
+        * Returns call status information
+        * @return the status of the current call
+        */    
+        virtual TPEState GetCallState() const = 0;
+        
+        /**
+        * Returns call id number
+        * @return the call id number
+        */    
+        virtual TInt GetCallId() const = 0;
+        
+    };
+
+#endif // MPESINGLECALL_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/mpecallhandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,389 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the MPECallHandling class.
+*
+*/
+
+
+
+#ifndef MPECALLHANDLING_H
+#define MPECALLHANDLING_H
+
+//INCLUDES
+#include <mccecall.h>
+#include <pevirtualengine.h>
+#include <mpecallowner.h>
+
+// CONSTANTS
+enum TPEHangUpOptions 
+    {
+    ETPEHangUpDefault = 0,       // Normal hangup
+    ETPEHangUpResumeHeldCall,    // 1 + Send
+    ETPEHangUpNotResumeHeldCall, // 1x + Send
+    };
+
+// CLASS DECLARATION
+
+/**
+*  Virtual interface of call handling subsystem
+*
+*  @lib CallHandling.lib
+*  @since Series60_4.0
+*/
+class MPECallHandling
+    {
+    public:
+        /**
+        * destructor
+        */
+        virtual ~MPECallHandling( ) 
+        {
+        // empty destructor    
+        };
+        
+    public:
+        /**
+        * Starts monitoring incoming calls for voice and data call.
+        */
+        virtual void StartUp() = 0;
+
+        /**
+        * Makes answer request to the Multimode ETel. 
+        * @since Series60_4.0
+        * @param None.
+        * @return Error code.
+        */
+        virtual TInt AnswerCall() = 0;
+
+        /**
+        * Creates dialing request to the Multimode ETel. 
+        * @since Series60_4.0
+        * @param aNumber The telephone number to be called.
+        * @param aCallId Identification number of the call.
+        * @return Error (KErrNone is success).
+        */
+        virtual TInt DialCall( const TPEPhoneNumber& aNumber,TInt& aCallId ) = 0;
+
+        /**
+        * Creates dialing request to the Multimode ETel. 
+        * @since Series60_4.0
+        * @param aNumber The telephone number to be called.
+        * @param aCallId Identification number of the call.
+        * @return Error (KErrNone is success).
+        */
+        virtual TInt DialMultimedia( const TPEPhoneNumber& aNumber,TInt& aCallId ) = 0;
+
+        /**
+        * Makes HangUp request to the CCE. 
+        * @since Series60_4.0
+        * @param aCallId Identification number of the call to be rejected.
+        * @param aAutoResumeOption if options for autoresume.
+        * @return Error (KErrNone is success).
+        */
+        virtual TInt HangUp( TInt aCallId, TPEHangUpOptions aAutoResumeOption ) = 0;
+
+        /**
+        * Put all the calls to idle and make an MMEtel request to 
+        * end the connection 
+        * @return KErrNotFound if there is not a call 
+        *         KErrNone if there is one call at least
+        */
+        virtual TInt ReleaseAll() = 0;
+
+        /**
+        * Makes terminate all connection request to Custom Api. 
+        * @since Series60_4.0
+        * @param  None.
+        * @return KErrNone.
+        */
+        virtual TInt TerminateAllConnections() = 0;
+        
+        /**
+        * Asks phone identity parameters from the mmetel.
+        * @since Series60_4.0
+        * @param aMessage Reply message to the phone application.
+        * @return Error (KErrNone or KErrNotFound).
+        */
+        virtual TInt UpdatePhoneIdentity( 
+            MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ) = 0;
+
+        /**
+        * Determines if there is a call in given state.
+        * @since Series60_4.0
+        * @param aState Call state search key.
+        * @return TBool, ETrue is there is a call; otherwise EFalse.
+        */
+        virtual TBool IsCallInState( TPEState aState ) const = 0;
+        
+        /**
+        * Determines if there is a call in given state.
+        * @since Series60_4.0
+        * @param aState Call state search key.
+        * @return callid is there is a call; otherwise KPECallIdNotUsed( -1 ).
+        */
+        virtual TInt GetCallIdByState( TPEState aState ) const = 0;
+
+        /**
+        * Returns the missed voice call indicator. 
+        * @since Series60_4.0
+        * @param  aMissedCall, missed call indicator.
+        * @param aCallId, call idendificator.
+        * @return KErrNone or KErrNotFound.
+        */
+        virtual TInt GetMissedCall( TBool& aMissedCall, TInt aCallId ) = 0;
+
+        /**
+        * Returns information of the call.
+        * @since Series60_4.0
+        * @param aCallInfo Current call information.
+        * @param aCallId Identification number of the call.
+        * @return Error code (KErrNone or KErrNotFound).
+        */
+        virtual TInt GetCallInfo( RMobileCall::TMobileCallInfoV3& aCallInfo, TInt aCallId ) = 0;
+
+        /**
+        * Get the call state
+        * 
+        * @param a call ID. 
+        * @return the call state. 
+        */
+        virtual TPEState GetCallState ( TInt aCallId ) = 0;
+ 
+        /**
+        * Get the number of calls (voice + call waiting)
+        * 
+        * @return Number of calls. 
+        */
+        virtual TInt GetNumberOfCalls ( ) = 0;
+               
+        /**
+        * Returns call duration time.
+        * @since Series60_4.0
+        * @param aDuration Call duration.
+        * @param aCallId Identification number of the call.
+        * @return Error code (KErrNone or KErrNotFound).
+        */    
+        virtual TInt GetCallDuration( TTimeIntervalSeconds& aDuration, TInt aCallId ) = 0;
+
+        /**
+        * Makes reject request to the Multimode ETel 
+        * @since Series60_4.0
+        * @return Return possible error code
+        */
+        virtual TInt RejectCall( ) = 0;
+
+        /**
+        * Reroutes error codes to the Phone Model.
+        * @since Series60_4.0
+        * @param aCallId Identification number of the call.
+        * @param aErrorCode Error code.
+        * @return None.
+        */
+        virtual void SendErrorMessage( TInt aCallId, TInt aErrorCode ) = 0;
+
+        /**
+        * Sets active line
+        */
+        virtual void SetActiveLine() = 0;
+
+        /**
+        * Makes transfer request to the Multimode ETel 
+        * @since Series60_4.0
+        * @param None.
+        * @return Return possible error code
+        */
+        virtual TInt BuildConference() = 0;
+        
+        /**
+        * Swaps connected and held calls
+        * @since Series60_4.0
+        * @param  None.
+        * @return KErrNone or KErrNotFound.
+        */
+        virtual TInt SwapCalls() = 0;
+
+        /**
+        * Checks that can add conference member.
+        * @return possible error code from the CallHandling subsystem.
+        */
+        virtual TInt AddConferenceMember() = 0;
+        
+        /**
+        * Drops one member from the conference call
+        * @since Series60_4.0
+        * @param aCallid It is the Call Id of the call to be dropped
+        * @return Return possible error code
+        */
+        virtual TInt DropMember( TInt aCallId ) = 0;
+
+        /**
+        * Splits one member from the conference call. 
+        * @since Series60_4.0
+        * @param aCallid It is the index number of the call to be splited. 
+        * @return Return possible error code
+        */
+        virtual TInt GoOneToOne( TInt aCallId ) = 0;
+
+        /**
+        * Makes hold request for the connected call
+        * @return KErrNone if request was sent successfully
+        *         KErrGsmNotAllowed if no connected call was found
+        */
+        virtual TInt HoldCall( ) = 0;
+
+        /**
+        * Makes resume request for the held call
+        * @return KErrNone if request was sent successfully
+        *         KErrGsmNotAllowed if no held call was found
+        */
+        virtual TInt ResumeCall( ) = 0;
+
+        /**
+        * Makes transfer request to the Multimode ETel 
+        * @since Series60_4.0
+        * @param None. 
+        * @return KErrNone or KErrNotFound.
+        */
+        virtual TInt TransferCalls() = 0;
+        
+        /**
+        * Creates emergency call request to the Multimode ETel 
+        * @since Series60_4.0
+        * @param None. 
+        * @return None.
+        */
+        virtual void DialEmergencyCall( const TPEPhoneNumber& aEmergencyNumber ) = 0;
+
+        /**
+        * Returns call terminated diagnostics of a call
+        * Info is valid only for Idle call
+        * @since Series60_4.0
+        * @param aCallName, TName information of a call
+        * @return diagnostics info of a call
+        */
+        virtual TInt GetCallTerminatedDiagnostics( 
+            TName& aCallName ) const = 0;
+        
+        /**
+        * Returns call terminated error
+        * @since Series60_4.0
+        * @return Return errorCode
+        */        
+        virtual TInt CallTerminatedError( const TInt aCallId ) = 0;
+         
+        /**
+        * Replace active call with waiting call. 
+        * @since Series60_5.0
+        * @return Error (KErrNone is success).
+        */
+        virtual  TInt ReplaceActive() = 0;
+
+        /**
+         * Accepts unattended transfer request. 
+         * @since    Series 60 v5.1
+         * @return   System wide error code.
+         */
+        virtual TInt AcceptUnattendedTransfer() = 0;
+        
+        /**
+         * Rejects unattended transfer request. 
+         * @since    Series 60 v5.1
+         * @return   System wide error code.
+         */
+        virtual TInt RejectUnattendedTransfer() = 0;
+
+        /**
+        * Does unattended transfer to the connected VoIP call 
+        * @since Series60_5.1
+        * @return Error (KErrNone is success).
+        */
+        virtual TInt DoUnattendedTransfer( const TDesC& aTransferTarget ) = 0;
+
+        /**
+        * Starts call forwarding to selected address. 
+        * @since Series60_5.1
+        * @param aIndex A array index for a selected address.
+        * @return Error (KErrNone is success).
+        */ 
+        virtual TInt ForwardCallToAddress( TInt aIndex ) = 0;
+        
+    public: // DTMF related
+        /**
+        * Sends dtmf string.
+        * @since Series60_4.0
+        * @param aDtmfString TPEDtmfString to be sent.
+        * @return KErrNone.
+        */
+        virtual TInt SendDtmf( const TPEDtmfString& aDtmfString ) = 0;
+
+        /**
+        * Allows a client to continue dtmf string sending when 
+        * it was stopped by use of 'w' char in the string.
+        * @since Series60_4.0
+        * @param  None.
+        * @return None.
+        */
+        virtual void ContinueDtmfSending() = 0;
+        
+        /**
+        * Sends dtmf tone
+        * @since Series60_4.0
+        * @param aTone Tone to be sent.
+        * @return Error (KErrNone or KErrNotFound).
+        */
+        virtual TInt StartDtmfTone( const TChar& aTone ) = 0;
+
+        /**
+        * Allows a client to cancel the sending of a dtmf string when 
+        * it was stopped by use of 'w' char in the string.
+        * @since Series60_4.0
+        * @param None.
+        * @return None.
+        */
+        virtual void StopDtmfSending() = 0;
+
+        /**
+        * Stops sending dtmf tone.
+        * @since Series60_4.0
+        * @param None.
+        * @return Error (KErrNone or KErrNotFound).
+        */
+        virtual TInt StopDtmfTone() = 0;
+
+        /**
+        * Cancels Dtmf string sending.
+        * @since Series60_4.0
+        * @param  None.
+        * @return None.
+        */
+        virtual void CancelDtmfPlay() = 0;
+        
+        /**
+        * This method gets the lifetime of the MS. The lifetime information 
+        * includes the manufacturing date of the MS and the total amount of airtime use.
+        * @param aLifeTimeInfo Life time information
+        * @return Get succeeded or not.
+        */
+        virtual TBool GetLifeTime( TDes8& aLifeTimeInfo ) = 0;
+        
+        /**
+        * This method gets the reference to MPECallOwner object.
+        * @return None.
+        */
+        virtual MPECallOwner& CallOwner() const = 0;
+    };
+
+#endif // MPECALLHANDLING_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/mpecallinitialiser.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Initialises incoming or external calls.
+*
+*/
+
+
+#ifndef MPECALLINITIALISER_H
+#define MPECALLINITIALISER_H
+
+#include <e32std.h>
+
+class MCCECall;
+
+/**
+ *  Interface for incoming and external call initialisation
+ *
+ *  @lib CallHandling.lib
+ *  @since S60 5.1
+ */
+NONSHARABLE_CLASS( MPECallInitialiser )
+    {
+public:
+    
+    /**
+     * Initialises incoming / external voice call.
+     * 
+     * @param aCall New voice call.
+     */ 
+    virtual void InitVoiceCall( MCCECall& aNewCall ) = 0;
+    
+    /**
+     * Initialises incoming / external data/video call.
+     * 
+     * @param aCall New data/video call.
+     */ 
+    virtual void InitVideoCall( MCCECall& aNewCall ) = 0;
+    
+    /**
+     * Initialises self-created / external conference call.
+     * 
+     * @param aCall New data/video call.
+     */ 
+    virtual void InitConferenceCall( MCCEConferenceCall& aConference ) = 0;
+    };
+
+
+#endif // MPECALLINITIALISER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/mpecallowner.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the MPECallOwner class.
+*
+*/
+
+
+
+#ifndef MPECALLOWNER_H
+#define MPECALLOWNER_H
+
+//INCLUDES
+#include <mpecall.h>
+
+// CLASS DECLARATION
+
+/**
+*  Abstract base class for call owner.
+*
+*  @lib CallHandling.lib
+*/
+class MPECallOwner
+    {
+    public:
+        
+        /**
+        * returns ETrue if call object found by state, NULL if not found.
+        * @param aState, the wanted call state.
+        */ 
+        virtual TBool IsCallByState( 
+            const TPEState aState ) const = 0;
+        
+        /**
+        * returns ETrue if call object found by call ID, NULL if not found.
+        * @param aCallId, the wanted call id.
+        */    
+        virtual TBool IsCallByCallId( 
+            const TInt aCallId ) const = 0;
+ 
+        /**
+        * returns pointer to MPECall object by State, NULL if not found.
+        * @param aState, the wanted call state.
+        */ 
+        virtual MPECall* CallByState( 
+            const TPEState aState ) const = 0;
+        
+        /**
+        * returns pointer to MPECall object by CallId, NULL if not found.
+        * @param aCallId, the wanted call id.
+        */    
+        virtual MPECall* CallByCallId( 
+            const TInt aCallId ) const = 0;
+            
+        /**
+        * returns pointer to MPECall object by CallId, NULL if not found.
+        * @param aName, the wanted name.
+        */    
+        virtual MPECall* CallByName( 
+            const TName& aName ) const = 0;
+        
+        /**
+        * Return active call count, other then idle state.
+        * @param None
+        */ 
+        virtual TInt ActiveCallCount() const = 0;
+    };
+
+#endif // MPECALLOWNER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/mpemessagesender.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the MPEMessageSender class.
+*
+*/
+
+
+
+#ifndef MPEMESSAGESENDER_H
+#define MPEMESSAGESENDER_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+
+// CLASS DECLARATION
+
+/**
+*  Abstract base class for message sender.
+*
+*  @lib CallHandling.lib
+*/
+class MPEMessageSender
+    {
+    public:
+
+        /**
+        * Reroutes error message
+        * @param aErrorCode, the error code stored after previous unsuccessful request
+        * @param aCallId
+        */
+        virtual void SendErrorMessage( 
+            const TInt aCallId, 
+            const TInt aErrorCode ) = 0;
+
+        /**
+        * Reroutes call messages
+        * @param aMessage The message code of the message
+        */    
+        virtual void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+            const TInt aCallId ) = 0;
+            
+        /**
+        * Reroutes call messages
+        * @param aMessage The message code of the message
+        * @param aName Name of call fill be maped to call id
+        */  
+        virtual void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+            const TName& aName ) = 0;
+        
+        /**
+         * Reroutes call messages.
+         * @param aMessage specifies the event that has taken place
+         */
+        virtual void HandleInternalMessage(
+            TInt aMessage ) = 0;
+    };
+
+#endif // MPEMESSAGESENDER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpecall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPECall class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include <talogger.h>
+
+#include "cpecall.h"
+#include "mpemessagesender.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPECall::CPECall
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPECall::CPECall
+        ( 
+        MPEMessageSender& aOwner
+        ) : iOwner( aOwner ),
+            iCallState( EPEStateIdle )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPECall::cpecall: start." );
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPECall::cpecall: complete." );
+    }
+
+// Destructor
+EXPORT_C CPECall::~CPECall
+        (
+        // None.
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPECall::~CPECall: Start." );
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPECall::~CPECall: Complete." );
+    }    
+
+// -----------------------------------------------------------------------------
+// CPECall::SendErrorMessage
+// Method reroutes error message from other modules to the CPEPCallHandling-object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPECall::SendErrorMessage( const TInt aErrorCode )
+    {
+    iErrorCode = aErrorCode;
+    iOwner.SendErrorMessage( iCallId, aErrorCode );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECall::SendMessage
+// Method reroutes messages from other modules to the CPECallHandling-object
+// -----------------------------------------------------------------------------
+//
+void CPECall::SendMessage
+        ( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage
+        )
+    {
+    iOwner.SendMessage( aMessage, iCallId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECall::GetErrorCode
+// Get the error code of the call.
+// -----------------------------------------------------------------------------
+//
+void CPECall::GetErrorCode
+        (
+        TInt& aErrorCode
+        ) const
+    {
+    aErrorCode = iErrorCode;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECall::SetCallState
+// Method sets call state.
+// -----------------------------------------------------------------------------
+//
+void CPECall::SetCallState
+        ( 
+        const TPEState aCallState
+        )
+    {
+    iCallState =  aCallState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECall::GetCallState
+// Method returns call state.
+// -----------------------------------------------------------------------------
+//
+TPEState CPECall::GetCallState
+        (
+        // None.
+        ) const
+    {
+    return iCallState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECall::SetCallId
+// Method sets call identification numbers
+// -----------------------------------------------------------------------------
+//
+void CPECall::SetCallId
+        ( 
+        const TInt aCallId
+        )
+    {
+    iCallId = aCallId;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECall::GetCallId
+// Method returns call identification numbers
+// -----------------------------------------------------------------------------
+//
+TInt CPECall::GetCallId
+        (
+        // None.
+        ) const
+    {
+    return iCallId;
+    }
+    
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+// None.
+
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpecallarrayowner.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,476 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPECallArrayOwner class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include <talogger.h>
+#include <pepanic.pan>
+#include <ccce.h>
+
+#include "cpecallarrayowner.h"
+#include "cpesinglecall.h"
+#include "cpevideocallhandling.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CPECallArrayOwner
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPECallArrayOwner::CPECallArrayOwner()
+    {
+    }
+
+// Destructor
+CPECallArrayOwner::~CPECallArrayOwner()
+    {
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL CPECallArrayOwner::~CPECallArrayOwner: Start." );
+    
+    if ( iCallArray )
+        {
+        iCallArray->ResetAndDestroy();
+        iCallArray->Close();
+        delete iCallArray;
+        iCallArray = NULL;
+        }
+        
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL: CPECallArrayOwner::~CPECallArrayOwner: Complete." );
+    }    
+
+CPECallArrayOwner* CPECallArrayOwner::NewL(
+        CCCE& iConvergedCallEngine, 
+        MPEMessageSender& aOwner )
+    {
+    TEFLOGSTRING( KTAOBJECT,
+         "CALL CPECallArrayOwner::NewL: start." );
+    
+    CPECallArrayOwner* self = new ( ELeave ) CPECallArrayOwner();
+    CleanupStack::PushL( self );
+    self->ConstructL( iConvergedCallEngine, aOwner );
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL CPECallArrayOwner::NewL: complete." );
+    
+    return self;
+    }
+    
+void CPECallArrayOwner::ConstructL(
+        CCCE& iConvergedCallEngine, 
+        MPEMessageSender& aOwner )
+
+    {
+    TEFLOGSTRING( KTAOBJECT,
+         "CALL CPECallArrayOwner::ConstructL: start." );
+    
+    iCallArray = new ( ELeave ) RPointerArray< CPESingleCall >;
+    
+    // Open emergency call, this done here so that phone app doesn't allocate memory
+    // when emeregency call is really created.
+    CPESingleCall* call = CreateEmergencyCallL( aOwner );
+    call->SetCall( iConvergedCallEngine.InitializeEmergencyCall( *call ) );
+        
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL CPECallArrayOwner::ConstructL: complete." );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CreateCallL
+// 
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallArrayOwner::CreateCallL( MPEMessageSender& aOwner )
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::CreateCallL");
+    CPESingleCall* call( NULL );
+
+    if( iCallArray->Count() < ( KPEMaximumNumberOfVoiceCalls ) )
+        {
+        // Find free call id
+        for( TInt callId = 0; callId < KPEMaximumNumberOfVoiceCalls; callId++ )
+            {
+            if( !GetCallObject( callId ) )
+                {
+                call = CPESingleCall::NewL( aOwner );
+                call->SetCallId( callId );
+                iCallArray->Append( call );
+                break;
+                }
+            }
+        }
+    else
+        {
+        TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::CreateCallL Leave( ECCPRequestFailure )");
+        User::Leave( ECCPRequestFailure );
+        }
+    return call;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CallByCallId
+// 
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallArrayOwner::GetCallObject( 
+        const TInt aCallId ) const
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::GetCallObject");
+    CPESingleCall* call( NULL );
+    TInt callIndex;
+
+    __ASSERT_DEBUG( 
+        aCallId <= ( KPEMaximumNumberOfVoiceCalls + KPEMaximumNumberOfDataCalls ),
+        Panic( EPEPanicIndexOutOfRange) );
+        
+    for( callIndex = 0; callIndex < iCallArray->Count(); callIndex++ )
+        {
+        if( aCallId == (*iCallArray)[callIndex]->GetCallId() )
+            {
+            call = (*iCallArray)[callIndex];
+            TEFLOGSTRING2( KTAMESINT, "CALL CPECallArrayOwner::GetCallObject %d", callIndex);
+            break;
+            }
+        }
+    return call;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::GetCallObjectByIndex
+// 
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallArrayOwner::GetCallObjectByIndex( 
+        const TInt aIndex ) const
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::GetCallObjectByIndex");
+
+    __ASSERT_DEBUG( 
+        aIndex < ( KPEMaximumNumberOfVoiceCalls ),
+        Panic( EPEPanicIndexOutOfRange) );
+        
+    return aIndex < Count() ? (*iCallArray)[aIndex] : NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::DeleteCallObject
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CPECallArrayOwner::DeleteCallObject( 
+        const TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAMESINT, "CALL CPECallArrayOwner::DeleteCallObject, call id: %d", aCallId );
+    CPESingleCall* call( NULL );
+    TInt callIndex;
+    TInt errorCode( KErrNotFound );
+
+    __ASSERT_DEBUG( 
+        aCallId <= ( KPEMaximumNumberOfVoiceCalls + KPEMaximumNumberOfDataCalls ),
+        Panic( EPEPanicIndexOutOfRange) );
+    
+    if( aCallId != KPEEmergencyCallId )
+        {
+        // Normal Voice Calls
+        for( callIndex = 0; callIndex < iCallArray->Count(); callIndex++ )
+            {
+            if( aCallId == (*iCallArray)[callIndex]->GetCallId() )
+                {
+                call = (*iCallArray)[callIndex];
+                delete call;
+                iCallArray->Remove(callIndex);
+                iCallArray->Compress();
+                errorCode = KErrNone;
+                break;
+                }
+            }
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::Count()
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CPECallArrayOwner::Count() const
+    {
+    TEFLOGSTRING2( KTAMESINT, "CALL CPECallArrayOwner::Count %d", iCallArray->Count() );
+    return iCallArray->Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::ActiveCallCount()
+// 
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallArrayOwner::ActiveCallCount() const
+    {
+    TInt numberOfCalls = 0;
+
+    // Count ongoing voice calls
+    numberOfCalls = iCallArray->Count();
+    
+    for( TInt callIndex = 0; 
+         callIndex < iCallArray->Count();
+         callIndex++ )
+        {
+        if( EPEStateIdle == (*iCallArray)[callIndex]->GetCallState() )
+            {
+            numberOfCalls--;
+            }
+        }
+    TEFLOGSTRING2( KTAMESINT, "CALL CPECallArrayOwner::ActiveCallCount %d", numberOfCalls );
+
+    return numberOfCalls;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CreateEmercencyCallL
+// Method 
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallArrayOwner::CreateEmergencyCallL( MPEMessageSender& aOwner )
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::CreateEmercencyCallL");
+    CPESingleCall* call = GetCallObject( KPEEmergencyCallId );
+    
+    if( !call )
+        {
+        call = CPESingleCall::NewL( aOwner );
+        call->SetCallId( KPEEmergencyCallId );
+        iCallArray->Append( call );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::CreateEmercencyCallL: Already exist");
+        User::Leave( KErrAlreadyExists );
+        }
+
+    return call;
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CreateDataCallL
+// 
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallArrayOwner::CreateDataCallL( MPEMessageSender& aOwner )
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::CreateDataCallL");
+    CPESingleCall* call( NULL );
+
+    if( iCallArray->Count() < ( KPEMaximumNumberOfVoiceCalls ) )
+        {
+        // find free call id
+        for( TInt callId = KPEDataCallIdBase; 
+            callId < KPEDataCallIdBase + KPEMaximumNumberOfDataCalls; callId++ )
+            {
+            if( !GetCallObject( callId ) )
+                {
+                call = CPESingleCall::NewL( aOwner );
+                call->SetCallId( callId );
+                iCallArray->Append( call );
+                break;
+                }
+            }
+        if( !call )
+            {
+            // Leave if all datacallids are reserved
+            TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::CreateCallL all datacallids are reserved Leave( ECCPRequestFailure )");
+            User::Leave( ECCPRequestFailure );
+            }
+        }
+    else
+        {
+        TEFLOGSTRING( KTAMESINT, "CALL CPECallArrayOwner::CreateCallL Leave( ECCPRequestFailure )");
+        User::Leave( ECCPRequestFailure );
+        }
+    return call;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CallPointerByState
+// returns CPESingleCall voice call object by State, NULL if not found
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallArrayOwner::CallPointerByState( 
+        TPEState aState ) const
+    {
+    CPESingleCall* returnValue = NULL;
+    
+    TEFLOGSTRING2( 
+        KTAREQEND, 
+        "CALL CPECallHandling::CallPointerByState: asked aState: %d", 
+        aState );
+    
+    for( TInt callIndex = 0; 
+         callIndex < iCallArray->Count();
+         callIndex++ )
+        {
+        if( aState == (*iCallArray)[callIndex]->GetCallState() )
+            {
+            TEFLOGSTRING2( 
+                KTAREQEND, 
+                "CALL CPECallHandling::CallPointerByState: callIndex: %d", 
+                callIndex );
+            returnValue = (*iCallArray)[callIndex];
+            break;
+            }
+        }
+
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::IsCallByState
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPECallArrayOwner::IsCallByState( 
+        const TPEState aState ) const
+    {
+    TEFLOGSTRING2( 
+        KTAREQEND, 
+        "CALL CPECallHandling::CallByState: asked aState: %d", 
+        aState );
+  
+    return CallByState( aState ) ? ETrue : EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::IsCallByCallId
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPECallArrayOwner::IsCallByCallId( 
+        const TInt aCallId ) const
+    {
+    TEFLOGSTRING2( 
+        KTAREQEND, 
+        "CALL CPECallHandling::CallByCallId: asked aCallId: %d", 
+        aCallId );
+
+    return GetCallObject( aCallId ) ? ETrue : EFalse;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CallByState
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPECall* CPECallArrayOwner::CallByState( 
+        const TPEState aState ) const
+    {
+    TEFLOGSTRING2( 
+        KTAREQEND, 
+        "CALL CPECallHandling::CallByState: asked aState: %d", 
+        aState );
+  
+    return CallPointerByState( aState );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CallByCallId
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPECall* CPECallArrayOwner::CallByCallId( 
+        const TInt aCallId ) const
+    {
+    TEFLOGSTRING2( 
+        KTAREQEND, 
+        "CALL CPECallHandling::CallByCallId: asked aCallId: %d", 
+        aCallId );
+
+    return GetCallObject( aCallId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CallByName
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPECall* CPECallArrayOwner::CallByName( 
+        const TName& aName ) const
+    {
+    TEFLOGSTRING2( 
+        KTAREQEND, 
+        "CALL CPECallHandling::CallByName: aName: %S", 
+        &aName );
+    return CallPointerByName( aName );      
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallArrayOwner::CallPointerByName
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallArrayOwner::CallPointerByName( 
+        const TName& aName ) const
+    {
+    CPESingleCall* call( NULL );
+    for ( TInt index=0; index < Count(); index++ )
+        {
+        CPESingleCall* callData = GetCallObjectByIndex( index );
+        if( callData )
+            {
+            RMobileCall::TMobileCallInfoV3 callInfo;
+            callData->GetCallInfo( callInfo );
+            if( callInfo.iCallName == aName )
+                {
+                call = callData;
+                break;
+                }
+            }
+        }
+    TEFLOGSTRING2( 
+        KTAREQEND, 
+        "CALL CPECallHandling::CallPointerByName: call: %d", 
+        call );
+    return call;      
+    }
+    
+// ================= OTHER EXPORTED FUNCTIONS ==============================
+
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpecallhandling.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,2421 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPECallHandling class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "cpecallhandling.h"
+#include    "cpevideocallhandling.h"
+#include    "cpesinglecall.h"
+#include    "cpedtmfhandling.h"
+#include    "cpesupplementaryservicesmonitor.h"
+#include    "mpephonemodelinternal.h"
+#include    "cpeconferencecall.h"
+#include    "cpecallarrayowner.h"
+#include    "mpecallhandling.h"
+#include    "cpecceobserver.h"
+#include    "cpesystemcallstate.h"
+
+#include    <gsmerror.h>
+#include    <mpedatastore.h>
+#include    <pepanic.pan>
+#include    <talogger.h>
+#include    <PSVariables.h>
+#include    <ctsydomainpskeys.h>
+#include    <mccecall.h>
+#include    <psetsaobserver.h>
+#include    <cccecallparameters.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+// ============================= LOCAL FUNCTIONS ===============================
+// None
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::CPECallHandling
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPECallHandling::CPECallHandling(
+    MPEPhoneModelInternal& aModel,
+    CCCE& aConvergedCallEngine,
+    MCCEDtmfInterface& aDtmfInterface
+    ) : iModel( aModel ),
+        iConvergedCallEngine( aConvergedCallEngine ),
+        iDtmfInterface( aDtmfInterface ),
+        iReplaceActive( EFalse ),
+        iDialRequest( EFalse )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::CPECallHandling()");
+    }
+
+// Destructor
+EXPORT_C CPECallHandling::~CPECallHandling()
+    {  
+    TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::~CPECallHandling() start");
+    
+    delete iSystemCallState;
+    delete iDtmfHandling;
+    
+    // No need to uninitialize feature manager - this is done in MPEPhoneModelInternal .cpp
+        
+    delete iSupplementaryServicesMonitor;
+    delete iCCEObserver;
+
+    delete iVideoCallHandling;
+    delete iConferenceCall;
+    delete iCallArrayOwner;
+    delete iPsetSAObserver;
+    delete iCallOpenParams;
+    
+    TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::~CPECallHandling() complete");    
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPECallHandling* CPECallHandling::NewL(
+        MPEPhoneModelInternal& aModel,                    
+        CCCE& aConvergedCallEngine,
+        MCCEDtmfInterface& aDtmfInterface )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::NewL start." );
+    CPECallHandling* self = new (ELeave) CPECallHandling( aModel,
+        aConvergedCallEngine, aDtmfInterface );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::NewL complete." );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::BaseConstructL() start"); 
+
+    // Creates a supplementary services monitor
+    iSupplementaryServicesMonitor = new (ELeave) CPESupplementaryServicesMonitor( 
+        *this, *iModel.DataStore() );
+    
+    iCCEObserver = CPECCEObserver::NewL( *this, iModel );
+    
+    iConvergedCallEngine.SetObserver( *iCCEObserver, *iSupplementaryServicesMonitor );
+
+    // Creates CPEDtmfSender object
+    iDtmfHandling = CPEDtmfHandling::NewL( *this, iDtmfInterface );
+
+    // Creates a call array owner object
+    iCallArrayOwner = CPECallArrayOwner::NewL( 
+            iConvergedCallEngine, 
+            *this );
+    
+    iVideoCallHandling = CPEVideoCallHandling::NewL( 
+            *this, 
+            iModel, 
+            iConvergedCallEngine,
+            *iCallArrayOwner );
+                                                          
+    iCallOpenParams = CCCECallParameters::NewL();
+    
+    iSystemCallState = CPESystemCallState::NewL( *iCallArrayOwner, *iModel.DataStore() );
+    
+    TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::BaseConstructL() complete");
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SendErrorMessage
+// Reroutes error messages to the Phone Engine, usable by other than call objects
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::SendErrorMessage(
+        const TInt aErrorCode )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "CALL CPECallHandling::SendErrorMessage, error code: %d", 
+        aErrorCode );
+
+    iModel.DataStore()->SetErrorCode( aErrorCode );
+    iModel.SendMessage( MEngineMonitor::EPEMessageCallHandlingError );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SendErrorMessage
+// Reroutes error messages to the Phone Engine, usable by call objects
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::SendErrorMessage( 
+        const TInt aCallId,
+        const TInt aErrorCode )
+    {
+    TEFLOGSTRING3( KTAINT, 
+        "CALL CPECallHandling::SendErrorMessage, error code: %d, call id: %d", 
+        aErrorCode,
+        aCallId );
+    
+    // Dial request failed - resume held call
+    if( aErrorCode == ECCPErrorInvalidFDN )
+        {
+        HandleAutoResume();
+        }
+
+    if ( aCallId == KPECallIdNotUsed )
+        {
+        SendErrorMessage( aErrorCode );
+        }
+    else
+        {
+        iModel.DataStore()->SetErrorCode( aErrorCode );
+        iModel.SendMessage( MEngineMonitor::EPEMessageCallHandlingError, aCallId );
+        
+        //Handle call objet deleting if dialing fail.
+        if( ECCPErrorNone != aErrorCode )
+            {
+            CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
+            if( callData )
+                {
+                TEFLOGSTRING2( KTAINT, 
+                    "CALL CPECallHandling::SendErrorMessage, call state %d", callData->GetCallState() );
+                if( callData->GetCallState() == EPEStateIdle )
+                    {
+                    ReleaseCallObject( aCallId  );
+                    iDialRequest = EFalse;
+                    }
+                }
+            }
+
+        if( ( KPEConferenceCallID == aCallId ) && ( ECCPConferenceErrorAddCall == aErrorCode ) &&
+              iConferenceCall && ( iConferenceCall->EnumerateCalls() == 0 ) )
+           { 
+           delete iConferenceCall; 
+           iConferenceCall = NULL;
+           iModel.DataStore()->ResetCallInfo( aCallId );
+           } 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SendMessage
+// Reroutes messages to the Phone Engine, usable by other than call objects
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::SendMessage( 
+    MEngineMonitor::TPEMessagesFromPhoneEngine aMessage )
+    {
+    TEFLOGSTRING2( KTAINT,
+        "CALL CPECallHandling::SendMessage, message id: %d", aMessage );
+   
+    iModel.SendMessage( aMessage );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SendMessage
+// Reroutes messages to the Phone Engine, usable by call objects
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::SendMessage( 
+    MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+    TInt aCallId )
+    {
+    TEFLOGSTRING3( KTAINT, 
+        "CALL CPECallHandling::SendMessage, message id: %d, call id: %d", 
+        aMessage, 
+        aCallId );
+    
+    TInt errorCode( KErrNone );
+    
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageDialing:
+            {
+            iDialRequest = EFalse;
+            CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
+            if( callData )
+                {
+                MCCECall& call = callData->Call();
+                iModel.DataStore()->SetCallIndex(call.CallIndex(), aCallId );                
+                SetCallOrigin( aCallId, call );                        
+                }  
+            break;
+            }
+        case MEngineMonitor::EPEMessageChangedCallDuration:
+            {
+            TTimeIntervalSeconds duration;
+ 
+            errorCode = GetCallDuration( duration, aCallId );
+            if ( errorCode == KErrNone )
+                {
+                iModel.DataStore()->SetCallDuration( duration, aCallId );
+                }
+            break;
+            }
+        case MEngineMonitor::EPEMessageIdle:
+            {
+            HandleAutoResume();
+            break;
+            }
+        case MEngineMonitor::EPEMessageAddedConferenceMember:
+            {
+            TName memberName;
+            TInt count;
+
+            errorCode = GetNumberOfParticipants( count );
+            TEFLOGSTRING2( 
+                KTAMESIN, 
+                "CALL CPECallHandling::SendMessage EPEMessageAddedConferenceMember errorCode %d", 
+                errorCode );
+            if ( errorCode == KErrNone )
+                {
+                iModel.DataStore()->SetNumberOfConferenceMembers( count, KPEConferenceCallID );
+
+                iConferenceCall->GetConferenceMemberName( memberName );
+
+                if ( errorCode == KErrNone )
+                    {
+                    iModel.DataStore()->SetConferenceMemberInfo( 
+                        memberName, 
+                        KPEConferenceCallID, 
+                        aCallId );
+                    iModel.DataStore()->SetCallConference( aCallId, 
+                            KPEConferenceCallID );
+                    }
+                }
+            break;
+            }
+        case MEngineMonitor::EPEMessageDroppedConferenceMember:                
+            {
+            TName memberName;
+            TInt memberCallId;
+            TInt count;
+
+            errorCode = GetNumberOfParticipants( count );
+            TEFLOGSTRING2( 
+                KTAMESIN, 
+                "CALL CPECallHandling::SendMessage EPEMessageAddedConferenceMember EPEMessageDroppedConferenceMember %d", 
+                errorCode );
+            if ( errorCode == KErrNone )
+                {
+                iModel.DataStore()->SetNumberOfConferenceMembers( count, KPEConferenceCallID );
+
+                errorCode = GetConferenceMemberNameAndId( memberName, 
+                                                          memberCallId );
+
+                // Member has been taken to OneToOne conversation and is still alive
+                if ( errorCode == KErrNone )
+                    {
+                    iModel.DataStore()->SetConferenceMemberInfo( 
+                        memberName, 
+                        KPECallIdNotUsed, 
+                        aCallId );
+                    iModel.DataStore()->SetCallConference( 
+                        KPENormalVoiceCall,
+                        memberCallId );
+                    }
+                else
+                    {
+                    // Member has been dropped and its state is idle, so no 
+                    // information can be found...
+                    // So actually not an error situation memberName is empty
+                    // (set in GetConferenceMemberNameAndId method) 
+                    iModel.DataStore()->SetConferenceMemberInfo( 
+                        memberName, 
+                        KPECallIdNotUsed, 
+                        aCallId );
+                    errorCode = KErrNone;
+                    }
+                }                
+            break;    
+            }
+        case MEngineMonitor::EPEMessageCallControlCapsChanged: 
+            {
+            TPECallControlCaps callControlCaps;
+            errorCode = GetCallControlCaps( callControlCaps, aCallId );
+            if ( errorCode == KErrNone )
+                {
+                iModel.DataStore()->SetCallControlCaps( 
+                    callControlCaps, 
+                    aCallId );
+                }
+            break;
+            }
+        case MEngineMonitor::EPEMessageConferenceCapsChange:                             
+            {
+            TUint32 caps;
+            errorCode = GetConferenceCallCaps( caps );
+            if ( errorCode == KErrNone )
+                {
+                iModel.DataStore()->SetConferenceCallCaps( caps, aCallId );
+                }
+            break;    
+            }
+        case MEngineMonitor::EPEMessageDisconnecting:
+            {
+            CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
+            if ( callData )
+                {
+                TCCPTone inbandTone = callData->Tone();
+                iModel.DataStore()->SetInbandTone( inbandTone );
+                }
+            break;
+            }
+        case MEngineMonitor::EPEMessageConferenceErrorAddCall:
+        case MEngineMonitor::EPEMessageConferenceErrorRemoveCall:
+        case MEngineMonitor::EPEMessageConferenceErrorSwap:
+        case MEngineMonitor::EPEMessageConferenceErrorHold:
+        case MEngineMonitor::EPEMessageConferenceErrorResume:
+        case MEngineMonitor::EPEMessageConferenceErrorGoOneToOne:
+        case MEngineMonitor::EPEMessageConferenceErrorCurrentCallsToConference:
+            {
+            errorCode = KErrGeneral;
+            if( iConferenceCall && ( iConferenceCall->EnumerateCalls() == 0 ) )
+                {
+                delete iConferenceCall;
+                iConferenceCall = NULL;
+                }
+            break;
+            }
+        case MEngineMonitor::EPEMessageCallSecureStatusChanged:
+            {
+            iModel.DataStore()->SetCallSecureStatus( 
+                IsSecureCall( aCallId ), 
+                aCallId );
+            // Secure is specified  
+            iModel.DataStore()->SetSecureSpecified( ETrue );
+            break;
+            }          
+        case MEngineMonitor::EPEMessageSecureNotSpecified:
+            {
+            iModel.DataStore()->SetSecureSpecified( EFalse );
+            break;
+            }                     
+            
+        case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
+            {
+            TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged");
+            // HO cases call type can changes
+            CPESingleCall* connectedCall;
+            connectedCall = iCallArrayOwner->CallPointerByState( EPEStateConnected );
+            
+            if( connectedCall )
+                {
+                CCPCall::TCallType callType = connectedCall->Call().Parameters().CallType();
+                
+                if ( callType == CCPCall::ECallTypePS ) 
+                    {
+                    TEFLOGSTRING( KTAMESINT, 
+                        "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to PS");
+                    iModel.DataStore()->SetCallType( EPECallTypeVoIP, aCallId ); 
+                    iModel.DataStore()->SetServiceIdCommand( connectedCall->Call().Parameters().ServiceId() );
+                    iCallOpenParams->SetCallType( CCPCall::ECallTypePS); 
+                    }
+                else if ( callType == CCPCall::ECallTypeCSVoice )
+                    {
+                     TEFLOGSTRING( KTAMESINT, 
+                        "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to CS");
+                    iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice );
+                    iModel.DataStore()->SetServiceIdCommand( 1 );
+                    iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId );    
+                    }
+                }
+            }
+       // Flow throught
+            
+        case MEngineMonitor::EPEMessageIncoming:
+            {
+            CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
+            if( callData )
+                {
+                MCCECall& call = callData->Call();
+                iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId );
+                iModel.DataStore()->SetRemotePhoneNumber( call.RemoteParty().Left( KPEPhoneNumberMaxLength ), aCallId );
+                iModel.DataStore()->SetCallIndex(call.CallIndex(), aCallId );
+                }
+            break;
+            }
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
+            {
+            UpdateSaSetting();
+            break;
+            }
+        case MEngineMonitor::EPEMessageUnattendedTransferRequest:
+            {
+            CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId );
+            __ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) );
+            if ( call )
+                {
+                iModel.DataStore()->SetUnattendedTransferTarget( 
+                    call->UnattendedTransferTarget(), aCallId );
+                }
+            
+            break;
+            }
+        case MEngineMonitor::EPEMessageALSLineChanged:
+            {
+            SetActiveLine();
+            break;
+            }
+        case MEngineMonitor::EPEMessageMovedPermanently:
+        case MEngineMonitor::EPEMessageMultipleChoices:
+            {
+            /* Incoming moved permanently request from server,
+             * store target addresses for later use
+             */
+            CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId );
+            __ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) );
+            if ( call )
+                {
+                iModel.DataStore()->SetForwardAddressChoices( 
+                    call->ForwardAddressChoices(), aCallId );
+                }
+            
+            break;
+            }
+        default:
+            // Other messages cause no action.
+            break;
+        } 
+
+    if( aCallId != KPECallIdNotUsed )
+        {
+        // Preferred to be before sendmessage
+        // f.e active idle update before display to screen
+        iSystemCallState->NotifySystemCallStateChanged( aMessage, aCallId );
+        }
+    
+    if ( errorCode )
+        {
+        SendErrorMessage( aCallId, errorCode );
+        }
+    else
+        {
+        iModel.SendMessage( aMessage, aCallId );
+        }
+
+    // Call obect deleting in idle state is handled here because phoneengine 
+    // uses call object during idle state handling
+    if( aMessage == MEngineMonitor::EPEMessageIdle )
+        {
+        TEFLOGSTRING2( KTAINT, 
+           "CALL CPECallHandling::SendMessage DeleteCallObject %d", aCallId );
+        iCallArrayOwner->DeleteCallObject( aCallId );
+        }
+    else if( aMessage == MEngineMonitor::EPEMessageConferenceIdle )
+        {
+        delete iConferenceCall;
+        iConferenceCall = NULL;
+        if ( iReplaceActive )
+            {
+            AnswerCall();
+            iReplaceActive = EFalse;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::AnswerCall
+// Answers an incoming call
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::AnswerCall()
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::AnswerCall");
+    TInt callIndex;
+    CPESingleCall* callData;
+    CPESingleCall* connectedCall;
+    TInt errorCode( ECCPErrorNotFound );
+
+    callData = VoiceCallDataByState( EPEStateRinging, callIndex );
+    connectedCall = iCallArrayOwner->CallPointerByState( EPEStateConnected );
+    if( connectedCall && !iReplaceActive )
+        {
+        CCPCall::TCallType callType = connectedCall->Call().Parameters().CallType();
+        TEFLOGSTRING2( KTAINT, 
+            "CALL CPECallHandling::AnswerCall EPEStateConnected type %d", callType );
+        if( callType == CCPCall::ECallTypeVideo )
+            {
+            TEFLOGSTRING( KTAINT, 
+                "CALL CPECallHandling::AnswerCall ECCPErrorNotAllowed" );
+            return ECCPErrorNotAllowed;
+            }
+        }
+        
+    if ( callData )
+        {
+        TEFLOGSTRING2( KTAINT, 
+            "CALL CPECallHandling::AnswerCall > CPESingleCall::Answer %d", 
+            callData->GetCallId() );
+        errorCode = callData->Answer();        
+        }
+    else
+        {
+        TEFLOGSTRING( KTAINT, 
+            "CALL CPECallHandling::AnswerCall > iVideoCallHandling->AnswerCall");
+        errorCode = iVideoCallHandling->AnswerCall();
+        }
+        
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::DialCall
+// creates dial request to the CPESingleCall object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::DialCall( 
+    const TPEPhoneNumber& aNumber,
+    TInt& aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialCall" );
+    CPESingleCall* callData( NULL );
+    TInt errorCode( KErrNone );
+
+    // If there is allready video call, one dial in connecting, dialing or disconnecting state,
+    // we just ignore new dial request and send KErrInUse back to UI
+    if( iDialRequest )
+        {
+        // Dial request already send, waiting for dialing state.
+        errorCode = KErrGeneral;
+        TEFLOGSTRING( KTAERROR, 
+            "CALL CPECALLHANDLING::DIALCALL ! DIAL FAILED: DIAL REQUEST ALREADY ACTIVE" );
+        }
+    else if ( IsDialAllowed ( EFalse ) )
+        {
+        // Set user to user info call params.
+                // Set user to user info call params.
+                
+        const CCCECallParameters& params = iModel.DataStore()->CallParameters();
+        iCallOpenParams->SetBearer( params.Bearer() );
+        iCallOpenParams->SetSubAddress( params.SubAddress() );
+        iCallOpenParams->SetOrigin( params.Origin() );
+        iCallOpenParams->SetUUSId( iModel.DataStore()->UserToUserInformation() );
+        
+        TRAP( errorCode, callData = OpenNewCallL( aNumber ) );
+        if( errorCode == KErrNone )
+            {
+            if( iModel.DataStore()->CallOriginCommand() == EPECallOriginSAT )
+                {
+                // disable number matching for SAT calls
+                callData->DisableFDNCheck();
+                }
+            
+            TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialCall > Dial" );
+            iDialRequest = ETrue;
+            errorCode = callData->Dial( aNumber );
+            
+            if ( errorCode != KErrNone )
+                {
+                iDialRequest = EFalse;
+                // Dial failed: clean up
+                ReleaseCallObject( callData->GetCallId() );
+                TEFLOGSTRING2( KTAERROR, 
+                    "CALL CPECALLHANDLING::DIALCALL ! DIAL FAILED: MAY NOT PROCEED! %d", errorCode );
+                }
+            else
+                {
+                // Dial request passed on successfully: forward new call id
+                aCallId = callData->GetCallId();
+                }
+            }
+        }
+    else
+        {
+        errorCode = KErrInUse;
+        }
+        
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::DialMultimedia
+// creates dial request to the CPESingleCall object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::DialMultimedia( 
+        const TPEPhoneNumber& aNumber,
+        TInt& aCallId
+        )
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::DialMultimedia");
+    TInt errorCode( ECCPErrorNone );
+    
+    // If there is allready call, one dial in connecting, dialing or disconnecting state,
+    // we just ignore new dial request and send KErrInUse back to UI    
+    if ( IsDialAllowed ( ETrue ) )
+        {
+        errorCode = iVideoCallHandling->DialCall( aNumber, aCallId );
+        }
+    else
+        {
+        errorCode = ECCPErrorAlreadyInUse;
+        }
+    return errorCode;
+    }
+// -----------------------------------------------------------------------------
+// CPECallHandling::IsDialAllowed
+//  
+// -----------------------------------------------------------------------------
+//
+TBool CPECallHandling::IsDialAllowed( TBool aMultimediaDial )
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::IsDialAllowed");
+    
+    CPESingleCall* call = iCallArrayOwner->CallPointerByState( EPEStateConnected );
+    CPESingleCall* heldCall = iCallArrayOwner->CallPointerByState( EPEStateHeld );
+    
+    TBool status = EFalse;
+    
+    if( ( call || heldCall ) && aMultimediaDial )
+        {
+        // A call was found when tried video call
+        TEFLOGSTRING( KTAERROR, 
+            "CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A VIDEO CALL IN CALL STATE!");
+        }
+    else if( call && iVideoCallHandling->IsMultimedia( call->GetCallId() ) )
+        {
+        // A video call was found when tried voice or video call
+        TEFLOGSTRING( KTAERROR, 
+            "CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN VIDEO CALL STATE!");
+        }
+    else if( iCallArrayOwner->CallPointerByState( EPEStateDialing ) ) 
+        {
+        // A dialing call was found
+            TEFLOGSTRING( KTAERROR, 
+                "CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN DIALING STATE!");
+         }
+    else if( iCallArrayOwner->CallPointerByState( EPEStateConnecting ) ) 
+        { 
+        // A connecting call was found
+         TEFLOGSTRING( KTAERROR, 
+             "CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN CONNECTING STATE!");
+
+        }
+    else if( iCallArrayOwner->CallPointerByState( EPEStateDisconnecting ) ) 
+        {
+        // A disconnecting call was found
+        TEFLOGSTRING( KTAERROR, 
+            "CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN DISCONNECTING STATE!");
+         }
+    else if( ( iConferenceCall && iConferenceCall->GetCallState() == EPEStateConnectedConference && ( heldCall ) ) ||
+            ( iConferenceCall && iConferenceCall->GetCallState() == EPEStateHeldConference && ( call ) ) )
+        {
+        // coference and single call found
+        TEFLOGSTRING( KTAERROR, 
+            "CALL CPECALLHANDLING::IsDialAllowed() CANNOT CREATE A CALL IN CONFERENCE AND SINGLE STATE!");
+        }
+    else
+        {
+        status = ETrue; // Dial allowed
+        }
+    return status; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::HangUp
+// Terminates an ongoing call
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt  CPECallHandling::HangUp( 
+        TInt aCallId, 
+        TPEHangUpOptions aAutoResumeOption )
+    {
+    TEFLOGSTRING3( KTAMESINT, "CALL CPECallHandling::HangUp aCallId= %d aAutoResumeOption= %d ", aCallId, aAutoResumeOption );
+    TInt errorCode( ECCPErrorNotFound );
+    
+    CPESingleCall* heldcall = iCallArrayOwner->CallPointerByState( EPEStateHeld );
+
+    if( aAutoResumeOption == ETPEHangUpResumeHeldCall )
+        {
+        if( heldcall )
+            {
+            iModel.DataStore()->SetResumeHeldCall( ETrue, heldcall->GetCallId() );
+            }
+        else if( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) )
+            {
+            iModel.DataStore()->SetResumeHeldCall( ETrue, KPEConferenceCallID );
+            }
+        }
+    else if( aAutoResumeOption == ETPEHangUpNotResumeHeldCall )
+        {
+        if( heldcall )
+            {
+            iModel.DataStore()->SetResumeHeldCall( EFalse, heldcall->GetCallId() );
+            }
+        else if( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) )
+            {
+            iModel.DataStore()->SetResumeHeldCall( EFalse, KPEConferenceCallID );
+            }
+        }
+
+    if ( CallIdCheck::IsVoice( aCallId )) 
+        {
+        CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
+        if( callData )
+            {
+            // conference call that is not yet created, must be cancelled.
+            if( iConferenceCall && iConferenceCall->GetCallState() == EPEStateCreatingConference )
+                {
+                TEFLOGSTRING( KTAERROR, 
+                    "CPECallHandling::HangUp Delete conference call.");
+                delete iConferenceCall;
+                iConferenceCall = NULL;
+                }
+            
+            errorCode = callData->HangUp();
+            }
+        else
+            {
+            TEFLOGSTRING( KTAERROR, 
+                "CALL CPECALLHANDLING::HANGUP ! CALL OBJECT IN IDLE STATE OR ALREADY HANGING UP" );
+            }
+        }
+
+    else if ( CallIdCheck::IsVideo( aCallId ) ) 
+        {
+        errorCode = iVideoCallHandling->HangUp( aCallId );
+        }
+
+    else if ( CallIdCheck::IsConference( aCallId ) )
+        {
+        if( iConferenceCall )
+            {
+            errorCode = iConferenceCall->HangUp();
+            }
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::TerminateAllConnections
+// Terminates all ringing voice and data calls
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::TerminateAllConnections()
+    {
+    CPESingleCall* callData;
+    TPEState callState;
+
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::TerminateAllConnections");
+    
+    RejectCall(); // Rejects ringing call if one exists.
+
+    if ( iConferenceCall )
+        {
+        TEFLOGSTRING( KTAMESOUT, 
+            "CALL CPECallHandling::TerminateAllConnections: Hanging Up conference call" );
+        iConferenceCall->HangUp();
+        }
+            
+    // Hangup normal Voice Calls
+    for( TInt callId = 0; callId < KPEMaximumNumberOfVoiceCalls; callId++ )
+        {
+        callData = iCallArrayOwner->GetCallObject( callId );
+        if( callData )
+            {
+            callState = callData->GetCallState();
+            if ( callState != EPEStateIdle ) 
+                {
+                TEFLOGSTRING2( KTAREQOUT, 
+                    "CALL CPECallHandling::TerminateAllConnections: Hanging Up call id %d...", 
+                    callId );
+                callData->HangUp();
+                }
+            }
+        }
+    //Terminate all ringing data calls, connected data calls and packet data connections
+    return iVideoCallHandling->TerminateAllConnections();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::UpdatePhoneIdentity
+// Method updates phone identity
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::UpdatePhoneIdentity(
+    MEngineMonitor::TPEMessagesFromPhoneEngine /*aMessage*/ )
+    {
+    TInt retValue( KErrNone ); 
+    CSInfo csinfo;
+    retValue = iConvergedCallEngine.GetCSInfo( csinfo );
+    
+    TPEPhoneIdentityParameters phoneIdentityParameters;
+    
+    phoneIdentityParameters.iSerialNumber = csinfo.iSerialNumber;
+        
+    iModel.DataStore()->SetPhoneIdentityParameters( phoneIdentityParameters );
+
+    SendMessage( MEngineMonitor::EPEMessageShowIMEI );
+    return retValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::IsCallInState
+// returns ETrue if there is a call in given state; otherwise EFalse
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPECallHandling::IsCallInState( TPEState aState ) const
+    {
+    TBool isCallInState( EFalse );
+    iCallArrayOwner->CallPointerByState( aState ) ? isCallInState = ETrue : isCallInState = EFalse;
+    
+    return isCallInState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetCallIdByState
+// returns return callid is there is a call; otherwise KPECallIdNotUsed( -1 ).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::GetCallIdByState( TPEState aState ) const
+    {
+    TInt callId( KPECallIdNotUsed );
+    CPESingleCall* call = iCallArrayOwner->CallPointerByState( aState );
+    if( call )
+        {
+        callId = call->GetCallId();
+        }
+    TEFLOGSTRING2( KTAREQOUT, 
+                   "CALL CPECallHandling::GetCallIdByState: callid %d", 
+                   callId );
+    return callId;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetMissedCall
+// Returns the missed voice call indicator.
+// Method checks that call id is valid number
+// Method gets CPECallData object from the CArrayPtrFlat and
+// Method gets the missed voice call indicator from CPECallData object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::GetMissedCall( 
+        TBool& aMissedCall,
+        TInt aCallId )
+    {
+    TInt errorCode( ECCPErrorNotFound );
+
+    CPESingleCall* voiceCall = iCallArrayOwner->GetCallObject( aCallId );
+    if( voiceCall )
+        {
+        errorCode = voiceCall->GetMissedCall( aMissedCall );
+        }
+    else
+        {
+        __ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) );
+        }
+
+    return errorCode;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetCallInfo
+// Returns call info
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::GetCallInfo( 
+    RMobileCall::TMobileCallInfoV3& aCallInfo,
+    TInt aCallId )
+    {
+    CPESingleCall* callData;
+    TInt errorCode( ECCPErrorNotFound );
+
+    if ( CallIdCheck::IsVoice( aCallId ))
+        {
+        callData = iCallArrayOwner->GetCallObject( aCallId );
+        if( callData )
+            {
+            errorCode = callData->GetCallInfo( aCallInfo );
+            }
+        else
+            {
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) );
+            }
+        }
+        
+    else if ( CallIdCheck::IsVideo( aCallId ) )
+        {
+        errorCode = iVideoCallHandling->GetCallInfo( aCallInfo, aCallId );
+        }
+        
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetCallState
+// Returns call state
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TPEState CPECallHandling::GetCallState( 
+        TInt aCallId )
+    {
+    TPEState callState( EPEStateUnknown );
+    
+    if ( CallIdCheck::IsConference( aCallId ) )
+        {
+        if( iConferenceCall )
+            {
+            callState = iConferenceCall->GetCallState();
+            }
+        else
+            {
+            callState = EPEStateConferenceIdle;
+            }
+        }
+    else
+        {
+        CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
+        if( callData )
+            {
+            callState = callData->GetCallState();
+            }
+        else
+            {
+            callState = EPEStateIdle;
+            }
+        }
+
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetCallState, callState: %d", callState );
+    return callState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetNumberOfCalls
+// Returns number of non-idle calls
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::GetNumberOfCalls()
+    {
+    // Count ongoing calls
+    return iCallArrayOwner->ActiveCallCount();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetCallDuration
+// Returns voice call duration.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::GetCallDuration( 
+    TTimeIntervalSeconds& aDuration,
+    TInt aCallId )
+    {
+    TInt errorCode( KErrNone );
+
+    if ( CallIdCheck::IsVoice( aCallId ))
+        {
+        CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
+        if( callData )
+            {
+            callData->GetCallDuration( aDuration );
+            }
+        else
+            {
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) );
+            }
+        }
+    else if ( CallIdCheck::IsVideo( aCallId ) )
+        {
+        iVideoCallHandling->GetCallDuration( aDuration, aCallId );
+        }
+    else if ( CallIdCheck::IsConference( aCallId ) )
+        {
+        if( iConferenceCall )
+            {
+            iConferenceCall->GetCallDuration( aDuration );
+            errorCode = KErrNone;
+            }
+        else
+            {
+            errorCode = ECCPErrorNotFound;
+            }
+        }
+    else
+        {
+        errorCode = ECCPErrorNotFound;
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::RejectCall
+// rejects the incoming call
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::RejectCall()
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::RejectCall");
+    TInt callIndex;
+    TInt errorCode( ECCPErrorNotFound );
+    
+    CPESingleCall* callData = VoiceCallDataByState( EPEStateRinging, callIndex );
+    if( callIndex >= 0 )
+        {
+        callData->HangUp();
+        errorCode = KErrNone;
+        }
+    else
+        {
+        // Data call reject
+        errorCode = iVideoCallHandling->RejectCall();
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ReleaseAll
+// Release ongoing calls
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::ReleaseAll()
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::ReleaseAll");
+    CPESingleCall* callData;
+    TInt errorCode( ECCPErrorNotFound );
+    
+    // Normal Voice Calls
+    for ( TInt callId=0; callId < KPEMaximumNumberOfVoiceCalls; callId++ )
+        {
+        callData = iCallArrayOwner->GetCallObject( callId );
+        if( callData && 
+            callData->GetCallState() != EPEStateIdle &&
+            callData->GetCallState() != EPEStateRinging )
+            {
+            callData->HangUp();
+            errorCode = KErrNone;
+            }
+        }
+    
+    // Release ongoing data calls
+    errorCode ? errorCode = iVideoCallHandling->ReleaseAll() : iVideoCallHandling->ReleaseAll();
+      
+    TEFLOGSTRING2( KTAINT, "PE CPECallHandling::ReleaseAll, error id: %d", 
+        errorCode );
+    
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SendDtmf
+// sends dtmf string
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::SendDtmf( 
+    const TPEDtmfString& aDtmfString )
+    {
+    return iDtmfHandling->SendDtmfString( aDtmfString );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ContinueDtmfSending
+// Continues dtmf sending after 'w'-character
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPECallHandling::ContinueDtmfSending()
+    {
+    iDtmfHandling->ContinueDtmfSending();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::StartDtmfTone
+// sends dtmf tone to the remote party
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::StartDtmfTone( 
+    const TChar& aTone )
+    {
+    iDtmfHandling->StartDtmfTone(aTone);
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::StopDtmfSending
+// Stops dtmf sending after 'w'-character
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPECallHandling::StopDtmfSending()
+    {
+    iDtmfHandling->StopDtmfSending();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::StopDtmfTone
+// stops sending dtmf tone to the remote party
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::StopDtmfTone()
+    {
+    iDtmfHandling->StopDtmfTone();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::CancelDtmfPlay
+// Cancels Dtmf string sending
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPECallHandling::CancelDtmfPlay()
+    {
+    iDtmfHandling->CancelDtmfString();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::VoiceCallDataByState
+// returns CPESingleCall voice call object by State
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPESingleCall* CPECallHandling::VoiceCallDataByState( 
+    TPEState aState,
+    TInt& aIndex ) const
+    {
+    aIndex = KPECallIdNotUsed;
+    CPESingleCall* returnValue = NULL;
+    if ( aState != EPEStateIdle )
+        {
+        for ( TInt callId=0; callId < KPEMaximumNumberOfVoiceCalls; callId++ )
+            {        
+            CPESingleCall* callData = iCallArrayOwner->GetCallObject( callId );
+            if( callData )
+                {
+                if ( callData->GetCallState() == aState )
+                    {
+                    TEFLOGSTRING2( 
+                        KTAREQEND, 
+                        "CALL CPECallHandling::VoiceCallDataByState: , aState: %d", 
+                        aState );
+                    TEFLOGSTRING2( 
+                        KTAREQEND, 
+                        "CALL CPECallHandling::VoiceCallDataByState: , callId: %d", 
+                        aState );
+                    aIndex = callId;
+                    returnValue = callData;
+                    break;
+                    }
+                }
+            }
+        }
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// From base class MPECallInitiator
+// Initialises (incoming,external) voice call.
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::InitVoiceCall( MCCECall& aNewCall )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitVoiceCall" );
+    CPESingleCall* callData( NULL );
+    TRAP_IGNORE( ( callData = iCallArrayOwner->CreateCallL( *this ) ) );
+
+    if ( callData )
+        {
+        iModel.DataStore()->SetPhoneNumber( KNullDesC() );
+        iModel.DataStore()->SetServiceId( callData->GetCallId(), aNewCall.ServiceId() );
+        const CCCPCallParameters& callParameters = aNewCall.Parameters();
+        
+        TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::InitVoiceCall call type: %d",  callParameters.CallType() );
+        switch ( callParameters.CallType() )
+            {
+            case CCPCall::ECallTypeCSVoice:
+                {
+                iModel.DataStore()->SetCallType( EPECallTypeCSVoice, callData->GetCallId() );
+                // Set incoming Call's Als line
+                const CCCECallParameters& cceparams = 
+                    static_cast<const CCCECallParameters&> (callParameters);
+                iModel.DataStore()->SetCallALSLine( cceparams.LineType(), callData->GetCallId() );
+                }
+                break;
+            case CCPCall::ECallTypePS:
+                {
+                iModel.DataStore()->SetCallType( EPECallTypeVoIP, callData->GetCallId() );
+                }
+                break;
+            default:
+                __ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange ));
+                break;
+            }
+        callData->SetCall( aNewCall );
+        TPECallControlCaps callControlCaps;
+        TInt err = GetCallControlCaps( callControlCaps, callData->GetCallId() );
+        if ( err == KErrNone )
+            {
+            iModel.DataStore()->SetCallControlCaps( callControlCaps, callData->GetCallId() );
+            }
+        iModel.DataStore()->SetCallSecureStatus( IsSecureCall( callData->GetCallId() ), callData->GetCallId() );
+        iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() );
+        }
+    else
+        {
+        Panic( EPEPanicNoFreeCalls );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// From base class MPECallInitiator
+// Initialises (incoming,external) video call.
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::InitVideoCall( MCCECall& aNewCall )
+    {
+    iVideoCallHandling->InitCall( aNewCall );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ConnectedCalls
+// Indicates if there is any connected calls
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPECallHandling::ConnectedCalls()
+    {
+    TInt index;
+    return ( VoiceCallDataByState( EPEStateConnected, index ) ||
+             VoiceCallDataByState( EPEStateHeld, index ) ||
+             iVideoCallHandling->ConnectedCalls() );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::StartUp
+// Starts monitoring incoming data calls
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPECallHandling::StartUp()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SetCallParams
+//
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::SetCallParams( TInt aCallId )
+    {
+    iCallOpenParams->SetLineType( iActiveLine );
+    iModel.DataStore()->SetCallALSLine( iActiveLine, aCallId );
+    switch ( iModel.DataStore()->CallTypeCommand() )
+        {
+        case EPECallTypeCSVoice:
+            {
+            iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice );
+            iModel.DataStore()->SetServiceIdCommand( 1 );
+            iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId );
+            }
+            break;
+        case EPECallTypeVideo:
+            {
+            iCallOpenParams->SetCallType( CCPCall::ECallTypeVideo);
+            iModel.DataStore()->SetServiceIdCommand( 1 );
+            iModel.DataStore()->SetCallType( EPECallTypeVideo, aCallId );
+            }
+            break;
+        case EPECallTypeVoIP:
+            {
+            iCallOpenParams->SetCallType( CCPCall::ECallTypePS);
+            iModel.DataStore()->SetCallType( EPECallTypeVoIP, aCallId );
+            //PhoneApp set service id in voip call case
+            }
+            break;
+        case EPECallTypeUninitialized:
+        default:
+            iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice);
+            iModel.DataStore()->SetServiceIdCommand( 1 );
+            iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId );
+            break;
+        } 
+    iCallOpenParams->SetServiceId( iModel.DataStore()->ServiceIdCommand() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SendMessage
+// Reroutes messages to the Phone Engine
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::SendMessage( 
+    const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+    const TName& aName )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::SendMessage, message id: %d", aMessage );
+    TInt callId( KPECallIdNotUsed );
+    MPECall* call = iCallArrayOwner->CallByName( aName );
+    if( call )
+        {
+        callId = call->GetCallId();
+        }
+
+    SendMessage( aMessage, callId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::HandleInternalMessage
+// Reroutes messages to the Phone Engine
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::HandleInternalMessage(
+    TInt aMessage )
+    {
+    iModel.HandleInternalMessage( aMessage );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::OpenNewCallL
+// returns ETrue if hangup active
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPECallHandling::OpenNewCallL( const TPEPhoneNumber& aNumber )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::OpenNewCallL");
+    TInt errorCode( KErrNone );
+    CPESingleCall* callData( NULL );
+    MCCECall* cceCall( NULL );
+    callData = iCallArrayOwner->CreateCallL( *this );
+    SetCallParams( callData->GetCallId() );
+    
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::OpenNewCallL > CCCE::OpenNewCallL");
+    TRAP( errorCode, 
+          cceCall = &( iConvergedCallEngine.OpenNewCallL( aNumber, 
+                                                          *iCallOpenParams, 
+                                                          *callData ) ) );
+    if ( errorCode == KErrNone )
+        {
+        callData->SetCall( *cceCall );
+        iModel.DataStore()->SetServiceId( callData->GetCallId(), cceCall->ServiceId() );
+        iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() );
+        iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() ); 
+        TPECallControlCaps callControlCaps;
+        TInt err = GetCallControlCaps( callControlCaps, callData->GetCallId() );
+        if ( err == KErrNone )
+            {
+            iModel.DataStore()->SetCallControlCaps( callControlCaps, callData->GetCallId() );
+            }
+        }
+    else
+        {
+        // Open new call failed
+        ReleaseCallObject( callData->GetCallId() );
+        TEFLOGSTRING2( KTAERROR, 
+            "CALL CPECALLHANDLING::OPENNEWCALLL ! OPENNEWCALL FAILED: MAY NOT PROCEED! %d", errorCode );
+        User::Leave( errorCode );
+        }
+    return callData;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPECallHandling::SetActiveLine
+// Sets active line
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPECallHandling::SetActiveLine()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPECallHandling::SetActiveLine" );
+    iActiveLine = iModel.DataStore()->ALSLine();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::IsSecureCall
+// Returns the call secure status
+// -----------------------------------------------------------------------------
+//
+TBool CPECallHandling::IsSecureCall( const TInt aCallId ) const
+    {
+    TEFLOGSTRING2( 
+        KTAINT, 
+        "PE CPECallHandling::IsSecureCall:  aCallId = %d", 
+        aCallId );
+    CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId );
+    
+    __ASSERT_DEBUG( call, Panic( EPEPanicIndexOutOfRange ) );  
+    TBool secured( EFalse );
+    if( call )
+        {
+        secured = call->IsSecureCall();
+        }
+    return secured;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetNumberOfParticipants
+// returns number of conference members
+// -----------------------------------------------------------------------------
+//
+TInt CPECallHandling::GetNumberOfParticipants( 
+        TInt& aCount )    // The Number of participants 
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetNumberOfParticipants" );
+    TInt errorCode( ECCPErrorNotFound );
+
+    if ( iConferenceCall )
+        {
+        aCount = iConferenceCall->EnumerateCalls();
+        TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetNumberOfParticipants count %d", aCount );
+        errorCode = KErrNone;
+        }
+    return errorCode;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetConferenceMemberNameAndId
+// Returns added or removeds members TName information and CallId.
+// -----------------------------------------------------------------------------
+//
+TInt CPECallHandling::GetConferenceMemberNameAndId( 
+        TName& aCallName,   // Added or removed members TName information is returned here
+        TInt& aMemberCallId ) // Added or removed members callid is returned here
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetConferenceMemberNameAndId" );
+    TInt errorCode( ECCPErrorNotFound );
+
+    if ( iConferenceCall )
+        {
+        iConferenceCall->GetConferenceMemberName( aCallName );
+        MPECall* call = iCallArrayOwner->CallByName( aCallName );
+        
+        if( call )
+            {
+            aMemberCallId = call->GetCallId();
+            TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetConferenceMemberNameAndId CallId %d", aMemberCallId );
+            errorCode = KErrNone;
+            }
+        else
+            {
+            aMemberCallId = -1;
+            aCallName = KNullDesC;
+            }   
+        }
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetConferenceMemberNameAndId errorCode %d", errorCode );
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetCallControlCaps
+// returns call info
+// Method checks that call id is valid number
+// Method gets CPESingleCall object from the CArrayPtrFlat and
+// Method gets call info from CPESingleCall object
+// -----------------------------------------------------------------------------
+//
+TInt CPECallHandling::GetCallControlCaps(
+        TPECallControlCaps& aCallControlCaps,
+        TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GetCallControlCaps %d", aCallId );
+    CPESingleCall* callData;
+    TInt errorCode( ECCPErrorNotFound );
+    MCCECallObserver::TCCECallControlCaps callControlCaps;
+    callData = iCallArrayOwner->GetCallObject( aCallId );
+
+    if ( callData )
+        {
+        callData->GetCallControlCaps( callControlCaps );
+        aCallControlCaps = static_cast<TPECallControlCaps>( callControlCaps );
+        errorCode = KErrNone;
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetConferenceCallCaps
+// returns conference call capabilities
+// Checks that call id is valid and gets CPEConferenceCall object and calls its method
+// to get capabilities
+// -----------------------------------------------------------------------------
+//
+TInt CPECallHandling::GetConferenceCallCaps( 
+        TUint32& aCaps )     // capabilities are returned in this parameter
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetConferenceCallCaps" );
+    TInt errorCode( ECCPErrorNotFound );
+    if ( iConferenceCall  )
+        {
+        aCaps = iConferenceCall->CallCaps();
+        errorCode = KErrNone;
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::AddMember
+// Adds member to the conference call
+// -----------------------------------------------------------------------------
+//
+TInt CPECallHandling::AddMember(
+        TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::AddMember %d", aCallId );
+    TInt errorCode( KErrNone );
+    TRAP( errorCode, AddMemberL( aCallId ));
+    return errorCode;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::AddMemberL
+// Adds member to the conference call
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::AddMemberL(
+        TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::AddMemberL" );
+    CPESingleCall* callData;
+    callData = iCallArrayOwner->GetCallObject( aCallId );
+    
+    if ( callData && iConferenceCall && CallIdCheck::IsVoice( aCallId ))
+        {
+        iConferenceCall->AddCallL( callData->Call() );
+        }
+    else
+        {
+        User::Leave( ECCPErrorNotFound );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::CallTerminatedError
+// Handles RemoteTerminated. 
+// -----------------------------------------------------------------------------
+// 
+EXPORT_C TInt CPECallHandling::CallTerminatedError(
+        const TInt aCallId )
+    {
+    TInt errorCode( KErrNone );
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CallTerminatedError" );
+    CPESingleCall* callObject = iCallArrayOwner->GetCallObject( aCallId );
+    if ( callObject )
+        {
+        callObject->GetErrorCode( errorCode );
+        }
+    
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::BuildConference
+// creates conference call
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::BuildConference()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::BuildConference" );
+    TInt heldcallid;
+    CPESingleCall* heldcall( NULL );
+    TInt connectedcallid;
+    CPESingleCall* connectedcall( NULL );
+    TInt errorCode( ECCPErrorNotAllowed );
+
+    heldcall = VoiceCallDataByState( EPEStateHeld, heldcallid );
+    if ( heldcall )
+        {
+        connectedcall = VoiceCallDataByState( EPEStateConnected, connectedcallid );
+        
+        if ( connectedcall )
+            {
+            TRAP( errorCode, CreateConferenceCallL( *heldcall, *connectedcall ) );
+            }
+        }
+    
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SwapCalls
+// resumes a held call
+// Method search active and held call
+// Method gets CPESingleCall object from the CArrayPtrFlat and
+// Method checks that call is in held state
+// Method makes swap request to CPESingleCall object.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::SwapCalls()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::SwapCalls" );
+    TInt callIndex;
+    CPESingleCall* callData;
+    TInt errorCode( ECCPErrorNotFound );
+
+    if ( ( iConferenceCall ) && 
+         ( iConferenceCall->GetCallState() == EPEStateConnectedConference ) )
+        {
+        errorCode = iConferenceCall->Swap();
+        }
+    else
+        {
+        callData = VoiceCallDataByState( EPEStateConnected, callIndex );
+        if( callData )
+            {
+            errorCode = callData->Swap();
+            }
+        }
+
+    return errorCode;
+    }   
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::AddConferenceMember
+// Handles add conference member
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::AddConferenceMember()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::AddConferenceMember" );
+
+    CPESingleCall* callData;
+    TInt errorCode( ECCPErrorNotFound );
+    TPEState callState;
+    
+    // Checks that call is single call and state of call is connected or held
+    for( TInt callId = 0; callId < KPEMaximumNumberOfVoiceCalls; callId++ )
+        {
+        callData = iCallArrayOwner->GetCallObject( callId );
+        if( callData )
+            {
+            // Check that call is not already join to Conference
+            if ( iModel.DataStore()->IsConferenceMemberId( callId ) == KPECallIdNotUsed )
+                {
+                callState = callData->GetCallState();
+                if ( callState == EPEStateConnected || callState == EPEStateHeld )
+                    {
+                    TEFLOGSTRING2( KTAINT, 
+                        "CALL CPECallHandling::AddConferenceMember > AddMember, CallId =  %d"
+                        , callId );
+                    errorCode = AddMember( callId );
+                    break;
+                    }
+                }
+            }
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::DropMember
+// drops member from the conference call
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::DropMember( 
+        TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::DropMember %d", aCallId );
+    CPESingleCall* callData;
+    TInt errorCode( ECCPErrorNotFound );
+
+    if ( CallIdCheck::IsVoice( aCallId ))
+        {
+        callData = iCallArrayOwner->GetCallObject( aCallId );
+        if ( callData )
+            {
+            callData->HangUp();
+            errorCode = KErrNone;
+            }
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GoOneToOne
+// Splits one call to private conversation.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::GoOneToOne( 
+        TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::GoOneToOne %d", aCallId );
+    TInt errorCode( ECCPErrorNotFound );
+    CPESingleCall* callData;
+    
+    callData = iCallArrayOwner->GetCallObject( aCallId );
+            
+    if ( iConferenceCall && callData )
+        {
+        TRAP( errorCode, iConferenceCall->GoOneToOneL( callData->Call() ) );
+        }
+    return errorCode;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPECallHandling::HoldCall
+// holds an active call
+// Method checks that call id is valid number and
+// Method gets CPESingleCall object from the CArrayPtrFlat and
+// Method checks that call is in connected state
+// Method makes hold request to CPESingleCall object.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::HoldCall()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HoldCall" );
+    CPESingleCall* callData;
+    TInt callIndex;
+    TInt errorCode( ECCPErrorNotAllowed );
+
+    if ( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateConnectedConference ) )
+        {
+        // hold was explicitly requested by the user, 
+        // update information to engine info
+        iModel.DataStore()->SetResumeHeldCall( EFalse, KPEConferenceCallID );
+        errorCode = iConferenceCall->Swap();
+        }
+    else
+        {
+        callData = VoiceCallDataByState( EPEStateConnected, callIndex );   
+        if( callData )
+            {
+            // hold was explicitly requested by the user, 
+            // update information to engine info
+            iModel.DataStore()->SetResumeHeldCall( EFalse, callIndex );
+            errorCode = callData->Hold();
+            }
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ResumeCall
+// resumes a held call
+// Method checks that call id is valid number and
+// Method gets CPESingleCall object from the CArrayPtrFlat and
+// Method checks that call is in held state
+// Method makes resume request to CPESingleCall object.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::ResumeCall()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::ResumeCall" );
+    CPESingleCall* callData;
+    TInt callIndex;
+    TInt errorCode( ECCPErrorNotAllowed );
+
+    if ( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) )
+        {
+        // resume was explicitly requested by the user, update information to engine info
+        iModel.DataStore()->SetResumeHeldCall( ETrue, KPEConferenceCallID );
+        errorCode = iConferenceCall->Swap();
+        }
+    else
+        {
+        callData = VoiceCallDataByState( EPEStateHeld, callIndex );
+        if( callData )
+            {
+            // resume was explicitly requested by the user, update information to engine info
+            iModel.DataStore()->SetResumeHeldCall( ETrue, callIndex );
+            errorCode = callData->Resume();
+            }
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::TransferCalls
+// transfers the held party to the active party
+// Method search active and held call
+// Method gets CPESingleCall object from the CArrayPtrFlat and
+// Method checks that call is in held state
+// Method makes transfer request to CPESingleCall object.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::TransferCalls()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::TransferCalls" );
+    TInt callIndex;
+    CPESingleCall* callData;
+    CPESingleCall* callDataHeld;
+    TInt errorCode( ECCPErrorNotAllowed );
+
+    callDataHeld = VoiceCallDataByState( EPEStateHeld, callIndex );
+    if( callDataHeld && !iConferenceCall )
+        { // found one held call
+        callData = VoiceCallDataByState( EPEStateConnected, callIndex );
+        if ( callData ) // found the connected call
+           {
+           TEFLOGSTRING( KTAINT, "CALL CPECallHandling::TransferCalls > Transfer" );
+           callDataHeld->Transfer( callData->Call().DialledParty() );
+           errorCode = KErrNone;
+           }
+        else
+           {
+           callData = VoiceCallDataByState( EPEStateConnecting, callIndex );
+           if ( callData ) // The connecting call found
+              {
+              TEFLOGSTRING( KTAINT, "CALL CPECallHandling::TransferCalls > Transfer" );
+              callDataHeld->Transfer( callData->Call().DialledParty() );
+              errorCode = KErrNone;
+              }
+           }
+        }
+        
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::DialEmergencyCall
+// creates emergency dial request to the CPESingleCall object
+//    Method gets CPESingleCall object from the CArrayPtrFlat
+//    Method makes emergency dial request
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPECallHandling::DialEmergencyCall( const TPEPhoneNumber& aEmergencyNumber )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialEmergencyCall" );
+    
+    SendMessage( MEngineMonitor::EPEMessageInitiatedEmergencyCall );
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DialEmergencyCall start emergency dialing" );
+    CPESingleCall* callData = iCallArrayOwner->GetCallObject( KPEEmergencyCallId );
+    callData->DialEmergency( aEmergencyNumber );   
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetCallTerminatedDiagnostics
+// Returns call terminated diagnostics of a call
+// Method returns valid info only after call state has changed to Idle.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::GetCallTerminatedDiagnostics( 
+        TName& /*aCallName*/ ) const
+    {
+        
+    TInt diagnosticsInfo = 0/*iCustomAPI.GetDiagnosticInfo( aCallName )*/;
+    TEFLOGSTRING2( KTAMESIN, 
+            "CALL CPECallHandling::GetCallTerminatedDiagnostics: RMmCustomAPI::GetDiagnosticInfo, diagnosticInfo: %d", 
+            diagnosticsInfo );
+    return diagnosticsInfo;        
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::CreateConferenceCallL
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::CreateConferenceCallL( 
+    CPESingleCall& aCall1, 
+    CPESingleCall& aCall2 )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CreateConferenceCallL start" );
+    if( !iConferenceCall )
+        {
+        iConferenceCall = CPEConferenceCall::NewL( *this, iConvergedCallEngine );
+        iConferenceCall->SetCallId( KPEConferenceCallID );
+        iConferenceCall->AddCallL( aCall1.Call() );
+        iConferenceCall->AddCallL( aCall2.Call() );
+        InitialiseConferenceCallInfo( aCall1.Call(), aCall2.Call() );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "CALL CPECallHandling::CreateConferenceCallL already exist" );
+        User::Leave( KErrAlreadyExists );
+        }
+
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::CreateConferenceCallL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::GetLifeTime
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CPECallHandling::GetLifeTime( TDes8& aLifeTimeInfo )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::GetLifeTime" );
+    return iConvergedCallEngine.GetLifeTime( aLifeTimeInfo );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallHandling::UpdateSaSetting
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::UpdateSaSetting()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::UpdateSaSetting start" );
+    
+    TUnconditionalCFStatus status( KCFIndicatorUnknown );
+    TSelectedLine line( ENotSupportedLine );
+    CCCECallParameters::TCCELineType lineType( CCCECallParameters::ECCELineTypePrimary );
+    CPESingleCall* call( NULL );
+    TCallDivertNotifySetting notifySet;
+    notifySet.Initialize();
+    notifySet.iCfActivated = ETrue;
+    
+    // Get dialing call object
+    call = iCallArrayOwner->CallPointerByState( EPEStateDialing );
+     
+    // Determinate als support and used line
+    lineType = iModel.DataStore()->ALSLine();
+    if( iModel.DataStore()->ALSLineSupport() )
+        {
+        if( CCCECallParameters::ECCELineTypePrimary == lineType )
+            {
+            line = EPrimaryLine;
+            }
+        else
+            {
+            line = EAuxiliaryLine;
+            }
+        }
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::UpdateSaSetting line %d", line );
+    
+    // Determinate basic service code
+    notifySet.iBasicServiceCode = DefineDivertBsc( lineType, call  ); 
+    
+    // Create phonesetting connection
+    if( !iPsetSAObserver )
+        {
+        TRAPD( errorCode, iPsetSAObserver = CPsetSAObserver::NewL() );
+        if( errorCode != KErrNone )
+            {
+            TEFLOGSTRING2( 
+               KTAERROR, 
+               "CALL CPECallHandling::UpdateSaSetting FAIL with error %d", 
+               errorCode );
+            return;
+            }
+        }
+        
+    // Get diver status
+    TInt error = iPsetSAObserver->GetCurrentDivertStatus( status );
+    if ( error != KErrNone )
+        {
+        status = KCFNoCallsForwarded;
+        }
+    notifySet.iPreviousCfStatus = status;
+    
+    // Update dovert indicator.
+    iPsetSAObserver->NotifyDivertChange( 
+        line, 
+        notifySet,
+        0 );
+        
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::UpdateSaSetting end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::DefineDivertBsc
+// -----------------------------------------------------------------------------
+//  
+TInt CPECallHandling::DefineDivertBsc( CCCECallParameters::TCCELineType aLineType, 
+                                       CPESingleCall* call )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc start" );
+    TInt bsc( EAllTele );
+    
+    if ( !call )
+        {
+        TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EUnknown" );
+        bsc = EUnknown;
+        return bsc;
+        }
+    else if ( call->Call().Parameters().CallType() == CCPCall::ECallTypeVideo  )
+        {
+        // If initiated call is video set bsc as ESyncData.
+        TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc ESyncData" );
+        bsc = ESyncData;
+        return bsc;
+        }
+
+    switch ( aLineType )
+        {
+        case CCCECallParameters::ECCELineTypePrimary:
+            // Call is done using line 1.
+            TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EAllTele" );
+            bsc = EAllTele;  
+            break;
+        case CCCECallParameters::ECCELineTypeAux:
+            // Call is done using line 2.
+            TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EAltTele" );
+            bsc = EAltTele;  
+            break;
+        default:
+            // Defauld case no alternate line service.
+            TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DefineDivertBsc EAllTele default" );
+            bsc = EAllTele;  
+            break;
+        }
+        
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::DefineDivertBsc end, bsc = %d", bsc );
+    return bsc;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ReplaceActive
+// Terminates an active call and answer waiting call
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::ReplaceActive()
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::ReplaceActive");
+    TInt errorCode( ECCPErrorNotFound );
+    TInt callIdConnected = KPECallIdNotUsed;
+         
+    CPESingleCall* replacingcall = iCallArrayOwner->CallPointerByState( EPEStateRinging );
+
+    if( iConferenceCall && iConferenceCall->GetCallState() == EPEStateConnectedConference )
+        {
+        callIdConnected = iConferenceCall->GetCallId(); 
+        }
+    else
+        {
+        CPESingleCall* connectedcall = iCallArrayOwner->CallPointerByState( EPEStateConnected );
+        if ( connectedcall )
+            {
+            callIdConnected = connectedcall->GetCallId();
+            }
+        }
+    if ( callIdConnected != KPECallIdNotUsed && replacingcall ) 
+        {
+        if( CallIdCheck::IsConference( callIdConnected ) || CallIdCheck::IsVoice( callIdConnected ) )
+            {
+            iReplaceActive = ETrue;
+            errorCode = HangUp( callIdConnected , ETPEHangUpNotResumeHeldCall );
+            TEFLOGSTRING2( KTAMESINT, "CALL CPECallHandling::ReplaceActive HangUp error %d", errorCode );
+            if ( !CallIdCheck::IsConference( callIdConnected ) && errorCode == KErrNone ) // Conference replace when idle
+                {
+                errorCode = AnswerCall();
+                iReplaceActive = EFalse;
+                TEFLOGSTRING2( KTAMESINT, "CALL CPECallHandling::ReplaceActive AnswerCall error %d", errorCode );
+                }
+            else if ( errorCode != KErrNone )
+                {
+                iReplaceActive = EFalse;
+                }
+            }
+        else
+            {
+            errorCode = iVideoCallHandling->ReplaceActive( callIdConnected );
+            TEFLOGSTRING2( KTAMESINT, "CALL CPECallHandling::ReplaceActive DataCallHandling::ReplaceActive error %d", errorCode );
+            }
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "CALL CPECALLHANDLING::REPLACEACTIVE ! CALL OBJECT NOT FOUND" );
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::AcceptUnattendedTransfer
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::AcceptUnattendedTransfer()
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::AcceptUnattendedTransfer" );
+    
+    TInt callId = iModel.DataStore()->CallId();
+    CPESingleCall* call = iCallArrayOwner->GetCallObject( callId );
+    __ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) );
+    if ( NULL != call )
+        {
+        return call->AcceptUnattendedTransfer();
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::RejectUnattendedTransfer
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::RejectUnattendedTransfer()
+    {
+    TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::RejectUnattendedTransfer" );
+    
+    TInt callId = iModel.DataStore()->CallId();
+    CPESingleCall* call = iCallArrayOwner->GetCallObject( callId );
+    __ASSERT_DEBUG( NULL != call, Panic( EPEPanicIllegalCommand ) );
+    if ( NULL != call )
+        {
+        return call->RejectUnattendedTransfer();
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::DoUnattendedTransfer
+// Does unattended transfer request for the connected VoIP call
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::DoUnattendedTransfer( const TDesC& aTransferTarget )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::DoUnattendedTransfer" );
+    CPESingleCall* callData;
+    TInt callIndex;
+    TInt errorCode( ECCPErrorNotAllowed );
+    callData = VoiceCallDataByState( EPEStateConnected, callIndex );  
+   
+    if( callData )
+        { 
+        errorCode = callData->UnattendedTransfer( aTransferTarget );
+        }
+       
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ForwardCallToAddress
+// Forwards call by user selected address
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPECallHandling::ForwardCallToAddress( TInt aIndex )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::ForwardCallToAddress" );
+    CPESingleCall* callData;
+    TInt callIndex;
+    TInt errorCode( ECCPErrorNotAllowed );
+    callData = VoiceCallDataByState( EPEStateDialing, callIndex );  
+   
+    if ( NULL == callData )
+        {
+        callData = VoiceCallDataByState( EPEStateConnecting, callIndex );
+        }
+    
+    if ( NULL == callData )
+        {
+        callData = VoiceCallDataByState( EPEStateConnected, callIndex );
+        }
+
+    if( callData )
+        { 
+        errorCode = callData->ForwardCallToAddress( aIndex );
+        }
+       
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SecureSpecified
+// Returns the call secure specified status
+// -----------------------------------------------------------------------------
+//
+TBool CPECallHandling::SecureSpecified( const TInt aCallId ) const
+    {
+    CPESingleCall* call = iCallArrayOwner->GetCallObject( aCallId );
+    
+    __ASSERT_DEBUG( call, Panic( EPEPanicIndexOutOfRange ) );  
+    TBool secureSpecified( ETrue );
+    if( call )
+        {
+        secureSpecified = call->SecureSpecified();
+        }
+
+    TEFLOGSTRING3( 
+        KTAINT, 
+        "PE CPECallHandling::SecureSpecified securespecified:%d  aCallId:%d", 
+        secureSpecified, aCallId );
+
+    return secureSpecified;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::InitConferenceCall
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::InitConferenceCall( MCCEConferenceCall& aConference )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitConferenceCall start" );
+    if( iConferenceCall )
+        {
+        TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitConferenceCall already exist" );
+        delete iConferenceCall;
+        iConferenceCall = NULL;
+        }
+    
+    TRAPD( error, ( iConferenceCall = CPEConferenceCall::NewL( *this, aConference ) ) );
+    if( error != KErrNone )
+        {
+        SendMessage( MEngineMonitor::EPEMessageConferenceErrorCurrentCallsToConference );
+        RPointerArray<MCCECall> callArray; 
+        TInt err = aConference.GetCallArray( callArray );
+        for( TInt index = 0 ; index < callArray.Count() ; index++ )
+            {
+            TRAP_IGNORE( aConference.RemoveCallL( *callArray[index] ) );
+            }
+        aConference.Release();
+        callArray.Close();
+        TEFLOGSTRING( KTAERROR, "CALL CPECallHandling::InitConferenceCall FAIL" );
+        }
+    else
+        {
+        iConferenceCall->SetCallId( KPEConferenceCallID );
+                
+        RPointerArray<MCCECall> callArray;
+        TInt err = aConference.GetCallArray( callArray );
+        
+        if( err == KErrNone && callArray.Count() >= 2 )
+            {
+            InitialiseConferenceCallInfo( *callArray[0], *callArray[1] );
+            iConferenceCall->CallStateChanged( MCCEConferenceCallObserver::ECCEConferenceActive );
+            }
+        callArray.Close();
+        }    
+    
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::InitConferenceCall end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::CallOwner
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPECallOwner& CPECallHandling::CallOwner() const
+    {
+    return *iCallArrayOwner;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::InitialiseConferenceCallInfo
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::InitialiseConferenceCallInfo( 
+    MCCECall& aCall1, 
+    MCCECall& aCall2 )
+    {
+    TTimeIntervalSeconds call1Duration, call2Duration;
+    call1Duration = aCall1.CallDuration();
+    call2Duration = aCall2.CallDuration();
+    
+    // Set conference call duration to match the longest running call.
+    // If this is not done, zero call duration is shown in case the
+    // conference call fails or user rejects it instantly
+    // --- See CPEGsmMessageHandler::HandleConferenceIdleState how
+    // the duration is handled in these scenarios.
+    if ( call1Duration > call2Duration )
+       {
+       iModel.DataStore()->SetCallDuration( call1Duration.Int(), KPEConferenceCallID );
+       }
+    else
+       {
+       iModel.DataStore()->SetCallDuration( call2Duration.Int(), KPEConferenceCallID );
+       }
+       
+    if ( aCall1.Parameters().CallType()  
+        == CCPCall::ECallTypeCSVoice )
+       {
+       iModel.DataStore()->SetCallType( EPECallTypeCSVoice, KPEConferenceCallID );
+       }
+    else if ( aCall1.Parameters().CallType()  
+        == CCPCall::ECallTypePS )
+       {
+       iModel.DataStore()->SetCallType( EPECallTypeVoIP, KPEConferenceCallID );
+       }
+    
+    __ASSERT_DEBUG( aCall1.ServiceId() == aCall2.ServiceId(), 
+        Panic( EPEPanicInvalidParameter ) );
+    iModel.DataStore()->SetServiceId( KPEConferenceCallID, aCall1.ServiceId() );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPECallHandling::HandleAutoResume
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::HandleAutoResume()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HandleAutoResume" );
+    if ( iConferenceCall && ( iConferenceCall->GetCallState() == EPEStateHeldConference ) )
+        {
+        // Check that no conference + single case
+        CPESingleCall* callData = iCallArrayOwner->CallPointerByState( EPEStateConnected );
+        if( !callData && iModel.DataStore()->ResumeHeldCall( KPEConferenceCallID ))
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HandleAutoResume conference" );
+            iConferenceCall->Swap();
+            }
+        }
+    else
+        {
+        CPESingleCall* callData = iCallArrayOwner->CallPointerByState( EPEStateHeld );
+        // Check that no actice and held call, if waiting call gets idle
+        CPESingleCall* connectedCallData = iCallArrayOwner->CallPointerByState( EPEStateConnected );
+        if( callData && ( iModel.DataStore()->ResumeHeldCall( callData->GetCallId() ) )
+                    && !connectedCallData )
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPECallHandling::HandleAutoResume single" );
+            callData->Resume();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::ReleaseCallObject
+// -----------------------------------------------------------------------------
+//
+TInt CPECallHandling::ReleaseCallObject( const TInt aCallId  )
+    {
+    TInt error(KErrNone);
+    TEFLOGSTRING2( KTAINT, 
+            "CALL CPECallHandling::ReleaseCallObject ReleaseCallObject %d", aCallId );
+    error = iCallArrayOwner->DeleteCallObject( aCallId );
+    // Reset datastore to prevent invalid usage in next call
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::ReleaseCallObject, Reset CallInfo" );
+    iModel.DataStore()->ResetCallInfo( aCallId );
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallHandling::SetCallOrigin
+// -----------------------------------------------------------------------------
+//
+void  CPECallHandling::SetCallOrigin( const TInt aCallId, const MCCECall& aCall ) const
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::SetCallOrigin" );
+    
+    //ToDo: casting not needed when CCE API is fixed.
+    const CCCPCallParameters& parameters = aCall.Parameters();
+    CCPCall::TCallType callType = parameters.CallType();
+    if ( callType == CCPCall::ECallTypeCSVoice || callType == CCPCall::ECallTypeVideo )
+        {
+        const CCCECallParameters& params = static_cast<const CCCECallParameters&>( parameters );
+                                                    
+        if ( params.Origin() == CCCECallParameters::ECCECallOriginSAT )
+            {
+            iModel.DataStore()->SetCallOrigin( EPECallOriginSAT, aCallId );
+            iModel.DataStore()->SetRemoteName( params.AlphaId(), aCallId );
+            iModel.DataStore()->SetRemotePhoneNumber( KNullDesC(), aCallId );
+            }                 
+        }                
+    }
+
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpecceobserver.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observes CCE
+*
+*/
+
+
+#include "cpecceobserver.h"
+
+#include <mccecall.h>
+#include <pepanic.pan>
+#include <mpephonemodelinternal.h>
+#include <mpedatastore.h>
+#include "mpecallinitialiser.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Static construcotr
+// ---------------------------------------------------------------------------
+//
+CPECCEObserver* CPECCEObserver::NewL( 
+    MPECallInitialiser& aCallInitialiser,
+    MPEPhoneModelInternal& aPhoneModel )
+    {
+    CPECCEObserver* self = 
+        CPECCEObserver::NewLC( aCallInitialiser, aPhoneModel );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPECCEObserver* CPECCEObserver::NewLC( 
+    MPECallInitialiser& aCallInitialiser,
+    MPEPhoneModelInternal& aPhoneModel )
+    {
+    CPECCEObserver* self = 
+        new( ELeave ) CPECCEObserver( aCallInitialiser, aPhoneModel  );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPECCEObserver::~CPECCEObserver()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MCCEObserver
+// ---------------------------------------------------------------------------
+//
+void CPECCEObserver::IncomingCall( MCCECall& aCall )
+    {
+    NotifyCallInitialiser( aCall );
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MCCEObserver
+// ---------------------------------------------------------------------------
+//
+void CPECCEObserver::MOCallCreated( MCCECall& aCall )
+    {
+    NotifyCallInitialiser( aCall );
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MCCEObserver
+// ---------------------------------------------------------------------------
+//
+void CPECCEObserver::ConferenceCallCreated( MCCEConferenceCall& aConferenceCall )
+    {
+    iCallInitialiser.InitConferenceCall( aConferenceCall );
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MCCEObserver
+// ---------------------------------------------------------------------------
+//
+void CPECCEObserver::DataPortName( TName& aPortName )
+    {
+    iPhoneModel.DataStore()->SetDataPortName( aPortName );
+    iPhoneModel.SendMessage( MEngineMonitor::EPEMessageDataPortLoaned );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPECCEObserver::CPECCEObserver( 
+    MPECallInitialiser& aCallInitialiser,
+    MPEPhoneModelInternal& aPhoneModel ) : 
+iCallInitialiser( aCallInitialiser ),
+iPhoneModel( aPhoneModel )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies the call initialiser to take start using the incoming/external 
+// call
+// ---------------------------------------------------------------------------
+//
+void CPECCEObserver::NotifyCallInitialiser( MCCECall& aCall )
+    {
+    const CCPCall::TCallType callType = 
+        aCall.Parameters().CallType();
+    
+    switch( callType )
+        {
+        case CCPCall::ECallTypeVideo:
+            iCallInitialiser.InitVideoCall( aCall );
+            break;
+        
+        case CCPCall::ECallTypeCSVoice:
+        case CCPCall::ECallTypePS:
+            iCallInitialiser.InitVoiceCall( aCall );
+            break;
+            
+        default:
+            Panic( EPEPanicInvalidMode );
+        }
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpeconferencecall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,426 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPEConferenceCall  class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeconferencecall.h"
+#include "mpemessagesender.h"
+#include <pevirtualengine.h>
+#include <talogger.h>
+#include <mccpconferencecallobserver.h>
+#include <pepanic.pan>
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::CPEConferenceCall
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEConferenceCall::CPEConferenceCall( 
+        MPEMessageSender& aOwner,
+        MCCEConferenceCall& aCall
+        ) : CPECall( aOwner ), iConferenceCall( &aCall )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPEConferenceCall::CPEConferenceCall start." );
+    SetCallState( EPEStateConferenceIdle );
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPEConferenceCall::CPEConferenceCall complete." );
+    }
+    
+    // Destructor
+CPEConferenceCall::~CPEConferenceCall
+        (
+        // None.
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPEConferenceCall::~CPEConferenceCall: Start." );
+    iConferenceCall->Release();
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPEConferenceCall::~CPEConferenceCall: Complete." );
+    } 
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::ConstructL(
+        CCCE& aConvergedCallEngine )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::ConstructL start." );
+    iConferenceCall = &( aConvergedCallEngine.ConferenceCallL( *this ) );
+    iConferenceCall->SetObserver( *this );
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::ConstructL complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEConferenceCall* CPEConferenceCall::NewL( 
+        MPEMessageSender& aOwner,
+        CCCE& aConvergedCallEngine
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::NewL start." );
+    MCCEConferenceCall* temp = NULL;
+    
+    CPEConferenceCall* self = new ( ELeave ) CPEConferenceCall( aOwner, *temp );
+    CleanupStack::PushL( self );
+    self->ConstructL( aConvergedCallEngine );
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::NewL complete." );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEConferenceCall* CPEConferenceCall::NewL( 
+        MPEMessageSender& aOwner,
+        MCCEConferenceCall& aCall
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::NewL start." );
+    
+    CPEConferenceCall* self = new ( ELeave ) CPEConferenceCall( aOwner, aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::NewL complete." );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::ConstructL start." );
+    iConferenceCall->SetObserver( *this );
+    TEFLOGSTRING( KTAOBJECT, "cpecallgsm: CPEGsmConferenceCall::ConstructL complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::AddCall
+// Adds new member to Conference Call
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::AddCallL
+        ( 
+        MCCECall& aCall
+        )
+    {
+    if( GetCallState() == EPEStateConferenceIdle )
+        {
+        SetCallState( EPEStateCreatingConference );
+        }
+    iConferenceCall->AddCallL( aCall );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::CallEventOccurred
+// A conference call event has occurred.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEConferenceCall::CallEventOccurred( 
+        const MCCEConferenceCallObserver::TCCEConferenceCallEvent aEvent,
+        MCCECall* aReferredCall  )
+    {
+    TEFLOGSTRING2( KTAREQEND, "CALL CPEConferenceCall::ConferenceCallEventOccurred, event: %d", aEvent );
+    
+    if ( aReferredCall )
+        {
+        //resolve the referred call first
+        RMobileCall::TMobileCallInfoV1 callInfo;
+        RMobileCall::TMobileCallInfoV1Pckg callInfoPckg( callInfo );
+        TEFLOGSTRING( KTAREQOUT, "CALL CPEConferenceCall::ConferenceCallEventOccurred: Request MCCECall::GetMobileCallInfo()" );
+        aReferredCall->GetMobileCallInfo( callInfoPckg );
+        callInfo = callInfoPckg();
+        iCallName = callInfo.iCallName;
+        
+        // now that the call name has been stored, owner may fetch it
+        // upon receiving a conference call related indication
+        }
+    else
+        {
+        iCallName = KNullDesC;
+        }
+
+    switch ( aEvent )
+        {
+        case MCCEConferenceCallObserver::ECCEConferenceCallAdded:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallEventOccurred, Call added to conference" );
+            SendMessage( MEngineMonitor::EPEMessageAddedConferenceMember, iCallName );
+            break;
+            }
+        case MCCEConferenceCallObserver::ECCEConferenceCallRemoved:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallEventOccurred, Call removed from conference" );
+            SendMessage( MEngineMonitor::EPEMessageDroppedConferenceMember, iCallName );
+            break;
+            }
+        case MCCEConferenceCallObserver::ECCEConferenceBuilt:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallEventOccurred, Conference call was built" );
+            break;
+            }
+        case MCCEConferenceCallObserver::ECCEConferenceTerminated:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallEventOccurred, Conference call was terminated" );
+            break;
+            }
+        case MCCEConferenceCallObserver::ECCEConferenceSwapped:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallEventOccurred, Conference call was swapped" );
+            break;
+            }
+        case MCCEConferenceCallObserver::ECCEConferenceSplit:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallEventOccurred, Conference call was split" );
+            SendMessage( MEngineMonitor::EPEMessageWentOneToOne, iCallName );
+            break;
+            }
+        default:
+            {
+            TEFLOGSTRING( KTAERROR, "CALL CPEConferenceCall::CallEventOccurred, UNKNOWN CONFERENCE EVENT!" );       
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::CallStateChanged
+// A conference call state has changed.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEConferenceCall::CallStateChanged( 
+         const MCCEConferenceCallObserver::TCCEConferenceCallState aState )
+    {
+    switch ( aState )
+        {
+        case MCCEConferenceCallObserver::ECCEConferenceIdle:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallStateChanged, ECCEConferenceIdle" );
+            SetCallState( EPEStateConferenceIdle );
+            iLastConferenceDuration = iDuration;
+            SendMessage( MEngineMonitor::EPEMessageConferenceIdle );
+            break;
+            }
+        case MCCEConferenceCallObserver::ECCEConferenceActive:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallStateChanged, ECCEConferenceActive" );
+            SetCallState( EPEStateConnectedConference );
+            SendMessage( MEngineMonitor::EPEMessageConnectedConference );
+            break;
+            }
+        case MCCEConferenceCallObserver::ECCEConferenceHold:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEConferenceCall::CallStateChanged, ECCEConferenceHold" );
+            SetCallState( EPEStateHeldConference );
+            SendMessage( MEngineMonitor::EPEMessageHeldConference );
+            break;
+            }
+        default:
+            {
+            TEFLOGSTRING( KTAERROR, "CALL CPEConferenceCall::CallStateChanged, UNKNOWN CONFERENCE STATE!" );       
+            break;
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::CallCapsChanged
+// Conference call capabilities have changed.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEConferenceCall::CallCapsChanged( 
+        const MCCEConferenceCallObserver::TCCEConferenceCallCaps aCaps )
+    {
+    TEFLOGSTRING2( KTAREQEND, "CALL CPEConferenceCall::CallCapsChanged, caps: %d", aCaps );
+    iCaps = aCaps;
+    SendMessage( MEngineMonitor::EPEMessageConferenceCapsChange );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::ErrorOccurred
+// 
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEConferenceCall::ErrorOccurred( TCCPConferenceCallError aError )
+    {
+    TEFLOGSTRING2( KTAERROR, "CALL CPEConferenceCall::ErrorOccurred, error: %d", aError );
+    
+    iOwner.SendErrorMessage( KPEConferenceCallID, aError );
+
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::SendMessage
+// Forwards message to CPEConferenceCall object
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::SendMessage( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage )
+    {
+    iOwner.SendMessage( aMessage, KPEConferenceCallID );
+    }
+
+    
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::SendMessage
+// Forwards message to CPEConferenceCall object
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::SendMessage( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        const TName& aName )
+    {
+    iOwner.SendMessage( aMessage, aName );
+    }
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::GetConferenceDuration
+// Returns Conference duration.
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::GetCallDuration
+        (
+        TTimeIntervalSeconds& aDuration
+        )
+    {    
+    TPEState callState = GetCallState();
+    if ( callState != EPEStateConferenceIdle )
+        {
+        aDuration = iDuration;
+        }
+    else
+        {
+        aDuration = iLastConferenceDuration;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::EnumerateCalls
+// Returns number of conference members
+// -----------------------------------------------------------------------------
+//
+TInt CPEConferenceCall::EnumerateCalls()
+    {
+    TEFLOGSTRING( KTAREQOUT, "cpecall: CPEConferenceCall::EnumerateCalls: MCCEConferenceCall::EnumerateCalls()" );    
+    return iConferenceCall->EnumerateCalls();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::GetCallCaps
+// Returns conference call capabilities
+// -----------------------------------------------------------------------------
+//
+MCCEConferenceCallObserver::TCCEConferenceCallCaps 
+    CPEConferenceCall::CallCaps()
+    {
+    return iCaps;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::HangUp
+// Ends conference call.
+// -----------------------------------------------------------------------------
+//
+TInt CPEConferenceCall::HangUp()
+    {
+    return iConferenceCall->HangUp();
+    }
+        
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::Swap
+// Swaps conference between active and held states
+// -----------------------------------------------------------------------------
+//
+TInt CPEConferenceCall::Swap()
+    {
+    return iConferenceCall->Swap();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::GetConferenceMemberName
+// Returns TName information of added or removed member
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::GetConferenceMemberName
+        ( 
+        TName& aCallName
+        ) const
+    {
+    aCallName = iCallName;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::GoOneToOneL
+// Go one to one
+// -----------------------------------------------------------------------------
+//
+void CPEConferenceCall::GoOneToOneL( MCCECall& aCall )
+    {
+    iConferenceCall->GoOneToOneL( aCall );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEConferenceCall::CallDurationChanged
+// -----------------------------------------------------------------------------
+//    
+void CPEConferenceCall::CallDurationChanged( const TTimeIntervalSeconds aDuration )
+    {
+    iDuration = aDuration;
+    iOwner.SendMessage( MEngineMonitor::EPEMessageChangedCallDuration, iCallId );
+    }
+
+// End Of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpedtmfhandling.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,278 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPEDtmfHandling class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpedtmfhandling.h"
+#include "cpecallhandling.h"
+
+#include <pevirtualengine.h>
+#include <talogger.h>
+#include <featmgr.h>
+#include <mccedtmfinterface.h>
+#include <ccce.h>
+
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPEDtmfHandling* CPEDtmfHandling::NewL( 
+        CPECallHandling& aOwner,
+        MCCEDtmfInterface& aDtmfInterface )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::NewL start." );
+    CPEDtmfHandling* self = new ( ELeave ) CPEDtmfHandling( aOwner, 
+                                                            aDtmfInterface );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::NewL complete." );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::~CPEDtmfHandling
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPEDtmfHandling::~CPEDtmfHandling()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::~CPEDtmfHandling start." );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::~CPEDtmfHandling complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::CPEDtmfHandling
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+
+EXPORT_C CPEDtmfHandling::CPEDtmfHandling( 
+        CPECallHandling& aOwner,
+        MCCEDtmfInterface& aDtmfInterface
+        ) : iOwner( aOwner ),
+            iDtmfInterface( aDtmfInterface )  
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::CPEDtmfHandling start." );
+    iDtmfInterface.SetObserver( *this );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::CPEDtmfHandling complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEDtmfHandling::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::ConstructL start." );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPEDtmfHandling::ConstructL complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::CancelDtmfString
+// Method cancels the ongoing DTMF tones string sending.
+// -----------------------------------------------------------------------------
+//
+void CPEDtmfHandling::CancelDtmfString()
+    {
+    TEFLOGSTRING( KTAMESOUT, "CALL CPEDtmfHandling::CancelDtmfString" );
+    iDtmfInterface.CancelDtmfStringSending();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::ContinueDtmfSending
+// Continue the sending of a DTMF string when it was stopped by the use of 
+// 'w' char in the string.
+// -----------------------------------------------------------------------------
+//
+void CPEDtmfHandling::ContinueDtmfSending()
+    {
+    TEFLOGSTRING( KTAMESOUT, 
+        "CALL CPEDtmfHandling::ContinueDtmfSending, EPEMessageContinuingDTMFSending" );
+    iOwner.SendMessage( MEngineMonitor::EPEMessageContinuingDTMFSending );
+    TEFLOGSTRING( KTAREQOUT, 
+        "CALL CPEDtmfHandling::ContinueDtmfSending > MCCEDtmfInterface::ContinueStringSending( ETrue )" );
+    TInt errorCode = iDtmfInterface.ContinueStringSending( ETrue );
+    TEFLOGSTRING2( KTAREQEND, 
+        "CALL CPEDtmfHandling::ContinueDtmfSending > MCCEDtmfInterface::ContinueStringSending( ETrue ); errorCode = %d", errorCode );          
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::SendDtmfString
+// Starts sending of DTMF tones string.
+// -----------------------------------------------------------------------------
+//
+TInt CPEDtmfHandling::SendDtmfString( 
+        const TDesC& aTones )
+    {
+    TEFLOGSTRING( KTAREQOUT, 
+        "CALL CPEDtmfHandling::SendDtmfString > MCCEDtmfInterface::SendDtmfToneString()" );
+    TInt errorCode = iDtmfInterface.SendDtmfToneString( aTones );
+    TEFLOGSTRING2( KTAREQEND, 
+        "CALL   CPEDtmfHandling::SendDtmfString > MCCEDtmfInterface::SendDtmfToneString(); errorCode = %d"
+        , errorCode );
+    if( errorCode == KErrNone )
+        {
+        iOwner.SendMessage( MEngineMonitor::EPEMessageSendingDTMF );
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::StartDtmfTone
+// Starts the transmission of a single DTMF tone across a connected and active
+// voice call. 
+// -----------------------------------------------------------------------------
+//
+TInt CPEDtmfHandling::StartDtmfTone( 
+        const TChar& aTone ) const
+    {
+    TEFLOGSTRING( KTAREQOUT, 
+        "CALL CPEDtmfHandling::StartDtmfTone > MCCEDtmfInterface::StartDtmfTone()" );
+    TInt errorCode = iDtmfInterface.StartDtmfTone( aTone );
+    TEFLOGSTRING2( KTAREQEND, 
+        "CALL CPEDtmfHandling::StartDtmfTone > MCCEDtmfInterface::StartDtmfTone(); errorCode = %d", errorCode );
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::StopDtmfSending
+// Cancels dtmf sending after 'w'-characte
+// -----------------------------------------------------------------------------
+//
+void CPEDtmfHandling::StopDtmfSending()
+    {
+    TEFLOGSTRING( KTAREQEND, 
+        "CALL CPEDtmfHandling::StopDtmfSending > MCCEDtmfInterface::CancelDtmfStringSending()" );
+    iDtmfInterface.CancelDtmfStringSending();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::StopDtmfTone
+// Stops the transmission of a single DTMF tone, which had previously been
+// started by use of the StartDTMFTone function member, across a connected 
+// and active voice call.
+// -----------------------------------------------------------------------------
+//
+TInt CPEDtmfHandling::StopDtmfTone() const
+    {
+    TEFLOGSTRING( KTAREQOUT, 
+        "CALL CPEDtmfHandling::StopDtmfTone > MCCEDtmfInterface::StopDtmfTone()" );
+    TInt errorCode = iDtmfInterface.StopDtmfTone();
+    TEFLOGSTRING2( KTAREQEND,
+        "CALL PEDtmfHandling::StopDtmfTone > MCCEDtmfInterface::StopDtmfTone(), errorCode = %d"
+        , errorCode );
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDtmfHandling::HandleDtmfEvent
+// From MCCEDtmfObserver.
+// All the occurred DTMF events are notified through this interface.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEDtmfHandling::HandleDTMFEvent( 
+    const MCCEDtmfObserver::TCCEDtmfEvent aEvent, 
+    const TInt aError, 
+    const TChar /*aTone*/ )
+    {
+    TEFLOGSTRING3( KTAMESIN, 
+        "CALL CPEDtmfHandling::HandleDtmfEvent: aEvent %d, aError %d", 
+        aEvent, 
+        aError );
+        
+    switch( aEvent )
+        {
+        case ECCEDtmfUnknown:
+            iOwner.SendErrorMessage( KPECallIdNotUsed, KErrUnknown );
+            break;
+            
+        case ECCEDtmfManualStart:
+        case ECCEDtmfSequenceStart:
+            // Handled in audio handling
+            break;
+            
+        case ECCEDtmfManualStop:
+        case ECCEDtmfSequenceStop:
+            // Handled in audio handling
+            break;
+            
+        case ECCEDtmfManualAbort:
+        case ECCEDtmfSequenceAbort:
+            iOwner.SendMessage( MEngineMonitor::EPEMessageDTMFSendingAborted );
+            break;
+            
+        case ECCEDtmfStopInDtmfString:
+            iOwner.SendMessage( MEngineMonitor::EPEMessageStoppedDTMF );
+            break;
+            
+        case ECCEDtmfStringSendingCompleted:
+            iOwner.SendMessage( MEngineMonitor::EPEMessageSentDTMF );
+            break;
+
+        default:
+            TEFLOGSTRING( KTAERROR, 
+                "CALL CPEDtmfHandling::HandleDtmfEvent: NOT HANDLED ENUM VALUE" );
+            break;
+        }
+  
+    if( aError != KErrNone && 
+        !( aEvent == ECCEDtmfStringSendingCompleted && aError == KErrEtelCallNotActive ) )
+        {
+        iOwner.SendErrorMessage( KPECallIdNotUsed, aError );    
+        }
+    }
+    
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+// None.
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpegprstermination.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GPRS termination active object implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpegprstermination.h"
+#include <talogger.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::CPEGprsTermination
+// -----------------------------------------------------------------------------
+//
+CPEGprsTermination::CPEGprsTermination()
+    : CActive( EPriorityStandard )
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPEGprsTermination::CPEGprsTermination" );
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::CPEGprsTermination
+// -----------------------------------------------------------------------------
+//
+CPEGprsTermination::~CPEGprsTermination()
+    {
+    TEFLOGSTRING( KTAOBJECT, "cpecall: CPEGprsTermination::~CPEGprsTermination" );
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::StartL
+// -----------------------------------------------------------------------------
+//
+void CPEGprsTermination::StartL()
+    {
+    TEFLOGSTRING( KTAINT, "cpecall: CPEGprsTermination::StartL" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::IsTerminating
+// -----------------------------------------------------------------------------
+//
+TBool CPEGprsTermination::IsTerminating() const
+    {
+    TEFLOGSTRING( KTAINT, "cpecall: CPEGprsTermination::IsTerminating" );
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::RunL
+// -----------------------------------------------------------------------------
+//
+void CPEGprsTermination::RunL()
+    {
+    TEFLOGSTRING2( KTAREQEND, "cpecall: CPEGprsTermination::RunL status: %d", iStatus.Int() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGprsTermination::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CPEGprsTermination::DoCancel()
+    {
+    TEFLOGSTRING( KTAREQEND, "cpecall: CPEGprsTermination::DoCancel" );
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpesinglecall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,346 @@
+/*
+* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPESingleCall class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include <pepanic.pan>
+#include <talogger.h>
+
+#include "cpesinglecall.h"
+#include "mpecallowner.h"
+#include "cpevideocallhandling.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// Destructor
+//
+CPESingleCall::~CPESingleCall()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall::~CPESingleCall: Start." );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall::~CPESingleCall: Complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::CPESingleCall
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPESingleCall::CPESingleCall( 
+        MPEMessageSender& aOwner
+        ) : CPESingleCallObserver( aOwner ),
+            iMissedCall( EFalse)
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall::CPESingleCall start." );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall::CPESingleCall complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmVoiceCall::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPESingleCall::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall:::ConstructL start." );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall::ConstructL complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmVoiceCall::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPESingleCall::NewL( 
+        MPEMessageSender& aOwner )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall::NewL start." );
+    CPESingleCall* self = new ( ELeave ) CPESingleCall( aOwner );
+    CleanupStack::PushL(self);
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCall::NewL complete." );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::SendMessage
+// Method reroutes messages from other modules to the CPEPhoneData-object
+// Note that it does not use base class SendMessage.
+// -----------------------------------------------------------------------------
+//
+void CPESingleCall::SendMessage( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage )
+    {
+    iErrorCode = KErrNone;
+    if( aMessage == MEngineMonitor::EPEMessageIdle )
+        {
+        // Get the call duration before the call object is closed.
+        iDuration = Call().CallDuration();
+        TEFLOGSTRING2( 
+            KTAREQEND, 
+            "CALL CPESingleCall::SendMessage: MCCECall::GetCallDuration() called, Duration: %d", 
+            iDuration.Int() );
+        }
+   
+    if ( aMessage != MEngineMonitor::EPEMessageUnknown )
+        {
+        CPECall::SendMessage( aMessage );
+        }
+        
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::Answer
+// Method Answers the incoming call.
+// Method creates iCallInfo parameter package and
+// makes answer request to CPECallCommand-parameter.
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::Answer()
+    {
+    SetMissedCall( EFalse );
+    return Call().Answer();    
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::Dial
+// creates dial request to the CPECallCommand object.
+// Method opens the line for the new call.
+// If error occurs the method returns error value.
+// Method makes call parameter package and
+// starts monitoring call statuses and call events and
+// makes a dial request to the CPECallCommand object.
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::Dial( 
+        const RMobileCall::TTelNumberC& aNumber )
+    {
+    TInt errorCode( KErrNone );
+    iDialledNumber = aNumber;
+    
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::Dial");
+    errorCode = Call().Dial(KNullDesC8);
+    
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::DialEmergency
+// creates emergency dial request to the CPECallCommand object
+// -----------------------------------------------------------------------------
+//
+void CPESingleCall::DialEmergency(
+        const TPEPhoneNumber& aEmergencyNumber )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::DialEmergency" );
+    iCall->DialEmergencyCall( aEmergencyNumber );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::DisableFDNCheck
+// Disables FDN checking for SIM ATK originated calls
+// -----------------------------------------------------------------------------
+//
+void CPESingleCall::DisableFDNCheck()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::DisableFDNCheck UNSUPPORTED" );
+    
+    // NOTE! Currently disabled due to incomplete TSY implementation
+    // Remove comments after this task is completed
+    
+    //iCall->NoFDNCheck();
+    }
+        
+// -----------------------------------------------------------------------------
+// CPESingleCall::Hold
+// creates hold request to the CPECallCommand object
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::Hold()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::Hold" );
+    return iCall->Hold();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::Resume
+// Method resumes held call
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::Resume()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::Resume" );
+    return iCall->Resume();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::Swap
+// Method swaps active and held call
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::Swap()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::Swap" );
+    return iCall->Swap();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::Transfer
+// Method Transfers the active and the held call.
+// -----------------------------------------------------------------------------
+//
+void CPESingleCall::Transfer( const TDesC& aTransferTarget )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::Transfer" );
+    iCall->AttendedTransfer( aTransferTarget );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::Tone
+// Returns the inband tone needed to play in state transition
+// -----------------------------------------------------------------------------
+//
+TCCPTone CPESingleCall::Tone()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::Tone" );
+    return iCall->Tone();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::HangUp
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::HangUp()
+    {
+    TEFLOGSTRING( KTAREQOUT, "CALL CPESingleCall::HangUp" );
+    SetMissedCall( EFalse );
+    return iCall->HangUp();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::GetCallInfo
+// Method returns call information.
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::GetCallInfo(
+        RMobileCall::TMobileCallInfoV3& aCallInfo )
+    {
+    TEFLOGSTRING( KTAREQOUT, 
+            "CALL CPESingleCall::GetCallInfo > RMobileCall::GetMobileCallInfo()" );
+    RMobileCall::TMobileCallInfoV3Pckg callInfoPckg( iCallInfo );
+    Call().GetMobileCallInfo( callInfoPckg );
+
+    iCallInfo = callInfoPckg();
+   
+    aCallInfo = iCallInfo;
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::SetMissedCall
+// Set the missed call indicator = ETrue, if the current call
+// was hanged up on state ringing by remote party.
+// -----------------------------------------------------------------------------
+//
+void CPESingleCall::SetMissedCall( TBool aMissed )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPESingleCall::SetMissedCall: Call Missed. %d", aMissed );
+    iMissedCall = aMissed; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::GetMissedCall
+// Returns the missed data call indicator.
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::GetMissedCall(
+        TBool& aMissedCall) const
+    {
+    aMissedCall = iMissedCall;
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::IsSecureCall
+// -----------------------------------------------------------------------------
+//
+TBool CPESingleCall::IsSecureCall() const
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::IsSecureCall" );
+    return iCall->IsSecured();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::SecureSpecified
+// -----------------------------------------------------------------------------
+//
+TBool CPESingleCall::SecureSpecified() const
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::SecureSpecified" );
+    return iCall->SecureSpecified(); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::AcceptUnattendedTransfer
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::AcceptUnattendedTransfer()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::AcceptUnattendedTransfer" );
+    
+    return iCall->AcceptTransfer( ETrue );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::RejectUnattendedTransfer
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::RejectUnattendedTransfer()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::RejectUnattendedTransfer" );
+    
+    return iCall->AcceptTransfer( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::UnattendedTransfer
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::UnattendedTransfer( const TDesC& aTransferTo ) const
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::UnattendedTransfer" );
+
+    return iCall->UnattendedTransfer( aTransferTo );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCall::ForwardCallToAddress
+// -----------------------------------------------------------------------------
+//
+TInt CPESingleCall::ForwardCallToAddress( TInt aIndex )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESingleCall::ForwardToAddress" );
+    TRAPD( err, iCall->ForwardToAddressL( aIndex ) );
+    return err;
+    }
+    
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpesinglecallobserver.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,445 @@
+/*
+* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPESingleCallObserver class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include <talogger.h>
+#include <pepanic.pan>
+
+#include "cpesinglecallobserver.h"
+#include "mpemessagesender.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::CPESingleCallObserver
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPESingleCallObserver::CPESingleCallObserver( MPEMessageSender& aOwner )
+    : CPECall( aOwner ),
+    iDialledNumber( KNullDesC )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCallObserver::CPESingleCallObserver start." );
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCallObserver::CPESingleCallObserver complete." );
+    }
+
+// Destructor
+CPESingleCallObserver::~CPESingleCallObserver()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCallObserver::~CPESingleCallObserver: Start." );
+    if( iCall )
+        {
+        TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCallObserver::~CPESingleCallObserver: Release" );
+        iCall->Release();
+        }
+    TEFLOGSTRING( KTAOBJECT, "CALL CPESingleCallObserver::~CPESingleCallObserver: Complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::ErrorOccurred
+// Asynchronous call errors are notified using this interface. 
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESingleCallObserver::ErrorOccurred( const TCCPError aError )
+    {
+    TInt error = static_cast < TInt > ( aError );
+    TEFLOGSTRING2( KTAERROR, "CALL CPESINGLECALLOBSERVER::ERROROCCURRED, ! ERROR CODE: %d !", error );
+    // Currently completes also with KErrNone
+    // Need to prevent forwarding in no-error situation
+    if( ECCPErrorBusy == aError )
+        {
+        iErrorCode = aError;
+        CPECall::SendMessage( MEngineMonitor::EPEMessageRemoteBusy );
+        }
+    else if( ECCPErrorRejected == aError )
+        {
+        // Don't send error message.
+        SetMissedCall( EFalse );
+        }
+    else if( aError != KErrNone )
+        {
+        CPECall::SendErrorMessage( error );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::CallStateChanged
+// Notifies observer the change in call state. The observer needs to verify
+// event correctness.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESingleCallObserver::CallStateChanged( const CCPCall::TCallState aState )
+    {
+    TEFLOGSTRING2( KTAREQIN, "CALL CPESingleCallObserver::CallStateChanged, Call state: %d", aState );
+
+    switch ( aState )
+        {
+        case CCPCall::EStateIdle:
+            {
+            SetCallState( EPEStateIdle );
+            SendMessage( MEngineMonitor::EPEMessageIdle );
+            break;
+            }
+        case CCPCall::EStateRinging:
+            {
+            SetCallState( EPEStateRinging );
+            SendMessage( MEngineMonitor::EPEMessageIncoming );
+            SetMissedCall( ETrue );
+            break;
+            }
+        case CCPCall::EStateConnecting:
+            {
+            SetCallState( EPEStateConnecting );
+            SendMessage( MEngineMonitor::EPEMessageConnecting );
+            break;
+            }
+        case CCPCall::EStateConnected:
+            {
+            SetCallState( EPEStateConnected );
+            SendMessage( MEngineMonitor::EPEMessageConnected );
+            SetMissedCall( EFalse );
+            break;
+            }
+        case CCPCall::EStateDisconnecting:
+            {
+            SetCallState( EPEStateDisconnecting );
+            SendMessage( MEngineMonitor::EPEMessageDisconnecting );
+            break;
+            }
+        case CCPCall::EStateHold:
+            {
+            SetCallState( EPEStateHeld );
+            SendMessage( MEngineMonitor::EPEMessageHeld );
+            break;  
+            }
+        case CCPCall::EStateAnswering:
+            {
+            SetCallState( EPEStateAnswering );
+            SendMessage( MEngineMonitor::EPEMessageAnswering );
+            break;
+            }
+        case CCPCall::EStateDialling:
+            {
+            SetCallState( EPEStateDialing );
+            SendMessage( MEngineMonitor::EPEMessageDialing );
+            break;
+            }
+        case CCPCall::EStateQueued:
+            {
+            SetCallState( EPEStateRinging );
+            SendMessage( MEngineMonitor::EPEMessageIncoming );
+            SetMissedCall( ETrue );
+            break;
+            }
+
+        case CCPCall::EStateTransferring:
+
+            {
+            // Not supported -> Ignored
+            TEFLOGSTRING( KTAERROR, "CALL CPESingleCallObserver::CALLSTATECHANGED ! STATE IGNORED !" );
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::CallStateChangedWithInband
+// 
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESingleCallObserver::CallStateChangedWithInband( 
+        const CCPCall::TCallState aState )
+    {
+    TEFLOGSTRING2( 
+        KTAREQIN, 
+        "CALL CPESingleCallObserver::CallStateChangedWithInband, Call state: %d", 
+        aState );
+
+    switch ( aState )
+        {
+        case CCPCall::EStateConnecting:
+            {
+            SetCallState( EPEStateConnecting );
+            SendMessage( MEngineMonitor::EPEMessageConnectingWithInband );
+            break;
+            }
+        case CCPCall::EStateDisconnecting:
+            {
+            SetCallState( EPEStateDisconnecting );
+            SendMessage( MEngineMonitor::EPEMessageDisconnectingWithInband );
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+        
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::CallEventOccurred
+// An event for the call has occurred. The observer needs to verify
+// event correctness.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESingleCallObserver::CallEventOccurred( const MCCECallObserver::TCCECallEvent aEvent )
+    {
+    TEFLOGSTRING2( KTAREQIN, "CALL CPESingleCallObserver::CallEventOccurred, Call event: %d", aEvent );
+
+    switch ( aEvent )
+        {
+        case MCCECallObserver::ERemoteTerminated:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Remotely terminated" );
+            SendMessage( MEngineMonitor::EPEMessageRemoteTerminated );
+            break;
+            }
+        case MCCECallObserver::ESecureSession: // fall through
+        case MCCECallObserver::ENotSecureSession: // fall through
+        case MCCECallObserver::EVoIPEventNotSecureSessionWithSips:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Secure information changed" );
+            SendMessage( MEngineMonitor::EPEMessageCallSecureStatusChanged );
+            break;
+            }
+        case MCCECallObserver::ECCESecureNotSpecified: 
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Secure not specified" );
+            SendMessage( MEngineMonitor::EPEMessageSecureNotSpecified );
+            break;
+            }            
+        case MCCECallObserver::ELocalHold:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Locally held, IGNORED" );
+            break;
+            }
+        case MCCECallObserver::ELocalResume:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Locally resumed, IGNORED" );
+            break;
+            }
+        case MCCECallObserver::ERemoteHold:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Remotely held" );
+            SendMessage( MEngineMonitor::EPEMessageRemoteHeld );
+            break;
+            }
+        case MCCECallObserver::ERemoteResume:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Remotely resumed" );
+            SendMessage( MEngineMonitor::EPEMessageRemoteResumed );
+            break;
+            }
+        case MCCECallObserver::ERemoteConferenceCreate:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Remotely created conference" );
+            SendMessage( MEngineMonitor::EPEMessageRemoteCreatedConference );
+            break;
+            }
+        case MCCECallObserver::ELocalTransfer:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::ELocalTransfer" );
+            SendMessage( MEngineMonitor::EPEMessageTransferDone );
+            break;
+            }
+        case MCCECallObserver::ERemoteTransferring:
+        case MCCECallObserver::ERemoteTransferAlerting:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::ERemoteTransferring or ERemoteTransferAlerting" );
+            SendMessage( MEngineMonitor::EPEMessageTransferring );
+            break;
+            }
+        case MCCECallObserver::ECCENotifyRemotePartyInfoChange:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::ECCENotifyRemotePartyInfoChange" );
+            SendMessage( MEngineMonitor::EPEMessageRemotePartyInfoChanged );
+            break;
+            }
+        
+        // Indicates that network or call provider has started to play
+        // inband tone so our tone playing must be stopped.
+        case MCCECallObserver::EVoIPEventEarlyMediaStarted:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::EVoIPEventEarlyMediaStarted" );
+            iOwner.HandleInternalMessage( MPEPhoneModel::EPEMessageStopTonePlay );
+            break;
+            }
+            
+        case MCCECallObserver::ERemoteForwarding:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::EPEMessageRemoteForwarding" );
+            SendMessage( MEngineMonitor::EPEMessageRemoteForwarding );
+            break;
+            }
+        case MCCECallObserver::EVoIPEventMovedPermanently:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::EMovedPermanently" );
+            SendMessage( MEngineMonitor::EPEMessageMovedPermanently );
+            break;
+            }
+        case MCCECallObserver::EVoIPEventMultipleChoices:
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPESingleCallObserver::EMovedPermanently" );
+            SendMessage( MEngineMonitor::EPEMessageMultipleChoices );
+            break;
+            }             
+        
+        case MCCECallObserver::ELocalDeflectCall:
+        case MCCECallObserver::ERemoteBarred:
+        case MCCECallObserver::ERemoteWaiting:
+        case MCCECallObserver::ELocalBarred:
+        default:
+            {
+            TEFLOGSTRING2( KTAINT, "CALL CPESingleCallObserver::CallEventOccurred, Unspecified/protocol specific call event: %d", aEvent );
+            break;
+            }
+        }
+    } 
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::CallDurationChanged
+// Notifies observer the change in call duration.
+// -----------------------------------------------------------------------------
+//    
+EXPORT_C void CPESingleCallObserver::CallDurationChanged( const TTimeIntervalSeconds aDuration )
+    {
+    TEFLOGSTRING( KTAREQIN, "CALL CPESingleCallObserver::CallDurationChanged" );
+    iDuration = aDuration;
+    SendMessage( MEngineMonitor::EPEMessageChangedCallDuration );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::CallCapsChanged
+// Notifies observer about the changes in call control caps.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESingleCallObserver::CallCapsChanged( const MCCECallObserver::TCCECallControlCaps aCaps )
+    {
+    TEFLOGSTRING( KTAREQIN, "CALL CPESingleCallObserver::CallCapsChanged" );
+    iControlCaps = aCaps;
+    SendMessage( MEngineMonitor::EPEMessageCallControlCapsChanged );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::HandleTransfer
+// Notifies observer about transfer made by remote end
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESingleCallObserver::HandleTransfer( const TBool aAttended, 
+                                 const TDesC& aDestination )
+    {
+    TEFLOGSTRING3( KTAREQIN, "CALL CPESingleCallObserver::HandleTransfer: Remote transfer request, attended: %d, destination: %S", aAttended, &aDestination );
+    TEFLOGSTRING( KTAREQIN, "CALL CPESingleCallObserver::HandleTransfer: Currently not supported" );
+    if ( KNullDesC() != aDestination && EFalse == aAttended && 
+            aDestination.Length() <= iTransferTarget.MaxLength() )
+        {
+        iTransferTarget = aDestination;
+        SendMessage( MEngineMonitor::EPEMessageUnattendedTransferRequest );
+        }
+    else
+        {
+        iCall->AcceptTransfer( EFalse );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::GetCallDuration
+// Method returns the duration of the current call.
+// -----------------------------------------------------------------------------
+//
+void CPESingleCallObserver::GetCallDuration(
+        TTimeIntervalSeconds& aDuration )
+    {
+    TEFLOGSTRING2( 
+        KTAINT, 
+        "CALL CPESingleCallObserver::GetCallDuration, iDuration: %d", 
+        iDuration.Int() );
+    aDuration = iDuration;
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::GetCallControlCaps
+// Method returns call control caps
+// -----------------------------------------------------------------------------
+//
+void CPESingleCallObserver::GetCallControlCaps(
+        MCCECallObserver::TCCECallControlCaps& aCallControlCaps )  const
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPESingleCallObserver::GetCallControlCaps, iControlCaps: %d", iControlCaps );
+    aCallControlCaps = iControlCaps;
+    }
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::Call
+// Returns reference to MCCECall handle
+// -----------------------------------------------------------------------------
+//
+MCCECall& CPESingleCallObserver::Call()
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPESingleCallObserver::Call, iCall: %d", iCall );
+    return *iCall;
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::SetCall
+// 
+// -----------------------------------------------------------------------------
+//
+void CPESingleCallObserver::SetCall( MCCECall& aCall )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPESingleCallObserver::SetCall, aCall: %d", &aCall );
+    iCall = &aCall;
+    iCall->SetObserver( *this );
+    iControlCaps = iCall->Caps();
+    TEFLOGSTRING2( KTAINT, "CALL CPESingleCallObserver::SetCall, iControlCaps: %b", iControlCaps );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::UnattendedTransferTarget
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPESingleCallObserver::UnattendedTransferTarget() const
+    {
+    TEFLOGSTRING2( KTAREQIN, 
+        "CALL CPESingleCallObserver::UnattendedTransferTarget: %S",
+        &iTransferTarget );
+    
+    return iTransferTarget;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPESingleCallObserver::ForwardAddressChoices
+// -----------------------------------------------------------------------------
+//
+const CDesC8Array* CPESingleCallObserver::ForwardAddressChoices() const
+    {
+    const CDesC8Array* array = NULL;
+    TRAP_IGNORE( array = &iCall->GetForwardAddressChoicesL() );
+
+    return array;
+    }
+
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpesupplementaryservicesmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,227 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPESupplementaryServicesMonitor class 
+*                member functions.
+*
+*/
+
+
+//  ==================== INCLUDE FILES  ====================
+#include "cpesupplementaryservicesmonitor.h"
+#include "mpemessagesender.h"
+#include <talogger.h>
+#include <mpedatastore.h>
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPESupplementaryServicesMonitor::CPESupplementaryServicesMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPESupplementaryServicesMonitor::CPESupplementaryServicesMonitor( 
+        MPEMessageSender& aOwner,
+        MPEDataStore& aDataStore
+        ) : iOwner( aOwner ),
+            iDataStore( aDataStore )
+    {
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL: CPESupplementaryServcesMonitor::CPESupplementaryServicesMonitor: complete" );     
+    }
+
+
+// Destructor
+CPESupplementaryServicesMonitor::~CPESupplementaryServicesMonitor()
+    {
+    TEFLOGSTRING( KTAOBJECT,
+        "CALL CPESupplementaryServicesMonitor::~CPESupplementaryServicesMonitor: Complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESupplementaryServicesMonitor::BarringEventOccurred
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESupplementaryServicesMonitor::BarringEventOccurred( 
+    const MCCESsObserver::TCCESsBarringEvent aBarringEvent )
+    {
+    TEFLOGSTRING2( 
+        KTAMESIN, 
+        "CALL: CPESupplementaryServcesMonitor::BarringEventOccurred aBarringEvent %d", 
+        aBarringEvent );
+     switch( aBarringEvent )
+        {       
+        case ECCESsIncomingCallBarred:  /** Incoming call is barred. (DoCoMo) */
+        case ECCESsAnonymousCallBarred: /** Anonymous call barring. */
+        case ECCESsOutgoingCallBarred:  /** Outgoing call barring */
+            iOwner.SendMessage( MEngineMonitor::EPEMessageCallBarred, KPECallIdNotUsed );
+            break;
+            
+        default:
+            break;
+        }
+    }
+    
+        
+// -----------------------------------------------------------------------------
+// CPESupplementaryServicesMonitor::CLIEventOccurred
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESupplementaryServicesMonitor::CLIEventOccurred( 
+    const MCCESsObserver::TCCESsCLIEvent aCallLineEvent )
+    {
+ 
+    switch( aCallLineEvent )
+        {
+        case ECCESsTempClirSuppressUnsuccessful:    /** Temporary CLIR suppression was unsuccessful */
+            iOwner.SendMessage( MEngineMonitor::EPEMessageTempClirSuppressUnsuccessful, KPECallIdNotUsed );
+            break;
+            
+        case ECCESsTempClirActivationUnsuccessful:  /** Temporary CLIR activation was unsuccessful*/
+            iOwner.SendMessage( MEngineMonitor::EPEMessageTempClirActivationUnsuccessful, KPECallIdNotUsed );
+            break;
+            
+        default:
+            break;
+        }
+
+    }
+                          
+// -----------------------------------------------------------------------------
+// CPESupplementaryServicesMonitor::CallForwardEventOccurred
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESupplementaryServicesMonitor::CallForwardEventOccurred( 
+                        const MCCESsObserver::TCCESsCallForwardEvent aCallForwardEvent,
+                        const TDesC& /*aRemoteAddress*/ )
+    {  
+    TEFLOGSTRING2( 
+        KTAMESIN, 
+        "CALL: CPESupplementaryServcesMonitor::CallForwardEventOccurred aCallForwardEvent %d", 
+        aCallForwardEvent );
+    switch( aCallForwardEvent )
+        {
+        case ECCESsIncCallIsForw:   /** Incoming call is forwarded */
+            iOwner.SendMessage( MEngineMonitor::EPEMessageIncCallIsForw, KPECallIdNotUsed );
+            break;
+            
+        case ECCESsIncCallForwToC:  /** Incoming call was forwarded because of user own settings. */
+            iOwner.SendMessage( MEngineMonitor::EPEMessageIncCallForwToC, KPECallIdNotUsed );
+            break;
+            
+        case ECCESsOutCallForwToC:  /** outgoing call was forwarded because of user own settings. */
+            iOwner.SendMessage( MEngineMonitor::EPEMessageOutCallForwToC, KPECallIdNotUsed );
+            break;
+        
+        case ECCESsForwardUnconditionalModeActive:
+            iOwner.SendMessage( MEngineMonitor::EPEMessageForwardUnconditionalModeActive, KPECallIdNotUsed );
+            break;
+            
+        case ECCESsForwardConditionallyModeActive:
+            iOwner.SendMessage( MEngineMonitor::EPEMessageForwardConditionallyModeActive, KPECallIdNotUsed );
+            break;
+            
+        case ESsCallWaiting:
+            iOwner.SendMessage( MEngineMonitor::EPEMessageCallWaiting, KPECallIdNotUsed );
+            TEFLOGSTRING( KTAINT, "CPESupplementaryServicesMonitor::CallForwardEventOccurred -> ECCESsCallWaiting" );
+            break;
+            
+        default:
+            break;        
+        }       
+    }
+                                  
+// -----------------------------------------------------------------------------
+// CPESupplementaryServicesMonitor::CallCugEventOccurred
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESupplementaryServicesMonitor::CallCugEventOccurred( 
+    const MCCESsObserver::TCCESsCugEvent aCugEvent )
+    {
+    // These events can be ingored for now. They don't cause any action in our
+    // layer or in UI.
+    
+    switch( aCugEvent )
+        {
+        case ECCESsShowIncCallGroupIndex: // fall through
+            iOwner.SendMessage( MEngineMonitor::EPEMessageShowIncCallGroupIndex, KPECallIdNotUsed );
+            break;
+        case ECCESsRejectedCause:
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESupplementaryServicesMonitor::NotifyCurrentActiveALSLine
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPESupplementaryServicesMonitor::NotifyCurrentActiveALSLine( 
+    TInt aLine )
+    {
+    TEFLOGSTRING2( 
+        KTAMESIN, 
+        "CALL: CPESupplementaryServcesMonitor::NotifyCurrentActiveALSLine aLine %d", 
+        aLine );
+        
+    switch( aLine )
+        {
+        case RMobilePhone::EAlternateLineNotAvailable:
+            iDataStore.SetALSLineSupport( EFalse );
+            iDataStore.SetALSLine( CCCECallParameters::ECCELineTypePrimary );
+            break;
+            
+        case RMobilePhone::EAlternateLinePrimary:
+            iDataStore.SetALSLineSupport( ETrue );
+            iDataStore.SetALSLine( CCCECallParameters::ECCELineTypePrimary );
+            break;
+            
+        case RMobilePhone::EAlternateLineAuxiliary:
+            iDataStore.SetALSLineSupport( ETrue );
+            iDataStore.SetALSLine( CCCECallParameters::ECCELineTypeAux );
+            break;
+            
+        default:
+            break;
+        }
+        
+    // Notify that, ALS line changed.   
+    iOwner.SendMessage( MEngineMonitor::EPEMessageALSLineChanged, KPECallIdNotUsed );
+    }
+    
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpesystemcallstate.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,537 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPESystemCallState class 
+*                member functions.
+*
+*/
+
+
+// INCLUDE FILES
+#include <talogger.h>
+#include <pepanic.pan>
+#include <ctsydomainpskeys.h>
+
+#include "cpesystemcallstate.h"
+#include "cpecallarrayowner.h"
+#include "mpedatastore.h"
+#include "cpesinglecall.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPESystemCallState::CPESystemCallState
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPESystemCallState::CPESystemCallState( 
+         CPECallArrayOwner& aCallArrayOwner,
+         MPEDataStore& aDataStore ) : 
+         iCallArrayOwner( aCallArrayOwner ),
+         iDataStore( aDataStore ),
+         iCallStateTsy( EPSCTsyCallStateUninitialized ),
+         iCallTypeTsy( EPSCTsyCallTypeUninitialized )
+    {
+    }
+
+// Destructor
+CPESystemCallState::~CPESystemCallState()
+    {
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL CPESystemCallState::~CPESystemCallState start" );
+    iCallStateProperty.Close();
+    iCallTypeProperty.Close();
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL CPESystemCallState::~CPESystemCallState complete" );
+    }    
+
+// -----------------------------------------------------------------------------
+// CPESystemCallState::NewL
+// -----------------------------------------------------------------------------
+//
+CPESystemCallState* CPESystemCallState::NewL( 
+        CPECallArrayOwner& aCallArrayOwner,
+        MPEDataStore& aDataStore )
+    {
+    TEFLOGSTRING( KTAOBJECT,
+         "CALL CPESystemCallState::NewL: start." );
+    
+    CPESystemCallState* self = new ( ELeave ) CPESystemCallState( aCallArrayOwner, aDataStore );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL CPESystemCallState::NewL: complete." );
+    
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::ConstructL()
+
+    {
+    // Attach and initialize publish & subscribe properties
+    TInt r( KErrNone );
+    RProperty::TType type( RProperty::EInt );
+    TSecurityPolicy readPolicy( ECapability_None );
+    TSecurityPolicy writePolicy( ECapabilityWriteDeviceData );
+    
+    TEFLOGSTRING( KTAOBJECT,
+         "CALL CPESystemCallState::ConstructL: start." );
+    iCallStateInCenRep = EPSCTsyCallStateNone;
+    iCallTypeInCenRep = EPSCTsyCallTypeNone;
+    
+    User::LeaveIfError( 
+        iCallStateProperty.Attach( KPSUidCtsyCallInformation, KCTsyCallState ) );  
+    r =  iCallStateProperty.Set( iCallStateInCenRep );
+    if ( KErrNotFound == r )
+        {
+        // Not defined yet - do so here
+        User::LeaveIfError( RProperty::Define( KPSUidCtsyCallInformation, 
+            KCTsyCallState, 
+            type,
+            readPolicy,
+            writePolicy ) );
+        r = iCallStateProperty.Set( iCallStateInCenRep );
+        }
+    User::LeaveIfError( r );
+    
+    User::LeaveIfError( 
+        iCallTypeProperty.Attach( KPSUidCtsyCallInformation, KCTsyCallType ) );   
+    r =  iCallTypeProperty.Set( iCallTypeInCenRep );
+    if ( KErrNotFound == r )
+        {
+        // Not defined yet - do so here
+        User::LeaveIfError( RProperty::Define( KPSUidCtsyCallInformation, 
+            KCTsyCallType, 
+            type,
+            readPolicy,
+            writePolicy ) );
+        r = iCallTypeProperty.Set( iCallTypeInCenRep );
+        }
+    User::LeaveIfError( r );
+    
+    TEFLOGSTRING( KTAOBJECT, 
+        "CALL CPESystemCallState::ConstructL: complete." );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::CreateCallL
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::NotifySystemCallStateChanged( 
+        MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        TInt aCallId )
+    {
+    TEFLOGSTRING3( 
+        KTAINT, 
+        "CALL CPECallHandling::NotifySystemCallStateChanged, message id: %d, call id: %d", 
+        aMessage, 
+        aCallId );
+        
+    iCallStateTsy = EPSCTsyCallStateUninitialized;
+    iCallTypeTsy = EPSCTsyCallTypeUninitialized;
+    TInt updateError( KErrNone );
+    TInt updateErrorTsy( KErrNone );
+    
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageIncoming:
+            HandleIncoming( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageAnswering:
+            HandleAnswering( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageDialing:
+            HandleDialling( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageConnecting:
+        case MEngineMonitor::EPEMessageConnectingWithInband:
+            HandleConnecting( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageConnected:
+            HandleConnected( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageDisconnecting:
+        case MEngineMonitor::EPEMessageDisconnectingWithInband:
+            HandleDisconnecting( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageIdle:
+            HandleIdle( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageHeld:
+            HandleHeld( aCallId );
+            break;
+        case MEngineMonitor::EPEMessageCallControlCapsChanged:
+            HandleCallControlCapsChanged();
+            break;
+        case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
+            HandleRemotePartyChanged( aCallId );
+            break;
+        default:
+            // Other messages cause no action.
+            break;
+        } 
+
+    if ( iCallStateTsy != EPSCTsyCallStateUninitialized && 
+         iCallStateTsy != iCallStateInCenRep )
+        {
+        TEFLOGSTRING2( 
+            KTAREQOUT, 
+            "CALL CPECallHandling::NotifySystemCallStateChanged request rproperty::set, Call State Tsy: %d", 
+            iCallStateTsy );
+        updateErrorTsy = RProperty::Set( KPSUidCtsyCallInformation, 
+        KCTsyCallState, iCallStateTsy );
+        iCallStateInCenRep = iCallStateTsy;
+        }
+
+    if ( iCallTypeTsy != EPSCTsyCallTypeUninitialized && 
+         !updateError && 
+         !updateErrorTsy && 
+         iCallTypeTsy != iCallTypeInCenRep )
+        {
+        TEFLOGSTRING2( 
+            KTAREQOUT, 
+            "CALL CPECallHandling::NotifySystemCallStateChanged request rproperty::set, Call Type: %d", 
+            iCallTypeTsy );
+        updateError = iCallTypeProperty.Set( iCallTypeTsy );
+        updateErrorTsy = RProperty::Set( KPSUidCtsyCallInformation, 
+        KCTsyCallType, iCallTypeTsy );
+        iCallTypeInCenRep = iCallTypeTsy;
+        }
+
+    if ( updateError || updateErrorTsy )
+        {// Logs error - but does not return it
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::NOTIFYSYSTEMCALLSTATECHANGED: UNABLE TO UPDATE SYSTEM KEYS, ERROR = %d", 
+            updateError || updateErrorTsy );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleIncoming
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleIncoming( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleIncoming" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleIncoming: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+    iCallStateTsy = EPSCTsyCallStateRinging;
+    SetCallInformatioAPICallType( *callData );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleDialling
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleDialling( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleDialling" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleDialling: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+    iCallStateTsy = EPSCTsyCallStateDialling;
+    SetCallInformatioAPICallType( *callData );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleConnected
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleConnected( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleConnected" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleConnected: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+    
+    if ( !iCallArrayOwner.CallByState( EPEStateRinging ) )
+        {
+        iCallStateTsy = EPSCTsyCallStateConnected;
+        // Needs update also CallType. Even when replace Video Call, see error ELYG-7AWC2N.    
+        SetCallInformatioAPICallType( *callData );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleRemotePartyChanged
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleRemotePartyChanged( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleRemotePartyChanged" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleRemotePartyChanged: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+    CPESingleCall* connectedCallData = iCallArrayOwner.CallPointerByState( EPEStateConnected );
+
+    if ( connectedCallData )
+        {
+        iCallStateTsy = EPSCTsyCallStateConnected;
+        // Needs update also CallType. Even when replace Video Call, see error ELYG-7AWC2N.    
+        SetCallInformatioAPICallType( *callData );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleDisconnecting
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleDisconnecting( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleDisconnecting" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleDisconnecting: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+    if ( !iCallArrayOwner.CallByState( EPEStateConnected ) &&
+         !iCallArrayOwner.CallByState( EPEStateHeld ) &&
+         !iCallArrayOwner.CallByState( EPEStateDialing ) && 
+         !iCallArrayOwner.CallByState( EPEStateConnecting ) && 
+         !iCallArrayOwner.CallByState( EPEStateRinging ) )
+        {
+        iCallStateTsy = EPSCTsyCallStateDisconnecting;
+        SetCallInformatioAPICallType( *callData );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleIdle
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleIdle( TInt /*aCallId*/ )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleIdle" );
+    if ( !iCallArrayOwner.ActiveCallCount() )
+        {
+        iCallStateTsy = EPSCTsyCallStateNone;
+        iCallTypeTsy = EPSCTsyCallTypeNone;
+        }
+    else
+        {
+         // There is other active / waiting call(s)
+        CPESingleCall* ringingCallData = iCallArrayOwner.CallPointerByState( EPEStateRinging );
+        if ( !ringingCallData )
+            {
+            CPESingleCall* connectedCallData = iCallArrayOwner.CallPointerByState( EPEStateConnected );
+            CPESingleCall* heldCallData = iCallArrayOwner.CallPointerByState( EPEStateHeld );
+            if ( connectedCallData )
+                {
+                iCallStateTsy = EPSCTsyCallStateConnected;
+                SetCallInformatioAPICallType( *connectedCallData );
+                }                    
+            else if ( heldCallData )
+                {
+                iCallStateTsy = EPSCTsyCallStateHold;
+                SetCallInformatioAPICallType( *heldCallData );
+                }
+            }
+        else
+            {
+            iCallStateTsy = EPSCTsyCallStateRinging;
+            SetCallInformatioAPICallType( *ringingCallData );
+            }   
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleHeld
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleHeld( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleHeld" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleHeld: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+
+    if( !iCallArrayOwner.CallByState( EPEStateDialing ) &&
+        !iCallArrayOwner.CallByState( EPEStateRinging ) &&
+        !iCallArrayOwner.CallByState( EPEStateConnecting ) &&
+        !iCallArrayOwner.CallByState( EPEStateConnected )&&
+        !iCallArrayOwner.CallByState( EPEStateAnswering ) )
+        {
+        iCallStateTsy = EPSCTsyCallStateHold;
+        SetCallInformatioAPICallType( *callData );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleAnswering
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleAnswering( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleAnswering" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleHeld: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+    
+    iCallStateTsy = EPSCTsyCallStateAnswering; 
+    SetCallInformatioAPICallType( *callData );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleConnecting
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleConnecting( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleConnecting" );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( !callData )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "CALL CPECallHandling::HandleHeld: call not found, call id  = %d", 
+            aCallId );
+        __ASSERT_DEBUG( callData, Panic( EPEPanicCallDataNull) );
+        return;
+        }
+    
+    iCallStateTsy = EPSCTsyCallStateAlerting;
+    SetCallInformatioAPICallType( *callData );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESystemCallState::HandleCallControlCapsChanged
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::HandleCallControlCapsChanged()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::HandleCallControlCapsChanged" );
+    CPESingleCall* callData = iCallArrayOwner.CallPointerByState( EPEStateConnected );
+    if( callData && !iCallArrayOwner.CallByState( EPEStateRinging ) )
+        {
+        iCallStateTsy = EPSCTsyCallStateConnected;
+        SetCallInformatioAPICallType( *callData );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPESystemCallState::SetCallInformatioAPICallType
+// -----------------------------------------------------------------------------
+//
+void CPESystemCallState::SetCallInformatioAPICallType( CPESingleCall& aCallData )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::SetCallInformatioAPICallType" );
+    switch ( aCallData.Call().Parameters().CallType() )
+        {
+        case CCPCall::ECallTypeCSVoice:
+            TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::SetCallInformatioAPICallType EPSCTsyCallTypeCSVoice" );
+            iCallTypeTsy = EPSCTsyCallTypeCSVoice;
+            break;
+        case CCPCall::ECallTypePS:
+            TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::SetCallInformatioAPICallType EPSCTsyCallTypeVoIP" );
+            iCallTypeTsy = EPSCTsyCallTypeVoIP;
+            break;
+        case CCPCall::ECallTypeVideo:
+            TEFLOGSTRING( KTAINT, "CALL CPESystemCallState::SetCallInformatioAPICallType EPSCTsyCallTypeH324Multimedia" );
+            iCallTypeTsy = EPSCTsyCallTypeH324Multimedia;
+            break;
+        default:
+            TEFLOGSTRING( 
+                KTAERROR, 
+                "CALL CPECallHandling::SetCallInformatioAPICallType: call type not recognised" );
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicCallDataNull) );
+            break;
+        }
+    }
+    
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+
+
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/cpevideocallhandling.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,995 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains implementation of CPEVideoCallHandling class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpevideocallhandling.h"
+#include "cpesinglecall.h"
+#include "pevirtualengine.h"
+#include "cpecallarrayowner.h"
+#include "cpecallarrayowner.h"
+#include "cpegprstermination.h"
+
+#include <mpephonemodelinternal.h>
+#include <e32property.h>
+#include <gsmerror.h>
+#include <mpedatastore.h>
+#include <networkhandlingdomainpskeys.h>
+#include <pepanic.pan>
+#include <pevirtualengine.h>
+#include <talogger.h>
+#include <ctsydomainpskeys.h>
+#include <connect/sbdefs.h>
+#include <ccce.h>
+#include <mccecall.h>
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::CPEVideoCallHandling
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEVideoCallHandling::CPEVideoCallHandling(
+        MPEMessageSender& aOwner,
+        MPEPhoneModelInternal& aModel,        
+        CCCE& aConvergedCallEngine,
+        CPECallArrayOwner& aCallArrayOwner
+        ) : iOwner( aOwner ),
+            iModel( aModel ),
+            iConvergedCallEngine( aConvergedCallEngine ),
+            iDataCallName( KNullDesC ),
+            iCallArrayOwner( aCallArrayOwner ),
+            iDataStore( *( aModel.DataStore( ) ) ),
+            iRestoreCauseVTCallReject( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::ConstructL start." );
+
+    iCallOpenParams = CCCECallParameters::NewL();
+    TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::ConstructL complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEVideoCallHandling* CPEVideoCallHandling::NewL(
+        MPEMessageSender& aOwner,
+        MPEPhoneModelInternal& aModel,         
+        CCCE& aConvergedCallEngine,
+        CPECallArrayOwner& aCallArrayOwner )
+    {
+    TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::NewL start." );
+    CPEVideoCallHandling* self = new ( ELeave ) CPEVideoCallHandling( aOwner, 
+                                                                      aModel, 
+                                                                      aConvergedCallEngine,
+                                                                      aCallArrayOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING( KTAOBJECT, "VID CPEVideoCallHandling::NewL complete." );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::~CPEVideoCallHandling()
+// Destructor
+// -----------------------------------------------------------------------------
+//
+CPEVideoCallHandling::~CPEVideoCallHandling()
+    {
+    TFLOGSTRING( "CallHandling: CPEVideoCallHandling::~CPEVideoCallHandling() Start");
+    delete iGprsInterface;
+    iGprsInterface = NULL;
+    delete iCallOpenParams;
+    TFLOGSTRING( "CallHandling: CPEVideoCallHandling::~CPEVideoCallHandling() complete");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::AnswerCall
+// Answers the incoming call
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::AnswerCall()
+    {
+    TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::AnswerCall");
+    TInt errorCode( KErrNotFound );
+    CPESingleCall* dataCallData = VideoCallByState( EPEStateRinging );
+    if ( dataCallData )
+        {
+        if ( GetNumberOfCalls() == 1 )
+            {
+            TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::AnswerCall > CPEDataCall::Answer" );
+            dataCallData->Answer();
+            errorCode = KErrNone;
+            }
+        else
+            {
+            TEFLOGSTRING( KTAERROR, 
+                    "VID CPEVIDEOCALLHANDLING::ANSWERCALL: NOT ALLOWED WITH EXISTING CALLS!" );
+            errorCode = ECCPErrorNotAllowed;
+            }
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, 
+                "VID CPEVIDEOCALLHANDLING::ANSWERCALL: NO RINGING CALLS FOUND!" );
+        }
+
+    return errorCode;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::VideoCallByState
+// Finds a data call object that is in specified  state
+// -----------------------------------------------------------------------------
+//  
+CPESingleCall* CPEVideoCallHandling::VideoCallByState( 
+        const TPEState aState ) const
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallByState" );
+    CPESingleCall* returnValue( NULL );
+    CPESingleCall* callData;
+        
+    for ( TInt callId = KPEDataCallIdBase; 
+          callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls ); 
+          callId++ )
+        {
+        callData = iCallArrayOwner.GetCallObject( callId );
+        if ( callData 
+             && ( callData->GetCallState() == aState ) )
+            {
+            returnValue = callData;
+            TEFLOGSTRING2( KTAINT, 
+                "CALL CPEVideoCallHandling::DataCallByState %d", callId );
+            break;
+            }
+        }
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::CallTerminatedError
+// Handles RemoteTerminated. 
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::CallTerminatedError( const TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, 
+            "VID CPEVideoCallHandling::CallTerminatedError, aCallId: %d",
+            aCallId );
+    
+    TInt errorCode( KErrNone );    
+    CPESingleCall* dataCall = iCallArrayOwner.GetCallObject( aCallId );
+    if ( dataCall )
+        {
+        dataCall->GetErrorCode( errorCode );
+        }
+    
+    TEFLOGSTRING2( KTAINT, 
+                "VID CPEVideoCallHandling::CallTerminatedError, errorCode: %d",
+                errorCode );
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::DataPortInUse
+// Tells if the call has reserved serial communications data port for use
+// The default value is EFalse, i.e. the data port has not been reserved for
+// use. The data port is recovered when no longer needed.
+// -----------------------------------------------------------------------------
+// 
+TBool CPEVideoCallHandling::DataPortInUse(
+        TInt aCallId ) const
+    {
+    TBool dataPortInUse( EFalse );
+    TPEState state;
+    
+    if ( CallIdCheck::IsVideo( aCallId ) )
+        {
+        CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+        if( callData )
+            {
+            state = callData->GetCallState();
+            if( state == EPEStateConnected )
+                {
+                dataPortInUse = ETrue;
+                }
+            }
+        }
+    return dataPortInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::DialCall
+// Creates dialing request to the Multimode ETel. 
+// This request is for creating a new multimedia (=data) call
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::DialCall(
+        const TPEPhoneNumber& aNumber,
+        TInt& aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::DialCall" );
+    TInt errorCode( KErrNone );
+    TInt networkMode( ENWNetworkModeUnknown );
+    CPESingleCall* callData( NULL );
+    
+    RProperty::Get( KPSUidNetworkInfo, KNWTelephonyNetworkMode, networkMode );   
+
+    TInt restoreValue;
+    RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, restoreValue );       
+    
+    if ( networkMode == ENWNetworkModeWcdma && 
+        !( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )) )
+        {
+        TRAP( errorCode, callData = OpenNewCallL( aNumber ) );
+        if( errorCode == KErrNone )
+            {
+            TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DialCall > Dial" );
+            errorCode = callData->Dial( aNumber );
+            if ( errorCode != KErrNone )
+                {
+                // Dial failed: clean up
+                ReleaseCallObject( callData->GetCallId() );
+                TEFLOGSTRING2( KTAERROR, 
+                        "VID CALL CPEVideoCallHandling::DialCall ! DIAL FAILED: MAY NOT PROCEED! %d",
+                        errorCode );
+                }
+            else
+                {
+                // Dial request passed on successfully: forward new call id
+                aCallId = callData->GetCallId();
+                }
+            }
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, 
+            "VID CPEVideoCallHandling::DialCall: Attempting video call in 2G network!" );
+        errorCode = ( networkMode != ENWNetworkModeWcdma ) ? 
+                      ECCPErrorVideoCallNotSupportedByNetwork : 
+                      ECCPErrorVideoCallNotAllowedDuringRestore;
+        }    
+        
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::HangUp
+// terminates an ongoing call
+// Method checks that call id is valid number and
+// hangups conference or data call or reroutes call to base class.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::HangUp( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::HangUp" );
+    TInt errorCode( KErrNotFound );
+    CPESingleCall* videoCall = iCallArrayOwner.GetCallObject( aCallId );
+    
+    if ( videoCall && CallIdCheck::IsVideo( aCallId ) ) 
+        {
+
+        errorCode = videoCall->HangUp();
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::InitCall
+// Handles the initializing of a single data/video call.
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::InitCall( MCCECall& aCall )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::InitCall" );
+    CPESingleCall* callData( NULL );
+      TRAP_IGNORE( callData = iCallArrayOwner.CreateDataCallL( *this ) );
+
+    if ( callData )
+        {
+        iModel.DataStore()->SetPhoneNumber( KNullDesC() );
+        iModel.DataStore()->SetServiceId( callData->GetCallId(), aCall.ServiceId() );
+        callData->SetCall( aCall );
+        iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() );
+        iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() );
+        
+        const CCCPCallParameters& callParameters = aCall.Parameters();
+        switch ( callParameters.CallType() )
+            {
+            case CCPCall::ECallTypeCSVoice:
+                {
+                iModel.DataStore()->SetCallType( EPECallTypeCSVoice, callData->GetCallId() );
+                }
+                break;
+            case CCPCall::ECallTypeVideo:
+                {
+                iModel.DataStore()->SetCallType( EPECallTypeVideo, callData->GetCallId() );
+                }
+                break;
+            case CCPCall::ECallTypePS:
+                {
+                iModel.DataStore()->SetCallType( EPECallTypeVoIP, callData->GetCallId() );
+                }
+                break;
+            default:
+                __ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange ));
+                break;
+            }
+        }
+    else
+        {
+        Panic( EPEPanicNoFreeCalls );
+        }
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::IsMultimedia
+// Checks if the data call is a multimedia call. Requires that the data call has
+// already been opened.
+// -----------------------------------------------------------------------------
+//
+TBool CPEVideoCallHandling::IsMultimedia( TInt aCallId ) const
+    {
+    TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::IsMultimedia %d", aCallId );
+    
+    TBool multimedia( EFalse );
+    CPESingleCall* videoCall = iCallArrayOwner.GetCallObject( aCallId );
+    
+    if ( videoCall && CallIdCheck::IsVideo( aCallId ) 
+         && videoCall->Call().Parameters().CallType()  
+                == CCPCall::ECallTypeVideo )
+        {
+        multimedia = ETrue;
+        }
+        
+    return multimedia;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::NotifySystemCallStateChanged
+// Notifies system for changes to the call state.
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::NotifySystemCallStateChanged( 
+        MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,  // The enumeration number of the message
+        TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::NotifySystemCallStateChanged %d", aCallId );
+    // this needs to be checked because this function is called for all data calls
+    if ( IsMultimedia( aCallId ) )
+        {
+        if ( aMessage == MEngineMonitor::EPEMessageIncoming ||
+           aMessage == MEngineMonitor::EPEMessageDialing )
+            {
+            TInt updateError = RProperty::Set( KPSUidCtsyCallInformation, 
+                KCTsyCallType, EPSCTsyCallTypeH324Multimedia );
+            TEFLOGSTRING2( updateError?KTAERROR:KTAMESOUT, 
+                "VID CPEVideoCallHandling::NotifySystemCallStateChanged request RProperty::Set, EPSCTsyCallTypeH324Multimedia, updateError: ",
+                updateError );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::SendMessage
+// Overrides CPECallHandling::SendMessage to provide internal handling for gsm events
+// and common events related to multimedia calls.
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::SendMessage(
+        MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        TInt aCallId )
+    {
+    TEFLOGSTRING3( KTAINT, 
+        "VID CPEVideoCallHandling::SendMessage, message id: %d, call id: %d", 
+        aMessage, 
+        aCallId );
+        
+    TInt error( KErrNone );
+    CPESingleCall* videoCall = iCallArrayOwner.GetCallObject( aCallId );
+    CPESingleCall* connectedVideoCall = VideoCallByState( EPEStateConnected );
+
+    if ( IsMultimedia( aCallId ) )
+        {
+        switch ( aMessage )
+            {
+            case MEngineMonitor::EPEMessageIncoming:
+            case MEngineMonitor::EPEMessageDialing:
+                {
+                TInt restoreValue;
+                RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, restoreValue );
+                if( ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial ) ) )
+                    {
+                    // First phase VT and restore: Check if there is a arriving VT 
+                    // call and Restore ongoing.
+                    TEFLOGSTRING( KTAINT, 
+                        "VID CPEVideoCallHandling::SendMessage > HangUp restore active " );
+                    iRestoreCauseVTCallReject = ETrue;
+                    if( videoCall )
+                        {
+                        videoCall->HangUp();
+                        }
+                    aMessage = MEngineMonitor::EPEMessageDoNotSendMe;
+                    }
+                break;
+                }
+            case MEngineMonitor::EPEMessageDisconnecting:
+                {
+                if( iRestoreCauseVTCallReject )
+                    {
+                    // Second phase VT and restore: Check if there is a rejected arriving VT call 
+                    // and Restore ongoing, then don't notify observers.
+                    iRestoreCauseVTCallReject = EFalse;
+                    TEFLOGSTRING( KTAINT, 
+                        "VID CPEVideoCallHandling::SendMessage Second phase Restore and VT call" );
+                    aMessage = MEngineMonitor::EPEMessageDoNotSendMe;
+                    }
+                break;
+                }
+            case MEngineMonitor::EPEMessageIdle:
+                {
+                iRestoreCauseVTCallReject = EFalse;
+                // Check reject video cace, if there is connect VT call don't disconnect
+                if( !connectedVideoCall )
+                    {
+                    if ( CallTerminatedError( aCallId ) == KErrGsmCCIncompatibleDestination )
+                        {
+                        error = KErrGsmCCIncompatibleDestination;
+                        }
+                    }
+                break;
+                }
+            default:
+                {
+                TEFLOGSTRING2( 
+                    KTAINT, 
+                    "VID CPEVideoCallHandling::SendMessage: multimedia call, message: %d", 
+                    aMessage );
+                break;
+                }
+            } 
+        }
+    else
+        {
+        TEFLOGSTRING2( 
+            KTAINT, 
+            "VID CPEVideoCallHandling::SendMessage, isMultimedia: %d", 
+            IsMultimedia( aCallId ) );
+        }
+    if ( error == KErrNone )
+        {
+        iOwner.SendMessage( aMessage, aCallId );
+        }
+    else
+        {
+        SendErrorMessage( aCallId, error );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::VideoCallInState
+// Checks if there are any data calls in the specified state
+// -----------------------------------------------------------------------------
+//
+TBool CPEVideoCallHandling::VideoCallInState( const TPEState& aState ) const
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallInState" );
+    TBool returnValue( EFalse );
+    if( VideoCallByState( aState ) )
+        {
+        returnValue = ETrue;
+        }
+    return returnValue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::IsPhoneNumberAvailable
+// -----------------------------------------------------------------------------
+//
+TBool CPEVideoCallHandling::IsPhoneNumberAvailable( const TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "VID CPEVideoCallHandling::IsPhoneNumberAvailable, aCallId: %d"
+        , aCallId );
+    TBool phoneNumberAvailable ( EFalse );
+        
+    if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated )
+        {
+        phoneNumberAvailable = ETrue;   
+        }
+    else
+        {
+        RMobileCall::TMobileCallRemoteIdentityStatus remoteIdentity;
+        remoteIdentity = iDataStore.RemoteIdentity( aCallId );
+        TEFLOGSTRING2( KTAINT, 
+            "VID CPEVideoCallHandling::IsPhoneNumberAvailable, remoteIdentity: %d", 
+            remoteIdentity);
+        phoneNumberAvailable = ( remoteIdentity == RMobileCall::ERemoteIdentityAvailable );     
+        }
+    TEFLOGSTRING2( KTAINT, 
+        "VID CPEVideoCallHandling::IsPhoneNumberAvailable, isAvailable: %d", 
+        phoneNumberAvailable );
+    return phoneNumberAvailable;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::VideoCallByState
+// returns CPEVoiceCall video call object by State
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPEVideoCallHandling::VideoCallByState( TPEState aState )
+    {
+    TEFLOGSTRING2( KTAINT, 
+            "CPEVideoCallHandling::VideoCallByState, aState: %d", aState );    
+    TPEState state;
+    CPESingleCall* returnValue( NULL );
+
+    for ( TInt callId = KPEDataCallIdBase; 
+          callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls );
+          callId++ )
+        {        
+        CPESingleCall* callData = iCallArrayOwner.GetCallObject( callId );
+        if( callData )
+            {
+            state = callData->GetCallState();
+
+            if ( state == aState )
+                {
+                returnValue = callData;
+                break;
+                }
+            }
+        }
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// Replace active video call with a waiting video call
+// NOT SUPPORTED AS OF 5.1
+// -----------------------------------------------------------------------------
+//    
+TInt CPEVideoCallHandling::ReplaceActive( TInt /*aCallId*/  )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::SetCallParams
+//
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::SetCallParams( TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, 
+            "VID CCPEVideoCallHandling::SetCallParams, aCallId: %d", aCallId );
+    iCallOpenParams->SetLineType( CCCECallParameters::ECCELineTypePrimary );
+
+    switch ( iModel.DataStore()->CallTypeCommand() )
+        {
+        case EPECallTypeVideo:
+            {
+            iCallOpenParams->SetCallType( CCPCall::ECallTypeVideo );
+            iModel.DataStore()->SetServiceIdCommand( 1 );
+            iModel.DataStore()->SetCallType( EPECallTypeVideo, aCallId );
+            }
+            break;
+        default:
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicIndexOutOfRange ));
+            iCallOpenParams->SetCallType( CCPCall::ECallTypeVideo );
+            iModel.DataStore()->SetServiceIdCommand( 1 );
+            iModel.DataStore()->SetCallType( EPECallTypeVideo, aCallId );
+            break;
+        } 
+    iCallOpenParams->SetServiceId( iModel.DataStore()->ServiceIdCommand() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::OpenNewCallL
+// returns ETrue if hangup active
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPEVideoCallHandling::OpenNewCallL( const TPEPhoneNumber& aNumber )
+    {
+    TEFLOGSTRING( KTAINT, "VID CPEVideoCallHandling::OpenNewCallL");
+    TInt errorCode( KErrNone );
+    CPESingleCall* callData( NULL );
+    MCCECall* cceCall( NULL );
+    
+    callData = iCallArrayOwner.CreateDataCallL( *this );
+    SetCallParams( callData->GetCallId() );
+    
+    TEFLOGSTRING( KTAINT, 
+        "VID CPEVideoCallHandling::OpenNewCallL > CCCE::OpenNewCallL");
+    TRAP( errorCode, 
+          cceCall = &( iConvergedCallEngine.OpenNewCallL( aNumber, 
+                                                          *iCallOpenParams, 
+                                                          *callData ) ) );
+    if ( errorCode == KErrNone )
+        {
+        callData->SetCall( *cceCall );
+        iModel.DataStore()->SetServiceId( callData->GetCallId(), cceCall->ServiceId() );
+        iModel.DataStore()->SetCallSecureStatus( callData->IsSecureCall(), callData->GetCallId() );
+        iModel.DataStore()->SetSecureSpecified( callData->SecureSpecified() );
+        }
+    else
+        {
+        // Open new call failed
+        ReleaseCallObject( callData->GetCallId() );
+        TEFLOGSTRING2( KTAERROR, 
+                "VID CPEVideoCallHandling::DIALCALL ! OPENNEWCALL FAILED: MAY NOT PROCEED! %d", 
+                errorCode );
+        User::Leave( errorCode );
+        }
+    return callData;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::GetCallState
+// Returns call state information.
+// -----------------------------------------------------------------------------
+//
+TPEState CPEVideoCallHandling::GetCallState( TInt aCallId  )
+    {
+    TEFLOGSTRING2( KTAINT, 
+            "CALL CPEVideoCallHandling::GetCallState %d", aCallId );
+    TPEState callState( EPEStateUnknown );
+    CPESingleCall* callData = iCallArrayOwner.GetCallObject( aCallId );
+    if( callData )
+        {
+        callState = callData->GetCallState();
+        }
+    else
+        {
+        callState = EPEStateIdle;
+        }
+    TEFLOGSTRING2( KTAINT, 
+            "CALL CPEVideoCallHandling::GetCallState, callState: %d", 
+            callState );
+    return callState;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::VideoCallById
+// returns CPESingleCall video call object by State
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPEVideoCallHandling::VideoCallById( TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "VID CPEVideoCallHandling::VideoCallById %d", aCallId );
+    return iCallArrayOwner.GetCallObject( aCallId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::GetNumberOfCalls
+// Returns number of data calls.
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::GetNumberOfCalls()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::GetNumberOfCalls" );
+    // Count ongoing calls
+    return iCallArrayOwner.ActiveCallCount();
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::SendMessage
+// Reroutes messages to the Phone Engine
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::SendMessage( 
+    MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+    const TName& aName )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPECallHandling::SendMessage, message id: %d", aMessage );
+    CPESingleCall* videoCall = VideoCallByName( aName );
+    if( videoCall )
+        {
+        SendMessage( aMessage, videoCall->GetCallId() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::VideoCallByName
+// returns data call object by name
+// -----------------------------------------------------------------------------
+//
+CPESingleCall* CPEVideoCallHandling::VideoCallByName( const TName& aName )
+    {       
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallByName" );
+    CPESingleCall* returnValue( NULL );
+    CPESingleCall* callData;
+    for ( TInt callId = KPEDataCallIdBase; 
+          callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls ); 
+          callId++ )
+        {
+        callData = iCallArrayOwner.GetCallObject( callId );
+
+        if ( callData 
+             && ( VideoCallName( callId ) == aName ) )
+            {
+            returnValue = callData;
+            TEFLOGSTRING2( KTAINT, 
+                "CALL CPEVideoCallHandling::DataCallByName %d", callId );
+            break;
+            }
+        }
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::VideoCallName
+// Finds data call name given the call id.
+// -----------------------------------------------------------------------------
+//  
+TName& CPEVideoCallHandling::VideoCallName( const TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::DataCallName" );
+    
+    iDataCallName = KNullDesC;
+    TInt errorCode( KErrNone );
+
+    if ( CallIdCheck::IsVideo( aCallId ) )
+        {
+        RMobileCall::TMobileCallInfoV3* dataCallInfo = NULL;
+        dataCallInfo = new RMobileCall::TMobileCallInfoV3;
+        
+        if ( dataCallInfo )
+            {
+            errorCode = GetCallInfo( *dataCallInfo, aCallId );
+            TEFLOGSTRING2( KTAINT, 
+                "CALL CPEVideoCallHandling::DataCallName > GetCallInfo, error code: %d", 
+                errorCode );
+ 
+            if ( errorCode == KErrNone )
+                {
+                iDataCallName = dataCallInfo->iCallName;
+                }
+            }
+        else
+            {
+            errorCode = KErrNoMemory;
+            TEFLOGSTRING( KTAINT, 
+                "CALL CPEVideoCallHandling::DataCallName, error code = KErrNoMemory" );
+            }
+        delete dataCallInfo;
+        }
+    return iDataCallName;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::GetCallInfo
+// Returns data call information.
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::GetCallInfo( 
+        RMobileCall::TMobileCallInfoV3& aCallInfo,
+        TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPEVideoCallHandling::GetCallInfo %d", aCallId );
+    CPESingleCall* videoCall( NULL );
+    TInt errorCode( KErrNotFound );
+    videoCall = iCallArrayOwner.GetCallObject( aCallId );
+    if ( videoCall && CallIdCheck::IsVideo( aCallId ) )
+        {
+        errorCode = videoCall->GetCallInfo( aCallInfo );
+        errorCode = KErrNone;
+        }
+    else
+        {
+        __ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) );
+        }
+    return errorCode;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::SendErrorMessage
+// Reroutes error code to Call Handling interface.
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::SendErrorMessage(
+    const TInt aCallId,
+    const TInt aErrorCode )
+    {
+    TEFLOGSTRING3( KTAINT, 
+        "CALL CPEVideoCallHandling::SendErrorMessage, error code: %d, error cause: %d, call id: %d", 
+        aErrorCode, 
+        aCallId );
+    iOwner.SendErrorMessage( aCallId, aErrorCode );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::HandleInternalMessage
+// Reroutes messages to the Phone Engine
+// -----------------------------------------------------------------------------
+//
+void CPEVideoCallHandling::HandleInternalMessage( TInt aMessage )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPEVideoCallHandling::HandleInternalMessage, message: %d", aMessage );
+    iOwner.HandleInternalMessage( aMessage );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::ConnectedCalls
+// Indicates if there are any connected calls.
+// -----------------------------------------------------------------------------
+//
+TBool CPEVideoCallHandling::ConnectedCalls()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::ConnectedCalls" );
+    TBool returnValue( EFalse );
+    if( VideoCallByState( EPEStateConnected ) )
+        {
+        returnValue = ETrue;
+        }
+    return returnValue ;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::RejectCall
+// Rejects the incoming call.
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::RejectCall()
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::RejectCall" );
+    TInt errorCode( KErrNotFound );
+    
+    CPESingleCall* videoCall = VideoCallByState( EPEStateRinging );
+    if( videoCall )
+        {
+        videoCall->HangUp();
+        errorCode = KErrNone;
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::ReleaseAll
+// Releases all ongoing calls.
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::ReleaseAll()
+    {
+    CPESingleCall* callData;
+    TInt errorCode( KErrNotFound );
+    TPEState callState;
+    
+    TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::ReleaseAll " );
+    
+    for ( TInt callId = KPEDataCallIdBase; 
+          callId < ( KPEDataCallIdBase + KPEMaximumNumberOfDataCalls ); 
+          callId++ )
+        {
+        callData = iCallArrayOwner.GetCallObject( callId );
+        if ( callData )
+            {
+            callState = callData->GetCallState();
+            if ( callState != EPEStateIdle && callState != EPEStateRinging )
+                {
+                TEFLOGSTRING2( KTAINT, 
+                    "CALL CPEVideoCallHandling::ReleaseAll, call id: %d", 
+                    callId );
+                HangUp( callId );
+                errorCode = KErrNone;
+                }
+            }
+        }
+        
+    TEFLOGSTRING2( KTAINT, 
+        "CALL CPEVideoCallHandling::ReleaseAll, error code: %d", 
+        errorCode );
+            
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::TerminateAllConnections
+// Terminates all ringing data calls, connected data calls and packet data
+// connections.
+// -----------------------------------------------------------------------------
+//
+TInt CPEVideoCallHandling::TerminateAllConnections()
+    {
+    TEFLOGSTRING( KTAMESINT, 
+        "CALL CPEVideoCallHandling::TerminateAllConnections");    
+    // Terminate GPRS connection.
+    // If GPRS connections are being terminated, 
+    // then we do not start again.
+    TBool canBeDeleted = ETrue;
+    if ( iGprsInterface )
+        {
+        canBeDeleted = !iGprsInterface->IsTerminating();
+        }
+
+    TInt error( KErrNone );
+    if ( canBeDeleted )
+        {
+        delete iGprsInterface;
+        iGprsInterface = NULL;
+        TRAP( error,
+            iGprsInterface = new (ELeave) CPEGprsTermination;
+            iGprsInterface->StartL() );
+        }
+    // Hangup Data calls
+    ReleaseAll();
+    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEVideoCallHandling::GetCallDuration
+// Returns voice and conference (master call) call duration.
+// Method checks that call id is valid number and gets
+// call duration from conference or data call object or from
+// calls base class for voice call duration.
+// -----------------------------------------------------------------------------
+//
+ TInt CPEVideoCallHandling::GetCallDuration( 
+         TTimeIntervalSeconds& aDuration, 
+         TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "CALL CPEVideoCallHandling::GetCallDuration %d", aCallId ); 
+    TInt errorCode( KErrNotFound );
+    CPESingleCall* callData( NULL );
+    callData = iCallArrayOwner.GetCallObject( aCallId );
+    
+    if ( callData && CallIdCheck::IsVideo( aCallId ) )
+        {
+        callData->GetCallDuration( aDuration );
+        errorCode = KErrNone;
+        }
+    else
+        {
+        __ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand) );
+        }
+
+    return errorCode;
+    }
+ 
+ // -----------------------------------------------------------------------------
+ // CPEVideoCallHandling::ReleaseCallObject
+ // -----------------------------------------------------------------------------
+ //
+ TInt CPEVideoCallHandling::ReleaseCallObject( const TInt aCallId  )
+     {
+     TInt error(KErrNone);
+     TEFLOGSTRING2( KTAINT, 
+             "CALL CPEVideoCallHandling::ReleaseCallObject ReleaseCallObject %d", aCallId );
+     error = iCallArrayOwner.DeleteCallObject( aCallId );
+     // Reset datastore to prevent invalid usage in next call
+     TEFLOGSTRING( KTAINT, "CALL CPEVideoCallHandling::ReleaseCallObject, Reset CallInfo" );
+     iModel.DataStore()->ResetCallInfo( aCallId );
+     return error;
+     }
+ 
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/pecallhandlingpanic.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of PECallHandlingPanic function
+
+*
+*/
+
+
+// INCLUDE FILES
+#include <pepanic.pan>
+#include "e32std.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None. 
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+// None
+
+// -----------------------------------------------------------------------------
+// Panic
+// Creates call handling panic
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+GLDEF_C void Panic
+        ( 
+        TPEPanic aPanic 
+        )
+    {
+    _LIT( KPanicCategoryCallHandling, "CallHandling" );
+    User::Panic( KPanicCategoryCallHandling(), aPanic );
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+// None.
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/bwins/contacthandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,11 @@
+EXPORTS
+	??1CPEContactHandlingProxy@@UAE@XZ @ 1 NONAME ; CPEContactHandlingProxy::~CPEContactHandlingProxy(void)
+	?CreateFirstPhaseL@CPEContactHandlingProxy@@SAPAVMPEContactHandling@@XZ @ 2 NONAME ; class MPEContactHandling * CPEContactHandlingProxy::CreateFirstPhaseL(void)
+	?CreateSecondPhaseL@CPEContactHandlingProxy@@QAEXAAVMPEPhoneModelInternal@@AAVRFs@@@Z @ 3 NONAME ; void CPEContactHandlingProxy::CreateSecondPhaseL(class MPEPhoneModelInternal &, class RFs &)
+	?FindContactInfoSync@CPEContactHandlingDummy@@UAEHHW4TPEFindContactKey@@@Z @ 4 NONAME ; int CPEContactHandlingDummy::FindContactInfoSync(int, enum TPEFindContactKey)
+	?FindContactInfoSync@CPEContactHandlingProxy@@UAEHHW4TPEFindContactKey@@@Z @ 5 NONAME ; int CPEContactHandlingProxy::FindContactInfoSync(int, enum TPEFindContactKey)
+	?GetSpeedDialLocation@CPEContactHandlingDummy@@UAEHHAAV?$TBuf@$0GE@@@@Z @ 6 NONAME ; int CPEContactHandlingDummy::GetSpeedDialLocation(int, class TBuf<100> &)
+	?GetSpeedDialLocation@CPEContactHandlingProxy@@UAEHHAAV?$TBuf@$0GE@@@@Z @ 7 NONAME ; int CPEContactHandlingProxy::GetSpeedDialLocation(int, class TBuf<100> &)
+	?NewL@CPEContactHandlingDummy@@SAPAV1@XZ @ 8 NONAME ; class CPEContactHandlingDummy * CPEContactHandlingDummy::NewL(void)
+	?NewL@CPEContactMatch@@SAPAV1@AAVCPEContactHandling@@AAVMPEDataStore@@@Z @ 9 NONAME ; class CPEContactMatch * CPEContactMatch::NewL(class CPEContactHandling &, class MPEDataStore &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/data/contacthandling_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing contact handling dll.
+;
+; contacthandling_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"contacthandling"},(0x1000A836),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\contacthandling.dll"
\ No newline at end of file
Binary file phoneengine/contacthandling2/data/contacthandling_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/eabi/contacthandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,21 @@
+EXPORTS
+	_ZN23CPEContactHandlingDummy19FindContactInfoSyncEi17TPEFindContactKey @ 1 NONAME
+	_ZN23CPEContactHandlingDummy20GetSpeedDialLocationEiR4TBufILi100EE @ 2 NONAME
+	_ZN23CPEContactHandlingDummy4NewLEv @ 3 NONAME
+	_ZN23CPEContactHandlingProxy17CreateFirstPhaseLEv @ 4 NONAME
+	_ZN23CPEContactHandlingProxy18CreateSecondPhaseLER21MPEPhoneModelInternalR3RFs @ 5 NONAME
+	_ZN23CPEContactHandlingProxy19FindContactInfoSyncEi17TPEFindContactKey @ 6 NONAME
+	_ZN23CPEContactHandlingProxy20GetSpeedDialLocationEiR4TBufILi100EE @ 7 NONAME
+	_ZTI15CPEContactMatch @ 8 NONAME ; #<TI>#
+	_ZTI18CPEContactHandling @ 9 NONAME ; #<TI>#
+	_ZTI23CPEContactHandlingDummy @ 10 NONAME ; #<TI>#
+	_ZTI23CPEContactHandlingProxy @ 11 NONAME ; #<TI>#
+	_ZTV15CPEContactMatch @ 12 NONAME ; #<VT>#
+	_ZTV18CPEContactHandling @ 13 NONAME ; #<VT>#
+	_ZTV23CPEContactHandlingDummy @ 14 NONAME ; #<VT>#
+	_ZTV23CPEContactHandlingProxy @ 15 NONAME ; #<VT>#
+	_ZThn4_N23CPEContactHandlingDummy19FindContactInfoSyncEi17TPEFindContactKey @ 16 NONAME ; #<thunk>#
+	_ZThn4_N23CPEContactHandlingDummy20GetSpeedDialLocationEiR4TBufILi100EE @ 17 NONAME ; #<thunk>#
+	_ZThn4_N23CPEContactHandlingProxy19FindContactInfoSyncEi17TPEFindContactKey @ 18 NONAME ; #<thunk>#
+	_ZThn4_N23CPEContactHandlingProxy20GetSpeedDialLocationEiR4TBufILi100EE @ 19 NONAME ; #<thunk>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ContanctHandling bld file
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/cpecontacthandlingproxy.h |../../inc/cpecontacthandlingproxy.h
+../inc/mpecontacthandling.h      |../../inc/mpecontacthandling.h
+
+// SIS stubs
+../data/contacthandling_stub.sis    /epoc32/data/z/system/install/contacthandling_stub.sis
+ 
+PRJ_MMPFILES
+contacthandling.mmp
+
+#endif // RD_PHONE_NG
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/group/contacthandling.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for Contact Handling dll
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+TARGET          contacthandling.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x1000A836    
+VENDORID        VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+
+SYSTEMINCLUDE   ../../inc          // PhoneEngine private headers
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+SYSTEMINCLUDE   /epoc32/include/connect
+
+SOURCEPATH      ../src
+
+SOURCE          cpecontacthandling.cpp
+SOURCE          cpecontacthandlingdummy.cpp
+SOURCE          cpecontacthandlingproxy.cpp
+SOURCE          cpecontactmatch.cpp
+SOURCE          pecontacthandlingpanic.cpp
+
+USERINCLUDE     ../inc
+
+
+LIBRARY         efsrv.lib // For reading picture.
+LIBRARY         euser.lib
+LIBRARY         featmgr.lib // Feature manager. 
+LIBRARY         flogger.lib // For logging.
+LIBRARY         phonecntfinder.lib
+
+LANG            SC
+
+START WINS
+BASEADDRESS 0x10040000
+END
+
+#endif // RD_PHONE_NG
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/inc/cpecontacthandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the
+*              : CPEContactHandling class.
+*
+*/
+
+
+#ifndef CPECONTACTHANDLING_H
+#define CPECONTACTHANDLING_H
+
+//  INCLUDES
+#include "mpecontacthandling.h"
+#include <e32base.h>
+#include <cntdef.h> // TContactItemId
+#include <pevirtualengine.h>
+
+// CONSTANTS
+//None
+
+// MACROS
+//None
+
+// DATA TYPES
+//None.
+
+// FUNCTION PROTOTYPES
+//None
+
+// FORWARD DECLARATIONS
+class CContactGroup;
+class CContactItemFieldDef;
+class MPEPhoneModelInternal;
+class CPEContactMatch;
+
+// CLASS DECLARATION
+
+/**
+*  Interface class for phone engine to fetch remote info from contact database or SIM
+*
+*  @lib ContactHandling.lib
+*  @since Series60_4.0
+*/
+class CPEContactHandling
+        : public CBase,
+          public MPEContactHandling
+    {
+    public:  // Constructors and destructor
+      
+        /**
+        * Two-phased constructor.
+        */
+        static CPEContactHandling* NewL( MPEPhoneModelInternal& aModel, 
+                                              RFs& aFsSession );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPEContactHandling();
+
+    public: // New functions
+        
+        /**
+        * Synchronous method for searching contact information. This function call's FindContactInfoSyncL()
+        * which can leave. This function call is Trapped so API function does not leave.
+        * @param aCallId        call id from phone engine
+        * @param aFindKey       defines the key to search the contact data with
+        * @return Error code indicating the success of the search
+        */
+        TInt FindContactInfoSync( 
+            const TInt aCallId,
+            const TPEFindContactKey aFindKey );
+
+        /**
+        * Reroutes errorCodes to the Phone Model
+        * @param aErrorCode is the errorCode
+        * @return None.
+        */
+        void SendErrorMessage( TInt aErrorCode );
+
+        /**
+        * Reroutes messages to the Phone Model
+        * @param aMessage is the message id
+        * @param aCallId identifies the call this event is associated to
+        */
+        void SendMessage( MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+                          const TInt aCallId = KPECallIdNotUsed );
+        
+        /**
+        * Fetch number from speed dial location
+        * @param aLocationIndex Index to look for
+        * @param aNumber Filled with speed dial location phone number
+        * @return Error code.
+        */
+        TInt GetSpeedDialLocation( 
+            TInt aLocationIndex, 
+            TPEPhoneNumber& aNumber );
+
+   protected:  // New functions
+        
+        /**
+        * C++ default constructor.
+        */
+        CPEContactHandling( MPEPhoneModelInternal& aModel, 
+                        RFs& aFsSession );
+
+    private:
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+
+        /**
+        * Synchronous method for searching contact information
+        * @param aCallId        call id from phone engine
+        * @param aFindKey       defines the key to search the contact data with
+        */
+
+        void FindContactInfoSyncL(
+            const TInt aCallId, 
+            const TPEFindContactKey aFindKey );
+
+        /**
+        * Synchronous method for searching contact information from Contactdb
+        * @param aFindKey       defines the key to search the contact data with
+        * @return None
+        */
+        void FindContactInfoSyncFromContactDbL(
+            const TInt aCallId, 
+            const TPEFindContactKey aFindKey ) const;
+
+    private:    // Data
+        // Reference to MPEPhoneModelInternal , also object owner
+        MPEPhoneModelInternal&          iModel;
+        // ContactMatcher
+        CPEContactMatch*                iContactMatcher;
+        // handle to a file server session
+        RFs& iFsSession;
+        
+    };
+
+#endif      // CPECONTACTHANDLING_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/inc/cpecontacthandlingdummy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the
+*              : CPEContactHandlingDummy class.
+*
+*/
+
+
+#ifndef CPECONTACTHANDLINGDUMMY_H
+#define CPECONTACTHANDLINGDUMMY_H
+
+//  INCLUDES
+#include "mpecontacthandling.h"
+#include <e32base.h>
+#include <mpephonemodelinternal.h>
+
+// CLASS DECLARATION
+
+/**
+*  Dummy interface to substitute real contact handling subject when neccessary
+*
+*  @lib ContactHandling.lib
+*  @since Series60_4.0
+*/
+class CPEContactHandlingDummy
+        : public CBase,
+          public MPEContactHandling
+    {
+    public:  // Constructors and destructor
+      
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPEContactHandlingDummy* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPEContactHandlingDummy();
+
+    public: // New functions
+        
+        /**
+        * Synchronous method for searching contact information. This function call's FindContactInfoSyncL()
+        * which can leave. This function call is Trapped so API funktion dosn't leave.
+        * @param aCallId        call id from phone engine
+        *        aFindKey       defines the key to search the contact data with
+        *        aSearchFrom    search from key
+        * @return Error code indicating the success of the search
+        */
+        TInt FindContactInfoSync( 
+                    TInt aCallId,
+                    TPEFindContactKey aFindKey );
+
+        /**
+        * Reroutes errorCodes to the Phone Model
+        * @param aErrorCode is the errorCode
+        * @return None.
+        */
+        void SendErrorMessage( TInt aErrorCode );
+
+        /**
+        * Reroutes messages to the Phone Model
+        * @param aMessage is the message id
+        * @return None.
+        */
+        void SendMessage( MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+        
+        /**
+        * Fetch number from speed dial location
+        * @param aLocationIndex Index to look for
+        * @param aNumber Filled with speed dial location phone number
+        * @return Error code.
+        */
+        TInt GetSpeedDialLocation( 
+            TInt aLocationIndex, 
+            TPEPhoneNumber& aNumber );
+
+   protected:  // New functions
+        /**
+        * C++ default constructor.
+        */
+        CPEContactHandlingDummy();
+
+    };
+
+#endif      // CPECONTACTHANDLINGDUMMY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/inc/cpecontacthandlingproxy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the
+*              : CPEContactHandlingProxy class.
+*
+*/
+
+
+
+#ifndef CPECONTACTHANDLINGPROXY_H
+#define CPECONTACTHANDLINGPROXY_H
+
+//  INCLUDES
+#include "mpecontacthandling.h"
+#include <e32base.h>
+#include <mpephonemodelinternal.h>
+
+// CLASS DECLARATION
+
+/**
+*  This proxy class provides for the access to contact information services.
+*  The construction of contact handling component is two-fold:
+*  1) CreateFirstPhaseL() creates the proxy object along with cnt handling dummy
+*  2) CreateSecondPhaseL() creates the real subject with capability to utilize
+*     contact database.
+*
+*  @lib ContactHandling.lib
+*  @since Series60_4.0
+*/
+class CPEContactHandlingProxy
+        : public CBase,
+          public MPEContactHandling
+    {
+    public:
+        /**
+        * Create contact handling proxy and dummy implementation
+        * @return pointer to log handling proxy object, i.e. the handle to
+        * access log handling services
+        */
+        IMPORT_C static MPEContactHandling* CreateFirstPhaseL();
+
+        /**
+        * Create contact handling sub system
+        * This method creates the actual log handling implementation which
+        * replaces the dummy component in use. The phone model should call this
+        * function as all the critical sub systems already enable emergency call
+        * capabilities.
+        * @param aModel, handle to the owner of this object and phone engine
+        * @param aFsSession, handle to the shared file server session
+        */
+        IMPORT_C void CreateSecondPhaseL( 
+            MPEPhoneModelInternal& aModel, 
+            RFs& aFsSession );
+      
+        /**
+        * Destructor.
+        */
+        IMPORT_C virtual ~CPEContactHandlingProxy();
+
+    public:
+        /**
+        * Synchronous method for searching contact information.
+        * @param aCallId        call id from phone engine
+        *        aFindKey       defines the key to search the contact data with
+        *        aSearchFrom    search from key
+        * @return possible Symbian OS error code
+        */
+        IMPORT_C TInt FindContactInfoSync( 
+            const TInt aCallId,
+            const TPEFindContactKey aFindKey );
+
+        /**
+        * Fetch number from speed dial location
+        * @param aLocationIndex Index to look for
+        * @param aNumber Filled with speed dial location phone number
+        * @param aContactItemId Contact item id. KErrNotFound if given location
+        *                                        was not set.
+        * @return possible Symbian OS error code
+        */
+        IMPORT_C TInt GetSpeedDialLocation( 
+            TInt aLocationIndex, 
+            TPEPhoneNumber& aNumber );
+
+    protected:
+        /**
+        * C++ default constructor.
+        */
+        CPEContactHandlingProxy();
+
+        /**
+        * Constructor, second phase. 
+        */
+        void ConstructL();
+
+
+    private:    // Data
+        // Handle to contact handling implementation
+        MPEContactHandling* iContactHandling;
+        // Handle to contact handling dummy implementation
+        MPEContactHandling* iContactHandlingDummy;
+    };
+
+#endif      // CPECONTACTHANDLINGPROXY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/inc/cpecontactmatch.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contact match class
+*
+*/
+
+#ifndef CPECONTACTMATCH_H
+#define CPECONTACTMATCH_H
+
+// INCLUDES
+#include <cntdef.h>
+#include <e32base.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// Number of languages that use lastname-firstname order
+const TInt KPENumberOfSwappedLanguages = 7;
+
+// Languages which use lastname-firstname order
+const TLanguage KPESwappedLanguages[ KPENumberOfSwappedLanguages ] = 
+    {
+    ELangHungarian,       // 17
+    ELangTaiwanChinese,   // 29
+    ELangHongKongChinese, // 30
+    ELangPrcChinese,      // 31
+    ELangJapanese,        // 32
+    ELangKorean,          // 65
+    ELangVietnamese       // 96
+    };
+
+// FORWARD DECLARATIONS
+class CPEContactHandling;
+class CPhCntContactId;
+class CPhCntFactory;
+class MPEDataStore;
+class MPhCntMatch;
+class CPhCntMatcher;
+class MPESimContactMatch;
+
+// CLASS DECLARATION
+
+/**
+*  Container for all Contact Handling owned instances of Phone Contact Finder
+*/
+class CPEContactMatch
+    : public CBase
+    {
+    public:  // Constructors and destructor      
+
+        /**
+        * Two-phased constructor.
+        * @param aOwner, handle to contact handling interface / owner of this class
+        * @param aDataStore, handle to internal engine info interface
+        * @return an instance of class CPEContactMatch
+        */
+        IMPORT_C static CPEContactMatch* NewL(
+            CPEContactHandling& aOwner,
+            MPEDataStore& aDataStore );
+        
+        /**
+        * Destructor.
+        */
+        ~CPEContactMatch();
+
+    public: // New functions
+
+        /**
+        * Synchronous method for finding contact data specified with aContactId
+        * @param aCallId, the call this contact is associated with
+        * @return None
+        */
+        void MatchWithContactIdL( const TInt aCallId ); 
+
+        /**
+        * Search contact information synchronously matching with aPhoneNumber
+        * @param aCallId, the call this contact is associated with
+        * @return None (leaves with KErrNotFound if no match found or db in use)
+        */
+        void MatchWithNumberL( const TInt aCallId );
+
+        /**
+        * Returns contact picture data and call id association
+        * NOTE! Ownership of the picture is transfered to caller.
+        * @return contact thumbnail, equals NULL if not found
+        */
+        CFbsBitmap* ContactThumbnail();
+
+        /**
+        * Fetch number from speed dial location
+        * @param aLocationIndex Index to look for
+        * @param aNumber Filled with speed dial location phone number
+        */
+        void GetSpeedDialLocationL( 
+            TInt aLocationIndex, 
+            TPEPhoneNumber& aNumber );
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPEContactMatch(
+            CPEContactHandling& aOwner,
+            MPEDataStore& aDataStore );
+        
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Copies contact information to remote info struct
+        * @param aMatch a contact item 
+        * @param aCallId, the call this contact is associated with
+        */
+        void CopyContactFieldsDataL(
+            const MPhCntMatch& aMatch,
+            const TInt aCallId );
+
+
+        /**
+         * Creates contact id.
+         */
+        CPhCntContactId* CreateContactIdL( const TDesC8& aContactId );
+
+        /**
+         * Creates contact id.
+         */
+        CPhCntContactId* CreateContactIdL( TContactItemId aContactId );
+
+        /**
+        * Starts loading thumbnail image
+        * @param aContactId contact item with the desired thumbnail
+        * @param aCallId call id for identifying which thumbnail is loaded
+        * @return Symbian OS error code
+        */
+        TInt LoadThumbnail( const CPhCntContactId& aContactId, const TInt aCallId );
+
+  
+
+    private:    // Data
+
+        // Handle to contact handling interface / owner of this class
+        CPEContactHandling& iOwner;
+
+        // Handle to internal engine info interface
+        MPEDataStore& iDataStore;
+
+        // Owned: library
+        RLibrary iLibrary;
+
+        // Owned: contact factory
+        CPhCntFactory* iContactFactory;
+
+        // Owned: contact matcher
+        CPhCntMatcher* iContactMatcher;
+
+        // Owned: sim contact matcher
+        MPESimContactMatch* iSimContactMatcher;
+
+
+    };
+
+#endif // CPECONTACTMATCH_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/inc/mpecontacthandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the MPEContactHandling class.
+*
+*/
+
+
+#ifndef MPECONTACTHANDLING_H
+#define MPECONTACTHANDLING_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <pevirtualengine.h>
+
+// CLASS DECLARATION
+
+/**
+*  Interface class provides for the access to contact information services.
+*
+*  @lib ContactHandling.lib
+*  @since Series60_4.0
+*/
+class MPEContactHandling
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        virtual ~MPEContactHandling(){};
+
+        /**
+        * Synchronous method for searching contact information.
+        * @param aCallId        call id from phone engine
+        *        aFindKey       defines the key to search the contact data with
+        *        aSearchFrom    search from key
+        * @return possible Symbian OS error code
+        */
+        virtual TInt FindContactInfoSync( 
+            const TInt aCallId,
+            const TPEFindContactKey aFindKey ) = 0;
+
+        /**
+        * Fetch number from speed dial location
+        * @param aLocationIndex Index to look for
+        * @param aNumber Filled with speed dial location phone number
+        * @param aContactItemId Contact item id. KErrNotFound if given location
+        *                                        was not set.
+        * @return possible Symbian OS error code
+        */
+        virtual TInt GetSpeedDialLocation( 
+            TInt aLocationIndex, 
+            TPEPhoneNumber& aNumber ) = 0;
+    };
+
+#endif      // MPECONTACTHANDLING_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/src/cpecontacthandling.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,230 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEContactHandling class
+*
+*/
+
+//  INCLUDE FILES
+#include "cpecontacthandling.h"
+#include "cpecontactmatch.h"
+#include <mpedatastore.h>
+#include <e32std.h>
+#include <mpephonemodelinternal.h>
+#include <pepanic.pan>
+#include <barsc.h> 
+#include <barsread.h>
+#include <talogger.h>
+#include <bldvariant.hrh>
+#include <featmgr.h>
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::CPEContactHandling
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEContactHandling::CPEContactHandling
+        ( 
+        MPEPhoneModelInternal& aModel,
+        RFs& aFsSession
+        ) : iModel( aModel ),
+            iFsSession( aFsSession )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEContactHandling::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactHandling::ConstructL > CPEContactMatch::NewL" );
+    iContactMatcher = CPEContactMatch::NewL( *this, *iModel.DataStore() );  
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEContactHandling* CPEContactHandling::NewL
+        ( 
+        MPEPhoneModelInternal& aModel,  // Phone Model
+        RFs& aFsSession
+        )
+    {
+    TEFLOGSTRING(KTAOBJECT, "CNT CPEContactHandling::NewL start.");
+    CPEContactHandling* self = new ( ELeave ) CPEContactHandling( aModel, aFsSession );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING(KTAOBJECT, "CNT CPEContactHandling::NewL Complete.");
+    return self;
+    }
+
+// Destructor
+CPEContactHandling::~CPEContactHandling
+        (
+        // None.
+        )
+    {
+    delete iContactMatcher;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::FindContactInfoSyncL
+// Synchronous method for searching contact information with the key defined
+//
+// Supported synchronous searching keys are searching with phone number,
+// name, contact id and voice tag (actually uses contact id)
+// -----------------------------------------------------------------------------
+//
+void CPEContactHandling::FindContactInfoSyncL
+        ( 
+        TInt aCallId,             // call id from phone engine
+        TPEFindContactKey aFindKey     // search key
+        )     
+    {
+    TPEPhoneNumber line1 = iModel.DataStore()->VoiceMailBoxNumberLine1();
+    TPEPhoneNumber line2 = iModel.DataStore()->VoiceMailBoxNumberLine2();
+    TPEPhoneNumber remoteNumber = iModel.DataStore()->RemotePhoneNumber( aCallId );
+    
+    if( remoteNumber.Length() < 3 ) //according to UI spec numbers less than 3 digits are not matched.
+        {
+        return;
+        }
+
+    if ( remoteNumber == line1 )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactHandling::FindContactInfoSyncL, number matched to vmbx line 1" );
+        iModel.DataStore()->SetRemotePhoneNumberType( EPEVmbxNumberLine1, aCallId );
+        }
+    else if ( remoteNumber == line2 )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactHandling::FindContactInfoSyncL, number matched to vmbx line 2" );
+        iModel.DataStore()->SetRemotePhoneNumberType( EPEVmbxNumberLine2, aCallId );
+        }
+    else // If number was not voicemailboxnumber, check number from contacts.
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactHandling::FindContactInfoSyncL, number did not match vmbx" );
+        FindContactInfoSyncFromContactDbL( aCallId, aFindKey );
+        }
+    }
+// -----------------------------------------------------------------------------
+// CPEContactHandling::FindContactInfoSync
+// Calls method FindContactInfoSyncL which can leave. This leave is trapped in 
+// this function.
+// -----------------------------------------------------------------------------
+//
+TInt CPEContactHandling::FindContactInfoSync
+        ( 
+        const TInt aCallId,
+        const TPEFindContactKey aFindKey
+        )     
+    {
+    TRAPD( error, FindContactInfoSyncL( aCallId, aFindKey ) );
+    TEFLOGSTRING2( KTAMESOUT, "CNT CPEContactHandling::FindContactInfoSync, error code: %d", error );
+    return (error);
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::SendErrorMessage
+// Method reroutes error messages to the CPhoneModel object
+// -----------------------------------------------------------------------------
+//
+void CPEContactHandling::SendErrorMessage
+        ( 
+        TInt aErrorCode 
+        )
+    {
+    iModel.DataStore()->SetErrorCode( aErrorCode );
+    iModel.SendMessage( MEngineMonitor::EPEMessageContactHandlingError );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::SendMessage
+// Method reroutes error messages to the CPhoneModel object
+// -----------------------------------------------------------------------------
+//
+void CPEContactHandling::SendMessage
+        (
+        MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        const TInt aCallId
+        )
+    {
+    if ( aMessage == MEngineMonitor::EPEMessageThumbnailLoadingCompleted )
+        {
+        CFbsBitmap* thumbnailData = iContactMatcher->ContactThumbnail();
+        if ( thumbnailData )
+            {
+            iModel.DataStore()->SetCallerThumbnail( thumbnailData, aCallId );
+            }
+        }
+
+    iModel.SendMessage( aMessage, aCallId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::FindContactInfoSyncFromContactDb
+// Synchronous method for searching contact information from
+// contact database with the key defined.
+//
+// Supported synchronous searching keys are searching with phone number and
+// contact id.
+// -----------------------------------------------------------------------------
+//
+void CPEContactHandling::FindContactInfoSyncFromContactDbL
+        (
+        const TInt aCallId,
+        const TPEFindContactKey aFindKey
+        ) const
+    {
+    ASSERT( iContactMatcher );
+
+    // Check validity of the search key
+    switch ( aFindKey )
+        {
+        case EPEFindWithPhoneNumber:
+            iContactMatcher->MatchWithNumberL( aCallId );
+            break;
+        case EPEFindWithContactId:
+            iContactMatcher->MatchWithContactIdL( aCallId );
+            break;
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandling::GetSpeedDialLocation
+// Get's phone number and contact id from given location.
+// -----------------------------------------------------------------------------
+//
+TInt CPEContactHandling::GetSpeedDialLocation( 
+    TInt aLocationIndex, 
+    TPEPhoneNumber& aNumber )
+    {
+    TInt error = KErrLocked;
+    ASSERT( iContactMatcher );
+    TRAP( error, iContactMatcher->GetSpeedDialLocationL( aLocationIndex, 
+                                                        aNumber ) );
+    return error;
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/src/cpecontacthandlingdummy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEContactHandlingDummy class
+*
+*/
+
+
+//  INCLUDE FILES
+#include "cpecontacthandlingdummy.h"
+#include "cpecontactmatch.h"
+#include <mpedatastore.h>
+#include <e32std.h>
+#include <mpephonemodelinternal.h>
+#include <pepanic.pan>
+#include <barsc.h> 
+#include <barsread.h>
+#include <talogger.h>
+#include <bldvariant.hrh>
+#include <featmgr.h>
+
+// ================= MEMBER FUNCTIONS =======================================
+// -----------------------------------------------------------------------------
+// CPEContactHandlingDummy::CPEContactHandlingDummy
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEContactHandlingDummy::CPEContactHandlingDummy()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingDummy::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPEContactHandlingDummy* CPEContactHandlingDummy::NewL()
+    {
+    TEFLOGSTRING(KTAOBJECT, "CNT CPEContactHandlingDummy::NewL start.");
+    CPEContactHandlingDummy* self = new ( ELeave ) CPEContactHandlingDummy();
+    TEFLOGSTRING(KTAOBJECT, "CNT CPEContactHandlingDummy::NewL Complete.");
+    return self;
+    }
+
+// Destructor
+CPEContactHandlingDummy::~CPEContactHandlingDummy()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactHandlingDummy::~CPEContactHandlingDummy()" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingDummy::FindContactInfoSync
+// Calls method FindContactInfoSyncL which can leave. This leave is trapped in 
+// this function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEContactHandlingDummy::FindContactInfoSync( 
+    const TInt /*aCallId*/, const TPEFindContactKey /*aFindKey*/ )     
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactHandlingDummy::FindContactInfoSync()" );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingDummy::GetSpeedDialLocation
+// Get's phone number and contact id from given location.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEContactHandlingDummy::GetSpeedDialLocation( 
+    TInt /*aLocationIndex*/, 
+    TPEPhoneNumber& /*aNumber*/ )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactHandlingDummy::GetSpeedDialLocation()" );
+    return KErrNone;
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/src/cpecontacthandlingproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEContactHandlingProxy class
+*
+*/
+
+//  INCLUDE FILES
+#include "cpecontacthandling.h"
+#include "cpecontacthandlingproxy.h"
+#include "cpecontacthandlingdummy.h"
+#include "cpecontactmatch.h"
+#include <mpedatastore.h>
+#include <e32std.h>
+#include <mpephonemodelinternal.h>
+#include <pepanic.pan>
+#include <barsc.h> 
+#include <barsread.h>
+#include <talogger.h>
+#include <bldvariant.hrh>
+#include <featmgr.h>
+
+// ================= MEMBER FUNCTIONS =======================================
+// -----------------------------------------------------------------------------
+// CPEContactHandlingProxy::CreateFirstPhaseL
+// This method creates the contact handling proxy and dummy implementation
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPEContactHandling* CPEContactHandlingProxy::CreateFirstPhaseL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactHandlingProxy::CreateFirstPhaseL start." );
+    CPEContactHandlingProxy* self = new ( ELeave ) CPEContactHandlingProxy();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactHandlingProxy::CreateFirstPhaseL Complete." );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingProxy::CreateSecondPhaseL
+// This method creates the actual contact handling implementation
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPEContactHandlingProxy::CreateSecondPhaseL(
+        MPEPhoneModelInternal& aModel,
+        RFs& aFsSession
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::CreateSecondPhaseL start." );
+    iContactHandling = CPEContactHandling::NewL( aModel, aFsSession );
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::CreateSecondPhaseL complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingProxy::CPEContactHandlingProxy
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEContactHandlingProxy::CPEContactHandlingProxy()
+        {
+        }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingProxy::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEContactHandlingProxy::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPEContactHandlingProxy::ConstructL" );
+    // Create an instance of the log handling dummy implementation
+    iContactHandlingDummy = CPEContactHandlingDummy::NewL();  
+    }
+
+// Destructor
+CPEContactHandlingProxy::~CPEContactHandlingProxy()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::~CPEContactHandlingProxy" );
+    delete iContactHandling;
+    delete iContactHandlingDummy;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingProxy::FindContactInfoSync
+// Calls method FindContactInfoSyncL which can leave. This leave is trapped in 
+// this function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEContactHandlingProxy::FindContactInfoSync
+        ( 
+        const TInt aCallId,
+        const TPEFindContactKey aFindKey
+        )     
+    {
+    if ( iContactHandling )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactHandlingProxy::FindContactInfoSync > CPEContactHandling::FindContactInfoSync" );
+        return iContactHandling->FindContactInfoSync( aCallId, aFindKey );
+        }
+    else if ( iContactHandlingDummy )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactHandlingProxy::FindContactInfoSync > CPEContactHandlingDummy::FindContactInfoSync" );
+        return iContactHandlingDummy->FindContactInfoSync( aCallId, aFindKey );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "CNT CPECONTACTHANDLINGPROXY::FINDCONTACTINFOSYNC ! NEITHER CONTACT HANDLING NOR CONTACT HANDLING DUMMY EXISTS" );
+        User::Invariant();
+        }
+    return KErrBadHandle;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactHandlingProxy::GetSpeedDialLocation
+// Get's phone number and contact id from given location.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPEContactHandlingProxy::GetSpeedDialLocation( 
+    TInt aLocationIndex, 
+    TPEPhoneNumber& aNumber )
+    {
+    if ( iContactHandling )
+        {
+        TEFLOGSTRING( 
+            KTAINT, 
+            "CNT CPEContactHandlingProxy::GetSpeedDialLocation > CPEContactHandling::GetSpeedDialLocation" );
+        return iContactHandling->GetSpeedDialLocation( aLocationIndex, aNumber );
+        }
+    else if ( iContactHandlingDummy )
+        {
+        TEFLOGSTRING( 
+            KTAINT, 
+            "CNT CPEContactHandlingProxy::GetSpeedDialLocation > CPEContactHandlingDummy::GetSpeedDialLocation" );
+        return iContactHandlingDummy->GetSpeedDialLocation( 
+            aLocationIndex, 
+            aNumber );
+        }
+    else
+        {
+        TEFLOGSTRING( 
+            KTAERROR, 
+            "CNT CPECONTACTHANDLINGPROXY::GETSPEEDDIALLOCATION ! NEITHER CONTACT HANDLING NOR CONTACT HANDLING DUMMY EXISTS" );
+        User::Invariant();
+        }
+    return KErrBadHandle;
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/src/cpecontactmatch.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,467 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEContactMatch class
+*
+*/
+
+// INCLUDE FILES
+#include "cpecontacthandling.h"
+#include "cpecontactmatch.h"
+#include <cphonecntfactory.h>
+#include <cphcntmatcher.h>
+#include <mpeclientinformation.h>
+#include <mpedatastore.h>
+#include <mphcntmatch.h>
+#include <pepanic.pan>
+#include <pevirtualengine.h>
+#include <talogger.h>
+
+// CONSTANTS
+
+// Space - used as a separator between concatenated first and last name
+_LIT( KPESpace," ");
+
+// For parsing protocol prefix and domain part out of a VoIP call URI
+_LIT( KPhoneColon, ":" );
+_LIT( KPhoneAt, "@" );
+
+// Contact group array granularity
+const TInt KPEContactGroupArrayGranularity = 5;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// CPEContactMatch::NewL
+// ---------------------------------------------------------------------------
+//
+CPEContactMatch* CPEContactMatch::NewL(
+        CPEContactHandling& aOwner,
+        MPEDataStore& aDataStore
+        )
+    {
+    CPEContactMatch* self = 
+        new ( ELeave ) CPEContactMatch( aOwner, aDataStore );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPEContactMatch::~CPEContactMatch()
+    {
+
+    delete iContactMatcher;
+    delete iContactFactory;
+    iLibrary.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::CreateContactIdL
+// -----------------------------------------------------------------------------
+//
+CPhCntContactId* CPEContactMatch::CreateContactIdL( const TDesC8& aContactId )
+    {  
+    return iContactFactory->CreateContactIdL( aContactId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::CreateContactIdL
+// -----------------------------------------------------------------------------
+//
+CPhCntContactId* CPEContactMatch::CreateContactIdL(
+    TContactItemId aContactId )
+    {  
+    return iContactFactory->CreateContactIdL( aContactId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::CPEContactMatch
+// -----------------------------------------------------------------------------
+//
+CPEContactMatch::CPEContactMatch(
+        CPEContactHandling& aOwner,
+        MPEDataStore& aDataStore )
+        : iOwner( aOwner ), iDataStore( aDataStore )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPEContactMatch::ConstructL()
+    {
+    //Mandatory services for providing contact match functionality
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactMatch::ConstructL > RLibrary::Load" );
+    iContactFactory = CreateCntFactoryL();
+    TEFLOGSTRING( KTAOBJECT, "CNT CPEContactMatch::ConstructL > CPhCntFactory::CreateContactMatcherL" );
+    iContactMatcher = iContactFactory->CreateContactMatcherL();
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::MatchWithContactIdL
+// Synchronous method for finding contact data specified 
+// with aContactId.
+// -----------------------------------------------------------------------------
+//
+void CPEContactMatch::MatchWithContactIdL(
+        const TInt aCallId
+        )
+
+    {
+    TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithContactIdL" );
+    MPhCntMatch* match( NULL );
+    CPhCntContactId* contactId = NULL;
+    contactId = CreateContactIdL( iDataStore.CallClientInformation( aCallId ).ContactLink() );
+    CleanupStack::PushL( contactId );
+    if ( iDataStore.CallType( aCallId ) == EPECallTypeVoIP )
+        {
+        if ( contactId && contactId->IsValid() )
+            {
+            TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithContactIdL > CPhCntMatcher::MatchVoipNumber" );
+            // Get contact based on contact id.
+            iContactMatcher->MatchVoipNumber( match, 
+                                              *contactId );
+            }
+        else
+            {
+            User::Leave( KErrArgument );
+            }
+        }
+    else
+        {
+        if ( contactId && contactId->IsValid() )
+            {
+            TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithContactIdL > CPhCntMatcher::MatchNumber" );
+            iContactMatcher->MatchNumber( match, 
+                                          iDataStore.RemotePhoneNumber( aCallId ),
+                                          *contactId );
+            }
+        else
+            {
+            User::Leave( KErrArgument );
+            }
+        }
+
+    if ( match != NULL )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithContactIdL, Contact match found" );
+        CopyContactFieldsDataL( *match, aCallId );
+
+        if ( match->HasThumbnailImage() )
+            {
+            TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithContactIdL, Thumbnail image found" );
+            // Start loading thumbnail for this contact
+            // Error code may be ignored since this is not a critical function
+            //LoadThumbnail( iDataStore.ContactId( aCallId ), aCallId );
+            }
+        match->Release();
+        match = NULL;
+        }
+    CleanupStack::PopAndDestroy( contactId ); //contactId 
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::MatchWithNumberL
+// Synchronous method for finding contact data specified with phone number.
+// -----------------------------------------------------------------------------
+//
+void CPEContactMatch::MatchWithNumberL(
+        const TInt aCallId
+        )
+    {
+    MPhCntMatch* match( NULL );
+
+    if ( iDataStore.CallType( aCallId ) == EPECallTypeVoIP )
+        {
+        TEFLOGSTRING2( KTAINT, "CNT CPEContactMatch::MatchWithNumberL > CPhCntMatcher::MatchVoipNumber, call id: %d", aCallId );
+        TPEPhoneNumber remoteNumber = iDataStore.RemotePhoneNumber( aCallId );        
+        
+
+        // TODO: Determine whether domain part of the URI should be ignored
+        // This could be done via RCSE (which is in my understanding: depricated)
+        // but needs to be studied if SP Settings need to support this service
+        // setting instead
+        
+        // Parse protocol prefix and domain part out of a VoIP call URI
+        TInt pos( remoteNumber.Find( KPhoneColon ) );
+        if ( pos > KErrNotFound )
+            {
+            remoteNumber.Delete( 0, pos+1 );
+            }                
+            
+        pos = remoteNumber.Find( KPhoneAt );
+        if ( pos > KErrNotFound )
+            {
+            remoteNumber.Delete( pos, remoteNumber.Length() - pos );
+            }
+
+        TEFLOGSTRING3( KTAINT, "CNT CPEContactMatch::MatchWithNumberL > CPhCntMatcher::MatchNumber, number: %S, call id: %d",
+            &remoteNumber, aCallId );
+        iContactMatcher->MatchVoipNumber( match, remoteNumber, ETrue, remoteNumber.Length() );
+
+                
+        }
+    else
+        {
+        TPEPhoneNumber remoteNumber = iDataStore.RemotePhoneNumber( aCallId );
+        
+        TEFLOGSTRING3( KTAINT, "CNT CPEContactMatch::MatchWithNumberL > CPhCntMatcher::MatchNumber, number: %S, call id: %d",
+            &remoteNumber, aCallId );
+
+         TInt id = KErrNotFound;
+         id = iDataStore.ContactId2();
+         id == KErrNotFound? iContactMatcher->MatchNumber( match, remoteNumber ) :
+                                     iContactMatcher->MatchNumber(match, remoteNumber, id);
+         //reset contact-id
+         iDataStore.SetContactId2(KErrNotFound);
+         
+
+        }
+
+    if ( match != NULL )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithNumberL, Contact match found" );
+        CopyContactFieldsDataL( *match, aCallId );
+
+        if ( match->HasThumbnailImage() )
+            {
+            TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::MatchWithNumberL, Thumbnail image found" );
+            // Start loading thumbnail for this contact
+            // Error code may be ignored since this is not a critical function
+            iDataStore.SetHasCallerThumbnail( ETrue, aCallId );
+            //LoadThumbnail( iDataStore.ContactId( aCallId ), aCallId );
+            }
+        match->Release();
+        match = NULL;
+        }
+    }
+
+
+
+// ---------------------------------------------------------
+// CPEContactMatch::ContactThumbnail
+// Returns contact thumbnail image, NULL if not found
+// ---------------------------------------------------------
+//
+CFbsBitmap* CPEContactMatch::ContactThumbnail()
+    {
+    return NULL;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::CopyContactFieldsDataL
+// Copies contact information to remote info struct
+// -----------------------------------------------------------------------------
+//
+void CPEContactMatch::CopyContactFieldsDataL(
+        const MPhCntMatch& aMatch,
+        const TInt aCallId
+        )
+    {
+    TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::CopyContactFieldsDataL: start" );
+
+    // Set ringing tone's filename
+    iDataStore.SetPersonalRingingTone( aMatch.PersonalRingingTone(), aCallId );
+
+    // Set name
+    // The following logic determines if one of the languages that require
+    // swapping of first/last name order is selected and performs the operation.
+    HBufC* lastname( NULL );
+    HBufC* firstname( NULL );
+
+    if ( aMatch.LastName().Length() > 0 )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::CopyContactFieldsDataL, alloc last name" );
+        lastname = aMatch.LastName().Alloc();
+        }
+    if ( aMatch.FirstName().Length() > 0 )
+        {
+        TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::CopyContactFieldsDataL, alloc first name" );
+        firstname = aMatch.FirstName().Alloc();
+        }
+
+    if ( ( lastname ) && ( firstname ) )
+        {
+        //Swap name order, if required by the current language setting
+        const TLanguage language = User::Language();
+    
+        for ( TInt index = 0; index < KPENumberOfSwappedLanguages; index++ )
+            {
+            if ( KPESwappedLanguages[index] == language )
+                {
+                HBufC* tempfirstname( firstname );
+                firstname = lastname;
+                lastname = tempfirstname;
+                break;
+                }
+            }
+        }
+
+    TPEContactName finalName;
+    // Parse name by concatenating lastname and firstname
+    if ( firstname )
+        {
+        finalName = *firstname;
+        if ( finalName.Length() < KCntMaxTextFieldLength && lastname )
+            {
+            TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::CopyContactFieldsDataL, append with space" );
+            finalName.Append( KPESpace );
+            }
+        delete firstname;
+        firstname = NULL;
+        }
+    if ( lastname )
+        {
+        if ( finalName.Length() < KCntMaxTextFieldLength )
+            {
+            // Check how long last name can be added to the iName string. 
+            TInt lastNameMaxLength = KCntMaxTextFieldLength - finalName.Length();
+            if ( lastname->Length() > lastNameMaxLength )
+                {
+                TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::CopyContactFieldsDataL, append with part of last name" );
+                // Cut extra chars from the string.
+                finalName.Append( lastname->Left( lastNameMaxLength ) );          
+                }
+            else 
+                {
+                TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::CopyContactFieldsDataL, append with last name" );
+                finalName.Append( *lastname );
+                }
+            }
+        delete lastname;
+        lastname = NULL;
+        }
+        
+    // Replace paragraph separator with space character
+    const TText ps(0x2029);
+
+    while ( finalName.Locate( ps ) != KErrNotFound )
+        {
+        finalName[ finalName.Locate( ps )] = ' ';
+        }
+    TEFLOGSTRING3( KTAINT, "CNT CPEContactMatch::iDataStore.SetRemoteName( finalName, aCallId ): finalName: %S callid: %d ", &finalName, aCallId);
+    iDataStore.SetRemoteName( finalName, aCallId );
+
+    iDataStore.SetRemoteTextToSpeechText( aMatch.TextToSpeechTextL(), aCallId );
+
+    TInt phcntfinderNumberType = aMatch.NumberType();
+            
+    switch ( phcntfinderNumberType )
+        {
+        case MPhCntMatch::EMobileNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEMobileNumber, aCallId );
+            break;
+        case MPhCntMatch::EStandardNumber:
+            iDataStore.SetRemotePhoneNumberType( EPETelephoneNumber, aCallId );
+            break;
+        case MPhCntMatch::EFaxNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEFaxNumber, aCallId );
+            break;
+        case MPhCntMatch::EPagerNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEPager, aCallId );
+            break;
+        case MPhCntMatch::EVoipNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEVoipNumber, aCallId );
+            break;
+        case MPhCntMatch::EVideoNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEVideoNumber, aCallId );
+            break;        
+        case MPhCntMatch::EAssistantNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEAssistantNumber, aCallId );
+            break;        
+        case MPhCntMatch::ECarNumber:
+            iDataStore.SetRemotePhoneNumberType( EPECarNumber, aCallId );
+            break;        
+        case MPhCntMatch::EHomeNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEHomeNumber, aCallId );
+            break;        
+        case MPhCntMatch::EWorkNumber:
+            iDataStore.SetRemotePhoneNumberType( EPEWorkNumber, aCallId );
+            break;        
+        case MPhCntMatch::ENone: // fall through
+        default:
+            iDataStore.SetRemotePhoneNumberType( EPEUnknownNumber, aCallId );
+            break;
+        }
+
+    // Replace paragraph separator with space character
+    TPEContactName companyName;
+    companyName = aMatch.CompanyName();
+    while ( companyName.Locate( ps ) != KErrNotFound )
+        {
+        companyName[ companyName.Locate( ps )] = ' ';
+        }
+    // Set Company name
+    iDataStore.SetRemoteCompanyName( companyName, aCallId );
+
+    // Set Call text
+    iDataStore.SetCallerText( aMatch.CallText(), aCallId );
+
+    // Set Call image
+    iDataStore.SetCallerImage( aMatch.CallImage(), aCallId );
+    
+    // Set Contact ID
+    iDataStore.SetContactId( aMatch.ContactId()->CloneL(), aCallId );
+
+    CArrayFixFlat< TContactItemId >* groupList
+        = new ( ELeave ) CArrayFixFlat< TContactItemId >
+        ( KPEContactGroupArrayGranularity );
+ 
+    TArray<TContactItemId> alertFor = iDataStore.AlertForGroup();
+    const TInt groupLength = alertFor.Count();
+    for ( TInt i = 0; i < groupLength; i++ ) 
+        {
+        groupList->AppendL( alertFor[ i ] );
+        }
+   
+    if ( aMatch.BelongsToGroups( *groupList ) )
+        {
+        // Convert array type here to ease further handling
+        TArray<TContactItemId> list = groupList->Array();
+        // Set group information
+        iDataStore.SetContactGroups( list, aCallId );
+        }
+    delete groupList;
+    groupList = NULL;
+    
+    // Set dtmf array
+    iDataStore.SetPredefinedDtmfStrings( aMatch.AllDtmfNumbers(), aCallId );
+    TEFLOGSTRING( KTAINT, "CNT CPEContactMatch::CopyContactFieldsDataL: complete" );  
+    }
+
+// -----------------------------------------------------------------------------
+// CPEContactMatch::GetSpeedDialLocationL
+// Get's phone number from given location.
+// -----------------------------------------------------------------------------
+//
+void CPEContactMatch::GetSpeedDialLocationL( 
+    TInt /*aLocationIndex*/, 
+    TPEPhoneNumber& /*aNumber*/ )
+    {
+
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/src/pecontacthandlingpanic.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of Contact Hanling 
+*                panic function
+*
+*/
+
+
+// INCLUDE FILES
+#include <pepanic.pan>
+#include "e32std.h"
+// EXTERNAL DATA STRUCTURES
+//None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//None
+
+// CONSTANTS
+//None
+
+// MACROS
+//None
+
+// LOCAL CONSTANTS AND MACROS
+//None
+
+// MODULE DATA STRUCTURES
+//None
+
+// LOCAL FUNCTION PROTOTYPES
+//None
+
+// FORWARD DECLARATIONS
+//None
+
+
+// ==================== LOCAL FUNCTIONS =====================================
+// None
+
+// ================= MEMBER FUNCTIONS =======================================
+// None
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Panic implements...
+// Contact Handling panic function
+// Returns: None
+// -----------------------------------------------------------------------------
+//
+GLDEF_C void Panic
+        ( 
+        TPEPanic aPanic 
+        )
+    {
+    _LIT(KPEContactHandlingPanic,"ContactHandling Panic!");
+    User::Panic( KPEContactHandlingPanic, aPanic);
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/contacthandling2/tsrc/run_auto_tests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,228 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\..\..\src\*
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set REMOVETESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb.test --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_MOVE_DLL=\epoc32\release\winscw\udeb\z\sys\bin
+set PATH_TO_COVERAGE_DATA=\coverage_data
+
+
+if not exist %PATH_TO_DLL%\eunitexerunner.exe  ( 
+echo EUnit not installed! 
+goto end
+)
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+set REMOVETESTS=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+set REMOVETESTS=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+call :move
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%REMOVETESTS%] EQU [TRUE] (
+call :removetests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1\group
+call sbs --config winscw_udeb.test --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function MOVE
+::
+:: moves compiled tests to eunit directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:MOVE
+echo Moving tests
+call move %PATH_TO_DLL%\ut_*.dll %PATH_TO_MOVE_DLL%
+call move %PATH_TO_DLL%\mt_*.dll %PATH_TO_MOVE_DLL%
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: Runs tests in eunit directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\eunitexerunner.exe -dtextshell --
+copy \epoc32\winscw\c\shared\EUnit\Logs\EUnit_log.xml \lastrun_EUnit_log.xml
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVETESTS
+::
+:: Removes tests from eunit directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVETESTS
+echo Removing Test dlls
+call sleep 3
+call del %PATH_TO_MOVE_DLL%\t_*.dll
+call del %PATH_TO_MOVE_DLL%\mt_*.dll
+call del %PATH_TO_MOVE_DLL%\ut_*.dll
+call del %PATH_TO_MOVE_DLL%\it_*.dll
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/bwins/engineinfou.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,5 @@
+EXPORTS
+	?NewL@CPEEngineInfo@@SAPAV1@XZ @ 1 NONAME ; class CPEEngineInfo * CPEEngineInfo::NewL(void)
+	?NewL@CPEClientInformation@@SAPAV1@XZ @ 2 NONAME ; class CPEClientInformation * CPEClientInformation::NewL(void)
+	?NewL@CPEEngineInfoImpl@@SAPAV1@XZ @ 3 NONAME ; class CPEEngineInfoImpl * CPEEngineInfoImpl::NewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/eabi/engineinfou.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,4 @@
+EXPORTS
+	_ZN20CPEClientInformation4NewLEv @ 1 NONAME
+	_ZN13CPEEngineInfo4NewLEv @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Engine Info bld file
+*
+*/
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/cpeengineinfo.h                |../../../inc/cpeengineinfo.h
+../inc/mpeclientinformation.h         |../../../inc/mpeclientinformation.h
+../inc/mpeengineinfo.h                |../../../inc/mpeengineinfo.h
+
+../inc/cpeclientinformation.h         |../../inc/cpeclientinformation.h
+../inc/mpedatastore.h                 |../../inc/mpedatastore.h
+ 
+PRJ_MMPFILES
+engineinfo.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/group/engineinfo.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for Engine info dll
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          engineinfo.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x10207904
+VENDORID            VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH      ../src
+SOURCE          cpecallinfo.cpp
+SOURCE          cpeclientinformation.cpp
+SOURCE          cpeclientinformationimpl.cpp
+SOURCE          cpeengineinfo.cpp
+SOURCE          cpeengineinfoimpl.cpp
+SOURCE          cperemoteinfo.cpp
+SOURCE          panic.cpp 
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE       
+SYSTEMINCLUDE   ../../inc          // Phone Engine private headers
+SYSTEMINCLUDE   ../../../inc       // Telephony internal headers
+
+LIBRARY         euser.lib
+LIBRARY         bafl.lib           // Descriptor arrays
+LIBRARY         cce.lib
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/cpecallinfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,639 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information container for a single call
+*
+*/
+
+
+#ifndef C_CPECALLINFO_H
+#define C_CPECALLINFO_H
+
+#include <pevirtualengine.h>
+
+class CPEClientInformation;
+
+/**
+ * Information container for a single call.
+ */
+NONSHARABLE_CLASS( CPECallInfo ) : public CBase
+    {
+
+public:
+    
+    /**
+     * Two-phased constructor.
+     * 
+     * @return      The newly created object. Ownership is transferred to the caller.
+     */
+    static CPECallInfo* NewL();
+
+    /**
+     * Destructor.
+     */
+    ~CPECallInfo();
+
+    /**
+     * Resets all call information to their initial values.
+     * 
+     * @param   aIsConference   Flag indicating if the call is a conference call.
+     */
+    void Reset( TBool aIsConference );
+    
+    /**
+     * Returns the client information of the call.
+     * 
+     * @return  Client information of the call.
+     */ 
+    CPEClientInformation& ClientInformation();
+    
+    /**
+     * Sets the state of the call.
+     * 
+     * @param   aState          New state of the call.
+     */
+    void SetCallState( TPEState aState );
+    
+    /**
+     * Returns the state of the call.
+     * 
+     * @return  State of the call.
+     */
+    TPEState CallState() const;
+    
+    /**
+     * Sets the type of the call.
+     * 
+     * @param   aType           New type of the call.
+     */
+    void SetCallType( TPECallType aType );
+    
+    /**
+     * Returns the type of the call.
+     * 
+     * @return  Type of the call.
+     */
+    TPECallType CallType() const;
+    
+    /**
+     * Sets the call control capabilites.
+     * 
+     * @param   aCaps           Call control capabilites to set.
+     */
+    void SetCallControlCaps( TPECallControlCaps aCaps );
+    
+    /**
+     * Returns the call control capabilities.
+     * 
+     * @return  Call control capabilities.
+     */
+    TPECallControlCaps CallControlCaps() const;
+
+    /**
+     * Sets the remote party name of the call as given by the network.
+     * 
+     * @param   aName           Remote party name of the call.
+     */
+    void SetRemotePartyName( const TPEContactName& aName );
+    
+    /**
+     * Returns the remote party name of the call as given by the network.
+     * 
+     * @return  Remote party name of the call.
+     */
+    const TPEContactName& RemotePartyName() const;
+    
+    /**
+     * Sets the whole outgoing phone number (invalid characters removed).
+     * 
+     * @param   aNumber         Phone number to set.
+     */
+    void SetWholeOutgoingPhoneNumber( const TPEPhoneNumber& aNumber );
+    
+    /**
+     * Returns the whole outgoing phone number (invalid characters removed).
+     * 
+     * @return  Whole outgoing phone number.
+     */
+    const TPEPhoneNumber& WholeOutgoingPhoneNumber() const;
+
+    /**
+     * Sets the ALS line type of the call.
+     * 
+     * @param   aAlsLine        ALS line type to set.
+     */
+    void SetAlsLine( CCCECallParameters::TCCELineType aAlsLine );
+    
+    /**
+     * Returns the ALS line type of the call.
+     * 
+     * @return  ALS line type of the call.
+     */
+    CCCECallParameters::TCCELineType AlsLine() const;
+    
+    /**
+     * Sets the remote identity status of the call.
+     * 
+     * @param   aIdentity       Remote identity status to set.
+     */
+    void SetRemoteIdentity( RMobileCall::TMobileCallRemoteIdentityStatus aIdentity );
+    
+    /**
+     * Returns the remote identity status of the call.
+     * 
+     * @return  Remote identity status of the call.
+     */
+    RMobileCall::TMobileCallRemoteIdentityStatus RemoteIdentity() const;
+    
+    /**
+     * Sets the direction of the call.
+     * 
+     * @param   aDirection      Direction to set.
+     */
+    void SetCallDirection( RMobileCall::TMobileCallDirection aDirection );
+    
+    /**
+     * Returns the direction of the call.
+     * 
+     * @return  Direction of the call.
+     */
+    RMobileCall::TMobileCallDirection CallDirection() const;
+
+    /**
+     * Sets the mobile call service type of the call.
+     *  
+     * @param   aService        Mobile call service type to set.
+     */
+    void SetService( RMobilePhone::TMobileService aService );
+    
+    /**
+     * Returns the mobile call service type of the call.
+     * 
+     * @return  Mobile call service type of the call.
+     */
+    RMobilePhone::TMobileService Service() const;
+    
+    /**
+     * Sets the conference member name of the call.
+     * 
+     * @param   aName           Conference member name of the call.
+     */
+    void SetConferenceMemberName( const TName& aName );
+    
+    /**
+     * Returns the conference member name of the call.
+     * 
+     * @return  Conference member name of the call.
+     */
+    const TName& ConferenceMemberName() const;
+    
+    /**
+     * Sets the call start time.
+     * 
+     * @param   aTime           Start time of the call.
+     */
+    void SetStartTime( const TTime& aTime );
+    
+    /**
+     * Returns the start time of the call.
+     * 
+     * @return  Start time of the call.
+     */
+    const TTime& StartTime() const;
+    
+    /**
+     * Sets the duration of the call.
+     * 
+     * @param   aDuration       Duration of the call in seconds.
+     */
+    void SetDuration( TTimeIntervalSeconds aDuration );
+    
+    /**
+     * Returns the duration of the call.
+     * 
+     * @return  Duration of the call in seconds.
+     */
+    TTimeIntervalSeconds Duration() const;
+    
+    /**
+     * Sets the service identifier of the call.
+     * 
+     * @param   aId             Service identifier to set.
+     */
+    void SetCallServiceId( TUint32 aId );
+    
+    /**
+     * Returns the service identifier of the call.
+     * 
+     * @return  Service identifier of the call.
+     */
+    TUint32 CallServiceId() const;
+    
+    /**
+     * Sets conference capabilities of the call.
+     * 
+     * @param   aCaps           Conference capabilities to set.
+     */
+    void SetConferenceCaps( TUint32 aCaps );
+    
+    /**
+     * Returns the conference capabilities of the call.
+     * 
+     * @return  Conference capabilities of the call.
+     */
+    TUint32 ConferenceCaps() const;
+    
+    /**
+     * Sets the identification number of the conference master.
+     * 
+     * @param   aConference     Identification number of the conference master to set.
+     */
+    void SetConference( TInt aConference );
+    
+    /**
+     * Returns the identification number of the conference master.
+     * 
+     * @return  Identification number of the conference master.
+     */
+    TInt Conference() const;
+    
+    /**
+     * Sets the identifier of the conference member call.
+     * 
+     * @param   aId             Identifier of the conference member call to set.
+     */
+    void SetConferenceMemberId( TInt aId );
+    
+    /**
+     * Returns the identifier of the conference member call.
+     * 
+     * @return  Identifier of the conference member call.
+     */
+    TInt ConferenceMemberId();
+    
+    /**
+     * Sets the number of conference members.
+     * 
+     * @param   aNumberOfConferenceMembers      Number of conference members.
+     */
+    void SetNumberOfConferenceMembers( TInt aNumberOfConferenceMembers );
+    
+    /**
+     * Returns the number of conference members.
+     * 
+     * @return  Number of conference members.
+     */
+    TInt NumberOfConferenceMembers() const;
+    
+    /**
+     * Sets the forced completion indicator for logging.
+     * 
+     * @param   aLog            Flag indicating if forced completion should be set.
+     */
+    void SetLogForcedCompletion( TBool aLog );
+    
+    /**
+     * Returns the flag indicating if forced completion indicator for logging is used.
+     * 
+     * @return  Flag indicating if forced completion indicator for logging is used.
+     */
+    TBool LogForcedCompletion();
+    
+    /**
+     * Enables or disables logging for the call.
+     * 
+     * @param   aEnabled        Flag enabling or disabling logging for the call.
+     */
+    void SetLoggingEnabled( TBool aEnabled );
+    
+    /**
+     * Returns if logging is enabled for the call.
+     * 
+     * @return  Flag indicating if logging is enabled for the call.
+     */
+    TBool LoggingEnabled() const;
+    
+    /**
+     * Sets the missed call status for the call.
+     * 
+     * @param   aMissedCall     Missed call status to set.
+     */
+    void SetMissedCall( TBool aMissedCall );
+    
+    /**
+     * Returns the missed call status for the call.
+     * 
+     * @return  Missed call status for the call.
+     */
+    TBool MissedCall() const;
+    
+    /**
+     * Sets the secure status for the call.
+     * 
+     * @param   aSecureStatus   Secure status to set.
+     */
+    void SetSecureStatus( TBool aSecureStatus );
+    
+    /**
+     * Returns the secure status of the call.
+     * 
+     * @return  Secure status of the call.
+     */
+    TBool SecureStatus() const;
+    
+    /**
+     * Sets the forwarded status for the call.
+     * 
+     * @param   aForwarded      Forwarded status to set.
+     */
+    void SetForwarded( TBool aForwarded );
+    
+    /**
+     * Returns the forwarded status of the call.
+     * 
+     * @return  Forwarded status of the call.
+     */
+    TBool Forwarded() const;
+    
+    /**
+     * Sets the resume held call status for the call.
+     * 
+     * @param   aResume         Resume held call status to set.
+     */
+    void SetResumeHeldCall( TBool aResume );
+    
+    /**
+     * Returns the resume held call status of the call.
+     * 
+     * @return  Resume held call status of the call.
+     */
+    TBool ResumeHeldCall() const;
+
+    /**
+     * Returns the dtmf postfix of the call.
+     * 
+     * @return  dtmf postfix of the call.
+     */
+    const TPEDtmfString& DtmfPostFix() const;
+    
+    /**
+     * Sets the dtmf postfix of the call.
+     * 
+     * @param aDtmfPostFix dtmf postfix to set.
+     */
+    void SetDtmfPostFix( const TPEDtmfString& aDtmfPostFix );
+
+    /**
+     * Sets the secure specified status for the call.
+     * 
+     * @param aSecureSpecified Secure specified status to set.
+     */
+    void SetSecureSpecified( TBool aSecureSpecified );
+
+    /**
+     * Returns the secure specified status of the call.
+     * 
+     * @return Secure specified status of the call.
+     */
+    TBool SecureSpecified() const;
+    
+    /**
+     * Returns transfer target from the received unattended transfer 
+     * request or KNullDesC if transfer target is not available.
+     * 
+     * @return  Transfer target.
+     */
+    const TPEPhoneNumber& UnattendedTransferTarget() const;
+    
+    /**
+     * Sets transfer target from received unattended transfer request.
+     *
+     * @param   aTarget     Transfer target to set.
+     */
+    void SetUnattendedTransferTarget( const TPEPhoneNumber& aTarget );
+
+    /**
+     * Returns address choices from received call forward request 
+     * or NULL if addresses are not available.
+     * 
+     * @return  New address.
+     */
+    const CDesC8Array* ForwardAddressChoices() const;
+    
+    /**
+     * Sets address choices from received call forward request.
+     *
+     * @param   aArray     Address array.
+     */
+    void SetForwardAddressChoices( const CDesC8Array* aArray );
+    
+    /**
+     * Sets array index for user selected address.
+     *
+     * @param   aIndex     Array index for selected address.
+     */
+    void SetForwardAddressIndex( TInt aIndex );
+    
+    /**
+     * Sets the call index of a call. Note this is not a call id.
+     */
+    void SetCallIndex( TInt aCallIndex );
+    
+    /**
+     * Gets the call index of a call. Note this is not the same as
+     * call id.
+     */
+    TInt CallIndex() const;
+    
+    /**
+     * Sets the origin of a call.
+     */
+    void SetCallOrigin( TPECallOrigin aOrigin );
+    
+    /**
+     * Gets the origin of a call.
+     */
+    TPECallOrigin CallOrigin() const;
+    
+private:
+    
+    /**
+     * Constructor.
+     */
+    CPECallInfo();
+    
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+private:
+    
+    /**
+     * Client information of the call.
+     * Owned.
+     */
+    CPEClientInformation* iClientInformation;
+    
+    /**
+     * State of the call.
+     */
+    TPEState iCallState;
+    
+    /**
+     * Type of the call.
+     */
+    TPECallType iCallType;
+    
+    /**
+     * Call control capabilities.
+     */
+    TPECallControlCaps iCallControlCaps;
+
+    /**
+     * Name of the remote party as given by the network (SkypeID).
+     */
+    TPEContactName iRemotePartyName;
+    
+    /**
+     * Whole outgoing phone number (invalid characters removed).
+     */
+    TPEPhoneNumber iWholeOutgoingPhoneNumber;
+
+    /**
+     * ALS line of the call.
+     */
+    CCCECallParameters::TCCELineType iALSLine;
+    
+    /**
+     * Remote identity status.
+     */
+    RMobileCall::TMobileCallRemoteIdentityStatus iRemoteIdentity;
+    
+    /**
+     * Direction of the call.
+     */
+    RMobileCall::TMobileCallDirection iCallDirection;
+
+    /**
+     * Mobile call service type.
+     */
+    RMobilePhone::TMobileService iService;
+
+    /**
+     * Conference member name.
+     */
+    TName iConferenceMemberName; 
+    
+    /**
+     * Start time of the call.
+     */
+    TTime iStartTime;
+    
+    /**
+     * Duration of the call in seconds.
+     */
+    TTimeIntervalSeconds iDuration;
+
+    /**
+     * Service identifier.
+     */
+    TUint32 iCallServiceId;
+    
+    /**
+     * Conference capabilities.
+     */
+    TUint32 iConferenceCaps;
+    
+    /**
+     * Identification number of the conference master.
+     */
+    TInt iConference;
+    
+    /**
+     * Conference member call identifier.
+     */
+    TInt iConferenceMemberId;
+    
+    /**
+     * Number of conference members.
+     */
+    TInt iNumberOfConferenceMembers;
+
+    /**
+     * Flag to indicate forced completion indicator for log handling.
+     */
+    TBool iLogForcedCompletion;
+    
+    /**
+     * Flag to indicate logging enabled status.
+     */
+    TBool iLoggingEnabled;
+    
+    /**
+     * Flag to indicate missed call status.
+     */
+    TBool iMissedCall;
+    
+    /**
+     * Flag to indicate secure status.
+     */
+    TBool iSecureStatus;
+    
+    /**
+     * Flag to indicate forwarded status of the incoming call.
+     */
+    TBool iForwarded;
+    
+    /**
+     * Flag to indicate resume held call status.
+     */
+    TBool iResumeHeldCall;
+
+    /**
+     * Flag to indicate secure specified status.
+     */    
+    TBool iSecureSpecified;
+    
+    /**
+     * Unattended transfer target.
+     */
+    TPEPhoneNumber iTransferTarget;
+    
+    /**
+     * Dtmf postfix.
+     */
+    TPEDtmfString iDtmfPostFix;
+
+    /**
+     * Call forward address choices.
+     */
+    const CDesC8Array* iForwardAddressChoices;
+    
+    /**
+     * User selected array index for call forward.
+     */
+    TInt iForwardAddressArrayIndex;
+    
+    /**
+     * Call index of a call. Note this is not call id. 
+     */
+    TInt iCallIndex;
+    
+    /**
+     * Origin of the call. 
+     */
+    TPECallOrigin iCallOrigin;
+    };
+
+#endif // C_CPECALLINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/cpeclientinformation.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Client information for a single call
+*
+*/
+
+
+#ifndef CPECLIENTINFORMATION_H_
+#define CPECLIENTINFORMATION_H_
+
+#include <e32base.h>
+#include "mpeclientinformation.h"
+
+/**
+ * Holds client information for a single call
+ * 
+ * This information is specific on a per-call basis.
+ */
+NONSHARABLE_CLASS( CPEClientInformation ) 
+    : public CBase, public MPEClientInformation
+    {
+    
+public:
+        
+        /**
+         * Two-phased constructor.
+         * 
+         * @return  The newly created object. Ownership is transferred to the caller.
+         */
+        IMPORT_C static CPEClientInformation* NewL();
+        
+        /**
+         * Destructor.
+         */
+        virtual ~CPEClientInformation();
+        
+protected:
+        
+        /**
+         * Constructor.
+         */
+        CPEClientInformation();
+    };
+
+#endif /*CPECLIENTINFORMATION_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/cpeclientinformationimpl.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone client information for a single call
+*
+*/
+
+
+#ifndef C_CPECLIENTINFORMATIONIMPL_H
+#define C_CPECLIENTINFORMATIONIMPL_H
+
+#include "cpeclientinformation.h"
+
+/**
+ * Holds phone client information.
+ * 
+ * This information is specific on a per-call basis.
+ */
+NONSHARABLE_CLASS( CPEClientInformationImpl ) 
+    : public CPEClientInformation
+    {
+
+public:
+    
+    /**
+     * Two-phased constructor.
+     * 
+     * @return  The newly created object. Ownership is transferred to the caller.
+     */
+    static CPEClientInformationImpl* NewL();
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CPEClientInformationImpl();
+
+// from base class MPEClientInformation    
+    
+    void Reset();
+    void Set( const MPEClientInformation& aSource );
+    void SetContactLink( const TDesC8& aLink );
+    const TDesC8& ContactLink() const;
+    void SetName( const TName& aName );
+    const TName& Name() const;
+    void SetNumber( const TPEPhoneNumber& aNumber );
+    const TPEPhoneNumber& Number() const;
+    void SetCallType( TPECallType aType );
+    TPECallType CallType() const;
+    void SetAllowMatch( TBool aAllow );
+    TBool AllowMatch() const;    
+    void SetShowNumber( TBool aShow );
+    TBool ShowNumber() const;
+    void SetEndOtherCalls( TBool aEndOtherCalls );
+    TBool EndOtherCalls() const;
+    
+private:    
+    
+    /**
+     * Constructor.
+     */
+    CPEClientInformationImpl();
+    
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+    
+private:
+    
+    /**
+     * Contact link used for retrieving contact information.
+     * Owned.
+     */
+    RBuf8 iContactLink;
+
+    /**
+     * Name corresponding the phone number.
+     */
+    TName iName;
+    
+    /**
+     * Phone number to dial.
+     */
+    TPEPhoneNumber iNumber;
+    
+    /**
+     * Type of the call.
+     */
+    TPECallType iCallType;
+
+    /**
+     * Flag to indicate if contact matching is allowed.
+     */
+    TBool iAllowMatch;    
+    
+    /**
+     * Flag to indicate if phone number should be shown.
+     */
+    TBool iShowNumber;
+    
+    /**
+     * Flag to indicate if other calls should be terminated before attempting this one.
+     */
+    TBool iEndOtherCalls;
+    
+    };
+
+#endif // C_CPECLIENTINFORMATIONIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/cpeengineinfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony events and commands related information
+*
+*/
+
+#ifndef CPEENGINEINFO_H
+#define CPEENGINEINFO_H
+
+#include <e32base.h>
+#include "mpedatastore.h"
+
+/**
+ * Holds telephony events and commands related information
+ * + Call information is valid for a lifetime of a call
+ * + Command information is considered valid at all times and it is 
+ * the clients responsibility to set it correctly
+ * + Device information related to telephony is valid after startup
+ * is completed and is updated according to a set of monitored indications
+ *
+ */
+NONSHARABLE_CLASS( CPEEngineInfo ) 
+    : public CBase, public MPEDataStore
+    {
+    
+public:
+        
+        /**
+         * Two-phased constructor.
+         * 
+         * @return  The newly created object. Ownership is transferred to the caller.
+         */
+        IMPORT_C static CPEEngineInfo* NewL();
+        
+        /**
+         * Destructor.
+         */
+        virtual ~CPEEngineInfo();
+        
+protected:
+        
+        /**
+         * Constructor.
+         */
+        CPEEngineInfo();
+    };
+
+#endif /*CPEENGINEINFO_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/cpeengineinfoimpl.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1591 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEEngineInfoImpl object.
+*
+*/
+
+#ifndef CPEENGINEINFOIMPL_H
+#define CPEENGINEINFOIMPL_H
+
+//INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <ccpdefs.h>
+#include <pevirtualengine.h>
+#include "cperemoteinfo.h"
+#include "mpedatastore.h"
+#include "cpeengineinfo.h"
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+NONSHARABLE_STRUCT( TPECallCommandInfo )                  // For Mobile Originated Call Commands
+    {
+    TChar iKeyCode;                         // pressed key code
+    TInt iAudioMute;                        // state of microphone ( 0 = false, 1 = true )
+    TInt iAudioVolume;                      // Audio volume
+    TPEAudioOutput iAudioOutput;            // audio output path
+    TBool iShowNote;                        // Status of call audio route info note.
+    TInt iCallId;                           // Calls ID
+    TPEDtmfString iDtmfString;              // Dtmf string to be sent.
+    TPEPhoneNumber iPhoneNumber;            // Dialed Phonenumber, set by client
+    TPECallType iCallType;                  // Type of the attempted call
+    TUint32 iServiceId;                     // ServiceId    
+    TPECallOrigin iCallOrigin;              // Origin of the attempted call (Phone, client or SAT)
+    RMobileCall::TMobileCallIdRestriction iIdRestrict; // Call Id restriction setting to be used for this call
+    TPEPhoneNumber iEmergencyNumber;        // For checking is this number emergency number.
+    TPEUserToUserInfo iUserToUserInfo;      // User to user information.
+    TPEPhoneNumber iSwitchToNumber;         // Dialed Phonenumber, set by client
+    TPEPhoneNumber iTransferToAddress;      // Unattended transfer target address   
+    TInt iForwardToAddressIndex;            // Array index for a address to be forwarded
+    };
+
+NONSHARABLE_STRUCT( TPEBasicInfo )                         // Contains information of the phone related variables 
+    {
+    TBool iAudioMute;                       // state of microphone.                 
+    TBool iTwoDigitSupportStatus;           // Two Digit support status
+    TBool iALSLineSupport;                  // ALS line support.                
+    TInt iAudioOutputPreference;            // Audio output preference (private/public) - TODO: change type to enum when available
+    TInt iAudioVolume;                      // Audio volume                 
+    TInt iKeypadVolume;                     // Keypad volume                    
+    TInt iLastCallDuration;                 // Call duration (seconds)                  
+    TInt iPersonalToneStatus;               // Personal tone status                 
+    TInt iProfileId;                        // the id number of the profile                 
+    TInt iRingingVolume;                    // Current ringing volume                   
+    TBool iTextToSpeech;                    // Current text-to-speech setting
+    TBool iPhoneNumberIsServiceCode;        // flag indicating if the phone number is a service code
+    TNWNetworkRegistrationStatus iNetworkRegistrationStatus;                    
+    CCCECallParameters::TCCELineType iALSLine;        // includes active als line.                  
+    TPEContactFileName iRingingToneName1;   // Current ringingtone name                 
+    TPEContactFileName iRingingToneName2;
+    TPEContactFileName iVideoCallRingingTone; // Video call ringingtone name                                    
+    TPEDtmfString iDtmfString;              // Dtmf string.                 
+    TPEErrorInfo iErrorInfo;                // possible error code                  
+    TPELifeTimeData iLifeTimeData;                  
+    TPEPhoneIdentityParameters iPhoneIdentityParameters; // the phone identity parameters                   
+    TPEProfileName iProfileName;            // the name of the profile                  
+    TProfileRingingType iRingingType;       // Includes current ringing type                    
+    TPEVoiceMailBoxNumberInfo iVMBXNumbers; // Voice mail box numbers
+    TPEPhoneAudioRouteParameters iPhoneAudioRouteParameters; // the phone audio route parameters
+    TCCPTone iInbandTone;                   // Inband tone needed to play in a call state transition or error
+    TPEActiveForwardInfo iActiveForward;    // active forward information.
+    TPEBarringInfo iBarringInfo;            // includes call barring information.
+    TPESimState iSimState;
+    TPESSCommandInfo iSSCommandInfo;        // Contains information of the Suplementary Services command.
+    TBool iSecureSpecified;                 // Secure specified status
+    TName iDataPortName;                    // the name of data port currently on-loan
+    TBool iSwitchToOngoing;                 // Switch to operation status
+    };
+
+NONSHARABLE_STRUCT( TPEConferenceCallInfo ) // Contains conference call related variables 
+    {
+    TPEState iConferenceCallState;
+    };
+
+class CPECallInfo;
+
+// CLASS DECLARATION
+
+/**
+*  Handles telephony related information structures.
+*  
+*
+*  @lib engineinfo.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPEEngineInfoImpl )
+        : public CPEEngineInfo
+{
+    public:     //Constructors and destructor
+    
+        /**
+        * Two-phased constructor.
+        */
+        IMPORT_C static CPEEngineInfoImpl* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPEEngineInfoImpl();
+        
+    public:     //New functions
+
+        // Functions from MPEEngineInfo
+
+        /**
+        * Gets active als line of the phone from TPEBasicInfo-structure
+        * @return active als line of the phone
+        */
+        const CCCECallParameters::TCCELineType& ALSLine() const;
+        
+        /**
+        * Gets ALS support of the phone from TPEBasicInfo-structure
+        * @return ETrue if als is supported.
+        */
+        const TBool& ALSLineSupport() const;
+
+        /**
+        * Gets audio mute value
+        * @return audio mute value
+        */
+        const TBool& AudioMute() const;
+
+        /**
+        * Gets current audio output path
+        * @return audio output path
+        */
+        const TPEAudioOutput& AudioOutput() const;
+        
+        /**
+        * Gets phone audio route parameters
+        * @return phone audio route parameters. 
+        */
+        const TPEPhoneAudioRouteParameters& RouteParameters() const;
+                
+        /**
+        * Gets audio output path availability
+        * @return audio output path availability status
+        */
+        TBool AudioOutputAvailable( 
+            const TPEAudioOutput aOutput ) const;
+
+        /**
+        * Gets audio output preference
+        * @return audio output preference
+        */
+        const TInt& AudioOutputPreference() const;
+
+        /**
+        * Gets audio volume value
+        * @return audio volume value
+        */
+        const TInt& AudioVolume() const;
+
+        /**
+        * Gets call direction of the specified call
+        * @param aCallId is the call identification number
+        * @return call direction of the specified call
+        */
+        RMobileCall::TMobileCallDirection CallDirection( 
+            const TInt aCallId ) const;
+
+        /**
+        * Gets duration of the last call to go idle
+        * @return call duration of the last active call
+        */
+        const TInt& CallDuration() const;
+
+        /**
+        * Gets call duration of the ongoing or last active call with specified id
+        * @param aCallId is the call identification number
+        * @return call duration of the ongoing or last active call
+        */
+        TTimeIntervalSeconds CallDuration( const TInt aCallId ) const;
+        
+        /**
+        * Gets line information for the specified call
+        * @param aCallId is the call identification number
+        * @return line information for the specified call
+        */
+        CCCECallParameters::TCCELineType CallALSLine( const TInt aCallId ) const;
+
+        /**
+        * Gets call origin for next call attempt
+        * @return value indicates if the call is phone, client or SAT originated
+        */
+        const TPECallOrigin& CallOriginCommand() const;
+
+        /**
+        * Gets start time for the specified call
+        * @param aCallId is the call identification number
+        * @return time of the call
+        */
+        const TTime& CallStartTime( const TInt aCallId ) const;
+
+        /**
+        * Gets state of the specified call
+        * @param aCallId is the call identification number.
+        * @return call state of a specified call
+        */
+        TPEState CallState( const TInt aCallId ) const;
+
+        /**
+        * Gets type of the specified call
+        * @param aCallId is the call identification number.
+        * @return call state of a specified call
+        */
+        TPECallType CallType( const TInt aCallId ) const;
+
+        /**
+        * Gets call state of a conference call
+        * @return call state
+        */
+        TPEState ConferenceCallState() const;
+        
+        /**
+        * Gets the name of data port currently on-loan.
+        * Data port loaning is handled by CSPlugin and happens when a data
+        * call goes into connected state. The dataport is released when VT components
+        * indicate it can be released, i.e. video call hangup.
+        * @return data port name
+        */
+        const TName& DataPortName() const;
+
+        /**
+        * Gets secure status from call info
+        * @param aCallId is the call identification number.
+        * @return TBool the secure status (on/off)
+        */
+        TBool IsSecureCall( const TInt aCallId ) const;
+        
+        /**
+        * Gets dtmf postfix
+        * @param aCallId is the call identification number.
+        * @return dtmf postfix
+        */
+        const TPEDtmfString& DtmfPostFix( const TInt aCallId ) const;
+        
+        /**
+        * Gets dtmf string
+        * @return dtmf string
+        */
+        const TPEDtmfString& DtmfString() const;
+
+        /**
+        * Gets error code and cause values for the latest error
+        * @return error code and cause values for the latest error
+        */
+        const TPEErrorInfo& ErrorInfo() const;
+
+        /**
+        * Gets correct inband tone for specific call state transition or error
+        * @return the inband tone to be played
+        */
+        const TCCPTone& InbandTone() const;
+
+        /**
+        * Gets lifetimer data
+        * @return lifetime data (TDes8&)
+        */
+        const TPELifeTimeData& LifeTimerData() const;
+
+        /**
+        * Gets network registration status
+        * @return TNWNetworkRegistrationStatus Network registration status
+        */
+        const TNWNetworkRegistrationStatus& NetworkRegistrationStatus() const;
+
+        /**
+        * Gets phone identity parameters from TPEBasicInfo-structure
+        * @param aPhoneIdentityParameters is the phone identity parameters. 
+        */
+        const TPEPhoneIdentityParameters& PhoneIdentityParameters() const;
+
+        /**
+        * Gets phone number
+        * @return Reference to TPEPhoneNumber, containing the phone number of the remote party.
+        */
+        const TPEPhoneNumber& PhoneNumber() const;
+
+        /**
+        * Gets phone number parsing result
+        * @return ETrue if phone number is a service code
+        */
+        const TBool& PhoneNumberIsServiceCode() const;
+        
+        /**
+        * Gets profile id
+        * @return profile id
+        */
+        const TInt& ProfileId() const;
+
+        /**
+        * Gets remote party identity 
+        * @param aCallId is the Call identification number
+        * @return remote party identity
+        */
+        RMobileCall::TMobileCallRemoteIdentityStatus RemoteIdentity( 
+            const TInt aCallId ) const;
+
+        /**
+        * Gets ringing type
+        * @return ringing type
+        */
+        const TProfileRingingType& RingingType() const;
+        
+        /**
+        * Sets active als line value to the TPEGsmBasicInfo structure.
+        * @param aALSLine is the active als line value.
+        */
+        void SetALSLine( const CCCECallParameters::TCCELineType& aALSLine );
+        
+        /**
+        * Sets ALS support value to the TPEGsmBasicInfo structure.
+        * @param aALSLineSupport is the ALS support value.
+        */
+        void SetALSLineSupport( const TBool& aALSLineSupport );
+
+        /**
+        * Sets audio mute command to TPEBasicInfo-structure
+        * @param aAudioMute is audio mute
+        */
+        void SetAudioMuteCommand( const TInt& aAudioMute );
+
+        /**
+        * Sets audio output command to TPEBasicInfo-structure
+        * @param aOutput is audio output path
+        * @param aShowNote is audio note value 
+        * @return None.
+        */
+        void SetAudioOutputCommand( const TPEAudioOutput& aOutput,
+                                             const TBool aShowNote  );
+
+        /**
+        * Sets audio volume of the phone to TPEBasicInfo-structure
+        * @param aAudioVolume is audio volume of the phone
+        */
+        void SetAudioVolumeCommand( const TInt& aAudioVolume );
+
+        /**
+        * Sets CallId value to TPECallCommandInfo-structure
+        * @param aPhoneMumber is the phone number
+        */ 
+        void SetCallId( const TInt& aCallId );
+        
+        /**
+        * Sets alsline value to TPEGsmCallInfo-structure
+        * @param aALSLine informs which line is selected active
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallALSLine( const CCCECallParameters::TCCELineType& aALSLine, const TInt aCallId );
+
+        /**
+        * Sets call type information for the following command message
+        * @param aCallType is call type value.
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallTypeCommand( const TPECallType& aCallType );
+
+        /**
+        * Sets the name of data port currently on-loan.
+        * Data port loaning is handled by CSPlugin and happens when a data
+        * call goes into connected state. The dataport is released when VT components
+        * indicate it can be released, i.e. video call hangup.
+        * @param aName is Data port name
+        */
+        void SetDataPortName( const TName& aDataPortName );
+
+        /**
+        * Sets dtmf string value to TPECommandInfo-structure
+        * @param aDtmfString is the dtmf string to be sent. 
+        */
+        void SetDtmfStringCommand( const TPEDtmfString& aDtmfString );
+
+        /**
+        * Sets correct inband tone for specific call state transition or error
+        * @param aTone is the inband tone to be played
+        */
+        void SetInbandTone( const TCCPTone aTone ) ;
+
+        /**
+        * Sets key code value to TPECallCommandInfo-structure
+        * @param aKeyCode is the ascii coded key code.
+        */
+        void SetKeyCode( const TChar& aKeyCode );
+
+        /**
+        * Sets phone number to TPECallCommandInfo-structure
+        * @param aPhoneNumber is the phone number
+        */
+        void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber );
+
+        /**
+        * Gets active forwarding information from TPEBasicInfo-structure
+        * @return deflect information
+        */
+        const TPEActiveForwardInfo& ActiveForwardingInfo() const;
+
+        /**
+        * Gets barring information from TPEBasicInfo-structure
+        * @return barring information
+        */
+        const TPEBarringInfo& BarringInfo() const;
+
+        /**
+        * Gets conference value from TPECallInfo-structure
+        * @param aCallId is the call identification number
+        * @return call conference value
+        */
+        TInt CallConference( const TInt aCallId ) const;
+
+        /**
+        * Gets call control caps from the TPECallInfo-structure
+        * @param aCallId is the call identification number
+        * @return call control capabilities
+        */
+        TPECallControlCaps CallControlCaps( const TInt aCallId ) const;
+
+        /**
+        * Gets forwarded value from TPECallInfo-structure
+        * @param aCallId is the call identification number
+        * @return is call forwarded or not
+        */
+        TBool CallForwarded( const TInt aCallId ) const;
+
+        /**
+        * Gets Service information from TPECallInfo-structure
+        * @param aCallId is the call identification number.
+        * @return mobile call service type
+        */
+        RMobilePhone::TMobileService CallService( const TInt aCallId ) const;
+
+        /**
+        * Gets Conference call capabilities
+        * @param aCallId is the call identification number
+        * @return conference call capabilities
+        */
+        TUint32 ConferenceCallCaps( const TInt aCallId ) const;
+
+        /**
+        * Gets Conference call capabilities
+        * @param aCallId is the call identification number
+        * @return conference call member name
+        */
+        const TName& ConferenceMemberName( const TInt aCallId ) const;
+
+        /**
+        * Gets Conference call capabilities
+        * @param aCallId is the call identification number
+        * @return conference call member id
+        */
+        TInt IsConferenceMemberId( const TInt aCallId ) const;
+
+        /**
+        * Gets number of the conference members
+        * @param aCallId is the call identification number
+        * @return number of conference members
+        */
+        TInt NumberOfConferenceMembers( const TInt aCallId ) const;
+
+        /**
+        * Gets Sim state
+        * @return current Sim state
+        */
+        const TPESimState& SimState() const;
+
+        /**
+        * Gets secure specified status from call info
+        * @return TBool the secure specified status (on/off)
+        */
+        TBool SecureSpecified( ) const;
+        
+        /**
+        * Gets the last suplementary services string command information 
+        * from TPESSCommandInfo-structure
+        * @since Series90_1.1
+        * @return Suplementary Services command information. 
+        */
+        const TPESSCommandInfo& SSCommandInfo() const;
+    
+        /**
+        * Sets emergency numbers of the phone to TPEGsmBasicInfo-structure
+        * @since Series90_1.1
+        * @param aEmergencyNumber for emergency number checking.
+        * @return None.
+        */
+        void SetEmergencyNumber( const TPEPhoneNumber& aEmergencyNumbers );
+        
+        /**
+         * Gets remote party name. Contains possible CNAP name or received 
+         * skype identification
+         * @param aCallId Call identification number.
+         * @return Name of the remote party detemined by network.
+         */
+        const TPEContactName& RemotePartyName( 
+            const TInt aCallId ) const;
+        
+        /**
+         * Gets error code from TPEBasicInfo-structure
+         * @return Error code
+         */
+         TInt ErrorCode() const;
+         
+         /**
+         * Sets switch to  number to TPECallCommandInfo-structure
+         * @param aPhoneNumber is the phone number
+         */
+         void SetSwitchToNumberCommand( const TPEPhoneNumber& aPhoneNumber );
+         
+         /**
+         * Gets switch to number
+         * @return Reference to TPEPhoneNumber, containing the phone number.
+         */
+         const TPEPhoneNumber& SwitchToNumberCommand() const;
+         
+         /**
+          * Returns transfer target from the last received unattended transfer 
+          * request or KNullDesC if transfer target is not available.
+          * 
+          * @return  Transfer target.
+          */
+         const TPEPhoneNumber& UnattendedTransferTarget( TInt aCallId ) const;
+         
+         /**
+          * Sets transfer target from the last received unattended transfer request.
+          *
+          * @param   aTarget     Transfer target to set.
+          * @param   aCallId     Call identification number.
+          */
+         void SetUnattendedTransferTarget( const TPEPhoneNumber& aTarget, 
+             TInt aCallId );
+
+        /**
+         * Returns address choices from received call forward request 
+         * or NULL if addresses are not available.
+         * 
+         * @return  Address array.
+         */
+        const CDesC8Array* ForwardAddressChoices( TInt aCallId ) const;
+        
+        /**
+         * Sets address choices from received call forward request.
+         *
+         * @param   aArray      Address array.
+         * @param   aCallId     Call identification number.
+         */
+        void SetForwardAddressChoices( const CDesC8Array* aArray,
+            TInt aCallId );
+         
+        /**
+         * Sets array index for user selected address.
+         *
+         * @param   aIndex     Array index for selected address.
+         */
+        void SetForwardAddressIndex( TInt aIndex );
+        
+        /**
+         * Returns array index for user selected address.
+         *
+         * @return Array index for selected address.
+         */
+        TInt ForwardAddressIndex();
+        
+         /**
+         * Sets unattended transfer target address
+         * @param aTransferTarget Transfer target address
+         * @return None
+         */
+         void SetTransferTargetCommand( const TPEPhoneNumber& aTransferTarget );
+         
+         /**
+         * Returns transfer target address
+         * @return Transfer target address
+         * address.
+         */
+         const TPEPhoneNumber& TransferTargetCommand() const;
+         
+         /**
+         * Sets switch to operation status.
+         * @param aValue switch to operation status.
+         */
+         void SetIsSwitchToOperationOngoing( const TBool aValue );
+         
+         /**
+         * Returns switch to operation status.
+         */
+         TBool IsSwitchToOperationOngoing() const;         
+         
+         /**
+          * From base class MPEEngineInfo
+          * @see MPEEngineInfo::CallOrigin          
+          */
+         TPECallOrigin CallOrigin( const TInt aCallId ) const;
+         
+         /**
+         * Checks if given state can be found.
+         * @param aCallState state to be checked.
+         */
+          TBool CheckIfCallStateExists( const TPEState& aCallState );
+
+    // Functions from MPEDataStore (reading values)
+    public:
+        /**
+        * Gets group ids which are active to play ring tone
+        * @return contact group id
+        */
+        const TArray< TContactItemId > AlertForGroup() const;
+
+        /**
+        * Gets audio mute command value
+        * @return audio mute value for PhoneApplication commands
+        */
+        const TBool& AudioMuteCommand() const;
+
+        /**
+        * Gets audio output command value
+        * @return audio output value for PhoneApplication commands
+        */
+        const TPEAudioOutput& AudioOutputCommand() const;
+        
+        /**
+        * Gets audio note command value
+        * @return audio output value for PhoneApplication commands
+        */
+        TBool ShowNoteCommand() const;
+        
+        /**
+        * Gets audio volume command value
+        * @return audio volume value for Phone Application commands
+        */
+        const TInt& AudioVolumeCommand() const;      
+
+        /**
+        * Gets phone client information of the specified call
+        * @since Series60_2.7
+        * @param aCallId is the call identification number
+        * @return client information of the specified call
+        */
+        const MPEClientInformation& CallClientInformation( const TInt aCallId ) const;
+
+        /**
+        * Get caller image
+        * @param aCallId is the call identification number.
+        * @return caller image
+        */
+        const TPtrC CallerImage( const TInt aCallId ) const;
+
+        /**
+        * Get caller text
+        * @param aCallId is the call identification number.
+        * @return caller text
+        */
+        const TPtrC CallerText( const TInt aCallId ) const;
+
+        /**
+        * Get caller thumbnail
+        * @param aCallId is the call identification number.
+        * @return pointer to thumbnail data
+        */
+        CFbsBitmap* CallerThumbnail( const TInt aCallId ) const;
+        
+        /**
+        * Get caller thumbnail status
+        * @return ETrue if has thumbnail, otherwise EFalse.
+        */
+        TBool HasCallerThumbnail( const TInt aCallId ) const;
+      
+        /**
+        * Gets identification number of a call
+        *
+        * This value is used for determining the target for a command message
+        * that requires such information
+        * @return identification number of a call
+        */
+        const TInt& CallId() const;
+
+        /**
+        * Gets call type information for the attempted call
+        * @return call state of a specified call
+        */
+        const TPECallType& CallTypeCommand( ) const;
+
+        /**
+        * Get remote contact link or id
+        * @param aCallId is the call identification number.
+        * @return contact link or id
+        */
+        const CPhCntContactId& ContactId( const TInt aCallId ) const;
+
+        /**
+        * Get user group ids this contact is assigned to
+        * @param aCallId is the call identification number.
+        * @return array for group ids
+        */
+        const TArray< TContactItemId > ContactGroups(
+            const TInt aCallId ) const;
+
+        /**
+         * Get contact link packet. See virtual phonebook API.
+         * @param aCallId is the call identification number.
+         * @return Virtual phonebook contact link. 
+         */
+        const TDesC8& ContactLink( const TInt aCallId ) const;
+        
+        /**
+        * Gets dtmf string command value
+        * @return dtmf string value for Phone Application commands
+        */
+        const TPEDtmfString& DtmfStringCommand() const;
+        
+        /**
+        * Gets DTMFVoiceMailBoxNumber information for line 1
+        * @return line 1 DTMFVoiceMailBoxNumber information
+        * @return None.
+        */
+        const TPEPhoneNumber& DTMFVoiceMailBoxNumberLine1() const;
+
+        /**
+        * Gets DTMFVoiceMailBoxNumber for Line 2 information from TPEGsmBasicInfo-structure
+        * @return line 2 DTMF VoiceMailBoxNumber information
+        */
+        const TPEPhoneNumber& DTMFVoiceMailBoxNumberLine2() const;
+
+        /**
+        * Gets key code of the last key press
+        * @return key code of the last key press
+        */
+        const TChar& KeyCode() const;
+        
+        /**
+        * Gets keypad volume value
+        * @return keypad volume value
+        */
+        const TInt& KeypadVolume() const;
+
+        /**
+        * Gets a logging indicator
+        * @param aCallId, call identification number     
+        * @return continuous logging indicator
+        */
+        TBool LoggingIndicator( const TInt aCallId ) const;
+        
+        /**
+        * Get missed call indicator
+        * @param aCallId, call identification number
+        * @return missed call indicator
+        */
+        TBool MissedCall( const TInt aCallId ) const;
+
+        /**
+        * Get ringing tone
+        * Returns a ringing tone defined for one of the user groups
+        * if personal tone is not found
+        * @param aCallId, call identification number
+        * @return ringing tone file path
+        */
+        const TPEContactFileName& PersonalRingingTone(
+            const TInt aCallId ) const;
+        
+        /**
+        * Gets personal tone status
+        * @return personal tone status
+        */
+        const TBool& PersonalToneStatus() const;
+
+        /**
+        * Gets profile name
+        * @return profile name.  
+        */
+        const TPEProfileName& ProfileName() const;
+
+        /**
+        * Get contact company name
+        * @param aCallId, call identification number
+        * @return company name
+        */
+        const TPEContactCompany& RemoteCompanyName(
+            const TInt aCallId ) const;
+
+        /**
+        * Get contact name
+        * Depending on user selected language may be in order:
+        * first + last name OR last + first name
+        * @param aCallId, call identification number
+        * @return contact name
+        */
+        const TPEContactName& RemoteName( const TInt aCallId ) const;
+
+        /**
+        * Get remote end phone number
+        * @param aCallId, call identification number
+        * @return phone number
+        */
+        const TPEPhoneNumber& RemotePhoneNumber(
+            const TInt aCallId ) const;
+
+        /**
+        * Get remote end phone number type
+        * @param aCallId, call identification number
+        * @return phone number type
+        */
+        const TPEPhoneNumberIdType& RemotePhoneNumberType(
+            const TInt aCallId ) const;
+
+        /**
+        * Gets text to speech text for this contact. Used in
+        * text to speech ringing tone.
+        * @param aCallId, call identification number
+        * @return descriptor, ownership passed.
+        */
+        const TPtrC RemoteTextToSpeechText(
+            const TInt aCallId ) const;
+
+        /**
+        * Gets remote predefined dtmf strings
+        * @param aCallId, call identification number
+        * @return reference to string array
+        */
+        const  CDesCArray& RemotePredefinedDtmfStrings(
+            const TInt aCallId ) const;
+  
+        /**
+        * Get remote end connected phone number
+        * @param aCallId, call identification number
+        * @return phone number
+        */
+        const TPEPhoneNumber& RemoteColpNumber(
+            const TInt aCallId ) const;
+
+         /**
+        * Gets ringing tone name
+        * @param aCallId, call identification number 
+        * @return name of the current ringing tone
+        */
+        virtual const TPEContactFileName& RingingTone( const TInt& aCallId ) const;
+        
+         /**
+        * Gets current ringing volume
+        * @return the current ringing volume
+        */
+        const TInt& RingingVolume() const;       
+
+        /**
+        * Gets text-to-speech preference setting value
+        * @return text-to-speech status (EFalse/ETrue)
+        */
+        const TBool& TextToSpeech() const; 
+        
+        /**
+         * @see MPEDataStore::UserToUserInformation.
+         */
+        const TPEUserToUserInfo& UserToUserInformation() const;
+
+        /**
+        * Gets two digit support status value
+        * @return two digit support status (EFalse/ETrue)
+        */
+        const TBool& TwoDigitSupportStatus() const; 
+  
+        /**
+        * Gets VoiceMailBoxNumber for Line 1 information from TPEBasicInfo-structure
+        * @return line 1 VoiceMailBoxNumber information
+        */
+        const TPEPhoneNumber& VoiceMailBoxNumberLine1() const;
+
+        /**
+        * Gets VoiceMailBoxNumber for Line 2 information from TPEBasicInfo-structure
+        * @return line 2 VoiceMailBoxNumber information
+        */
+        const TPEPhoneNumber& VoiceMailBoxNumberLine2() const;   
+        
+        /**
+        * Get log forced completion indicator. 
+        * @param TInt aCallId, call identification.
+        * @return TBool&, log forced completion indicator.
+        */
+        TBool LogForcedCompletion( const TInt aCallId ) const;
+
+        /**
+        * Gets whole outgoing phone number
+        * @param TInt aCallId, call identification.
+        * @return TPEPhoneNumber&, remote party number including DTMF string.
+        */
+        const TPEPhoneNumber& WholeOutgoingPhoneNumber( const TInt aCallId ) const;
+                             
+        /**
+        * Gets emergency numbers of the phone from TPEGsmBasicInfo-structure
+        * @return emergency number to be checked for validity
+        */
+        const TPEPhoneNumber& EmergencyNumber() const;
+
+        /**
+        * ResumeHeldCall
+        * @param aCallId is the call identification number.
+        * @return TBool.
+        */
+        TBool ResumeHeldCall( const TInt aCallId ) const;
+        
+        /**
+         * From base class MPEDataStore
+         * @see MPEDataStore::CallIndex
+         */
+        TInt CallIndex( TInt aCallId ) const;
+
+    // Functions from MPEDataStore (setting values)
+    public:
+        /**
+        * Resets TPECallInfo parameters.
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void ResetCallInfo( const TInt aCallId );              
+
+        /**
+        * Reset remote information
+        * @param aCallId is the Call identification number.
+        */
+        void ResetRemoteInfo( const TInt aCallId );
+
+        /**
+        * Set the group id's which are active to play ring tone.
+        * @param aAlertForGroup group id .
+        */
+        void SetAlertForGroup( const TArray< TContactItemId >& aAlertForGroup );
+
+        /**
+        * Sets audio mute state of the phone to TPEBasicInfo-structure
+        * @param aAudioMute is audio mute state of the phone (ETrue = mute on)
+        */
+        void SetAudioMute( const TBool aAudioMute );
+
+        /**
+        * Sets audio output path
+        * @param aOutput is the audio output path.
+        * @param aPreviousOutput is the audio previous output path.
+        * @param aShowNote is audio note value
+        */
+        void SetAudioOutput( const TPEAudioOutput aOutput,
+                                      const TPEAudioOutput aPreviousOutput,
+                                      const TBool aShowNote );
+
+        /**
+        * Sets hands free mode of the phone to TPEBasicInfo-structure
+        * @param aHandsfreeMode is handsfree mode of the phone(on,off).
+        */
+        void SetAvailableAudioOutputs( 
+            const TArray< TPEAudioOutput >& aAvailableOutputs );
+
+        // TODO: change TInt param to enum type when it is available
+        /**
+        * Sets audio output preference to TPEBasicInfo-structure
+        * @param aOutputPreference is audio output preference (public/private)
+        */
+        void SetAudioOutputPreference( const TInt aOutputPreference );
+        
+        /**
+        * Sets audio volume of the phone to TPEBasicInfo-structure
+        * @param aAudioVolume is audio volume of the phone.
+        */
+        void SetAudioVolume( const TInt aAudioVolume );
+
+        /**
+        * Sets phone client information to TPECallInfo-structure
+        * @param aClientInformation includes phone client information.
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallClientInformation( 
+            const MPEClientInformation& aClientInformation, 
+            const TInt aCallId );
+                       
+        /**
+        * Sets Call direction to TPECallInfo-structure
+        * @param aCallDirection is the Call direction value (0=Unknown/1=MO/2=MT)
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallDirection( 
+            const RMobileCall::TMobileCallDirection& aCallDirection, 
+            const TInt aCallId );
+
+        /**
+        * Sets call duration of the last call to Idle to TPEBasicInfo-structure
+        * @param aCallDuration is the duration of the call.
+        */
+        void SetCallDuration( const TInt& aCallDuration ); 
+
+        /**
+        * Sets duration of the call to TPECallInfo-structure
+        * @param aDuration is duration of the call. 
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallDuration( 
+            const TTimeIntervalSeconds& aCallDuration, 
+            const TInt aCallId );
+
+        /**
+        * Set caller image
+        * @param aCallerImage caller image
+        * @param aCallId is the call identification number
+        */
+        void SetCallerImage(
+            const TPtrC aCallerImage, 
+            const TInt aCallId );
+
+        /**
+        * Set caller text
+        * @param aCallerText caller text
+        * @param aCallId is the call identification number
+        */
+        void SetCallerText(
+            const TPtrC aCallerText, 
+            const TInt aCallId );
+
+        /**
+        * Set caller thumbnail
+        * @param aCallerThumbnail caller thumbnail
+        * @param aCallId is the call identification number
+        */
+        void SetCallerThumbnail(
+            CFbsBitmap* aCallerThumbnail, 
+            const TInt aCallId );
+        
+        /**
+        * Set caller thumbnail status
+        * @param aStatus caller thumbnail status
+        * @param aCallId is the call identification number
+        */
+        void SetHasCallerThumbnail(
+            TBool aStatus, 
+            const TInt aCallId );
+
+        /**
+        * Sets call origin for the next call attempt
+        * @param aOrigin indicates if the call is phone, client or SAT originated
+        */
+        void SetCallOriginCommand( const TPECallOrigin& aOrigin );
+
+        /**
+        * Sets predefined dtmf strings
+        * @param aArray, is reference to string array
+        * @param aCallId, is the call identification number
+        */
+        void SetPredefinedDtmfStrings( 
+            const CDesCArray& aArray, 
+            const TInt aCallId );
+ 
+        /**
+        * Sets start time of the call to TPECallInfo-structure
+        * @param aStartTime is the start time of the call.
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallStartTime( const TTime& aCallStartTime, const TInt aCallId );
+
+        /**
+        * Sets Call State value to TPECallInfo-structure
+        * @param aCallState is call state value.
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallState( const TPEState& aCallState, const TInt aCallId );
+
+        /**
+        * Sets call type information
+        * @param aCallType is the call type.
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallType( const TPECallType& aCallType, const TInt aCallId );
+
+        /**
+        * Sets Secure status to call info
+        * @since Series60_4.0
+        * @param SecureStatus is the secure status (on/off)
+        * @param aCallId is the Call identification number.
+        */
+        void SetCallSecureStatus( const TBool aSecureStatus, const TInt aCallId );
+
+        /**
+        * Sets call state of a conference call
+        * @param aCallState is call state value.
+        */
+        void SetConferenceCallState( const TPEState& aCallState );
+        
+        /**
+        * Sets Secure specified status to call info
+        * @since Series60_5.0
+        * @param SecureSpecifiedStatus is the secure status (on/off)
+        */
+        void SetSecureSpecified( const TBool aSecureSpecifiedStatus );        
+        
+        /**
+        * Set user group ids this contact is assigned to
+        * Array is reset if the operation fails.
+        * @param aGroupIdArray array of group ids
+        * @param aCallId is the Call identification number
+        */
+        void SetContactGroups(
+            TArray< TContactItemId >& aGroupIdArray,
+            const TInt aCallId );
+
+        /**
+        * Set contact link or id
+        * @param aContactId pointer to contact id
+        * @param aCallId is the Call identification number
+        * @return 
+        */
+        void SetContactId(
+                CPhCntContactId* aContactId,
+                const TInt aCallId );
+
+        /**
+        * Sets dtmf postfix value to TPEBasicInfo-structure
+        * @param aDtmfPostFix is persed dtmf postfix. 
+        * @param aCallId is the call identification number.
+        */
+        void SetDtmfPostFix( const TPEDtmfString& aDtmfPostFix, const TInt aCallId );
+                
+        /**
+        * Sets dtmf string value to TPEBasicInfo-structure
+        * @param aDtmfString is the dtmf string to be sent. 
+        */
+        void SetDtmfString( const TPEDtmfString& aDtmfString );
+        
+        /**
+        * Sets DTMFVoiceMailBoxNumber for Line 1 information from TPEGsmBasicInfo-structure
+        * @param aDTMFVoiceMailBoxNumberLine1 includes line 1 DTMFVoiceMailBoxNumber information.  
+        */
+        void SetDTMFVoiceMailBoxNumberLine1( const  TDesC& aDTMFVoiceMailBoxNumberLine1 );
+
+        /**
+        * Sets DTMFVoiceMailBoxNumber for Line 2 information from TPEGsmBasicInfo-structure
+        * @param aDTMFVoiceMailBoxNumberLine2 includes line 2 DTMFVoiceMailBoxNumber information.  
+        */
+        void SetDTMFVoiceMailBoxNumberLine2( const  TDesC& aDTMFVoiceMailBoxNumberLine2 );
+ 
+        /**
+        * Sets error code of the phone to TPEBasicInfo-structure
+        * @param aErrorCode is error code value
+        */
+        void SetErrorCode( const TInt aErrorCode );
+
+        /**
+        * Sets Keypad volume of the phone to TPEBasicInfo-structure
+        * @param aKeypadVolume is Keypad volume of the phone.
+        */
+        void SetKeypadVolume( const TInt aKeypadVolume );
+
+        /**
+        * Sets lifetimer data of the phone to TPEBasicInfo-structure
+        * @param aLifeTimerData lifetime data (TDesc8&).
+        */
+        void SetLifeTimerData( TCCPLifeTimeDataPckg& aPckg );
+
+        /**
+        * Sets a logging indicator to TPECallInfo-tructure
+        * @param aLoggingIndicator, Continuous logging indicator.
+        * @param aCallId, the call identification number.
+        */
+        void SetLoggingIndicator( const TBool aLoggingIndicator, const TInt aCallId );
+
+        /**
+        * Set missed call indicator. 
+        * @param TBool& aMissedCall, missed call indicator.
+        * @param TInt aCallId, call identification.
+        */
+        void SetMissedCall( const TBool& aMissedCall, const TInt aCallId );
+
+        /**
+        * Sets network information to TPEBasicInfo-structure
+        * @param aNetworkInfo is the current network information.
+        */
+        void SetNetworkRegistrationStatus( 
+            const TNWNetworkRegistrationStatus& aRegistrationStatus );
+
+        /**
+        * Set personal ringing tone
+        * Used to set a ringing tone defined for one of the user groups
+        * if personal tone is not found
+        * @param aRingingTonepath, personal ringing tone
+        * @param aCallId, call identification number
+        */
+        void SetPersonalRingingTone(
+            const TPEContactFileName& aRingingTonepath,
+            const TInt aCallId );
+
+        /**
+        * Sets personal tone status value to TPEBasicInfo-structure.
+        * @param aPersonalTone is personal tone status (EFalse/ETrue).
+        */
+        void SetPersonalToneStatus( const TInt& aPersonalToneStatus );
+
+        /**
+        * Sets phone number to TPECallCommandInfo-structure
+        * @param aPhoneIdentityParameters is the phone identity parameters
+        */
+        void SetPhoneIdentityParameters( 
+            const TPEPhoneIdentityParameters& aPhoneIdentityParameters );
+        
+        /**
+        * Sets phone number parsing result
+        * @param aServiceCode indicates if phone number a service code
+        */
+        void SetPhoneNumberIsServiceCode( const TBool& aServiceCode );
+
+        /**
+        * Sets profile id to TPEBasicInfo-structure
+        * @param aProfileId is the identification number of the profile
+        */
+        void SetProfileId( const TInt aProfileId );
+
+        /**
+        * Sets profile name to TPEBasicInfo-structure
+        * @param aProfileName is the name of the profile
+        */
+        void SetProfileName( const TPEProfileName& aProfileName );
+
+        /**
+        * Sets remote identity status
+        * @param aIdentity is the status of identity 
+        */
+        void SetRemoteIdentity( 
+            const RMobileCall::TMobileCallRemoteIdentityStatus& aIdentity, 
+            const TInt aCallId );
+
+        /**
+        * Set contact company name
+        * @param aCompanyName company name
+        * @param aCallId, is the call identification number
+        */
+        void SetRemoteCompanyName(
+            const TPEContactName& aCompanyName, 
+            const TInt aCallId );
+
+        /**
+        * Set remote end connected phone number
+        * @param aColpNumber phone number
+        * @param aCallId, is the call identification number.
+        */
+        void SetRemoteColpNumber(
+            TPEPhoneNumber& aColpNumber, 
+            const TInt aCallId );
+
+        /**
+        * Set contact name
+        * Depending on user selected language may be in order:
+        * first + last name OR last + first name
+        * @param aContactName contact name
+        * @param aCallId, is the call identification number
+        */
+        void SetRemoteName(
+            const TPEContactName& aContactName, 
+            const TInt aCallId );
+
+        /**
+        * Set remote end phone number
+        * @param aPhoneNumber phone number
+        * @param aCallId, is the call identification number
+        */
+        void SetRemotePhoneNumber(
+            const TPEPhoneNumber& aPhoneNumber, 
+            const TInt aCallId );
+
+        /**
+        * Set remote end phone number type
+        * @param aPhoneNumberType phone number id
+        * @param aCallId, is the call identification number
+        */
+        void SetRemotePhoneNumberType(
+            TPEPhoneNumberIdType aPhoneNumberType, 
+            const TInt aCallId );
+
+        /**
+        * Set remote end Text To Speech Text
+        * @param aText Text To Speech Text
+        * @param aCallId, is the call identification number
+        */
+        void SetRemoteTextToSpeechText(
+            HBufC* aText,
+            TInt aCallId );
+
+        /**
+        * Sets ringing type to TPEBasicInfo-structure
+        * @param aRingingToneName is the current ringintone name for line 1. 
+        */
+        void SetRingingTone1( const TPEContactFileName& aRingingToneName );
+        
+        /**
+        * Sets ringing type to TPEBasicInfo-structure
+        * @param aRingingToneName is the current ringintone name for line 2.
+        */
+        void SetRingingTone2( const TPEContactFileName& aRingingToneName );
+
+        /**
+        * Sets video call ringing tone name to TPEBasicInfo-structure
+        * @param aRingingToneName is the current ringintone name for video call.
+        */
+        void SetVideoCallRingingTone( 
+            const TPEContactFileName& aRingingToneName );
+        
+        /**
+        * Sets ringing type to TPEBasicInfo-structure
+        * @param aRinginType is the ringintype
+        */
+        void SetRingingType( const TProfileRingingType& aRingingType );
+                
+        /**
+        * Sets ringing volume to TPEBasicInfo-structure
+        * @param aRingingVolume is the current ringingtone name. 
+        */
+        void SetRingingVolume( const TInt& aRingingVolume );
+
+        /**
+        * Sets text-to-speech to TPEBasicInfo-structure
+        * @param aTextToSpeech is the current text-to-speech preference setting. 
+        */
+        void SetTextToSpeech( const TBool aTextToSpeech );
+
+         /**
+        * Sets two digit support status of the phone to TPEBasicInfo-structure
+        * @param aTwoDigitSupportStatus is support status (EFalse/ETrue).
+        */
+        void SetTwoDigitSupportStatus( const TBool aTwoDigitSupportStatus );
+
+        /**
+        * Gets VoiceMailBoxNumber for Line 1 information from TPEGsmBasicInfo-structure
+        * @param aVMBXL1 includes line 1 VoiceMailBoxNumber information.  
+        */
+        void SetVoiceMailBoxNumberLine1( const  TDesC& aVoiceMailBoxNumberLine1 );
+
+        /**
+        * Gets VoiceMailBoxNumber for Line 2 information from TPEGsmBasicInfo-structure
+        * @param aVMBXL2 includes line 2 VoiceMailBoxNumber information.  
+        */
+        void SetVoiceMailBoxNumberLine2( const  TDesC& aVoiceMailBoxNumberLine2 );
+
+        /**
+        * Set log forced completion indicator. 
+        * @param TBool aForcedCOmpletion, log forced completion indicator.
+        * @param TInt aCallId, call identification.
+        */
+        void SetLogForcedCompletion(  const TBool aForcedCompletion, const TInt aCallId );
+       
+        /**
+        * Sets whole outgoing phone number 
+        * @param aPhoneNumber is the phone number
+        * @param TInt aCallId, call identification.
+        */
+        void SetWholeOutgoingPhoneNumber( 
+            const TPEPhoneNumber& aPhoneNumber, 
+            const TInt aCallId );
+        
+        /**
+        * Returns the service-id used for the command.
+        * @since S60 3.2
+        * @param none
+        * @return TUint32 Service-id
+        */
+        TUint32 ServiceIdCommand() const;
+        
+        /**
+        * Set the service-id for the command.
+        * @since S60 3.2
+        * @param TUint32 Service-id
+        * @return none
+        */
+        void SetServiceIdCommand( TUint32 aServiceId );
+        
+        /**
+        * Returns the service-id used for the call.
+        * @since S60 3.2
+        * @param none
+        * @return TUint32 Service-id
+        */
+        TUint32 ServiceId( const TInt aCallId ) const;
+        
+        /**
+        * Set the service-id for the call.
+        * @since S60 3.2
+        * @param TUint32 Service-id
+        * @return none
+        */
+        void SetServiceId( const TInt aCallId, TUint32 aServiceId );
+        
+                
+        /**
+        * Sets Barring information to TPEGsmBasicInfo-structure
+        * @param aBarringInfo includes call Barring information
+        * @return
+        */
+        void SetBarringInfo( const TPEBarringInfo& aBarringInfo );
+
+        /**
+        * Sets Confrence value to TPEGsmCallInfo-structure
+        * @param aCallConference informs is the call a member of conference call. 
+        * -2 = normal call, -1 = conference master, >= 0 master id
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetCallConference( const TInt aCallConference, const TInt aCallId );
+
+        /**
+        * Sets Call control caps to TPEGsmCallInfo-structure
+        * @param aCallControlCaps the value of the call control caps
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetCallControlCaps( const TPECallControlCaps& aCallControlCaps, const TInt aCallId );
+
+        /**
+        * Sets forwarded value to TPEGsmCallInfo-structure
+        * @param aForwarded Indicates if incoming call was forwarded
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetCallForwarded( const TBool aCallForwarded, const TInt aCallId );
+
+        /**
+        * Sets Call service to TPEGsmCallInfo-structure
+        * @param aCallService is the Call service value
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetCallService( 
+            const RMobilePhone::TMobileService& aCallService, 
+            const TInt aCallId );
+
+       /**
+        * Sets Conference capabilities to TPEGsmCallInfo structure.
+        * @param aCaps, conference capabilities
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetConferenceCallCaps( const TUint32 aCaps, const TInt aCallId );
+
+        /**
+        * Sets added or removed members TName information to TPEGsmCallInfo structure
+        * @param aName is the TName information of added or removed member.
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetConferenceMemberInfo( 
+            const TName& aConferenceMemberName, 
+            const TInt aConferenceMemberCallId, 
+            const TInt aCallId );
+
+        /**
+        * Sets deflect information to the TPEGsmBasicInfo structure.
+        * @param aActiveForward is the active forward information.
+        * @return None.
+        */
+        void SetDeflectInfo( const TPEActiveForwardInfo& aActiveForward );           
+
+        /**
+        * Set iResumeHeldCall value to TPEGsmCallInfo structure
+        * @param aResumeHeldCall
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetResumeHeldCall( const TBool aResumeHeldCall, const TInt aCallId );
+
+        /**
+        * Sets the number of conference members to TPEGsmCallInfo structure
+        * @param aNumberOfMembers, number of conference members
+        * @param aCallId is the Call identification number.
+        * @return None.
+        */
+        void SetNumberOfConferenceMembers( const TInt aNumberOfMembers, const TInt aCallId );
+
+        /**
+        * Sets Sim state to TPEGsmBasicInfo-structure
+        * @param aSimState is the Sim state
+        * @return None.
+        */
+        void SetSimState( const TPESimState& aSimState );
+
+        /**
+        * Sets Suplementary Services command information to TPESSCommandInfo-structure
+        * @param aSSCommandInfo includes Suplementary Services command information.  
+        * @return None.
+        */
+        void SetSSCommandInfo( const TPESSCommandInfo& aSSCommandInfo );
+
+        /**
+         * @see MPEDataStore::UserToUserInformation
+         * @since S60 5.0
+         */
+        void SetUserToUserInformation( const TPEUserToUserInfo& aUUI );
+        
+        /**
+         * Sets remote party name given by network to TPECallInfo structure.
+         * @param aName Remote party name.
+         * @param aCallId Call identification number.
+         */
+        void SetRemotePartyName(    
+            const TPEContactName& aName, 
+            const TInt aCallId );
+
+        CCCECallParameters& CallParameters();       
+        
+        /**
+         * From base class MPEDataStore
+         * @see MPEDataStore::SetCallIndex
+         */
+        void SetCallIndex( TInt aCallIndex, TInt aCallId );
+        
+        /**
+         * From base class MPEDataStore
+         * @see MPEDataStore::SetCallOrigin          
+         */
+        void SetCallOrigin( TPECallOrigin aOrigin, TInt aCallId );
+      
+        /**
+        * Sets call Phonebook contact identifier.
+        * @param aContactId is the contact identifier for a call
+        */
+        void SetContactId2( const TInt aContactId );
+
+        /**
+         * Returns Phonebook contact identifier.
+         */
+        TInt ContactId2() const;
+          
+    private:
+          /**
+        * C++ default constructor.
+        */
+        CPEEngineInfoImpl();
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();                      
+
+    protected: // Data
+        // Contains information of the calls
+        RPointerArray<CPECallInfo> iCurrentCalls;
+
+        // Contains information of the conference call
+        TPEConferenceCallInfo iConferenceCallInfo;
+        
+        // For Mobile Originated Call Commands information
+        TPECallCommandInfo iCallCommandInfo;
+
+        // Contains information of the phone related variables 
+        TPEBasicInfo iBasicInfo;
+
+        // Remote data array
+        RPointerArray< CPERemoteInfo >* iRemoteInfo;
+
+        // Available audio outputs array
+        TFixedArray<TBool, KPEMaxAudioOutputs> iAvailableAudioOutputs;
+
+        // Contains the group id's which are active for ringtone
+        RArray< TContactItemId > iAlertForGroup;
+
+        /**
+         * CCE call dial parameters
+         */
+        CCCECallParameters *iCallParams;
+
+        /**
+         * Phonebook contact identifier.
+         */
+        TInt iContactId;
+    };
+
+
+#endif // CPEENGINEINFOIMPL_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/cperemoteinfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,349 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPERemoteInfo object
+*
+*/
+
+
+#ifndef CPEREMOTEINFO_H
+#define CPEREMOTEINFO_H
+
+#include <e32base.h>
+#include "pevirtualengine.h"
+
+class CPhCntContactId;
+
+/**
+ *  Remote info definition
+ *
+ *  This class defines the call remote end information
+ *  used for contact matching and logging
+ *
+ *  @lib PhoneEngine.lib
+ *  @since S60 v4.0
+ */
+NONSHARABLE_CLASS( CPERemoteInfo ) : public CBase
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     */
+    static CPERemoteInfo* NewL();
+
+    /**
+     * Destructor
+     */
+    virtual ~CPERemoteInfo();
+
+    /**
+     * Get call id associated with this information
+     * @return call identification number
+     */
+    TInt CallId() const;
+
+    /**
+     * Get contact link or id
+     * @return contact link or id
+     */
+    const CPhCntContactId& ContactId() const;
+
+    /**
+     * Get contact link.
+     * @return Virtual phonebook contact link
+     */
+    const TDesC8& ContactLink() const;
+    
+    /**
+     * Get remote end phone number
+     * @return phone number
+     */
+    const TPEPhoneNumber& PhoneNumber() const;
+
+    /**
+     * Get remote end connected phone number
+     * @return phone number
+     */
+    const TPEPhoneNumber& ColpNumber() const;
+
+    /**
+     * Get contact name
+     * Depending on user selected language may be in order:
+     * first + last name OR last + first name
+     * @return contact name
+     */
+    const TPEContactName& Name() const;
+
+    /**
+     * Get contact company name
+     * @return company name
+     */
+    const TPEContactCompany& CompanyName() const;
+
+    /**
+     * Get ringing tone
+     * Returns a ringing tone defined for one of the user groups
+     * if personal tone is not found
+     * @return ringing tone file path
+     */
+    const TPEContactFileName& PersonalRingingTone() const;
+
+    /**
+     * Get remote end phone number type
+     * @return phone number type
+     */
+    const TPEPhoneNumberIdType& PhoneNumberType() const;
+
+    /**
+    * Get text to speech text for this contact. Used in
+    * text to speech ringing tone.
+    * @return descriptor, ownership passed.
+    */
+    const TPtrC TextToSpeechText() const;
+
+    /**
+     * Get user group ids this contact is assigned to
+     * @return array for group ids
+     */
+    const TArray< TContactItemId > ContactGroups() const;
+
+    /**
+     * Get caller text
+     * @return caller text
+     */
+    const TPtrC CallerText() const;
+
+    /**
+     * Get caller image
+     * @return caller image
+     */
+    const TPtrC CallerImage() const;
+
+    /**
+     * Get caller thumbnail
+     * @return pointer to thumbnail data
+     */
+    CFbsBitmap* CallerThumbnail() const;
+
+    /**
+     * Get caller thumbnail status
+     * @return status of caller thumbnail
+     */
+    TBool HasCallerThumbnail() const;
+
+    /**
+     * Get predefined dtmf strings
+     * @return reference to string array
+     */
+    CDesCArray& PredefinedDtmfStrings();
+     
+    /**
+     * Set call association for this information
+     * @param aContactId pointer to contact id
+     */
+    void SetCallId( const TInt aCallId );
+
+    /**
+     * Set contact link or id
+     * @param aContactId pointer to contact id
+     */
+    void SetContactId( CPhCntContactId* aContactId );
+
+    /**
+     * Set remote end phone number
+     * @param aPhoneNumber phone number
+     */
+    void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber );
+
+    /**
+     * Set remote end connected phone number
+     * @param aColpNumber phone number
+     */
+    void SetColpNumber( const TPEPhoneNumber& aColpNumber );
+
+    /**
+     * Set contact name
+     * Depending on user selected language may be in order:
+     * first + last name OR last + first name
+     * @param aContactName contact name
+     */
+    void SetName( const TPEContactName& aContactName );
+
+    /**
+     * Set contact company name
+     * @param aCompanyName company name
+     */
+    void SetCompanyName( const TPEContactName& aCompanyName );
+
+    /**
+     * Set ringing tone
+     * @param aPersonalRingingTone ringing tone file path
+     */
+    void SetPersonalRingingTone(
+        const TPEContactFileName& aPersonalRingingTone );
+
+    /**
+     * Set remote end phone number type
+     * @param aPhoneNumberType phone number id
+     */
+    void SetPhoneNumberType( const TPEPhoneNumberIdType aPhoneNumberType );
+
+    /**
+     * Set remote end Text To Speech Text
+     * @param aText Text To Speech Text
+     */
+    void SetTextToSpeechText( HBufC* aText );
+
+    /**
+     * Set user group ids this contact is assigned to
+     * Array is reset if the operation fails.
+     * @param aGroupIdArray array of group ids
+     */
+    void SetContactGroups( const TArray< TContactItemId >& aGroupIdArray );
+
+    /**
+     * Set caller text
+     * @param aCallerText caller text
+     */
+    void SetCallerText( const TPtrC aCallerText );
+
+    /**
+     * Set caller image
+     * @param aCallerImage caller image
+     */
+    void SetCallerImage( const TPtrC aCallerImage );
+
+    /**
+     * Set caller thumbnail
+     * @param aCallerThumbnail  caller thumbnail
+     */
+    void SetCallerThumbnail( CFbsBitmap* aCallerThumbnail );
+
+    /**
+     * Set caller thumbnail status
+     * @param aStatus  caller thumbnail status
+     */
+    void SetHasCallerThumbnail( TBool aStatus );
+
+    /**
+     * Set predefined dtmf strings
+     * @param aArray, is reference to sring array 
+     */
+    void SetPredefinedDtmfStrings( 
+            const CDesCArray& aArray );           
+    /**
+     * Reset remote information
+     * Resets all member data
+     */
+    void ResetRemoteInfo();
+
+private:
+
+    /**
+     * Constructor
+     */
+    CPERemoteInfo();
+
+private: // data
+
+    /**
+     * Call id association
+     */
+    TInt iCallId;
+
+    /**
+     * Contact link or id
+     * Own.
+     */
+    CPhCntContactId* iContactId;
+
+    /**
+     * Contact link
+     * Own.
+     */
+    HBufC8* iContactLink;
+    
+    /**
+     * Remote end phone number
+     */
+    TPEPhoneNumber iPhoneNumber;
+
+    /**
+     * Remote end phone number if the mobile originated call was forwarded
+     */
+    TPEPhoneNumber iColpNumber;
+
+    /**
+     * First name + Last name
+     */
+    TPEContactName iName;
+
+    /**
+     * Remote end company name
+     */
+    TPEContactCompany iCompanyName;
+
+    /**
+     * Remote end personal or group ringing tone
+     */
+    TPEContactFileName iPersonalRingingTone;
+
+    /**
+     * Remote end phone number type
+     */
+    TPEPhoneNumberIdType iPhoneNumberType;
+
+    /**
+     * Remote end Text To Speech text
+     */
+    HBufC* iTextToSpeechText;
+
+    /**
+     * Array for caller group ids
+     * Own.
+     */
+    RArray< TContactItemId > iGroupId;
+
+    /**
+     * Caller text
+     */
+    HBufC* iCallerText;
+
+    /**
+     * Caller image
+     */
+    HBufC* iCallerImage;
+
+    /**
+     * Caller thumbnail image
+     * Own.
+     */
+    CFbsBitmap* iCallerThumbnail;
+    
+    /**
+     * Caller thumbnail image status
+     * Own.
+     */
+    TBool iHasCallerThumbnail;    
+    
+    /**
+     * Dtmf array
+     *  
+     */
+    CDesCArray* iPredefinedDtmfStrings;
+    
+    
+    };
+
+#endif // CPEREMOTEINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/mpeclientinformation.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class to access the client information of a call
+*
+*/
+
+#ifndef MPECLIENTINFORMATION_H
+#define MPECLIENTINFORMATION_H
+
+#include <pevirtualengine.h>
+
+/**
+ * Interface to access the client information of a single call.
+ */
+NONSHARABLE_CLASS( MPEClientInformation )
+    {
+    
+public:
+    
+    /**
+     * Resets the state of this client information.
+     */
+    virtual void Reset() = 0;
+    
+    /**
+     * Sets information from another client information.
+     * 
+     * @param   aSource         Client information to set.
+     */
+    virtual void Set( const MPEClientInformation& aSource ) = 0;
+    
+    /**
+     * Sets the contact link used for retrieving contact information.
+     * 
+     * Should be available when dialing from Phonebook.
+     * 
+     * @param   aLink           Contact link to set.
+     */
+    virtual void SetContactLink( const TDesC8& aLink ) = 0;
+
+    /**
+     * Returns the contact link used for retrieving contact information.
+     * 
+     * @return  Contact link used for retrieving contact information.
+     */
+    virtual const TDesC8& ContactLink() const = 0;
+    
+    /**
+     * Sets the name corresponding the phone number.
+     * 
+     * Must be defined if showing the phone number is disabled.
+     * 
+     * @param   aName           Name corresponding the phone number.
+     */
+    virtual void SetName( const TName& aName ) = 0;
+    
+    /**
+     * Returns the name corresponding the phone number.
+     * 
+     * @return  Name corresponding the phone number.
+     */
+    virtual const TName& Name() const = 0;
+    
+    /**
+     * Sets the phone number to be dialed.
+     * 
+     * @param   aNumber         Phone number to set.
+     */
+    virtual void SetNumber( const TPEPhoneNumber& aNumber ) = 0;
+    
+    /**
+     * Returns the phone number to be dialed.
+     * 
+     * @return  Phone number to be dialed.
+     */
+    virtual const TPEPhoneNumber& Number() const = 0;
+    
+    /**
+     * Sets the type of the call.
+     * 
+     * @param   aType           Type of the call to set.
+     */
+    virtual void SetCallType( TPECallType aType ) = 0;
+    
+    /**
+     * Returns the type of the call.
+     * 
+     * @return  Type of the call.
+     */
+    virtual TPECallType CallType() const = 0;
+
+    /**
+     * Enables or disables contact matching.
+     * 
+     * @param   aAllow          Flag to enable or disable contact matching.
+     */
+    virtual void SetAllowMatch( TBool aAllow ) = 0;
+    
+    /**
+     * Returns if contact matching is allowed.
+     * 
+     * @return  Flag to indicate if contact matching is allowed.
+     */
+    virtual TBool AllowMatch() const = 0;    
+        
+    /**
+     * Shows or hides the phone number that is being dialed.
+     * 
+     * @param   aShow           Flag to indicate if the phone number being dialed should be shown.
+     */
+    virtual void SetShowNumber( TBool aShow ) = 0;
+    
+    /**
+     * Returns a flag indicating if the phone number being dialed should be shown.
+     * 
+     * @return  Flag indicating if the phone number being dialed should be shown.
+     */
+    virtual TBool ShowNumber() const = 0;
+    
+    /**
+     * Flag to indicate if existing calls should be terminated before this one is being attempted.
+     * 
+     * @param   aEndOtherCalls      Flag to indicate if existing calls should be terminated 
+     *                              before this one is being attempted.
+     */
+    virtual void SetEndOtherCalls( TBool aEndOtherCalls ) = 0;
+    
+    /**
+     * Returns a flag indicating if existing calls should be terminated before this one is being attempted.
+     * 
+     * @return  Flag indicating if existing calls should be terminated before this one is being attempted.
+     */
+    virtual TBool EndOtherCalls() const = 0;
+    
+    };
+
+#endif // MPECLIENTINFORMATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/mpedatastore.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,823 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class for DataStore of the PhoneEngine
+*
+*/
+
+
+#ifndef MPEDATASTORE_H
+#define MPEDATASTORE_H
+
+//  INCLUDES
+#include <mpeengineinfo.h>
+#include <cphcntcontactid.h>
+#include <ccpdefs.h>
+#include <mccecall.h>
+
+class MPEClientInformation;
+
+
+// CLASS DECLARATION
+
+/**
+*  Offers data store interface to phone engine
+*  
+*
+*  @lib phoneengine.lib
+*  @since Series 60 5.0
+*/
+NONSHARABLE_CLASS( MPEDataStore )
+    : public MPEEngineInfo
+    {
+    public: // New functions
+    
+        /**
+        * Gets audio mute command value
+        * @return audio mute value for PhoneApplication commands
+        */
+        virtual const TBool& AudioMuteCommand() const = 0;
+        
+        /**
+        * Gets audio output preference
+        * @return audio output preference
+        */
+        virtual const TInt& AudioOutputPreference() const = 0;
+
+        /**
+        * Gets audio output command value
+        * @return audio output value for PhoneApplication commands
+        */
+        virtual const TPEAudioOutput& AudioOutputCommand() const = 0;
+        
+        /**
+        * Gets audio output command value
+        * @return audio output value for PhoneApplication commands
+        */
+        virtual TBool ShowNoteCommand() const = 0;
+          
+        /**
+        * Gets audio volume command value
+        * @return audio volume value for Phone Application commands
+        */
+        virtual const TInt& AudioVolumeCommand() const = 0;      
+
+        /**
+        * Get remote contact link or id
+        * @param aCallId is the call identification number.
+        * @return contact link or id
+        */
+        virtual const CPhCntContactId& ContactId( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets dtmf postfix
+        * @param aCallId is the call identification number.
+        * @return dtmf postfix
+        */
+        virtual const TPEDtmfString& DtmfPostFix( const TInt aCallId  ) const = 0;     
+
+        /**
+        * Gets dtmf string command value
+        * @return dtmf string value for Phone Application commands
+        */
+        virtual const TPEDtmfString& DtmfStringCommand() const = 0;
+        
+        /**
+        * Gets DTMFVoiceMailBoxNumber information for line 1
+        * @return line 1 DTMFVoiceMailBoxNumber information
+        */
+        virtual const TPEPhoneNumber& DTMFVoiceMailBoxNumberLine1() const = 0;
+
+        /**
+        * Gets DTMFVoiceMailBoxNumber information for line 2
+        * @return line 2 DTMF VoiceMailBoxNumber information
+        */
+        virtual const TPEPhoneNumber& DTMFVoiceMailBoxNumberLine2() const = 0;
+        
+        /**
+        * Gets error code from TPEBasicInfo-structure
+        * @return Error code
+        */
+        virtual TInt ErrorCode() const = 0;
+
+        /**
+        * Gets correct inband tone for specific call state transition or error
+        * @return the inband tone to be played
+        */
+        virtual const TCCPTone& InbandTone() const = 0;
+        
+        /**
+        * Gets call origin for next call attempt
+        * @return value indicates if the call is phone, client or SAT originated
+        */
+        virtual const TPECallOrigin& CallOriginCommand() const = 0;
+
+        /**
+         * Reset remote information
+        * @param aCallId is the Call identification number.
+         */
+        virtual void ResetRemoteInfo( const TInt aCallId ) = 0;
+
+        
+        /**
+         * Gets user to user information. If this is set before dial, the
+         * data is sent to network.
+         *
+         * @return User to user info.
+         */
+        virtual const TPEUserToUserInfo& UserToUserInformation() const = 0;
+
+        /**
+        * Set the group id's which are active to play ring tone.
+        * @param aAlertForGroup group id .
+        */
+        virtual void SetAlertForGroup( const TArray< TContactItemId >& aAlertForGroup ) = 0;  
+        
+        /**
+        * Sets active als line value to the TPEGsmBasicInfo structure.
+        * @param aALSLine is the active als line value.
+        */
+        virtual void SetALSLine( const CCCECallParameters::TCCELineType& aALSLine ) = 0;
+             
+        /**
+        * Sets ALS support value to the TPEGsmBasicInfo structure.
+        * @param aALSLineSupport is the ALS support value.
+        */
+        virtual void SetALSLineSupport( const TBool& aALSLineSupport ) = 0;
+   
+        /**
+        * Sets audio mute state of the phone to TPEBasicInfo-structure
+        * @param aAudioMute is audio mute state of the phone (ETrue = mute on)
+        */
+        virtual void SetAudioMute( const TBool aAudioMute ) = 0;
+        
+        /**
+        * Sets audio output path
+        * @param aOutput is the audio previous output path.
+        * @param aPreviousOutput is the audio previous output path.
+        * @param aShowNote is audio note value
+        */
+        virtual void SetAudioOutput( const TPEAudioOutput aOutput,
+                                     const TPEAudioOutput aPreviousOutput,
+                                     const TBool aShowNote ) = 0;
+
+        /**
+        * Sets hands free mode of the phone to TPEBasicInfo-structure
+        * @param aHandsfreeMode is handsfree mode of the phone(on,off).
+        */
+        virtual void SetAvailableAudioOutputs( 
+            const TArray< TPEAudioOutput >& aAvailableOutputs ) = 0;
+        
+        // TODO: change TInt param to enum type when it is available
+        /**
+        * Sets audio output preference to TPEBasicInfo-structure
+        * @param aOutputPreference is audio output preference (public/private)
+        */
+        virtual void SetAudioOutputPreference( const TInt aOutputPreference ) = 0;
+        
+        /**
+        * Sets audio volume of the phone to TPEBasicInfo-structure
+        * @param aAudioVolume is audio volume of the phone.
+        */
+        virtual void SetAudioVolume( const TInt aAudioVolume ) = 0;
+
+        /**
+        * Sets alsline value to TPECallInfo-structure
+        * @param aALSLine informs which line is selected active
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallALSLine( const CCCECallParameters::TCCELineType& aALSLine, const TInt aCallId ) = 0;
+        
+        /**
+        * Sets phone client information to TPECallInfo-structure
+        * @param aClientInformation includes phone client information.
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallClientInformation( 
+            const MPEClientInformation& aClientInformation, 
+            const TInt aCallId ) = 0;
+                       
+        /**
+        * Sets Call direction to TPECallInfo-structure
+        * @param aCallDirection is the Call direction value (0=Unknown/1=MO/2=MT)
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallDirection( 
+            const RMobileCall::TMobileCallDirection& aCallDirection, 
+            const TInt aCallId ) = 0;
+    
+        /**
+        * Sets call duration of the last call to Idle to TPEBasicInfo-structure
+        * @param aDiagnostics is call terminated diagnostics value
+        */
+        virtual void SetCallDuration( const TInt& aCallDuration ) = 0;       
+
+        /**
+        * Sets duration of the call to TPECallInfo-structure
+        * @param aDuration is duration of the call. 
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallDuration( 
+            const TTimeIntervalSeconds& aCallDuration, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Set caller image
+        * @param aCallerImage caller image
+        * @param aCallId is the call identification number
+        */
+        virtual void SetCallerImage(
+            const TPtrC aCallerImage,
+            const TInt aCallId ) = 0;
+
+        /**
+        * Set caller text
+        * @param aCallerText caller text
+        * @param aCallId is the call identification number
+        */
+        virtual void SetCallerText( const TPtrC aCallerText, const TInt aCallId ) = 0;
+
+        /**
+        * Set caller thumbnail
+        * @param aCallerThumbnail caller thumbnail
+        * @param aCallId is the call identification number
+        */
+        virtual void SetCallerThumbnail(
+            CFbsBitmap* aCallerThumbnail, 
+            const TInt aCallId ) = 0;
+            
+        /**
+        * Set status of caller thumbnail 
+        * @param aStatus caller thumbnail status
+        * @param aCallId is the call identification number
+        */
+        virtual void SetHasCallerThumbnail( TBool aStatus, const TInt aCallId  ) = 0;
+        
+        /**
+        * Sets start time of the call to TPECallInfo-structure
+        * @param aStartTime is the start time of the call.
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallStartTime( const TTime& aCallStartTime, const TInt aCallId ) = 0;
+        
+        /**
+        * Sets Call State value to TPECallInfo-structure
+        * @param aCallState is call state value.
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallState( const TPEState& aCallState, const TInt aCallId ) = 0;
+
+        /**
+        * Sets call type information
+        * @param aCallType is the call type.
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallType( const TPECallType& aCallType, const TInt aCallId ) =  0;
+
+        /**
+        * Sets Secure status to call info
+        * @param SecureStatus is the secure status (on/off)
+        * @param aCallId is the Call identification number.
+        */
+        virtual void SetCallSecureStatus( const TBool aSecureStatus, const TInt aCallId ) = 0;
+
+        /**
+        * Sets call state of a conference call
+        * @param aCallState is call state value.
+        */
+        virtual void SetConferenceCallState( const TPEState& aCallState ) = 0;
+        
+        /**
+        * Set user group ids this contact is assigned to
+        * Array is reset if the operation fails.
+        * @param aGroupIdArray array of group ids
+        * @param aCallId is the Call identification number
+        */
+        virtual void SetContactGroups(
+            TArray< TContactItemId >& aGroupIdArray,
+            const TInt aCallId ) = 0;
+
+        /**
+        * Set contact link or id
+        * @param aContactId pointer to contact id
+        * @param aCallId is the Call identification number
+        */
+        virtual void SetContactId(
+            CPhCntContactId* aContactId,
+            const TInt aCallId ) = 0;
+
+        /**
+        * Sets the name of data port currently on-loan.
+        * Data port loaning is handled by CSPlugin and happens when a data
+        * call goes into connected state. The dataport is released when VT components
+        * indicate it can be released, i.e. video call hangup.
+        * @param aName is Data port name
+        */
+        virtual void SetDataPortName( const TName& aDataPortName ) = 0;
+        
+        /**
+        * Sets dtmf postfix value to TPEBasicInfo-structure
+        * @param aDtmfPostFix is persed dtmf postfix. 
+        * @param aCallId is the call identification number.
+        */
+        virtual void SetDtmfPostFix( const TPEDtmfString& aDtmfPostFix, const TInt aCallId ) = 0;
+  
+        /**
+           
+        /**
+        * Sets dtmf string value to TPEBasicInfo-structure
+        * @param aDtmfString is the dtmf string to be sent. 
+        */
+        virtual void SetDtmfString( const TPEDtmfString& aDtmfString ) = 0;
+        
+        /**
+        * Sets DTMFVoiceMailBoxNumber for Line 1 information from TPEGsmBasicInfo-structure
+        * @param aDTMFVoiceMailBoxNumberLine1 includes line 1 DTMFVoiceMailBoxNumber information.  
+        */
+        virtual void SetDTMFVoiceMailBoxNumberLine1( 
+            const TDesC& aDTMFVoiceMailBoxNumberLine1 ) = 0;
+
+        /**
+        * Sets DTMFVoiceMailBoxNumber for Line 2 information from TPEGsmBasicInfo-structure
+        * @param aDTMFVoiceMailBoxNumberLine2 includes line 2 DTMFVoiceMailBoxNumber information.  
+        */
+        virtual void SetDTMFVoiceMailBoxNumberLine2( 
+            const TDesC& aDTMFVoiceMailBoxNumberLine2 ) = 0;
+        
+        /**
+        * Sets error code of the phone to TPEBasicInfo-structure
+        * @param aErrorCode is error code value
+        */
+        virtual void SetErrorCode( const TInt aErrorCode ) = 0;
+
+        /**
+        * Sets correct inband tone for specific call state transition or error
+        * @param aTone is the inband tone to be played
+        */
+        virtual void SetInbandTone( const TCCPTone aTone ) = 0;
+            
+        /**
+        * Sets Keypad volume of the phone to TPEBasicInfo-structure
+        * @param aKeypadVolume is Keypad volume of the phone.
+        */
+        virtual void SetKeypadVolume( const TInt aKeypadVolume ) = 0;
+        
+        /**
+        * Sets lifetimer data of the phone to TPEBasicInfo-structure
+        * @param aLifeTimerData lifetime data (TDesc8&).
+        */
+        virtual void SetLifeTimerData( TCCPLifeTimeDataPckg& aPckg ) = 0;   
+        
+        /**
+        * Sets a logging indicator to TPECallInfo-tructure
+        * @param aLoggingIndicator, Continuous logging indicator.
+        * @param aCallId, the call identification number.
+        */
+        virtual void SetLoggingIndicator( const TBool aLoggingIndicator, const TInt aCallId ) = 0;
+       
+        /**
+        * Set missed call indicator. 
+        * @param TBool& aMissedCall, missed call indicator.
+        * @param TInt aCallId, call identification.
+        */
+        virtual void SetMissedCall( const TBool& aMissedCall, const TInt aCallId ) = 0; 
+          
+        /**
+        * Sets network information to TPEBasicInfo-structure
+        * @param aNetworkInfo is the current network information.
+        */
+        virtual void SetNetworkRegistrationStatus( 
+            const TNWNetworkRegistrationStatus& aRegistrationStatus ) = 0;
+
+        /**
+        * Set personal ringing tone
+        * Used to set a ringing tone defined for one of the user groups
+        * if personal tone is not found
+        * @param aRingingTonepath, personal ringing tone
+        * @param aCallId, call identification number
+        */
+        virtual void SetPersonalRingingTone(
+            const TPEContactFileName& aRingingTonepath,
+            const TInt aCallId ) = 0;
+
+        /**
+        * Sets personal tone status value to TPEBasicInfo-structure.
+        * @param aPersonalTone is personal tone status (EFalse/ETrue).
+        */
+        virtual void SetPersonalToneStatus( const TInt& aPersonalToneStatus ) = 0;
+        
+        /**
+        * Set phone number parsing result
+        * @param TBool& aServiceCode, service code indicator
+        */
+        virtual void SetPhoneNumberIsServiceCode( const TBool& aServiceCode ) = 0;
+ 
+        /**
+        * Sets phone number to TPECallCommandInfo-structure
+        * @param aPhoneIdentityParameters is the phone identity parameters
+        */
+        virtual void SetPhoneIdentityParameters( 
+            const TPEPhoneIdentityParameters& aPhoneIdentityParameters ) = 0;
+
+        /**
+        * Sets call origin for the next call attempt
+        * @param aOrigin indicates if the call is phone, client or SAT originated
+        */
+        virtual void SetCallOriginCommand( const TPECallOrigin& aOrigin ) = 0;
+         
+        /**
+        * Sets profile id to TPEBasicInfo-structure
+        * @param aProfileId is the identification number of the profile
+        */
+        virtual void SetProfileId( const TInt aProfileId ) = 0;   
+        
+        /**
+        * Sets profile name to TPEBasicInfo-structure
+        * @param aProfileName is the name of the profile
+        */
+        virtual void SetProfileName( const TPEProfileName& aProfileName ) = 0;
+
+        /**
+        * Set contact company name
+        * @param aCompanyName company name
+        * @param aCallId, is the call identification number
+        */
+        virtual void SetRemoteCompanyName(
+            const TPEContactName& aCompanyName, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Sets remote identity status
+        * @param aIdentity is the status of identity 
+        */
+        virtual void SetRemoteIdentity( 
+            const RMobileCall::TMobileCallRemoteIdentityStatus& aIdentity, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Set contact name
+        * Depending on user selected language may be in order:
+        * first + last name OR last + first name
+        * @param aContactName contact name
+        * @param aCallId, is the call identification number
+        */
+        virtual void SetRemoteName(
+            const TPEContactName& aContactName, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Set remote end phone number
+        * @param aPhoneNumber phone number
+        * @param aCallId, is the call identification number
+        */
+        virtual void SetRemotePhoneNumber(
+            const TPEPhoneNumber& aPhoneNumber, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Set remote end phone number type
+        * @param aPhoneNumberType phone number id
+        * @param aCallId, is the call identification number
+        */
+        virtual void SetRemotePhoneNumberType(
+            TPEPhoneNumberIdType aPhoneNumberType, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Set remote end Text To Speech Text
+        * @param aText Text To Speech Text
+        * @param aCallId, is the call identification number
+        */
+        virtual void SetRemoteTextToSpeechText(
+            HBufC* aText,
+            TInt aCallId ) = 0;
+
+        /**
+        * Sets ringing type to TPEBasicInfo-structure
+        * @param aRingingToneName is the current ringintone name for line 1. 
+        */
+        virtual void SetRingingTone1(
+            const TPEContactFileName& aRingingToneName ) = 0;
+        
+        /**
+        * Sets ringing type to TPEGsmBasicInfo-structure
+        * @param aRingingToneName is the current ringintone name for line 2.
+        */
+        virtual void SetRingingTone2(
+            const TPEContactFileName& aRingingToneName ) = 0;
+
+        /**
+        * Sets video call ringing tone name to TPEGsmBasicInfo-structure
+        * @param aRingingToneName is the current ringintone name for video call.
+        */
+        virtual void SetVideoCallRingingTone( const TPEContactFileName& aRingingToneName ) = 0;
+                
+        /**
+        * Sets ringing type to TPEBasicInfo-structure
+        * @param aRinginType is the ringintype
+        */
+        virtual void SetRingingType(
+            const TProfileRingingType& aRingingType ) = 0;
+        
+        /**
+        * Sets ringing volume to TPEBasicInfo-structure
+        * @param aRingingVolume is the current ringingtone name. 
+        */
+        virtual void SetRingingVolume( const TInt& aRingingVolume ) = 0;
+
+        /**
+        * Sets text-to-speech to TPEBasicInfo-structure
+        * @param aTextToSpeech is the current text-to-speech preference setting. 
+        */
+        virtual void SetTextToSpeech( const TBool aTextToSpeech ) = 0;
+
+        /**
+        * Sets two digit support status of the phone to TPEBasicInfo-structure
+        * @param aTwoDigitSupportStatus is support status (EFalse/ETrue).                                                      
+        */
+        virtual void SetTwoDigitSupportStatus(
+            const TBool aTwoDigitSupportStatus ) = 0;
+   
+        /**
+        * Gets VoiceMailBoxNumber for Line 1 information from TPEGsmBasicInfo-structure
+        * @param aVMBXL1 includes line 1 VoiceMailBoxNumber information.  
+        */
+        virtual void SetVoiceMailBoxNumberLine1(
+            const TDesC& aVoiceMailBoxNumberLine1 ) = 0;
+
+        /**
+        * Gets VoiceMailBoxNumber for Line 2 information from TPEGsmBasicInfo-structure
+        * @param aVMBXL2 includes line 2 VoiceMailBoxNumber information.  
+        */
+        virtual void SetVoiceMailBoxNumberLine2(
+            const TDesC& aVoiceMailBoxNumberLine2 ) = 0;
+
+        /**
+        * Set log forced completion indicator. 
+        * @since Series60_4.0
+        * @param TBool aForcedCOmpletion, log forced completion indicator.
+        * @param TInt aCallId, call identification.
+        */
+        virtual void SetLogForcedCompletion(  
+            const TBool aForcedCompletion, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Get log forced completion indicator. 
+        * @since Series60_4.0
+        * @param TInt aCallId, call identification.
+        * @return TBool&, log forced completion indicator.
+        */
+        virtual TBool LogForcedCompletion(
+            const TInt aCallId ) const = 0;
+        
+        /**
+        * Sets whole outgoing phone number 
+        * @since Series60_4.0
+        * @param aPhoneNumber is the phone number
+        * @param TInt aCallId, call identification.
+        */
+        virtual void SetWholeOutgoingPhoneNumber( 
+            const TPEPhoneNumber& aPhoneNumber, 
+            const TInt aCallId ) = 0;
+
+        /**
+        * Gets whole outgoing phone number
+        * @since Series60_4.0
+        * @param TInt aCallId, call identification.
+        * @return TPEPhoneNumber&, remote party number including DTMF string.
+        */
+        virtual const TPEPhoneNumber& WholeOutgoingPhoneNumber(
+            const TInt aCallId ) const = 0;
+       
+        /**
+        * Returns the service-id used for the command.
+        * @since S60 3.2
+        * @param none
+        * @return TUint32 Service-id
+        */
+        virtual TUint32 ServiceIdCommand() const = 0;
+        
+        /**
+        * Set the service-id for the call.
+        * @since S60 3.2
+        * @param TUint32 Service-id
+        * @return none
+        */
+        virtual void SetServiceId( const TInt aCallId, TUint32 aServiceId ) = 0;
+        
+        /**
+        * Sets predefined dtmf strings
+        * @param aArray, is reference to string array
+        * @param aCallId, is the call identification number
+        */
+        virtual void SetPredefinedDtmfStrings(
+            const CDesCArray& aArray, 
+            const TInt aCallId ) = 0;
+
+         /**
+         * ResumeHeldCall
+         * @param aCallId is the call identification number.
+         * @return TBool.
+         */
+         virtual TBool ResumeHeldCall( const TInt aCallId ) const = 0;
+        
+         /**
+         * Resets TPECallInfo parameters.
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void ResetCallInfo( const TInt aCallId ) = 0;
+
+         /**
+         * Sets Barring information to TPEGsmBasicInfo-structure
+         * @param aBarringInfo includes call Barring information
+         * @return
+         */
+         virtual void SetBarringInfo( const TPEBarringInfo& aBarringInfo ) = 0;
+         
+         /**
+         * Sets Confrence value to TPECallInfo-structure
+         * @param aCallConference informs is the call a member of conference call.
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetCallConference( const TInt aCallConference, const TInt aCallId ) = 0;
+         
+         /**
+         * Sets Call control caps to TPECallInfo-structure
+         * @param aCallControlCaps the value of the call control caps
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetCallControlCaps( 
+             const TPECallControlCaps& aCallControlCaps, 
+             const TInt aCallId ) = 0;        
+         
+         /**
+         * Sets forwarded value to TPECallInfo-structure
+         * @param aForwarded Indicates if incoming call was forwarded
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetCallForwarded( const TBool aCallForwarded, const TInt aCallId ) = 0;
+
+         /**
+         * Sets Call service to TPECallInfo-structure
+         * @param aCallService is the Call service value.
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetCallService( 
+             const RMobilePhone::TMobileService& aCallService, 
+             const TInt aCallId ) = 0;
+         
+      
+         /**
+         * Sets Conference capabilities to TPECallInfo structure.
+         * @param aCaps, conference capabilities
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetConferenceCallCaps( const TUint32 aCaps, const TInt aCallId ) = 0;        
+         
+         /**
+         * Sets added or removed members TName information to TPECallInfo structure
+         * @param aName is the TName information of added or removed member.
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetConferenceMemberInfo( 
+             const TName& aConferenceMemberName, 
+             const TInt aConferenceMemberCallId, 
+             const TInt aCallId ) = 0;
+
+         /**
+         * Sets deflect information to the TPEGsmBasicInfo structure.
+         * @param aActiveForward is the active forward information.
+         * @return None.
+         */
+         virtual void SetDeflectInfo( const TPEActiveForwardInfo& aActiveForward ) = 0;    
+
+         /**
+         * Set iResumeHeldCall value to TPEGsmCallInfo structure
+         * @param aResumeHeldCall
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetResumeHeldCall( 
+             const TBool aResumeHeldCall, 
+             const TInt aCallId ) = 0;
+     
+         /**
+         * Sets the number of conference members to TPEGsmCallInfo structure
+         * @param aNumberOfMembers, number of conference members
+         * @param aCallId is the Call identification number.
+         * @return None.
+         */
+         virtual void SetNumberOfConferenceMembers( 
+             const TInt aNumberOfMembers, 
+             const TInt aCallId ) = 0;
+
+         /**
+         * Set remote end connected phone number
+         * @param aColpNumber phone number
+         * @param aCallId, is the call identification number.
+         */
+         virtual void SetRemoteColpNumber(
+             TPEPhoneNumber& aColpNumber, 
+             const TInt aCallId ) = 0;
+
+         /**
+         * Sets Sim state to TPEGsmBasicInfo-structure
+         * @param aSimState is the Sim state
+         * @return None.
+         */
+         virtual void SetSimState( const TPESimState& aSimState ) = 0;
+
+         /**
+         * Sets Suplementary Services command information to TPESSCommandInfo-structure
+         * @param aSSCommandInfo includes Suplementary Services command information.  
+         * @return None.
+         */
+         virtual void SetSSCommandInfo( const TPESSCommandInfo& aSSCommandInfo ) = 0;
+
+        /**
+         * Sets user to user information.
+         * @since S60 5.0
+         * @param aUUI User to user info.
+         */
+        virtual void SetUserToUserInformation( const TPEUserToUserInfo& aUUI ) = 0;
+                
+        /**
+         * Sets remote party name given by network to TPECallInfo structure.
+         * @param aName Remote party name.
+         */
+        virtual void SetRemotePartyName( 
+            const TPEContactName& aName, 
+            const TInt aCallId ) = 0;
+
+        /**
+         * Sets secure specified status.
+         * @param aSecureSpecified Secure specified status.
+         */
+        virtual void SetSecureSpecified( const TBool aSecureSpecified ) = 0;
+        
+        /**
+        * Gets call parameters
+        * @return None.
+        */
+        virtual CCCECallParameters& CallParameters() = 0;
+        
+        /**
+        * Sets switch to  number to TPECallCommandInfo-structure
+        * @param aPhoneNumber is the phone number
+        */
+        virtual void SetSwitchToNumberCommand( const TPEPhoneNumber& aPhoneNumber ) = 0;
+        
+        /**
+        * Gets switch to number
+        * @return Reference to TPEPhoneNumber, containing the phone number.
+        */
+        virtual const TPEPhoneNumber& SwitchToNumberCommand() const = 0;
+        
+        /**
+        * Sets switch to operation status.
+        * @param aValue switch to operation status.
+        */
+        virtual void SetIsSwitchToOperationOngoing( const TBool aValue ) = 0;
+        
+        /**
+         * Sets call index of a call.
+         * @param aCallIndex Call index
+         * @param aCallId call identification
+         */
+        virtual void SetCallIndex( TInt aCallIndex, TInt aCallId ) = 0;
+        
+        /**
+         * Gets call index of a call.
+         * @param aCallId Call identification
+         * @return Call index of a call.
+         */
+        virtual TInt CallIndex( TInt aCallId ) const = 0;
+        
+        /**
+         * Sets call origin for the call
+         * @param aOrigin indicates if the call is phone, client or SAT originated
+         */
+        virtual void SetCallOrigin( TPECallOrigin aOrigin, TInt aCallId ) = 0;
+
+    };
+
+#endif      //MPEDATASTORE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/inc/mpeengineinfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,712 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class for MPEEngineInfo of the PhoneEngine
+*
+*/
+
+
+
+#ifndef MPEENGINEINFO_H
+#define MPEENGINEINFO_H
+
+//  INCLUDES
+#include <pevirtualengine.h>
+#include "mpecallsettersif.h" 
+
+// CONSTANTS
+// None
+
+// FORWARD DECLARATIONS
+class MPEClientInformation;
+
+// DATA TYPES
+// None
+
+// CLASS DECLARATION
+
+/**
+*  Offers engine info interface to phone application
+*
+*  @lib phoneengine.lib
+*  @since Series 60 4.0
+*/
+NONSHARABLE_CLASS( MPEEngineInfo ) : public MPECallSettersIF
+    {
+
+    public:
+        /**
+        * Gets active als line of the phone from TPEBasicInfo-structure
+        * @return active als line of the phone
+        */
+        virtual const CCCECallParameters::TCCELineType& ALSLine() const = 0;
+            
+        /**
+        * Gets ALS support of the phone from TPEBasicInfo-structure
+        * @return ETrue if als is supported.
+        */
+        virtual const TBool& ALSLineSupport() const = 0;
+
+        /**
+        * Gets group ids which are active to play ring tone
+        * @return contact group id
+        */
+        virtual const TArray< TContactItemId > AlertForGroup() const = 0;
+    
+        /**
+        * Gets audio mute value
+        * @return audio mute value
+        */
+        virtual const TBool& AudioMute() const = 0;
+
+        /**
+        * Gets audio volume value
+        * @return audio volume value
+        */
+        virtual const TInt& AudioVolume() const = 0;
+        
+        /**
+        * Gets current audio output path
+        * @return audio output path
+        */
+        virtual const TPEAudioOutput& AudioOutput() const = 0;
+        
+        /**
+        * Gets phone audio route parameters
+        * @return phone audio route parameters. 
+        */
+        virtual const TPEPhoneAudioRouteParameters& RouteParameters() const = 0;  
+  
+        /**
+        * Gets audio output path availability
+        * @return audio output path availability status
+        */
+        virtual TBool AudioOutputAvailable( 
+            const TPEAudioOutput aOutput ) const = 0;
+
+        /**
+        * Gets line information for the specified call
+        * @param aCallId is the call identification number
+        * @return line information for the specified call
+        */
+        virtual CCCECallParameters::TCCELineType CallALSLine( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets phone client information of the specified call
+        * @param aCallId is the call identification number
+        * @return client information of the specified call
+        */
+        virtual const MPEClientInformation& CallClientInformation( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets call direction of the specified call
+        * @param aCallId is the call identification number
+        * @return call direction of the specified call
+        */
+        virtual RMobileCall::TMobileCallDirection CallDirection( 
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets duration of the last call to go idle
+        * @return call duration of the last active call
+        */
+        virtual const TInt& CallDuration() const = 0;
+
+        /**
+        * Gets call duration of the ongoing or last active call with specified id
+        * @param aCallId is the call identification number
+        * @return call duration of the ongoing or last active call
+        */
+        virtual TTimeIntervalSeconds CallDuration( const TInt aCallId ) const = 0;
+
+        /**
+        * Get caller image
+        * @param aCallId is the call identification number.
+        * @return caller image
+        */
+        virtual const TPtrC CallerImage( const TInt aCallId ) const = 0;
+
+        /**
+        * Get caller text
+        * @param aCallId is the call identification number.
+        * @return caller text
+        */
+        virtual const TPtrC CallerText( const TInt aCallId ) const = 0;
+
+        /**
+        * Get caller thumbnail
+        * @param aCallId is the call identification number.
+        * @return pointer to thumbnail data
+        */
+        virtual CFbsBitmap* CallerThumbnail(
+            const TInt aCallId ) const = 0;
+        
+        /**
+        * Get caller thumbnail status
+        * @return ETrue if has thumbnail, otherwise EFalse.
+        */
+        virtual TBool HasCallerThumbnail( const TInt aCallId  ) const = 0;
+
+        /**
+        * Gets identification number of a call
+        *
+        * This value is used for determining the target for a command message
+        * that requires such information
+        * @return identification number of a call
+        */
+        virtual const TInt& CallId() const = 0;
+
+        /**
+        * Gets start time of the call
+        * @param aCallTime is the start time of the call
+        * @param aCallId is the call identification number
+        * @return None.
+        */
+        virtual const TTime& CallStartTime( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets call state of a specified call
+        * @param aCallId is the call identification number
+        * @return call state of a specified call
+        */
+        virtual TPEState CallState( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets type of the specified call
+        * @param aCallId is the call identification number.
+        * @return call type of a specified call
+        */
+        virtual TPECallType CallType( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets last set call type information
+        * @return call type information
+        */
+        virtual const TPECallType& CallTypeCommand() const = 0;
+
+        /**
+        * Gets secure status from call info
+        * @return TBool the secure status (on/off)
+        */
+        virtual TBool IsSecureCall( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets call state of a conference call
+        * @return call state
+        */
+        virtual TPEState ConferenceCallState() const = 0;
+
+        /**
+        * Get user group ids this contact is assigned to
+        * @param aCallId is the call identification number.
+        * @return array for group ids
+        */
+        virtual const TArray< TContactItemId > ContactGroups(
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Get remote contact link packet. See virtual phonebook API.
+        * @param aCallId is the call identification number.
+        * @return Virtual phonebook contact link packet.
+        */
+        virtual const TDesC8& ContactLink( const TInt aCallId ) const = 0;
+        
+        /**
+        * Gets the name of data port currently on-loan.
+        * Data port loaning is handled by CSPlugin and happens when a data
+        * call goes into connected state. The dataport is released when VT components
+        * indicate it can be released, i.e. video call hangup.
+        * @return data port name
+        */
+        virtual const TName& DataPortName() const = 0;
+
+        /**
+        * Gets dtmf string
+        * @return dtmf string
+        */
+        virtual const TPEDtmfString& DtmfString() const = 0;
+
+        /**
+        * Gets error code and cause values for the latest error
+        * @return error code and cause values for the latest error
+        */
+        virtual const TPEErrorInfo& ErrorInfo() const = 0;
+
+        /**
+        * Gets key code of the last key press
+        * @return key code of the last key press
+        */
+        virtual const TChar& KeyCode() const = 0;
+
+        /**
+        * Gets keypad volume value
+        * @return keypad volume value
+        */
+        virtual const TInt& KeypadVolume() const = 0;
+
+        /**
+        * Gets lifetimer data
+        * @return lifetime data (TDes8&)
+        */
+        virtual const TPELifeTimeData& LifeTimerData() const = 0;
+
+        /**
+        * Gets a logging indicator
+        * @param aCallId, call identification number     
+        * @return continuous logging indicator
+        */
+        virtual TBool LoggingIndicator( const TInt aCallId ) const = 0;
+
+        /**
+        * Get missed call indicator
+        * @param aCallId, call identification number
+        * @return missed call indicator
+        */
+        virtual TBool MissedCall( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets network registration status
+        * @return TNWNetworkRegistrationStatus Network registration status
+        */
+        virtual const TNWNetworkRegistrationStatus& NetworkRegistrationStatus() const = 0;
+
+        /**
+        * Get ringing tone
+        * Returns a ringing tone defined for one of the user groups
+        * if personal tone is not found
+        * @param aCallId, call identification number
+        * @return ringing tone file path
+        */
+        virtual const TPEContactFileName& PersonalRingingTone(
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets personal tone status
+        * @return personal tone status
+        */
+        virtual const TBool& PersonalToneStatus() const = 0;
+
+        /**
+        * Gets phone identity parameters
+        * @return phone identity parameters. 
+        */
+        virtual const TPEPhoneIdentityParameters& PhoneIdentityParameters() const = 0;
+
+        /**
+        * Gets phone number
+        * @return Reference to TPEPhoneNumber, containing the phone number of the remote party.
+        */
+        virtual const TPEPhoneNumber& PhoneNumber() const = 0;
+
+        /**
+        * Gets phone number parsing result
+        * @return ETrue if phone number is a service code
+        */
+        virtual const TBool& PhoneNumberIsServiceCode() const = 0;
+
+        /**
+        * Gets profile id
+        * @return profile id
+        */
+        virtual const TInt& ProfileId() const = 0;
+
+        /**
+        * Gets profile name
+        * @return profile name.  
+        */
+        virtual const TPEProfileName& ProfileName() const = 0;
+
+        /**
+        * Gets contact company name
+        * @param aCallId, call identification number
+        * @return company name
+        */
+        virtual const TPEContactCompany& RemoteCompanyName(
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets remote party identity 
+        * @param aCallId is the Call identification number
+        * @return remote party identity
+        */
+        virtual RMobileCall::TMobileCallRemoteIdentityStatus RemoteIdentity ( 
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets contact name
+        * Depending on user selected language may be in order:
+        * first + last name OR last + first name
+        * @param aCallId, call identification number
+        * @return contact name
+        */
+        virtual const TPEContactName& RemoteName( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets remote end phone number
+        * @param aCallId, call identification number
+        * @return phone number
+        */
+        virtual const TPEPhoneNumber& RemotePhoneNumber(
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets remote end phone number type
+        * @param aCallId, call identification number
+        * @return phone number type
+        */
+        virtual const TPEPhoneNumberIdType& RemotePhoneNumberType(
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets text to speech text for this contact. Used in
+        * text to speech ringing tone.
+        * @param aCallId, call identification number
+        * @return descriptor, ownership passed.
+        */
+        virtual const TPtrC RemoteTextToSpeechText(
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets remote predefined dtmf strings
+        * @param aCallId, call identification number
+        * @return reference to string array
+        */
+        virtual const CDesCArray&  RemotePredefinedDtmfStrings(
+            const TInt aCallId ) const = 0;                 
+ 
+        /**
+        * Gets ringing type
+        * @return ringing type
+        */
+        virtual const TProfileRingingType& RingingType() const = 0; 
+
+        /**
+        * Gets ringing tone name
+        * @param aCallId, call identification number 
+        * @return name of the current ringing tone
+        */
+        virtual const TPEContactFileName& RingingTone( const TInt& aCallId ) const = 0;
+        
+        /**
+        * Gets current ringing volume
+        * @return the current ringing volume
+        */
+        virtual const TInt& RingingVolume() const = 0;       
+
+        /**
+        * Gets text-to-speech preference setting value
+        * @return text-to-speech status (EFalse/ETrue)
+        */
+        virtual const TBool& TextToSpeech() const = 0;
+
+        /**
+        * Gets VoiceMailBoxNumber for Line 1 information from TPEBasicInfo-structure
+        * @return line 1 VoiceMailBoxNumber information
+        */
+        virtual const TPEPhoneNumber& VoiceMailBoxNumberLine1() const = 0;
+
+        /**
+        * Gets VoiceMailBoxNumber for Line 2 information from TPEBasicInfo-structure
+        * @return line 2 VoiceMailBoxNumber information
+        */
+        virtual const TPEPhoneNumber& VoiceMailBoxNumberLine2() const = 0;
+
+        /**
+        * Sets audio mute command to TPEBasicInfo-structure
+        * @param aAudioMute is audio mute
+        * @return None.
+        */
+        virtual void SetAudioMuteCommand( const TInt& aAudioMute ) = 0;
+        
+        /**
+        * Sets audio output command to TPEBasicInfo-structure
+        * @param aOutput is audio output path
+        * @param aShowNote is audio note value
+        * @return None.
+        */
+        virtual void SetAudioOutputCommand( 
+            const TPEAudioOutput& aOutput,
+            const TBool aShowNote  ) = 0;
+
+        /**
+        * Sets audio volume command to TPEBasicInfo-structure
+        * @param aAudioVolume is audio volume
+        * @return None.
+        */
+        virtual void SetAudioVolumeCommand( const TInt& aAudioVolume ) = 0;
+        
+        /**
+        * Sets CallId value to TPECallCommandInfo-structure
+        * @param aCallId is the call id number.
+        * @return None.
+        */
+        virtual void SetCallId( const TInt& aCallId ) = 0;
+
+        /**
+        * Sets call type information for following command message
+        * Used for specifying the call type of the next attempted call
+        * @param aCallType is the call type of the next attempted call
+        */
+        virtual void SetCallTypeCommand( const TPECallType& aCallType ) =  0;
+
+        /**
+        * Sets dtmf string value to TPEBasicInfo-structure
+        * @param aDtmfString is the dtmf string to be sent. 
+        * @return None.
+        */
+        virtual void SetDtmfStringCommand( const TPEDtmfString& aDtmfString ) = 0;
+
+        /**
+        * Sets key code value to TPEBasicInfo-structure
+        * @param aKeyCode is the key code value.
+        * @return None.
+        */
+        virtual void SetKeyCode( const TChar& aKeyCode ) = 0; 
+
+        /**
+        * Sets phone number to TPECallCommandInfo-structure
+        * @param aPhoneNumber is the phone number
+        * @return None.
+        */
+        virtual void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber ) = 0;
+
+        /**
+        * Gets two digit support status value
+        * @return two digit support status (EFalse/ETrue)
+        */
+        virtual const TBool& TwoDigitSupportStatus() const = 0;
+     
+        /**
+        * Returns the service-id used for the command.
+        * @return TUint32 ServiceId
+        */
+        virtual TUint32 ServiceIdCommand() const = 0;
+        
+        /**
+        * SetServiceIdCommand
+        * @return None
+        */
+        virtual void SetServiceIdCommand( TUint32 aServiceId ) = 0;
+        
+        /**
+        * Gets ServiceId
+        * @return ServiceId
+        */
+        virtual TUint32 ServiceId( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets active forwarding information from TPEBasicInfo-structure
+        * @return deflect information
+        */
+        virtual const TPEActiveForwardInfo& ActiveForwardingInfo() const = 0;
+
+        /**
+        * Gets barring information from TPEBasicInfo-structure
+        * @return barring information
+        */
+        virtual const TPEBarringInfo& BarringInfo() const = 0;
+
+        /**
+        * Gets conference value from TPECallInfo-structure
+        * @param aCallId is the call identification number
+        * @return call conference value
+        */
+        virtual TInt CallConference( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets call control caps from the TPECallInfo-structure
+        * @param aCallId is the call identification number
+        * @return call control capabilities
+        */
+        virtual TPECallControlCaps CallControlCaps( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets forwarded value from TPECallInfo-structure
+        * @param aCallId is the call identification number
+        * @return is call forwarded or not
+        */
+        virtual TBool CallForwarded( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets Service information from TPECallInfo-structure
+        * @param aCallId is the call identification number.
+        * @return mobile call service type
+        */
+        virtual RMobilePhone::TMobileService CallService( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets Conference call capabilities
+        * @param aCallId is the call identification number
+        * @return conference call capabilities
+        */
+        virtual TUint32 ConferenceCallCaps( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets Conference call capabilities
+        * @param aCallId is the call identification number
+        * @return conference call member name
+        */
+        virtual const TName& ConferenceMemberName( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets Conference call capabilities
+        * @param aCallId is the call identification number
+        * @return conference call member id
+        */
+        virtual TInt IsConferenceMemberId( const TInt aCallId ) const = 0;
+
+        /**
+        * Gets emergency number to be checked for validity
+        * @return emergency number to be checked for validity
+        */
+        virtual const TPEPhoneNumber& EmergencyNumber() const = 0;
+
+        /**
+        * Gets number of the conference members
+        * @param aCallId is the call identification number
+        * @return number of conference members
+        */
+        virtual TInt NumberOfConferenceMembers( const TInt aCallId ) const = 0;
+
+        /**
+        * Get remote end connected phone number
+        * @param aCallId, call identification number
+        * @return phone number
+        */
+        virtual const TPEPhoneNumber& RemoteColpNumber(
+            const TInt aCallId ) const = 0;
+
+        /**
+        * Gets Sim state
+        * @return current Sim state
+        */
+        virtual const TPESimState& SimState() const = 0;
+
+        /**
+         * Gets secure specified status
+         * @return ETrue if secure specified
+         */
+        virtual TBool SecureSpecified( ) const = 0;        
+        
+        /**
+        * Gets the last suplementary services string command information
+        * @return Suplementary Services command information.  
+        */
+        virtual const TPESSCommandInfo& SSCommandInfo() const = 0;
+    
+        /**
+        * Sets emergency numbers of the phone to TPEBasicInfo-structure
+        * @param aEmergencyNumber for emergency number checking.
+        * @return None.
+        */
+        virtual void SetEmergencyNumber( const TPEPhoneNumber& aEmergencyNumbers ) = 0;
+        
+        /**
+         * Gets remote party name. Contains possible recieved CNAP name or 
+         *  received skype identification
+         * @param aCallId, Call identification number.
+         * @return Name of the remote party detemined by network.
+         */
+        virtual const TPEContactName& RemotePartyName( const TInt aCallId ) const = 0;
+        
+        /**
+         * Returns transfer target from the last received unattended transfer 
+         * request or KNullDesC if transfer target is not available.
+         * 
+         * @return  Transfer target.
+         */
+        virtual const TPEPhoneNumber& UnattendedTransferTarget( 
+            TInt aCallId ) const = 0;
+        
+        /**
+         * Sets transfer target from the last received unattended transfer request.
+         *
+         * @param   aTarget     Transfer target to set.
+         * @param   aCallId     Call identification number.
+         */
+        virtual void SetUnattendedTransferTarget( 
+            const TPEPhoneNumber& aTarget, TInt aCallId ) = 0;
+
+        /**
+         * Returns address choices from received call forward request 
+         * or NULL if addresses are not available.
+         * 
+         * @param   aCallId     Call identification number.
+         * @return  Address array.
+         */
+        virtual const CDesC8Array* ForwardAddressChoices( TInt aCallId ) const = 0;
+        
+        /**
+         * Sets address choices from received call forward request.
+         *
+         * @param   aArray      Address array.
+         * @param   aCallId     Call identification number.
+         */
+        virtual void SetForwardAddressChoices( const CDesC8Array* aArray,
+            TInt aCallId ) = 0;
+            
+        /**
+         * Sets array index for user selected address.
+         *
+         * @param   aIndex     Array index for selected address.
+         */
+        virtual void SetForwardAddressIndex( TInt aIndex ) = 0;
+        
+        /**
+         * Returns array index for user selected address.
+         * Address is used for call forwarding.
+         *
+         * @return Array index for selected address.
+         */
+        virtual TInt ForwardAddressIndex() = 0;
+
+        /**
+         * Sets transfer target address for unattended transfer
+         * @param aTransferTarget Target address for unattended transfer
+         */
+        virtual void SetTransferTargetCommand( const TPEPhoneNumber& aTransferTarget ) = 0;
+
+        /**
+        * Returns transfer target address
+        * @return Transfer target address set with SetTransferTargetCommand
+        */
+        virtual const TPEPhoneNumber& TransferTargetCommand() const = 0;
+        
+        /**
+        * Returns switch to operation status.
+        */
+        virtual TBool IsSwitchToOperationOngoing() const = 0;
+        
+        /**
+        * Checks if given state can be found.
+        * @param aCallState state to be checked.
+        */
+        virtual TBool CheckIfCallStateExists( const TPEState& aCallState )= 0;
+        
+        /**
+         * Returns call origin for the call
+         * @param aOrigin indicates if the call is phone, client or SAT originated
+         */
+        virtual TPECallOrigin CallOrigin( const TInt aCallId ) const = 0;
+        
+        /**
+         * Returns Phonebook contact identifier.
+         */
+        virtual TInt ContactId2 () const = 0;
+
+    }; // MPEEngineInfo
+    
+#endif      //MPEENGINEINFO_H
+    
+// End of File
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cpecallinfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,654 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Information container for a single call
+*
+*/
+
+#include "cpecallinfo.h"
+#include "cpeclientinformation.h"
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CPECallInfo* CPECallInfo::NewL()
+    {
+    CPECallInfo* self = new ( ELeave ) CPECallInfo;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+CPECallInfo::CPECallInfo()
+    {
+    Reset( EFalse );
+    }
+
+// ---------------------------------------------------------------------------
+// Second-phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::ConstructL()
+    {
+    iClientInformation = CPEClientInformation::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPECallInfo::~CPECallInfo()
+    {
+    delete iClientInformation;
+    }
+
+// ---------------------------------------------------------------------------
+// Resets all call information to their initial values.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::Reset( TBool aIsConference )
+    {
+    if ( iClientInformation )
+        {
+        iClientInformation->Reset();
+        }
+    
+    if ( aIsConference )
+        {
+        iCallState = EPEStateConferenceIdle;
+        iConference = KPEConferenceMaster;
+        }
+    else
+        {
+        iCallState = EPEStateIdle;
+        iConference = KPENormalVoiceCall;
+        }
+    
+    _LIT( dateTimeInit, "0,0,0,0,0,0,0" );
+    iStartTime.Set( dateTimeInit );
+
+    iCallType = EPECallTypeUninitialized;
+    iCallDirection = RMobileCall::EDirectionUnknown;
+    iRemoteIdentity = RMobileCall::ERemoteIdentityUnknown;
+    iLoggingEnabled = ETrue;
+    iMissedCall = EFalse;
+    iALSLine = CCCECallParameters::ECCELineTypePrimary;
+    iLogForcedCompletion = EFalse;
+    iWholeOutgoingPhoneNumber = KNullDesC;
+    iCallServiceId = 0;
+    iSecureStatus = EFalse;
+    iResumeHeldCall = ETrue;
+    iForwarded = EFalse;
+    iService = RMobilePhone::EServiceUnspecified;
+    iConferenceCaps = 0;
+    iConferenceMemberName = KNullDesC;
+    iConferenceMemberId = KPECallIdNotUsed;
+    iNumberOfConferenceMembers = 0;
+    iRemotePartyName = KNullDesC;
+    iSecureSpecified = ETrue; 
+    iTransferTarget = KNullDesC;
+    iDtmfPostFix = KNullDesC;
+    iForwardAddressChoices = NULL;
+    iCallIndex = KPEInvalidCallIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the client information of the call.
+// ---------------------------------------------------------------------------
+//
+CPEClientInformation& CPECallInfo::ClientInformation()
+    {
+    return *iClientInformation;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the state of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetCallState( TPEState aState )
+    {
+    iCallState = aState;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the state of the call.
+// ---------------------------------------------------------------------------
+//
+TPEState CPECallInfo::CallState() const
+    {
+    return iCallState;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the type of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetCallType( TPECallType aType )
+    {
+    iCallType = aType;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the type of the call.
+// ---------------------------------------------------------------------------
+//
+TPECallType CPECallInfo::CallType() const
+    {
+    return iCallType;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the call control capabilites.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetCallControlCaps( TPECallControlCaps aCaps )
+    {
+    iCallControlCaps = aCaps;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the call control capabilities.
+// ---------------------------------------------------------------------------
+//
+TPECallControlCaps CPECallInfo::CallControlCaps() const
+    {
+    return iCallControlCaps;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the remote party name of the call as given by the network.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetRemotePartyName( const TPEContactName& aName )
+    {
+    iRemotePartyName = aName;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the remote party name of the call as given by the network.
+// ---------------------------------------------------------------------------
+//
+const TPEContactName& CPECallInfo::RemotePartyName() const
+    {
+    return iRemotePartyName;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the whole outgoing phone number (invalid characters removed).
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetWholeOutgoingPhoneNumber( const TPEPhoneNumber& aNumber )
+    {
+    iWholeOutgoingPhoneNumber = aNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the whole outgoing phone number (invalid characters removed).
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPECallInfo::WholeOutgoingPhoneNumber() const
+    {
+    return iWholeOutgoingPhoneNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the ALS line type of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetAlsLine( CCCECallParameters::TCCELineType aAlsLine )
+    {
+    iALSLine = aAlsLine;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the ALS line type of the call.
+// ---------------------------------------------------------------------------
+//
+CCCECallParameters::TCCELineType CPECallInfo::AlsLine() const
+    {
+    return iALSLine;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the remote identity status of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetRemoteIdentity( RMobileCall::TMobileCallRemoteIdentityStatus aIdentity )
+    {
+    iRemoteIdentity = aIdentity;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the remote identity status of the call.
+// ---------------------------------------------------------------------------
+//
+RMobileCall::TMobileCallRemoteIdentityStatus CPECallInfo::RemoteIdentity() const
+    {
+    return iRemoteIdentity;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the direction of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetCallDirection( RMobileCall::TMobileCallDirection aDirection )
+    {
+    iCallDirection = aDirection;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the direction of the call.
+// ---------------------------------------------------------------------------
+//
+RMobileCall::TMobileCallDirection CPECallInfo::CallDirection() const
+    {
+    return iCallDirection;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the mobile call service type of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetService( RMobilePhone::TMobileService aService )
+    {
+    iService = aService;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the mobile call service type of the call.
+// ---------------------------------------------------------------------------
+//
+RMobilePhone::TMobileService CPECallInfo::Service() const
+    {
+    return iService;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the conference member name of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetConferenceMemberName( const TName& aName )
+    {
+    iConferenceMemberName = aName;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the conference member name of the call.
+// ---------------------------------------------------------------------------
+//
+const TName& CPECallInfo::ConferenceMemberName() const
+    {
+    return iConferenceMemberName;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the call start time.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetStartTime( const TTime& aTime )
+    {
+    iStartTime = aTime;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the start time of the call.
+// ---------------------------------------------------------------------------
+//
+const TTime& CPECallInfo::StartTime() const
+    {
+    return iStartTime;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the duration of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetDuration( TTimeIntervalSeconds aDuration )
+    {
+    iDuration = aDuration;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the duration of the call.
+// ---------------------------------------------------------------------------
+//
+TTimeIntervalSeconds CPECallInfo::Duration() const
+    {
+    return iDuration;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the service identifier of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetCallServiceId( TUint32 aId )
+    {
+    iCallServiceId = aId;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the service identifier of the call.
+// ---------------------------------------------------------------------------
+//
+TUint32 CPECallInfo::CallServiceId() const
+    {
+    return iCallServiceId;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets conference capabilities of the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetConferenceCaps( TUint32 aCaps )
+    {
+    iConferenceCaps = aCaps;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the conference capabilities of the call.
+// ---------------------------------------------------------------------------
+//
+TUint32 CPECallInfo::ConferenceCaps() const
+    {
+    return iConferenceCaps;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the identification number of the conference master.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetConference( TInt aConference )
+    {
+    iConference = aConference;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the identification number of the conference master.
+// ---------------------------------------------------------------------------
+//
+TInt CPECallInfo::Conference() const
+    {
+    return iConference;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the identifier of the conference member call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetConferenceMemberId( TInt aId )
+    {
+    iConferenceMemberId = aId;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the identifier of the conference member call.
+// ---------------------------------------------------------------------------
+//
+TInt CPECallInfo::ConferenceMemberId()
+    {
+    return iConferenceMemberId;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the number of conference members.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetNumberOfConferenceMembers( TInt aNumberOfConferenceMembers )
+    {
+    iNumberOfConferenceMembers = aNumberOfConferenceMembers;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the number of conference members.
+// ---------------------------------------------------------------------------
+//
+TInt CPECallInfo::NumberOfConferenceMembers() const
+    {
+    return iNumberOfConferenceMembers;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the forced completion indicator for logging.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetLogForcedCompletion( TBool aLog )
+    {
+    iLogForcedCompletion = aLog;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the flag indicating if forced completion indicator for logging is used.
+// ---------------------------------------------------------------------------
+//
+TBool CPECallInfo::LogForcedCompletion()
+    {
+    return iLogForcedCompletion;
+    }
+
+// ---------------------------------------------------------------------------
+// Enables or disables logging for the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetLoggingEnabled( TBool aEnabled )
+    {
+    iLoggingEnabled = aEnabled;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns if logging is enabled for the call.
+// ---------------------------------------------------------------------------
+//
+TBool CPECallInfo::LoggingEnabled() const
+    {
+    return iLoggingEnabled;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the missed call status for the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetMissedCall( TBool aMissedCall )
+    {
+    iMissedCall = aMissedCall;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the missed call status for the call.
+// ---------------------------------------------------------------------------
+//
+TBool CPECallInfo::MissedCall() const
+    {
+    return iMissedCall;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the secure status for the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetSecureStatus( TBool aSecureStatus )
+    {
+    iSecureStatus = aSecureStatus;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the secure status of the call.
+// ---------------------------------------------------------------------------
+//
+TBool CPECallInfo::SecureStatus() const
+    {
+    return iSecureStatus;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the forwarded status for the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetForwarded( TBool aForwarded )
+    {
+    iForwarded = aForwarded;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the forwarded status of the call.
+// ---------------------------------------------------------------------------
+//
+TBool CPECallInfo::Forwarded() const
+    {
+    return iForwarded;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the resume held call status for the call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetResumeHeldCall( TBool aResume )
+    {
+    iResumeHeldCall = aResume;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the resume held call status of the call.
+// ---------------------------------------------------------------------------
+//
+TBool CPECallInfo::ResumeHeldCall() const
+    {
+    return iResumeHeldCall;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the secure specified status 
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetSecureSpecified( TBool aSecureSpecified )
+    {
+    iSecureSpecified = aSecureSpecified; 
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the secure specified status 
+// ---------------------------------------------------------------------------
+//
+TBool CPECallInfo::SecureSpecified() const
+    {
+    return iSecureSpecified;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns unattended transfer target.
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPECallInfo::UnattendedTransferTarget() const
+    {
+    return iTransferTarget;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets unattended transfer target. 
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetUnattendedTransferTarget( const TPEPhoneNumber& aTarget )
+    {
+    iTransferTarget = aTarget;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns address array for call forward.
+// ---------------------------------------------------------------------------
+//
+const CDesC8Array* CPECallInfo::ForwardAddressChoices() const
+    {
+    return iForwardAddressChoices;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets call forward address array. 
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetForwardAddressChoices( const CDesC8Array* aArray )
+    {
+    iForwardAddressChoices = aArray;
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets array index. 
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetForwardAddressIndex( TInt aIndex )
+    {
+    iForwardAddressArrayIndex = aIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// Return dtmf postfix. 
+// ---------------------------------------------------------------------------
+//
+const TPEDtmfString& CPECallInfo::DtmfPostFix() const
+    {
+    return iDtmfPostFix;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets dtmf postfix. 
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetDtmfPostFix( const TPEDtmfString& aDtmfPostFix )
+    {
+    iDtmfPostFix = aDtmfPostFix;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets call index
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetCallIndex( TInt aCallIndex )
+    {
+    iCallIndex = aCallIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets call index
+// ---------------------------------------------------------------------------
+//
+TInt CPECallInfo::CallIndex() const
+    {
+    return iCallIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the origin of a call.
+// ---------------------------------------------------------------------------
+//
+void CPECallInfo::SetCallOrigin( TPECallOrigin aOrigin )
+    {
+    iCallOrigin = aOrigin;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the origin of a call.
+// ---------------------------------------------------------------------------
+//
+TPECallOrigin CPECallInfo::CallOrigin() const
+    {
+    return iCallOrigin;
+    }
+    
+   
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cpeclientinformation.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Interface class for instantiation of call client information
+*
+*/
+
+#include "cpeclientinformation.h"
+#include "cpeclientinformationimpl.h"
+
+// -----------------------------------------------------------------------------
+// CPEClientInformation::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPEClientInformation* CPEClientInformation::NewL()
+    {
+    return CPEClientInformationImpl::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------------------------
+//
+CPEClientInformation::CPEClientInformation()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPEClientInformation::~CPEClientInformation()
+    {
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cpeclientinformationimpl.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone client information for a single call
+*
+*/
+
+#include <talogger.h>
+#include "cpeclientinformationimpl.h"
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CPEClientInformationImpl* CPEClientInformationImpl::NewL()
+    {
+    CPEClientInformationImpl* self = new ( ELeave ) CPEClientInformationImpl;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+CPEClientInformationImpl::CPEClientInformationImpl()
+    {
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// Second-phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPEClientInformationImpl::~CPEClientInformationImpl()
+    {
+    iContactLink.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Resets the state of this client information.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::Reset()
+    {
+    TEFLOGSTRING( KTAINT,"PE CPEClientInformationImpl::Reset" );
+    iContactLink.Close();
+    iName = KNullDesC;
+    iNumber = KNullDesC;
+    iCallType = EPECallTypeUninitialized;
+    iAllowMatch = ETrue;    
+    iShowNumber = EFalse;
+    iEndOtherCalls = EFalse;    
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::Set( const MPEClientInformation& aSource )
+    {
+    SetContactLink( aSource.ContactLink() );
+    iName = aSource.Name();
+    iNumber = aSource.Number();
+    iCallType = aSource.CallType();
+    iAllowMatch = aSource.AllowMatch();
+    TEFLOGSTRING2( KTAINT,"PE CPEClientInformationImpl::Set, iAllowMatch: %d", iAllowMatch );    
+    iShowNumber = aSource.ShowNumber();
+    TEFLOGSTRING2( KTAINT,"PE CPEClientInformationImpl::Set, iShowNumber: %d", iShowNumber );
+    iEndOtherCalls = aSource.EndOtherCalls();
+    TEFLOGSTRING2( KTAINT,"PE CPEClientInformationImpl::Set, iEndOtherCalls: %d", iEndOtherCalls );    
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::SetContactLink( const TDesC8& aLink )
+    {
+    iContactLink.Close();
+    HBufC8* contactLink = aLink.Alloc(); // No leaving allowed here due to emergency call cases.
+    if ( contactLink )
+        {
+        iContactLink.Assign( contactLink );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+const TDesC8& CPEClientInformationImpl::ContactLink() const
+    {
+    return iContactLink;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::SetName( const TName& aName )
+    {
+    iName = aName;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+const TName& CPEClientInformationImpl::Name() const
+    {
+    return iName;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::SetNumber( const TPEPhoneNumber& aNumber )
+    {
+    iNumber = aNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEClientInformationImpl::Number() const
+    {
+    return iNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::SetCallType( TPECallType aType )
+    {
+    iCallType = aType;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+TPECallType CPEClientInformationImpl::CallType() const
+    {
+    return iCallType;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::SetAllowMatch( TBool aAllow )
+    {
+    iAllowMatch = aAllow;
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEClientInformationImpl::SetAllowMatch, iAllowMatch: %d", iAllowMatch );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+TBool CPEClientInformationImpl::AllowMatch() const
+    {
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEClientInformationImpl::AllowMatch, iAllowMatch: %d", iAllowMatch );
+    return iAllowMatch;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::SetShowNumber( TBool aShow )
+    {
+    iShowNumber = aShow;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+TBool CPEClientInformationImpl::ShowNumber() const
+    {
+    return iShowNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+void CPEClientInformationImpl::SetEndOtherCalls( TBool aEndOtherCalls )
+    {
+    iEndOtherCalls = aEndOtherCalls;
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEClientInformationImpl::SetEndOtherCalls, iEndOtherCalls: %d", 
+        iEndOtherCalls );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MPEClientInformation.
+// ---------------------------------------------------------------------------
+//
+TBool CPEClientInformationImpl::EndOtherCalls() const
+    {
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEClientInformationImpl::EndOtherCalls, iEndOtherCalls: %d", 
+        iEndOtherCalls );
+    return iEndOtherCalls;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cpeengineinfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Interface class for instantiation of telephony information storage
+*
+*/
+
+#include "cpeengineinfo.h"
+#include "cpeengineinfoimpl.h"
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfo::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPEEngineInfo* CPEEngineInfo::NewL()
+    {
+    return CPEEngineInfoImpl::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------------------------
+//
+CPEEngineInfo::CPEEngineInfo()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPEEngineInfo::~CPEEngineInfo()
+    {
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cpeengineinfoimpl.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,2644 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEEngineInfoImpl class 
+*
+*/
+
+// INCLUDE FILES
+#include "cpecallinfo.h"
+#include "cpeclientinformation.h"
+#include "cpeengineinfoimpl.h"
+#include <pepanic.pan>
+#include <telinternalpskeys.h>
+#include <cphcltdialdata.h>
+#include <phclttypes.h>
+#include <talogger.h>
+
+// ================= MEMBER FUNCTIONS ==========================================
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CPEEngineInfoImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEEngineInfoImpl::CPEEngineInfoImpl()
+    : iCurrentCalls( KPEMaximumNumberOfCalls )
+    ,iContactId( KErrNotFound )
+    {
+    iCallCommandInfo.iPhoneNumber = KNullDesC;
+    iCallCommandInfo.iCallId = 0;
+    iCallCommandInfo.iKeyCode = 0;
+    iCallCommandInfo.iAudioVolume = KPENumberInitValue;
+    iCallCommandInfo.iAudioMute = EFalse;
+    iCallCommandInfo.iDtmfString = KNullDesC;
+    iCallCommandInfo.iCallType = EPECallTypeUninitialized;
+    iCallCommandInfo.iServiceId = 0;
+    iBasicInfo.iAudioOutputPreference = EPSAudioPrivate;
+    iBasicInfo.iALSLine = CCCECallParameters::ECCELineTypePrimary;
+    iBasicInfo.iALSLineSupport = EFalse;
+    iBasicInfo.iPhoneAudioRouteParameters.iAudioOutput = EPENotActive;
+    iBasicInfo.iAudioVolume = KPEDefaultAudioVolume;
+    iBasicInfo.iKeypadVolume = KPENumberInitValue;
+    iBasicInfo.iAudioMute = EFalse;
+    iBasicInfo.iDtmfString = KNullDesC;
+    iBasicInfo.iErrorInfo.iErrorCode = ECCPErrorNone;
+    iBasicInfo.iErrorInfo.iCallId = KPECallIdNotUsed;
+    iBasicInfo.iProfileId = ECCPErrorNotFound;
+    iBasicInfo.iProfileName = KNullDesC;
+    iBasicInfo.iPhoneIdentityParameters.iManufacturer = KNullDesC;
+    iBasicInfo.iPhoneIdentityParameters.iModel = KNullDesC;
+    iBasicInfo.iPhoneIdentityParameters.iRevision = KNullDesC;
+    iBasicInfo.iPhoneIdentityParameters.iSerialNumber = KNullDesC;
+    iBasicInfo.iLastCallDuration = KPENumberInitValue;
+    iBasicInfo.iVMBXNumbers.iVMBXL1 = KNullDesC;
+    iBasicInfo.iVMBXNumbers.iVMBXL2 = KNullDesC;
+    iBasicInfo.iRingingType = EProfileRingingTypeRinging;
+    iBasicInfo.iTextToSpeech = EFalse;
+    iBasicInfo.iPhoneNumberIsServiceCode = EFalse;
+    iBasicInfo.iTwoDigitSupportStatus = EFalse;
+    iBasicInfo.iLifeTimeData.iHours = 0;
+    iBasicInfo.iLifeTimeData.iMinutes = 0;
+
+    iBasicInfo.iNetworkRegistrationStatus = ENWStatusRegistrationUnknown;
+
+    iCallCommandInfo.iIdRestrict = RMobileCall::EIdRestrictDefault;
+    iCallCommandInfo.iEmergencyNumber = KNullDesC;
+    
+    iCallCommandInfo.iTransferToAddress = KNullDesC;
+    iCallCommandInfo.iForwardToAddressIndex = ECCPErrorNotFound;
+    iBasicInfo.iActiveForward.iActiveType = RMobilePhone::ECFUnconditionalActive;
+    iBasicInfo.iActiveForward.iServiceGroup =  RMobilePhone::EServiceUnspecified;
+    iBasicInfo.iBarringInfo.iGroupCount = KPENumberInitValue;
+    for( TInt i = 0; i < KPEMaxServiceGroup; i++ )
+        {
+        __ASSERT_DEBUG( 
+            iBasicInfo.iBarringInfo.iBarredInfo.Count() > i, 
+            Panic( EPEPanicIndexOutOfRange ) );
+        iBasicInfo.iBarringInfo.iBarredInfo[i].iCondition = RMobilePhone::EBarUnspecified;
+        iBasicInfo.iBarringInfo.iBarredInfo[i].iServiceGroup = 
+            RMobilePhone::EServiceUnspecified;
+        iBasicInfo.iBarringInfo.iBarredInfo[i].iStatus = 
+            RMobilePhone::ECallBarringStatusUnknown;
+        }
+    iBasicInfo.iSSCommandInfo.action = EPESSActionUnspecified;
+    iBasicInfo.iSSCommandInfo.type = EPESSTypeUnspecified;
+    iBasicInfo.iSSCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    iBasicInfo.iSimState = EPESimStatusUninitialized;
+    iBasicInfo.iSecureSpecified = ETrue; 
+    iBasicInfo.iDataPortName = KNullDesC;
+    iBasicInfo.iSwitchToOngoing = EFalse;
+    iConferenceCallInfo.iConferenceCallState = EPEStateConferenceIdle;
+    
+    //TODO remove after profile information is available
+    iBasicInfo.iRingingVolume = 10;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEEngineInfoImpl* CPEEngineInfoImpl::NewL()
+    {
+    CPEEngineInfoImpl* self = new ( ELeave ) CPEEngineInfoImpl;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ConstructL
+// Initializes class member variables
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::ConstructL()
+    {
+    iCallParams = CCCECallParameters::NewL();
+
+    iRemoteInfo = new ( ELeave ) RPointerArray<CPERemoteInfo>( KPEMaximumNumberOfCalls );
+
+    for ( TInt i = 0; i < KPEMaximumNumberOfCalls; i++ )
+        {
+        TEFLOGSTRING( KTAOBJECT, "CPEEngineInfoImpl::ConstructL" );
+        CPERemoteInfo* remoteInfo = CPERemoteInfo::NewL();
+        CleanupStack::PushL( remoteInfo );
+        // associate this remote info instance with a call id
+        remoteInfo->SetCallId( i );
+        iRemoteInfo->InsertL( remoteInfo, i );
+        CleanupStack::Pop( remoteInfo );
+        
+        CPECallInfo* callInfo = CPECallInfo::NewL();
+        CleanupStack::PushL( callInfo );
+        iCurrentCalls.AppendL( callInfo );
+        CleanupStack::Pop( callInfo );
+        }
+        
+    for( TInt i = 0 ; i < KPEMaximumNumberOfCalls ; i++ ) 
+        {
+        ResetCallInfo( i );    // Resets every call.
+        }
+    }
+
+// Destructor
+CPEEngineInfoImpl::~CPEEngineInfoImpl()
+    {
+    if ( iRemoteInfo )
+        {
+        iRemoteInfo->ResetAndDestroy();
+        iRemoteInfo->Close();
+        delete iRemoteInfo;
+        iRemoteInfo = NULL;
+        }
+    delete iCallParams;
+    
+    iCurrentCalls.ResetAndDestroy();
+    iCurrentCalls.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AlertForGroup
+// Gets group ids  from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TArray< TContactItemId > CPEEngineInfoImpl::AlertForGroup() const
+    {
+    return iAlertForGroup.Array();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ALSLine
+// Gets active als line of the phone.
+// -----------------------------------------------------------------------------
+//
+const CCCECallParameters::TCCELineType& CPEEngineInfoImpl::ALSLine() const
+    {
+    return iBasicInfo.iALSLine;
+    }    
+
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ALSLine
+// Gets active als line of the phone.
+// -----------------------------------------------------------------------------
+//
+const TBool& CPEEngineInfoImpl::ALSLineSupport() const
+    {
+    TEFLOGSTRING2( KTAMESIN,"CPEEngineInfoImpl::ALSLineSupport(),iALSLineSupport: %d"
+        , iBasicInfo.iALSLineSupport );
+    return iBasicInfo.iALSLineSupport;
+    }  
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioMute
+// Gets audio mute value from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TBool& CPEEngineInfoImpl::AudioMute() const
+    {
+    return iBasicInfo.iAudioMute;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioOutput
+// Gets audio output value from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEAudioOutput& CPEEngineInfoImpl::AudioOutput() const
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::AudioOutput: iBasicInfo.iAudioOutput: %d", 
+        iBasicInfo.iPhoneAudioRouteParameters.iAudioOutput );
+    return iBasicInfo.iPhoneAudioRouteParameters.iAudioOutput;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::PhoneIdentityParameters
+// Gets the phone identity parameters from the TPEBasicInfo structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneAudioRouteParameters& CPEEngineInfoImpl::RouteParameters() const
+    {
+    return iBasicInfo.iPhoneAudioRouteParameters;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioOutputAvailable
+// Gets audio output path availability status from array
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::AudioOutputAvailable( 
+        const TPEAudioOutput aOutput ) const 
+    {
+    __ASSERT_ALWAYS( ( EPENotActive <= aOutput && 
+        aOutput <= EPETTY ), Panic( EPEPanicInvalidParameter ) );
+        
+    TBool available( EFalse );
+    // find given output from the available outputs array
+    for (TInt i = 0; i < iAvailableAudioOutputs.Count(); i++)
+        {
+        if ( iAvailableAudioOutputs[i] == aOutput )
+            {
+            available = ETrue;
+            }
+        }
+    return available;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioMuteCommand
+// Gets audio mute command value from the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TBool& CPEEngineInfoImpl::AudioMuteCommand() const
+    {
+    return iCallCommandInfo.iAudioMute;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioOutputCommand
+// Gets audio output command value from the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEAudioOutput& CPEEngineInfoImpl::AudioOutputCommand() const
+    {
+    return iCallCommandInfo.iAudioOutput;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ShowNoteCommand
+// Gets audio note command value from the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::ShowNoteCommand() const
+    {
+    return iCallCommandInfo.iShowNote;
+    }
+        
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioOutputPreference
+// Gets audio output preference value from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::AudioOutputPreference() const
+    {
+    return iBasicInfo.iAudioOutputPreference;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioVolume
+// Gets audio volume value from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::AudioVolume() const
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::AudioVolume, volume: %d", iBasicInfo.iAudioVolume );
+    return iBasicInfo.iAudioVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::AudioVolumeCommand
+// Gets audio volume command value from the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::AudioVolumeCommand() const
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::AudioVolumeCommand, volume: %d", 
+        iCallCommandInfo.iAudioVolume );
+    return iCallCommandInfo.iAudioVolume;
+    } 
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallClientInformation
+// Gets phone client information from the TPECallInfo structure.
+// -----------------------------------------------------------------------------
+//
+const MPEClientInformation& CPEEngineInfoImpl::CallClientInformation(
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->ClientInformation();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallDirection
+// Gets the call direction.
+// -----------------------------------------------------------------------------
+//
+RMobileCall::TMobileCallDirection CPEEngineInfoImpl::CallDirection( 
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->CallDirection();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallDuration
+// Gets the duration of the last call to idle.
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::CallDuration() const
+    {
+    return iBasicInfo.iLastCallDuration;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallDuration
+// Gets the duration of the call.
+// -----------------------------------------------------------------------------
+//
+TTimeIntervalSeconds CPEEngineInfoImpl::CallDuration(
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->Duration();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallId
+// Gets the identification number of the call from the TPECallCommandInfo structure. 
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::CallId() const
+    {
+    return iCallCommandInfo.iCallId;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallALSLine
+// Gets als line value from the TPECallInfo structure.
+// -----------------------------------------------------------------------------
+//
+CCCECallParameters::TCCELineType CPEEngineInfoImpl::CallALSLine( 
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->AlsLine();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallStartTime
+// Gets the start time of the call.
+// -----------------------------------------------------------------------------
+//
+const TTime& CPEEngineInfoImpl::CallStartTime(
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->StartTime();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallState
+// Gets the state of the call.
+// -----------------------------------------------------------------------------
+//
+TPEState CPEEngineInfoImpl::CallState( 
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->CallState();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallType
+// Gets the type of the call.
+// -----------------------------------------------------------------------------
+//
+TPECallType CPEEngineInfoImpl::CallType(
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->CallType();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallTypeCommand
+// Gets call type information for the attempted call
+// -----------------------------------------------------------------------------
+//
+const TPECallType& CPEEngineInfoImpl::CallTypeCommand() const
+    {
+    return iCallCommandInfo.iCallType;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ConferenceCallState
+// -----------------------------------------------------------------------------
+//
+TPEState CPEEngineInfoImpl::ConferenceCallState() const
+    {
+    return iConferenceCallInfo.iConferenceCallState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::IsSecureCall
+// Gets secured status from call info
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::IsSecureCall( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    TInt isSecured = EFalse; 
+    
+    // Conference call secure status
+    if ( KPEConferenceCallID == aCallId )
+        {
+        TInt count = iCurrentCalls.Count();
+
+        for ( TInt i = 0; i < count; i++ )
+            {
+            if ( iCurrentCalls[ i ]->ConferenceMemberId() != KPECallIdNotUsed )
+            {
+                if ( iCurrentCalls[ i ]->SecureStatus() )
+                    {
+                    isSecured = ETrue;
+                    }
+                else
+                    {
+                    isSecured = EFalse;
+                    break;
+                    }
+                }
+            }
+        }
+    else
+        {
+        isSecured = iCurrentCalls[ aCallId ]->SecureStatus();
+        }
+    
+    return isSecured;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::DataPortName
+// Gets the name of data port currently on-loan.
+// -----------------------------------------------------------------------------
+//
+const TName& CPEEngineInfoImpl::DataPortName() const
+    {
+    return iBasicInfo.iDataPortName;
+    }
+        
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::DtmfPostFix
+// Gets dtmf postfix value from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEDtmfString& CPEEngineInfoImpl::DtmfPostFix( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->DtmfPostFix();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::DtmfString
+// Gets dtmf string value from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEDtmfString& CPEEngineInfoImpl::DtmfString() const
+    {
+    return iBasicInfo.iDtmfString;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::DtmfStringCommand
+// Gets dtmf string command value from TPECallCommandInfo-structure
+// -----------------------------------------------------------------------------
+//
+const TPEDtmfString& CPEEngineInfoImpl::DtmfStringCommand() const
+    {
+    return iCallCommandInfo.iDtmfString; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ErrorInfo
+// Gets the error code value of the phone from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEErrorInfo& CPEEngineInfoImpl::ErrorInfo() const
+    {
+    return iBasicInfo.iErrorInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::InbandTone
+// Gets correct inband tone for specific call state transition or error
+// -----------------------------------------------------------------------------
+//
+const TCCPTone& CPEEngineInfoImpl::InbandTone() const 
+    {
+    return iBasicInfo.iInbandTone; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::KeyCode
+//  Gets key code value.
+// -----------------------------------------------------------------------------
+//
+const TChar& CPEEngineInfoImpl::KeyCode() const
+    {
+    return iCallCommandInfo.iKeyCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::KeypadVolume
+// Gets Keypad volume value from the TPEBasicInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::KeypadVolume() const
+    {
+    return iBasicInfo.iKeypadVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::LifeTimerData
+// Gets lifetimerdata from the TPEBasicInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPELifeTimeData& CPEEngineInfoImpl::LifeTimerData() const
+    {
+    return iBasicInfo.iLifeTimeData;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::LoggingIndicator
+// Get logging indicator from TPECallInfo.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::LoggingIndicator(
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( !CallIdCheck::IsConference( aCallId ), Panic( EPEPanicIllegalCommand ) );
+    return iCurrentCalls[ aCallId ]->LoggingEnabled();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::MissedCall
+// Get missed call indicator from TPECallInfo.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::MissedCall(
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( !CallIdCheck::IsConference( aCallId ), Panic( EPEPanicIllegalCommand ) );
+    return iCurrentCalls[ aCallId ]->MissedCall();     
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::NetworkInformation
+// Return network information
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TNWNetworkRegistrationStatus& CPEEngineInfoImpl::NetworkRegistrationStatus() const
+    {
+    return iBasicInfo.iNetworkRegistrationStatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::PersonalToneStatus
+// Gets personal tone status from the TPEBasicInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TBool& CPEEngineInfoImpl::PersonalToneStatus() const
+    {
+    return iBasicInfo.iPersonalToneStatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::PhoneIdentityParameters
+// Gets the phone identity parameters from the TPEBasicInfo structure
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneIdentityParameters& CPEEngineInfoImpl::PhoneIdentityParameters() const
+    {
+    return iBasicInfo.iPhoneIdentityParameters;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::PhoneNumber
+// Return the phone number from the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::PhoneNumber() const
+    {
+    return iCallCommandInfo.iPhoneNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::PhoneNumberIsServiceCode
+// Return the phone number parsing result
+// -----------------------------------------------------------------------------
+//
+const TBool& CPEEngineInfoImpl::PhoneNumberIsServiceCode() const
+    {
+    return iBasicInfo.iPhoneNumberIsServiceCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallOriginCommand
+// Gets call origin for next call attempt
+// -----------------------------------------------------------------------------
+//
+const TPECallOrigin& CPEEngineInfoImpl::CallOriginCommand() const
+    {
+    return iCallCommandInfo.iCallOrigin;
+    }
+            
+// CPEEngineInfoImpl::ProfileId
+// Gets the profile id from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::ProfileId() const
+    {
+    return iBasicInfo.iProfileId;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ProfileName
+// Gets the profile name from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEProfileName& CPEEngineInfoImpl::ProfileName() const
+    {
+    return iBasicInfo.iProfileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemoteIdentity
+// Gets the remote identity from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+//
+RMobileCall::TMobileCallRemoteIdentityStatus CPEEngineInfoImpl::RemoteIdentity(
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->RemoteIdentity();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RingingTone
+// Gets the ringing tone file name from the TPEBasicInfo structure.
+// -----------------------------------------------------------------------------
+// 
+const TPEContactFileName& CPEEngineInfoImpl::RingingTone(
+        const TInt& aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+
+    if ( iCurrentCalls[aCallId]->AlsLine() == CCCECallParameters::ECCELineTypeAux )
+        {
+        return iBasicInfo.iRingingToneName2;
+        }
+    else if ( EPECallTypeVideo == iCurrentCalls[aCallId]->CallType() )
+        {
+        return iBasicInfo.iVideoCallRingingTone;
+        }
+    else
+        {
+        return iBasicInfo.iRingingToneName1;
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RingingType 
+// Gets the ringingtype.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TProfileRingingType& CPEEngineInfoImpl::RingingType() const
+    {
+    return iBasicInfo.iRingingType;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RingingVolume
+// Gets the ringing volume.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TInt& CPEEngineInfoImpl::RingingVolume() const
+    {
+    return iBasicInfo.iRingingVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::TextToSpeech
+// Return the status of the text-to-speech preference setting.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TBool& CPEEngineInfoImpl::TextToSpeech() const
+    {
+    return iBasicInfo.iTextToSpeech;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::UserToUserInformation
+// Return User to user information
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//    
+const TPEUserToUserInfo& CPEEngineInfoImpl::UserToUserInformation() const
+    {
+    return iCallCommandInfo.iUserToUserInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetALSLine
+// Sets active als line value to the TPEBasicInfo structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetALSLine( 
+    const CCCECallParameters::TCCELineType& aALSLine ) 
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetALSLine: aALSLine: %d", aALSLine );
+    __ASSERT_ALWAYS( ( CCCECallParameters::ECCELineTypePrimary <= aALSLine && aALSLine <= CCCECallParameters::ECCELineTypeAux ), 
+        Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iALSLine = aALSLine;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetALSLine
+// Sets active als line value to the TPEBasicInfo structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetALSLineSupport( 
+    const TBool& aALSLineSupport ) 
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::ALSLineSupport: aALSLineSupport: %d", aALSLineSupport );
+    iBasicInfo.iALSLineSupport = aALSLineSupport;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAudioMuteCommand
+// Sets audio mode of the phone to the TPEBasicInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAudioMuteCommand( 
+        const TBool& aAudioMute )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetAudioMuteCommand, mute: %d", aAudioMute );
+    iCallCommandInfo.iAudioMute = aAudioMute;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAudioOutputCommand
+// Sets audio output path to the TPECallCommandInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAudioOutputCommand( 
+        const TPEAudioOutput& aOutput,
+        const TBool aShowNote
+         )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetAudioOutputCommand, output: %d", aOutput );
+    __ASSERT_ALWAYS( ( EPENotActive <= aOutput && 
+        aOutput <= EPETTY ), Panic( EPEPanicInvalidParameter ) );
+    iCallCommandInfo.iAudioOutput = aOutput;
+    iCallCommandInfo.iShowNote = aShowNote;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAudioVolumeCommand
+// Sets audio mode of the phone to the TPEBasicInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAudioVolumeCommand( 
+        const TInt& aAudioVolume )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetAudioVolumeCommand, volume: %d", aAudioVolume );
+    // No need to check that, is parameter value correct. Maximun value is 
+    // platform depended. If the volume is not within this range, the volume 
+    // is automatically set to minimum or maximum value based on the value 
+    // that is being passed (by CMMFDevSound ).
+    iCallCommandInfo.iAudioVolume = aAudioVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallClientInformation
+// Sets phone client information to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallClientInformation( 
+        const MPEClientInformation& aClientInformation, 
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->ClientInformation().Set( aClientInformation );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallDirection
+// Sets the call direction to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallDirection( 
+        const RMobileCall::TMobileCallDirection& aCallDirection, 
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( ( RMobileCall::EDirectionUnknown <= aCallDirection && 
+        aCallDirection <= RMobileCall::EMobileTerminated ), Panic( EPEPanicInvalidParameter ) );
+    iCurrentCalls[ aCallId ]->SetCallDirection( aCallDirection );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallDuration
+// Sets the duration of the call to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallDuration( 
+        const TTimeIntervalSeconds& aCallDuration,  
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetDuration( aCallDuration );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallId
+// Sets the identification number of the call to the TPECallCommandInfo structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallId( 
+        const TInt& aCallId )
+    {
+    __ASSERT_ALWAYS( CallIdCheck::IsValid( aCallId ), 
+        Panic( EPEPanicCallIndexOutOfRange ) );
+    iCallCommandInfo.iCallId = aCallId;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallStartTime
+// Sets the start time of the call to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallStartTime( 
+        const TTime& aCallStartTime,
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetStartTime( aCallStartTime );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallState
+// Sets the state of the call to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallState( 
+        const TPEState& aCallState, 
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( !( aCallState > EPEStateMaximumState ), 
+        Panic( EPEPanicInvalidParameter ) );
+    iCurrentCalls[ aCallId ]->SetCallState( aCallState );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallType
+// Sets the type of the call.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallType( 
+        const TPECallType& aCallType,   
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( ( EPECallTypeUninitialized <= aCallType &&
+        aCallType <= EPECallTypeVoIP ), Panic( EPEPanicInvalidParameter ) );
+    iCurrentCalls[ aCallId ]->SetCallType( aCallType );
+    TEFLOGSTRING3( KTAINT, 
+        "PE CPEEngineInfoImpl::SetCallType: call id: %d , aCallType: %d"
+        ,aCallId ,aCallType );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallTypeCommand
+// Sets call type information for following command message
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallTypeCommand( 
+        const TPECallType& aCallType )
+    {
+    __ASSERT_ALWAYS( ( EPECallTypeUninitialized <= aCallType &&
+        aCallType <= EPECallTypeVoIP ), Panic( EPEPanicInvalidParameter ) );
+    iCallCommandInfo.iCallType = aCallType;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetConferenceCallState
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetConferenceCallState(
+        const TPEState& aCallState )
+    {
+    __ASSERT_ALWAYS( !( aCallState > EPEStateMaximumState ), 
+        Panic( EPEPanicInvalidParameter ) );
+    iConferenceCallInfo.iConferenceCallState = aCallState;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetDataPortName
+// Sets the name of data port currently on-loan.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetDataPortName(
+        const TName& aDataPortName )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetDataPortName: dataport name = %S", &aDataPortName );
+    iBasicInfo.iDataPortName = aDataPortName;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetDtmfStringCommand
+// Sets the dtmf string value to the TPECommandInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetDtmfStringCommand( 
+        const TPEDtmfString& aDtmfString )
+    {
+    __ASSERT_DEBUG( !( aDtmfString.Length() > KPEDtmfMaxLength ),
+        Panic( EPEPanicInvalidParameter ) );
+    iCallCommandInfo.iDtmfString = aDtmfString;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetKeyCode
+// Sets the key code value to the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetKeyCode( 
+        const TChar& aKeyCode )
+    {
+    iCallCommandInfo.iKeyCode = aKeyCode;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetLoggingIndicator
+// Set logging indicator to TPECallInfo.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetLoggingIndicator(
+        const TBool aLoggingIndicator, 
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( !CallIdCheck::IsConference( aCallId ), Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetLoggingEnabled( aLoggingIndicator );
+    TEFLOGSTRING3( KTAINT, 
+        "PE CPEEngineInfoImpl::SetLoggingIndicator: call id: %d , iLoggingEnabled: %d"
+        ,aCallId ,aLoggingIndicator );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetMissedCall
+// Set missed call indicator to TPECallInfo.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetMissedCall(
+        const TBool& aMissedCall,    
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( !CallIdCheck::IsConference( aCallId ), Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetMissedCall( aMissedCall );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetPhoneNumber
+// Sets the phone number to the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetPhoneNumber( 
+        const TPEPhoneNumber& aPhoneNumber )
+    {
+    __ASSERT_DEBUG( !( aPhoneNumber.Length() > KPEPhoneNumberMaxLength ),
+        Panic( EPEPanicExternalDataIdOutOfRange ) );
+    iCallCommandInfo.iPhoneNumber = aPhoneNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRemoteIdentity
+// Sets the remote party status to the TPECallInfo structure.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRemoteIdentity( 
+    const RMobileCall::TMobileCallRemoteIdentityStatus& aIdentity, 
+    const TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetRemoteIdentity: aIdentity = %d", aIdentity );
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( ( RMobileCall::ERemoteIdentityUnknown <= aIdentity &&
+        aIdentity <= RMobileCall::ERemoteIdentityAvailableNoCliUnavailable ), 
+        Panic( EPEPanicInvalidParameter ) );    
+    iCurrentCalls[ aCallId ]->SetRemoteIdentity( aIdentity );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::TwoDigitSupportStatus
+// Return the status of the two dial digit.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+
+const TBool& CPEEngineInfoImpl::TwoDigitSupportStatus() const
+    {
+    return iBasicInfo.iTwoDigitSupportStatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::VoiceMailBoxNumberLine1
+// Gets the VoiceMailBoxNumber for line 1.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::VoiceMailBoxNumberLine1() const
+    {
+    return iBasicInfo.iVMBXNumbers.iVMBXL1;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::VoiceMailBoxNumberLine2
+// Gets the VoiceMailBoxNumber for line 2.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::VoiceMailBoxNumberLine2() const
+    {
+    return iBasicInfo.iVMBXNumbers.iVMBXL2;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngienInfo::DTMFVoiceMailBoxNumberLine1
+// Gets the DTMFVoiceMailBoxNumber for line 1.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::DTMFVoiceMailBoxNumberLine1() const
+    {
+    return iBasicInfo.iVMBXNumbers.iDTMFVMBXL1;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngienInfo::DTMFVoiceMailBoxNumberLine2
+// Gets the DTMFVoiceMailBoxNumber for line 2.
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::DTMFVoiceMailBoxNumberLine2() const
+    {
+    return iBasicInfo.iVMBXNumbers.iDTMFVMBXL2;
+    }    
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAlertForGroup
+// Set the group id's which are active to play ring tone
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAlertForGroup(
+        const TArray< TContactItemId >& aAlertForGroup ) 
+    {
+    TInt errorCode( KErrNone );
+
+    iAlertForGroup.Reset();
+    for ( TInt i = 0; i < aAlertForGroup.Count(); i++ )
+        {
+        errorCode = iAlertForGroup.Append( aAlertForGroup[ i ] );
+        TEFLOGSTRING3( 
+            KTAINT, 
+            "PE CPEEngineInfoImpl::SetAlertForGroup, index: %d, alert for: %d", 
+            i, 
+            aAlertForGroup[ i ] );
+        }
+    if ( errorCode != KErrNone )
+        {
+        TEFLOGSTRING2( KTAERROR,
+            "CPEENGINEINFOIMPL::SETALERTFORGROUP ! RARRAY::APPEND FAILED WITH EXIT CODE: &d",
+            errorCode );
+        iAlertForGroup.Reset();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAudioMute
+// Sets audio mute state of the phone to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAudioMute(
+        const TBool aAudioMute ) 
+    {
+    iBasicInfo.iAudioMute = aAudioMute; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAudioOutput
+// Sets hands free mode of the phone to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAudioOutput(
+        const TPEAudioOutput aOutput,
+        const TPEAudioOutput aPreviousOutput,
+        const TBool aShowNote ) 
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetAudioOutput, output: %d", aOutput );
+    __ASSERT_ALWAYS( ( EPENotActive <= aOutput && 
+        aOutput <= EPETTY ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iPhoneAudioRouteParameters.iAudioOutput = aOutput;
+    iBasicInfo.iPhoneAudioRouteParameters.iPreviousOutput = aPreviousOutput;
+    iBasicInfo.iPhoneAudioRouteParameters.iShowNote = aShowNote;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAvailableAudioOutputs
+// Sets hands free mode of the phone to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAvailableAudioOutputs(
+        const TArray<TPEAudioOutput>& aAvailableOutputs ) 
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEEngineInfoImpl::SetAvailableAudioOutputs" );
+    // reset the array
+    iAvailableAudioOutputs.Reset();
+
+    // set the available outputs
+    for (TInt j = 0; j < aAvailableOutputs.Count(); j++)
+        {
+        iAvailableAudioOutputs[j] = aAvailableOutputs[j];
+        TEFLOGSTRING3( 
+            KTAINT, 
+            "PE CPEEngineInfoImpl::SetAvailableAudioOutputs, index: %d, available: %d", 
+            j, 
+            aAvailableOutputs[j] );
+        }
+    TEFLOGSTRING( KTAINT, "PE CPEEngineInfoImpl::SetAvailableAudioOutputs:  Done" );    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAudioOutputPreference
+// Sets audio output preference to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAudioOutputPreference(
+        const TInt aOutputPreference )
+    {    
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetAudioOutputPreference, value: %d", 
+        aOutputPreference );    
+    __ASSERT_ALWAYS( !( aOutputPreference != EPSAudioPrivate && 
+        aOutputPreference != EPSAudioPublic ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iAudioOutputPreference = aOutputPreference;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetAudioVolume
+// Sets audio volume of the phone to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetAudioVolume(
+        const TInt aAudioVolume )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetAudioVolume, volume: %d", aAudioVolume );
+    iBasicInfo.iAudioVolume = aAudioVolume;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallALSLine
+// Sets the alsline value to the TPECallInfo structure.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallALSLine( 
+        const CCCECallParameters::TCCELineType& aALSLine,
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_ALWAYS( ( CCCECallParameters::ECCELineTypePrimary <= aALSLine && aALSLine <= CCCECallParameters::ECCELineTypeAux ),
+        Panic( EPEPanicInvalidParameter ) );
+    iCurrentCalls[ aCallId ]->SetAlsLine( aALSLine );
+    TEFLOGSTRING3( KTAINT, 
+        "PE CPEEngineInfoImpl::SetCallALSLine: line: %d, call id: %d", 
+        iCurrentCalls[ aCallId ]->AlsLine(), 
+        aCallId );
+    }    
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallDuration
+// Sets call duration of the last call to Idle to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallDuration(
+        const TInt& aCallDuration ) 
+    {
+    iBasicInfo.iLastCallDuration = aCallDuration; 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetDtmfPostFix
+// Sets dtmf postfix value to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetDtmfPostFix( 
+        const TPEDtmfString& aDtmfPostFix,
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_DEBUG( !( aDtmfPostFix.Length() > KPEDtmfMaxLength ),
+            Panic( EPEPanicInvalidParameter ) );
+    iCurrentCalls[ aCallId ]->SetDtmfPostFix( aDtmfPostFix );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetDtmfString
+// Sets dtmf string value to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetDtmfString(
+        const TPEDtmfString& aDtmfString ) 
+    {
+    __ASSERT_DEBUG( !( aDtmfString.Length() > KPEDtmfMaxLength ),
+        Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iDtmfString = aDtmfString; 
+    }
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetErrorCode
+// Sets error code of the phone to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetErrorCode(
+        const TInt aErrorCode ) 
+    {
+    iBasicInfo.iErrorInfo.iErrorCode = aErrorCode; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetInbandTone
+// Sets correct inband tone for specific call state transition or error
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetInbandTone( const TCCPTone aTone ) 
+    {
+    iBasicInfo.iInbandTone = aTone; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetKeypadVolume
+// Sets keypad volume of the phone to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetKeypadVolume(
+        const TInt aKeypadVolume ) 
+    {
+    iBasicInfo.iKeypadVolume = aKeypadVolume; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetLifeTimerData
+// Sets lifetimer data of the phone to TPELifeTimeData-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetLifeTimerData( 
+        TCCPLifeTimeDataPckg& aPckg )
+    {
+    iBasicInfo.iLifeTimeData.iHours = aPckg().iHours;
+    iBasicInfo.iLifeTimeData.iMinutes = aPckg().iMinutes;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetNetworkRegistrationStatus
+// Sets network registration status to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetNetworkRegistrationStatus(
+        const TNWNetworkRegistrationStatus& aRegistrationStatus ) 
+    {
+    __ASSERT_ALWAYS( ( ENWStatusRegistrationUnknown <= aRegistrationStatus &&
+        aRegistrationStatus <= ENWStatusRegisteredRoaming ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iNetworkRegistrationStatus = aRegistrationStatus;
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::SetNetworkRegistrationStatus, iNetworkRegistrationStatus: %d", 
+        iBasicInfo.iNetworkRegistrationStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetPersonalToneStatus
+// Sets personal tone status of the phones profile settings to TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetPersonalToneStatus( 
+        const TInt& aPersonalToneStatus ) 
+    {
+    iBasicInfo.iPersonalToneStatus = aPersonalToneStatus; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetPhoneIdentityParameters
+// Sets phone number to TPECallCommandInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetPhoneIdentityParameters(
+        const TPEPhoneIdentityParameters& aPhoneIdentityParameters ) 
+    { 
+    iBasicInfo.iPhoneIdentityParameters = aPhoneIdentityParameters; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetPhoneNumberIsServiceCode
+// Sets phone number parsing result
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetPhoneNumberIsServiceCode( 
+    const TBool& aServiceCode )
+    {
+    iBasicInfo.iPhoneNumberIsServiceCode = aServiceCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallOriginCommand
+// Sets call origin for the next call attempt
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallOriginCommand( const TPECallOrigin& aOrigin )
+    {
+    iCallCommandInfo.iCallOrigin = aOrigin;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetProfileId
+// Sets profile id to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetProfileId(
+        const TInt aProfileId ) 
+    {
+    iBasicInfo.iProfileId = aProfileId; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetProfileName
+// Sets profile name to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetProfileName(
+        const TPEProfileName& aProfileName ) 
+    {
+    __ASSERT_DEBUG( !( aProfileName.Length() > KPEProfileNameLength ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iProfileName = aProfileName; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRingingTone1
+// Sets ringing type to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRingingTone1(
+        const TPEContactFileName& aRingingToneName )
+    {
+    __ASSERT_DEBUG( !( aRingingToneName.Length() > KMaxFileName ), 
+        Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iRingingToneName1 = aRingingToneName; 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRingingTone2
+// Sets ringing type to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRingingTone2( 
+        const TPEContactFileName& aRingingToneName )
+    {
+    __ASSERT_DEBUG( !( aRingingToneName.Length() > KMaxFileName ), 
+        Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iRingingToneName2 = aRingingToneName; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetVideoCallRingingTone
+// Sets video call ringing tone name to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetVideoCallRingingTone( 
+        const TPEContactFileName& aRingingToneName )
+    {
+    __ASSERT_DEBUG( !( aRingingToneName.Length() > KMaxFileName ), 
+        Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iVideoCallRingingTone = aRingingToneName; 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRingingType
+// Sets ringing type to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRingingType(
+        const TProfileRingingType& aRingingType )
+    {
+    __ASSERT_ALWAYS( ( EProfileRingingTypeRinging <= aRingingType && 
+        aRingingType <= EProfileRingingTypeSilent ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iRingingType = aRingingType; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRingingVolume
+// Sets ringing volume to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRingingVolume(
+        const TInt& aRingingVolume )
+    {
+    iBasicInfo.iRingingVolume = aRingingVolume; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetTextToSpeech
+// Sets text-to-speech of the phone to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetTextToSpeech( 
+    const TBool aTextToSpeech )
+    {
+    iBasicInfo.iTextToSpeech = aTextToSpeech;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetTwoDigitSupportStatus
+// Sets two digit support status of the phone to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetTwoDigitSupportStatus( 
+    const TBool aTwoDigitSupportStatus )
+    {
+    iBasicInfo.iTwoDigitSupportStatus = aTwoDigitSupportStatus;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallSecureStatus
+// Sets Secure status to call info
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallSecureStatus( 
+    const TBool aSecureStatus, 
+    const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetSecureStatus( aSecureStatus );
+    TEFLOGSTRING3( KTAINT, 
+        "PE CPEEngineInfoImpl::SetCallSecureStatus, iSecureStatus: %d, call id: %d", 
+        iCurrentCalls[ aCallId ]->SecureStatus(), 
+        aCallId );
+    }  
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetSecureSpecified
+// Sets Secure status to call info
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetSecureSpecified( 
+    const TBool aSecureSpecified )
+    {
+    iBasicInfo.iSecureSpecified = aSecureSpecified;
+    }  
+
+// -----------------------------------------------------------------------------
+// CPEEngienInfo::SetDTMFVoiceMailBoxNumberLine1
+// Sets DTMFVoiceMailBoxNumber for Line 1 information from TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetDTMFVoiceMailBoxNumberLine1( 
+    const TDesC& aDTMFVoiceMailBoxNumberLine1 ) 
+    { 
+    __ASSERT_DEBUG( !( aDTMFVoiceMailBoxNumberLine1.Length() 
+        > KPEPhoneNumberMaxLength ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iVMBXNumbers.iDTMFVMBXL1 = aDTMFVoiceMailBoxNumberLine1; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngienInfo::SetDTMFVoiceMailBoxNumberLine2
+// Sets DTMFVoiceMailBoxNumber for Line 2 information from 
+// TPEBasicInfo-structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetDTMFVoiceMailBoxNumberLine2( 
+    const TDesC& aDTMFVoiceMailBoxNumberLine2 )
+    {
+    __ASSERT_DEBUG( !( aDTMFVoiceMailBoxNumberLine2.Length() 
+        > KPEPhoneNumberMaxLength ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iVMBXNumbers.iDTMFVMBXL2 = aDTMFVoiceMailBoxNumberLine2; 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngienInfo::SetVoiceMailBoxNumberLine1
+// Gets VoiceMailBoxNumber for Line 1 information from TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetVoiceMailBoxNumberLine1( 
+    const TDesC& aVoiceMailBoxNumberLine1 ) 
+    {
+    __ASSERT_DEBUG( !( aVoiceMailBoxNumberLine1.Length() 
+        > KPEPhoneNumberMaxLength ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iVMBXNumbers.iVMBXL1 = aVoiceMailBoxNumberLine1; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngienInfo::SetVoiceMailBoxNumberLine2
+// Gets VoiceMailBoxNumber for Line 2 information from TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetVoiceMailBoxNumberLine2( 
+    const TDesC& aVoiceMailBoxNumberLine2 )
+    {
+    __ASSERT_DEBUG( !( aVoiceMailBoxNumberLine2.Length() 
+        > KPEPhoneNumberMaxLength ), Panic( EPEPanicInvalidParameter ) );
+    iBasicInfo.iVMBXNumbers.iVMBXL2 = aVoiceMailBoxNumberLine2; 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetLogForcedCopletion
+// Set the log forced completion indicator.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetLogForcedCompletion(
+    const TBool aForcedCompletion,  
+    const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetLogForcedCompletion( aForcedCompletion );
+    }    
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::GetLogForcedCompletion
+// Gets the log forced completion indicator
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::LogForcedCompletion( 
+    const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->LogForcedCompletion();
+    }
+   
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetPhoneNumber
+// Sets the phone number to the TPECallCommandInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetWholeOutgoingPhoneNumber( 
+        const TPEPhoneNumber& aPhoneNumber, 
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    __ASSERT_DEBUG( !( aPhoneNumber.Length() > KPEPhoneNumberMaxLength ),
+        Panic( EPEPanicInvalidParameter ) );
+    iCurrentCalls[ aCallId ]->SetWholeOutgoingPhoneNumber( aPhoneNumber );
+    TEFLOGSTRING3( KTAINT, 
+        "PE CPEEngineInfoImpl::SetWholeOutgoingPhoneNumber: phone number: '%S', call id: %d"
+        , &iCurrentCalls[ aCallId ]->WholeOutgoingPhoneNumber(), aCallId );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::PhoneNumber
+// Return the phone number from the TPECallCommandInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::WholeOutgoingPhoneNumber( 
+        const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->WholeOutgoingPhoneNumber();
+    }
+                
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ServiceIdCommand
+// Return the Service Id from the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+TUint32 CPEEngineInfoImpl::ServiceIdCommand() const
+    {
+    return iCallCommandInfo.iServiceId; 
+    } 
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetServiceIdCommand
+// Set the Service Id to the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetServiceIdCommand( TUint32 aServiceId )
+    {
+    iCallCommandInfo.iServiceId = aServiceId; 
+    }
+                
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ServiceId
+// Return the Service Id from the TPECallInfo structure.
+// -----------------------------------------------------------------------------
+//
+TUint32 CPEEngineInfoImpl::ServiceId( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->CallServiceId(); 
+    } 
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetServiceId
+// Set the Service Id to the TPECallInfo structure.
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetServiceId( const TInt aCallId, TUint32 aServiceId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetCallServiceId( aServiceId ); 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ActiveForwardingInfo
+// Gets active forward info from the TPEBasicInfo structure. 
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEActiveForwardInfo& CPEEngineInfoImpl::ActiveForwardingInfo() const
+    {
+    return iBasicInfo.iActiveForward;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::BarringInfo
+// Gets the call barring information.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEBarringInfo& CPEEngineInfoImpl::BarringInfo() const
+    {
+    return iBasicInfo.iBarringInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallConference
+// Gets the call's conference value.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPEEngineInfoImpl::CallConference( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->Conference();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallControlCaps
+// Gets the call control caps
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TPECallControlCaps CPEEngineInfoImpl::CallControlCaps( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->CallControlCaps();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallForwarded
+// Gets the call forwarded value. 
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::CallForwarded( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->Forwarded();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallService
+// Gets Service value.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+RMobilePhone::TMobileService CPEEngineInfoImpl::CallService( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->Service();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ConferenceCallCaps
+// Gets Conference call capabilities.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TUint32 CPEEngineInfoImpl::ConferenceCallCaps( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->ConferenceCaps();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ConferenceMemberName 
+// Gets added or removed Conference members TName information.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TName& CPEEngineInfoImpl::ConferenceMemberName( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->ConferenceMemberName();
+    }
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::IsConferenceMemberId 
+// Gets added or removed Conference members TName information.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPEEngineInfoImpl::IsConferenceMemberId( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->ConferenceMemberId();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::EmergencyNumber
+// Gets emergency number for checking.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::EmergencyNumber() const
+    {
+    return iCallCommandInfo.iEmergencyNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::NumberOfConferenceMembers
+// Gets number of conference members involved in conference call.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPEEngineInfoImpl::NumberOfConferenceMembers( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->NumberOfConferenceMembers();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SimState 
+// Gets Sim state from the TPEBasicInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPESimState& CPEEngineInfoImpl::SimState() const
+    {
+    return iBasicInfo.iSimState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SecureSpecified
+// Gets secure specified status 
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::SecureSpecified( ) const
+    {
+    return iBasicInfo.iSecureSpecified;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SSCommandInfo
+// Gets the last suplementary services string command information.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPESSCommandInfo& CPEEngineInfoImpl::SSCommandInfo() const
+    {
+    return iBasicInfo.iSSCommandInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ResetCallInfo
+// Resets TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::ResetCallInfo( const TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfoImpl::ResetCallInfo CallId %d", aCallId );
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+
+    iCurrentCalls[aCallId]->Reset( CallIdCheck::IsConference( aCallId ) );
+    
+    if ( iRemoteInfo->Count() &&       // Check that array is not empty
+         ( *iRemoteInfo )[aCallId ]     // Check that there is content in this index
+       )
+        {
+        ( *iRemoteInfo )[aCallId ]->ResetRemoteInfo();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallConference
+// Sets the conference value to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallConference( const TInt aConference, const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicIllegalCommand ) );
+    iCurrentCalls[ aCallId ]->SetConference( aConference );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallControlCaps
+// Sets the call control caps to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallControlCaps( const TPECallControlCaps& aCallControlCaps,
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicIllegalCommand ) );
+    iCurrentCalls[ aCallId ]->SetCallControlCaps( aCallControlCaps );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallForwarded
+// Sets the forwarded value to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallForwarded( const TBool aCallForwarded, const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetForwarded( aCallForwarded );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallService
+// Sets the call service to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallService( const RMobilePhone::TMobileService& aCallService,
+        const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetService( aCallService );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetConferenceCallCaps
+// Sets the conference call capabilities to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetConferenceCallCaps( const TUint32 aCaps, const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetConferenceCaps( aCaps );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetConferenceMemberInfo
+// Sets the added or removed conference members TName information to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetConferenceMemberInfo( const TName& aConferenceMemberName, 
+        const TInt aConferenceMemberCallId, const TInt aCallId  )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetConferenceMemberName( aConferenceMemberName );
+    iCurrentCalls[ aCallId ]->SetConferenceMemberId( aConferenceMemberCallId ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetEmergencyNumber
+// Sets the emergency numbers of the phone to the TPEBasicInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetEmergencyNumber( const TPEPhoneNumber& aEmergencyNumber )
+    {
+    iCallCommandInfo.iEmergencyNumber = aEmergencyNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemotePartyName
+// Remote party's network given name. (CNAP, skype id).
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEContactName& CPEEngineInfoImpl::RemotePartyName( 
+    const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->RemotePartyName();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ErrorCode
+// Error code from basic call info.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPEEngineInfoImpl::ErrorCode() const
+    {
+    return iBasicInfo.iErrorInfo.iErrorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetNumberOfConferenceMembers
+// Sets the number of conference members involved in Conference
+// call to the TPECallInfo structure.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetNumberOfConferenceMembers( const TInt aNumberOfMembers, const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetNumberOfConferenceMembers( aNumberOfMembers );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ResumeHeldCall
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::ResumeHeldCall( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->ResumeHeldCall(); 
+    }
+
+// -----------------------------------------------------------------------------
+// From base class MPEDataStore
+// -----------------------------------------------------------------------------
+//
+TInt CPEEngineInfoImpl::CallIndex( TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->CallIndex(); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetBarringInfo
+// Sets Barring information to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetBarringInfo( const TPEBarringInfo& aBarringInfo ) 
+    {
+    iBasicInfo.iBarringInfo = aBarringInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetDeflectInfo
+// Sets deflect information to the TPEBasicInfo structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetDeflectInfo( const TPEActiveForwardInfo& aActiveForward )
+    {
+    iBasicInfo.iActiveForward  = aActiveForward;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetResumeHeldCall
+// Set iHeldByUser value to TPECallInfo structure
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetResumeHeldCall( const TBool aResumeHeldCall, 
+    const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetResumeHeldCall( aResumeHeldCall ); 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetSimState
+// Sets Sim state to TPEBasicInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetSimState( const TPESimState& aSimState )
+    {
+    iBasicInfo.iSimState = aSimState;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetSSCommandInfo
+// Sets Suplementary Services command information to TPESSCommandInfo-structure
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetSSCommandInfo( const TPESSCommandInfo& aSSCommandInfo ) 
+    {
+    iBasicInfo.iSSCommandInfo = aSSCommandInfo; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetUserToUserInfo
+// Set the user to user info.
+// -----------------------------------------------------------------------------
+//    
+void CPEEngineInfoImpl::SetUserToUserInformation( const TPEUserToUserInfo& aUUI )
+    {
+    iCallCommandInfo.iUserToUserInfo = aUUI;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetUserToUserInfo
+// Set the user to user info.
+// -----------------------------------------------------------------------------
+//   
+void CPEEngineInfoImpl::SetRemotePartyName( 
+    const TPEContactName& aName, 
+    const TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetRemotePartyName( aName ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallParameters
+// Get the call parameters.
+// -----------------------------------------------------------------------------
+// 
+CCCECallParameters& CPEEngineInfoImpl::CallParameters()
+    {
+    return *iCallParams;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetSwitchToNumberCommand
+// Sets switch to number
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetSwitchToNumberCommand( 
+        const TPEPhoneNumber& aPhoneNumber )
+    {
+    __ASSERT_DEBUG( !( aPhoneNumber.Length() > KPEPhoneNumberMaxLength ),
+        Panic( EPEPanicExternalDataIdOutOfRange ) );
+    iCallCommandInfo.iSwitchToNumber = aPhoneNumber;
+    }
+
+// -----------------------------------------------------------------------------
+// From base class MPEDataStore
+// Sets call index
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallIndex( TInt aCallIndex, TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetCallIndex( aCallIndex );
+    }
+
+// -----------------------------------------------------------------------------
+// From base class MPEDataStore
+// Sets call origin
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallOrigin( TPECallOrigin aOrigin, TInt aCallId )
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->SetCallOrigin( aOrigin ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SwitchToNumberCommand
+// Return the switch to number from the TPECallCommandInfo structure.
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::SwitchToNumberCommand() const
+    {
+    return iCallCommandInfo.iSwitchToNumber;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::UnattendedTransferTarget
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::UnattendedTransferTarget( 
+        TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( aCallId < iCurrentCalls.Count(), 
+        Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->UnattendedTransferTarget(); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetUnattendedTransferTarget
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetUnattendedTransferTarget( const TPEPhoneNumber& aTarget,
+        TInt aCallId )
+    {
+    __ASSERT_DEBUG( aCallId < iCurrentCalls.Count(),
+        Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetUnattendedTransferTarget( aTarget );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ForwardAddressChoices
+// -----------------------------------------------------------------------------
+//
+const CDesC8Array* CPEEngineInfoImpl::ForwardAddressChoices( 
+        TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( aCallId < iCurrentCalls.Count(), 
+        Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->ForwardAddressChoices(); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetForwardAddressChoices
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetForwardAddressChoices( const CDesC8Array* aArray,
+        TInt aCallId )
+    {
+    __ASSERT_DEBUG( aCallId < iCurrentCalls.Count(),
+        Panic( EPEPanicCallIndexOutOfRange ) );
+    iCurrentCalls[ aCallId ]->SetForwardAddressChoices( aArray );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetForwardAddressIndex
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetForwardAddressIndex( TInt aIndex )
+    {
+    iCallCommandInfo.iForwardToAddressIndex = aIndex;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ForwardAddressIndex
+// -----------------------------------------------------------------------------
+//
+TInt CPEEngineInfoImpl::ForwardAddressIndex()
+    {
+    return iCallCommandInfo.iForwardToAddressIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetTransferTargetCommand
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetTransferTargetCommand( const TPEPhoneNumber& aTransferTarget )
+    {
+    iCallCommandInfo.iTransferToAddress = aTransferTarget; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::TransferTarget
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::TransferTargetCommand() const
+    {
+    return iCallCommandInfo.iTransferToAddress;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfo::SetIsSwitchToOperationOngoing
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetIsSwitchToOperationOngoing( const TBool aValue )
+    {
+    TEFLOGSTRING2( KTAINT, "SetIsSwitchToOperationOngoing: %d", aValue );
+    iBasicInfo.iSwitchToOngoing = aValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfo::IsSwitchToOperationOngoing
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::IsSwitchToOperationOngoing() const
+    {
+    TEFLOGSTRING2( KTAINT, "IsSwitchToOperationOngoing: %d", iBasicInfo.iSwitchToOngoing );
+    return iBasicInfo.iSwitchToOngoing;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfo::CallOrigin
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TPECallOrigin CPEEngineInfoImpl::CallOrigin( const TInt aCallId ) const
+    {
+    __ASSERT_DEBUG( iCurrentCalls.Count() > aCallId, Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCurrentCalls[ aCallId ]->CallOrigin();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallerImage
+// -----------------------------------------------------------------------------
+//
+const TPtrC CPEEngineInfoImpl::CallerImage( const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->CallerImage();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallerText
+// -----------------------------------------------------------------------------
+//
+const TPtrC CPEEngineInfoImpl::CallerText( const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->CallerText();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CallerThumbnail
+// -----------------------------------------------------------------------------
+//
+CFbsBitmap* CPEEngineInfoImpl::CallerThumbnail( const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->CallerThumbnail();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::HasCallerThumbnail
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::HasCallerThumbnail( const TInt aCallId ) const
+   {
+    return ( *iRemoteInfo )[ aCallId ]->HasCallerThumbnail();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ContactId
+// -----------------------------------------------------------------------------
+//
+const CPhCntContactId& CPEEngineInfoImpl::ContactId( const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->ContactId();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ContactGroups
+// -----------------------------------------------------------------------------
+//
+const TArray< TContactItemId > CPEEngineInfoImpl::ContactGroups(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->ContactGroups();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ContactLink
+// -----------------------------------------------------------------------------
+//
+const TDesC8& CPEEngineInfoImpl::ContactLink( const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->ContactLink();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::PersonalRingingTone
+// -----------------------------------------------------------------------------
+//
+const TPEContactFileName& CPEEngineInfoImpl::PersonalRingingTone(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->PersonalRingingTone();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemoteCompanyName
+// -----------------------------------------------------------------------------
+//
+const TPEContactCompany& CPEEngineInfoImpl::RemoteCompanyName(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->CompanyName();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemoteName
+// -----------------------------------------------------------------------------
+//
+const TPEContactName& CPEEngineInfoImpl::RemoteName( const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->Name();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemotePhoneNumber
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::RemotePhoneNumber(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->PhoneNumber();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemotePhoneNumberType
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumberIdType& CPEEngineInfoImpl::RemotePhoneNumberType(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->PhoneNumberType();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemoteTextToSpeechText
+// -----------------------------------------------------------------------------
+//
+const TPtrC CPEEngineInfoImpl::RemoteTextToSpeechText(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->TextToSpeechText();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemotePredefinedDtmfStrings
+// -----------------------------------------------------------------------------
+//
+const  CDesCArray& CPEEngineInfoImpl::RemotePredefinedDtmfStrings(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->PredefinedDtmfStrings();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::RemoteColpNumber
+// -----------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPEEngineInfoImpl::RemoteColpNumber(
+    const TInt aCallId ) const
+    {
+    return ( *iRemoteInfo )[ aCallId ]->ColpNumber();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ResetRemoteInfo
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::ResetRemoteInfo( const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->ResetRemoteInfo();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallerImage
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallerImage(
+    const TPtrC aCallerImage, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetCallerImage( aCallerImage );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallerText
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallerText(
+    const TPtrC aCallerText, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetCallerText( aCallerText );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetCallerThumbnail
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetCallerThumbnail(
+    CFbsBitmap* aCallerThumbnail, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetCallerThumbnail( aCallerThumbnail );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetHasCallerThumbnail
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetHasCallerThumbnail(
+    TBool aStatus, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetHasCallerThumbnail( aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetPredefinedDtmfStrings
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetPredefinedDtmfStrings( 
+    const CDesCArray& aArray, 
+    const TInt aCallId )            
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetPredefinedDtmfStrings( aArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetContactGroups
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetContactGroups(
+    TArray< TContactItemId >& aGroupIdArray,
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetContactGroups( aGroupIdArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetContactId
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetContactId(
+        CPhCntContactId* aContactId,
+        const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetContactId( aContactId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetPersonalRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetPersonalRingingTone(
+    const TPEContactFileName& aRingingTonepath,
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetPersonalRingingTone( aRingingTonepath );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRemoteCompanyName
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRemoteCompanyName(
+    const TPEContactName& aCompanyName, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetCompanyName( aCompanyName );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRemoteColpNumber
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRemoteColpNumber(
+    TPEPhoneNumber& aColpNumber, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetColpNumber( aColpNumber );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRemoteName
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRemoteName(
+    const TPEContactName& aContactName, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetName( aContactName );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRemotePhoneNumber
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRemotePhoneNumber(
+    const TPEPhoneNumber& aPhoneNumber, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetPhoneNumber( aPhoneNumber );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRemotePhoneNumberType
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRemotePhoneNumberType(
+    TPEPhoneNumberIdType aPhoneNumberType, 
+    const TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetPhoneNumberType( aPhoneNumberType );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetRemoteTextToSpeechText
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetRemoteTextToSpeechText(
+    HBufC* aText,
+    TInt aCallId )
+    {
+    return ( *iRemoteInfo )[ aCallId ]->SetTextToSpeechText( aText );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::CheckIfCallStateExists
+// Checks if given state can be found.
+// -----------------------------------------------------------------------------
+//
+TBool CPEEngineInfoImpl::CheckIfCallStateExists( const TPEState& aCallState )
+    {
+    TInt count = iCurrentCalls.Count();
+    TBool stateExists(EFalse);
+    for ( TInt i = 0; i < count; i++ )
+      {
+      if( aCallState == iCurrentCalls[ i ]->CallState() )
+          {
+          stateExists = ETrue;
+          break;
+          }
+      }
+    return stateExists;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::SetContactId
+// -----------------------------------------------------------------------------
+//
+void CPEEngineInfoImpl::SetContactId2( const TInt aContactId )
+{
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEEngineInfo::SetContactId: aContactId: %d", aContactId );
+    iContactId = aContactId;    
+}
+
+// -----------------------------------------------------------------------------
+// CPEEngineInfoImpl::ContactId
+// -----------------------------------------------------------------------------
+//
+TInt CPEEngineInfoImpl::ContactId2 () const
+    {
+    TEFLOGSTRING2( KTAINT, "ContactId: %d", iContactId );
+    return iContactId;      
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/cperemoteinfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,401 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of the CPERemoteInfo object
+*
+*/
+
+#include <cphcntcontactid.h>
+#include "cperemoteinfo.h"
+#include "talogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPERemoteInfo::NewL
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CPERemoteInfo* CPERemoteInfo::NewL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPERemoteInfo::NewL" );
+    CPERemoteInfo* remoteInfo = new ( ELeave ) CPERemoteInfo();
+    return remoteInfo;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPERemoteInfo::CPERemoteInfo()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPERemoteInfo::CPERemoteInfo" );
+    ResetRemoteInfo();
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPERemoteInfo::~CPERemoteInfo()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPERemoteInfo::~CPERemoteInfo" );
+    delete iTextToSpeechText;
+    delete iCallerText;
+    delete iCallerImage;
+    delete iContactLink;
+    if ( iContactId )
+        {
+        if ( iContactId->IsValid() )
+            {
+            iContactId->Invalidate();
+            delete iContactId;
+            }
+        }
+    iGroupId.Reset();
+    delete iCallerThumbnail;
+    delete iPredefinedDtmfStrings;
+    }
+
+TInt CPERemoteInfo::CallId() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::CallId, id: %d", iCallId );
+    return iCallId;
+    }
+
+const CPhCntContactId& CPERemoteInfo::ContactId() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::ContactId, ptr: %x", iContactId );
+    return *iContactId;
+    }
+
+const TDesC8& CPERemoteInfo::ContactLink() const
+    {
+    if( iContactLink )
+        {
+        return *iContactLink;
+        }
+    else
+        {
+        return KNullDesC8;
+        }
+    }
+
+const TPEPhoneNumber& CPERemoteInfo::PhoneNumber() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::PhoneNumber, number: '%S'", &iPhoneNumber );
+    return iPhoneNumber;
+    }
+
+const TPEPhoneNumber& CPERemoteInfo::ColpNumber() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::ColpNumber, number: '%S'", &iColpNumber );
+    return iColpNumber;
+    }
+
+const TPEContactName& CPERemoteInfo::Name() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::Name, name: '%S'", &iName );
+    return iName;
+    }
+
+const TPEContactCompany& CPERemoteInfo::CompanyName() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::CompanyName, name: '%S'", &iCompanyName );
+    return iCompanyName;
+    }
+
+const TPEContactFileName& CPERemoteInfo::PersonalRingingTone() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::PersonalRingingTone, path: '%S'", &iPersonalRingingTone );
+    return iPersonalRingingTone;
+    }
+
+const TPEPhoneNumberIdType& CPERemoteInfo::PhoneNumberType() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::PhoneNumberType, type: %d", iPhoneNumberType );
+    return iPhoneNumberType;
+    }
+
+const TPtrC CPERemoteInfo::TextToSpeechText() const
+    {
+    if( iTextToSpeechText )
+        {
+        TEFLOGSTRING2( KTAINT, "CPERemoteInfo::TextToSpeechText, path: '%S'", iTextToSpeechText );
+        return *iTextToSpeechText;
+        }
+    else
+        {
+        return KNullDesC();
+        }
+    }
+
+const TArray< TContactItemId > CPERemoteInfo::ContactGroups() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::ContactGroups, entries: %d", iGroupId.Count() );
+    return iGroupId.Array();
+    }
+
+const TPtrC CPERemoteInfo::CallerText() const
+    {
+    if( iCallerText )
+        {
+        TEFLOGSTRING2( KTAINT, "CPERemoteInfo::CallerText, path: '%S'", iCallerText );
+        return *iCallerText;
+        }
+    else
+        {
+        return KNullDesC();
+        }
+    }
+
+const TPtrC CPERemoteInfo::CallerImage() const
+    {
+    if( iCallerImage )
+        {
+        TEFLOGSTRING2( KTAINT, "CPERemoteInfo::CallerImage, path: %S", iCallerImage );
+        return *iCallerImage;
+        }
+    else
+        {
+        return KNullDesC();
+        }
+    }
+
+CFbsBitmap* CPERemoteInfo::CallerThumbnail() const
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::CallerThumbnail, ptr: %x", iCallerThumbnail );
+    return iCallerThumbnail;
+    }
+
+TBool CPERemoteInfo::HasCallerThumbnail() const
+    {
+    return iHasCallerThumbnail;
+    }    
+
+void CPERemoteInfo::SetCallId( const TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetCallId, id: %d", iCallId );
+    iCallId = aCallId;
+    }
+
+void CPERemoteInfo::SetContactId( CPhCntContactId* aContactId )
+    {
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetContactId, ptr: %x", iContactId );
+    iContactId = aContactId;
+    
+    delete iContactLink;
+    iContactLink = NULL;
+    TRAP_IGNORE( iContactLink = iContactId->PackLC();
+        CleanupStack::Pop( iContactLink ); );
+
+    }
+
+void CPERemoteInfo::SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber )
+    {
+    iPhoneNumber = aPhoneNumber;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetPhoneNumber, number: '%S'", &iPhoneNumber );
+    }
+
+void CPERemoteInfo::SetColpNumber( const TPEPhoneNumber& aColpNumber )
+    {
+    iColpNumber = aColpNumber;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetColpNumber, number: '%S'", &iColpNumber );
+    }
+
+void CPERemoteInfo::SetName( const TPEContactName& aContactName )
+    {
+    iName = aContactName;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetName, name: '%S'", &iName );
+    }
+
+void CPERemoteInfo::SetCompanyName( const TPEContactName& aCompanyName )
+    {
+    iCompanyName = aCompanyName;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetCompanyName, company name: '%S'", &iCompanyName );
+    }
+
+void CPERemoteInfo::SetPersonalRingingTone(
+        const TPEContactFileName& aPersonalRingingTone )
+    {
+    iPersonalRingingTone = aPersonalRingingTone;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetPersonalRingingTone, path: '%S'", &iPersonalRingingTone );
+    }
+
+void CPERemoteInfo::SetPhoneNumberType( const TPEPhoneNumberIdType aPhoneNumberType )
+    {
+    iPhoneNumberType = aPhoneNumberType;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetPhoneNumberType, type: %d", iPhoneNumberType );
+    }
+
+void CPERemoteInfo::SetTextToSpeechText( HBufC* aText )
+    {
+    iTextToSpeechText = aText;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetTextToSpeechText, path: '%S'", &iTextToSpeechText );
+    }
+
+void CPERemoteInfo::SetContactGroups(
+        const TArray< TContactItemId >& aGroupIdArray )
+    {
+    TEFLOGSTRING( KTAINT, "CPERemoteInfo::SetContactGroups" );
+    TInt errorCode( KErrNone );
+
+    iGroupId.Reset();
+    for ( TInt i = 0; i < aGroupIdArray.Count(); i++ )
+        {
+        errorCode = iGroupId.Append( aGroupIdArray[ i ] );
+        TEFLOGSTRING3( 
+            KTAINT, 
+            "PE CPERemoteInfo::SetContactGroups, index: %d, group id: %d", 
+            i, 
+            aGroupIdArray[ i ] );
+        }
+    if ( errorCode != KErrNone )
+        {
+        TEFLOGSTRING2( KTAERROR,
+            "CPERemoteInfo::SetContactGroups ! RARRAY::APPEND FAILED WITH EXIT CODE: &d",
+            errorCode );
+        iGroupId.Reset();
+        }
+    TEFLOGSTRING2( KTAINT, "PE CPERemoteInfo::SetContactGroups, entries: %d", iGroupId.Count() );
+    }
+
+void CPERemoteInfo::SetCallerText( const TPtrC aCallerText )
+    {
+    delete iCallerText;
+    if ( aCallerText.Length() > 0 )
+        {
+        iCallerText = aCallerText.Alloc();
+        TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetCallerText, text: '%S'", &iCallerText );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "CPEREMOTEINFO::SETCALLERTEXT ! NO CALLER TEXT" );
+        }
+    }
+
+void CPERemoteInfo::SetCallerImage( const TPtrC aCallerImage )
+    {
+    delete iCallerImage;
+    if ( aCallerImage.Length() > 0 )
+        {
+        iCallerImage = aCallerImage.Alloc();
+        TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetCallerImage, path: '%S'", &iCallerImage );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "CPEREMOTEINFO::SETCALLERIMAGE ! NO CALLER IMAGE PATH" );
+        }
+    }
+
+void CPERemoteInfo::SetCallerThumbnail( CFbsBitmap* aCallerThumbnail )
+    {
+    delete iCallerThumbnail;
+    iCallerThumbnail = aCallerThumbnail;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetCallerThumbnail, ptr: %x", iCallerThumbnail );
+    }
+
+
+void CPERemoteInfo::SetHasCallerThumbnail( TBool aStatus )
+    {
+    iHasCallerThumbnail = aStatus;
+    TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetHasCallerThumbnail, %d", aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// CPERemoteInfo::SetPredefinedDtmfStrings()
+//
+//  
+// -----------------------------------------------------------------------------
+//
+void CPERemoteInfo::SetPredefinedDtmfStrings( 
+            const CDesCArray& aArray )           
+    {
+    if ( iPredefinedDtmfStrings )
+        {
+        delete iPredefinedDtmfStrings;
+        iPredefinedDtmfStrings = NULL;
+        }
+    
+    TInt count = aArray.Count();
+  
+    if ( count )
+        {
+        TRAPD( err, iPredefinedDtmfStrings = new ( ELeave ) CDesCArrayFlat( count ) );
+        
+        if( err != KErrNone )
+            {
+            TEFLOGSTRING2( KTAINT, "CPERemoteInfo::SetPredefinedDtmfStrings, err: %d", err );
+            return;
+            }
+         
+        for ( TInt i = 0; i < count; i++ )
+            {
+            TRAP_IGNORE( iPredefinedDtmfStrings->AppendL( aArray.MdcaPoint(i) ) );    
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPERemoteInfo::PredefinedDtmfStrings()
+//
+//  
+// -----------------------------------------------------------------------------
+//
+CDesCArray& CPERemoteInfo::PredefinedDtmfStrings()
+    {
+    if ( !iPredefinedDtmfStrings )
+        {
+        // Create dymmy array to help post handling
+        TRAP_IGNORE( iPredefinedDtmfStrings = new ( ELeave ) CDesCArrayFlat( 1 ) );        
+        }
+    return *iPredefinedDtmfStrings;    
+    }
+
+
+void CPERemoteInfo::ResetRemoteInfo()
+    {
+    TEFLOGSTRING( KTAINT, "CPERemoteInfo::ResetRemoteInfo" );
+    iPhoneNumber = KNullDesC;
+    iColpNumber = KNullDesC;
+    iName = KNullDesC;
+    iCompanyName = KNullDesC;
+    iPersonalRingingTone = KNullDesC;
+    iPhoneNumberType = EPEUnknownNumber;
+    delete iTextToSpeechText;
+    iTextToSpeechText = NULL;
+    delete iCallerText;
+    iCallerText = NULL;
+    delete iCallerImage;
+    iCallerImage = NULL;
+    if ( iContactId )
+        {
+        if ( iContactId->IsValid() )
+            {
+            iContactId->Invalidate();
+            delete iContactId;
+            iContactId = NULL;
+            }
+        }
+    
+    delete iContactLink;
+    iContactLink = NULL;
+    
+    iGroupId.Reset();
+    delete iCallerThumbnail;
+    iCallerThumbnail = NULL;
+    delete iPredefinedDtmfStrings;
+    iPredefinedDtmfStrings = NULL;
+    iHasCallerThumbnail = EFalse;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/engineinfo/src/panic.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Panic method
+*
+*/
+
+#include <e32std.h>
+#include "pepanic.pan"
+
+// -----------------------------------------------------------------------------
+// Panic
+// -----------------------------------------------------------------------------
+//
+GLDEF_C void Panic( TPEPanic aPanic )
+    {
+    User::Panic( KPEPhoneEnginePanic, aPanic );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony / phoneengine
+*
+*/
+
+      
+#include "../audiohandling/group/bld.inf"
+#include "../callhandling/group/bld.inf"
+#include "../contacthandling2/group/bld.inf"
+#include "../loghandling/group/bld.inf"
+#include "../engineinfo/group/bld.inf"
+#include "../servicehandling/group/bld.inf"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/bwins/loghandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,10 @@
+EXPORTS
+	??1CPELogHandling@@UAE@XZ @ 1 NONAME ; CPELogHandling::~CPELogHandling(void)
+	??1CPELogHandlingDummy@@UAE@XZ @ 2 NONAME ; CPELogHandlingDummy::~CPELogHandlingDummy(void)
+	??1CPELogHandlingProxy@@UAE@XZ @ 3 NONAME ; CPELogHandlingProxy::~CPELogHandlingProxy(void)
+	?CreateFirstPhaseL@CPELogHandlingProxy@@SAPAVMPELogHandling@@XZ @ 4 NONAME ; class MPELogHandling * CPELogHandlingProxy::CreateFirstPhaseL(void)
+	?CreateSecondPhaseL@CPELogHandlingProxy@@QAEXAAVMPEPhoneModelInternal@@AAVRFs@@@Z @ 5 NONAME ; void CPELogHandlingProxy::CreateSecondPhaseL(class MPEPhoneModelInternal &, class RFs &)
+	?SaveCallEntry@CPELogHandling@@UAEHH@Z @ 6 NONAME ; int CPELogHandling::SaveCallEntry(int)
+	?SaveCallEntry@CPELogHandlingDummy@@UAEHH@Z @ 7 NONAME ; int CPELogHandlingDummy::SaveCallEntry(int)
+	?SaveCallEntry@CPELogHandlingProxy@@UAEHH@Z @ 8 NONAME ; int CPELogHandlingProxy::SaveCallEntry(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/data/loghandling_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing log handling dll.
+;
+; loghandling_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"loghandling"},(0x1000A830),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\loghandling.dll"
\ No newline at end of file
Binary file phoneengine/loghandling/data/loghandling_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/eabi/loghandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,39 @@
+EXPORTS
+	_ZN14CPELogHandling13SaveCallEntryEi @ 1 NONAME
+	_ZN14CPELogHandlingD0Ev @ 2 NONAME
+	_ZN14CPELogHandlingD1Ev @ 3 NONAME
+	_ZN14CPELogHandlingD2Ev @ 4 NONAME
+	_ZN19CPELogHandlingDummy13SaveCallEntryEi @ 5 NONAME
+	_ZN19CPELogHandlingDummyD0Ev @ 6 NONAME
+	_ZN19CPELogHandlingDummyD1Ev @ 7 NONAME
+	_ZN19CPELogHandlingDummyD2Ev @ 8 NONAME
+	_ZN19CPELogHandlingProxy13SaveCallEntryEi @ 9 NONAME
+	_ZN19CPELogHandlingProxy17CreateFirstPhaseLEv @ 10 NONAME
+	_ZN19CPELogHandlingProxy18CreateSecondPhaseLER21MPEPhoneModelInternalR3RFs @ 11 NONAME
+	_ZN19CPELogHandlingProxyD0Ev @ 12 NONAME
+	_ZN19CPELogHandlingProxyD1Ev @ 13 NONAME
+	_ZN19CPELogHandlingProxyD2Ev @ 14 NONAME
+	_ZTI11CPELogEvent @ 15 NONAME ; #<TI>#
+	_ZTI14CPELogHandling @ 16 NONAME ; #<TI>#
+	_ZTI18CPELogExternalData @ 17 NONAME ; #<TI>#
+	_ZTI19CPELogHandlingDummy @ 18 NONAME ; #<TI>#
+	_ZTI19CPELogHandlingProxy @ 19 NONAME ; #<TI>#
+	_ZTI21CPELogHandlingCommand @ 20 NONAME ; #<TI>#
+	_ZTV11CPELogEvent @ 21 NONAME ; #<VT>#
+	_ZTV14CPELogHandling @ 22 NONAME ; #<VT>#
+	_ZTV18CPELogExternalData @ 23 NONAME ; #<VT>#
+	_ZTV19CPELogHandlingDummy @ 24 NONAME ; #<VT>#
+	_ZTV19CPELogHandlingProxy @ 25 NONAME ; #<VT>#
+	_ZTV21CPELogHandlingCommand @ 26 NONAME ; #<VT>#
+	_ZThn4_N14CPELogHandling13SaveCallEntryEi @ 27 NONAME ; #<thunk>#
+	_ZThn4_N14CPELogHandlingD0Ev @ 28 NONAME ; #<thunk>#
+	_ZThn4_N14CPELogHandlingD1Ev @ 29 NONAME ; #<thunk>#
+	_ZThn4_N19CPELogHandlingDummy13SaveCallEntryEi @ 30 NONAME ; #<thunk>#
+	_ZThn4_N19CPELogHandlingDummyD0Ev @ 31 NONAME ; #<thunk>#
+	_ZThn4_N19CPELogHandlingDummyD1Ev @ 32 NONAME ; #<thunk>#
+	_ZThn4_N19CPELogHandlingProxy13SaveCallEntryEi @ 33 NONAME ; #<thunk>#
+	_ZThn4_N19CPELogHandlingProxyD0Ev @ 34 NONAME ; #<thunk>#
+	_ZThn4_N19CPELogHandlingProxyD1Ev @ 35 NONAME ; #<thunk>#
+	_ZTI10CPELogInfo @ 36 NONAME ; #<TI>#
+	_ZTV10CPELogInfo @ 37 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  LogHandling bld file
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/cpeloghandlingproxy.h         |../../inc/cpeloghandlingproxy.h
+../inc/mpeloghandling.h              |../../inc/mpeloghandling.h
+
+// SIS stubs
+../data/loghandling_stub.sis        /epoc32/data/z/system/install/loghandling_stub.sis
+
+PRJ_MMPFILES
+loghandling.mmp
+
+#endif // RD_PHONE_NG
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/group/loghandling.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for Log Handling dll
+*
+*/
+
+#ifdef RD_PHONE_NG
+
+#include <platform_paths.hrh>
+
+TARGET          loghandling.dll
+TARGETTYPE      dll
+UID             0x10000079 0x1000A830
+VENDORID        VID_DEFAULT
+
+CAPABILITY      CAP_GENERAL_DLL
+
+SOURCEPATH      ../src
+
+SOURCE          cpeloghandling.cpp
+SOURCE          cpeloginfo.cpp
+SOURCE          cpeloghandlingdummy.cpp
+SOURCE          cpeloghandlingproxy.cpp
+SOURCE          peloghandlingpanic.cpp
+SOURCE          cpelogevent.cpp
+SOURCE          cpeloghandlingcommand.cpp
+SOURCE          cpelogexternaldata.cpp
+SOURCE          cpelogextensionwrapper.cpp
+
+USERINCLUDE     ../inc
+
+APP_LAYER_SYSTEMINCLUDE         // Application layer domain APIs
+SYSTEMINCLUDE   ../../inc          // PhoneEngine private headers
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+LIBRARY         customapi.lib
+LIBRARY         efsrv.lib
+LIBRARY         engineinfo.lib
+LIBRARY         euser.lib
+LIBRARY         flogger.lib // For logging
+LIBRARY         logcli.lib 
+LIBRARY         logwrap.lib 
+
+LIBRARY         centralrepository.lib
+LIBRARY         serviceprovidersettings.lib
+LIBRARY         ecom.lib
+
+LANG            SC
+START WINS
+BASEADDRESS 0x10040000
+END
+
+#endif // RD_PHONE_NG
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpelogevent.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPELogEvent class.
+*
+*/
+
+
+
+
+#ifndef    CPELOGEVENT_H
+#define    CPELOGEVENT_H
+
+//  INCLUDES
+#include "pevirtualengine.h"
+#include "cpeloghandling.h"
+#include <logwrap.h>
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <logwraplimits.h>
+#include <logengdurations.h>
+#endif
+
+// CONSTANTS
+const TInt KPEESDWFormattedTimeLength( 50 ); // Formatted time length
+_LIT( KPEESDWTimeFormat, "%F%D/%M/%Y %H:%T:%S" ); //Time format
+
+//Defined in \s60\app\contacts\logsui\EngineIncLogsApiConsts.h
+const TInt KTUintCharLength( 10 );
+
+// MACROS
+//None.
+
+// DATA TYPES
+//None.
+
+// FUNCTION PROTOTYPES
+//None.
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+* CPELogEvent is the class that interfaced with Symbian Log Engine over the
+* log client interface.
+*
+*  @lib loghandling.lib
+*  @since Series60_2.7
+*/
+class CPELogEvent : public CBase
+    {
+    public:  // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CPELogEvent* NewL( CPELogHandling& aOwner,
+                                  CPELogHandlingCommand& aLogHandlingCommand );
+     
+        /**
+        * Destructor.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        virtual ~CPELogEvent(); 
+         
+    protected:
+        
+        /**
+        * C++ default constructor.
+        */
+        CPELogEvent( CPELogHandling& aOwner, CPELogHandlingCommand& aLogHandlingCommand );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        virtual void ConstructL();
+
+
+    public: // New functions
+        /**
+        * Add call entry to database.
+        * @param None
+        * @return None.
+        */
+        void SaveL( );
+
+        /**
+        * Update log info for the log event
+        * @param TPELogInfo& alogInfo, log information
+        * @return None.
+        */
+        void UpdateLogInfoL( const CPELogInfo& aLogInfo );
+        
+        /**
+        * Reset log info 
+        */
+        void ResetLogInfo();
+
+        /**
+        * Reset event.
+        * @since N/A
+        * @param None.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        void ResetEvent();      
+       
+        /* Get call id of the event
+        * @param: None
+        * @return TInt aCallId, call idendification.
+        */  
+        TInt CallId( );
+
+        /* Check is the event has been completed; no new updates expected
+        * @param: None.
+        * @return TBool ETrue or False.
+        */  
+        TBool IsCompleted();
+
+        /* Check is the event has been completed; no new updates expected
+        * @param: None.
+        * @return None.
+        */  
+        void SetAdded();
+        
+        /* Get call id of the event
+        * @param: None
+        * @return TBool save leave flag. ETrue if SaveL leaves.
+        */  
+        TBool SaveLeave( );        
+
+    private:
+        /**
+        * Set phonenumber type to event subject from phonenumber id.
+        * @since N/A
+        * @param None.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        void SetPhoneNumberId();
+    
+        /**
+        * Set Event type
+        * @since N/A
+        * @param None.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        void SetEventTypeL();
+
+        /**
+        * Set log event information.
+        * @since N/A
+        * @param None.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        void SetLogEvent();
+
+        /**
+        * Set log event duration.
+        * @since N/A
+        * @param None.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                        
+        void SetDuration();
+
+        /**
+        * Sets callers service id to log event.
+        * @since N/A
+        * @param None.
+        * @return None.
+        */
+        void SetServiceIdL();
+        
+        /**
+        * Sets callers contact link to log event.
+        * 
+        * @since v5.0
+        */
+        void SetContactLinkL();
+
+        /**
+        * Sets a data field like VoIP address or my address.
+        * @since    S60 v5.1
+        * @param    aTag        Log tag identifying a field.
+        * @param    aFieldData  Field data.
+        */
+        void SetDataFieldL( const TDesC8& aTag, const TDesC& aFieldData );
+
+        /**
+         * Sets remote party to the given log event.
+         * @since    S60 v5.1
+         * @param    aEvent        Log event.
+         * @param    aLogInfo      Log info containing remote party.
+         */
+        void SetRemoteParty( CLogEvent& aEvent, const CPELogInfo& aLogInfo );
+        
+        /**
+         * Sets remote contact to the given log event.
+         * @since    S60 v5.1
+         * @param    aEvent        Log event.
+         * @param    aLogInfo      Log info containing remote contact.
+         */
+        void SetRemoteContact( CLogEvent& aEvent, const CPELogInfo& aLogInfo );
+        
+    private:    // Data
+        // Owner of the object.
+        CPELogHandling& iOwner;
+        // Reference to log handling command object
+        CPELogHandlingCommand& iLogHandlingCommand; 
+        // Log database event.
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        CLogEvent* iEvent;       
+        // Call information.
+        CPELogInfo* iLogInfo;
+        // Completed indicator
+        TBool iCompleted;
+        // Added indicator.
+        TBool iAdded;
+        // Save Leave indicator
+        TBool iSaveLeave;
+    };
+
+#endif      // CPELOGSENTRY_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpelogextensionwrapper.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of CPELogExtensionWrapper class.
+*
+*/
+
+
+
+#ifndef C_CPELOGEXTENSIONWRAPPER_H
+#define C_CPELOGEXTENSIONWRAPPER_H
+
+#include <e32base.h>
+#include <telloggingextension.h>
+
+/**
+ *  Provides container friendly interface for extension plugin handling.
+ *    
+ *  @lib loghandling.dll
+ *  @since S60 v5.1
+ */
+NONSHARABLE_CLASS( CPELogExtensionWrapper ) : public CTelLoggingExtension
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param   aImplementationUid  An Ecom plugin implementation identifier.
+     */
+    static CPELogExtensionWrapper* NewL( TUid aImplementationUid );
+
+    /**
+     * Two-phased constructor.
+     * @param   aImplementationUid  An Ecom plugin implementation identifier.
+     */
+    static CPELogExtensionWrapper* NewLC( TUid aImplementationUid );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CPELogExtensionWrapper();
+
+    /**
+     * Provides comparison algorithm for CPELogExtensionWrapper objects using
+     * extension plugin implementation identifier as a search key.
+     * 
+     * @param   aKey        A search key.
+     * @param   aWrapper    An object to match with a key.
+     * @since   S60 v5.1
+     * @return  ETrue if match, EFalse otherwise.
+     */
+    static TBool MatchByUid( 
+        const TUid* aKey, const CPELogExtensionWrapper& aWrapper );
+    
+    // from base class CTelLoggingExtension
+    /**
+    * From CTelLoggingExtension.
+    * @see CTelLoggingExtension.
+    */
+    void InitializeL( TUint aServiceId, const TDesC& aOrigAddress );
+    
+    /**
+    * From CTelLoggingExtension.
+    * @see CTelLoggingExtension.
+    */
+    TInt GetPhoneNumber( RBuf& aPhoneNumber );
+
+    /**
+    * From CTelLoggingExtension.
+    * @see CTelLoggingExtension.
+    */
+    TInt GetVoipAddress( RBuf& aVoipAddress );
+    
+    /**
+    * From CTelLoggingExtension.
+    * @see CTelLoggingExtension.
+    */
+    TInt GetMyAddress( RBuf& aMyAddress );
+    
+    /**
+    * From CTelLoggingExtension.
+    * @see CTelLoggingExtension.
+    */
+    TInt GetRemotePartyName( RBuf& aRemotePartyName );
+
+private:
+
+    CPELogExtensionWrapper() {};
+    
+    CPELogExtensionWrapper( TUid aImplementationUid );
+
+    void ConstructL();
+    
+    /**
+     * Creates logging extension plugin.
+     * @since   S60 v5.1
+     * @return A new logging extension plugin instance.
+     */
+    CTelLoggingExtension* CreateLoggingExtensionL() const;
+    
+    /**
+     * Returns identifier of the wrapped extension plugin.
+     * @since   S60 v5.1
+     * @return Identifier of the extension plugin.
+     */
+    TUid Identifier() const;
+
+private: // data
+
+    /**
+     * Extension plugin identifier.
+     */
+    TUid iPluginUid;
+
+    /**
+     * Logging extension plugin.
+     * Own.
+     */
+    CTelLoggingExtension* iPlugin;
+
+    };
+
+#endif // C_CPELOGEXTENSIONWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpelogexternaldata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPELogExternalData class.
+*
+*/
+
+
+#ifndef    CPELOGEXTERNALDATA_H
+#define    CPELOGEXTERNALDATA_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPELogInfo;
+class CPELogHandling;
+class CRepository;
+
+// CLASS DECLARATION
+
+class CPELogExternalData : public CBase
+    {
+    public:
+
+        /**
+        * Two-phased constructor
+        */
+        static CPELogExternalData* NewL( CPELogHandling& aOwner );
+             
+        /**
+         * Destructor.
+         */
+        /*****************************************************
+        *    Series 60 Customer / REPOSITORY
+        *    Series 60  REPOSITORY API
+        *****************************************************/                
+        virtual ~CPELogExternalData();
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CPELogExternalData( CPELogHandling& aOwner );
+
+        /**
+        * Constructor, second phase. 
+        */
+        /*****************************************************
+        *    Series 60 Customer / REPOSITORY
+        *    Series 60  REPOSITORY API
+        *****************************************************/                
+        void ConstructL();
+
+    public:
+ 
+        /**
+        * Update call timers value.
+        * @since N/A
+        * @param  CPELogInfo aCallInfo, call information.
+        * @return None.
+        */
+        void UpdateCallTimers( const CPELogInfo& aLogInfo );
+
+        /**
+        * Update line specific last call timers.
+        * @since since S90 1.1
+        * @param  CPELogInfo aLogInfo, call information.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / REPOSITORY
+        *    Series 60  REPOSITORY API
+        *****************************************************/                
+        void UpdateLastCallTimerByLine( const CPELogInfo& aLogInfo );
+
+        /**
+        * Update the last call timer when no calls left.
+        * @since since S90 1.1
+        * @param  CPELogInfo aLogInfo, call information.
+        * @return in multicall case duration from start of first to end of last.
+        */
+        /*****************************************************
+        *    Series 60 Customer / REPOSITORY
+        *    Series 60  REPOSITORY API
+        *****************************************************/                
+        TInt UpdateLastCallTimer( const CPELogInfo& aLogInfo );
+
+        /**
+        * Increase missed call's counter value.
+        * @since N/A
+        * @param None.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / REPOSITORY
+        *    Series 60  REPOSITORY API
+        *****************************************************/                
+        void IncreaseMissedCallValue( const TInt aCallId );
+        
+        /**
+        * Set first call start time.
+        * @since N/A
+        * @param: TTime aFirstCallStartTime 
+        * @return: None.
+        */
+        void SetFirstCallStartTime( const TTime& aFirstCallStartTime );
+
+    private:
+        /**
+        * Update call timers value.
+        * @since  since S90 1.1
+        * @param  aTimer            Timer key
+        * @param  aDuration         Call duration
+        * @param  aRepository       Repository to use
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / REPOSITORY
+        *    Series 60  REPOSITORY API
+        *****************************************************/                
+        void UpdateTimer( const TUint32 aTimer, TInt aDuration, 
+            CRepository& aRepository );
+
+    private:
+        // Owner of the object.   
+        CPELogHandling&  iOwner; 
+        // First call start time
+        TTime iFirstCallStartTime;
+        // Repository
+        /*****************************************************
+        *    Series 60 Customer / REPOSITORY
+        *    Series 60  REPOSITORY API
+        *****************************************************/                
+        CRepository* iRepository;
+    };
+
+#endif // CPELOGSHANDLER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpeloghandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,339 @@
+/*
+* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPELogHandling class.
+*
+*/
+
+
+#ifndef    CPELOGHANDLING_H
+#define    CPELOGHANDLING_H
+
+//INCLUDES
+#include <e32base.h>
+#include <mccecall.h>
+#include <f32file.h>
+#include <logwrap.h>
+#include "mpeloghandling.h"
+
+// CONSTANTS
+// Maximum number of log events that may be needed at any given moment.
+// Due to log system limitations there is a chance more log event are needed
+// and this will be handled as it happens
+const TInt KPEMaximumNumberOfLogEvents = KPEMaximumNumberOfCalls + 2;
+
+// MACROS
+// None.
+
+// DATA TYPES
+typedef TBuf8<KCntMaxTextFieldLength> TPELogsDataFieldType;
+
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPELogHandlingCommand;
+class CPELogExternalData;
+class CPELogEvent;
+class CLogClient;
+class MPEPhoneModelInternal;
+class MPEDataStore;
+class CPELogInfo;
+class CTelLoggingExtension;
+class CSPSettings;
+class CPELogExtensionWrapper;
+
+// CLASS DECLARATION
+
+class CPELogHandling : public CBase,
+                       public MPELogHandling
+    {
+    public:
+
+        /**
+        * Two-phased constructor
+        */
+        static MPELogHandling* NewL( MPEPhoneModelInternal& aModel, RFs& aFsSession );
+             
+        /**
+         * Destructor.
+         */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        virtual IMPORT_C ~CPELogHandling();
+        
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CPELogHandling( MPEPhoneModelInternal& aModel, RFs& aFsSession );
+
+        /**
+        * Constructor, second phase. 
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        void ConstructL();
+
+    public: // From MPELogHandling
+        /**
+        * Save call entry
+        * @since N/A
+        * @param: TInt, call id
+        * @return: possible error code.
+        */
+        IMPORT_C TInt SaveCallEntry( const TInt aCallId );
+        
+    public:      
+        /**
+        * Reroutes messages to the Phone Model.
+        * @since Series60_2.7
+        * @param aMessage Message id.
+        * @param aErrorCode Error code.
+        * @return None.
+        */
+        void SendMessage( MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, TInt aErrorCode );
+
+        /* Get log string
+        * @param: None
+        * @return TLogString, string for incoming call.
+        */  
+        TLogString& LogStringIn( );
+
+
+        /* Get log string
+        * @param: None
+        * @return TLogString, string for outgoing call.
+        */  
+        TLogString& LogStringOut( );
+
+        /* Get log string
+        * @param: None
+        * @return TLogString, string for missed call.
+        */  
+        TLogString& LogStringMissed( );
+
+        /* Get log string
+        * @param: None
+        * @return TLogString, string for delivery.
+        */  
+        TLogString& LogStringDelivery( );
+
+        /* Get log string
+        * @param: None
+        * @return TLogString, string for incoming auxiliary call.
+        */  
+        TLogString& LogStringInAlt( );
+        
+        /* Get log string
+        * @param: None
+        * @return TLogString, string for outgoing auxiliary call.
+        */  
+        TLogString& LogStringOutAlt( );
+        
+        /* Get log string
+        * @param: None
+        * @return TLogString, string for unknown call.
+        */  
+        TLogString& LogStringUnknown( );
+        
+        /**
+        * Reset missed call status.
+        */
+        void ResetMissedCalls( const TInt aCallId );
+        
+    private:
+
+        /**
+         * Set remote contact information to log info.
+         * @since   S60 v9.1
+         * @param   aCallId     Call identifier.
+         * @param   aLogInfo    Log info.
+         */
+        void SetRemoteContact( TInt aCallId, CPELogInfo& aLogInfo );
+        
+        /**
+        * Update call info to log database.
+        * @since N/A
+        * @param  CPELogInfo aCallInfo, call information.
+        * @return None.
+        */
+        void SaveCallInfoL( const CPELogInfo& aLogInfo );
+
+        /**
+        * Save log event
+        * @since N/A
+        * @param: const CPELogInfo&, log information
+        * @return: none.
+        */
+        void SaveEventL( const CPELogInfo& aLogInfo );        
+    
+        /**
+        * Find Log database entry index by given call id.
+        * @since Series60_2.7
+        * @param: TInt aCallId , call identification number.
+        * @return: Error code.
+        */
+        TInt FindEventIndexById( const TInt aCallId );
+        
+        /**
+        * Delete event in Id array
+        * @since Series60_2.7
+        * @param: CPELogsEntry* aLogEntry pointer
+        * @return: None.
+        */
+        void DeleteArrayEntry( CPELogEvent* aLogEvent );                
+
+        /**
+        * Log Handling cleanup if log handling of an event leaves.
+        * @since Series60_2.7
+        */
+        void DoCleanup();
+        
+        /**
+         * Updates log info with a data queried from logging extension plugin.
+         * Log info is not changed if error happens while using extension.
+         * @since   S60 v9.1
+         * @param   aCallId     Call identifier.
+         * @param   aLogInfo    Log info to be updated.
+         */
+        void UpdateLogInfoWithExtensionDataL( TInt aCallId, 
+            CPELogInfo& aLogInfo );
+
+        /**
+         * Returns logging extension plugin for the given service. A new 
+         * plugin is created if extension is not yet created for the service.
+         * @since   S60 v5.1
+         * @param   aServiceId  Service identifier.
+         */
+        CTelLoggingExtension& LoggingExtensionL( TUint aServiceId );
+        
+        /**
+         * Returns logging extension plugin identifier from service
+         * provider settings.
+         * @since   S60 v9.1
+         * @param   aServiceId  Service identifier.
+         */
+        TUid LoggingPluginIdentifierL( TUint aServiceId ) const;
+        
+        /**
+         * Sets extension data to log info.
+         * @since   S60 v9.1
+         * @param   aLogInfo        Log info to be updated.
+         * @param   aPhoneNumber    Phone number of remote party.
+         * @param   aVoipAddress    Voip address of remote party.
+         * @param   aMyAddress      Local user's registered address.
+         * @param   aRemotePartyName Name of the remote party.
+         */
+        void SetExtensionData( CPELogInfo& aLogInfo, 
+            const TDesC& aPhoneNumber, const TDesC& aVoipAddress, 
+            const TDesC& aMyAddress, const TDesC& aRemotePartyName );
+        
+        /**
+         * Creates an logging extension wrapper instance.
+         * @since   S60 v5.1
+         * @param   aPluginUid      An ECom plugin implementation identifier.
+         * @return  Extension wrapper instance.
+         */
+        CPELogExtensionWrapper* CreateExtensionWrapperLC( 
+            const TUid& aPluginUid ) const;
+        
+    private: // data 
+        // Reference to MPEPhoneModelInternal, also object owner
+        MPEPhoneModelInternal&  iModel;
+        // Reference to data store
+        MPEDataStore& iDataStore;
+        // Log database connection.
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        CLogClient* iLogClient;           
+        // Array of active log events
+        RPointerArray< class CPELogEvent > iActiveLogEventArray;
+        // Array of queued log events
+        RPointerArray< class CPELogEvent > iQueuedLogEventArray;
+        // Array of free log event objects
+        RPointerArray< class CPELogEvent > iFreeLogEventArray;
+        // Logs handling command pointer   
+        CPELogHandlingCommand* iLogHandlingCommand;  
+        // Log external data pointer
+        CPELogExternalData* iLogExternalData;
+        // File session connection
+        RFs& iFsSession;
+        // Identifiers of active calls.
+        RArray<TInt> iActiveCallIds;
+        // pointer to the log event under processing
+        CPELogEvent* iLogEventUnderProcessing;
+        
+        // Enumeration for incoming call, get from database  
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogString iLogStringIn;          
+        // Enumeration for outgoing call, get from database
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogString iLogStringOut;       
+        // Enumeration for missed call, get from database
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogString iLogStringMissed;  
+        // Enumeration for delivery, ger from database.
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogString iLogStringDelivery;  
+       // Enumeration for incoming auxiliary line call, get from database.
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogString iLogStringInAlt;
+        // Enumeration for outgoing auxiliary line call, get from database.
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogString iLogStringOutAlt;
+        // Enumeration for Unknown name, get from database.
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogString iLogStringUnknown;        
+        
+        /**
+         * Logging extension plugins.
+         * Own.
+         */
+        RPointerArray<CPELogExtensionWrapper> iPlugins;
+
+    };
+
+#endif // CPELOGSHANDLER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpeloghandlingcommand.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPELogHandlingCommand object
+*
+*/
+
+
+#ifndef CPELOGHANDLINGCOMMAND_H
+#define CPELOGHANDLINGCOMMAND_H
+
+//INCLUDES
+#include <e32base.h>
+#include <pevirtualengine.h>
+#include <logwrap.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CPELogHandling;
+class CLogClient;
+class CLogEvent;
+
+// CLASS DECLARATION
+
+/**
+*  Sends Supplementary string directly to the serving network
+*  
+*
+*  @lib callhandling.lib
+*  @since Series60_2.7
+*/
+class CPELogHandlingCommand   
+    : public CActive
+    {
+    public: //Constructors and descructor
+        /**
+        * C++ default constructor.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/        
+        CPELogHandlingCommand( CPELogHandling& aOwner, CLogClient& aLogClient );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPELogHandlingCommand( );        
+
+    public:    //New functions
+        /**
+        * This method offers phone's identity
+        * @since Series60_2.7
+        * @param aPhoneIdentity includes phone identity parameters.
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        virtual TInt AddEvent( CLogEvent& aLogEvent );
+
+        /**
+        * This method asks phone identity parameters from the mmetel.
+        * @since Series60_2.7
+        * @param aMessage,The reply message to the phone application.
+        * @return KErrNone or KErrInUse if CPELogHandlingCommand is active allready
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        virtual TInt ChangeEvent( const CLogEvent& aLogEvent );
+        
+    protected: // From CActive
+        /**
+        * Informs object that asyncronous request is ready.
+        * @since Series60_4.0
+        * @param None. 
+        * @return None.
+        */
+        virtual void RunL();   
+                      
+        /**
+        * Cancels asyncronous request(s).
+        * @since Series60_4.0
+        * @param None.    
+        * @return None.
+        */
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        virtual void DoCancel();
+        
+        
+    private:
+        CPELogHandling& iOwner;
+    
+        // reference to log client
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        CLogClient& iLogClient;  
+        
+        // reference to log database event.
+        /*****************************************************
+        *    Series 60 Customer / LOGENG
+        *    Series 60  LOGENG API
+        *****************************************************/                
+        TLogId iLogId;       
+              
+    };
+
+#endif // CPELOGHANDLINGCOMMAND_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpeloghandlingdummy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPELogHandlingDummy
+*              : class.
+*
+*/
+
+
+#ifndef    CPELOGHANDLINGDUMMY_H
+#define    CPELOGHANDLINGDUMMY_H
+
+//INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+#include <logwrap.h>
+#include "mpeloghandling.h"
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPELogHandlingCommand;
+class CPELogExternalData;
+class CPELogEvent;
+class CLogClient;
+class MPEPhoneModelInternal;
+class MPEDataStore;
+
+// CLASS DECLARATION
+
+class CPELogHandlingDummy : public CBase,
+                       public MPELogHandling
+    {
+    public:
+        /**
+        * Two-phased constructor
+        */
+        static MPELogHandling* NewL();
+             
+        /**
+         * Destructor.
+         */               
+        virtual IMPORT_C ~CPELogHandlingDummy();
+        
+    protected:
+        /**
+        * C++ default constructor.
+        */
+        CPELogHandlingDummy();
+
+    public: // From MPELogHandling
+        /**
+        * Save call entry
+        * @since N/A
+        * @param: TInt, call id
+        * @return: possible error code.
+        */
+        IMPORT_C TInt SaveCallEntry( const TInt aCallId );
+    };
+
+#endif // CPELOGHANDLINGDUMMY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpeloghandlingproxy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPELogHandlingProxy
+*              : class.
+*
+*/
+
+
+#ifndef    CPELOGHANDLINGPROXY_H
+#define    CPELOGHANDLINGPROXY_H
+
+//INCLUDES
+#include "mpeloghandling.h"
+#include <e32base.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// CLASS DECLARATION
+
+/**
+*  This proxy class provides for the access to call logging services.
+*  The construction of log handling component is two-fold:
+*  1) CreateFirstPhaseL() creates the proxy object along with log handling dummy
+*  2) CreateSecondPhaseL() creates the real subject with capability to log calls
+*
+*  @lib LogHandling.lib
+*  @since Series60_4.0
+*/
+class CPELogHandlingProxy : public CBase,
+                        public MPELogHandling
+    {
+    public:
+        /**
+        * Create log handling proxy and dummy implementation
+        * @return pointer to log handling proxy object, i.e. the handle to
+        * access log handling services
+        */
+        IMPORT_C static MPELogHandling* CreateFirstPhaseL();
+
+        /**
+        * Create log handling sub system
+        * This method creates the actual log handling implementation which
+        * replaces the dummy component in use. The phone model should call this
+        * function as all the critical sub systems already enable emergency call
+        * capabilities.
+        * @param aModel, handle to the owner of this object and phone engine
+        * @param aFsSession, handle to the shared file server session
+        */
+        IMPORT_C void CreateSecondPhaseL( MPEPhoneModelInternal& aModel, RFs& aFsSession );
+
+    public: // From MPELogHandling
+        /**
+         * Destructor.
+         */          
+        IMPORT_C ~CPELogHandlingProxy();
+
+        /**
+        * Redirects the function call to either log handling implementation or
+        * log handling dummy implementation.
+        * @param aCallId, call id
+        * @return possible error code.
+        */
+        IMPORT_C TInt SaveCallEntry( const TInt aCallId );
+
+    protected:
+        /**
+        * C++ default constructor.
+        */
+        CPELogHandlingProxy();
+
+        /**
+        * Constructor, second phase. 
+        */
+        void ConstructL();
+
+    private: // data
+        // Handle to log handling implementation
+        MPELogHandling* iLogHandling; 
+        // Handle to log handling dummy implementation
+        MPELogHandling* iLogHandlingDummy;  
+    };
+
+#endif // CPELOGHANDLINGPROXY_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/cpeloginfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,369 @@
+/*
+* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPELogInfo class.
+*
+*/
+
+#ifndef CPELOGINFO_H
+#define CPELOGINFO_H
+
+
+#include <e32base.h>
+#include <LogsApiConsts.h>
+
+#include "mpedatastore.h"
+
+_LIT( KPELogUnknownText, "Unknown" );
+
+
+/**
+ *  Log info data.
+ *
+ *  @lib loghandling.dll
+ *  @since S60 v5.0
+ */
+class CPELogInfo : public CBase
+    {
+public:
+    //Log Event Type
+    enum TPELogEventType
+        {
+        EPEUnknownEvent = 0,
+        EPEVoiceEvent,
+        EPEVideoCallEvent,
+        EPEEmergecyEvent,
+        EPEVoIPEvent
+        };
+
+    static CPELogInfo* NewL();
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CPELogInfo();
+
+    /**
+     * Save event data. Basic log data existence guaranteed for class.
+     * 
+     * @since S60 v5.0
+     * @param aCallId Identification for call
+     * @param aDataStore Logs datastore
+     */
+    void SetEventData( TInt aCallId, const MPEDataStore& aDataStore );
+
+    /**
+     * Copy event data.
+     * 
+     * @since S60 v5.0
+     * @param aLogInfo Log info to be copied
+     */
+    void CopyL( const CPELogInfo& aLogInfo );
+
+    /**
+     * Restore default values.
+     * 
+     * @since S60 v5.0
+     */
+    void Reset();
+
+    /**
+     * Set the logged event type data,voice.
+     * 
+     * @since S60 v5.0
+     * @param aEventType LogEventType
+     */
+    void SetEventType( TPELogEventType aEventType );
+    
+    /**
+     * The logged event type data,voice.
+     * 
+     * @since S60 v5.0
+     */
+    CPELogInfo::TPELogEventType EventType() const;
+    
+    /**
+     * Set call direction (0=MO/1=MT).
+     * 
+     * @since S60 v5.0
+     * @param aCallDirection Call direction
+     */
+    void SetCallDirection( RMobileCall::TMobileCallDirection aCallDirection );
+    
+    /**
+     * Call direction (0=MO/1=MT).
+     * 
+     * @since S60 v5.0
+     */
+    RMobileCall::TMobileCallDirection CallDirection() const;
+    
+    /**
+     * Set call id.
+     * 
+     * @since S60 v5.0
+     * @param aCallId Call Id
+     */
+    void SetCallId( TInt aCallId );
+    
+    /**
+     * Call id.
+     * 
+     * @since S60 v5.0
+     */
+    TInt CallId() const;
+    
+    /**
+     * Set phone number.
+     * 
+     * @since S60 v5.0
+     * @param aPhoneNumber Phone number
+     */
+    void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber );
+    
+    /**
+     * Phone number.
+     * 
+     * @since S60 v5.0
+     */
+    const TPEPhoneNumber& PhoneNumber() const;
+    
+    /**
+     * Set firstname + lastname.
+     * 
+     * @since S60 v5.0
+     * @param aName Name
+     */
+    void SetName( const TPEContactName& aName );
+    
+    /**
+     * Firstname + lastname.
+     * 
+     * @since S60 v5.0
+     */
+    const TPEContactName& Name() const;
+    
+    /**
+     * Set call state.
+     * 
+     * @since S60 v5.0
+     * @param aCallState Call state
+     */
+    void SetCallState( TPEState aCallState );
+    
+    /**
+     * Call state.
+     * 
+     * @since S60 v5.0
+     */
+    TPEState CallState() const;
+    
+    /**
+     * Set call duration (seconds).
+     * 
+     * @since S60 v5.0
+     * @param aDuration Call duration
+     */
+    void SetDuration( TTimeIntervalSeconds aDuration );
+    
+    /**
+     * Call duration (seconds).
+     * 
+     * @since S60 v5.0
+     */
+    TTimeIntervalSeconds Duration() const;
+    
+    /**
+     * Set call line.
+     * 
+     * @since S60 v5.0
+     * @param aCurrentLine Current line type
+     */
+    void SetCurrentLine( CCCECallParameters::TCCELineType aCurrentLine );
+    
+    /**
+     * Call line.
+     * 
+     * @since S60 v5.0
+     */
+    CCCECallParameters::TCCELineType CurrentLine() const;
+    
+    /**
+     * Set phone number id.
+     * 
+     * @since S60 v5.0
+     * @param aPhoneNumberId Phone number id type
+     */
+    void SetPhoneNumberId( TPEPhoneNumberIdType aPhoneNumberId );
+    
+    /**
+     * Phone number id.
+     * 
+     * @since S60 v5.0
+     */
+    TPEPhoneNumberIdType PhoneNumberId() const;
+    
+    /**
+     * Set logging indicator.
+     * 
+     * @since S60 v5.0
+     * @param aLoggingEnabled Logging state
+     */
+    void SetLoggingEnabled( TBool aLoggingEnabled );
+    
+    /**
+     * Logging indicator.
+     * 
+     * @since S60 v5.0
+     */
+    TBool LoggingEnabled() const;
+    
+    /**
+     * Set start time.
+     * 
+     * @since S60 v5.0
+     * @param aCallStartTime Call start time
+     */
+    void SetCallStartTime( TTime aCallStartTime );
+    
+    /**
+     * Start time.
+     * 
+     * @since S60 v5.0
+     */
+    TTime CallStartTime() const;
+    
+    /**
+     * Set missed call indicator.
+     * 
+     * @since S60 v5.0
+     * @param aMissedCall Call missed status
+     */
+    void SetMissedCall( TBool aMissedCall );
+    
+    /**
+     * Missed call indicator.
+     * 
+     * @since S60 v5.0
+     */
+    TBool MissedCall() const;
+    
+    /**
+     * Set indication if entry should be completed.
+     * 
+     * @since S60 v5.0
+     * @param aForcedCompletion Force completion state
+     */
+    void SetForcedCompletion( TBool aForcedCompletion );
+    
+    /**
+     * Indication for entry if it should be completed.
+     * 
+     * @since S60 v5.0
+     */
+    TBool ForcedCompletion() const;
+    
+    /**
+     * Set service id for the call.
+     * 
+     * @since S60 v5.0
+     * @param aServiceId Service id
+     */
+    void SetServiceId( TUint32 aServiceId );
+    
+    /**
+     * Service id of the call.
+     * 
+     * @since S60 v5.0
+     */
+    TUint32 ServiceId() const;
+    
+    /**
+     * Set VoIP address.
+     * 
+     * @since S60 v5.0
+     * @param aVoipAddress VoIP address
+     */
+    void SetVoipAddress( const TPEPhoneNumber& aVoipAddress );
+    
+    /**
+     * VoIP address.
+     * 
+     * @since S60 v5.0
+     */
+    const TPEPhoneNumber& VoipAddress() const;
+    
+    /**
+     * Set my address.
+     * 
+     * @since S60 v5.0
+     * @param aMyAddress My address
+     */
+    void SetMyAddress( const TPEPhoneNumber& aMyAddress );
+    
+    /**
+     * My address.
+     * 
+     * @since S60 v5.0
+     */
+    const TPEPhoneNumber& MyAddress() const;
+    
+    /**
+     * Save contact link. Ownership is transferred.
+     * 
+     * @since S60 v5.0
+     * @param aCallId Identification for call
+     * @param aDataStore Logs datastore
+     */
+    void SetContactLink( const HBufC8* aContactLink );
+    
+    /**
+     * Contact link to phonebook.
+     * 
+     * @since S60 v5.0
+     */
+    const HBufC8& ContactLink() const;
+    
+    
+private:
+    CPELogInfo();
+
+    
+private: // data, public because no processing done in this class
+    TPELogEventType iEventType;     // The logged event type data,voice.
+    RMobileCall::TMobileCallDirection iCallDirection;// Call direction (0=MO/1=MT)
+    TInt iCallId;
+    TPEPhoneNumber iPhoneNumber;
+    TPEContactName iName;           // Firstname + Lastname
+    TPEState iCallState;
+    TTimeIntervalSeconds iDuration; // Call duration (seconds)
+    CCCECallParameters::TCCELineType iCurrentLine;       // Call line.
+    TPEPhoneNumberIdType iPhoneNumberId;
+    TBool iLoggingEnabled;          // Logging indicator
+    TTime iCallStartTime;           // Start time
+    TBool iMissedCall;              // Missed call indicator
+    TBool iForcedCompletion;        // indicates that entry should be completed
+    TUint32 iServiceId;             // Service Id for the call  
+    /** voip address of remote party */
+    TPEPhoneNumber iVoipAddress;
+    /** own address during the logged call */
+    TPEPhoneNumber iMyAddress;
+    
+    /**
+     * Contact id/link
+     * Own.
+     */
+    const HBufC8* iContactLink;
+
+    };
+
+#endif // CPELOGINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/inc/mpeloghandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the MPELogHandling class.
+*
+*/
+
+
+#ifndef MPELOGHANDLING_H
+#define MPELOGHANDLING_H
+
+//INCLUDES
+#include <pevirtualengine.h>
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+
+/**
+*  Virtual interface of log handling subsystem
+*
+*  @lib LogHandling.lib
+*  @since Series60_4.0
+*/
+class MPELogHandling
+    {
+    public:
+        /**
+        * Destructor
+        */
+        virtual ~MPELogHandling( ) 
+            {
+            // empty destructor    
+            };
+
+        /**
+        * Save call entry
+        * @since N/A
+        * @param: TInt, call id
+        * @return: possible error code.
+        */
+        virtual TInt SaveCallEntry( const TInt aCallId ) = 0;
+    };
+
+#endif // MPELOGHANDLING_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpelogevent.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,692 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPELogEvent class
+*
+*/
+
+
+//  INCLUDE FILES
+#include "cpelogevent.h"
+#include "cpeloginfo.h"
+#include "cpeloghandling.h"
+#include "cpeloghandlingcommand.h"
+#include <talogger.h>
+#include <logcli.h>
+#include <LogsApiConsts.h>
+
+
+// EXTERNAL DATA STRUCTURES
+//None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//None
+
+// CONSTANTS
+const TInt KPhonebookTypeIdLength = 11;
+
+// Defined in \s60\app\contacts\logsui\EngineIncLogsEngConsts.h as KLogEventALS
+const TLogFlags KPELogEventALS = 0x4;
+
+const TInt KOneChar = 1;
+
+// MACROS
+//None
+
+// LOCAL CONSTANTS AND MACROS
+//None
+
+// MODULE DATA STRUCTURES
+//None
+
+// LOCAL FUNCTION PROTOTYPES
+//None
+
+// FORWARD DECLARATIONS
+//None
+
+
+// ==================== LOCAL FUNCTIONS =====================================
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPELogEvent* CPELogEvent::NewL
+        ( 
+        CPELogHandling& aOwner,  // Owner of the object
+        CPELogHandlingCommand& aLogHandlingCommand
+        )
+    {
+    TEFLOGSTRING(KTAOBJECT, "LOG CPELogEvent::NewL start.");
+    CPELogEvent* self = new ( ELeave ) CPELogEvent( aOwner, aLogHandlingCommand );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING(KTAOBJECT, "LOG CPELogEvent::NewL complete.");
+    return self;
+    }
+  
+// Destructor
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+CPELogEvent::~CPELogEvent
+        (
+        // None
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogEvent::~CPELogEvent()" );
+    delete iEvent;
+    delete iLogInfo;
+    }
+
+
+// ================= MEMBER FUNCTIONS =======================================
+// -----------------------------------------------------------------------------
+// CPELogEvent::CPELogEvent
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPELogEvent::CPELogEvent
+        ( 
+        CPELogHandling& aOwner,
+        CPELogHandlingCommand& aLogHandlingCommand
+        ) : iOwner( aOwner ),
+            iLogHandlingCommand( aLogHandlingCommand ),
+            iCompleted( EFalse ),
+            iAdded( EFalse ),
+            iSaveLeave( EFalse )
+    {
+    }
+// -----------------------------------------------------------------------------
+// CPELogEvent::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogEvent::ConstructL
+        (
+        // None
+        )
+    {
+    iEvent = CLogEvent::NewL();
+    ResetEvent( );
+    iLogInfo = CPELogInfo::NewL();
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogEvent::Save
+// Saves the event to the log.
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::SaveL()
+    {
+    iSaveLeave = ETrue;
+    // iCopleted flag must be set before the function leave as it is used 
+    // in log subsytem recovery procedure in case of leave.
+    if ( EPEStateIdle == iLogInfo->CallState() || iLogInfo->ForcedCompletion() )
+        {
+        iCompleted = ETrue;
+        }
+        
+    if ( !iAdded )
+        {
+        TEFLOGSTRING2( KTAINT, "LOG CPELogEvent::SaveL() > CPELogHandlingCommand::AddEvent(), callId=%d", iLogInfo->CallId() );  
+        SetPhoneNumberId();
+        SetEventTypeL();
+        SetLogEvent();
+        SetDuration();
+        SetServiceIdL();
+        
+        if ( &iLogInfo->ContactLink() )
+            {
+            SetContactLinkL();
+            }
+        // event under processing will always be of index 0 in the queued array
+        User::LeaveIfError( iLogHandlingCommand.AddEvent( *iEvent ) );
+        }
+    else
+        { 
+        TEFLOGSTRING2( KTAINT, "LOG CPELogEvent::SaveL() > CPELogHandlingCommand::ChangeEvent(), callId=%d", iLogInfo->CallId() );            
+        SetLogEvent();
+        SetDuration();
+        User::LeaveIfError( iLogHandlingCommand.ChangeEvent( *iEvent ) );
+        }
+    // indicates no leave happened in Save function
+    iSaveLeave = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::UpdateLogInfo
+// Update log database entry.
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::UpdateLogInfoL
+        ( 
+        const CPELogInfo& aLogInfo // Call information
+        ) 
+    {
+    // CPELogHandling generic loginfo must be replicated to this event
+    iLogInfo->CopyL( aLogInfo );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::ResetLogInfo
+// Reset log info.
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::ResetLogInfo() 
+    {
+    TEFLOGSTRING( KTAINT, "LOG CPELogEvent::ResetLogInfo: start" );  
+    iLogInfo->Reset();
+    TEFLOGSTRING( KTAINT, "LOG CPELogEvent::ResetLogInfo: complete" ); 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogEvent::ResetEvent
+// Reset event on the idle state.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogEvent::ResetEvent()
+    {
+    iAdded = EFalse;
+    iCompleted = EFalse;
+    iSaveLeave = EFalse;
+
+    // CLogEvent -variables
+    iEvent->SetId( KLogNullId );
+    iEvent->SetEventType( KNullUid );
+    iEvent->SetRemoteParty( KNullDesC );
+    iEvent->SetDirection( KNullDesC );
+    iEvent->SetTime( Time::NullTTime() );
+    iEvent->SetDurationType( KLogNullDurationType );
+    iEvent->SetDuration( KLogNullDuration );
+    iEvent->SetStatus( KNullDesC );
+    iEvent->SetSubject( KNullDesC );
+    iEvent->SetNumber( KNullDesC );
+    iEvent->SetContact( KNullContactId );
+    iEvent->SetLink( KLogNullLink );
+    iEvent->SetDescription( KNullDesC );
+    iEvent->ClearFlags( KLogFlagsMask );
+    TRAPD( error, iEvent->SetDataL( KNullDesC8 ) );
+    if ( error != KErrNone )
+        {
+        // SetDataL leave should not cause log subsystem to fail. Just log the error.
+        TEFLOGSTRING2( KTAERROR, "LOG CPELogEvent::Save()>CPELogHandlingCommand::ResetEvent(), error=%d", error );  
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::CallId
+// Get call id of the event.
+// -----------------------------------------------------------------------------
+//
+TInt CPELogEvent::CallId
+        (
+        // None
+        )
+    {
+    return iLogInfo->CallId();
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::IsCompleted
+// Returns flag if the entry has been completed, ie. no further updates are expected
+// -----------------------------------------------------------------------------
+//
+TBool CPELogEvent::IsCompleted
+        (
+        // None
+        )
+    {       
+    return iCompleted;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::Added
+// iAdded flag is set to ETrue
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::SetAdded
+        (
+        // None
+        )
+    {       
+    iAdded = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SaveLeave
+// Return value of save leave flag
+// -----------------------------------------------------------------------------
+//
+TBool CPELogEvent::SaveLeave
+        (
+        // None
+        )
+    {       
+    return iSaveLeave;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SetPhoneNumberId
+// Set event subject.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogEvent::SetPhoneNumberId()
+    {
+    TBuf<KPhonebookTypeIdLength> subject;
+    subject.Zero();
+
+    switch ( iLogInfo->PhoneNumberId() )
+        {
+        case EPEMobileNumber:
+            subject.AppendNum( EPEUnknownNumber );
+            break;
+        case EPETelephoneNumber:
+            subject.AppendNum( EPEUnknownNumber );
+            break;
+        case EPEPager:
+            subject.AppendNum( EPEUnknownNumber );
+            break;
+        case EPEFaxNumber:
+            subject.AppendNum( EPEUnknownNumber );
+            break; 
+        case EPEAssistantNumber:
+            subject.AppendNum( EPEUnknownNumber);
+            break;
+        case EPECarNumber:
+            subject.AppendNum( EPEUnknownNumber);
+            break;
+        default:
+            subject.AppendNum( EPEUnknownNumber );
+            break;
+        }
+
+    if ( subject.Length() > 0 )
+        {
+        iEvent->SetSubject( subject );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmLogsEntry::SetEventType
+// Set event type.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogEvent::SetEventTypeL()
+    {
+    switch ( iLogInfo->EventType() )
+        {
+        case CPELogInfo::EPEVoiceEvent:
+            
+            {
+            iEvent->SetEventType( KLogCallEventTypeUid );
+            }
+            break;
+        case CPELogInfo::EPEVideoCallEvent:
+            {           
+            iEvent->SetEventType( KLogCallEventTypeUid );
+            iEvent->SetDataL( KLogsDataFldTag_VT );
+            TEFLOGSTRING( KTAINT, "LOG CPELogEvent::SetEventTypeL() video" );                
+            }
+            break;
+        case CPELogInfo::EPEEmergecyEvent:
+            {           
+            iEvent->SetEventType( KLogCallEventTypeUid );
+            iEvent->SetDataL( KLogsDataFldTag_Emergency );
+            TEFLOGSTRING( KTAINT, "LOG CPELogEvent::SetEventTypeK() Emergecy" );                
+            }
+            break;
+        case CPELogInfo::EPEVoIPEvent:
+            {
+            iEvent->SetEventType( KLogCallEventTypeUid );
+            iEvent->SetDataL( KLogsDataFldTag_IP );
+            TEFLOGSTRING( KTAINT, "LOG CPELogEvent::SetEventTypeL() VoIP" );                
+            }
+            break;
+        case CPELogInfo::EPEUnknownEvent:
+        default:
+            {
+            iEvent->SetEventType( KLogCallEventTypeUid );
+            }
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SetLogEvent
+// Set the rest of event information.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogEvent::SetLogEvent()
+    {
+    if( CCCECallParameters::ECCELineTypeAux == iLogInfo->CurrentLine() )
+        {
+        iEvent->SetFlags( KPELogEventALS );             
+        }
+    if ( RMobileCall::EMobileOriginated == iLogInfo->CallDirection() )
+        {     
+        if ( CCCECallParameters::ECCELineTypeAux == iLogInfo->CurrentLine() )
+            {
+            iEvent->SetDirection( iOwner.LogStringOutAlt( ) );
+            }
+        else
+            {
+            iEvent->SetDirection( iOwner.LogStringOut( ) );    
+            }
+        }
+    else if ( RMobileCall::EMobileTerminated == iLogInfo->CallDirection() )
+        {
+        if ( iLogInfo->MissedCall() && EPEStateIdle == iLogInfo->CallState() )
+            {
+            iEvent->SetDirection( iOwner.LogStringMissed( ) );
+            }
+        else
+            //Logging on states Connected and Idle
+            {
+            if ( CCCECallParameters::ECCELineTypeAux == iLogInfo->CurrentLine() )
+                {
+                iEvent->SetDirection( iOwner.LogStringInAlt( ) );
+                }
+            else
+                {
+                iEvent->SetDirection( iOwner.LogStringIn( ) );
+                }
+            }
+        }
+
+    SetRemoteParty( *iEvent, *iLogInfo );
+    iEvent->SetStatus( iOwner.LogStringDelivery( ) );
+    
+    SetRemoteContact( *iEvent, *iLogInfo );
+    
+    if ( KNullDesC() != iLogInfo->MyAddress() )
+        {
+        TRAPD( error, SetDataFieldL( KLogsDataFldTag_MA, iLogInfo->MyAddress() ) );
+        if ( error )
+            {
+            TEFLOGSTRING2( KTAERROR, 
+                "LOG CPELogEvent::SetLogEvent()>SetDataFieldL(), error=%d", 
+                    error )
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SetDuration
+// Set the event duration
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogEvent::SetDuration()
+    {
+    iEvent->SetDurationType( KLogDurationValid );
+    iEvent->SetDuration( static_cast <TLogDuration> ( iLogInfo->Duration().Int() ) );
+
+#ifdef _DEBUG
+    if ( EPEStateIdle == iLogInfo->CallState() )
+        {
+        // debug logging of the event start time.
+        TBuf<KPEESDWFormattedTimeLength> formattedTime;
+        formattedTime.Zero();
+        TRAPD( error, iEvent->Time().FormatL( formattedTime, KPEESDWTimeFormat ) );    
+        if( error == KErrNone )
+            {
+            TEFLOGSTRING2( KTAINT, "LOG CPELogEvent::SetDuration() Idle state > formattedTime: %S", &formattedTime );
+            }
+        else
+            {
+            TEFLOGSTRING( KTAERROR, "LOG CPELogEvent::SetDuration() Idle state > time conversion failed!");
+            }        
+        }
+#endif // _DEBUG
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SetServiceIdL
+// Set callers service id to log event.
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::SetServiceIdL()
+    {
+    HBufC8* eventData = NULL; 
+    if ( iEvent->Data().Length() )
+        {
+        // There are existing data logged.
+        eventData = HBufC8::NewLC( iEvent->Data().Length() 
+                   + KLogsDataFldNameDelimiter().Length() // separator
+                   + KLogsDataFldTag_ServiceId().Length()
+                   + KLogsDataFldValueDelimiter().Length()
+                   + KTUintCharLength );    
+                   
+        // Copy existing data to temp buffer.
+        eventData->Des().Copy( iEvent->Data() );
+   
+        // Append tag separator.
+        eventData->Des().Append( KLogsDataFldNameDelimiter );    
+        }
+    else
+        {
+        // No existing data logged. 
+        eventData = HBufC8::NewLC( 
+            KLogsDataFldTag_ServiceId().Length()
+            + KLogsDataFldValueDelimiter().Length()
+            + KTUintCharLength ); 
+        }
+    
+    // Append service id
+    eventData->Des().Append( KLogsDataFldTag_ServiceId );
+    eventData->Des().Append( KLogsDataFldValueDelimiter );
+    eventData->Des().AppendNum( (TInt)iLogInfo->ServiceId() );
+    
+    iEvent->SetDataL( *eventData );
+    TEFLOGSTRING( KTAINT, "LOG CPELogEvent::SetServiceIdL() Service id set ok" );  
+    CleanupStack::PopAndDestroy( eventData );
+    }
+
+// -----------------------------------------------------------------------------
+// Sets callers contact link to log event.
+// Contact link data might accidentally contain "\t"(KLogsDataFldNameDelimiter),
+// because of this, those "accidents" are stuffed with another "\t". They are
+// removed in logs handling side when data is read in.
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::SetContactLinkL()
+    {
+    HBufC8* eventData = NULL;
+    
+    TPtrC8 pDelimiter( iLogInfo->ContactLink() );
+    TInt delimiterCount = 0;
+    // Check how many "delimiters" data contains so that we can
+    // reserve space for data duplication
+    while ( KErrNotFound != pDelimiter.Find( KLogsDataFldNameDelimiter ) )
+        {
+        // Skip first \t to see if there exists another one after that 
+        pDelimiter.Set( pDelimiter.Mid( pDelimiter.Find( KLogsDataFldNameDelimiter ) + KOneChar ) );
+        ++delimiterCount;
+        }
+    if ( iEvent->Data().Length() )
+        {
+        // There is previous data logged
+        eventData = HBufC8::NewLC( 
+            iEvent->Data().Length() 
+            + KLogsDataFldNameDelimiter().Length() // separator
+            + KLogsDataFldTag_ContactLink().Length() 
+            + KLogsDataFldValueDelimiter().Length()
+            + iLogInfo->ContactLink().Length() 
+            + delimiterCount );
+                   
+        // Copy previous data to temp buffer
+        eventData->Des().Copy( iEvent->Data() );
+   
+        // Append tag separator
+        eventData->Des().Append( KLogsDataFldNameDelimiter );    
+        }
+    else
+        {
+        // No previous data logged. 
+        eventData = HBufC8::NewLC( 
+                KLogsDataFldTag_ContactLink().Length() 
+            + KLogsDataFldValueDelimiter().Length()
+            + iLogInfo->ContactLink().Length() 
+            + delimiterCount ); 
+        }
+    
+    TPtr8 eventDataPtr( eventData->Des() );
+    eventDataPtr.Append( KLogsDataFldTag_ContactLink );
+    eventDataPtr.Append( KLogsDataFldValueDelimiter );
+    
+    if ( delimiterCount )
+        {
+        // Link data contained unintended \t chars
+        TPtrC8 linkPtr( iLogInfo->ContactLink() );
+        TInt dataLength = 0;
+        // Copy link data between \t chars
+        for ( TInt i = 0; i < delimiterCount; i++ )
+            {
+            // Plus one because we need length, not offset
+            dataLength = linkPtr.Find( KLogsDataFldNameDelimiter ) + KOneChar;
+            // Append from beginning of data, including \t
+            eventDataPtr.Append( linkPtr.Left( dataLength ) );
+            // Add another \t
+            eventDataPtr.Append( KLogsDataFldNameDelimiter );
+            linkPtr.Set( linkPtr.Mid( dataLength ) );
+            }
+        // Copy rest of link data
+        eventDataPtr.Append( linkPtr );
+        }
+    else
+        {
+        // Link data didn't contain \t, so normal copy is possible
+        eventDataPtr.Append( iLogInfo->ContactLink() );
+        }
+    
+    iEvent->SetDataL( *eventData );
+    TEFLOGSTRING( KTAINT, "LOG CPELogEvent::ContactLinkL() Contact link set ok" );
+    CleanupStack::PopAndDestroy( eventData );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SetDataFieldL
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::SetDataFieldL( const TDesC8& aTag, const TDesC& aFieldData )
+    {
+    __ASSERT_ALWAYS( aTag.Length() != 0 && aFieldData.Length() != 0 ,
+        User::Leave( KErrArgument ) );
+    
+    if ( KErrNotFound == iEvent->Data().Find( aTag ) )
+        {
+        HBufC8* eventData = NULL;
+        const TInt fieldLength = aTag.Length() 
+            + KLogsDataFldValueDelimiter().Length()
+            + aFieldData.Length();
+        const TInt oldDataFieldLength = iEvent->Data().Length();
+        
+        if ( oldDataFieldLength != 0 )
+            {
+            const TInt newDataFieldLength = oldDataFieldLength 
+                + KLogsDataFldNameDelimiter().Length()
+                + fieldLength;
+            
+            eventData = HBufC8::NewLC( newDataFieldLength );
+            
+            // Copy previous data
+            eventData->Des().Copy( iEvent->Data() );
+            eventData->Des().Append( KLogsDataFldNameDelimiter );
+            }
+        else
+            {
+            eventData = HBufC8::NewLC( fieldLength );
+            }
+        
+        // Add a new data field.
+        eventData->Des().Append( aTag );
+        eventData->Des().Append( KLogsDataFldValueDelimiter );
+        eventData->Des().Append( aFieldData );     
+        iEvent->SetDataL( *eventData );
+        
+        CleanupStack::PopAndDestroy( eventData );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SetRemoteParty
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::SetRemoteParty( CLogEvent& aEvent, 
+        const CPELogInfo& aLogInfo )
+    {
+    if ( KNullDesC() != aLogInfo.Name() )
+        {
+        aEvent.SetRemoteParty( aLogInfo.Name() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogEvent::SetRemoteContact
+// -----------------------------------------------------------------------------
+//
+void CPELogEvent::SetRemoteContact( CLogEvent& aEvent, 
+        const CPELogInfo& aLogInfo )
+    {
+    if ( KNullDesC() != aLogInfo.PhoneNumber() )
+        {
+        aEvent.SetNumber( aLogInfo.PhoneNumber() );
+        }
+    
+    if ( KNullDesC() != aLogInfo.VoipAddress() )
+        {
+        TRAPD( error, SetDataFieldL( KLogsDataFldTag_URL, aLogInfo.VoipAddress() ) );
+        if ( error )
+            {
+            TEFLOGSTRING2( KTAERROR, 
+                "LOG CPELogEvent::SetLogEvent()>SetDataFieldL(), error=%d", error )
+            }
+        }
+    }
+
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+
+//  End of File 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpelogextensionwrapper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CPELogExtensionWrapper class.
+*
+*/
+
+
+#include "cpelogextensionwrapper.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::CPELogExtensionWrapper
+// ---------------------------------------------------------------------------
+//
+CPELogExtensionWrapper::CPELogExtensionWrapper( TUid aImplementationUid )
+    : iPluginUid( aImplementationUid )
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CPELogExtensionWrapper::ConstructL()
+    {
+    iPlugin = CreateLoggingExtensionL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::NewL
+// ---------------------------------------------------------------------------
+//
+CPELogExtensionWrapper* CPELogExtensionWrapper::NewL( 
+        TUid aImplementationUid )
+    {
+    CPELogExtensionWrapper* self = 
+        CPELogExtensionWrapper::NewLC( aImplementationUid );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::NewLC
+// ---------------------------------------------------------------------------
+//
+CPELogExtensionWrapper* CPELogExtensionWrapper::NewLC( 
+        TUid aImplementationUid )
+    {
+    CPELogExtensionWrapper* self = 
+        new( ELeave ) CPELogExtensionWrapper( aImplementationUid );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::~CPELogExtensionWrapper
+// ---------------------------------------------------------------------------
+//
+CPELogExtensionWrapper::~CPELogExtensionWrapper()
+    {
+    delete iPlugin;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::MatchByUid
+// ---------------------------------------------------------------------------
+//
+TBool CPELogExtensionWrapper::MatchByUid( 
+        const TUid* aKey, const CPELogExtensionWrapper& aWrapper )
+    {
+    if ( aKey )
+        {
+        return ( aWrapper.Identifier() == *aKey );
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelLoggingExtension.
+// ---------------------------------------------------------------------------
+//
+void CPELogExtensionWrapper::InitializeL( TUint aServiceId, 
+        const TDesC& aOrigAddress )
+    {
+    iPlugin->InitializeL( aServiceId, aOrigAddress );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelLoggingExtension.
+// ---------------------------------------------------------------------------
+//
+TInt CPELogExtensionWrapper::GetPhoneNumber( RBuf& aPhoneNumber )
+    {
+    return iPlugin->GetPhoneNumber( aPhoneNumber );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelLoggingExtension.
+// ---------------------------------------------------------------------------
+//
+TInt CPELogExtensionWrapper::GetVoipAddress( RBuf& aVoipAddress )
+    {
+    return iPlugin->GetVoipAddress( aVoipAddress );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelLoggingExtension.
+// ---------------------------------------------------------------------------
+//
+TInt CPELogExtensionWrapper::GetMyAddress( RBuf& aMyAddress )
+    {
+    return iPlugin->GetMyAddress( aMyAddress );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CTelLoggingExtension.
+// ---------------------------------------------------------------------------
+//
+TInt CPELogExtensionWrapper::GetRemotePartyName( RBuf& aRemotePartyName )
+    {
+    return iPlugin->GetRemotePartyName( aRemotePartyName );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::CreateLoggingExtensionL
+// ---------------------------------------------------------------------------
+//
+CTelLoggingExtension* CPELogExtensionWrapper::CreateLoggingExtensionL() const
+    {
+    return CTelLoggingExtension::NewL( iPluginUid );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPELogExtensionWrapper::Identifier
+// ---------------------------------------------------------------------------
+//
+TUid CPELogExtensionWrapper::Identifier() const
+    {
+    return iPluginUid;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpelogexternaldata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,369 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPELogExternalData class 
+*                member functions.
+*
+*/
+
+
+
+//  INCLUDE FILES
+#include "cpelogexternaldata.h"
+#include "cpeloghandling.h"
+#include "cpeloginfo.h"
+#include <centralrepository.h>
+#include <LogsDomainCRKeys.h>
+#include <talogger.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+/// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPELogExternalData* CPELogExternalData::NewL
+        ( 
+        CPELogHandling& aOwner
+        )  
+    {
+    TEFLOGSTRING(KTAOBJECT, "LOG CPELogExternalData::NewL start.");
+    CPELogExternalData* self = 
+        new ( ELeave ) CPELogExternalData( aOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING(KTAOBJECT, "LOG CPELogExternalData::NewL complete.");
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::~CPELogExternalData
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / REPOSITORY
+*    Series 60  REPOSITORY API
+*****************************************************/
+CPELogExternalData::~CPELogExternalData()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogExternalData::~CPELogExternalData" );
+    delete iRepository;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogExternalData::CPELogExternalData
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPELogExternalData::CPELogExternalData
+        ( 
+        CPELogHandling& aOwner
+        ) : iOwner( aOwner ),
+            iFirstCallStartTime( 0 )
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogExternalData::CPELogExternalData" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / REPOSITORY
+*    Series 60  REPOSITORY API
+*****************************************************/
+void CPELogExternalData::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogExternalData::ConstructL" );
+
+    iRepository = CRepository::NewL( KCRUidLogs );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::UpdateCallTimers
+// Write call durations to TASharedData.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPELogExternalData::UpdateCallTimers
+        ( 
+        const CPELogInfo& aLogInfo // Call information
+        )
+    {
+    TInt duration( 0 );
+
+    duration = aLogInfo.Duration().Int();
+
+    switch( aLogInfo.CurrentLine() )
+        {
+        case CCCECallParameters::ECCELineTypePrimary:
+            {
+            if ( RMobileCall::EMobileOriginated == aLogInfo.CallDirection() )
+                {
+                if ( CPELogInfo::EPEVoIPEvent == aLogInfo.EventType() )
+                    {
+                    UpdateTimer( KLogsDialledCallsTimerVoIP, 
+                        duration, *iRepository );
+                    }
+                else
+                    {
+                    UpdateTimer( KLogsDialledCallsTimerLine1, 
+                        duration, *iRepository );
+                    }
+                }
+            else if ( RMobileCall::EMobileTerminated == aLogInfo.CallDirection() )
+                {
+                if( CPELogInfo::EPEVoIPEvent == aLogInfo.EventType() )
+                    {
+                    UpdateTimer( KLogsReceivedCallsTimerVoIP, 
+                        duration, *iRepository );
+                    }
+                else
+                    {
+                    UpdateTimer( KLogsReceivedCallsTimerLine1, 
+                        duration, *iRepository );
+                    }
+                }
+            }
+            break;
+        case CCCECallParameters::ECCELineTypeAux:
+            {
+            if( RMobileCall::EMobileOriginated == aLogInfo.CallDirection() ) 
+                {
+                UpdateTimer( KLogsDialledCallsTimerLine2, 
+                    duration, *iRepository );
+                }
+            else  if ( RMobileCall::EMobileTerminated == aLogInfo.CallDirection() )
+                {
+                UpdateTimer( KLogsReceivedCallsTimerLine2, 
+                    duration, *iRepository );
+                }
+            }
+            break;
+        default:
+            {
+            TEFLOGSTRING2( KTAINT, "LOG CPELogExternalData::UpdateCallTimers(): FAILED. Unexpected line: %d", aLogInfo.CurrentLine() );
+            }
+            break;
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::UpdateLastCallTimerByLine
+// Updates line specific last call timers to shared data.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / REPOSITORY
+*    Series 60  REPOSITORY API
+*****************************************************/
+void CPELogExternalData::UpdateLastCallTimerByLine
+        ( 
+        const CPELogInfo& aLogInfo 
+        )
+    {
+    TInt errorCode( KErrNone );
+
+    switch( aLogInfo.CurrentLine() )
+        {
+        case CCCECallParameters::ECCELineTypePrimary:
+            {
+            if ( CPELogInfo::EPEVoIPEvent == aLogInfo.EventType() )
+                {
+                TEFLOGSTRING( KTAREQOUT, 
+                "LOG CPELogExternalData::UpdateLastCallTimerByLine > CRepository::Set(KLogsLastCallTimerVoIP)" )
+                errorCode = iRepository->Set( 
+                    KLogsLastCallTimerVoIP, aLogInfo.Duration().Int() );
+                }
+            else
+                {
+                TEFLOGSTRING( KTAREQOUT, 
+                "LOG CPELogExternalData::UpdateLastCallTimerByLine > CRepository::Set(KLogsLastCallTimerLine1)" )
+                errorCode = iRepository->Set( 
+                    KLogsLastCallTimerLine1, aLogInfo.Duration().Int() );                
+                }
+            }
+            break;
+        case CCCECallParameters::ECCELineTypeAux:
+            {
+            TEFLOGSTRING( KTAREQOUT, 
+            "LOG CPELogExternalData::UpdateLastCallTimerByLine > CRepository::Set(KLogsLastCallTimerLine2)" );
+
+            errorCode = iRepository->Set( KLogsLastCallTimerLine2, aLogInfo.Duration().Int() );
+            }
+            break;
+        default:
+            errorCode = KErrArgument;
+            break;
+        } 
+
+    if ( errorCode != KErrNone )
+       {
+       TEFLOGSTRING2( KTAERROR, "LOG CPELogExternalData::UpdateLastCallTimerByLine(): FAILED. ErrorCode: %d", errorCode );
+       }
+   
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::UpdateLastCallTimer
+// Updates the last call timer to shared data.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / REPOSITORY
+*    Series 60  REPOSITORY API
+*****************************************************/
+TInt CPELogExternalData::UpdateLastCallTimer
+        ( 
+        const CPELogInfo& aLogInfo
+        )
+    {
+    TInt errorCode( KErrNone );
+
+    // No ongoing entries (calls) -> update last active call timer to shared data.
+    // In multicall cases time is from start of first to end of last.
+    TTimeIntervalSeconds startsDelta;
+    aLogInfo.CallStartTime().SecondsFrom( iFirstCallStartTime, startsDelta );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogExternalData::UpdateLastCallTimer(): StartsDelta: %d", startsDelta.Int() );
+
+    TInt duration = startsDelta.Int() + aLogInfo.Duration().Int();
+
+    TEFLOGSTRING2( KTAREQOUT, 
+        "LOG CPELogExternalData::UpdateLastCallTimer > CRepository::Set(KLogsActualLastCallTimer, %d )", duration );
+    errorCode = iRepository->Set( KLogsActualLastCallTimer, duration );
+    if ( errorCode != KErrNone )
+        {
+        TEFLOGSTRING2( KTAERROR, "LOG CPELogExternalData::UpdateLastCallTimer(): FAILED setting actual last call timer. ErrorCode: %d", errorCode );
+        }        
+    iFirstCallStartTime = 0;
+    return duration;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::IncreaseMissedCallValue
+// Increase missed call's counter.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / REPOSITORY
+*    Series 60  REPOSITORY API
+*****************************************************/
+void CPELogExternalData::IncreaseMissedCallValue( const TInt aCallId )
+    {
+    TInt errorCode( KErrNone );
+    TInt value;
+    
+    TEFLOGSTRING( KTAREQOUT, 
+        "LOG CPELogExternalData::IncreaseMissedCallValue > CRepository::Get" );
+    errorCode = iRepository->Get( KLogsNewMissedCalls, value );
+
+    if ( errorCode == KErrNone )
+        {
+        ++value;
+        TEFLOGSTRING2( KTAREQOUT, 
+            "LOG CPELogExternalData::IncreaseMissedCallValue > CRepository::Set. value = %d"
+            , value );
+        errorCode = iRepository->Set( KLogsNewMissedCalls, value );
+        iOwner.ResetMissedCalls( aCallId );
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAERROR, 
+            "LOG CPELogExternalData::IncreaseMissedCallValue(): Failed: %d", errorCode );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::SetFirstCallStartTime
+// Set the call start time on the connected state.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPELogExternalData::SetFirstCallStartTime
+        (
+        const TTime& aFirstCallStartTime
+        )
+    {
+    iFirstCallStartTime = aFirstCallStartTime;
+    }    
+
+// -----------------------------------------------------------------------------
+// CPELogExternalData::UpdateTimer
+// Updates the desired timer to shared data.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / REPOSITORY
+*    Series 60  REPOSITORY API
+*****************************************************/
+void CPELogExternalData::UpdateTimer
+        ( 
+        const TUint32 aTimer, 
+        TInt aDuration,
+        CRepository& aRepository
+        )
+    {
+    TEFLOGSTRING( KTAREQOUT, 
+        "LOG CPELogExternalData::UpdateTimer > CRepository::Get" );    
+    TInt errorCode( KErrNone );
+    TInt value( 0 );
+    errorCode = aRepository.Get( aTimer, value );
+    
+    if ( errorCode == KErrNone )
+        {
+        value += aDuration;
+        
+        TEFLOGSTRING( KTAREQOUT, 
+            "LOG CPELogExternalData::UpdateTimer > CRepository::Set" );
+        
+        errorCode = aRepository.Set( aTimer, value );
+        }
+    
+    if ( errorCode != KErrNone )
+        {
+        TEFLOGSTRING2( KTAERROR, 
+            "LOG CPELogExternalData::UpdateTimer(): Failed: %d", errorCode );
+        }
+    }
+        
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpeloghandling.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,844 @@
+/*
+* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPELogHandling class 
+*                member functions.
+*
+*/
+
+
+
+//  INCLUDE FILES
+#include <spsettings.h>
+#include <spproperty.h>
+#include <telloggingextension.h>
+#include <ecom.h> 
+#include "cpeloghandling.h"
+#include "cpelogevent.h"
+#include "cpeloghandlingcommand.h"
+#include "cpelogexternaldata.h"
+#include <talogger.h>
+#include <logcli.h>
+#include <pepanic.pan>
+#include <mpephonemodelinternal.h>
+#include <mpedatastore.h>
+#include "cpeloginfo.h"
+#include "cpelogextensionwrapper.h"
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+/// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+MPELogHandling* CPELogHandling::NewL
+        ( 
+        MPEPhoneModelInternal& aModel,        // Owner of the object
+        RFs& aFsSession                       // Handle to a file server session
+        )  
+    {
+    TEFLOGSTRING(KTAOBJECT, "LOG CPELogHandling::NewL start.");
+    CPELogHandling* self = 
+        new ( ELeave ) CPELogHandling( aModel, aFsSession );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING(KTAOBJECT, "LOG CPELogHandling::NewL complete.");
+    return self;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPELogHandling::~CPELogHandling
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+EXPORT_C CPELogHandling::~CPELogHandling()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandling::~CPELogHandling" );
+    
+    delete iLogExternalData;
+
+    iFreeLogEventArray.ResetAndDestroy();
+    iActiveLogEventArray.ResetAndDestroy();
+    // All created CPELogEvent objects must be either in Free or Active array
+    // That is, it would be error to destroy objects in queued array.
+    iQueuedLogEventArray.Reset();
+    iActiveCallIds.Close();
+
+    delete iLogHandlingCommand;
+    delete iLogClient;
+    iPlugins.ResetAndDestroy();
+    REComSession::FinalClose();
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogHandling::CPELogHandling
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPELogHandling::CPELogHandling
+        ( 
+        MPEPhoneModelInternal& aModel,
+        RFs& aFsSession        
+        ) : iModel( aModel ),
+            iDataStore( *( aModel.DataStore( ) ) ),
+            iFsSession( aFsSession ),
+            iLogEventUnderProcessing( NULL )
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandling::CPELogHandling" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogHandling::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandling::ConstructL" );
+    // Create new instace of the Log Client
+    iLogClient = CLogClient::NewL( iFsSession ); 
+
+    // Enumeration for incoming call, get from database 
+    User::LeaveIfError( iLogClient->GetString( iLogStringIn, R_LOG_DIR_IN ) ); 
+    // Enumeration for outgoing call, get from database 
+    User::LeaveIfError( iLogClient->GetString( iLogStringOut, R_LOG_DIR_OUT ) );   
+    // Enumeration for missed call, get from database
+    User::LeaveIfError( iLogClient->GetString( iLogStringMissed, R_LOG_DIR_MISSED ) );   
+    // Enumeration for delivery call, get from database  
+    User::LeaveIfError( iLogClient->GetString( iLogStringDelivery, R_LOG_DEL_NONE ) ); 
+    // Enumeration for incoming auxiliary line, get from database 
+    User::LeaveIfError( iLogClient->GetString( iLogStringInAlt, R_LOG_DIR_IN_ALT ) );   
+    // Enumeration for outgoing auxiliary line, get from database  
+    User::LeaveIfError( iLogClient->GetString( iLogStringOutAlt, R_LOG_DIR_OUT_ALT ) );
+    // Enumeration for unknown name, get from database  
+    User::LeaveIfError( iLogClient->GetString( iLogStringUnknown, R_LOG_REMOTE_UNKNOWN ) );
+      
+    iLogHandlingCommand = new (ELeave) CPELogHandlingCommand( *this, *iLogClient );
+ 
+    // Reserve some log events here. We delete these log event objects only on the destructor.
+    for( TInt entryIndex = 0; entryIndex < KPEMaximumNumberOfLogEvents; entryIndex++ )
+        {
+        CPELogEvent* logEvent = CPELogEvent::NewL( *this, *iLogHandlingCommand );
+        CleanupStack::PushL( logEvent );
+        iFreeLogEventArray.AppendL( logEvent );
+        CleanupStack::Pop( logEvent );
+        }
+    // Compress free log event array as it would never contain more objects than create here
+    iFreeLogEventArray.Compress( );
+
+    iLogExternalData = CPELogExternalData::NewL( *this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SaveCallEntry
+// Creates log info and initiates saving call log info by calling SaveCallInfoL.
+// Do log handling cleanup in case of a leave.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPELogHandling::SaveCallEntry
+        ( 
+        const TInt aCallId
+        )
+    {
+    TInt errorCode( KErrArgument );
+    if ( CallIdCheck::IsVoice( aCallId ) || 
+         CallIdCheck::IsVideo( aCallId )
+       ) 
+        {
+        CPELogInfo* logInfo( NULL );
+        TRAP( errorCode, logInfo = CPELogInfo::NewL(); );
+            
+        if ( logInfo )
+            {
+            // continue gathering log data
+            
+            // set phonenumber and/or voip address
+            SetRemoteContact( aCallId, *logInfo );
+            logInfo->SetEventData( aCallId, iDataStore ); 
+            TRAP_IGNORE( 
+                // Contact link can be big, not critical for basic functionality.
+                if ( &iDataStore.ContactId( aCallId ) )
+                    {
+                    // Pack and add link
+                    HBufC8* buf( iDataStore.ContactId( aCallId ).PackLC() );
+                    TEFLOGSTRING( KTAINT, "Contact id packed" );
+                    logInfo->SetContactLink( buf ); 
+                    CleanupStack::Pop( buf );
+                    }
+                // default logging strategy is used if error happens while using extension
+                UpdateLogInfoWithExtensionDataL( aCallId, *logInfo ) );
+            
+            TRAP( errorCode, SaveCallInfoL( *logInfo ) );
+            delete logInfo;
+            }
+        
+        if( errorCode != KErrNone )
+            {
+            DoCleanup();
+            }
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SendMessage
+// Method reroutes messages from other modules to the CPEPho-object
+// Note that it does not use base class SendMessage.
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::SendMessage
+        ( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, // The message id number of the message.
+        TInt aErrorCode
+        )
+    {
+    if ( aMessage == MEngineMonitor::EPEMessageLogEventSaved )
+        {
+        TEFLOGSTRING( KTAINT, "LOG CPELogHandling::SendMessage(), Log event saved" );                        
+        
+        if (aErrorCode == KErrNone )
+            {
+            // flag event entry as added; next event is to be just entry update.
+            iLogEventUnderProcessing->SetAdded( );
+            }
+        
+        if ( iLogEventUnderProcessing->IsCompleted( ) )
+            {
+            TEFLOGSTRING( KTAINT, "LOG CPELogHandling::SendMessage(), Log entry completed" );                       
+                       
+            DeleteArrayEntry( iLogEventUnderProcessing );
+            }
+
+        // Indicate that no processing of log event is in progress
+        iLogEventUnderProcessing = NULL;            
+            
+        if ( iQueuedLogEventArray.Count( ) > 0 )
+            {
+            TEFLOGSTRING( KTAINT, "LOG CPELogHandling::SendMessage(), Executing queued request" );
+            
+            CPELogEvent* logEvent = iQueuedLogEventArray[0];
+            iQueuedLogEventArray.Remove( 0 );
+            iLogEventUnderProcessing = logEvent;
+            TRAPD( error, logEvent->SaveL( ) );
+            if ( error != KErrNone )
+                {
+                DoCleanup();
+                }
+            }
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAINT, "LOG CPELogHandling::SendMessage(), Message %d not supported", aMessage );
+        }   
+    }
+        
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringIn
+// Get log string.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TLogString& CPELogHandling::LogStringIn
+        (
+        // None
+        )
+    {
+    return iLogStringIn;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringOut
+// Get log string.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TLogString& CPELogHandling::LogStringOut
+        (
+        // None
+        )
+    {
+    return iLogStringOut;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringMissed
+// Get log string.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TLogString& CPELogHandling::LogStringMissed
+        (
+        // None
+        )
+    {
+    return iLogStringMissed;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringIn
+// Get log string.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TLogString& CPELogHandling::LogStringDelivery
+        (
+        // None
+        )
+    {
+    return iLogStringDelivery;
+    }        
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringIn
+// Get log string.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TLogString& CPELogHandling::LogStringInAlt
+        (
+        // None
+        )
+    {
+    return iLogStringInAlt;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringOutAlt
+// Get log string.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TLogString& CPELogHandling::LogStringOutAlt
+        (
+        // None
+        )
+    {
+    return iLogStringOutAlt;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringUnknown
+// Get log string.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TLogString& CPELogHandling::LogStringUnknown
+        (
+        // None
+        )
+    {
+    return iLogStringUnknown;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SetRemoteContact
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::SetRemoteContact( TInt aCallId, CPELogInfo& aLogInfo )
+    {
+    aLogInfo.SetVoipAddress( KNullDesC() );
+    
+    if ( iDataStore.CallDirection( aCallId ) 
+            == RMobileCall::EMobileOriginated )
+        {
+        TEFLOGSTRING2(KTAINT, 
+            "LOG CPELogHandling::CreateLogInfo, WholeOutgoingPhoneNumber, aCallId: %d"
+            , aCallId )
+        aLogInfo.SetPhoneNumber( iDataStore.WholeOutgoingPhoneNumber( aCallId ) );
+        }
+    else
+        {
+        aLogInfo.SetPhoneNumber( iDataStore.RemotePhoneNumber( aCallId ) );
+        }
+    
+    if ( EPECallTypeVoIP == iDataStore.CallType( aCallId ) )
+        {
+        // voip address field must be used for voip calls
+        aLogInfo.SetVoipAddress( aLogInfo.PhoneNumber() );
+        aLogInfo.SetPhoneNumber( KNullDesC() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SaveCallInfoL
+// Update log external data.
+// Call SaveEventL if event should be saved to log db.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::SaveCallInfoL
+        ( 
+        const CPELogInfo& aLogInfo // Call information
+        )
+    {
+    TEFLOGSTRING3( KTAINT, "LOG CPELogHandling::SaveCallInfoL(), [CallID: %d], [CallState: %d]", aLogInfo.CallId(), aLogInfo.CallState() );
+    
+    if ( EPEStateConnected == aLogInfo.CallState() )
+        {
+        // Insert the call ID to the active call array when the call state is connected.
+        TInt err = iActiveCallIds.InsertInOrder( aLogInfo.CallId() );
+        if ( err != KErrAlreadyExists )
+            {
+            User::LeaveIfError( err );
+            }
+        
+        // Only for the first call set the first call start time
+        if ( iActiveCallIds.Count() == 1 )
+            {
+            // For Last active call timer. See end part of UpdateLastCallTimer.
+            iLogExternalData->SetFirstCallStartTime( aLogInfo.CallStartTime() );
+            }
+  
+        // We have already store the start time to log database on dialling/ringing state,
+        // but this is the real start time of call.
+        TBuf<KPEESDWFormattedTimeLength> formattedTime;
+        formattedTime.Zero();
+        aLogInfo.CallStartTime().FormatL( formattedTime, KPEESDWTimeFormat ); 
+        TEFLOGSTRING2( KTAINT, "LOG CPELogHandling::SaveCallInfoL() Connected state iCallStartTime > formattedTime: %S", &formattedTime );
+        }
+    else
+        {
+        // logsEntry handling only on Dialling/Ringing and Idle states.
+        if ( EPEStateIdle == aLogInfo.CallState() )
+            {          
+            iLogExternalData->UpdateCallTimers( aLogInfo );
+            if ( aLogInfo.MissedCall() )  
+                {
+                iLogExternalData->IncreaseMissedCallValue( aLogInfo.CallId() );
+                }
+
+            TInt index = iActiveCallIds.FindInOrder( aLogInfo.CallId() );
+            if ( index >= 0 )
+                {
+                // When a call is disconnected, its ID is removed from the active call array.
+                iActiveCallIds.Remove( index );
+                iLogExternalData->UpdateLastCallTimerByLine( aLogInfo );
+                if ( iActiveCallIds.Count() == 0 )
+                    {
+                    TInt duration = iLogExternalData->UpdateLastCallTimer( aLogInfo );
+                    iModel.DataStore()->SetCallDuration( duration );
+                    }
+                }
+            }
+        if ( aLogInfo.LoggingEnabled() ) 
+            {
+            // We log all voice calls and the following data/fax calls to Log database
+            // MO external Data calls,
+            // MO external Fax calls,
+            // MT external Data calls
+            // MT external Fax calls,
+            // MT internal Data calls,
+            // We don't log the following data/fax calls to Log database
+            // MO internal Data calls
+            // MO internal Fax calls,
+            // MT internal Fax calls, 
+            // these are logged by CSD agent.
+            // But we have to update timers for these calls.            
+            
+            SaveEventL( aLogInfo );
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SaveEventL
+// Update log database entry for an event. Manages event queueing.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::SaveEventL
+        ( 
+        const CPELogInfo& aLogInfo  // Log information
+        ) 
+    {
+    TInt index;
+    CPELogEvent* logEvent;
+    
+    
+    index = FindEventIndexById( aLogInfo.CallId() ); 
+    if ( index == KErrNotFound ) 
+        {
+        // a log event object can't be reused;  
+        TEFLOGSTRING2( KTAINT, "LOG CPELogHandling::SaveEventL(), [CallID: %d]",aLogInfo.CallId() );
+        TEFLOGSTRING2( KTAINT, "LOG CPELogHandling::SaveEventL(), [CallDirection: %d]", aLogInfo.CallDirection() );
+
+        if ( iFreeLogEventArray.Count() > 0 )
+            {
+            // reuse an already created object from the array of the freed log event objects
+            logEvent = iFreeLogEventArray[ 0 ];
+            iFreeLogEventArray.Remove( 0 );
+            }
+        else 
+            {
+            // create a new object; none available to be reused
+            logEvent = CPELogEvent::NewL( *this, *iLogHandlingCommand );
+            }
+            
+        CleanupStack::PushL( logEvent );
+        iActiveLogEventArray.AppendL( logEvent );
+        CleanupStack::Pop( logEvent );            
+        }
+    else
+        {
+        // the log event object is already active but not completed. reuse it.
+        logEvent = iActiveLogEventArray[ index ];
+        }
+        
+    __ASSERT_ALWAYS( logEvent, Panic(EPEPanicNullPointer) );
+        
+
+    // Save logInfo for possible queueing.
+    logEvent->UpdateLogInfoL( aLogInfo );
+       
+    if ( iLogEventUnderProcessing )
+        {
+        // queueing can not be done per event because log client
+        // would fail if new request is sent before the previous one
+        // has been processed even if they are for two different events.
+        // See Symbian doc for more details.
+        if ( iQueuedLogEventArray.Find( logEvent ) == KErrNotFound )  
+            {
+            TEFLOGSTRING( KTAINT, "LOG CPELogHandling::SaveEventL(), AO busy, request queued" );                
+            // queue the updated event only if event is not already queued
+            TInt error = iQueuedLogEventArray.Append( logEvent );
+            if ( error != KErrNone )
+                {
+                TEFLOGSTRING( KTAERROR, "LOG CPELogHandling::SaveEventL(), Append to QueuedArray failed!" );
+                TEFLOGSTRING( KTAERROR, "LOG CPELogHandling::SaveEventL(), WARNING: Array Entry will be deleted to prevent memory leak." );
+                       
+                DeleteArrayEntry( logEvent );
+                
+                User::LeaveIfError( error );
+                }
+            }
+        else // the existing queued request will be executed with updated info
+            {
+            TEFLOGSTRING( KTAINT, "LOG CPELogHandling::SaveEvent(), AO busy, queued request already exists" );
+            }
+        }   
+    else
+        {
+        iLogEventUnderProcessing = logEvent;
+        logEvent->SaveL( );            
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogsHandling::FindEventIndexById
+// Find index number from array with given callid.
+// -----------------------------------------------------------------------------
+//
+TInt CPELogHandling::FindEventIndexById
+        ( 
+        const TInt aCallId // Call identification number
+        )
+    {
+    TEFLOGSTRING( KTAINT, 
+        "Log Handling: CPELogHandling::FindEventIndexById() - 1" );
+    for( TInt index = 0; index < iActiveLogEventArray.Count(); index++ )
+        { 
+        TEFLOGSTRING( KTAINT, 
+            "Log Handling: CPELogHandling::FindEventIndexById() - 2" );        
+        if( (iActiveLogEventArray[ index ]->CallId() == aCallId) &&
+            !(iActiveLogEventArray[ index ]->IsCompleted()) )
+            {
+            TEFLOGSTRING( KTAINT, 
+                "LOG CPELogHandling::FindEventIndexById() - 3" );
+            return index;
+            }
+        }
+    TEFLOGSTRING( KTAINT, 
+        "LOG CPELogHandling::FindEventIndexById() - 4" );
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogsHandling::DeleteArrayEntry
+// Delete array's enty by given callid.
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::DeleteArrayEntry
+        ( 
+        CPELogEvent* aLogEvent
+        )
+    {
+    TInt index = iActiveLogEventArray.Find( aLogEvent );
+    TInt queuedIndex = iQueuedLogEventArray.Find( aLogEvent );
+    TInt freeIndex = iFreeLogEventArray.Find( aLogEvent );
+    
+    // Reset event before deletion
+    aLogEvent->ResetEvent( );
+    aLogEvent->ResetLogInfo();
+    
+    // Remove event from queued array as it is there by error and should not be processed after deletion
+    if ( queuedIndex != KErrNotFound )
+        {
+        TEFLOGSTRING( KTAERROR, "LOG CPELogHandling::DeleteArrayEntry: WARNING Log event removed from queued event array. This should not happen." )
+        iQueuedLogEventArray.Remove( queuedIndex );
+        }
+    
+    if ( index != KErrNotFound )
+        {
+        iActiveLogEventArray.Remove( index );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "LOG CPELogHandling::DeleteArrayEntry: WARNING Log event NOT in active event array. This should not happen." )
+        }
+        
+    if ( freeIndex == KErrNotFound )
+        {   
+        if ( iFreeLogEventArray.Count( ) < KPEMaximumNumberOfLogEvents )
+            {
+            if (iFreeLogEventArray.Append( aLogEvent ) != KErrNone)
+                {
+                // prevent memory leak
+                delete aLogEvent;
+                }
+            }
+        else
+            {
+            // prevent memory leak
+            delete aLogEvent;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogsHandling::DoCleanup
+// Do log handling cleanup in case of leave during handling of a log event.
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::DoCleanup()
+    {
+    if ( iLogEventUnderProcessing ) 
+        {
+        // delete log event entry only if save leaves and event is completed
+        // otherwise we expect more log events for the same entry that is no need to delete
+        if ( iLogEventUnderProcessing->SaveLeave( ) && 
+             iLogEventUnderProcessing->IsCompleted( ) )
+            {
+            TEFLOGSTRING( KTAERROR, 
+                "LOG CPELogHandling::DoCleanup(), WARNING: Array Entry will be deleted to prevent memory leak." );
+            
+            DeleteArrayEntry( iLogEventUnderProcessing );
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogsHandling::ResetMissedCalls()
+// Reset missed call.
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::ResetMissedCalls( TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, 
+        "LOG CPELogsHandling::ResetMissedCalls > SetMissedCall" );
+    
+    TEFLOGSTRING2(KTAINT, 
+            "LOG CPELogHandling::ResetMissedCalls, aCallId: %d"
+            , iDataStore.CallId() );
+    iDataStore.SetMissedCall( EFalse, aCallId );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::UpdateLogInfoWithExtensionDataL
+// Log information is not changed if some error happens with extension usage. 
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::UpdateLogInfoWithExtensionDataL( TInt aCallId, 
+        CPELogInfo& aLogInfo )
+    {
+    TUint serviceId( iDataStore.ServiceId( aCallId ) );
+    CTelLoggingExtension& extension = LoggingExtensionL( serviceId );
+    
+    // initialize extension with original remote contact number/address
+    const TPEPhoneNumber* origRemoteContact = NULL;
+    RMobileCall::EMobileOriginated == iDataStore.CallDirection( aCallId )
+        ? origRemoteContact = &iDataStore.WholeOutgoingPhoneNumber( aCallId )
+        : origRemoteContact = &iDataStore.RemotePhoneNumber( aCallId );
+    __ASSERT_ALWAYS( NULL != origRemoteContact, User::Leave( KErrNotFound ) );
+    extension.InitializeL( serviceId, *origRemoteContact );
+    
+    RBuf phoneNumber;
+    CleanupClosePushL( phoneNumber );
+    User::LeaveIfError( extension.GetPhoneNumber( phoneNumber ) );
+    
+    RBuf voipAddress;
+    CleanupClosePushL( voipAddress );
+    User::LeaveIfError( extension.GetVoipAddress( voipAddress ) );
+    
+    RBuf myAddress;
+    CleanupClosePushL( myAddress );
+    User::LeaveIfError( extension.GetMyAddress( myAddress ) );
+    
+    RBuf remotePartyName;
+    CleanupClosePushL( remotePartyName );
+    User::LeaveIfError( extension.GetRemotePartyName( remotePartyName ) );
+    
+    // update log info with successfully queried extension data
+    SetExtensionData( aLogInfo, phoneNumber, voipAddress, 
+        myAddress, remotePartyName );
+    
+    CleanupStack::PopAndDestroy( 4, &phoneNumber );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LoggingExtensionL
+// -----------------------------------------------------------------------------
+//
+CTelLoggingExtension& CPELogHandling::LoggingExtensionL( TUint aServiceId )
+    {
+    TUid pluginUid = LoggingPluginIdentifierL( aServiceId );
+    
+    CPELogExtensionWrapper* wrapper = NULL;
+    TInt pluginInd = 
+        iPlugins.Find( pluginUid, CPELogExtensionWrapper::MatchByUid );
+    if ( KErrNotFound == pluginInd )
+        {
+        wrapper = CreateExtensionWrapperLC( pluginUid );
+        iPlugins.AppendL( wrapper );
+        CleanupStack::Pop( wrapper );
+        }
+    else
+        {
+        wrapper = iPlugins[pluginInd];
+        }
+    
+    __ASSERT_ALWAYS( NULL != wrapper, User::Leave( KErrNotFound ) );
+    return *wrapper;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LoggingPluginIdentifierL
+// Resolves plugin identifier for the given service.
+// -----------------------------------------------------------------------------
+//
+TUid CPELogHandling::LoggingPluginIdentifierL( TUint aServiceId ) const
+    {
+    TInt pluginUid( 0 );
+    CSPSettings* settings = CSPSettings::NewLC();
+    CSPProperty* property = CSPProperty::NewLC();
+    
+    TInt result = settings->FindPropertyL( aServiceId, 
+        EPropertyCallLoggingPluginId, *property );
+    User::LeaveIfError( result );
+    User::LeaveIfError( property->GetValue( pluginUid ) );
+    CleanupStack::PopAndDestroy( property );
+    CleanupStack::PopAndDestroy( settings );
+    
+    return TUid::Uid( pluginUid );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SetExtensionData
+// Lengths of the descriptors gotten from plugin must be checked, because
+// extension API does not set limits for data length. In case that phone number
+// is available, voip address is not saved to logs. That enables user to select
+// call type s/he wants when calling from logs.
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::SetExtensionData( CPELogInfo& aLogInfo, 
+        const TDesC& aPhoneNumber, const TDesC& aVoipAddress, 
+        const TDesC& aMyAddress, const TDesC& aRemotePartyName )
+    {
+    if ( aPhoneNumber.Length() <= aLogInfo.PhoneNumber().MaxLength() )
+        {
+        aLogInfo.SetPhoneNumber( aPhoneNumber );
+        aLogInfo.SetVoipAddress( KNullDesC() );
+        }
+    
+    if ( aVoipAddress.Length() <= aLogInfo.VoipAddress().MaxLength() )
+        {
+        if ( KNullDesC() == aLogInfo.PhoneNumber() )
+            {
+            aLogInfo.SetVoipAddress( aVoipAddress );
+            }
+        }
+    
+    if ( aMyAddress.Length() <= aLogInfo.MyAddress().MaxLength() )
+        {
+        aLogInfo.SetMyAddress( aMyAddress );
+        }
+    
+    // Try to use user defined contact name from contacts, remote party name
+    // from extension or voip address from extension as a contact name to be
+    // saved in logs, in that order.
+    TBool noContactMatch = ( KNullDesC() == aLogInfo.Name() ); 
+    if ( noContactMatch )
+        {
+        if ( aRemotePartyName.Length() != 0 )
+            {
+            aLogInfo.SetName( aRemotePartyName.Left( aLogInfo.Name().MaxSize() ) );
+            }
+        else if ( KNullDesC() != aLogInfo.VoipAddress() )
+            {
+            aLogInfo.SetName( aLogInfo.VoipAddress() );
+            }
+        else
+            {
+            aLogInfo.SetName( aLogInfo.PhoneNumber() );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::CreateExtensionWrapperLC
+// -----------------------------------------------------------------------------
+//
+CPELogExtensionWrapper* CPELogHandling::CreateExtensionWrapperLC( 
+        const TUid& aPluginUid ) const
+    {
+    return CPELogExtensionWrapper::NewLC( aPluginUid );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpeloghandlingcommand.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPELogHandlingCommand class  
+
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeloghandlingcommand.h"
+#include "cpeloghandling.h"
+#include <pevirtualengine.h>
+#include <talogger.h>
+#include <logwrap.h>
+#include <logcli.h>
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None. 
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::CPELogHandlingCommand
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+CPELogHandlingCommand::CPELogHandlingCommand
+        ( 
+        CPELogHandling& aOwner,                   //The owner of this object
+        CLogClient& aLogClient                    //The log client
+        ) : CActive( EPriorityStandard ),
+            iOwner( aOwner),
+            iLogClient( aLogClient )
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingCommand::CPELogHandlingCommand start.");
+    CActiveScheduler::Add( this );    
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingCommand::CPELogHandlingCommand complete.");
+    }
+
+// Destructor
+CPELogHandlingCommand::~CPELogHandlingCommand
+    (
+    // None.
+    )
+    {
+    Cancel( );
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingCommand::~CPELogHandlingCommand: complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::AddEvent
+// Adds an event to the log
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+TInt CPELogHandlingCommand::AddEvent
+        (
+        CLogEvent& aLogEvent
+        )
+    {
+    TInt errorCode ( KErrNone );
+    
+    iLogId = aLogEvent.Id( );        
+    
+    TEFLOGSTRING( KTAINT, "==========================================" );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::AddEvent() > CLogClient::AddEvent(), Log ID: %d",iLogId );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::AddEvent() > CLogClient::AddEvent(), Calling Name: %S",&(aLogEvent.RemoteParty()) );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::AddEvent() > CLogClient::AddEvent(), Call Number: %S",&(aLogEvent.Number()) );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::AddEvent() > CLogClient::AddEvent(), Direction: %S",&(aLogEvent.Direction()) );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::AddEvent() > CLogClient::AddEvent(), Duration: %d",aLogEvent.Duration() );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::AddEvent() > CLogClient::AddEvent(), Subject: %S", &(aLogEvent.Subject()) );
+    TEFLOGSTRING( KTAINT, "==========================================" );
+    
+    if ( !IsActive( ) )
+        {
+        TEFLOGSTRING( KTAREQOUT, 
+            "LOG CPELogHandlingCommand::AddEvent() > CLogClient::AddEvent()" );
+        iLogClient.AddEvent( aLogEvent, iStatus );
+        errorCode = KErrNone;
+        SetActive( );        
+        }
+    else
+        {
+        TEFLOGSTRING( KTAINT, "LOG CPELogHandlingCommand::AddEvent(), Event NOT added" );
+        errorCode = KErrInUse;
+        }
+        
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::ChangeEvent
+// Updates an event in the log
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+TInt CPELogHandlingCommand::ChangeEvent
+        (
+        const CLogEvent& aLogEvent
+        )
+    {
+    TInt errorCode( KErrNone );
+
+    iLogId = aLogEvent.Id( );        
+
+    TEFLOGSTRING( KTAINT, "==========================================" );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::ChangeEvent() > CLogClient::ChangeEvent(), Log ID: %d",aLogEvent.Id() );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::ChangeEvent() > CLogClient::ChangeEvent(), Call Number: %S",&(aLogEvent.Number()) );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::ChangeEvent() > CLogClient::ChangeEvent(), Direction: %S",&(aLogEvent.Direction()) );
+    TEFLOGSTRING2( KTAINT, "LOG CPELogHandlingCommand::ChangeEvent() > CLogClient::ChangeEvent(), Duration: %d",aLogEvent.Duration() );
+    TEFLOGSTRING( KTAINT, "==========================================" );
+    
+    if ( !IsActive( ) )
+        {
+        TEFLOGSTRING( KTAREQOUT, 
+            "LOG CPELogHandlingCommand::ChangeEvent() > CLogClient::ChangeEvent()" );
+        
+        iLogClient.ChangeEvent( aLogEvent, iStatus );
+        SetActive( );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAINT, "LOG CPELogHandlingCommand::ChangeEvent(), Event NOT changed" );
+        errorCode = KErrInUse;        
+        } 
+        
+    return errorCode;       
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::RunL
+// Description: Method gets notification from etel that asyncronous request is completed.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPELogHandlingCommand::RunL
+        (
+        // None.
+        )
+    {
+    TEFLOGSTRING2( KTAREQEND, "LOG CPELogHandlingCommand::RunL: < CLogClient LogId = %d. ", iLogId );   
+    if ( iStatus.Int( ) != KErrNone && iStatus.Int( ) != KErrCancel )
+        {
+        TEFLOGSTRING2( KTAERROR, "LOG CPELogHandlingCommand::RunL: error = %d.", iStatus.Int() );   
+        }
+    iOwner.SendMessage( MEngineMonitor::EPEMessageLogEventSaved, iStatus.Int() );  
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::DoCancel
+// Cancels request to the log client
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogHandlingCommand::DoCancel
+        (
+        // None.
+        )
+    {
+    TEFLOGSTRING( KTAINT, "LOG CPELogHandlingCommand::DoCancel" );
+    
+    iLogClient.Cancel( );  
+    }
+
+
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpeloghandlingdummy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPELogHandlingDummy
+*              : class member functions.
+*
+*/
+
+
+
+//  INCLUDE FILES
+#include "cpeloghandlingdummy.h"
+#include "cpelogevent.h"
+#include <talogger.h>
+#include <pepanic.pan>
+#include <mpephonemodelinternal.h>
+#include <mpedatastore.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+/// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingDummy::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+MPELogHandling* CPELogHandlingDummy::NewL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingDummy::NewL start" );
+    CPELogHandlingDummy* self = new ( ELeave ) CPELogHandlingDummy();
+
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingDummy::NewL complete" );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingDummy::~CPELogHandlingDummy
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPELogHandlingDummy::~CPELogHandlingDummy()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingDummy::~CPELogHandlingDummy" );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPELogHandlingDummy::CPELogHandlingDummy
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPELogHandlingDummy::CPELogHandlingDummy()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingDummy::CPELogHandlingDummy" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingDummy::SaveCallEntry
+// Dummy method
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPELogHandlingDummy::SaveCallEntry
+        ( 
+        const TInt /*aCallId*/
+        )
+    {
+    return KErrNone;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpeloghandlingproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPELogHandlingProxy
+*              : class member functions.
+*
+*/
+
+
+
+//  INCLUDE FILES
+#include "cpeloghandling.h"
+#include "cpeloghandlingdummy.h"
+#include "cpeloghandlingproxy.h"
+#include <talogger.h>
+#include <pepanic.pan>
+#include "mpeloghandling.h"
+#include <mpephonemodelinternal.h>
+#include <mpedatastore.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+/// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// ================= MEMBER FUNCTIONS =======================
+// -----------------------------------------------------------------------------
+// CPELogHandlingProxy::CreateFirstPhaseL
+// This method creates the log handling proxy and dummy implementation
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MPELogHandling* CPELogHandlingProxy::CreateFirstPhaseL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::CreateFirstPhaseL start." );
+    CPELogHandlingProxy* self = new ( ELeave ) CPELogHandlingProxy();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::CreateFirstPhaseL complete" );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// PELogHandling::CreateSecondPhaseL
+// This method creates the actual log handling implementation
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CPELogHandlingProxy::CreateSecondPhaseL(
+        MPEPhoneModelInternal& aModel,        // Owner of the object
+        RFs& aFsSession                       // Handle to a file server session
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::CreateSecondPhaseL start." );
+    iLogHandling = CPELogHandling::NewL( aModel, aFsSession );
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::CreateSecondPhaseL complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingProxy::~CPELogHandlingProxy
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CPELogHandlingProxy::~CPELogHandlingProxy()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::~CPELogHandlingProxy" );
+    delete iLogHandling;
+    delete iLogHandlingDummy;
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingProxy::CPELogHandlingProxy
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPELogHandlingProxy::CPELogHandlingProxy()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingProxy::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPELogHandlingProxy::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "LOG CPELogHandlingProxy::ConstructL" );
+    // Create an instance of the log handling dummy implementation
+    iLogHandlingDummy = CPELogHandlingDummy::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingProxy::SaveCallEntry
+// Redirects the function call to either log handling implementation or
+// log handling dummy implementation.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CPELogHandlingProxy::SaveCallEntry
+        ( 
+        const TInt aCallId
+        )
+    {
+    if ( iLogHandling )
+        {
+        TEFLOGSTRING( KTAINT, "LOG CPELogHandlingProxy::SaveCallEntry > CPELogHandling::SaveCallEntry" );
+        return iLogHandling->SaveCallEntry( aCallId );
+        }
+    else if ( iLogHandlingDummy )
+        {
+        TEFLOGSTRING( KTAINT, "LOG CPELogHandlingProxy::SaveCallEntry > CPELogHandlingDummy::SaveCallEntry" );
+        return iLogHandlingDummy->SaveCallEntry( aCallId );
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "LOG CPELOGHANDLINGPROXY::SAVECALLENTRY ! NEITHER LOG HANDLING NOR LOG HANDLING DUMMY EXISTS" );
+        User::Invariant();
+        }
+    return KErrBadHandle;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/cpeloginfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,571 @@
+/*
+* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPELogInfo class 
+*                member functions.
+*
+*/
+
+//  INCLUDE FILES
+#include "cpeloginfo.h"
+#include "talogger.h"
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo* CPELogInfo::NewL()
+    {
+    return new( ELeave ) CPELogInfo();
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo::~CPELogInfo()
+    {
+    delete iContactLink;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo::CPELogInfo() : iEventType( CPELogInfo::EPEUnknownEvent ),
+    iCallDirection( RMobileCall::EDirectionUnknown ),
+    iCallId( KPECallIdNotUsed ),
+    iCallState( EPEStateUnknown ),
+    iCurrentLine( CCCECallParameters::ECCELineTypePrimary ), 
+    iPhoneNumberId( EPEUnknownNumber )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Set basic event data, guarantees data existence
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetEventData( 
+    TInt aCallId, 
+    const MPEDataStore& aDataStore )
+    {
+    //CallId
+    iCallId = aCallId;
+
+    // Line
+    iCurrentLine = aDataStore.CallALSLine( aCallId );
+
+    // EventType
+    switch ( aDataStore.CallType( aCallId ) )
+        {
+        case EPECallTypeCSVoice:
+
+            iEventType = EPEVoiceEvent;
+            break;
+
+        case EPECallTypeVoIP:
+
+            iEventType = EPEVoIPEvent;
+
+            break;
+        case EPECallTypeVideo:
+            iEventType = EPEVideoCallEvent;
+            break;
+        case EPECallTypeUninitialized:
+        default:
+            iEventType = EPEUnknownEvent;
+            break;
+        }
+
+    // CallDirection
+    iCallDirection = aDataStore.CallDirection( aCallId );
+   
+    // Name
+    if ( aDataStore.RemoteName( aCallId ).Length() > 0 )
+        {
+        iName = aDataStore.RemoteName( aCallId );
+        }
+    else if ( aDataStore.RemoteCompanyName( aCallId ).Length() > 0 ) 
+        {
+        iName = aDataStore.RemoteCompanyName( aCallId );
+        }
+    else
+        {
+        iName = KNullDesC;
+        }
+      
+    if ( iCallDirection == RMobileCall::EMobileTerminated )
+        {
+        // adjust log info name in case of suppressed and unknown remote identity for MT calls only
+        RMobileCall::TMobileCallRemoteIdentityStatus remoteIdentity;
+        remoteIdentity = aDataStore.RemoteIdentity( aCallId );
+
+        switch ( remoteIdentity )
+            {
+            case RMobileCall::ERemoteIdentityUnknown:
+                iName = KPELogUnknownText;
+                break;
+            case RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone:
+            case RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone:
+                iName = KLogsPayphoneText;
+                break;
+            case RMobileCall::ERemoteIdentitySuppressed:
+                if ( aDataStore.RemotePhoneNumber( aCallId ).Length() == 0 )
+                    {
+                    iName = KLogsPrivateText;
+                    }
+                break;
+            default:
+                break;
+            }
+        }
+
+    // CallState
+    iCallState = aDataStore.CallState( aCallId );
+    
+    // CallDuration
+    iDuration = aDataStore.CallDuration( aCallId );
+   
+    // PhoneNumberType
+    TPEPhoneNumberIdType numberType = aDataStore.RemotePhoneNumberType( aCallId );
+    iPhoneNumberId = numberType;
+
+    //Start time
+    iCallStartTime = aDataStore.CallStartTime( aCallId );
+    
+    //Missed call
+    iMissedCall = aDataStore.MissedCall( aCallId );
+
+    //LoggingEnabled
+    iLoggingEnabled = aDataStore.LoggingIndicator( aCallId );
+    
+    // Get log forced completion indicator
+    iForcedCompletion = aDataStore.LogForcedCompletion( aCallId );
+     
+    // Set log event type in case of emergency call
+    if ( numberType == EPEEmergencyNumber )
+        {
+        TEFLOGSTRING( KTAINT, "LOG CPELogHandling::CreateLogInfo() Emergecy call" );
+        iEventType = EPEEmergecyEvent;
+        }
+
+    iServiceId = aDataStore.ServiceId( aCallId );
+ 
+    iMyAddress = KNullDesC();
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::CopyL( const CPELogInfo& aLogInfo )
+    {
+    iEventType = aLogInfo.iEventType;
+    iCallDirection = aLogInfo.iCallDirection;
+    iCallId = aLogInfo.iCallId;
+    iPhoneNumber = aLogInfo.iPhoneNumber;
+    iName = aLogInfo.iName;
+    iCallState = aLogInfo.iCallState;
+    iDuration = aLogInfo.iDuration;
+    iCurrentLine = aLogInfo.iCurrentLine;
+    iPhoneNumberId = aLogInfo.iPhoneNumberId;
+    iLoggingEnabled = aLogInfo.iLoggingEnabled;
+    iCallStartTime = aLogInfo.iCallStartTime;
+    iMissedCall = aLogInfo.iMissedCall;
+    iForcedCompletion = aLogInfo.iForcedCompletion;
+    iServiceId = aLogInfo.iServiceId;
+    iVoipAddress = aLogInfo.iVoipAddress;
+    iMyAddress = aLogInfo.iMyAddress;
+    if ( iContactLink )
+        {
+        delete iContactLink;
+        iContactLink = NULL;
+        }
+    if ( aLogInfo.iContactLink )
+        {
+        iContactLink = aLogInfo.iContactLink->AllocL();
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::Reset()
+    {
+    iEventType = CPELogInfo::EPEUnknownEvent;
+    iCallDirection = RMobileCall::EDirectionUnknown;
+    iCallId = KPECallIdNotUsed;
+    iPhoneNumber = KNullDesC;
+    iName = KNullDesC;       
+    iCallState = EPEStateUnknown;
+    iDuration = 0; 
+    iCurrentLine = CCCECallParameters::ECCELineTypePrimary; 
+    iPhoneNumberId = EPEUnknownNumber;
+    iLoggingEnabled = EFalse;
+    iCallStartTime = 0;
+    iMissedCall = EFalse;   
+    iForcedCompletion = EFalse;
+    iVoipAddress = KNullDesC;
+    iMyAddress = KNullDesC;
+    delete iContactLink;
+    iContactLink = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetEventType( TPELogEventType aEventType )
+    {
+    iEventType = aEventType;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo::TPELogEventType CPELogInfo::EventType() const
+    {
+    return iEventType;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallDirection( RMobileCall::TMobileCallDirection aCallDirection )
+    {
+    iCallDirection = aCallDirection;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+RMobileCall::TMobileCallDirection CPELogInfo::CallDirection() const
+    {
+    return iCallDirection;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallId( TInt aCallId )
+    {
+    iCallId = aCallId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CPELogInfo::CallId() const
+    {
+    return iCallId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber )
+    {
+    iPhoneNumber = aPhoneNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPELogInfo::PhoneNumber() const
+    {
+    return iPhoneNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetName( const TPEContactName& aName )
+    {
+    iName = aName;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEContactName& CPELogInfo::Name() const
+    {
+    return iName;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallState( TPEState aCallState )
+    {
+    iCallState = aCallState;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TPEState CPELogInfo::CallState() const
+    {
+    return iCallState;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetDuration( TTimeIntervalSeconds aDuration )
+    {
+    iDuration = aDuration;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TTimeIntervalSeconds CPELogInfo::Duration() const
+    {
+    return iDuration;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCurrentLine( CCCECallParameters::TCCELineType aCurrentLine )
+    {
+    iCurrentLine = aCurrentLine;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CCCECallParameters::TCCELineType CPELogInfo::CurrentLine() const
+    {
+    return iCurrentLine;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetPhoneNumberId( TPEPhoneNumberIdType aPhoneNumberId )
+    {
+    iPhoneNumberId = aPhoneNumberId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TPEPhoneNumberIdType CPELogInfo::PhoneNumberId() const
+    {
+    return iPhoneNumberId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetLoggingEnabled( TBool aLoggingEnabled )
+    {
+    iLoggingEnabled = aLoggingEnabled;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CPELogInfo::LoggingEnabled() const
+    {
+    return iLoggingEnabled;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallStartTime( TTime aCallStartTime )
+    {
+    iCallStartTime = aCallStartTime;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TTime CPELogInfo::CallStartTime() const
+    {
+    return iCallStartTime;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetMissedCall( TBool aMissedCall )
+    {
+    iMissedCall = aMissedCall;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CPELogInfo::MissedCall() const
+    {
+    return iMissedCall;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetForcedCompletion( TBool aForcedCompletion )
+    {
+    iForcedCompletion = aForcedCompletion;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CPELogInfo::ForcedCompletion() const
+    {
+    return iForcedCompletion;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetServiceId( TUint32 aServiceId )
+    {
+    iServiceId = aServiceId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TUint32 CPELogInfo::ServiceId() const
+    {
+    return iServiceId;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetVoipAddress( const TPEPhoneNumber& aVoipAddress )
+    {
+    iVoipAddress = aVoipAddress;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPELogInfo::VoipAddress() const
+    {
+    return iVoipAddress;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetMyAddress( const TPEPhoneNumber& aMyAddress )
+    {
+    iMyAddress = aMyAddress;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPELogInfo::MyAddress() const
+    {
+    return iMyAddress;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Save contact link. Ownership is transferred.
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetContactLink( const HBufC8* aContactLink )
+    {
+    delete iContactLink;
+    iContactLink = aContactLink;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const HBufC8& CPELogInfo::ContactLink() const
+    {
+    return *iContactLink;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/src/peloghandlingpanic.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of Log Handling panic function
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <pepanic.pan>
+#include "e32std.h"
+
+// EXTERNAL DATA STRUCTURES
+//None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//None
+
+// CONSTANTS
+//None
+
+// MACROS
+//None
+
+// LOCAL CONSTANTS AND MACROS
+//None
+
+// MODULE DATA STRUCTURES
+//None
+
+// LOCAL FUNCTION PROTOTYPES
+//None
+
+// FORWARD DECLARATIONS
+//None
+
+
+// ==================== LOCAL FUNCTIONS =====================================
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Panic implements...
+// Log Handling panic function
+// Returns: None
+// -----------------------------------------------------------------------------
+//
+GLDEF_C void Panic
+        ( 
+        TPEPanic aPanic 
+        )
+    {
+    _LIT(KPELogHandlingPanic,"LogHandling Panic!");
+    User::Panic( KPELogHandlingPanic, aPanic);
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/mocks/mock_centralrepository.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,641 @@
+/** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <smcmockclassincludes.h>
+#include <ceunitalloctestcasedecorator.h>
+#include "centralrepository.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CRepository::NewL
+// -----------------------------------------------------------------------------
+//
+CRepository * CRepository::NewL( 
+        TUid aRepositoryUid )
+    {
+    SMC_MOCK_NEWL1( CRepository *, TUid, aRepositoryUid )
+
+    CRepository* self = new( ELeave ) CRepository;
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NewLC
+// -----------------------------------------------------------------------------
+//
+CRepository * CRepository::NewLC( 
+        TUid aRepositoryUid )
+    {
+    SMC_MOCK_NEWLC1( CRepository *, TUid, aRepositoryUid )
+
+    CRepository* self = new( ELeave ) CRepository;
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::~CRepository
+// -----------------------------------------------------------------------------
+//
+CRepository::~CRepository(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        TInt aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TInt, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        const TReal & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TReal &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        const TDesC8 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC8 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        const TDesC16 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC16 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Delete
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Delete( 
+        TUint32 aKey )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32, aKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Delete
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Delete( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TUint32 & aErrorKey )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TUint32 &, aErrorKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TInt & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TInt &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        TInt aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TInt, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TReal & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TReal &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        const TReal & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TReal &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TDes8 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TDes8 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aId,
+        TDes8 & aValue,
+        TInt & aActualLength )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aId, 
+        TDes8 &, aValue, 
+        TInt &, aActualLength )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        const TDesC8 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC8 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TDes16 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TDes16 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aId,
+        TDes16 & aValue,
+        TInt & aActualLength )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aId, 
+        TDes16 &, aValue, 
+        TInt &, aActualLength )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        const TDesC16 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC16 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::GetMeta
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::GetMeta( 
+        TUint32 aKey,
+        TUint32 & aMeta )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TUint32 &, aMeta )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Move
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Move( 
+        TUint32 aSourcePartialKey,
+        TUint32 aTargetPartialKey,
+        TUint32 aMask,
+        TUint32 & aErrorKey )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aSourcePartialKey, 
+        TUint32, aTargetPartialKey, 
+        TUint32, aMask, 
+        TUint32 &, aErrorKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TInt aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TInt, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TReal & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TReal &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC8 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC8 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC16 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC16 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TInt aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TInt, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TReal & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TReal &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC8 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC8 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC16 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC16 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyRequest
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyRequest( 
+        TUint32 aKey,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyRequest
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyRequest( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyCancel
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyCancel( 
+        TUint32 aKey )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32, aKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyCancel
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyCancel( 
+        TUint32 aPartialKey,
+        TUint32 aMask )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aPartialKey, 
+        TUint32, aMask )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyCancelAll
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyCancelAll(  )
+    {
+    SMC_MOCK_METHOD0( TInt )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Reset
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Reset(  )
+    {
+    SMC_MOCK_METHOD0( TInt )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Reset
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Reset( 
+        TUint32 aKey )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32, aKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::StartTransaction
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::StartTransaction( 
+        TTransactionMode aMode )
+    {
+    SMC_MOCK_METHOD1( TInt, TTransactionMode, aMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::StartTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::StartTransaction( 
+        TTransactionMode aMode,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD2( void, TTransactionMode, aMode, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CommitTransaction
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::CommitTransaction( 
+        TUint32 & aKeyInfo )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32 &, aKeyInfo )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CommitTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::CommitTransaction( 
+        TDes8 & aKeyInfo,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD2( void, TDes8 &, aKeyInfo, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CancelTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::CancelTransaction(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CleanupCancelTransactionPushL
+// -----------------------------------------------------------------------------
+//
+void CRepository::CleanupCancelTransactionPushL(  )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FailTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::FailTransaction(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CleanupFailTransactionPushL
+// -----------------------------------------------------------------------------
+//
+void CRepository::CleanupFailTransactionPushL(  )
+    {
+    EUNIT_LEAVE_POINT
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/mocks/mock_cpeloghandling.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,191 @@
+/** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <smcmockclassincludes.h>
+#include <spsettings.h>
+#include <spproperty.h>
+#include <telloggingextension.h>
+#include <ECom.h> 
+#include "CPELogHandling.h"
+#include "CPELogEvent.h"
+#include "CPELogHandlingCommand.h"
+#include "CPELogExternalData.h"
+#include <TALogger.h>
+#include <logcli.h>
+#include <pepanic.pan>
+#include <MPEPhoneModelInternal.h>
+#include <MPEDataStore.h>
+#include "cpeloghandling.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::CPELogHandling
+// -----------------------------------------------------------------------------
+//
+CPELogHandling::CPELogHandling( 
+        MPEPhoneModelInternal & aModel,
+        RFs & aFsSession ) : iModel( aModel ),
+            iDataStore( *( aModel.DataStore( ) ) ),
+            iFsSession( aFsSession )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::ConstructL(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::NewL
+// -----------------------------------------------------------------------------
+//
+MPELogHandling * CPELogHandling::NewL( 
+        MPEPhoneModelInternal & aModel,
+        RFs & aFsSession )
+    {
+    SMC_MOCK_NEWL2( MPELogHandling *, MPEPhoneModelInternal &, aModel, 
+        RFs &, aFsSession )
+
+    CPELogHandling* self = new( ELeave ) CPELogHandling( aModel, aFsSession );
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::~CPELogHandling
+// -----------------------------------------------------------------------------
+//
+CPELogHandling::~CPELogHandling(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SaveCallEntry
+// -----------------------------------------------------------------------------
+//
+TInt CPELogHandling::SaveCallEntry( 
+        const TInt aCallId )
+    {
+    SMC_MOCK_METHOD1( TInt, const TInt, aCallId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::SendMessage
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::SendMessage( 
+        MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        TInt aErrorCode )
+    {
+    SMC_MOCK_METHOD2( void, MEngineMonitor::TPEMessagesFromPhoneEngine, aMessage, 
+        TInt, aErrorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringIn
+// -----------------------------------------------------------------------------
+//
+TLogString & CPELogHandling::LogStringIn(  )
+    {
+    SMC_MOCK_METHOD0( TLogString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringOut
+// -----------------------------------------------------------------------------
+//
+TLogString & CPELogHandling::LogStringOut(  )
+    {
+    SMC_MOCK_METHOD0( TLogString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringMissed
+// -----------------------------------------------------------------------------
+//
+TLogString & CPELogHandling::LogStringMissed(  )
+    {
+    SMC_MOCK_METHOD0( TLogString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringDelivery
+// -----------------------------------------------------------------------------
+//
+TLogString & CPELogHandling::LogStringDelivery(  )
+    {
+    SMC_MOCK_METHOD0( TLogString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringInAlt
+// -----------------------------------------------------------------------------
+//
+TLogString & CPELogHandling::LogStringInAlt(  )
+    {
+    SMC_MOCK_METHOD0( TLogString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringOutAlt
+// -----------------------------------------------------------------------------
+//
+TLogString & CPELogHandling::LogStringOutAlt(  )
+    {
+    SMC_MOCK_METHOD0( TLogString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::LogStringUnknown
+// -----------------------------------------------------------------------------
+//
+TLogString & CPELogHandling::LogStringUnknown(  )
+    {
+    SMC_MOCK_METHOD0( TLogString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPELogHandling::ResetMissedCalls
+// -----------------------------------------------------------------------------
+//
+void CPELogHandling::ResetMissedCalls( 
+        const TInt aCallId )
+    {
+    SMC_MOCK_METHOD1( void, const TInt, aCallId )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/mocks/mock_cpeloghandlingcommand.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPELogHandlingCommand class  
+
+*
+*/
+
+
+// INCLUDE FILES
+#include <smcmockclassincludes.h>
+#include "CPELogHandlingCommand.h"
+#include "CPELogHandling.h"
+#include <PEVirtualEngine.h>
+#include <TALogger.h>
+#include <LogWrap.h>
+#include <LogCli.h>
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None. 
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::CPELogHandlingCommand
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+CPELogHandlingCommand::CPELogHandlingCommand
+        ( 
+        CPELogHandling& aOwner,                   //The owner of this object
+        CLogClient& aLogClient                    //The log client
+        ) : CActive( EPriorityStandard ),
+            iOwner( aOwner),
+            iLogClient( aLogClient )
+    {
+    }
+
+// Destructor
+CPELogHandlingCommand::~CPELogHandlingCommand
+    (
+    // None.
+    )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::AddEvent
+// Adds an event to the log
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+TInt CPELogHandlingCommand::AddEvent
+        (
+        CLogEvent& aLogEvent
+        )
+    { 
+    SMC_MOCK_METHOD1( TInt, CLogEvent& , aLogEvent)     
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::ChangeEvent
+// Updates an event in the log
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+TInt CPELogHandlingCommand::ChangeEvent
+        (
+        const CLogEvent& aLogEvent
+        )
+    { 
+    SMC_MOCK_METHOD1( TInt, CLogEvent& , aLogEvent)     
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::RunL
+// Description: Method gets notification from etel that asyncronous request is completed.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPELogHandlingCommand::RunL
+        (
+        // None.
+        )
+    {
+    SMC_MOCK_METHOD0( void ) 
+    }
+
+// -----------------------------------------------------------------------------
+// CPELogHandlingCommand::DoCancel
+// Cancels request to the log client
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*****************************************************
+*    Series 60 Customer / LOGENG
+*    Series 60  LOGENG API
+*****************************************************/
+void CPELogHandlingCommand::DoCancel
+        (
+        // None.
+        )
+    {
+    SMC_MOCK_METHOD0( void ) 
+    }
+
+
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/mocks/mock_cpeloginfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,427 @@
+/*
+* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPELogInfo class 
+*                member functions.
+*
+*/
+
+//  INCLUDE FILES
+#include <smcmockclassincludes.h>
+#include "cpeloginfo.h"
+#include "talogger.h"
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo* CPELogInfo::NewL()
+    {
+    return new( ELeave ) CPELogInfo();
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo::~CPELogInfo()
+    {
+    delete iContactLink;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo::CPELogInfo() : iEventType( CPELogInfo::EPEUnknownEvent ),
+    iCallDirection( RMobileCall::EDirectionUnknown ),
+    iCallId( KPECallIdNotUsed ),
+    iCallState( EPEStateUnknown ),
+    iCurrentLine( CCCECallParameters::ECCELineTypePrimary ), 
+    iPhoneNumberId( EPEUnknownNumber )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Set basic event data, guarantees data existence
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetEventData( 
+    TInt aCallId, 
+    const MPEDataStore& aDataStore )
+    {
+    SMC_MOCK_METHOD2( void, TInt, aCallId, const MPEDataStore&, aDataStore )	    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::CopyL( const CPELogInfo& aLogInfo )
+    {
+    SMC_MOCK_METHOD1( void, const CPELogInfo&, aLogInfo )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::Reset()
+    {
+    SMC_MOCK_METHOD0( void )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetEventType( TPELogEventType aEventType )
+    {
+    SMC_MOCK_METHOD1( void, TPELogEventType, aEventType )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CPELogInfo::TPELogEventType CPELogInfo::EventType() const
+    {
+    SMC_MOCK_METHOD0( CPELogInfo::TPELogEventType )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallDirection( RMobileCall::TMobileCallDirection aCallDirection )
+    {
+    SMC_MOCK_METHOD1( void, RMobileCall::TMobileCallDirection, aCallDirection )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+RMobileCall::TMobileCallDirection CPELogInfo::CallDirection() const
+    {
+    SMC_MOCK_METHOD0( RMobileCall::TMobileCallDirection )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallId( TInt aCallId )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aCallId )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CPELogInfo::CallId() const
+    {
+    SMC_MOCK_METHOD0( TInt )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber )
+    {
+    SMC_MOCK_METHOD1( void, TPEPhoneNumber&, aPhoneNumber )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPELogInfo::PhoneNumber() const
+    {
+    SMC_MOCK_METHOD0( TPEPhoneNumber& ) 
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetName( const TPEContactName& aName )
+    {
+    SMC_MOCK_METHOD1( void, TPEContactName&, aName )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEContactName& CPELogInfo::Name() const
+    {
+    SMC_MOCK_METHOD0( TPEContactName& )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallState( TPEState aCallState )
+    {
+    SMC_MOCK_METHOD1( void, TPEState, aCallState )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TPEState CPELogInfo::CallState() const
+    {
+    SMC_MOCK_METHOD0( TPEState )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetDuration( TTimeIntervalSeconds aDuration )
+    {
+    SMC_MOCK_METHOD1( void, TTimeIntervalSeconds, aDuration )	
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TTimeIntervalSeconds CPELogInfo::Duration() const
+    {
+    SMC_MOCK_METHOD0( TTimeIntervalSeconds )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCurrentLine( CCCECallParameters::TCCELineType aCurrentLine )
+    {
+    SMC_MOCK_METHOD1( void, CCCECallParameters::TCCELineType, aCurrentLine )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CCCECallParameters::TCCELineType CPELogInfo::CurrentLine() const
+    {
+    SMC_MOCK_METHOD0( CCCECallParameters::TCCELineType )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetPhoneNumberId( TPEPhoneNumberIdType aPhoneNumberId )
+    {
+    SMC_MOCK_METHOD1( void, TPEPhoneNumberIdType, aPhoneNumberId )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TPEPhoneNumberIdType CPELogInfo::PhoneNumberId() const
+    {
+    SMC_MOCK_METHOD0( TPEPhoneNumberIdType )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetLoggingEnabled( TBool aLoggingEnabled )
+    {
+    SMC_MOCK_METHOD1( void, TBool, aLoggingEnabled )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CPELogInfo::LoggingEnabled() const
+    {
+    SMC_MOCK_METHOD0( TBool )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetCallStartTime( TTime aCallStartTime )
+    {
+    SMC_MOCK_METHOD1( void, TTime, aCallStartTime )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TTime CPELogInfo::CallStartTime() const
+    {
+    SMC_MOCK_METHOD0( TTime )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetMissedCall( TBool aMissedCall )
+    {
+    SMC_MOCK_METHOD1( void, TBool, aMissedCall )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CPELogInfo::MissedCall() const
+    {
+    SMC_MOCK_METHOD0( TBool )
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetForcedCompletion( TBool aForcedCompletion )
+    {
+    SMC_MOCK_METHOD1( void, TBool, aForcedCompletion )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CPELogInfo::ForcedCompletion() const
+    {
+    SMC_MOCK_METHOD0( TBool )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetServiceId( TUint32 aServiceId )
+    {
+    SMC_MOCK_METHOD1( void, TUint32, aServiceId )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TUint32 CPELogInfo::ServiceId() const
+    {
+    SMC_MOCK_METHOD0( TUint32 )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetVoipAddress( const TPEPhoneNumber& aVoipAddress )
+    {
+    SMC_MOCK_METHOD1( void, TPEPhoneNumber&, aVoipAddress )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPELogInfo::VoipAddress() const
+    {
+    SMC_MOCK_METHOD0( TPEPhoneNumber& )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetMyAddress( const TPEPhoneNumber& aMyAddress )
+    {
+    SMC_MOCK_METHOD1( void, TPEPhoneNumber&, aMyAddress )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const TPEPhoneNumber& CPELogInfo::MyAddress() const
+    {
+    SMC_MOCK_METHOD0( TPEPhoneNumber& )
+    }
+
+
+// ---------------------------------------------------------------------------
+// Save contact link. Ownership is transferred.
+// ---------------------------------------------------------------------------
+//
+void CPELogInfo::SetContactLink( const HBufC8* aContactLink )
+    {
+    SMC_MOCK_METHOD1( void, const HBufC8*, aContactLink )
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const HBufC8& CPELogInfo::ContactLink() const
+    {
+    SMC_MOCK_METHOD0( const HBufC8& )
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/run_auto_tests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,228 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\..\..\src\*
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set REMOVETESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb.test --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_MOVE_DLL=\epoc32\release\winscw\udeb\z\sys\bin
+set PATH_TO_COVERAGE_DATA=\coverage_data
+
+
+if not exist %PATH_TO_DLL%\eunitexerunner.exe  ( 
+echo EUnit not installed! 
+goto end
+)
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+set REMOVETESTS=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+set REMOVETESTS=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+call :move
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%REMOVETESTS%] EQU [TRUE] (
+call :removetests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1\group
+call sbs --config winscw_udeb.test --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i m -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function MOVE
+::
+:: moves compiled tests to eunit directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:MOVE
+echo Moving tests
+call move %PATH_TO_DLL%\ut_*.dll %PATH_TO_MOVE_DLL%
+call move %PATH_TO_DLL%\mt_*.dll %PATH_TO_MOVE_DLL%
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: Runs tests in eunit directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\eunitexerunner.exe -dtextshell --
+copy \epoc32\winscw\c\shared\EUnit\Logs\EUnit_log.xml \lastrun_EUnit_log.xml
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVETESTS
+::
+:: Removes tests from eunit directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVETESTS
+echo Removing Test dlls
+call sleep 3
+call del %PATH_TO_MOVE_DLL%\t_*.dll
+call del %PATH_TO_MOVE_DLL%\mt_*.dll
+call del %PATH_TO_MOVE_DLL%\ut_*.dll
+call del %PATH_TO_MOVE_DLL%\it_*.dll
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogevent/bwins/ut_cpelogeventu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+	?SaveCallEntry@CPELogHandling@@UAEHH@Z @ 2 NONAME ; int CPELogHandling::SaveCallEntry(int)
+	??1CPELogHandling@@UAE@XZ @ 3 NONAME ; CPELogHandling::~CPELogHandling(void)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogevent/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+
+PRJ_TESTMMPFILES
+ut_cpelogevent.mmp
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogevent/group/ut_cpelogevent.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          UT_CPELogEvent.dll
+TARGETTYPE      dll
+TARGETPATH              /DigiaEUnit/Tests
+
+UID             0x1000af5a 0x01700000
+
+CAPABILITY      ALL -TCB //-DRM
+VENDORID        VID_DEFAULT
+
+SOURCEPATH          ../src
+SOURCE              UT_CPELogEvent.cpp
+SOURCE              UT_CPELogEvent_DllMain.cpp
+
+// mocks
+SOURCEPATH          ../../mocks
+SOURCE              mock_cpeloghandling.cpp
+SOURCE              mock_cpeloginfo.cpp
+SOURCE              mock_cpeloghandlingcommand.cpp
+
+// Sources required by the test suite
+SOURCEPATH          ../../../src
+SOURCE              cpelogevent.cpp
+
+
+USERINCLUDE         ../src
+
+// User include folders required by the tested code
+USERINCLUDE         ../../../inc
+
+APP_LAYER_SYSTEMINCLUDE   // Application layer domain APIs
+SYSTEMINCLUDE       /epoc32/include/ecom
+SYSTEMINCLUDE       /epoc32/include/Digia/EUnit
+SYSTEMINCLUDE       ../../../../loghandling/inc
+SYSTEMINCLUDE       ../../../../inc  // phoneengine inc
+SYSTEMINCLUDE       ../../../../../inc // phone inc
+
+LIBRARY             EUnit.lib
+LIBRARY             EUnitUtil.lib
+LIBRARY             customapi.lib
+LIBRARY             efsrv.lib
+LIBRARY             euser.lib
+LIBRARY             flogger.lib // For logging
+LIBRARY             logcli.lib 
+LIBRARY             logwrap.lib 
+LIBRARY             centralrepository.lib
+LIBRARY             ecom.lib
+LIBRARY             engineinfo.lib
+LIBRARY             serviceprovidersettings.lib
+LIBRARY             symbianmock.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogevent/src/testdefs.h	Fri Jun 04 10:19:18 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: 
+*
+*/
+#ifndef TESTDEFS_H_
+#define TESTDEFS_H_
+
+#include <CEunitAllocTestCaseDecorator.h>
+
+//Is eunit alloc decorator enabled or not.
+class TTestUtils
+    {
+public:
+    static TBool AllocTestEnabled()
+        {
+        CEUnitTestCaseDecorator* decorator 
+            = CEUnitTestCaseDecorator::ActiveTestCaseDecorator( 
+            KEUnitAllocTestCaseDecoratorName );
+        return ( decorator ? ETrue : EFalse );
+        }
+    };
+
+//id for test controller
+const TInt KTestControllerUid = 0xFFFF;
+
+//call id
+TInt const KVoipCallId = 157;
+
+//service id
+TUint32 const KServiceId = 3;
+
+//remote party name match found
+_LIT( KRemotePartyNameMatchFound, "Match" );
+
+//no remote party name found
+_LIT( KRemotePartyNameMatchNotFound, "No Match" );
+
+#endif /*TESTDEFS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogevent/src/ut_cpelogevent.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,564 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <eunitmacros.h>
+#include <eunitdecorators.h>
+#include <csmcmockcontext.h>
+#include <smcdefaultvalue.h>
+#include <msmcmockspecbuilder.h>
+
+#include <cpeengineinfo.h>
+#include <e32cmn.h>
+#include <f32file.h>
+#include <LOGCLI.H>
+#include <LogsApiConsts.h>
+#include <mpedatastore.h>
+
+#include "UT_CPELogEvent.h"
+#include "cpelogexternaldata.h"
+#include "cpeloginfo.h"
+#include "cpeloghandling.h"
+#include "cpeloghandlingcommand.h"
+#include "cpelogevent.h"
+#include "testdefs.h"
+
+const TInt KCallId = 0;
+
+
+TBool AllocTestEnabled()
+    {
+    CEUnitTestCaseDecorator* decorator 
+        = CEUnitTestCaseDecorator::ActiveTestCaseDecorator( 
+        KEUnitAllocTestCaseDecoratorName );
+    return ( decorator ? ETrue : EFalse );
+    }
+
+// - Construction -----------------------------------------------------------
+UT_CPELogEvent* UT_CPELogEvent::NewL()
+    {
+    UT_CPELogEvent* self = UT_CPELogEvent::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+UT_CPELogEvent* UT_CPELogEvent::NewLC()
+    {
+    UT_CPELogEvent* self = new( ELeave ) UT_CPELogEvent();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+UT_CPELogEvent::~UT_CPELogEvent()
+    {
+    CSmcMockContext::Release();
+    }
+
+TInt UT_CPELogEvent::SaveCallEntry( const TInt aCallId )
+    {
+    TInt id( aCallId );
+    return KErrNone;
+    // derived
+    }
+
+MPEDataStore* UT_CPELogEvent::DataStore()
+    {
+    return iDataStore;
+    }
+void UT_CPELogEvent::HandleInternalMessage( const TInt aMessage )
+    {
+    TInt mes( aMessage );
+    }
+void UT_CPELogEvent::SendMessage( 
+       const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage )
+    {
+    TInt mes(aMessage);
+    }
+void UT_CPELogEvent::SendMessage( 
+       const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+       const TInt aCallId )
+    {
+    TInt mes(aMessage);
+    TInt call(aCallId);
+    }
+MPEExternalDataHandler* UT_CPELogEvent::DataStoreExt()
+    {
+    return NULL;
+    }
+    
+CPERemotePartyInfoMediator* UT_CPELogEvent::MediatorCommunicationHandler()
+    {
+    return NULL;
+    }    
+
+UT_CPELogEvent::UT_CPELogEvent()
+    //iFsSession( *( RFs* )0x1 )
+    {
+    }
+
+void UT_CPELogEvent::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    iMockContext = CSmcMockContext::InstanceL();
+    }
+
+// - Test methods -----------------------------------------------------------
+void UT_CPELogEvent::SetupL(  )
+    {
+    iMockContext->InitializeL();
+    
+    User::LeaveIfError(iFsSession.Connect());
+    iLogClient = CLogClient::NewL( iFsSession );
+    
+    iLogHandlingMock = static_cast<CPELogHandling*>( 
+        CPELogHandling::NewL( *this, iFsSession ) );
+    
+    iLogInfoMock = CPELogInfo::NewL();
+  
+    iLogHCMock = new (ELeave) CPELogHandlingCommand( *static_cast<CPELogHandling*>(iLogHandlingMock), *iLogClient );
+
+    iCPELogEvent = CPELogEvent::NewL( *static_cast<CPELogHandling*>(iLogHandlingMock), *iLogHCMock );
+    iDataStore = static_cast<MPEDataStore*>( CPEEngineInfo::NewL() );
+    
+    _LIT( KBuf, "Number" );
+    TBuf<10> buf;
+    buf.Append( KBuf );
+    iDataStore->SetRemotePhoneNumber( buf, 0 );
+    iDataStore->SetServiceId( KServiceId, 0 );
+    iDataStore->SetCallType( EPECallTypeVoIP, 0 );
+    }
+
+void UT_CPELogEvent::Teardown(  )
+    {   
+    delete iLogInfoMock;
+    iLogInfoMock = NULL;
+    delete iLogHandlingMock;
+    iLogHandlingMock = NULL;
+    delete iLogClient;
+    iLogClient = NULL;
+    delete iCPELogEvent; 
+    iCPELogEvent = NULL; 
+    delete iLogHCMock;
+    iLogHCMock = NULL;
+    delete static_cast<CPEEngineInfo*>( iDataStore );
+    iDataStore = NULL;
+    iFsSession.Close();
+    iMockContext->Reset();
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_CallIdL()
+
+    {
+    iMockContext->ExpectCallL( "CPELogInfo::CallId" );
+    
+    iCPELogEvent->CallId( );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );  
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_UpdateLogInfoL(  )
+    {    
+    iMockContext->ExpectCallL( "CPELogInfo::CopyL" );
+        
+    iCPELogEvent->UpdateLogInfoL( *iLogInfoMock );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );  
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_ResetLogInfoL(  )
+    {
+    iMockContext->ExpectCallL( "CPELogInfo::Reset" );
+        
+    iCPELogEvent->ResetLogInfo( );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );  
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_IsCompletedL(  )
+    {
+    if ( iCPELogEvent->IsCompleted( ) )
+        {
+        EUNIT_FAIL_TEST( "IsCompleted FAILED return value!");
+        }
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_SaveLeaveL(  )
+    {
+    if ( iCPELogEvent->SaveLeave( ) )
+        {
+        EUNIT_FAIL_TEST( "SaveLeave FAILED wrong return value!");
+        }
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    }
+    
+void UT_CPELogEvent::T_CPELogEvent_SaveLL(  )
+    {
+    TLogString test;
+    _LIT( KMyAddress, "myaddress@domain.com" );
+    _LIT( KVoipAddress, "remotecontact@domain.com" );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringDelivery" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringOut" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumberId" ).
+        ReturnsL( EPEUnknownNumber );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::EventType" ).
+        ReturnsL( CPELogInfo::EPEVoiceEvent );
+   
+    iMockContext->ExpectCallL( "CPELogInfo::CurrentLine" ).
+        ReturnsL( CCCECallParameters::ECCELineTypePrimary ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::CallDirection" ).
+        ReturnsL( RMobileCall::EMobileOriginated );
+
+    iMockContext->ExpectCallL( "CPELogInfo::Name" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumber" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::VoipAddress" ).
+        ReturnsL( KVoipAddress()).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::MyAddress" ).
+        ReturnsL( KMyAddress()).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::Duration" ).
+        ReturnsL( 0 );
+
+    iMockContext->ExpectCallL( "CPELogInfo::ContactLink").
+        ReturnsL( KNullDesC() ).
+        TimesL( 4 );
+    
+    iMockContext->ExpectCallL( "CPELogHandlingCommand::AddEvent");
+    
+    iCPELogEvent->SaveL();
+       
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() ); 
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_SaveL2L(  )
+    {
+    TLogString test;
+    _LIT( KMyAddress, "myaddress@domain.com" );
+    _LIT( KVoipAddress, "remotecontact@domain.com" );
+
+    iMockContext->ExpectCallL( "CPELogInfo::CallState" ).
+        ReturnsL( EPEStateIdle ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringDelivery" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringOutAlt" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumberId" ).
+        ReturnsL( EPEUnknownNumber );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::EventType" ).
+        ReturnsL( CPELogInfo::EPEVoIPEvent );
+  
+    iMockContext->ExpectCallL( "CPELogInfo::CurrentLine" ).
+        ReturnsL( CCCECallParameters::ECCELineTypeAux ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::CallDirection" ).
+        ReturnsL( RMobileCall::EMobileOriginated );
+
+    iMockContext->ExpectCallL( "CPELogInfo::Name" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumber" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::VoipAddress" ).
+        ReturnsL( KVoipAddress()).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::MyAddress" ).
+        ReturnsL( KMyAddress()).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::Duration" ).
+        ReturnsL( 0 );
+
+    iMockContext->ExpectCallL( "CPELogInfo::ContactLink").
+        ReturnsL( KNullDesC() ).
+        TimesL( 4 );
+    
+    iMockContext->ExpectCallL( "CPELogHandlingCommand::AddEvent");
+     
+    iCPELogEvent->SaveL();
+       
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() ); 
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_SaveL3L(  )
+    {
+    TLogString test;
+    _LIT( KMyAddress, "myaddress@domain.com" );
+    _LIT( KVoipAddress, "remotecontact@domain.com" );
+
+    iMockContext->ExpectCallL( "CPELogInfo::ForcedCompletion" ).
+        ReturnsL( ETrue );
+   
+    iMockContext->ExpectCallL( "CPELogInfo::CurrentLine" ).
+        ReturnsL( CCCECallParameters::ECCELineTypePrimary ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::CallDirection" ).
+        ReturnsL( RMobileCall::EMobileTerminated ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringIn" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringDelivery" ).
+        ReturnsL( test );
+
+    iMockContext->ExpectCallL( "CPELogInfo::Name" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumber" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::VoipAddress" ).
+        ReturnsL( KVoipAddress()).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::MyAddress" ).
+        ReturnsL( KMyAddress()).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::Duration" ).
+        ReturnsL( 0 );
+    
+    iMockContext->ExpectCallL( "CPELogHandlingCommand::ChangeEvent");
+    
+    iCPELogEvent->SetAdded();
+ 
+    iCPELogEvent->SaveL();
+       
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() ); 
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_SaveL4L(  )
+    {
+    TLogString test;
+    _LIT( KVoipAddress, "remotecontact@domain.com" );
+
+    iMockContext->ExpectCallL( "CPELogInfo::CallState" ).
+        ReturnsL( EPEStateIdle );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringDelivery" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringMissed" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumberId" ).
+        ReturnsL( EPEUnknownNumber );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::EventType" ).
+        ReturnsL( CPELogInfo::EPEVideoCallEvent );
+  
+    iMockContext->ExpectCallL( "CPELogInfo::CurrentLine" ).
+        ReturnsL( CCCECallParameters::ECCELineTypeAux );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::CallDirection" ).
+        ReturnsL( RMobileCall::EMobileTerminated ).
+        TimesL( 2 );
+
+    iMockContext->ExpectCallL( "CPELogInfo::Name" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumber" ).
+        ReturnsL( KNullDesC() );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::VoipAddress" ).
+        ReturnsL( KVoipAddress()).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::MyAddress" ).
+        ReturnsL( KNullDesC());
+    
+    iMockContext->ExpectCallL( "CPELogInfo::Duration" ).
+        ReturnsL( 0 );
+
+    iMockContext->ExpectCallL( "CPELogInfo::ContactLink").
+        ReturnsL( KNullDesC() ).
+        TimesL( 4 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::CallState" ).
+        ReturnsL( EPEStateIdle ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::MissedCall" ).
+        ReturnsL( ETrue );
+    
+    iMockContext->ExpectCallL( "CPELogHandlingCommand::AddEvent");
+     
+    iCPELogEvent->SaveL();
+       
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() ); 
+    }
+
+void UT_CPELogEvent::T_CPELogEvent_SaveL5L(  )
+    {
+    TLogString test;
+
+    _LIT( KMyNumber, "040665544" );
+    _LIT( KMyName, "Tester" );
+
+    iMockContext->ExpectCallL( "CPELogInfo::CallState" ).
+        ReturnsL( EPEStateIdle );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringDelivery" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogHandling::LogStringInAlt" ).
+        ReturnsL( test );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumberId" ).
+        ReturnsL( EPEUnknownNumber );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::EventType" ).
+        ReturnsL( CPELogInfo::EPEUnknownEvent );
+  
+    iMockContext->ExpectCallL( "CPELogInfo::CurrentLine" ).
+        ReturnsL( CCCECallParameters::ECCELineTypeAux ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::CallDirection" ).
+        ReturnsL( RMobileCall::EMobileTerminated ).
+        TimesL( 2 );
+
+    iMockContext->ExpectCallL( "CPELogInfo::Name" ).
+        ReturnsL( KMyName() ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::PhoneNumber" ).
+        ReturnsL( KMyNumber() ).
+        TimesL( 2 );
+    
+    iMockContext->ExpectCallL( "CPELogInfo::VoipAddress" ).
+        ReturnsL(  KNullDesC());
+    
+    iMockContext->ExpectCallL( "CPELogInfo::MyAddress" ).
+        ReturnsL( KNullDesC());
+    
+    iMockContext->ExpectCallL( "CPELogInfo::Duration" ).
+        ReturnsL( 0 );
+
+    iMockContext->ExpectCallL( "CPELogInfo::ContactLink").
+        ReturnsL( KNullDesC() ).
+        TimesL( 4 );
+    
+    iMockContext->ExpectCallL( "CPELogHandlingCommand::AddEvent");
+     
+    iCPELogEvent->SaveL();
+       
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() ); 
+    }
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+    UT_CPELogEvent,
+    "Add test suite description here.",
+    "UNIT" )
+
+EUNIT_TEST(
+    "CallId - test1",
+    "CPELogEvent",
+    "CallId - test1",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_CallIdL, Teardown)
+   
+EUNIT_TEST(
+    "UpdateLogInfo - test2",
+    "CPELogEvent",
+    "UpdateLogInfo - test2",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_UpdateLogInfoL, Teardown)
+    
+EUNIT_TEST(
+    "ResetLogInfo - test3",
+    "CPELogEvent",
+    "ResetLogInfo - test3",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_ResetLogInfoL, Teardown)
+    
+EUNIT_TEST(
+    "IsCompleted - test4",
+    "CPELogEvent",
+    "IsCompleted - test4",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_IsCompletedL, Teardown)
+    
+EUNIT_TEST(
+    "SaveLeave - test5",
+    "CPELogEvent",
+    "SaveLeave - test5",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_SaveLeaveL, Teardown)
+    
+EUNIT_TEST(
+    "SaveL - test6",
+    "CPELogEvent",
+    "SaveL - test6",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_SaveLL, Teardown)
+    
+EUNIT_TEST(
+    "SaveL 2 - test7",
+    "CPELogEvent",
+    "SaveL 2 - test7",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_SaveL2L, Teardown)
+    
+EUNIT_TEST(
+    "SaveL 3 - test8",
+    "CPELogEvent",
+    "SaveL 3 - test8",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_SaveL3L, Teardown)
+    
+EUNIT_TEST(
+    "SaveL 4 - test9",
+    "CPELogEvent",
+    "SaveL 4 - test9",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_SaveL4L, Teardown)
+    
+EUNIT_TEST(
+    "SaveL 5 - test10",
+    "CPELogEvent",
+    "SaveL 5 - test10",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogEvent_SaveL5L, Teardown)  
+
+EUNIT_END_TEST_TABLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogevent/src/ut_cpelogevent.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef __UT_CPELOGEVENT_H__
+#define __UT_CPELOGEVENT_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include "MPEPhoneModelInternal.h"
+
+// FORWARD DECLARATIONS
+class CPELogExternalData;
+class CPELogHandling;
+class CPEEngineInfo;
+class CSmcMockContext;
+class CRepository;
+class MPEDataStore;
+
+class CPELogEvent;
+class CPELogHandlingCommand;
+class CLogClient;
+class CPELogInfo;
+
+
+
+
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( UT_CPELogEvent )
+    : public CEUnitTestSuiteClass, public MPEPhoneModelInternal
+    {
+    public:  // Constructors and destructor
+
+        static UT_CPELogEvent* NewL();
+        static UT_CPELogEvent* NewLC();
+        ~UT_CPELogEvent();
+ 
+        TInt SaveCallEntry( const TInt aCallId );
+        
+        MPEDataStore* DataStore();    
+        void HandleInternalMessage( const TInt aMessage );
+        void SendMessage( 
+               const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+        void SendMessage( 
+               const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+               const TInt aCallId );
+        MPEExternalDataHandler* DataStoreExt();
+        CPERemotePartyInfoMediator* MediatorCommunicationHandler();
+        
+
+    private: // Constructors
+
+        UT_CPELogEvent();
+        void ConstructL();
+
+    private: // New methods
+        
+         void SetupL();
+        
+         void Teardown();
+	   
+         void T_CPELogEvent_CallIdL();
+        
+         void T_CPELogEvent__CPELogEventL();
+        
+         void T_CPELogEvent_SaveLL();
+         
+         void T_CPELogEvent_UpdateLogInfoL();
+        
+         void T_CPELogEvent_ResetLogInfoL();
+                        
+         void T_CPELogEvent_IsCompletedL();
+        
+         void T_CPELogEvent_SetPhoneNumberIdL();
+        
+         void T_CPELogEvent_SaveLeaveL();
+         
+         void T_CPELogEvent_SaveL2L();
+         
+         void T_CPELogEvent_SaveL3L();
+         
+         void T_CPELogEvent_SaveL4L();
+         
+         void T_CPELogEvent_SaveL5L();
+
+    private: // Data
+
+        CPELogEvent* iCPELogEvent;
+        CPELogInfo* iLogInfoMock;
+        CPELogHandlingCommand* iLogHCMock;
+        CLogClient* iLogClient;
+        RFs iFsSession;
+        MPEDataStore* iDataStore;   
+        CSmcMockContext* iMockContext;
+        CPELogHandling* iLogHandlingMock;
+
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  __UT_CPELOGEVENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogevent/src/ut_cpelogevent_dllmain.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "UT_CPELogEvent.h"
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return UT_CPELogEvent::NewL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogexternaldata/bwins/ut_cpelogexternaldatau.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,50 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * __cdecl CreateTestSuiteL(void)
+	??1CRepository@@UAE@XZ @ 2 NONAME ; CRepository::~CRepository(void)
+	?StartTransaction@CRepository@@QAEHW4TTransactionMode@1@@Z @ 3 NONAME ; int CRepository::StartTransaction(enum CRepository::TTransactionMode)
+	?Reset@CRepository@@QAEHK@Z @ 4 NONAME ; int CRepository::Reset(unsigned long)
+	?Move@CRepository@@QAEHKKKAAK@Z @ 5 NONAME ; int CRepository::Move(unsigned long, unsigned long, unsigned long, unsigned long &)
+	?NewLC@CRepository@@SAPAV1@VTUid@@@Z @ 6 NONAME ; class CRepository * CRepository::NewLC(class TUid)
+	?Create@CRepository@@QAEHKABVTDesC8@@@Z @ 7 NONAME ; int CRepository::Create(unsigned long, class TDesC8 const &)
+	?Set@CRepository@@QAEHKABVTDesC8@@@Z @ 8 NONAME ; int CRepository::Set(unsigned long, class TDesC8 const &)
+	?CleanupFailTransactionPushL@CRepository@@QAEXXZ @ 9 NONAME ; void CRepository::CleanupFailTransactionPushL(void)
+	?Reset@CRepository@@QAEHXZ @ 10 NONAME ; int CRepository::Reset(void)
+	?NotifyCancel@CRepository@@QAEHK@Z @ 11 NONAME ; int CRepository::NotifyCancel(unsigned long)
+	?Delete@CRepository@@QAEHK@Z @ 12 NONAME ; int CRepository::Delete(unsigned long)
+	?Create@CRepository@@QAEHKH@Z @ 13 NONAME ; int CRepository::Create(unsigned long, int)
+	?CancelTransaction@CRepository@@QAEXXZ @ 14 NONAME ; void CRepository::CancelTransaction(void)
+	?CommitTransaction@CRepository@@QAEXAAVTDes8@@AAVTRequestStatus@@@Z @ 15 NONAME ; void CRepository::CommitTransaction(class TDes8 &, class TRequestStatus &)
+	?SaveCallEntry@CPELogHandling@@UAEHH@Z @ 16 NONAME ; int CPELogHandling::SaveCallEntry(int)
+	?Get@CRepository@@QAEHKAAVTDes8@@@Z @ 17 NONAME ; int CRepository::Get(unsigned long, class TDes8 &)
+	?Create@CRepository@@QAEHKABVTDesC16@@@Z @ 18 NONAME ; int CRepository::Create(unsigned long, class TDesC16 const &)
+	?FindEqL@CRepository@@QAEHKKABNAAV?$RArray@K@@@Z @ 19 NONAME ; int CRepository::FindEqL(unsigned long, unsigned long, double const &, class RArray<unsigned long> &)
+	?NewL@CRepository@@SAPAV1@VTUid@@@Z @ 20 NONAME ; class CRepository * CRepository::NewL(class TUid)
+	?NotifyCancelAll@CRepository@@QAEHXZ @ 21 NONAME ; int CRepository::NotifyCancelAll(void)
+	?Get@CRepository@@QAEHKAAH@Z @ 22 NONAME ; int CRepository::Get(unsigned long, int &)
+	??1CPELogHandling@@UAE@XZ @ 23 NONAME ; CPELogHandling::~CPELogHandling(void)
+	?Get@CRepository@@QAEHKAAVTDes16@@AAH@Z @ 24 NONAME ; int CRepository::Get(unsigned long, class TDes16 &, int &)
+	?Get@CRepository@@QAEHKAAVTDes8@@AAH@Z @ 25 NONAME ; int CRepository::Get(unsigned long, class TDes8 &, int &)
+	?CleanupCancelTransactionPushL@CRepository@@QAEXXZ @ 26 NONAME ; void CRepository::CleanupCancelTransactionPushL(void)
+	?FindNeqL@CRepository@@QAEHKKABNAAV?$RArray@K@@@Z @ 27 NONAME ; int CRepository::FindNeqL(unsigned long, unsigned long, double const &, class RArray<unsigned long> &)
+	?Set@CRepository@@QAEHKH@Z @ 28 NONAME ; int CRepository::Set(unsigned long, int)
+	?FailTransaction@CRepository@@QAEXXZ @ 29 NONAME ; void CRepository::FailTransaction(void)
+	?Get@CRepository@@QAEHKAAVTDes16@@@Z @ 30 NONAME ; int CRepository::Get(unsigned long, class TDes16 &)
+	?FindL@CRepository@@QAEHKKAAV?$RArray@K@@@Z @ 31 NONAME ; int CRepository::FindL(unsigned long, unsigned long, class RArray<unsigned long> &)
+	?FindNeqL@CRepository@@QAEHKKABVTDesC16@@AAV?$RArray@K@@@Z @ 32 NONAME ; int CRepository::FindNeqL(unsigned long, unsigned long, class TDesC16 const &, class RArray<unsigned long> &)
+	?FindNeqL@CRepository@@QAEHKKHAAV?$RArray@K@@@Z @ 33 NONAME ; int CRepository::FindNeqL(unsigned long, unsigned long, int, class RArray<unsigned long> &)
+	?NotifyRequest@CRepository@@QAEHKAAVTRequestStatus@@@Z @ 34 NONAME ; int CRepository::NotifyRequest(unsigned long, class TRequestStatus &)
+	?Get@CRepository@@QAEHKAAN@Z @ 35 NONAME ; int CRepository::Get(unsigned long, double &)
+	?Set@CRepository@@QAEHKABVTDesC16@@@Z @ 36 NONAME ; int CRepository::Set(unsigned long, class TDesC16 const &)
+	?NotifyRequest@CRepository@@QAEHKKAAVTRequestStatus@@@Z @ 37 NONAME ; int CRepository::NotifyRequest(unsigned long, unsigned long, class TRequestStatus &)
+	?FindNeqL@CRepository@@QAEHKKABVTDesC8@@AAV?$RArray@K@@@Z @ 38 NONAME ; int CRepository::FindNeqL(unsigned long, unsigned long, class TDesC8 const &, class RArray<unsigned long> &)
+	?Create@CRepository@@QAEHKABN@Z @ 39 NONAME ; int CRepository::Create(unsigned long, double const &)
+	?Set@CRepository@@QAEHKABN@Z @ 40 NONAME ; int CRepository::Set(unsigned long, double const &)
+	?FindEqL@CRepository@@QAEHKKHAAV?$RArray@K@@@Z @ 41 NONAME ; int CRepository::FindEqL(unsigned long, unsigned long, int, class RArray<unsigned long> &)
+	?FindEqL@CRepository@@QAEHKKABVTDesC8@@AAV?$RArray@K@@@Z @ 42 NONAME ; int CRepository::FindEqL(unsigned long, unsigned long, class TDesC8 const &, class RArray<unsigned long> &)
+	?StartTransaction@CRepository@@QAEXW4TTransactionMode@1@AAVTRequestStatus@@@Z @ 43 NONAME ; void CRepository::StartTransaction(enum CRepository::TTransactionMode, class TRequestStatus &)
+	?NotifyCancel@CRepository@@QAEHKK@Z @ 44 NONAME ; int CRepository::NotifyCancel(unsigned long, unsigned long)
+	?FindEqL@CRepository@@QAEHKKABVTDesC16@@AAV?$RArray@K@@@Z @ 45 NONAME ; int CRepository::FindEqL(unsigned long, unsigned long, class TDesC16 const &, class RArray<unsigned long> &)
+	?Delete@CRepository@@QAEHKKAAK@Z @ 46 NONAME ; int CRepository::Delete(unsigned long, unsigned long, unsigned long &)
+	?CommitTransaction@CRepository@@QAEHAAK@Z @ 47 NONAME ; int CRepository::CommitTransaction(unsigned long &)
+	?GetMeta@CRepository@@QAEHKAAK@Z @ 48 NONAME ; int CRepository::GetMeta(unsigned long, unsigned long &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogexternaldata/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+
+//../../../../group/loghandling.mmp
+
+PRJ_TESTMMPFILES
+UT_CPELogExternalData.mmp
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogexternaldata/group/ut_cpelogexternaldata.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET              UT_CPELogExternalData.dll
+TARGETTYPE          dll
+UID                 0x1000af5a 0x01700000
+
+CAPABILITY          ALL -TCB //-DRM
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+SOURCE              UT_CPELogExternalData.cpp
+SOURCE              UT_CPELogExternalData_DllMain.cpp
+
+// Sources required by the test suite
+SOURCEPATH          ../../../src
+SOURCE              peloghandlingpanic.cpp
+SOURCE              cpelogexternaldata.cpp
+SOURCE              cpeloginfo.cpp
+
+// mocks
+SOURCEPATH          ../../mocks
+SOURCE              mock_centralrepository.cpp
+SOURCE              mock_cpeloghandling.cpp
+
+// User include folders required by the tested code
+USERINCLUDE         ../src
+USERINCLUDE         ../../../../inc
+USERINCLUDE         ../../../../phonemodel/inc
+
+APP_LAYER_SYSTEMINCLUDE   // Application layer domain APIs
+SYSTEMINCLUDE       /epoc32/include/ecom
+SYSTEMINCLUDE       /epoc32/include/Digia/EUnit
+SYSTEMINCLUDE       ../../../../loghandling/inc
+SYSTEMINCLUDE       ../../../../inc  // phoneengine inc
+SYSTEMINCLUDE       ../../../../../inc // phone inc
+
+LIBRARY             EUnit.lib
+LIBRARY             EUnitUtil.lib
+LIBRARY             euser.lib
+LIBRARY             efsrv.lib
+LIBRARY             engineinfo.lib
+LIBRARY             flogger.lib // For logging
+LIBRARY             cce.lib
+LIBRARY             bafl.lib                // Descriptor arrays
+LIBRARY             symbianmock.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogexternaldata/src/ut_cpelogexternaldata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,320 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <EUnitMacros.h>
+#include <EUnitDecorators.h>
+#include <csmcmockcontext.h>
+#include <msmcmockspecbuilder.h>
+#include <centralrepository.h>
+#include <SettingsInternalCRKeys.h>
+#include <LogsDomainCRKeys.h>
+#include "UT_CPELogExternalData.h"
+#include "cpelogexternaldata.h"
+#include "cpeloginfo.h"
+#include "cpeengineinfo.h"
+#include "cpeloghandling.h"
+
+// - Construction -----------------------------------------------------------
+UT_CPELogExternalData* UT_CPELogExternalData::NewL()
+    {
+    UT_CPELogExternalData* self = UT_CPELogExternalData::NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+UT_CPELogExternalData* UT_CPELogExternalData::NewLC()
+    {
+    UT_CPELogExternalData* self = new( ELeave ) UT_CPELogExternalData();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+UT_CPELogExternalData::~UT_CPELogExternalData()
+    {
+    delete iRepositoryMock;
+    CSmcMockContext::Release();
+    }
+
+
+// from MPEPhoneModelInternal
+MPEDataStore* UT_CPELogExternalData::DataStore()
+    {
+    return iEngineInfo;
+    }
+
+
+void UT_CPELogExternalData::HandleInternalMessage( const TInt /*aMessage*/ )
+    {
+    }
+
+
+void UT_CPELogExternalData::SendMessage( 
+    const MEngineMonitor::TPEMessagesFromPhoneEngine /*aMessage*/ )
+    {
+    }
+
+
+void UT_CPELogExternalData::SendMessage( 
+    const MEngineMonitor::TPEMessagesFromPhoneEngine /*aMessage*/, 
+    const TInt /*aCallId*/ )
+    {
+    }
+
+
+MPEExternalDataHandler* UT_CPELogExternalData::DataStoreExt()
+    {
+    return NULL;
+    }
+
+CPERemotePartyInfoMediator* UT_CPELogExternalData::MediatorCommunicationHandler()
+    {
+    return NULL;
+    } 
+
+UT_CPELogExternalData::UT_CPELogExternalData()
+    {
+    }
+
+
+void UT_CPELogExternalData::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    iMockContext = CSmcMockContext::InstanceL();
+    }
+
+
+// - Test methods -----------------------------------------------------------
+void UT_CPELogExternalData::SetupL(  )
+    {
+    iMockContext->InitializeL();
+    
+    User::LeaveIfError( iFsSession.Connect() );
+    iEngineInfo = CPEEngineInfo::NewL();
+    iEngineInfo->SetCallType( EPECallTypeVoIP, 0 );
+    
+    iLogHandlingMock = static_cast<CPELogHandling*>( 
+        CPELogHandling::NewL( *this, iFsSession ) );
+    iCPELogExternalData = CPELogExternalData::NewL( *iLogHandlingMock );
+    
+    iRepositoryMock = CRepository::NewL( KCRUidLogs );
+    }
+
+
+void UT_CPELogExternalData::Teardown(  )
+    {
+    delete iCPELogExternalData; 
+    iCPELogExternalData = NULL;
+    delete iEngineInfo;
+    iEngineInfo = NULL;
+    iFsSession.Close();
+    
+    delete iLogHandlingMock; 
+    iLogHandlingMock = NULL;
+    delete iRepositoryMock;
+    iRepositoryMock = NULL;
+    
+    iMockContext->Reset();
+    }
+
+
+void UT_CPELogExternalData::T_UpdateCallTimersL(  )
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+    const TInt KDuration = 1000000;
+    info->SetDuration( KDuration );
+    
+    // 1) case
+    info->SetCurrentLine( CCCECallParameters::ECCELineTypePrimary );
+    info->SetCallDirection( RMobileCall::EMobileOriginated );
+    info->SetEventType( CPELogInfo::EPEVoIPEvent );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsDialledCallsTimerVoIP, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateCallTimers( *info );
+    
+    // 2) case
+    info->SetEventType( CPELogInfo::EPEVoiceEvent );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsDialledCallsTimerLine1, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateCallTimers( *info );
+    
+    // 3) case
+    info->SetCallDirection( RMobileCall::EMobileTerminated );
+    info->SetEventType( CPELogInfo::EPEVoIPEvent );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsReceivedCallsTimerVoIP, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateCallTimers( *info );
+    
+    // 4) case
+    info->SetEventType( CPELogInfo::EPEVoiceEvent );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsReceivedCallsTimerLine1, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateCallTimers( *info );
+    
+    // 5) case
+    info->SetCurrentLine( CCCECallParameters::ECCELineTypeAux );
+    info->SetCallDirection( RMobileCall::EMobileOriginated );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsDialledCallsTimerLine2, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateCallTimers( *info );
+    
+    // 6) case
+    info->SetCallDirection( RMobileCall::EMobileTerminated );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsReceivedCallsTimerLine2, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateCallTimers( *info );
+    
+    // 7) case, error while reading from repository
+    iMockContext->ExpectCallL( "CRepository::Get" ).
+        ReturnsL( KErrGeneral );
+    iMockContext->ExpectCallL( "CRepository::Set" ).TimesL( 0 );
+    iCPELogExternalData->UpdateCallTimers( *info );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    
+    delete info;
+    }
+
+
+void UT_CPELogExternalData::T_UpdateLastCallTimerByLineL(  )
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+    const TInt KDuration = 1000000;
+    info->SetDuration( KDuration );
+    
+    // 1) case, primary line and VoIP call
+    info->SetCurrentLine( CCCECallParameters::ECCELineTypePrimary );
+    info->SetEventType( CPELogInfo::EPEVoIPEvent );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsLastCallTimerVoIP, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateLastCallTimerByLine( *info );
+    
+    // 2) case, primary line and Voice call
+    info->SetEventType( CPELogInfo::EPEVoiceEvent );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsLastCallTimerLine1, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateLastCallTimerByLine( *info );
+    
+    // 3) case, aux line
+    info->SetCurrentLine( CCCECallParameters::ECCELineTypeAux );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsLastCallTimerLine2, KDuration ).
+        ReturnsL( KErrNone );
+    iCPELogExternalData->UpdateLastCallTimerByLine( *info );
+    
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    
+    delete info;
+    }
+
+
+void UT_CPELogExternalData::T_UpdateLastCallTimerL(  )
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+    const TInt KDuration = 1000000;
+    info->SetDuration( KDuration );
+    
+    // 1) case, primary line and VoIP call
+    info->SetCurrentLine( CCCECallParameters::ECCELineTypePrimary );
+    info->SetEventType( CPELogInfo::EPEVoIPEvent );
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        WithL( KLogsActualLastCallTimer, KDuration ).
+        ReturnsL( KErrNone );
+    
+    iCPELogExternalData->UpdateLastCallTimer( *info );
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    
+    delete info;
+    }
+
+void UT_CPELogExternalData::T_IncreaseMissedCallValueL(  )
+    {
+    TInt callId(0);
+ 
+    iMockContext->ExpectCallL( "CRepository::Get" ).
+        ReturnsL( KErrNone );
+    
+    iMockContext->ExpectCallL( "CRepository::Set" ).
+        ReturnsL( KErrNone );
+    
+    iCPELogExternalData->IncreaseMissedCallValue( callId );
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    }
+
+
+void UT_CPELogExternalData::T_SetFirstCallStartTimeL(  )
+    {
+    TTime time( 0 );
+    iCPELogExternalData->SetFirstCallStartTime( time );
+    EUNIT_ASSERT_EQUALS( KErrNone, iMockContext->VerifyExpectations() );
+    }
+
+
+// - EUnit test table -------------------------------------------------------
+EUNIT_BEGIN_TEST_TABLE(
+    UT_CPELogExternalData,
+    "Add test suite description here.",
+    "UNIT" )
+
+EUNIT_TEST(
+    "UpdateCallTimers",
+    "CPELogExternalData",
+    "UpdateCallTimers",
+    "FUNCTIONALITY",
+    SetupL, T_UpdateCallTimersL, Teardown)
+    
+EUNIT_TEST(
+    "UpdateLastCallTimerByLine",
+    "CPELogExternalData",
+    "UpdateLastCallTimerByLine",
+    "FUNCTIONALITY",
+    SetupL, T_UpdateLastCallTimerByLineL, Teardown)
+
+    
+EUNIT_TEST(
+    "UpdateLastCallTimer",
+    "CPELogExternalData",
+    "UpdateLastCallTimer",
+    "FUNCTIONALITY",
+    SetupL, T_UpdateLastCallTimerL, Teardown)
+    
+EUNIT_TEST(
+    "IncreaseMissedCallValue",
+    "CPELogExternalData",
+    "IncreaseMissedCallValue",
+    "FUNCTIONALITY",
+    SetupL, T_IncreaseMissedCallValueL, Teardown)
+    
+EUNIT_TEST(
+    "SetFirstCallStartTime",
+    "CPELogExternalData",
+    "SetFirstCallStartTime",
+    "FUNCTIONALITY",
+    SetupL, T_SetFirstCallStartTimeL, Teardown)
+    
+
+EUNIT_END_TEST_TABLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogexternaldata/src/ut_cpelogexternaldata.h	Fri Jun 04 10:19:18 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 __UT_CPELOGEXTERNALDATA_H__
+#define __UT_CPELOGEXTERNALDATA_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include "MPEPhoneModelInternal.h"
+
+// FORWARD DECLARATIONS
+class CPELogExternalData;
+class CPELogHandling;
+class CPEEngineInfo;
+class CSmcMockContext;
+class CRepository;
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( UT_CPELogExternalData )
+	: public CEUnitTestSuiteClass, public MPEPhoneModelInternal
+    {
+    public:  // Constructors and destructor
+
+        static UT_CPELogExternalData* NewL();
+        static UT_CPELogExternalData* NewLC();
+        ~UT_CPELogExternalData();
+        
+        // from MPEPhoneModelInternal
+        MPEDataStore* DataStore();    
+        void HandleInternalMessage( const TInt aMessage );
+        void SendMessage( 
+               const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+        void SendMessage( 
+               const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+               const TInt aCallId );
+        MPEExternalDataHandler* DataStoreExt();
+        CPERemotePartyInfoMediator* MediatorCommunicationHandler();
+
+    private: // Constructors
+
+        UT_CPELogExternalData();
+        void ConstructL();
+
+    private: // New methods
+
+         void SetupL();
+        
+         void Teardown();
+        
+         void T_UpdateCallTimersL();
+        
+         void T_UpdateLastCallTimerByLineL();
+        
+         void T_UpdateLastCallTimerL();
+        
+         void T_IncreaseMissedCallValueL();
+        
+         void T_SetFirstCallStartTimeL();
+
+    private: // Data
+
+        CPELogExternalData* iCPELogExternalData;
+        RFs iFsSession;
+        CPEEngineInfo* iEngineInfo;
+
+        CSmcMockContext* iMockContext;
+        CPELogHandling* iLogHandlingMock;
+        CRepository* iRepositoryMock;
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  __UT_CPELOGEXTERNALDATA_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpelogexternaldata/src/ut_cpelogexternaldata_dllmain.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "UT_CPELogExternalData.h"
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return UT_CPELogExternalData::NewL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpeloginfo/bwins/ut_cpeloginfou.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpeloginfo/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+
+
+//../../../../group/loghandling.mmp
+
+PRJ_TESTMMPFILES
+UT_CPELogInfo.mmp
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpeloginfo/group/ut_cpeloginfo.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          UT_CPELogInfo.dll
+TARGETTYPE      dll
+UID             0x1000af5a 0x01700000
+
+CAPABILITY      ALL -TCB //-DRM
+VENDORID        VID_DEFAULT
+
+SOURCEPATH          ../src
+SOURCE              UT_CPELogInfo.cpp
+SOURCE              UT_CPELogInfo_DllMain.cpp
+
+// mocks
+//SOURCEPATH          ../../../../../../internal/mocks/phoneengine/loghandling
+//SOURCE              mock_cpeloghandling.cpp
+
+// Sources required by the test suite
+SOURCEPATH          ../../../../loghandling/src
+SOURCE              cpeloginfo.cpp
+
+USERINCLUDE         ../src
+
+// User include folders required by the tested code
+USERINCLUDE         ../../../../inc
+
+APP_LAYER_SYSTEMINCLUDE   // Application layer domain APIs
+SYSTEMINCLUDE       /epoc32/include/ecom
+SYSTEMINCLUDE       /epoc32/include/Digia/EUnit
+SYSTEMINCLUDE       ../../../../loghandling/inc
+SYSTEMINCLUDE       ../../../../inc  // phoneengine inc
+SYSTEMINCLUDE       ../../../../../inc // phone inc
+
+LIBRARY             EUnit.lib
+LIBRARY             EUnitUtil.lib
+LIBRARY             customapi.lib
+LIBRARY             efsrv.lib
+LIBRARY             engineinfo.lib
+LIBRARY             euser.lib
+LIBRARY             flogger.lib // For logging
+LIBRARY             logcli.lib 
+LIBRARY             logwrap.lib 
+LIBRARY             centralrepository.lib
+LIBRARY             ecom.lib
+LIBRARY             serviceprovidersettings.lib
+//LIBRARY             symbianmock.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpeloginfo/src/testdefs.h	Fri Jun 04 10:19:18 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: 
+*
+*/
+#ifndef TESTDEFS_H_
+#define TESTDEFS_H_
+
+#include <CEunitAllocTestCaseDecorator.h>
+
+//Is eunit alloc decorator enabled or not.
+class TTestUtils
+    {
+public:
+    static TBool AllocTestEnabled()
+        {
+        CEUnitTestCaseDecorator* decorator 
+            = CEUnitTestCaseDecorator::ActiveTestCaseDecorator( 
+            KEUnitAllocTestCaseDecoratorName );
+        return ( decorator ? ETrue : EFalse );
+        }
+    };
+
+//id for test controller
+const TInt KTestControllerUid = 0xFFFF;
+
+//call id
+TInt const KVoipCallId = 157;
+
+//service id
+TUint32 const KServiceId = 3;
+
+//remote party name match found
+_LIT( KRemotePartyNameMatchFound, "Match" );
+
+//no remote party name found
+_LIT( KRemotePartyNameMatchNotFound, "No Match" );
+
+#endif /*TESTDEFS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpeloginfo/src/ut_cpeloginfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,577 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <eunitmacros.h>
+#include <eunitdecorators.h>
+#include <csmcmockcontext.h>
+#include <smcdefaultvalue.h>
+#include <msmcmockspecbuilder.h>
+
+#include <e32cmn.h>
+#include <f32file.h>
+#include <LOGCLI.H>
+#include <LogsApiConsts.h>
+#include <cccecallparameters.h>
+#include <cpeengineinfo.h>
+#include <mpedatastore.h>
+
+#include "UT_CPELogInfo.h"
+#include "cpeloginfo.h"
+
+const TInt KCallId = 0;
+
+
+TBool AllocTestEnabled()
+    {
+    CEUnitTestCaseDecorator* decorator 
+        = CEUnitTestCaseDecorator::ActiveTestCaseDecorator( 
+        KEUnitAllocTestCaseDecoratorName );
+    return ( decorator ? ETrue : EFalse );
+    }
+
+// - Construction -----------------------------------------------------------
+UT_CPELogInfo* UT_CPELogInfo::NewL()
+    {
+    UT_CPELogInfo* self = UT_CPELogInfo::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+UT_CPELogInfo* UT_CPELogInfo::NewLC()
+    {
+    UT_CPELogInfo* self = new( ELeave ) UT_CPELogInfo();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+UT_CPELogInfo::~UT_CPELogInfo()
+    {
+    }
+
+TInt UT_CPELogInfo::SaveCallEntry( const TInt aCallId )
+    {
+    TInt id( aCallId );
+    return KErrNone;
+    // derived
+    }
+
+
+MPEDataStore* UT_CPELogInfo::DataStore()
+    {
+    return iDataStore;
+    }
+
+void UT_CPELogInfo::HandleInternalMessage( const TInt aMessage )
+    {
+    TInt mes( aMessage );
+    }
+void UT_CPELogInfo::SendMessage( 
+       const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage )
+    {
+    TInt mes(aMessage);
+    }
+void UT_CPELogInfo::SendMessage( 
+       const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+       const TInt aCallId )
+    {
+    TInt mes(aMessage);
+    TInt call(aCallId);
+    }
+MPEExternalDataHandler* UT_CPELogInfo::DataStoreExt()
+    {
+    return NULL;
+    }
+    
+CPERemotePartyInfoMediator* UT_CPELogInfo::MediatorCommunicationHandler()
+    {
+    return NULL;
+    }        
+
+UT_CPELogInfo::UT_CPELogInfo()
+    //iFsSession( *( RFs* )0x1 )
+    {
+    }
+
+void UT_CPELogInfo::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+// - Test methods -----------------------------------------------------------
+void UT_CPELogInfo::SetupL(  )
+    {
+    }
+
+void UT_CPELogInfo::Teardown(  )
+    {   
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_VoIPAddressL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+    
+    TPEPhoneNumber voipAdderess;
+    voipAdderess.Copy( TPtrC8( ( TText8* )( "remotecontact@domain.com" ) ) );
+ 
+    info->SetVoipAddress(  voipAdderess );
+    
+    if ( voipAdderess != info->VoipAddress() )
+        {
+        EUNIT_FAIL_TEST( "VoIPAddressL FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_EventTypeL()
+    { 
+    CPELogInfo* info = CPELogInfo::NewL();
+  
+    info->SetEventType(  CPELogInfo::EPEVoIPEvent );
+    CPELogInfo::TPELogEventType eventType = info->EventType();
+    
+    if ( CPELogInfo::EPEVoIPEvent != eventType )
+        {
+        EUNIT_FAIL_TEST( "EventTypeL FAILED wrong return value!");
+        }
+    
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_CallDirectionL()
+    { 
+    CPELogInfo* info = CPELogInfo::NewL();
+    info->SetCallDirection(  RMobileCall::EMobileOriginated );
+    
+    if ( RMobileCall::EMobileOriginated != info->CallDirection() )
+        {
+        EUNIT_FAIL_TEST( "CallDirectionL FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_CallIdL()
+    {
+    TInt callId( 2 );
+    CPELogInfo* info = CPELogInfo::NewL();
+    info->SetCallId( callId );
+    
+    if ( callId != info->CallId() )
+        {
+        EUNIT_FAIL_TEST( "CallId FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_PhoneNumberL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL(); 
+    
+    TPEPhoneNumber phoneNumber;
+    phoneNumber.Copy( TPtrC8( ( TText8* )( "0123456789pw*#" ) ) );
+    
+    info->SetPhoneNumber(  phoneNumber );
+    
+    if ( phoneNumber != info->PhoneNumber() )
+        {
+        EUNIT_FAIL_TEST( "PhoneNumber FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_NameL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+
+    TPEContactName name;
+    name.Copy( TPtrC8( ( TText8* )( "Tester 007" ) ) );
+    
+    info->SetName(  name );
+    
+    if ( name != info->Name() )
+        {
+        EUNIT_FAIL_TEST( "Name FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_CallstateL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+  
+    info->SetCallState(  EPEStateRinging );
+    
+    if ( EPEStateRinging != info->CallState() )
+        {
+        EUNIT_FAIL_TEST( "CallState FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_CallDurationL()
+    {
+    TTimeIntervalSeconds duration(10000);
+    CPELogInfo* info = CPELogInfo::NewL();
+  
+    info->SetDuration(  duration );
+    
+    if ( duration != info->Duration() )
+        {
+        EUNIT_FAIL_TEST( "CallDuration FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_CurrentLineL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+  
+    CCCECallParameters::TCCELineType currentLine( CCCECallParameters::ECCELineTypePrimary );
+    
+    info->SetCurrentLine(  currentLine );
+    
+    if ( currentLine != info->CurrentLine() )
+        {
+        EUNIT_FAIL_TEST( "CallDuration FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_PhoneNumberIdL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+  
+    TPEPhoneNumberIdType phoneNumberId( EPEVoipNumber );
+    
+    info->SetPhoneNumberId( phoneNumberId );
+    
+    if ( phoneNumberId != info->PhoneNumberId() )
+        {
+        EUNIT_FAIL_TEST( "PhoneNumberId FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_LoggingEnabledL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+    
+    info->SetLoggingEnabled( ETrue );
+    
+    if ( ETrue != info->LoggingEnabled() )
+        {
+        EUNIT_FAIL_TEST( "LoggingEnabled FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_CallStartTimeL()
+    {
+    TTime startTime(1000);
+    CPELogInfo* info = CPELogInfo::NewL();
+  
+    info->SetCallStartTime(  startTime );
+    
+    if ( startTime != info->CallStartTime() )
+        {
+        EUNIT_FAIL_TEST( "CallStartTime FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_MissedCallL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+    
+    info->SetMissedCall( ETrue );
+    
+    if ( ETrue != info->MissedCall() )
+        {
+        EUNIT_FAIL_TEST( "MissedCall FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_ForcedCompletionL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+    
+    info->SetForcedCompletion( ETrue );
+    
+    if ( ETrue != info->ForcedCompletion() )
+        {
+        EUNIT_FAIL_TEST( "ForcedCompletion FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_ServiceIdL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+  
+    TUint32 serviceId( 12 );
+    
+    info->SetServiceId( serviceId );
+    
+    if ( serviceId != info->ServiceId() )
+        {
+        EUNIT_FAIL_TEST( "serviceId FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_MyAddressL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+
+    TPEPhoneNumber myAddress;
+    myAddress.Copy( TPtrC8( ( TText8* )( "myaddress@domain.com" ) ) );
+ 
+    info->SetMyAddress(  myAddress );
+ 
+    if ( myAddress != info->MyAddress() )
+        {
+        EUNIT_FAIL_TEST( "MyAddress FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_ContactLinkL()
+    {
+    CPELogInfo* info = CPELogInfo::NewL();
+
+    HBufC8* linkToContact = NULL;
+ 
+    info->SetContactLink(  linkToContact );
+
+    if ( &info->ContactLink() != linkToContact )
+        {
+        EUNIT_FAIL_TEST( "ContactLink FAILED wrong return value!");
+        }
+    delete info;
+    }
+
+void UT_CPELogInfo::T_CPELogInfo_CopyLogInfoL()
+    {
+    CPELogInfo* infoSource = CPELogInfo::NewL();
+    CPELogInfo* infoDestination = CPELogInfo::NewL();
+    
+    TPEPhoneNumber myAddress;
+    myAddress.Copy( TPtrC8( ( TText8* )( "myaddress@domain.com" ) ) );
+ 
+    infoSource->SetMyAddress(  myAddress );
+  
+    infoDestination->CopyL(  *infoSource );
+
+    if ( infoSource->MyAddress() != infoDestination->MyAddress() )
+        {
+        EUNIT_FAIL_TEST( "CopyLogInfoL case 1 FAILED wrong return value!");
+        }
+    
+    infoDestination->Reset();
+    
+    if ( infoSource->MyAddress() == infoDestination->MyAddress() )
+        {
+        EUNIT_FAIL_TEST( "CopyLogInfoL case 2 FAILED wrong return value!");
+        }
+    
+    delete infoSource;
+    delete infoDestination;
+    }
+
+
+void UT_CPELogInfo::T_CPELogInfo_SetEventDataL()
+    {       
+    TPEContactName name;
+    name.Copy( TPtrC8( ( TText8* )( "remotecontact" ) ) );
+  
+    CPELogInfo* info = CPELogInfo::NewL();
+    iDataStore = static_cast<MPEDataStore*>( CPEEngineInfo::NewL() );
+    
+    iDataStore->SetRemoteName( name, KCallId );
+    
+    info->SetEventData( KCallId, *DataStore() );
+    
+    if ( name != info->Name() )
+        {
+        EUNIT_FAIL_TEST( "SetEventDataL FAILED wrong return value!");
+        }
+
+    delete static_cast<CPEEngineInfo*>( iDataStore );
+    delete info;
+    }
+
+/**
+ * Copy event data.
+ * 
+ * @since S60 v5.0
+ * @param aLogInfo Log info to be copied
+ */
+void CopyL( const CPELogInfo& aLogInfo );
+
+/**
+ * Restore default values.
+ * 
+ * @since S60 v5.0
+ */
+void Reset();
+
+// - EUnit test table -------------------------------------------------------
+
+EUNIT_BEGIN_TEST_TABLE(
+    UT_CPELogInfo,
+    "Add test suite description here.",
+    "UNIT" )
+
+EUNIT_TEST(
+    "VoIP Address - test1",
+    "CPELogInfo",
+    "VoIP Address - test1",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_VoIPAddressL, Teardown)
+   
+EUNIT_TEST(
+    "EventType - test2",
+    "CPELogInfo",
+    "EventType - test2",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_EventTypeL, Teardown)
+    
+EUNIT_TEST(
+    "CallDirection - test3",
+    "CPELogInfo",
+    "CallDirection - test3",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_CallDirectionL, Teardown)
+        
+EUNIT_TEST(
+    "CallId - test4",
+    "CPELogInfo",
+    "CallId - test4",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_CallIdL, Teardown)
+    
+EUNIT_TEST(
+    "PhoneNumber - test5",
+    "CPELogInfo",
+    "PhoneNumber - test5",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_PhoneNumberL, Teardown)
+    
+EUNIT_TEST(
+    "NameL - test6",
+    "CPELogInfo",
+    "NameL - test6",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_NameL, Teardown)
+    
+EUNIT_TEST(
+    "CallStateL - test7",
+    "CPELogInfo",
+    "CallStateL - test7",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_CallstateL, Teardown)
+    
+EUNIT_TEST(
+    "Call duration - test8",
+    "CPELogInfo",
+    "Call duration - test8",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_CallDurationL, Teardown)
+    
+EUNIT_TEST(
+    "Current line - test9",
+    "CPELogInfot",
+    "Current line - test9",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_CurrentLineL, Teardown)
+    
+EUNIT_TEST(
+    "PhoneNumberId - test10",
+    "CPELogInfo",
+    "PhoneNumberId - test10",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_PhoneNumberIdL, Teardown)
+    
+EUNIT_TEST(
+    "LoggingEnabledL - test11",
+    "CPELogInfo",
+    "LoggingEnabledL - test11",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_LoggingEnabledL, Teardown)  
+    
+
+EUNIT_TEST(
+    "CallStartTimeL - test12",
+    "CPELogInfo",
+    "CallStartTimeL - test12",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_CallStartTimeL, Teardown) 
+    
+EUNIT_TEST(
+    "MissedCall - test13",
+    "CPELogInfo",
+    "MissedCall - test13",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_MissedCallL, Teardown) 
+    
+EUNIT_TEST(
+    "ForcedCompletion - test14",
+    "CPELogInfo",
+    "ForcedCompletion - test14",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_ForcedCompletionL, Teardown) 
+
+EUNIT_TEST(
+    "ServiceId - test145",
+    "CPELogInfo",
+    "ServiceId - test15",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_ServiceIdL, Teardown)
+
+EUNIT_TEST(
+    "MyAddress - test16",
+    "CPELogInfo",
+    "MyAddress - test16",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_MyAddressL, Teardown)
+    
+
+EUNIT_TEST(
+    "ContactLink - test17",
+    "CPELogInfo",
+    "ContactLink - test17",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_ContactLinkL, Teardown)
+    
+
+EUNIT_TEST(
+    "CopyLogInfo - test18",
+    "CPELogInfo",
+    "CopyLogInfo - test18",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_CopyLogInfoL, Teardown)
+    
+
+EUNIT_TEST(
+    "SetEventDataL - test19",
+    "CPELogInfo",
+    "SetEventDataL - test19",
+    "FUNCTIONALITY",
+    SetupL, T_CPELogInfo_SetEventDataL, Teardown)
+    
+EUNIT_END_TEST_TABLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpeloginfo/src/ut_cpeloginfo.h	Fri Jun 04 10:19:18 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 __UT_CPELOGEVENT_H__
+#define __UT_CPELOGEVENT_H__
+
+// INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
+#include "MPEPhoneModelInternal.h"
+
+// FORWARD DECLARATIONS
+class CPELogInfo;
+class MPEDataStore;
+
+// CLASS DEFINITION
+/**
+ * Generated EUnit test suite class.
+ */
+NONSHARABLE_CLASS( UT_CPELogInfo )
+    : public CEUnitTestSuiteClass, public MPEPhoneModelInternal
+    {
+    public:  // Constructors and destructor
+
+        static UT_CPELogInfo* NewL();
+        static UT_CPELogInfo* NewLC();
+        ~UT_CPELogInfo();
+   
+        TInt SaveCallEntry( const TInt aCallId );
+        
+        MPEDataStore* DataStore();
+        void HandleInternalMessage( const TInt aMessage );
+        void SendMessage( 
+               const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+        void SendMessage( 
+               const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+               const TInt aCallId );
+        MPEExternalDataHandler* DataStoreExt();
+        CPERemotePartyInfoMediator* MediatorCommunicationHandler();
+        
+
+    private: // Constructors
+
+        UT_CPELogInfo();
+        void ConstructL();
+
+    private: // New methods
+        
+         void SetupL();
+        
+         void Teardown();
+	   
+         void T_CPELogInfo_VoIPAddressL();
+        
+         void T_CPELogInfo_EventTypeL();
+         
+         void T_CPELogInfo_CallDirectionL();
+         
+         void T_CPELogInfo_CallIdL();
+         
+         void T_CPELogInfo_PhoneNumberL();
+         
+         void T_CPELogInfo_NameL();
+         
+         void T_CPELogInfo_CallstateL();
+         
+         void T_CPELogInfo_CallDurationL();
+         
+         void T_CPELogInfo_CurrentLineL();
+         
+         void T_CPELogInfo_PhoneNumberIdL();
+         
+         void T_CPELogInfo_LoggingEnabledL();
+         
+         void T_CPELogInfo_CallStartTimeL();
+         
+         void T_CPELogInfo_MissedCallL();
+         
+         void T_CPELogInfo_ForcedCompletionL();
+         
+         void T_CPELogInfo_ServiceIdL();
+         
+         void T_CPELogInfo_MyAddressL();
+         
+         void T_CPELogInfo_ContactLinkL();
+         
+         void T_CPELogInfo_CopyLogInfoL();
+         
+         void T_CPELogInfo_SetEventDataL();
+
+    private: // Data
+
+        CPELogInfo* iLogInfo;
+        MPEDataStore* iDataStore;   
+
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  __UT_CPELOGEVENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/loghandling/tsrc/ut_cpeloginfo/src/ut_cpeloginfo_dllmain.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "UT_CPELogInfo.h"
+#include <CEUnitTestSuite.h>
+
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    return UT_CPELogInfo::NewL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/inc/cnetworklistener.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Network info listener.
+*
+*/
+
+
+#ifndef CNETWORKLISTENER_H
+#define CNETWORKLISTENER_H
+
+// System includes
+#include <e32base.h>
+#include <NWHandlingEngine.h>
+
+// User includes
+
+// Forward declarations
+class CNWSession;
+class CRepository;
+class MNetworkListenerObserver;
+
+/**
+ *  Network info listener.
+ */
+NONSHARABLE_CLASS( CNetworkListener ) : public CBase, 
+    public MNWMessageObserver
+    {
+public:
+
+    /**
+     * Get pointer to network info listener.
+     * @return pointer to network info listener.
+     */
+    static CNetworkListener* NewL( MNetworkListenerObserver& aObserver );
+    
+    ~CNetworkListener();
+
+    // from base class MNWMessageObserver
+
+    /**
+     * From MNWMessageObserver.
+     * Called by network handling engine when network info changes.
+     * @param aMessage is type of the change.
+     */
+    void HandleNetworkMessage( const TNWMessages aMessage );
+
+    /**
+     * From MNWMessageObserver.
+     * Called fi network handling engine fails.
+     * @param aOperation is failed operation.
+     * @param aErrorCode is fail reason.
+     */
+    void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode );
+    
+    static TInt NWLostDelayCallBack(TAny* aParam);
+
+private:
+    
+    CNetworkListener( MNetworkListenerObserver& aObserver );
+    
+    void ConstructL();
+    
+    void HandleNetworkFound();
+     
+    void HandleNetworkLost();
+    
+    /**
+     * Tests if offline mode is engaged.
+     * @return ETrue if offline mode is currently active
+     */
+    TBool IsOffLineMode() const;
+    
+    /**
+     * Tests if Bluetooth SAP is in connected mode.
+     * @return ETrue if Bluetooth SAP is active.
+     */
+    TBool IsBluetoothSAPConnected() const;
+    
+    /**
+     * Tests if SIM is in OK state.
+     * @return ETrue if SIM is in OK state.
+     */
+    TBool IsSimOk() const;
+    
+private: // data
+
+    /**
+     * Session to network handling engine.
+     * Own.
+     */
+    CNWSession* iSession;
+
+    /**
+     * Cached network info structure.
+     */
+    TNWInfo iInfo;
+    
+    /**
+     * Timer to delay the showing of the notification if needed
+     * Own
+     */
+    CPeriodic *iTimer;
+    
+    /**
+     * A true value if registered to network.
+     */
+    TBool iRegistered;
+    
+    /**
+     * Profile API.
+     */
+    CRepository* iProfileApi;
+    
+    /**
+     * Observer.
+     */
+    MNetworkListenerObserver& iObserver;
+    
+    };
+    
+#endif // CNETWORKLISTENER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/inc/mnetworklistenerobserver.h	Fri Jun 04 10:19:18 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 MNETWORKLISTENEROBSERVER_H
+#define MNETWORKLISTENEROBSERVER_H
+
+/*!
+    \class NetworkStatusObserver
+ */
+class MNetworkListenerObserver
+{
+public: 
+    
+    virtual void ShowNote() = 0;
+    
+    virtual void RemoveNote() = 0;
+    
+};
+
+#endif // MNETWORKLISTENEROBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/inc/networkhandlingstarter.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 NETWORKHANDLINGSTARTER_H
+#define NETWORKHANDLINGSTARTER_H
+
+#include <xqserviceprovider.h>
+
+#ifdef BUILD_NETWORKHANDLINGSTARTER
+#define NETWORKHANDLINGSTARTER_EXPORT Q_DECL_EXPORT
+#else
+#define NETWORKHANDLINGSTARTER_EXPORT Q_DECL_IMPORT
+#endif
+
+class NetworkHandlingStarterPrivate;
+
+/*!
+    \class NetworkStatusObserver
+ */
+class NETWORKHANDLINGSTARTER_EXPORT NetworkHandlingStarter
+    : public XQServiceProvider
+{
+    Q_OBJECT
+    
+public:
+    
+    NetworkHandlingStarter(QObject *parent = 0);
+    
+    ~NetworkHandlingStarter();
+    
+public slots:
+    /*!
+        \fn start()
+        
+        This method start networkhandling. It is intended to be used via Qt Highway.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.networkhandling","start()");
+    */
+    void start();
+    
+private:
+    
+    NetworkHandlingStarterPrivate* m_privateImpl;
+    
+};
+
+#endif // NETWORKHANDLINGSTARTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/inc/networkhandlingstarter_p.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+#ifndef NETWORKHANDLINGSTARTERPRIVATE_H
+#define NETWORKHANDLINGSTARTERPRIVATE_H
+
+#include <QObject>
+#include "mnetworklistenerobserver.h"
+
+class CNetworkListener;
+class HbDeviceMessageBox;
+class HbMainWindow;
+
+/*!
+    \class NetworkHandlingStarterPrivate
+ */
+class NetworkHandlingStarterPrivate
+    : public QObject,
+      public MNetworkListenerObserver
+{
+    Q_OBJECT
+    
+public:
+    
+    NetworkHandlingStarterPrivate(QObject *parent = NULL);
+    
+    ~NetworkHandlingStarterPrivate();
+    
+public slots:
+
+    void LaunchCpNetworkPluginView();
+
+    void ViewDone();
+
+signals:
+    
+    void SearchAvailableNetworks();
+    
+public: // From MNetworkListenerObserver
+    
+    void ShowNote();
+    
+    void RemoveNote();
+        
+private:
+    
+    HbMainWindow * MainWindow();
+    
+    void InitaliseCpNetworkPluginView();
+    
+private:
+    
+    CNetworkListener* m_networkListener;
+    HbDeviceMessageBox *m_note;
+    
+};
+
+#endif // NETWORKHANDLINGSTARTERPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/inc/networkhandlingstarterlogging.h	Fri Jun 04 10:19:18 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 NETWORKHANDLINGSTARTERSLOGGING_H
+#define NETWORKHANDLINGSTARTERSLOGGING_H
+
+#include <QDebug>
+
+
+/*!
+  Define MSG_OUTPUT_RDEBUG 
+  for enabling RDebug prints in development tracing. 
+  Shouldn't be used in release code.
+  */
+#define MSG_OUTPUT_RDEBUG
+
+
+
+#ifdef MSG_OUTPUT_RDEBUG
+#ifdef Q_OS_SYMBIAN
+#include <e32debug.h>
+
+static void networkHandlingStarterMsgOutput(QtMsgType type, const char *msg)
+{
+    switch (type) {
+    
+    case QtDebugMsg:
+        RDebug::Printf("networkhandlingstarter Debug: %s\n", msg);
+        break;
+        
+    case QtWarningMsg:
+        RDebug::Printf("networkhandlingstarter Warning: %s\n", msg);
+        break;
+
+    case QtCriticalMsg:
+        RDebug::Printf("networkhandlingstarter Critical: %s\n", msg);
+        break;
+        
+    case QtFatalMsg:
+        RDebug::Printf("networkhandlingstarter Fatal: %s\n", msg);
+        abort();
+    }
+}
+
+    #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(networkHandlingStarterMsgOutput)
+    #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0)
+#else //Q_OS_SYMBIAN
+    #define INSTALL_TRACE_MSG_HANDLER
+    #define UNINSTALL_TRACE_MSG_HANDLER
+#endif
+#else 
+    #define INSTALL_TRACE_MSG_HANDLER 
+    #define UNINSTALL_TRACE_MSG_HANDLER 
+#endif //MSG_OUTPUT_RDEBUG
+
+/*!
+  Debug macros
+  */
+#define DPRINT qDebug() << __PRETTY_FUNCTION__
+
+
+#endif // NETWORKHANDLINGSTARTERSLOGGING_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/networkhandlingstarter.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += hb
+TEMPLATE = app
+TARGET = networkhandlingstarter
+TRANSLATIONS = telephone_cp.ts
+
+INCLUDEPATH += ./inc/
+DEFINES += BUILD_NETWORKHANDLINGSTARTER
+MOC_DIR = moc
+
+symbian: {
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.UID3 = 0x2002E67A
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    LIBS += -lnetworkhandling
+    LIBS += -lcentralrepository
+    LIBS += -lxqservice
+    LIBS += -lxqserviceutil
+    LIBS += -lcpframework
+    
+    BLD_INF_RULES.prj_exports +=  \
+     "./rom/networkhandlingstarter.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(networkhandlingstarter.iby)"
+}
+
+HEADERS += ./inc/networkhandlingstarter.h
+HEADERS += ./inc/networkhandlingstarter_p.h
+HEADERS += ./inc/cnetworklistener.h
+
+SOURCES += ./src/main.cpp
+SOURCES += ./src/networkhandlingstarter.cpp
+SOURCES += ./src/networkhandlingstarter_p.cpp
+SOURCES += ./src/cnetworklistener.cpp
+
+CONFIG += service
+SERVICE.FILE = service_conf.xml
+SERVICE.OPTIONS = embeddable
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/rom/networkhandlingstarter.iby	Fri Jun 04 10:19:18 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 __NETWORKHANDLINGSTARTER_IBY__
+#define __NETWORKHANDLINGSTARTER_IBY__
+
+#include <bldvariant.hrh>
+
+file=ABI_DIR\UREL\networkhandlingstarter.exe PROGRAMS_DIR\networkhandlingstarter.exe
+data=DATAZ_\private\10003a3f\import\apps\networkhandlingstarter_reg.rsc \private\10003a3f\import\apps\networkhandlingstarter_reg.rsc
+data=DATAZ_\resource\apps\networkhandlingstarter.rsc \resource\apps\networkhandlingstarter.rsc
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/service_conf.xml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service name="com.nokia.services"  filepath="must-not-be-empty" >
+  <description>Networkhandling services</description>
+  <interface name="networkhandling" version="1.0" capabilities="">
+    <description>Networkhandling starter interface</description>
+  </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/src/cnetworklistener.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+#include <NetworkHandlingProxy.h>
+#include <CNWSession.h>
+#include <e32property.h>
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+#include <BTSapDomainPSKeys.h>
+#include <startupdomainpskeys.h>
+
+#include "cnetworklistener.h"
+#include "mnetworklistenerobserver.h"
+#include "networkhandlingstarterlogging.h"
+
+// Constants
+
+// 1-minute timeout before showing soft notification
+const TInt KNetworkLostTimeout = 60*1000000;
+
+// Offline profile, from ProfileEngineSDKCRKeys.h
+const TInt KOfflineProfileId = 5;
+
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor of CNetworkListener.
+ */
+CNetworkListener::CNetworkListener(MNetworkListenerObserver& aObserver) : 
+    iRegistered(ETrue),
+    iObserver(aObserver)
+{
+    DPRINT << ": IN";
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    Constructor of CNetworkListener.
+ */
+void CNetworkListener::ConstructL()
+{
+    DPRINT << ": IN";
+    
+    //Create network handling engine session.
+    iSession = CreateL(*this, iInfo);
+    iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iProfileApi = CRepository::NewL(KCRUidProfileEngine);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    Constructor of CNetworkListener.
+ */
+CNetworkListener* CNetworkListener::NewL(MNetworkListenerObserver& aObserver)
+{
+    DPRINT << ": IN";
+    
+    CNetworkListener* self = new(ELeave) CNetworkListener(aObserver);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    DPRINT << ": OUT";
+    return self;
+ }
+    
+/*!
+    Destructor of CNetworkListener.
+ */
+CNetworkListener::~CNetworkListener()
+{
+    DPRINT << ": IN";
+    
+    delete iSession;
+    delete iTimer;
+    delete iProfileApi;
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    CNetworkListener::HandleNetworkMessage.
+ */
+void CNetworkListener::HandleNetworkMessage(const TNWMessages aMessage)
+{
+    DPRINT << ": IN";
+    
+    if(aMessage == ENWMessageNetworkRegistrationStatusChange) {
+        switch(iInfo.iRegistrationStatus) {
+            case ENWNotRegisteredNoService:
+                // Fall-through
+            case ENWNotRegisteredEmergencyOnly:
+                // Fall-through
+            case ENWNotRegisteredSearching:
+                // Fall-through
+            case ENWRegistrationDenied:
+                HandleNetworkLost();
+                break;
+            
+            case ENWRegisteredBusy:
+                // Fall-through
+            case ENWRegisteredOnHomeNetwork:
+                // Fall-through
+            case ENWRegisteredRoaming:
+                HandleNetworkFound();
+                break;
+            
+            case ENWRegistrationUnknown:
+                // Take no action
+            default:
+                break;
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    CNetworkListener::HandleNetworkError.
+ */
+void CNetworkListener::HandleNetworkError( 
+    const TNWOperation /*aOperation*/, TInt /*aErrorCode*/)
+    {
+    DPRINT << ": IN";
+    }
+
+/*!
+    CNetworkListener::NWLostDelayCallBack.
+ */
+TInt CNetworkListener::NWLostDelayCallBack(TAny* aParam)
+{
+    DPRINT << ": IN";
+    
+    CNetworkListener* self = 
+        reinterpret_cast< CNetworkListener* >( aParam );
+    
+    if ( self ) {
+        self->iTimer->Cancel();
+        self->iObserver.ShowNote();
+    }
+    
+    DPRINT << ": OUT";
+    return KErrNone;
+}
+    
+/*!
+    CNetworkListener::HandleNetworkFound
+ */
+void CNetworkListener::HandleNetworkFound()
+{
+    DPRINT << ": IN";
+    
+    if (!iRegistered) {
+        iTimer->Cancel();
+        iObserver.RemoveNote();
+    }
+    iRegistered = ETrue;
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    CNetworkListener::HandleNetworkLost
+ */
+void CNetworkListener::HandleNetworkLost()
+{
+    DPRINT << ": IN";
+    
+    if (iInfo.iSelectionSetting == ENWNetworkSelectionManual) {
+        // See if we were registered before
+        if (iRegistered) {
+            iRegistered = EFalse;
+
+            if (!IsOffLineMode() &&
+                !IsBluetoothSAPConnected() &&
+                IsSimOk()) {
+                // Start 60 second timer and when expired show the
+                // notifier
+                iTimer->Cancel();
+                iTimer->Start(KNetworkLostTimeout,
+                              KNetworkLostTimeout,
+                              TCallBack( NWLostDelayCallBack, this ));
+             }
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    CNetworkListener::IsOffLineMode
+ */
+TBool CNetworkListener::IsOffLineMode() const
+{
+    DPRINT << ": IN";
+    
+    TInt profileId;
+    TInt err = iProfileApi->Get(KProEngActiveProfile, profileId);
+    
+    DPRINT << ": OUT";
+    
+    return profileId == KOfflineProfileId && err == KErrNone;
+    }
+    
+/*!
+    CNetworkListener::IsBluetoothSAPConnected
+ */
+TBool CNetworkListener::IsBluetoothSAPConnected() const
+{
+    DPRINT << ": IN";
+    
+    TInt btSapState( EBTSapNotConnected );
+    TInt err = RProperty::Get(KPSUidBluetoothSapConnectionState,
+                              KBTSapConnectionState,
+                              btSapState );
+    
+    DPRINT << ": OUT";
+    
+    return btSapState != EBTSapNotConnected && err == KErrNone;
+}
+    
+/*!
+    CNetworkListener::IsSimOk
+ */
+TBool CNetworkListener::IsSimOk() const
+{
+    DPRINT << ": IN";
+    
+    TInt simState(ESimStatusUninitialized);
+    TInt err = RProperty::Get(KPSUidStartup,
+                              KPSSimStatus,
+                              simState );
+    
+    DPRINT << ": OUT";
+    
+    return simState == ESimUsable && err == KErrNone;
+}
+
+// End of file
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/src/main.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include <QLocale>
+#include <hbtranslator.h>
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <networkhandlingstarter.h>
+
+/*!
+    main.
+ */
+int main(int argc, char **argv)
+{
+    HbApplication app(argc, argv);
+    
+    // Load translators
+    HbTranslator *commonTranslator = new HbTranslator("common");
+    HbTranslator *control_panelTranslator = new HbTranslator("control_panel");
+    HbTranslator *telephone_cpTranslator = new HbTranslator("telephone_cp"); 
+    
+    HbMainWindow mainWindow;
+    NetworkHandlingStarter service;
+    int err = app.exec();
+    
+    delete commonTranslator;
+    delete control_panelTranslator;
+    delete telephone_cpTranslator;
+    
+    return err;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/src/networkhandlingstarter.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include <networkhandlingstarter.h>
+#include <networkhandlingstarterlogging.h>
+#include <networkhandlingstarter_p.h>
+
+/*!
+    Constructor of NetworkHandlingStarter.
+ */
+NetworkHandlingStarter::NetworkHandlingStarter(QObject *parent) : 
+    XQServiceProvider(QLatin1String("com.nokia.services.networkhandling"), parent),
+    m_privateImpl(NULL)
+{
+    // Install plugin specific msg handler
+    INSTALL_TRACE_MSG_HANDLER;
+    
+    publishAll();
+    
+    DPRINT;
+}
+
+/*!
+    Destructor of NetworkHandlingStarter.
+ */
+NetworkHandlingStarter::~NetworkHandlingStarter()
+{
+    DPRINT;
+    delete m_privateImpl;
+    // Uninstall plugin specific msg handler
+    UNINSTALL_TRACE_MSG_HANDLER;
+}
+
+void NetworkHandlingStarter::start()
+{
+    DPRINT;
+    
+    if(!m_privateImpl) {
+        m_privateImpl = new NetworkHandlingStarterPrivate();
+    }
+}
+
+// End of File.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/src/networkhandlingstarter_p.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#include <hbdevicemessagebox.h>
+#include <HbAction.h>
+#include <CpPluginLauncher.h>
+#include <hbinstance.h>
+#include <HbView.h>
+#include <xqserviceutil.h>
+
+#include "networkhandlingstarter_p.h"
+#include "networkhandlingstarterlogging.h"
+#include "cnetworklistener.h"
+
+/*!
+    Constructor of NetworkHandlingStarterPrivate.
+ */
+NetworkHandlingStarterPrivate::NetworkHandlingStarterPrivate(QObject *parent) : 
+    QObject(parent), m_note(NULL)
+{
+    DPRINT << ": IN";
+    
+    QT_TRAP_THROWING(m_networkListener = CNetworkListener::NewL(*this));
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    Destructor of NetworkHandlingStarterPrivate.
+ */
+NetworkHandlingStarterPrivate::~NetworkHandlingStarterPrivate()
+{
+    DPRINT << ": IN";
+    
+    delete m_networkListener;
+    if (m_note) {
+        delete m_note;
+    }
+    
+    DPRINT << ": OUT";
+}
+    
+/*!
+    NetworkHandlingStarterPrivate::ShowNote()
+ */
+void NetworkHandlingStarterPrivate::ShowNote()
+{
+    DPRINT << ": IN";
+    
+    if (m_note) {
+        m_note->close();
+        delete m_note;
+        m_note = NULL;
+    }
+    m_note = new HbDeviceMessageBox(
+        hbTrId("txt_phone_info_network_lost_select_network"), 
+        HbMessageBox::MessageTypeQuestion);
+    HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_yes"), m_note);
+    m_note->setAction(primaryAction, HbDeviceMessageBox::AcceptButtonRole); 
+    HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_no"), m_note);
+    m_note->setAction(secondaryAction,HbDeviceMessageBox::RejectButtonRole); 
+    QObject::connect(
+        primaryAction, SIGNAL(triggered()),
+        this, SLOT(LaunchCpNetworkPluginView()));
+    m_note->setTimeout(0);
+    m_note->show();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    NetworkHandlingStarterPrivate::RemoveNote()
+ */
+void NetworkHandlingStarterPrivate::RemoveNote()
+{
+    DPRINT << ": IN";
+    
+    if (m_note) {
+        m_note->close();
+        delete m_note;
+        m_note = NULL;
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    NetworkHandlingStarterPrivate::InitaliseCpNetworkPluginView()
+ */
+void NetworkHandlingStarterPrivate::InitaliseCpNetworkPluginView()
+{
+    DPRINT << ": IN";
+    
+    HbMainWindow *mainWnd = MainWindow();
+    if (mainWnd) {
+        if (CpPluginLauncher::launchCpPluginView(
+                "resource\\qt\\plugins\\controlpanel\\cpnetworkplugin.qtplugin")) {
+            foreach (HbView *view, mainWnd->views()) {
+                if (QString(view->metaObject()->className()) == 
+                    QString("CpNetworkPluginView")) {
+                    QObject::connect(
+                        view, SIGNAL(aboutToClose()), 
+                        this, SLOT(ViewDone()));
+                    QObject::connect(
+                        this, SIGNAL(SearchAvailableNetworks()), 
+                        view, SLOT(SearchAvailableNetworks()));
+                }
+            }
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView()
+ */
+void NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView()
+{
+    DPRINT << ": IN";
+    
+    InitaliseCpNetworkPluginView();
+    HbMainWindow *mainWnd = MainWindow();
+    if (mainWnd) {
+        mainWnd->show();
+        XQServiceUtil::toBackground(false);
+    }
+    emit SearchAvailableNetworks();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    NetworkHandlingStarterPrivate::ViewDone()
+ */
+void NetworkHandlingStarterPrivate::ViewDone()
+{
+    HbMainWindow *mainWnd = MainWindow();
+    if (mainWnd) {
+        mainWnd->hide();
+    }
+    XQServiceUtil::toBackground(true);
+}
+
+/*!
+    NetworkHandlingStarterPrivate::MainWindow()
+ */
+
+HbMainWindow * NetworkHandlingStarterPrivate::MainWindow() 
+{
+    HbMainWindow *window(NULL);
+    QList<HbMainWindow*> mainWindows = hbInstance->allMainWindows();
+    if (!mainWindows.isEmpty()) {
+        window = mainWindows.front();
+    }
+    return window;
+}
+
+// End of File.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/common/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_centralrepository.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,628 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <smcmockclassincludes.h>
+#include <centralrepository.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CRepository::NewL
+// -----------------------------------------------------------------------------
+//
+CRepository * CRepository::NewL( 
+        TUid aRepositoryUid )
+    {
+    SMC_MOCK_NEWL1( CRepository *, TUid, aRepositoryUid )
+
+    CRepository* self = new( ELeave ) CRepository;
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NewLC
+// -----------------------------------------------------------------------------
+//
+CRepository * CRepository::NewLC( 
+        TUid aRepositoryUid )
+    {
+    SMC_MOCK_NEWLC1( CRepository *, TUid, aRepositoryUid )
+
+    CRepository* self = new( ELeave ) CRepository;
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::~CRepository
+// -----------------------------------------------------------------------------
+//
+CRepository::~CRepository(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        TInt aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TInt, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        const TReal & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TReal &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        const TDesC8 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC8 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Create
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Create( 
+        TUint32 aKey,
+        const TDesC16 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC16 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Delete
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Delete( 
+        TUint32 aKey )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32, aKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Delete
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Delete( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TUint32 & aErrorKey )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TUint32 &, aErrorKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TInt & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TInt &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        TInt aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TInt, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TReal & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TReal &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        const TReal & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TReal &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TDes8 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TDes8 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aId,
+        TDes8 & aValue,
+        TInt & aActualLength )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aId, 
+        TDes8 &, aValue, 
+        TInt &, aActualLength )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        const TDesC8 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC8 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aKey,
+        TDes16 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TDes16 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get( 
+        TUint32 aId,
+        TDes16 & aValue,
+        TInt & aActualLength )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aId, 
+        TDes16 &, aValue, 
+        TInt &, aActualLength )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set( 
+        TUint32 aKey,
+        const TDesC16 & aValue )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        const TDesC16 &, aValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::GetMeta
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::GetMeta( 
+        TUint32 aKey,
+        TUint32 & aMeta )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TUint32 &, aMeta )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Move
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Move( 
+        TUint32 aSourcePartialKey,
+        TUint32 aTargetPartialKey,
+        TUint32 aMask,
+        TUint32 & aErrorKey )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aSourcePartialKey, 
+        TUint32, aTargetPartialKey, 
+        TUint32, aMask, 
+        TUint32 &, aErrorKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TInt aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TInt, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TReal & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TReal &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC8 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC8 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindEqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindEqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC16 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC16 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TInt aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TInt, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TReal & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TReal &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC8 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC8 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FindNeqL
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::FindNeqL( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        const TDesC16 & aValue,
+        RArray<TUint32> & aFoundKeys )
+    {
+    SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        const TDesC16 &, aValue, 
+        RArray<TUint32> &, aFoundKeys )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyRequest
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyRequest( 
+        TUint32 aKey,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyRequest
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyRequest( 
+        TUint32 aPartialKey,
+        TUint32 aMask,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
+        TUint32, aMask, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyCancel
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyCancel( 
+        TUint32 aKey )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32, aKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyCancel
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyCancel( 
+        TUint32 aPartialKey,
+        TUint32 aMask )
+    {
+    SMC_MOCK_METHOD2( TInt, TUint32, aPartialKey, 
+        TUint32, aMask )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::NotifyCancelAll
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::NotifyCancelAll(  )
+    {
+    SMC_MOCK_METHOD0( TInt )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Reset
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Reset(  )
+    {
+    SMC_MOCK_METHOD0( TInt )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::Reset
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Reset( 
+        TUint32 aKey )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32, aKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::StartTransaction
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::StartTransaction( 
+        TTransactionMode aMode )
+    {
+    SMC_MOCK_METHOD1( TInt, TTransactionMode, aMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::StartTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::StartTransaction( 
+        TTransactionMode aMode,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD2( void, TTransactionMode, aMode, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CommitTransaction
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::CommitTransaction( 
+        TUint32 & aKeyInfo )
+    {
+    SMC_MOCK_METHOD1( TInt, TUint32 &, aKeyInfo )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CommitTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::CommitTransaction( 
+        TDes8 & aKeyInfo,
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD2( void, TDes8 &, aKeyInfo, 
+        TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CancelTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::CancelTransaction(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CleanupCancelTransactionPushL
+// -----------------------------------------------------------------------------
+//
+void CRepository::CleanupCancelTransactionPushL(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::FailTransaction
+// -----------------------------------------------------------------------------
+//
+void CRepository::FailTransaction(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CRepository::CleanupFailTransactionPushL
+// -----------------------------------------------------------------------------
+//
+void CRepository::CleanupFailTransactionPushL(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnetworklistener.cpp	Fri Jun 04 10:19:18 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <cnetworklistener.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNetworkListener::CNetworkListener
+// -----------------------------------------------------------------------------
+//
+CNetworkListener::CNetworkListener( 
+        MNetworkListenerObserver & aObserver ) :
+    iRegistered( ETrue ),
+    iObserver( aObserver )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNetworkListener::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CNetworkListener::ConstructL(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNetworkListener::NewL
+// -----------------------------------------------------------------------------
+//
+CNetworkListener * CNetworkListener::NewL( 
+        MNetworkListenerObserver & aObserver )
+    {
+    //SMC_MOCK_NEWL1( CNetworkListener *, MNetworkListenerObserver &, aObserver )
+
+    CNetworkListener* self = new( ELeave ) CNetworkListener( aObserver );
+    CleanupStack::PushL( self );
+    //self->ConstructL()
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNetworkListener::~CNetworkListener
+// -----------------------------------------------------------------------------
+//
+CNetworkListener::~CNetworkListener(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNetworkListener::HandleNetworkMessage
+// -----------------------------------------------------------------------------
+//
+void CNetworkListener::HandleNetworkMessage( 
+        const TNWMessages aMessage )
+    {
+    SMC_MOCK_METHOD1( void, const TNWMessages, aMessage )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNetworkListener::HandleNetworkError
+// -----------------------------------------------------------------------------
+//
+void CNetworkListener::HandleNetworkError( 
+        const TNWOperation aOperation,
+        TInt aErrorCode )
+    {
+    SMC_MOCK_METHOD2( void, const TNWOperation, aOperation, 
+        TInt, aErrorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNetworkListener::NWLostDelayCallBack
+// -----------------------------------------------------------------------------
+//
+TInt CNetworkListener::NWLostDelayCallBack( 
+        TAny * aParam )
+    {
+    //SMC_MOCK_METHOD1( TInt, TAny *, aParam )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_cnwsession.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <smcmockclassincludes.h>
+#include <CNWSession.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CNWSession::CNWSession
+// -----------------------------------------------------------------------------
+//
+CNWSession::CNWSession(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CNWSession::~CNWSession
+// -----------------------------------------------------------------------------
+//
+CNWSession::~CNWSession(  )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_cppluginlauncher.cpp	Fri Jun 04 10:19:18 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "cppluginlauncher.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpPluginLauncher::launchCpPluginView
+// -----------------------------------------------------------------------------
+//
+bool CpPluginLauncher::launchCpPluginView( 
+        const QString & pluginFile,
+        int index )
+    {
+    SMC_MOCK_METHOD2( bool, const QString &, pluginFile, 
+        int, index )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbaction.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,169 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbaction.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        const QString & text,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        const HbIcon & icon,
+        const QString & text,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        Hb::SoftKeyAction action,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::~HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::~HbAction(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setIcon
+// -----------------------------------------------------------------------------
+//
+void HbAction::setIcon( 
+        const HbIcon & icon )
+    {
+ //   SMC_MOCK_METHOD1( void, const HbIcon &, icon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::icon
+// -----------------------------------------------------------------------------
+//
+HbIcon HbAction::icon(  ) const
+    {
+ //   SMC_MOCK_METHOD0( HbIcon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setMenu
+// -----------------------------------------------------------------------------
+//
+void HbAction::setMenu( 
+        HbMenu * menu )
+    {
+ //   SMC_MOCK_METHOD1( void, HbMenu *, menu )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::menu
+// -----------------------------------------------------------------------------
+//
+HbMenu * HbAction::menu(  ) const
+    {
+ //   SMC_MOCK_METHOD0( HbMenu * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setToolBarExtension
+// -----------------------------------------------------------------------------
+//
+void HbAction::setToolBarExtension( 
+        HbToolBarExtension * extension )
+    {
+//    SMC_MOCK_METHOD1( void, HbToolBarExtension *, extension )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::toolBarExtension
+// -----------------------------------------------------------------------------
+//
+HbToolBarExtension * HbAction::toolBarExtension(  ) const
+    {
+//    SMC_MOCK_METHOD0( HbToolBarExtension * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setCommandRole
+// -----------------------------------------------------------------------------
+//
+void HbAction::setCommandRole( 
+        HbAction::CommandRole commandRole )
+    {
+ //   SMC_MOCK_METHOD1( void, CommandRole, commandRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::commandRole
+// -----------------------------------------------------------------------------
+//
+HbAction::CommandRole HbAction::commandRole(  ) const
+    {
+ //   SMC_MOCK_METHOD0( CommandRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        HbActionPrivate & dd,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbdevicemessagebox.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,303 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbdevicemessagebox.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::HbDeviceMessageBox
+// -----------------------------------------------------------------------------
+//
+HbDeviceMessageBox::HbDeviceMessageBox( 
+        const QString & text,
+        HbMessageBox::MessageBoxType type,
+        QObject * parent )
+    //:
+    //QObject( /*text, type, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::~HbDeviceMessageBox
+// -----------------------------------------------------------------------------
+//
+HbDeviceMessageBox::~HbDeviceMessageBox(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::question
+// -----------------------------------------------------------------------------
+//
+bool HbDeviceMessageBox::question( 
+        const QString & text,
+        const QString & primaryButtonText,
+        const QString & secondaryButtonText )
+    {
+    SMC_MOCK_METHOD3( bool, const QString &, text, 
+        const QString &, primaryButtonText, 
+        const QString &, secondaryButtonText )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::information
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::information( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::warning
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::warning( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::show
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::show(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::close
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::close(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::exec
+// -----------------------------------------------------------------------------
+//
+HbAction * HbDeviceMessageBox::exec(  )
+    {
+    SMC_MOCK_METHOD0( HbAction * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setText
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::text
+// -----------------------------------------------------------------------------
+//
+QString HbDeviceMessageBox::text(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setIconName
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setIconName( 
+        const QString & iconName )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, iconName )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::iconName
+// -----------------------------------------------------------------------------
+//
+QString HbDeviceMessageBox::iconName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setIconAlignment
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setIconAlignment( 
+        Qt::Alignment align )
+    {
+ //   SMC_MOCK_METHOD1( void, Qt::Alignment, align )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::iconAlignment
+// -----------------------------------------------------------------------------
+//
+Qt::Alignment HbDeviceMessageBox::iconAlignment(  ) const
+    {
+ //   SMC_MOCK_METHOD0( Qt::Alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setTimeout
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setTimeout( 
+        int timeout )
+    {
+    SMC_MOCK_METHOD1( void, int, timeout )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setTimeout
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setTimeout( 
+        HbPopup::DefaultTimeout timeout )
+    {
+  //  SMC_MOCK_METHOD1( void, HbPopup::DefaultTimeout, timeout )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::timeout
+// -----------------------------------------------------------------------------
+//
+int HbDeviceMessageBox::timeout(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setDismissPolicy
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setDismissPolicy( 
+        HbPopup::DismissPolicy dismissPolicy )
+    {
+  //  SMC_MOCK_METHOD1( void, HbPopup::DismissPolicy, dismissPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::dismissPolicy
+// -----------------------------------------------------------------------------
+//
+HbPopup::DismissPolicy HbDeviceMessageBox::dismissPolicy(  ) const
+    {
+ //   SMC_MOCK_METHOD0( HbPopup::DismissPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::primaryAction
+// -----------------------------------------------------------------------------
+//
+HbAction * HbDeviceMessageBox::primaryAction(  ) const
+    {
+    SMC_MOCK_METHOD0( HbAction * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setPrimaryAction
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setPrimaryAction( 
+        HbAction * action )
+    {
+  //  SMC_MOCK_METHOD1( void, HbAction *, action )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::secondaryAction
+// -----------------------------------------------------------------------------
+//
+HbAction * HbDeviceMessageBox::secondaryAction(  ) const
+    {
+    SMC_MOCK_METHOD0( HbAction * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setSecondaryAction
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setSecondaryAction( 
+        HbAction * action )
+    {
+  //  SMC_MOCK_METHOD1( void, HbAction *, action )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::setAnimationDefinition
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::setAnimationDefinition( 
+        QString & animationDefinition )
+    {
+    SMC_MOCK_METHOD1( void, QString &, animationDefinition )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::animationDefinition
+// -----------------------------------------------------------------------------
+//
+QString HbDeviceMessageBox::animationDefinition(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDeviceMessageBox::aboutToClose
+// -----------------------------------------------------------------------------
+//
+void HbDeviceMessageBox::aboutToClose(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbinstance.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbinstance.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbInstance::instance
+// -----------------------------------------------------------------------------
+//
+HbInstance * HbInstance::instance(  )
+    {
+    SMC_MOCK_METHOD0( HbInstance * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::allMainWindows
+// -----------------------------------------------------------------------------
+//
+QList <HbMainWindow * > HbInstance::allMainWindows(  ) const
+    {
+    SMC_MOCK_METHOD0( QList <HbMainWindow * > )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::orientation
+// -----------------------------------------------------------------------------
+//
+Qt::Orientation HbInstance::orientation(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::Orientation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::setOrientation
+// -----------------------------------------------------------------------------
+//
+void HbInstance::setOrientation( 
+        Qt::Orientation orientation,
+        bool animate )
+    {
+    SMC_MOCK_METHOD2( void, Qt::Orientation, orientation, 
+        bool, animate )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::style
+// -----------------------------------------------------------------------------
+//
+HbStyle * HbInstance::style(  ) const
+    {
+    SMC_MOCK_METHOD0( HbStyle * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::theme
+// -----------------------------------------------------------------------------
+//
+HbTheme * HbInstance::theme(  ) const
+    {
+    SMC_MOCK_METHOD0( HbTheme * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::typefaceInfo
+// -----------------------------------------------------------------------------
+//
+HbTypefaceInfo * HbInstance::typefaceInfo(  ) const
+    {
+    SMC_MOCK_METHOD0( HbTypefaceInfo * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::addLibraryPath
+// -----------------------------------------------------------------------------
+//
+void HbInstance::addLibraryPath( 
+        const QString & path )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, path )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::removeLibraryPath
+// -----------------------------------------------------------------------------
+//
+void HbInstance::removeLibraryPath( 
+        const QString & path )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, path )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::libraryPaths
+// -----------------------------------------------------------------------------
+//
+QStringList HbInstance::libraryPaths(  ) const
+    {
+    SMC_MOCK_METHOD0( QStringList )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbInstance::setLibraryPaths
+// -----------------------------------------------------------------------------
+//
+void HbInstance::setLibraryPaths( 
+        const QStringList & paths )
+    {
+    SMC_MOCK_METHOD1( void, const QStringList &, paths )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_hbmainwindow.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,565 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbmainwindow.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::HbMainWindow
+// -----------------------------------------------------------------------------
+//
+HbMainWindow::HbMainWindow( 
+        QWidget * parent,
+        Hb::WindowFlags windowFlags )
+    : d_ptr(NULL)
+    //QGraphicsView( /*parent, windowFlags*/ )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::~HbMainWindow
+// -----------------------------------------------------------------------------
+//
+HbMainWindow::~HbMainWindow(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::insertView
+// -----------------------------------------------------------------------------
+//
+HbView * HbMainWindow::insertView( 
+        int index,
+        QGraphicsWidget * widget )
+    {
+    //SMC_MOCK_METHOD2( HbView *, int, index, 
+      //  QGraphicsWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::removeView
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbMainWindow::removeView( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( QGraphicsWidget *, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::currentViewIndex
+// -----------------------------------------------------------------------------
+//
+int HbMainWindow::currentViewIndex(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::viewCount
+// -----------------------------------------------------------------------------
+//
+int HbMainWindow::viewCount(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::indexOfView
+// -----------------------------------------------------------------------------
+//
+int HbMainWindow::indexOfView( 
+        HbView * view ) const
+    {
+    //SMC_MOCK_METHOD1( int, HbView *, view )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::viewAt
+// -----------------------------------------------------------------------------
+//
+HbView * HbMainWindow::viewAt( 
+        int index ) const
+    {
+    SMC_MOCK_METHOD1( HbView *, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::addView
+// -----------------------------------------------------------------------------
+//
+HbView * HbMainWindow::addView( 
+        QGraphicsWidget * widget )
+    {
+    //SMC_MOCK_METHOD1( HbView *, QGraphicsWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::removeView
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::removeView( 
+        QGraphicsWidget * widget )
+    {
+    //SMC_MOCK_METHOD1( void, QGraphicsWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::views
+// -----------------------------------------------------------------------------
+//
+QList <HbView * > HbMainWindow::views(  ) const
+    {
+    //SMC_MOCK_METHOD0( QList <HbView * > )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::currentView
+// -----------------------------------------------------------------------------
+//
+HbView * HbMainWindow::currentView(  ) const
+    {
+    SMC_MOCK_METHOD0( HbView * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::setCurrentView
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::setCurrentView( 
+        HbView * view,
+        bool animate,
+        Hb::ViewSwitchFlags flags )
+    {
+    //SMC_MOCK_METHOD3( void, HbView *, view, 
+    //    bool, animate, 
+    //    Hb::ViewSwitchFlags, flags )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::element
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbMainWindow::element( 
+        HbMainWindow::Element element ) const
+    {
+    //SMC_MOCK_METHOD1( QGraphicsWidget *, HbMainWindow::Element, element )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::setViewSwitchingEnabled
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::setViewSwitchingEnabled( 
+        bool enabled )
+    {
+    SMC_MOCK_METHOD1( void, bool, enabled )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::isViewSwitchingEnabled
+// -----------------------------------------------------------------------------
+//
+bool HbMainWindow::isViewSwitchingEnabled(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::softKeyAction
+// -----------------------------------------------------------------------------
+//
+HbAction * HbMainWindow::softKeyAction( 
+        Hb::SoftKeyId key ) const
+    {
+    //SMC_MOCK_METHOD1( HbAction *, Hb::SoftKeyId, key )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::addSoftKeyAction
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::addSoftKeyAction( 
+        Hb::SoftKeyId key,
+        HbAction * action )
+    {
+    //SMC_MOCK_METHOD2( void, Hb::SoftKeyId, key, 
+    //    HbAction *, action )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::removeSoftKeyAction
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::removeSoftKeyAction( 
+        Hb::SoftKeyId key,
+        HbAction * action )
+    {
+    //SMC_MOCK_METHOD2( void, Hb::SoftKeyId, key, 
+    //    HbAction *, action )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::orientation
+// -----------------------------------------------------------------------------
+//
+Qt::Orientation HbMainWindow::orientation(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::Orientation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::setOrientation
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::setOrientation( 
+        Qt::Orientation orientation,
+        bool animate )
+    {
+    //SMC_MOCK_METHOD2( void, Qt::Orientation, orientation, 
+    //    bool, animate )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::unsetOrientation
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::unsetOrientation( 
+        bool animate )
+    {
+    SMC_MOCK_METHOD1( void, bool, animate )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::showItems
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::showItems( 
+        Hb::SceneItems items )
+    {
+    //SMC_MOCK_METHOD1( void, Hb::SceneItems, items )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::hideItems
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::hideItems( 
+        Hb::SceneItems items )
+    {
+    //SMC_MOCK_METHOD1( void, Hb::SceneItems, items )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::visibleItems
+// -----------------------------------------------------------------------------
+//
+Hb::SceneItems HbMainWindow::visibleItems(  ) const
+    {
+    SMC_MOCK_METHOD0( Hb::SceneItems )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::isItemVisible
+// -----------------------------------------------------------------------------
+//
+bool HbMainWindow::isItemVisible( 
+        Hb::SceneItem item ) const
+    {
+    //SMC_MOCK_METHOD1( bool, Hb::SceneItem, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::setItemVisible
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::setItemVisible( 
+        Hb::SceneItem item,
+        bool visible )
+    {
+    //SMC_MOCK_METHOD2( void, Hb::SceneItem, item, 
+    //    bool, visible )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::nativeBackgroundWindow
+// -----------------------------------------------------------------------------
+//
+WId HbMainWindow::nativeBackgroundWindow(  )
+    {
+    SMC_MOCK_METHOD0( WId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::resetNativeBackgroundWindow
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::resetNativeBackgroundWindow(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::layoutRect
+// -----------------------------------------------------------------------------
+//
+QRectF HbMainWindow::layoutRect(  ) const
+    {
+    SMC_MOCK_METHOD0( QRectF )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::setCurrentViewIndex
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::setCurrentViewIndex( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( void, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::nextView
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::nextView(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::previousView
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::previousView(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::broadcastEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::broadcastEvent( 
+        int eventType )
+    {
+    SMC_MOCK_METHOD1( void, int, eventType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::toggleOrientation
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::toggleOrientation(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::currentViewIndexChanged
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::currentViewIndexChanged( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( void, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::viewReady
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::viewReady(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::currentViewChanged
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::currentViewChanged( 
+        HbView * view )
+    {
+    //SMC_MOCK_METHOD1( void, HbView *, view )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::aboutToChangeOrientation
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::aboutToChangeOrientation(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::aboutToChangeOrientation
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::aboutToChangeOrientation( 
+        Qt::Orientation newOrientation,
+        bool animated )
+    {
+    //SMC_MOCK_METHOD2( void, Qt::Orientation, newOrientation, 
+    //    bool, animated )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::orientationChanged
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::orientationChanged( 
+        Qt::Orientation orientation )
+    {
+    //SMC_MOCK_METHOD1( void, Qt::Orientation, orientation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::changeEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::changeEvent( 
+        QEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::closeEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::closeEvent( 
+        QCloseEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QCloseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::keyPressEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::keyPressEvent( 
+        QKeyEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QKeyEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::keyReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::keyReleaseEvent( 
+        QKeyEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QKeyEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::resizeEvent( 
+        QResizeEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QResizeEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::customEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::customEvent( 
+        QEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::scrollContentsBy
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::scrollContentsBy( 
+        int dx,
+        int dy )
+    {
+    SMC_MOCK_METHOD2( void, int, dx, 
+        int, dy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMainWindow::paintEvent
+// -----------------------------------------------------------------------------
+//
+void HbMainWindow::paintEvent( 
+        QPaintEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QPaintEvent *, event )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_mnetworklistenerobserver.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "mnetworklistenerobserver.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// MNetworkListenerObserver::ShowNote
+// -----------------------------------------------------------------------------
+//
+void MNetworkListenerObserver::ShowNote(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// MNetworkListenerObserver::RemoveNote
+// -----------------------------------------------------------------------------
+//
+void MNetworkListenerObserver::RemoveNote(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <networkhandlingstarter.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarter::NetworkHandlingStarter
+// -----------------------------------------------------------------------------
+//
+NetworkHandlingStarter::NetworkHandlingStarter( 
+        QObject * parent )
+    //:
+    //XQServiceProvider( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarter::~NetworkHandlingStarter
+// -----------------------------------------------------------------------------
+//
+NetworkHandlingStarter::~NetworkHandlingStarter(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarter::start
+// -----------------------------------------------------------------------------
+//
+void NetworkHandlingStarter::start(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_networkhandlingstarter_p.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <networkhandlingstarter_p.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarterPrivate::NetworkHandlingStarterPrivate
+// -----------------------------------------------------------------------------
+//
+NetworkHandlingStarterPrivate::NetworkHandlingStarterPrivate( 
+        QObject *  )
+    //:
+    //QObject( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarterPrivate::~NetworkHandlingStarterPrivate
+// -----------------------------------------------------------------------------
+//
+NetworkHandlingStarterPrivate::~NetworkHandlingStarterPrivate(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView
+// -----------------------------------------------------------------------------
+//
+void NetworkHandlingStarterPrivate::LaunchCpNetworkPluginView(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarterPrivate::ShowNote
+// -----------------------------------------------------------------------------
+//
+void NetworkHandlingStarterPrivate::ShowNote(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// NetworkHandlingStarterPrivate::RemoveNote
+// -----------------------------------------------------------------------------
+//
+void NetworkHandlingStarterPrivate::RemoveNote(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+/*!
+    NetworkHandlingStarterPrivate::ViewDone()
+ */
+void NetworkHandlingStarterPrivate::ViewDone()
+{
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_qabstractscrollarea.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,447 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <qabstractscrollarea.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::QAbstractScrollArea
+// -----------------------------------------------------------------------------
+//
+QAbstractScrollArea::QAbstractScrollArea( 
+        QAbstractScrollAreaPrivate & dd,
+        QWidget * parent )
+    //:
+    //QFrame( /*dd, parent*/ )
+    {
+    
+    }
+
+QAbstractScrollArea::QAbstractScrollArea(QWidget *parent)
+{
+
+}
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::~QAbstractScrollArea
+// -----------------------------------------------------------------------------
+//
+QAbstractScrollArea::~QAbstractScrollArea(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::verticalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+Qt::ScrollBarPolicy QAbstractScrollArea::verticalScrollBarPolicy(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::ScrollBarPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setVerticalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setVerticalScrollBarPolicy( 
+        Qt::ScrollBarPolicy )
+    {
+    // SMC_MOCK_METHOD1( void, Qt::, ScrollBarPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::verticalScrollBar
+// -----------------------------------------------------------------------------
+//
+QScrollBar * QAbstractScrollArea::verticalScrollBar(  ) const
+    {
+    SMC_MOCK_METHOD0( QScrollBar * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setVerticalScrollBar
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setVerticalScrollBar( 
+        QScrollBar * scrollbar )
+    {
+    //SMC_MOCK_METHOD1( void, QScrollBar *, scrollbar )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::horizontalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+Qt::ScrollBarPolicy QAbstractScrollArea::horizontalScrollBarPolicy(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::ScrollBarPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setHorizontalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setHorizontalScrollBarPolicy( 
+        Qt:: ScrollBarPolicy )
+    {
+    //SMC_MOCK_METHOD1( void, Qt::, ScrollBarPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::horizontalScrollBar
+// -----------------------------------------------------------------------------
+//
+QScrollBar * QAbstractScrollArea::horizontalScrollBar(  ) const
+    {
+    SMC_MOCK_METHOD0( QScrollBar * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setHorizontalScrollBar
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setHorizontalScrollBar( 
+        QScrollBar * scrollbar )
+    {
+    //SMC_MOCK_METHOD1( void, QScrollBar *, scrollbar )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::cornerWidget
+// -----------------------------------------------------------------------------
+//
+QWidget * QAbstractScrollArea::cornerWidget(  ) const
+    {
+    SMC_MOCK_METHOD0( QWidget * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setCornerWidget
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setCornerWidget( 
+        QWidget * widget )
+    {
+    //SMC_MOCK_METHOD1( void, QWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::addScrollBarWidget
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::addScrollBarWidget( 
+        QWidget * widget,
+        Qt::Alignment alignment )
+    {
+    //SMC_MOCK_METHOD2( void, QWidget *, widget, 
+    //    Qt::Alignment, alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::scrollBarWidgets
+// -----------------------------------------------------------------------------
+//
+QWidgetList QAbstractScrollArea::scrollBarWidgets( 
+        Qt::Alignment alignment )
+    {
+    //SMC_MOCK_METHOD1( QWidgetList, Qt::Alignment, alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::viewport
+// -----------------------------------------------------------------------------
+//
+QWidget * QAbstractScrollArea::viewport(  ) const
+    {
+    SMC_MOCK_METHOD0( QWidget * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setViewport
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setViewport( 
+        QWidget * widget )
+    {
+    //SMC_MOCK_METHOD1( void, QWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::maximumViewportSize
+// -----------------------------------------------------------------------------
+//
+QSize QAbstractScrollArea::maximumViewportSize(  ) const
+    {
+    SMC_MOCK_METHOD0( QSize )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::minimumSizeHint
+// -----------------------------------------------------------------------------
+//
+QSize QAbstractScrollArea::minimumSizeHint(  ) const
+    {
+    SMC_MOCK_METHOD0( QSize )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::sizeHint
+// -----------------------------------------------------------------------------
+//
+QSize QAbstractScrollArea::sizeHint(  ) const
+    {
+    SMC_MOCK_METHOD0( QSize )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setupViewport
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setupViewport( 
+        QWidget * viewport )
+    {
+    //SMC_MOCK_METHOD1( Q_SLOTS : void, QWidget *, viewport )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setViewportMargins
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setViewportMargins( 
+        int left,
+        int top,
+        int right,
+        int bottom )
+    {
+    //SMC_MOCK_METHOD4( void, int, left, 
+    //    int, top, 
+    //    int, right, 
+    //    int, bottom )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::setViewportMargins
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::setViewportMargins( 
+        const QMargins & margins )
+    {
+    //SMC_MOCK_METHOD1( void, const QMargins &, margins )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::event
+// -----------------------------------------------------------------------------
+//
+bool QAbstractScrollArea::event( 
+        QEvent * )
+    {
+    //SMC_MOCK_METHOD1( bool, QEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::viewportEvent
+// -----------------------------------------------------------------------------
+//
+bool QAbstractScrollArea::viewportEvent( 
+        QEvent * )
+    {
+    //SMC_MOCK_METHOD1( bool, QEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::resizeEvent( 
+        QResizeEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QResizeEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::paintEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::paintEvent( 
+        QPaintEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QPaintEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::mousePressEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::mousePressEvent( 
+        QMouseEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::mouseReleaseEvent( 
+        QMouseEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::mouseDoubleClickEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::mouseDoubleClickEvent( 
+        QMouseEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::mouseMoveEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::mouseMoveEvent( 
+        QMouseEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::wheelEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::wheelEvent( 
+        QWheelEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QWheelEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::contextMenuEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::contextMenuEvent( 
+        QContextMenuEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QContextMenuEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::dragEnterEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::dragEnterEvent( 
+        QDragEnterEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QDragEnterEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::dragMoveEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::dragMoveEvent( 
+        QDragMoveEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QDragMoveEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::dragLeaveEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::dragLeaveEvent( 
+        QDragLeaveEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QDragLeaveEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::dropEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::dropEvent( 
+        QDropEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QDropEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::keyPressEvent
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::keyPressEvent( 
+        QKeyEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QKeyEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAbstractScrollArea::scrollContentsBy
+// -----------------------------------------------------------------------------
+//
+void QAbstractScrollArea::scrollContentsBy( 
+        int dx,
+        int dy )
+    {
+    SMC_MOCK_METHOD2( void, int, dx, 
+        int, dy )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_qframe.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,256 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <qframe.h>
+#include <QWidget>
+
+
+QWidget::QWidget(QWidget* parent, Qt::WindowFlags f)
+    {};
+
+QWidget::~QWidget()
+    {};
+
+void QWidget::setVisible(bool visible)
+    {};
+
+inline bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const
+{
+    return true;
+}
+    
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QFrame::QFrame
+// -----------------------------------------------------------------------------
+//
+QFrame::QFrame( 
+        QWidget * parent,
+        Qt::WindowFlags f )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::~QFrame
+// -----------------------------------------------------------------------------
+//
+QFrame::~QFrame(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::frameStyle
+// -----------------------------------------------------------------------------
+//
+int QFrame::frameStyle(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::setFrameStyle
+// -----------------------------------------------------------------------------
+//
+void QFrame::setFrameStyle( int )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::frameWidth
+// -----------------------------------------------------------------------------
+//
+int QFrame::frameWidth(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::sizeHint
+// -----------------------------------------------------------------------------
+//
+QSize QFrame::sizeHint(  ) const
+    {
+    SMC_MOCK_METHOD0( QSize )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::frameShape
+// -----------------------------------------------------------------------------
+//
+QFrame::Shape QFrame::frameShape(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::setFrameShape
+// -----------------------------------------------------------------------------
+//
+void QFrame::setFrameShape( Shape )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::frameShadow
+// -----------------------------------------------------------------------------
+//
+QFrame::Shadow QFrame::frameShadow(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::setFrameShadow
+// -----------------------------------------------------------------------------
+//
+void QFrame::setFrameShadow( Shadow )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::lineWidth
+// -----------------------------------------------------------------------------
+//
+int QFrame::lineWidth(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::setLineWidth
+// -----------------------------------------------------------------------------
+//
+void QFrame::setLineWidth( int )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::midLineWidth
+// -----------------------------------------------------------------------------
+//
+int QFrame::midLineWidth(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::setMidLineWidth
+// -----------------------------------------------------------------------------
+//
+void QFrame::setMidLineWidth( int )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::frameRect
+// -----------------------------------------------------------------------------
+//
+QRect QFrame::frameRect(  ) const
+    {
+    SMC_MOCK_METHOD0( QRect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::setFrameRect
+// -----------------------------------------------------------------------------
+//
+void QFrame::setFrameRect( 
+        const QRect & )
+    {
+    //SMC_MOCK_METHOD1( void, const QRect, & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::event
+// -----------------------------------------------------------------------------
+//
+bool QFrame::event( 
+        QEvent * e )
+    {
+    //SMC_MOCK_METHOD1( bool, QEvent *, e )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::paintEvent
+// -----------------------------------------------------------------------------
+//
+void QFrame::paintEvent( 
+        QPaintEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QPaintEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::changeEvent
+// -----------------------------------------------------------------------------
+//
+void QFrame::changeEvent( 
+        QEvent * )
+    {
+    //SMC_MOCK_METHOD1( void, QEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::drawFrame
+// -----------------------------------------------------------------------------
+//
+void QFrame::drawFrame( 
+        QPainter * )
+    {
+    //SMC_MOCK_METHOD1( void, QPainter, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QFrame::QFrame
+// -----------------------------------------------------------------------------
+//
+QFrame::QFrame( 
+        QFramePrivate & dd,
+        QWidget * parent,
+        Qt::WindowFlags f )
+    //:
+    //QWidget( /*dd, parent, f*/ )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/mocks/mock_qgraphicsview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1150 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <QVariant>
+#include <smcmockclassincludes.h>
+#include <qgraphicsview.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::QGraphicsView
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::QGraphicsView( 
+        QWidget * parent )
+    //:
+    //QAbstractScrollArea( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::QGraphicsView
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::QGraphicsView( 
+        QGraphicsScene * scene,
+        QWidget * parent )
+    //:
+    //QAbstractScrollArea( /*scene, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::~QGraphicsView
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::~QGraphicsView(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::sizeHint
+// -----------------------------------------------------------------------------
+//
+QSize QGraphicsView::sizeHint(  ) const
+    {
+    SMC_MOCK_METHOD0( QSize )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::renderHints
+// -----------------------------------------------------------------------------
+//
+QPainter::RenderHints QGraphicsView::renderHints(  ) const
+    {
+    SMC_MOCK_METHOD0( QPainter::RenderHints )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setRenderHint
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setRenderHint( 
+        QPainter::RenderHint hint,
+        bool enabled )
+    {
+    //SMC_MOCK_METHOD2( void, QPainter::RenderHint, hint, 
+    //    bool, enabled )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setRenderHints
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setRenderHints( 
+        QPainter::RenderHints hints )
+    {
+    //SMC_MOCK_METHOD1( void, QPainter::RenderHints, hints )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::alignment
+// -----------------------------------------------------------------------------
+//
+Qt::Alignment QGraphicsView::alignment(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::Alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setAlignment
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setAlignment( 
+        Qt::Alignment alignment )
+    {
+    //SMC_MOCK_METHOD1( void, Qt::Alignment, alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::transformationAnchor
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::ViewportAnchor QGraphicsView::transformationAnchor(  ) const
+    {
+    SMC_MOCK_METHOD0( ViewportAnchor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setTransformationAnchor
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setTransformationAnchor( 
+        ViewportAnchor anchor )
+    {
+    //SMC_MOCK_METHOD1( void, ViewportAnchor, anchor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::resizeAnchor
+// -----------------------------------------------------------------------------
+//
+/*
+ViewportAnchor QGraphicsView::resizeAnchor(  ) const
+    {
+    SMC_MOCK_METHOD0( ViewportAnchor )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setResizeAnchor
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setResizeAnchor( 
+        QGraphicsView::ViewportAnchor anchor )
+    {
+    //SMC_MOCK_METHOD1( void, ViewportAnchor, anchor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::viewportUpdateMode
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::ViewportUpdateMode QGraphicsView::viewportUpdateMode(  ) const
+    {
+    SMC_MOCK_METHOD0( ViewportUpdateMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setViewportUpdateMode
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setViewportUpdateMode( 
+        QGraphicsView::ViewportUpdateMode mode )
+    {
+    //SMC_MOCK_METHOD1( void, ViewportUpdateMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::optimizationFlags
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::OptimizationFlags QGraphicsView::optimizationFlags(  ) const
+    {
+    SMC_MOCK_METHOD0( OptimizationFlags )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setOptimizationFlag
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setOptimizationFlag( 
+        QGraphicsView::OptimizationFlag flag,
+        bool enabled )
+    {
+    SMC_MOCK_METHOD2( void, OptimizationFlag, flag, 
+        bool, enabled )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setOptimizationFlags
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setOptimizationFlags( 
+        OptimizationFlags flags )
+    {
+    //SMC_MOCK_METHOD1( void, OptimizationFlags, flags )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::dragMode
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::DragMode QGraphicsView::dragMode(  ) const
+    {
+    SMC_MOCK_METHOD0( DragMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setDragMode
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setDragMode( 
+        DragMode mode )
+    {
+    //SMC_MOCK_METHOD1( void, DragMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::rubberBandSelectionMode
+// -----------------------------------------------------------------------------
+//
+Qt::ItemSelectionMode QGraphicsView::rubberBandSelectionMode(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::ItemSelectionMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setRubberBandSelectionMode
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setRubberBandSelectionMode( 
+        Qt::ItemSelectionMode mode )
+    {
+    //SMC_MOCK_METHOD1( void, Qt::ItemSelectionMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::cacheMode
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::CacheMode QGraphicsView::cacheMode(  ) const
+    {
+    SMC_MOCK_METHOD0( CacheMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setCacheMode
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setCacheMode( 
+        CacheMode mode )
+    {
+    //SMC_MOCK_METHOD1( void, CacheMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::resetCachedContent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::resetCachedContent(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::isInteractive
+// -----------------------------------------------------------------------------
+//
+bool QGraphicsView::isInteractive(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setInteractive
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setInteractive( 
+        bool allowed )
+    {
+    SMC_MOCK_METHOD1( void, bool, allowed )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::scene
+// -----------------------------------------------------------------------------
+//
+QGraphicsScene * QGraphicsView::scene(  ) const
+    {
+    SMC_MOCK_METHOD0( QGraphicsScene * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setScene
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setScene( 
+        QGraphicsScene * scene )
+    {
+    //SMC_MOCK_METHOD1( void, QGraphicsScene *, scene )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::sceneRect
+// -----------------------------------------------------------------------------
+//
+QRectF QGraphicsView::sceneRect(  ) const
+    {
+    SMC_MOCK_METHOD0( QRectF )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setSceneRect
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setSceneRect( 
+        const QRectF & rect )
+    {
+    //SMC_MOCK_METHOD1( void, const QRectF &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::matrix
+// -----------------------------------------------------------------------------
+//
+QMatrix QGraphicsView::matrix(  ) const
+    {
+    SMC_MOCK_METHOD0( QMatrix )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setMatrix
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setMatrix( 
+        const QMatrix & matrix,
+        bool combine )
+    {
+    //SMC_MOCK_METHOD2( void, const QMatrix &, matrix, 
+    //    bool, combine )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::resetMatrix
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::resetMatrix(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::transform
+// -----------------------------------------------------------------------------
+//
+QTransform QGraphicsView::transform(  ) const
+    {
+    SMC_MOCK_METHOD0( QTransform )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::viewportTransform
+// -----------------------------------------------------------------------------
+//
+QTransform QGraphicsView::viewportTransform(  ) const
+    {
+    SMC_MOCK_METHOD0( QTransform )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::isTransformed
+// -----------------------------------------------------------------------------
+//
+bool QGraphicsView::isTransformed(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setTransform
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setTransform( 
+        const QTransform & matrix,
+        bool combine )
+    {
+    //SMC_MOCK_METHOD2( void, const QTransform &, matrix, 
+    //    bool, combine )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::resetTransform
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::resetTransform(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::rotate
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::rotate( 
+        qreal angle )
+    {
+    //SMC_MOCK_METHOD1( void, qreal, angle )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::scale
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::scale( 
+        qreal sx,
+        qreal sy )
+    {
+    //SMC_MOCK_METHOD2( void, qreal, sx, 
+    //    qreal, sy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::shear
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::shear( 
+        qreal sh,
+        qreal sv )
+    {
+    //SMC_MOCK_METHOD2( void, qreal, sh, 
+    //    qreal, sv )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::translate
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::translate( 
+        qreal dx,
+        qreal dy )
+    {
+    SMC_MOCK_METHOD2( void, qreal, dx, 
+        qreal, dy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::centerOn
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::centerOn( 
+        const QPointF & pos )
+    {
+    //SMC_MOCK_METHOD1( void, const QPointF &, pos )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::centerOn
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::centerOn( 
+        const QGraphicsItem * item )
+    {
+    //SMC_MOCK_METHOD1( void, const QGraphicsItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::ensureVisible
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::ensureVisible( 
+        const QRectF & rect,
+        int xmargin,
+        int ymargin )
+    {
+    //SMC_MOCK_METHOD3( void, const QRectF &, rect, 
+    //    int, xmargin, 
+    //    int, ymargin )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::ensureVisible
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::ensureVisible( 
+        const QGraphicsItem * item,
+        int xmargin,
+        int ymargin )
+    {
+    //SMC_MOCK_METHOD3( void, const QGraphicsItem *, item, 
+    //    int, xmargin, 
+    //    int, ymargin )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::fitInView
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::fitInView( 
+        const QRectF & rect,
+        Qt::AspectRatioMode aspectRadioMode )
+    {
+    //SMC_MOCK_METHOD2( void, const QRectF &, rect, 
+    //    Qt::AspectRatioMode, aspectRadioMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::fitInView
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::fitInView( 
+        const QGraphicsItem * item,
+        Qt::AspectRatioMode aspectRadioMode )
+    {
+    //SMC_MOCK_METHOD2( void, const QGraphicsItem *, item, 
+    //    Qt::AspectRatioMode, aspectRadioMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::render
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::render( 
+        QPainter * painter,
+        const QRectF & target,
+        const QRect & source,
+        Qt::AspectRatioMode aspectRatioMode )
+    {
+    //SMC_MOCK_METHOD4( void, QPainter *, painter, 
+    //    const QRectF &, target, 
+    //    const QRect &, source, 
+    //    Qt::AspectRatioMode, aspectRatioMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::items
+// -----------------------------------------------------------------------------
+//
+QList <QGraphicsItem * > QGraphicsView::items(  ) const
+    {
+    SMC_MOCK_METHOD0( QList <QGraphicsItem * > )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::items
+// -----------------------------------------------------------------------------
+//
+QList <QGraphicsItem * > QGraphicsView::items( 
+        const QPoint & pos ) const
+    {
+    //SMC_MOCK_METHOD1( QList <QGraphicsItem * >, const QPoint &, pos )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::items
+// -----------------------------------------------------------------------------
+//
+QList <QGraphicsItem * > QGraphicsView::items( 
+        const QRect & rect,
+        Qt::ItemSelectionMode mode ) const
+    {
+    //SMC_MOCK_METHOD2( QList <QGraphicsItem * >, const QRect &, rect, 
+    //   Qt::ItemSelectionMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::items
+// -----------------------------------------------------------------------------
+//
+QList <QGraphicsItem * > QGraphicsView::items( 
+        const QPolygon & polygon,
+        Qt::ItemSelectionMode mode ) const
+    {
+    //SMC_MOCK_METHOD2( QList <QGraphicsItem * >, const QPolygon &, polygon, 
+    //    Qt::ItemSelectionMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::items
+// -----------------------------------------------------------------------------
+//
+QList <QGraphicsItem * > QGraphicsView::items( 
+        const QPainterPath & path,
+        Qt::ItemSelectionMode mode ) const
+    {
+    //SMC_MOCK_METHOD2( QList <QGraphicsItem * >, const QPainterPath &, path, 
+    //    Qt::ItemSelectionMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::itemAt
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * QGraphicsView::itemAt( 
+        const QPoint & pos ) const
+    {
+    //SMC_MOCK_METHOD1( QGraphicsItem *, const QPoint &, pos )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapToScene
+// -----------------------------------------------------------------------------
+//
+QPointF QGraphicsView::mapToScene( 
+        const QPoint & point ) const
+    {
+    //SMC_MOCK_METHOD1( QPointF, const QPoint &, point )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapToScene
+// -----------------------------------------------------------------------------
+//
+QPolygonF QGraphicsView::mapToScene( 
+        const QRect & rect ) const
+    {
+    //SMC_MOCK_METHOD1( QPolygonF, const QRect &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapToScene
+// -----------------------------------------------------------------------------
+//
+QPolygonF QGraphicsView::mapToScene( 
+        const QPolygon & polygon ) const
+    {
+    //SMC_MOCK_METHOD1( QPolygonF, const QPolygon &, polygon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapToScene
+// -----------------------------------------------------------------------------
+//
+QPainterPath QGraphicsView::mapToScene( 
+        const QPainterPath & path ) const
+    {
+    //SMC_MOCK_METHOD1( QPainterPath, const QPainterPath &, path )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapFromScene
+// -----------------------------------------------------------------------------
+//
+QPoint QGraphicsView::mapFromScene( 
+        const QPointF & point ) const
+    {
+    SMC_MOCK_METHOD1( QPoint, const QPointF &, point )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapFromScene
+// -----------------------------------------------------------------------------
+//
+QPolygon QGraphicsView::mapFromScene( 
+        const QRectF & rect ) const
+    {
+    //SMC_MOCK_METHOD1( QPolygon, const QRectF &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapFromScene
+// -----------------------------------------------------------------------------
+//
+QPolygon QGraphicsView::mapFromScene( 
+        const QPolygonF & polygon ) const
+    {
+    //SMC_MOCK_METHOD1( QPolygon, const QPolygonF &, polygon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mapFromScene
+// -----------------------------------------------------------------------------
+//
+QPainterPath QGraphicsView::mapFromScene( 
+        const QPainterPath & path ) const
+    {
+    //SMC_MOCK_METHOD1( QPainterPath, const QPainterPath &, path )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::inputMethodQuery
+// -----------------------------------------------------------------------------
+//
+QVariant QGraphicsView::inputMethodQuery( 
+        Qt::InputMethodQuery query ) const
+    {
+    //SMC_MOCK_METHOD1( QVariant, Qt::InputMethodQuery, query )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::backgroundBrush
+// -----------------------------------------------------------------------------
+//
+QBrush QGraphicsView::backgroundBrush(  ) const
+    {
+    SMC_MOCK_METHOD0( QBrush )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setBackgroundBrush
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setBackgroundBrush( 
+        const QBrush & brush )
+    {
+    //SMC_MOCK_METHOD1( void, const QBrush &, brush )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::foregroundBrush
+// -----------------------------------------------------------------------------
+//
+QBrush QGraphicsView::foregroundBrush(  ) const
+    {
+    SMC_MOCK_METHOD0( QBrush )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setForegroundBrush
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setForegroundBrush( 
+        const QBrush & brush )
+    {
+    //SMC_MOCK_METHOD1( void, const QBrush &, brush )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::updateScene
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::updateScene( 
+        const QList<QRectF> & rects )
+    {
+    //SMC_MOCK_METHOD1( Q_SLOTS : void, const QList<QRectF> &, rects )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::invalidateScene
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::invalidateScene( 
+        const QRectF & rect,
+        QGraphicsScene::SceneLayers layers )
+    {
+    //SMC_MOCK_METHOD2( void, const QRectF &, rect, 
+    //    QGraphicsScene::SceneLayers, layers )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::updateSceneRect
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::updateSceneRect( 
+        const QRectF & rect )
+    {
+    //SMC_MOCK_METHOD1( void, const QRectF &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::setupViewport
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::setupViewport( 
+        QWidget * widget )
+    {
+    //SMC_MOCK_METHOD1( Q_SLOTS : void, QWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::QGraphicsView
+// -----------------------------------------------------------------------------
+//
+QGraphicsView::QGraphicsView( 
+        QGraphicsViewPrivate &,
+        QWidget * parent )
+    //:
+    //QAbstractScrollArea( /*&, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::event
+// -----------------------------------------------------------------------------
+//
+bool QGraphicsView::event( 
+        QEvent * event )
+    {
+    //SMC_MOCK_METHOD1( bool, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::viewportEvent
+// -----------------------------------------------------------------------------
+//
+bool QGraphicsView::viewportEvent( 
+        QEvent * event )
+    {
+    //SMC_MOCK_METHOD1( bool, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::contextMenuEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::contextMenuEvent( 
+        QContextMenuEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QContextMenuEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::dragEnterEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::dragEnterEvent( 
+        QDragEnterEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QDragEnterEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::dragLeaveEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::dragLeaveEvent( 
+        QDragLeaveEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QDragLeaveEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::dragMoveEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::dragMoveEvent( 
+        QDragMoveEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QDragMoveEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::dropEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::dropEvent( 
+        QDropEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QDropEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::focusInEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::focusInEvent( 
+        QFocusEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QFocusEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::focusNextPrevChild
+// -----------------------------------------------------------------------------
+//
+bool QGraphicsView::focusNextPrevChild( 
+        bool next )
+    {
+    //SMC_MOCK_METHOD1( bool, bool, next )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::focusOutEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::focusOutEvent( 
+        QFocusEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QFocusEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::keyPressEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::keyPressEvent( 
+        QKeyEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QKeyEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::keyReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::keyReleaseEvent( 
+        QKeyEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QKeyEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mouseDoubleClickEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::mouseDoubleClickEvent( 
+        QMouseEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mousePressEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::mousePressEvent( 
+        QMouseEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mouseMoveEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::mouseMoveEvent( 
+        QMouseEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::mouseReleaseEvent( 
+        QMouseEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::wheelEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::wheelEvent( 
+        QWheelEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QWheelEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::paintEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::paintEvent( 
+        QPaintEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QPaintEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::resizeEvent( 
+        QResizeEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QResizeEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::scrollContentsBy
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::scrollContentsBy( 
+        int dx,
+        int dy )
+    {
+    //SMC_MOCK_METHOD2( void, int, dx, 
+    //    int, dy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::showEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::showEvent( 
+        QShowEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QShowEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::inputMethodEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::inputMethodEvent( 
+        QInputMethodEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QInputMethodEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::drawBackground
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::drawBackground( 
+        QPainter * painter,
+        const QRectF & rect )
+    {
+    //SMC_MOCK_METHOD2( void, QPainter *, painter, 
+    //    const QRectF &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::drawForeground
+// -----------------------------------------------------------------------------
+//
+void QGraphicsView::drawForeground( 
+        QPainter * painter,
+        const QRectF & rect )
+    {
+    //SMC_MOCK_METHOD2( void, QPainter *, painter, 
+    //    const QRectF &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsView::drawItems
+// -----------------------------------------------------------------------------
+//
+/*
+void QGraphicsView::drawItems( 
+        QPainter * painter,
+        int numItems,
+        QGraphicsItem * items,
+        const QStyleOptionGraphicsItem options )
+    {
+    //SMC_MOCK_METHOD4( void, QPainter *, painter, 
+    //    int, numItems, 
+    //    QGraphicsItem *, items, 
+    //    const QStyleOptionGraphicsItem, options )
+    }
+
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs --config winscw_udeb --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+    call %PATH_TO_DLL%\%%a.exe -dtextshell --
+    move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/inc/ut_cnetworklistener.h	Fri Jun 04 10:19:18 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 UT_CNETWORKLISTENER_H
+#define UT_CNETWORKLISTENER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+#include <mnetworklistenerobserver.h>
+
+class CNetworkListener;
+
+class ut_cnetworklistener : public QObject, public MockService, public MNetworkListenerObserver
+{
+    Q_OBJECT
+
+public:
+    
+    ut_cnetworklistener();
+    ~ut_cnetworklistener();
+    
+public: 
+    // From MNetworkListenerObserver
+    void ShowNote();
+    void RemoveNote();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_HandleNetworkMessage();
+    void t_HandleNetworkError();
+    void t_NWLostDelayCallBack();
+
+    
+private:
+    
+    CNetworkListener *m_networkListener;
+
+};
+
+#endif // UT_CNETWORKLISTENER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/src/ut_cnetworklistener.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <ut_cnetworklistener.h>
+#include <qtestmains60.h>
+#include <cnetworklistener.h>
+#include <NetworkHandlingProxy.h>
+#include <CNWSession.h>
+#include <NWHandlingEngine.h>
+
+TNWInfo* PoiterNWInfo;
+
+CNWSession* CreateL( MNWMessageObserver& /*aMessage*/, TNWInfo& aTNWInfo )
+{
+    PoiterNWInfo = &aTNWInfo;
+    aTNWInfo.iSelectionSetting = ENWNetworkSelectionManual;
+    aTNWInfo.iRegistrationStatus = ENWRegistrationDenied;
+    CNWSession* nullPointer(NULL);
+    return nullPointer;
+}
+
+/*!
+  ut_cnetworklistener::ut_cnetworklistener
+ */
+ut_cnetworklistener::ut_cnetworklistener() 
+    : m_networkListener(0)
+{
+}
+
+/*!
+  ut_cnetworklistener::~ut_cnetworklistener
+ */
+ut_cnetworklistener::~ut_cnetworklistener()
+{
+    delete m_networkListener;
+}
+
+/*!
+  ut_cnetworklistener::init
+ */
+void ut_cnetworklistener::init()
+{
+    initialize();
+    
+    m_networkListener = CNetworkListener::NewL(*this);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  ut_cnetworklistener::cleanup
+ */
+void ut_cnetworklistener::cleanup()
+{
+    delete m_networkListener;
+    m_networkListener = 0;
+    
+    reset();
+}
+
+/*!
+    From MNetworkListenerObserver
+ */
+void ut_cnetworklistener::ShowNote()
+{
+}
+
+/*!
+    From MNetworkListenerObserver
+ */
+void ut_cnetworklistener::RemoveNote()
+{
+}
+
+/*!
+  ut_cnetworklistener::t_HandleNetworkMessage
+ */
+void ut_cnetworklistener::t_HandleNetworkMessage()
+{
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredNoService;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredEmergencyOnly;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredSearching;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    PoiterNWInfo->iRegistrationStatus = ENWRegisteredBusy;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    PoiterNWInfo->iRegistrationStatus = ENWRegisteredOnHomeNetwork;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    PoiterNWInfo->iRegistrationStatus = ENWRegisteredRoaming;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    PoiterNWInfo->iRegistrationStatus = ENWRegistrationUnknown;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    PoiterNWInfo->iSelectionSetting = ENWNetworkSelectionAutomatic;
+    PoiterNWInfo->iRegistrationStatus = ENWNotRegisteredNoService;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    PoiterNWInfo->iRegistrationStatus = ENWRegisteredOnHomeNetwork;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkModeChange);
+    
+    PoiterNWInfo->iRegistrationStatus = (TNWRegistrationStatus)123456789;
+    m_networkListener->HandleNetworkMessage(MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);  
+}
+
+/*!
+  ut_cnetworklistener::t_HandleNetworkError
+ */
+void ut_cnetworklistener::t_HandleNetworkError()
+{
+    m_networkListener->HandleNetworkError( 
+        MNWMessageObserver::ENWGetServiceProviderName, KErrGeneral );
+}
+
+/*!
+  ut_cnetworklistener::t_NWLostDelayCallBack
+ */
+void ut_cnetworklistener::t_NWLostDelayCallBack()
+{
+    TAny* pointer(NULL); 
+    m_networkListener->NWLostDelayCallBack(pointer);
+    
+    CNetworkListener* networklistener = CNetworkListener::NewL(*this);; 
+    m_networkListener->NWLostDelayCallBack( networklistener );
+    delete networklistener;
+}
+
+QTEST_MAIN_S60(ut_cnetworklistener)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_cnetworklistener/ut_cnetworklistener.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../inc
+INCLUDEPATH += ../common
+DEFINES += QT_NO_DEBUG_STREAM BUILD_NETWORKHANDLINGSTARTER
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib \
+          -lsymbianmock
+}
+
+# test code
+HEADERS += ./inc/ut_cnetworklistener.h
+SOURCES += ./src/ut_cnetworklistener.cpp
+
+# code to be tested
+HEADERS += ../../inc/cnetworklistener.h
+SOURCES += ../../src/cnetworklistener.cpp
+
+# mocks needed for testing
+SOURCES += ../mocks/mock_cnwsession.cpp
+SOURCES += ../mocks/mock_centralrepository.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/inc/ut_networkhandlingstarter.h	Fri Jun 04 10:19:18 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 UT_NETWORKHANDLINGSTARTER_H
+#define UT_NETWORKHANDLINGSTARTER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class NetworkHandlingStarter;
+
+class ut_networkhandlingstarter : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:
+    
+    ut_networkhandlingstarter();
+    ~ut_networkhandlingstarter();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_test();
+
+    
+private:
+    
+    NetworkHandlingStarter *m_NetworkHandlingStarter;
+
+};
+
+#endif // UT_NETWORKHANDLINGSTARTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/src/ut_networkhandlingstarter.cpp	Fri Jun 04 10:19:18 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 <ut_networkhandlingstarter.h>
+#include <qtestmains60.h>
+#include <networkhandlingstarter.h>
+
+/*!
+  ut_networkhandlingstarter::ut_networkhandlingstarter
+ */
+ut_networkhandlingstarter::ut_networkhandlingstarter() 
+    : m_NetworkHandlingStarter(0)
+{
+}
+
+/*!
+  ut_networkhandlingstarter::~ut_networkhandlingstarter
+ */
+ut_networkhandlingstarter::~ut_networkhandlingstarter()
+{
+}
+
+/*!
+  ut_networkhandlingstarter::init
+ */
+void ut_networkhandlingstarter::init()
+{
+    initialize();
+    
+    m_NetworkHandlingStarter = new NetworkHandlingStarter();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  ut_networkhandlingstarter::cleanup
+ */
+void ut_networkhandlingstarter::cleanup()
+{
+    delete m_NetworkHandlingStarter;
+    m_NetworkHandlingStarter = 0;
+    
+    reset();
+}
+
+/*!
+  ut_networkhandlingstarter::t_test
+ */
+void ut_networkhandlingstarter::t_test()
+{
+    m_NetworkHandlingStarter->start();
+    m_NetworkHandlingStarter->start();
+}
+
+QTEST_MAIN_S60(ut_networkhandlingstarter)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter/ut_networkhandlingstarter.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../inc
+INCLUDEPATH += ../common
+DEFINES += QT_NO_DEBUG_STREAM BUILD_NETWORKHANDLINGSTARTER
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib \
+          -lsymbianmock \
+          -lxqservice
+}
+
+# test code
+HEADERS += ./inc/ut_networkhandlingstarter.h
+SOURCES += ./src/ut_networkhandlingstarter.cpp
+
+# code to be tested
+HEADERS += ../../inc/networkhandlingstarter.h
+SOURCES += ../../src/networkhandlingstarter.cpp
+
+# mocks needed for testing
+HEADERS += ../../inc/networkhandlingstarter_p.h
+SOURCES += ../mocks/mock_networkhandlingstarter_p.cpp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/inc/ut_networkhandlingstarter_p.h	Fri Jun 04 10:19:18 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 UT_NETWORKHANDLINGSTARTER_P_H
+#define UT_NETWORKHANDLINGSTARTER_P_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+#include <hbmainwindow.h>
+
+class NetworkHandlingStarterPrivate;
+
+class ut_networkhandlingstarter_p : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:
+    
+    ut_networkhandlingstarter_p();
+    ~ut_networkhandlingstarter_p();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_LaunchNetworksettingsPlugin();
+    void t_ViewDone();
+    void t_ShowNote();
+    void t_RemoveNote();
+
+    
+private:
+    
+    NetworkHandlingStarterPrivate *m_NetworkHandlingStarterPrivate;
+    HbMainWindow m_HbMainWindow;
+    QList<HbMainWindow *> m_MainWindowList;
+
+};
+
+#endif // UT_NETWORKHANDLINGSTARTER_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/src/ut_networkhandlingstarter_p.cpp	Fri Jun 04 10:19:18 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 <ut_networkhandlingstarter_p.h>
+#include <qtestmains60.h>
+#include <networkhandlingstarter_p.h>
+
+/*!
+  ut_networkhandlingstarter_p::ut_networkhandlingstarter_p
+ */
+ut_networkhandlingstarter_p::ut_networkhandlingstarter_p() 
+    : m_NetworkHandlingStarterPrivate(0)
+{
+    SmcDefaultValue< QList<HbMainWindow *> >::SetL(m_MainWindowList);
+}
+
+/*!
+  ut_networkhandlingstarter_p::~ut_networkhandlingstarter_p
+ */
+ut_networkhandlingstarter_p::~ut_networkhandlingstarter_p()
+{
+    delete m_NetworkHandlingStarterPrivate;
+}
+
+/*!
+  ut_networkhandlingstarter_p::init
+ */
+void ut_networkhandlingstarter_p::init()
+{
+    initialize();
+    
+    m_NetworkHandlingStarterPrivate = new NetworkHandlingStarterPrivate();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  ut_networkhandlingstarter_p::cleanup
+ */
+void ut_networkhandlingstarter_p::cleanup()
+{
+    delete m_NetworkHandlingStarterPrivate;
+    m_NetworkHandlingStarterPrivate = 0;
+    m_MainWindowList.clear();
+    
+    reset();
+}
+
+/*!
+  ut_networkhandlingstarter_p::t_LaunchNetworksettingsPlugin
+ */
+void ut_networkhandlingstarter_p::t_LaunchNetworksettingsPlugin()
+{
+    m_NetworkHandlingStarterPrivate->LaunchCpNetworkPluginView();
+    
+    m_MainWindowList.append(&m_HbMainWindow);
+    expect("HbInstance::allMainWindows").returns(m_MainWindowList).times(2);
+    m_NetworkHandlingStarterPrivate->LaunchCpNetworkPluginView();
+}
+
+/*!
+  ut_networkhandlingstarter_p::t_ViewDone
+ */
+void ut_networkhandlingstarter_p::t_ViewDone()
+{
+    m_NetworkHandlingStarterPrivate->ViewDone();
+    
+    m_MainWindowList.append(&m_HbMainWindow);
+    expect("HbInstance::allMainWindows").returns(m_MainWindowList);
+    m_NetworkHandlingStarterPrivate->ViewDone();
+}
+
+/*!
+  ut_networkhandlingstarter_p::t_ShowNote
+ */
+void ut_networkhandlingstarter_p::t_ShowNote()
+{
+    m_NetworkHandlingStarterPrivate->ShowNote();
+    m_NetworkHandlingStarterPrivate->ShowNote();
+}
+
+/*!
+  ut_networkhandlingstarter_p::t_RemoveNote
+ */
+void ut_networkhandlingstarter_p::t_RemoveNote()
+{
+    // Create note
+    m_NetworkHandlingStarterPrivate->ShowNote();
+    // Test
+    m_NetworkHandlingStarterPrivate->RemoveNote();
+    m_NetworkHandlingStarterPrivate->RemoveNote();
+}
+
+QTEST_MAIN_S60(ut_networkhandlingstarter_p)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/networkhandlingstarter/tsrc/ut_networkhandlingstarter_p/ut_networkhandlingstarter_p.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../inc
+INCLUDEPATH += ../common
+DEFINES += QT_NO_DEBUG_STREAM BUILD_NETWORKHANDLINGSTARTER
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib \
+          -lsymbianmock \
+          -lxqserviceutil
+}
+
+# test code
+HEADERS += ./inc/ut_networkhandlingstarter_p.h
+SOURCES += ./src/ut_networkhandlingstarter_p.cpp
+
+# code to be tested
+HEADERS += ../../inc/networkhandlingstarter_p.h
+SOURCES += ../../src/networkhandlingstarter_p.cpp
+
+# mocks needed for testing
+SOURCES += ../mocks/mock_cnetworklistener.cpp
+SOURCES += ../mocks/mock_cppluginlauncher.cpp
+SOURCES += ../mocks/mock_hbdevicemessagebox.cpp
+SOURCES += ../mocks/mock_hbaction.cpp
+SOURCES += ../mocks/mock_hbinstance.cpp
+SOURCES += ../mocks/mock_hbmainwindow.cpp
+SOURCES += ../mocks/mock_qgraphicsview.cpp
+SOURCES += ../mocks/mock_qabstractscrollarea.cpp
+SOURCES += ../mocks/mock_qframe.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/bwins/parserrecognizeru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+EXPORTS
+	?metaObject@ParserRecognizer@@UBEPBUQMetaObject@@XZ @ 1 NONAME ; struct QMetaObject const * ParserRecognizer::metaObject(void) const
+	?tr@ParserRecognizer@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString ParserRecognizer::tr(char const *, char const *, int)
+	??0ParserRecognizer@@QAE@PAVQObject@@@Z @ 3 NONAME ; ParserRecognizer::ParserRecognizer(class QObject *)
+	?tr@ParserRecognizer@@SA?AVQString@@PBD0@Z @ 4 NONAME ; class QString ParserRecognizer::tr(char const *, char const *)
+	?qt_metacast@ParserRecognizer@@UAEPAXPBD@Z @ 5 NONAME ; void * ParserRecognizer::qt_metacast(char const *)
+	?getStaticMetaObject@ParserRecognizer@@SAABUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const & ParserRecognizer::getStaticMetaObject(void)
+	??_EParserRecognizer@@UAE@I@Z @ 7 NONAME ; ParserRecognizer::~ParserRecognizer(unsigned int)
+	?sendMessage@ParserRecognizer@@QAEXHH@Z @ 8 NONAME ; void ParserRecognizer::sendMessage(int, int)
+	?trUtf8@ParserRecognizer@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString ParserRecognizer::trUtf8(char const *, char const *)
+	?staticMetaObject@ParserRecognizer@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const ParserRecognizer::staticMetaObject
+	??1ParserRecognizer@@UAE@XZ @ 11 NONAME ; ParserRecognizer::~ParserRecognizer(void)
+	?qt_metacall@ParserRecognizer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int ParserRecognizer::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@ParserRecognizer@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString ParserRecognizer::trUtf8(char const *, char const *, int)
+	?requestCompleted@ParserRecognizer@@AAEXABVQVariant@@@Z @ 14 NONAME ; void ParserRecognizer::requestCompleted(class QVariant const &)
+	?requestError@ParserRecognizer@@AAEXH@Z @ 15 NONAME ; void ParserRecognizer::requestError(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/eabi/parserrecognizeru.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,17 @@
+EXPORTS
+	_ZN16ParserRecognizer11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN16ParserRecognizer11qt_metacastEPKc @ 2 NONAME
+	_ZN16ParserRecognizer11sendMessageEii @ 3 NONAME
+	_ZN16ParserRecognizer16staticMetaObjectE @ 4 NONAME DATA 16
+	_ZN16ParserRecognizer19getStaticMetaObjectEv @ 5 NONAME
+	_ZN16ParserRecognizerC1EP7QObject @ 6 NONAME
+	_ZN16ParserRecognizerC2EP7QObject @ 7 NONAME
+	_ZN16ParserRecognizerD0Ev @ 8 NONAME
+	_ZN16ParserRecognizerD1Ev @ 9 NONAME
+	_ZN16ParserRecognizerD2Ev @ 10 NONAME
+	_ZNK16ParserRecognizer10metaObjectEv @ 11 NONAME
+	_ZTI16ParserRecognizer @ 12 NONAME
+	_ZTV16ParserRecognizer @ 13 NONAME
+	_ZN16ParserRecognizer16requestCompletedERK8QVariant @ 14 NONAME
+	_ZN16ParserRecognizer12requestErrorEi @ 15 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/inc/parserrecognizer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,55 @@
+/*!
+* Copyright (c) 2009-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:  Recognizes the parser messages that needs to be notified to 
+*               the world using QtHighway.
+*/
+
+#ifndef PARSERRECOGNIZER_H
+#define PARSERRECOGNIZER_H
+
+#include <QObject>
+#include <xqservicerequest.h>
+
+#ifdef BUILD_PARSERRECOGNIZER
+#define PARSERRECOGNIZER_EXPORT Q_DECL_EXPORT
+#else
+#define PARSERRECOGNIZER_EXPORT Q_DECL_IMPORT
+#endif
+
+class PARSERRECOGNIZER_EXPORT ParserRecognizer : public QObject
+{
+    Q_OBJECT
+
+public:
+    ParserRecognizer(QObject *parent = 0);
+    ~ParserRecognizer();
+    
+    /*!
+        \fn sendMessage(const int message, const int callId)
+        
+        This method takes a Phone Engine message and a caller id.
+        It recognizes the messages that needs to be sent to the
+        QtHighway. If message isn't recognized it doesn't do anything.
+    */
+    void sendMessage(const int message, const int callId);
+
+private slots:
+    void requestCompleted(const QVariant &returnValue);
+    void requestError(int error);
+    
+private:
+    XQServiceRequest *m_currentRequest;
+};
+
+#endif // PARSERRECOGNIZER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/parserrecognizer.pri	Fri Jun 04 10:19:18 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: 
+#
+
+SOURCES=\
+    ./src/parserrecognizer.cpp
+
+HEADERS=\
+    ./inc/parserrecognizer.h
+    
+DIALSERVICE_API_HEADERS=\
+		./inc/parserrecognizer.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/parserrecognizer.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = lib
+TARGET = parserrecognizer
+
+symbian {
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA =1
+    TARGET.UID3 = 0x20029F87
+    DEFINES += BUILD_PARSERRECOGNIZER
+    
+    INCLUDEPATH += ../../inc \
+                   ../phonemodel/inc
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    
+    parserDefFiles = \
+        "$${LITERAL_HASH}ifdef WINSCW" \
+        "DEFFILE bwins/parserrecognizer.def" \
+        "$${LITERAL_HASH}else" \
+        "DEFFILE eabi/parserrecognizer.def" \
+        "$${LITERAL_HASH}endif"
+        
+    MMP_RULES += parserDefFiles
+
+    LIBS += -lxqservice \
+            -lxqserviceutil
+}
+
+# Input
+#include(\ext\mw\qthighway\xqservicebase.pri)
+include(./parserrecognizer.pri)
+
+headers.sources = $$PARSERRECOGNIZER_API_HEADERS
+headers.path = |../../inc
+# This is for new exporting system coming in garden
+for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$headers.path/$$basename(header)"	   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/src/parserrecognizer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,127 @@
+/*!
+* Copyright (c) 2009-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:  Recognizes the parser messages that needs to be notified to 
+*               the world using QtHighway.
+*/
+
+#include <xqservicerequest.h>
+#include <pevirtualengine.h>
+#include "parserrecognizer.h"
+#include "qtphonelog.h"
+
+ParserRecognizer::ParserRecognizer(QObject* parent) 
+    : 
+    QObject(parent),
+    m_currentRequest(0)
+{
+}
+
+ParserRecognizer::~ParserRecognizer()
+{
+    delete m_currentRequest;
+}
+
+void ParserRecognizer::sendMessage(const int message, const int callId)
+{
+    Q_UNUSED(callId); // for now
+    PHONE_DEBUG2("ParserRecognizer::sendMessage message:", message);
+    QString api;
+    QString method;
+    bool recognized = true;
+    
+    switch(message) {
+    case MEngineMonitor::EPEMessageActivateRfsDeep:
+        api = "com.nokia.services.telephony";
+        method = "activateDeepRestoreFactorySettings()";
+        break;
+    
+    case MEngineMonitor::EPEMessageActivateRfsNormal:
+        api = "com.nokia.services.telephony";
+        method = "activateNormalRestoreFactorySettings()";
+        break;
+    
+    case MEngineMonitor::EPEMessageShowBTDeviceAddress:
+        api = "com.nokia.services.bluetooth";
+        method = "showBluetoothDeviceAddress()";
+        break;
+    
+    case MEngineMonitor::EPEMessageShowBTLoopback:
+        api = "com.nokia.services.bluetooth";
+        method = "showBluetoothLoopback()";
+        break;
+    
+    case MEngineMonitor::EPEMessageBTDebugMode:
+        api = "com.nokia.services.bluetooth";
+        method = "activateBluetoothDebugMode()";
+        break;
+    
+    case MEngineMonitor::EPEMessageShowVersion:
+        api = "com.nokia.services.devicemanager";
+        method = "showVersionNumber()";
+        break;
+    
+    case MEngineMonitor::EPEMessageSSRequestFailed:
+        api = "com.nokia.services.telephony";
+        method = "supplementaryServiceRequestFailed()";
+        break;
+    
+    default:
+      recognized = false;
+      break;        
+    }
+    
+    if (recognized && (!m_currentRequest)) {
+        PHONE_DEBUG2("ParserRecognizer::sendMessage api:", api);
+        PHONE_DEBUG2("ParserRecognizer::sendMessage method:", method);
+        m_currentRequest = new XQServiceRequest(api, method, false);
+        // Due to a Qt Highway bug in assignment operator implementation we 
+        // need to set request as asynchronous with a setter function.
+        m_currentRequest->setSynchronous(false);
+        connect(
+            m_currentRequest, SIGNAL(requestCompleted(const QVariant &)), 
+            this, SLOT(requestCompleted(const QVariant &)));
+        connect(
+            m_currentRequest, SIGNAL(requestError(int)), 
+            this, SLOT(requestError(int)));
+        
+        int exceptionAsError = 0;
+        bool requestOk = false;
+        QT_TRYCATCH_ERROR(
+            exceptionAsError, requestOk = m_currentRequest->send());
+        if ((0 != exceptionAsError) || (!requestOk)) {
+            PHONE_DEBUG2("ParserRecognizer::sendMessage exceptionAsError:", 
+                exceptionAsError);
+            PHONE_DEBUG2("ParserRecognizer::sendMessage requestOk:", 
+                requestOk);
+            requestCompleted(QVariant());
+        }
+    }
+}
+
+void ParserRecognizer::requestCompleted(const QVariant &returnValue)
+{
+    PHONE_DEBUG("ParserRecognizer::requestCompleted");
+    Q_UNUSED(returnValue);
+    
+    delete m_currentRequest;
+    m_currentRequest = NULL;
+}
+
+void ParserRecognizer::requestError(int error)
+{
+    PHONE_DEBUG2("ParserRecognizer::requestError", error);
+    
+    delete m_currentRequest;
+    m_currentRequest = NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/tsrc/README.txt	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,5 @@
+ut_parserrecognizer
+
+If you run qmake then please modify the created mmp file of this project.
+You need to remove \epoc32\include from the mmp. Otherwise the parserrecognizer.cpp
+will see the original instead of the mocked version.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/tsrc/runtests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,21 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+echo OFF
+
+del \epoc32\winscw\c\private\E31F4ECF\ut_parserrecognizer.log
+\epoc32\release\winscw\udeb\ut_parserrecognizer.exe -o ut_parserrecognizer.log
+type \epoc32\winscw\c\private\E31F4ECF\ut_parserrecognizer.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/tsrc/unit.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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
+SUBDIRS += ut_parserrecognizer
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/README.txt	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,5 @@
+ut_parserrecognizer
+
+If you run qmake then please modify the created mmp file of this project.
+You need to remove \epoc32\include from the mmp. Otherwise the parserrecognizer.cpp
+will see the original instead of the mocked version.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/unit_tests.cpp	Fri Jun 04 10:19:18 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:  Unit tests for ParserRecognizer.
+*
+*/
+
+#include <QtTest/QtTest>
+
+//#include <hbglobal_p.h>
+#include "xqservicerequest.h"
+#include "parserrecognizer.h"
+#include "pevirtualengine.h"
+
+QString apiString;
+QString methodString;
+bool sendCalled;
+bool gSendRequestResult = true;
+
+class TestParserRecognizer : public QObject
+{
+    Q_OBJECT
+public:
+    TestParserRecognizer();
+    virtual ~TestParserRecognizer();
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup ();
+        
+private slots:
+    void testActivateRfsDeep();
+    void testActivateRfsNormal();
+    void testActivateWarrantyMode();
+    void testShowBTDeviceAddress();
+    void testShowBTLoopback();
+    void testActivateBTDebugMode();
+    void testShowIMEI();
+    void testShowVersion();
+    void testShowWLANMacAddress();
+    void testSSRequestFailed();
+    void testSendRequestFail();
+    void testSimultaneousRequests();
+
+private:
+    ParserRecognizer *parserRecognizer; // class under test
+};
+
+XQServiceRequest::XQServiceRequest(QString const& api, QString const& method, bool const& sync)
+{
+    Q_UNUSED(sync);
+    apiString = api;
+    methodString = method;
+}
+
+bool XQServiceRequest::send()
+{
+    sendCalled = true;
+    return gSendRequestResult;
+}
+
+bool XQServiceRequest::send(QVariant& retValue)
+{
+    Q_UNUSED(retValue);
+    sendCalled = true;
+    return gSendRequestResult;
+}
+
+void XQServiceRequest::setSynchronous(const bool &synchronous)
+{
+    Q_UNUSED(synchronous);
+}
+
+XQServiceRequest::~XQServiceRequest()
+{
+}
+
+TestParserRecognizer::TestParserRecognizer ()
+{
+}
+
+TestParserRecognizer::~TestParserRecognizer ()
+{
+}
+
+void TestParserRecognizer::initTestCase ()
+{
+}
+
+void TestParserRecognizer::cleanupTestCase ()
+{
+}
+
+void TestParserRecognizer::init ()
+{
+    apiString = "";
+    methodString = "";
+    sendCalled = false;
+    gSendRequestResult = true;
+    parserRecognizer = new ParserRecognizer;
+}
+
+void TestParserRecognizer::cleanup ()
+{
+    delete parserRecognizer;
+}
+
+void TestParserRecognizer::testActivateRfsDeep()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageActivateRfsDeep, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.telephony"));
+    QCOMPARE(methodString, QString("activateDeepRestoreFactorySettings()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testActivateRfsNormal()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageActivateRfsNormal, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.telephony"));
+    QCOMPARE(methodString, QString("activateNormalRestoreFactorySettings()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testActivateWarrantyMode()
+{
+    // Lifetimer is implemented by phone and should not be handled 
+    // by the recognizer.
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageActivateWarrantyMode, 0);
+    QCOMPARE(apiString, QString(""));
+    QCOMPARE(methodString, QString(""));
+    QCOMPARE(sendCalled, false);
+}
+
+void TestParserRecognizer::testShowBTDeviceAddress()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowBTDeviceAddress, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.bluetooth"));
+    QCOMPARE(methodString, QString("showBluetoothDeviceAddress()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testShowBTLoopback()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowBTLoopback, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.bluetooth"));
+    QCOMPARE(methodString, QString("showBluetoothLoopback()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testActivateBTDebugMode()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageBTDebugMode, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.bluetooth"));
+    QCOMPARE(methodString, QString("activateBluetoothDebugMode()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testShowIMEI()
+{
+    // IMEI code showing is implemented by phone and should not be handled 
+    // by the recognizer.
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowIMEI, 0);
+    QCOMPARE(apiString, QString(""));
+    QCOMPARE(methodString, QString(""));
+    QCOMPARE(sendCalled, false);
+}
+
+void TestParserRecognizer::testShowVersion()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.devicemanager"));
+    QCOMPARE(methodString, QString("showVersionNumber()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testShowWLANMacAddress()
+{
+    // WLAN address showing not supported currently (TB 10.1)
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowWlanMacAddress, 0);
+    QCOMPARE(apiString, QString(""));
+    QCOMPARE(methodString, QString(""));
+    QCOMPARE(sendCalled, false);
+}
+
+void TestParserRecognizer::testSSRequestFailed()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageSSRequestFailed, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.telephony"));
+    QCOMPARE(methodString, QString("supplementaryServiceRequestFailed()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testSendRequestFail()
+{
+    gSendRequestResult = false;
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.devicemanager"));
+    QCOMPARE(methodString, QString("showVersionNumber()"));
+    QCOMPARE(sendCalled, true);
+}
+
+void TestParserRecognizer::testSimultaneousRequests()
+{
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0);
+    QCOMPARE(apiString, QString("com.nokia.services.devicemanager"));
+    QCOMPARE(methodString, QString("showVersionNumber()"));
+    QCOMPARE(sendCalled, true);
+    
+    sendCalled = false;
+    parserRecognizer->sendMessage(MEngineMonitor::EPEMessageShowVersion, 0);
+    QCOMPARE(sendCalled, false);
+}
+
+QTEST_MAIN(TestParserRecognizer)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/ut_parserrecognizer.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xE31F4ECF
+DEPENDPATH += .
+CONFIG += qtestlib
+QT -= gui
+
+symbian {
+	INCLUDEPATH +=./
+	INCLUDEPATH +=../../../../inc
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+	TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += BUILD_PARSERRECOGNIZER
+}
+
+# Input
+HEADERS += xqservicerequest.h
+HEADERS += ../../inc/parserrecognizer.h
+SOURCES += unit_tests.cpp
+SOURCES += ../../src/parserrecognizer.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/parserrecognizer/tsrc/ut_parserrecognizer/xqservicerequest.h	Fri Jun 04 10:19:18 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: 
+*
+*/
+
+#ifndef XQSERVICEREQUEST_H
+#define XQSERVICEREQUEST_H
+
+#include <QVariant>
+#include <QString>
+
+class XQServiceRequest : public QObject
+{
+    Q_OBJECT
+
+public:
+    XQServiceRequest(QString const& api, QString const& method, bool const& sync = true);
+    ~XQServiceRequest();
+    bool send();
+    bool send(QVariant& retValue);
+    void setSynchronous(const bool &synchronous);
+
+signals:
+    void requestCompleted(const QVariant& value) ;
+    void requestError(int err);
+};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/api_headers.pri	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+CNTFINDER2_API_HEADERS = \
+                        ./inc/cphonecntfactory.h \
+                        ./inc/mphcntmatch.h \
+                        ./inc/cphcntmatcher.h \
+                        ./inc/cphcntcontactid.h 
+                        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/bwins/phonecntfinderu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?CreateCntFactoryL@@YAPAVCPhCntFactory@@XZ @ 1 NONAME ; class CPhCntFactory * CreateCntFactoryL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/eabi/phonecntfinderu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z17CreateCntFactoryLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphcntcontactid.h	Fri Jun 04 10:19:18 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 CPHCNTCONTACTID_H
+#define CPHCNTCONTACTID_H
+
+#include <e32base.h>
+#include <cntdef.h>
+
+/**
+ *  Abstract base class for identifying a single contact
+ *  in contact stores.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+class CPhCntContactId : public CBase
+    {
+public:
+
+    /**
+     * Clones contact id.
+     *
+     * @since S60 v3.1
+     * @return New cloned instance of contact id.
+     */
+     virtual CPhCntContactId* CloneL() const  = 0;
+     
+     /**
+      * Invalidates this contact id. After this call, 
+      * IsValid call will return false.
+      * @since S60 v3.1
+      */
+     virtual void Invalidate() = 0;
+     
+     /**
+      * Is contact id valid.
+      * 
+      * @since S60 v3.1
+      * @return ETrue if contact id is valid.
+      */
+     virtual TBool IsValid() const = 0;
+     
+     /**
+      * Gives contact item id. If this id is not valid, then
+      * contact item id given is not valid.
+      * 
+      * @since S60 v3.1
+      * @return Contact item id.
+      */
+     virtual TContactItemId ContactId() const = 0;
+     
+     /**
+      * Packs Virtual phonebook contact link to descriptor.
+      * If this link is not valid, then packed data is not valid.
+      *
+      * @since S60 v3.1
+      * @return Packed virtual phonebook contact link.
+      */
+      virtual HBufC8* PackLC() const = 0;
+    
+      virtual ~CPhCntContactId() {};
+    };
+
+#endif // CPHCNTCONTACTID_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphcntcontactidimpl2.h	Fri Jun 04 10:19:18 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 CPHCNTCONTACTIDIMPL2_H
+#define CPHCNTCONTACTIDIMPL2_H
+
+#include <e32base.h>
+#include "cphcntcontactid.h"
+#include <qmobilityglobal.h>
+
+QTM_BEGIN_NAMESPACE
+class QContact;
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
+
+/**
+ *  Abstract base class for identifying a single contact
+ *  in contact stores.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS (CPhCntContactIdImpl2) : public CPhCntContactId
+    {
+public:
+
+    ~CPhCntContactIdImpl2();
+        /**
+        * Two-phased constructor.
+        * @return New instance
+        */
+   static CPhCntContactIdImpl2* NewL(const QContact aContact);
+   
+   //from base class
+   
+    /**
+     * Clones contact id.
+     *
+     * @since S60 v3.1
+     * @return New cloned instance of contact id.
+     */
+     CPhCntContactId* CloneL() const;
+     
+     /**
+      * Invalidates this contact id. After this call, 
+      * IsValid call will return false.
+      * @since S60 v3.1
+      */
+     void Invalidate();
+     
+     /**
+      * Is contact id valid.
+      * 
+      * @since S60 v3.1
+      * @return ETrue if contact id is valid.
+      */
+     TBool IsValid() const;
+     
+     /**
+      * Gives contact item id. If this id is not valid, then
+      * contact item id given is not valid.
+      * 
+      * @since S60 v3.1
+      * @return Contact item id.
+      */
+     TContactItemId ContactId() const;
+     
+     /**
+      * This function used to pack virtual phonebook contact link.
+      * Now it just packs the contact id (with phonebook3)
+      * @since S60 v3.1
+      * @return Contact Id
+      */
+      HBufC8* PackLC() const;
+    
+  
+      
+private:
+    CPhCntContactIdImpl2(const QContact aContact);
+private:
+    const QContact Contact() const; //contact for the cloning
+    
+private:
+    
+    const QContact iContact;
+    bool           iValid;
+    };
+
+#endif // CPHCNTCONTACTIDIMPL2_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphcntfactoryimpl2.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPHCNTFACTORYIMPL2_H
+#define CPHCNTFACTORYIMPL2_H
+
+//  INCLUDES
+#include    <e32base.h>
+#include    <cphonecntfactory.h>
+
+
+
+// FORWARD DECLARATIONS
+
+
+// CLASS DECLARATION
+
+/**
+*  Factory class's implementation. Not for external use.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntFactoryImpl2 ) : public CPhCntFactory
+    {
+    public: // Constructors and destructors.
+
+        /**
+        * Two-phased constructor.
+        *
+        * @return new instance of the class.
+        */
+        static CPhCntFactoryImpl2* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CPhCntFactoryImpl2();
+
+    public: // From base classes.
+
+
+
+        /**
+        * From CPhCntFactory
+        */
+        CPhCntMatcher* CreateContactMatcherL();
+
+
+        /**
+        * From CPhCntFactory
+        */
+        CBase* CreateProfileEngineNotifyHandlerL( 
+            MProfileChangeObserver* aObserver );
+ 
+            
+        /**
+         * Creates contact id instance.
+         *
+         * @since S60 v3.1
+         * @return New instance.
+         */
+        //CPhCntContactId* CreateContactIdL();
+        
+        /**
+         * From CPhCntFactory
+         * Creates an contact id instance.
+         *
+         * @since S60 v3.1
+         * @return New instance of CPhCntContactId
+         */
+        CPhCntContactId* CreateContactIdL( TContactItemId aContactId );
+        
+        /**
+         * From CPhCntFactory
+         *
+         * @since S60 v3.2
+         * @see CPhCntFactory
+         */
+        CPhCntContactId* CreateContactIdL( const TDesC8& aContactLink );
+
+        
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntFactoryImpl2();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+        
+  
+    };
+
+
+#endif      // CPHCNTFACTORYIMPL_H   
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphcntmatch2.h	Fri Jun 04 10:19:18 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 CPHCNTMATCH2_H
+#define CPHCNTMATCH2_H
+
+//  INCLUDES
+#include "mphcntmatch.h"
+#include <qmobilityglobal.h>
+
+// FORWARD DECLARATIONS
+class CPhCntContactIdImpl2;
+
+QTM_BEGIN_NAMESPACE
+class QContact;
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
+
+// CLASS DECLARATION
+
+/**
+*  Implementation for single match result.
+*  Passes all function calls to CPhCntMacthItem object.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntMatch2 ) : public CBase, public MPhCntMatch
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aContact associated contact
+        * @return New instance
+        */
+        static CPhCntMatch2* NewL(const QContact aContact);
+        
+        /**
+        * Destructor.
+        */
+        ~CPhCntMatch2();
+        
+        /**
+        * overrides the number returned from the contact
+        */
+        void SetNumberL(const TDesC& aNumber);
+
+    protected: // Functions from base classes
+
+        /**
+        * From MPhCntMatch
+        */ 
+        void Release();
+
+        /**
+        * From MPhCntMatch
+        */ 
+        CPhCntContactId* ContactId() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TNumberType NumberType() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TCliType Cli( HBufC*& aCliText ) const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TPtrC FirstName() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TPtrC LastName() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TPtrC CompanyName() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TPtrC Number() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TPtrC PersonalRingingTone() const;
+
+        /**
+        * From MPhCntMatch
+        */ 
+        TBool BelongsToGroups( 
+            const CArrayFix<TContactItemId>& aGroupArray ) const;
+
+        /**
+        * @see MPhCntMatch::TextToSpeechTextL.
+        * @since Series 60 3.0
+        */
+        virtual HBufC* TextToSpeechTextL() const;
+        
+        /**
+        * From MPhCntMatch
+        * @since Series 60 3.1
+        */ 
+        TPtrC CallText() const;
+        
+        /**
+        * From MPhCntMatch
+        * @since Series 60 3.1
+        */ 
+        TPtrC CallImage() const;
+        
+        /**
+        * From MPhCntMatch
+        * @since Series 60 3.1
+        */ 
+        TBool HasThumbnailImage() const;
+        
+        /**
+        * From MPhCntMatch
+        */
+        CDesCArray& AllDtmfNumbers() const;
+
+
+ 
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntMatch2(const QContact aContact);
+    private:
+        void ConstructL();
+        /*
+         * checks for exactly 1 item in the list
+         */
+         TPtrC FieldValue(const QString& name, const QString& key) const;
+
+    private:    // Data
+        const QContact iContact;
+        HBufC* iNumber;
+        CPhCntContactIdImpl2* iContactId;
+        CDesCArrayFlat* iDummyArray;
+
+    };
+
+#endif      // CPHCNTMATCH2_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphcntmatcher.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CPHCNTMATCHER_H
+#define CPHCNTMATCHER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <cntdef.h>     // TContactItemId
+#include <badesca.h>
+
+#include "mphcntmatch.h"
+
+// CONSTANTS
+const TInt KPhCntInvalidFieldId = KErrNotFound;
+
+// DATA TYPES
+typedef TInt TFieldId;
+
+// FORWARD DECLARATIONS
+
+class MVPbkContactLink;
+
+// CLASS DECLARATION
+
+/**
+*  Abstract class for making matches.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CPhCntMatcher 
+    : public CBase
+    {
+    public:  // Constructors and destructor  
+
+        /**
+        * Match number to phonebook.
+        * @param aMatch Found match, owership tranferred. NULL if not found any.
+        * @param aTelNumber Number to match against.
+        * @return Error code: KErrNone - one match found
+        *                     KErrNotFound - no matches found
+        *                     KErrAlreadyExists - several matches -> no match
+        *                     KErrUnderflow - Number too short for matching
+        *                     KErrAccessDenied - Can't get phonebook instance
+        *                     other - normal Symbian OS error
+        */
+        virtual TInt MatchNumber( 
+            MPhCntMatch*& aMatch, 
+            const TDesC& aTelNumber ) = 0;
+
+        /**
+        * Match number to phonebook.
+        * @param aMatch Found match, owership tranferred. NULL if not found any.
+        * @param aTelNumber Number to match against.
+        * @param aContactId Current contact.
+        * @return Error code: KErrNone - one match found
+        *                     KErrNotFound - no matches found
+        *                     KErrAlreadyExists - several matches -> no match
+        *                     KErrUnderflow - Number too short for matching
+        *                     KErrAccessDenied - Can't get phonebook instance
+        *                     other - normal Symbian OS error
+        */
+        virtual TInt MatchNumber(
+            MPhCntMatch*& aMatch,
+            const TDesC& aTelNumber,
+            const CPhCntContactId& aContactLink ) = 0;
+
+
+        /**
+        * Match number to phonebook.
+        * @param aMatch Found match, owership tranferred. NULL if not found any.
+        * @param aNumber Number to match against.
+        * @param aAllowUsernameMatch 
+        *                        is ETrue if username is sufficient for match.
+        * @param aCharsForMatching Length of string to be used in matching.
+        *                       Starts from the end of VoIP number. Domain part
+        *                       not included for matching.
+        * @return Error code: KErrNone - one match found
+        *                     KErrNotFound - no matches found
+        *                     other - normal Symbian OS error
+        */    
+        virtual TInt MatchVoipNumber(
+            MPhCntMatch*& aMatch,
+            const TDesC& aNumber,
+            const TBool aAllowUsernameMatch,
+            TInt aCharsForMatching = 0 ) = 0;
+        
+         /**
+        * Gets VoIP call contact info from phonebook
+        * by contact id.
+        * @since Series60 3.0
+        * @param aMatch for found match, owership tranferred. Empty if not found.
+        * @param aContactId for current contact.
+        * @return Error code: KErrNone - VoIP call contact found
+        *                     KErrNotFound - no VoIP call contact found
+        *                     other - normal Symbian OS error
+        */    
+        virtual TInt MatchVoipNumber(
+            MPhCntMatch*& aMatch,
+            const CPhCntContactId& aContactId ) = 0;
+            
+        /**
+         * Determines if contact has other type of numbers
+         * than VoIP numbers.
+         * 
+         * @since S60 v3.2.
+         * @param aContactId Id of the contact.
+         * @return ETrue - CS numbers found from contact.
+         *         EFalse - No CS numbers found from contact.
+         */
+        virtual TBool HasCSNumbers( 
+            const CPhCntContactId& aContactId ) = 0;
+            
+        
+        /**
+        * Match number to phonebook.
+        * @param aMatch Found match, owership tranferred. NULL if not found any.
+        * @param aTelNumber Number to match against.
+        * @param aContactId  a contact id (unigue UID)
+        * @return Error code: KErrNone - one match found
+        *                     KErrNotFound - no matches found
+        *                     KErrAlreadyExists - several matches -> no match
+        *                     KErrUnderflow - Number too short for matching
+        *                     KErrAccessDenied - Can't get phonebook instance
+        *                     other - normal Symbian OS error
+        */
+        virtual TInt MatchNumber( 
+            MPhCntMatch*& aMatch, 
+            const TDesC& aTelNumber,
+            TInt aContactId ) = 0;
+
+    };
+
+#endif      // CPHCNTMATCHER_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphcntmatcherimpl2.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CPHCNTMATCHERIMPL_H
+#define CPHCNTMATCHERIMPL_H
+
+//  INCLUDES
+#include "cphcntmatcher.h"
+#include <centralrepository.h>
+#include <cenrepnotifyhandler.h>
+#include <qmobilityglobal.h>
+
+// FORWARD DECLARATIONS
+class CPhCntContactId;
+class CPhCntMatch2;
+
+QTM_BEGIN_NAMESPACE
+class QContactManager;
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
+
+// CLASS DECLARATION
+
+
+/**
+*  Implementation for making matches.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+NONSHARABLE_CLASS( CPhCntMatcherImpl2 ) :
+    public CPhCntMatcher
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @pre aContactManager != NULL
+        * @param aContactManager provides matching services. Ownership is transferred.
+        * @return New instance
+        */
+        static CPhCntMatcherImpl2* NewL(QContactManager* aContactManager);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPhCntMatcherImpl2();
+
+
+    public: // Functions from base classes
+
+        /**
+        * From CPhCntMatcher
+        */
+        TInt MatchNumber( MPhCntMatch*& aMatch,const TDesC& aTelNumber );
+
+        /**
+        * From CPhCntMatcher
+        */
+        TInt MatchNumber( 
+            MPhCntMatch*& aMatch,
+            const TDesC& aTelNumber,
+            const CPhCntContactId& aContactId );
+
+        /**
+        * From CPhCntMatcher
+        */
+        TInt MatchNumber(
+            MPhCntMatch*& aMatch,
+            const TDesC& aTelNumber,
+            const CPhCntContactId& aContactId,
+            const TFieldId aFieldId );
+
+            
+        /**
+        * Match number to phonebook.
+        * @param aMatch Found match, owership tranferred. NULL if not found any.
+        * @param aNumber Number to match against.
+        * @return Error code: KErrNone - one match found
+        *                     KErrNotFound - no matches found
+        *                     other - normal Symbian OS error
+        */    
+        TInt MatchVoipNumber(
+            MPhCntMatch*& aMatch,
+            const TDesC& aNumber,
+            TBool aAllowUserNameMatch,
+            TInt aCharsForMatching = 0 );
+        
+         /**
+        * From CPhCntMatcher, gets VoIP call contact info from phonebook
+        * by contact id.
+        * @since Series60 3.0
+        * @param aMatch for found match, owership tranferred. Empty if not found.
+        * @param aContactId for current contact.
+        * @return Error code: KErrNone - VoIP call contact found
+        *                     KErrNotFound - no VoIP call contact found
+        *                     other - normal Symbian OS error
+        */    
+        TInt MatchVoipNumber(
+            MPhCntMatch*& aMatch,
+            const CPhCntContactId& aContactId );
+
+        /**
+          * Determines if contact has other type of numbers
+          * than VoIP numbers.
+          * 
+          * @since S60 v3.2.
+          * @param aContactId Id of the contact.
+          * @return ETrue - CS numbers found from contact.
+          *         EFalse - No CS numbers found from contact.
+          */
+         virtual TBool HasCSNumbers( 
+             const CPhCntContactId& aContactId );
+             
+        /**
+        * @see CPhCntMatcher::MatchNumber
+        */
+        TInt MatchNumber( 
+            MPhCntMatch*& aMatch, 
+            const TDesC& aTelNumber,
+            TInt aContactId );
+
+
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CPhCntMatcherImpl2(QContactManager* aContactManager);
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+        
+
+    private:
+        CPhCntMatch2* iMatch; //only one now, must delete anyway.
+        QContactManager* iContactManager;
+
+  
+    };
+
+#endif      // CPHCNTMATCHERIMPL_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphcntpbkcontactid.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CPHCNTPBKCONTACTID_H
+#define CPHCNTPBKCONTACTID_H
+
+#include "cphcntcontactid.h"
+
+/**
+ *  Contact id used with contact engine.
+ *
+ *  @lib PhoneCntFinder
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CPhCntPbkContactId ): public CPhCntContactId
+    {
+public:
+
+    static CPhCntPbkContactId* NewL( TInt aContactId );
+
+    static CPhCntPbkContactId* NewLC( TInt aContactId );
+
+    virtual ~CPhCntPbkContactId();
+
+    /**
+     * Gives the contact id used with contact engine.
+     *
+     * @since S60 v3.1
+     * @return Contact id.
+     */
+    TContactItemId ContactId() const;
+
+// from base class CPhCntContactId
+
+    /**
+     * From CPhCntContactId
+     * Clones contact id.
+     *
+     * @since S60 v3.1
+     * @return New cloned instance of this contact id.
+     */
+    CPhCntContactId* CloneL() const;
+    
+    /**
+     * From CPhCntContactId
+     * Invalidates this contact id.
+     *
+     * @since S60 v3.1
+     */
+    void Invalidate();
+    
+    /**
+     * From CPhCntContactId
+     * Determines if this contact id is valid contact id.
+     *
+     * @since S60 v3.1
+     * @return ETrue if contact id is valid.
+     */
+    TBool IsValid() const;
+    
+    /**
+     * From CPhCntContactId
+     * Returns null.
+     *
+     * @since S60 v3.1
+     * @return null.
+     */
+    HBufC8* PackLC() const;
+    
+private:
+
+    CPhCntPbkContactId( TInt aContactId );
+
+private: // data
+
+    /**
+     * Contact identifier.
+     */
+    TInt iContactId;
+
+    };
+
+#endif // CPHCNTPBKCONTACTID_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/cphonecntfactory.h	Fri Jun 04 10:19:18 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 CPHCNTFACTORY_H
+#define CPHCNTFACTORY_H
+
+//  INCLUDES
+#include    <e32base.h>
+#include    <cntdef.h>
+
+// FORWARD DECLARATIONS
+
+class CPhCntMatcher;
+class MProfileChangeObserver;
+class CPhCntContactId;
+
+// CLASS DECLARATION
+
+/**
+*  Factory class for creating phonebook related classes.
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class CPhCntFactory : public CBase
+    {
+    public:
+
+
+        /** 
+        * Creates an instance of Contact Matcher
+        *
+        * @return Contact Matcher object. Ownership is transferred.
+        */
+        virtual CPhCntMatcher* CreateContactMatcherL() = 0;
+
+        /**
+        * Creates an instance of profile engine notify handler.
+        * @param aObserver observer to be notified of profile changes.
+        * @return new instance.
+        */
+        virtual CBase* CreateProfileEngineNotifyHandlerL( 
+            MProfileChangeObserver* aObserver ) = 0;
+        
+
+            
+        /**
+         * Creates contact id instance.
+         *
+         * @since S60 v3.1
+         * @return New instance.
+         */
+        //virtual CPhCntContactId* CreateContactIdL() = 0;
+            
+        /**
+         * Creates an contact id instance.
+         *
+         * @since S60 v3.1
+         * @return New instance of CPhCntContactId
+         */
+        virtual CPhCntContactId* CreateContactIdL( TContactItemId aContactId ) = 0;
+
+        /**
+         * Create and contact id instance from contact link.
+         *
+         * @since S60 v3.2
+         */
+        virtual CPhCntContactId* CreateContactIdL( const TDesC8& aContactId ) = 0;    
+
+ 
+    };
+
+/**
+* Creates CPhCntFactory. Position 1 in DLL's lookup table.
+* @return Reference to CPhCntFactory object. Ownership is transferred.
+*/
+IMPORT_C CPhCntFactory* CreateCntFactoryL();
+
+#endif      // CPHCNTFACTORY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/mphcntmatch.h	Fri Jun 04 10:19:18 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 MPHCNTMATCH_H
+#define MPHCNTMATCH_H
+
+//  INCLUDES
+#include <cntdef.h>     // TContactItemId
+#include <badesca.h>
+
+class MVPbkContactLink;
+class CPhCntContactId;
+
+// CLASS DECLARATION
+
+/**
+*  Abstact match result. 
+*
+*  @lib PhoneCntFinder
+*  @since 1.0
+*/
+class MPhCntMatch
+    {
+    public:
+        
+        /**
+        * Enumerates CLI types.
+        *
+        * ECliEmpty - not set/found.
+        * ECliNumber - phone number from contact.
+        * ECliName - name from contact.
+        * ECliCompany - company name from contact.
+        */
+        enum TCliType
+            {
+            ECliEmpty,  
+            ECliNumber,
+            ECliName,
+            ECliCompany
+            };
+            
+        enum TNumberType
+            {
+            ENone = 0,
+            EMobileNumber,
+            EStandardNumber,
+            EFaxNumber,
+            EPagerNumber,
+            EVoipNumber,
+            EVideoNumber,
+            EAssistantNumber,
+            ECarNumber,
+            EHomeNumber,
+            EWorkNumber            
+            }; 
+
+        /**
+        * To destroy the item. Must be called when item is not needed
+        * any more.
+        */
+        virtual void Release() = 0;
+
+        /**
+         * Contact id.
+         * @return Contact finder contact id.
+         */
+        virtual CPhCntContactId* ContactId() const = 0;
+        
+        /**
+        * Get the number type.
+        * @return Phonebook number type.
+        */
+        virtual TNumberType NumberType() const = 0;
+
+        /**
+        * Get CLI value.
+        * @param aCliText CLI is copied here. User must delete after usage.
+        * @return CLI type.
+        */
+        virtual TCliType Cli( HBufC*& aCliText ) const = 0;
+
+        /**
+        * First name field from contact.
+        * @return Field text. Empty if there isn't one specified.
+        */
+        virtual TPtrC FirstName() const = 0;
+
+        /**
+        * Last name field from contact.
+        * @return Field text. Empty if there isn't one specified.
+        */
+        virtual TPtrC LastName() const = 0;
+
+        /**
+        * Company name field from contact.
+        * @return Field text. Empty if there isn't one specified.
+        */
+        virtual TPtrC CompanyName() const = 0;
+
+        /**
+        * Number field from contact (from matched field).
+        * @return Field text. Empty if there isn't one specified.
+        */
+        virtual TPtrC Number() const = 0;
+
+        /**
+        * Ringing tone field from contact.
+        * @return Field text. Empty if there isn't one specified.
+        */
+        virtual TPtrC PersonalRingingTone() const = 0;
+
+        /**
+        * Find if contact belong to any contact groups given.
+        * @param aGroupArray Compared contact groups.
+        * @return ETrue is belogns at least one group from parameter.
+        */
+        virtual TBool BelongsToGroups( 
+            const CArrayFix<TContactItemId>& aGroupArray ) const = 0;
+
+        /**
+        * Returns text to speech text for this contact. Used in
+        * text to speech ringing tone.
+        * @since Series 60 3.0
+        * @return descriptor, ownership passed.
+        */
+        virtual HBufC* TextToSpeechTextL() const = 0;
+        
+        /**
+        * Call text field from contact.
+        * @since Series 60 3.1
+        * @return Field text. Empty if there isn't one specified.
+        */
+        virtual TPtrC CallText() const = 0;
+
+        /**
+        * Call image field from contact.
+        * @since Series 60 3.1
+        * @return Field text. Empty if there isn't one specified.
+        */
+        virtual TPtrC CallImage() const = 0;
+        
+        /**
+        * Can used to check if contact has a thumbnail image.
+        * @since Series 60 3.1
+        * @return ETrue if has thumbnail, otherwise EFalse.
+        */
+        virtual TBool HasThumbnailImage() const = 0;      
+        
+        /**
+        * Returns all dtmf numbers which are found from
+        * a single contact
+        * @Since Series S60 3.2
+        * @return array of DTMF numbers.
+        */
+        virtual CDesCArray& AllDtmfNumbers() const = 0;    
+
+    };
+
+#endif      // MPHCNTMATCH_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/phcntpanic.h	Fri Jun 04 10:19:18 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 PHCNTPANIC
+#define PHCNTPANIC
+
+#include <e32std.h>
+
+enum TPhCntPanic 
+    {
+    EPhCntOperationAlreadyOngoing,
+    EPhCntServiceRequestActiveAlready
+    };
+
+/**
+ * Panics the current thread with panic code.
+ * @since S60 v3.1
+ * @param aPanicCode Panic code used with panic.
+ */
+void PhCntPanic( TPhCntPanic aPanicCode );
+
+
+#endif // PHCNTPANIC
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/phcnttrace.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef PHCNTTRACE_H
+#define PHCNTTRACE_H
+
+#include <e32std.h>
+
+//#define PHCNT_TRACE
+
+#ifdef PHCNT_TRACE
+
+#pragma message("DEBUG PRINTS ON")
+
+#define PRINTF( format, data ) RDebug::Print( _L(format), data );
+#define PRINT( format ) RDebug::RawPrint( _L(format) );
+
+#else
+
+#define PRINTF( format, data )
+#define PRINT( format ) 
+
+#endif // PHCNT_TRACE
+
+#endif // PHCNTTRACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/inc/qcontactfields.h	Fri Jun 04 10:19:18 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 QCONTACTFIELDS_H_
+#define QCONTACTFIELDS_H_
+
+
+//-------------- Fields supported by database ----------------------------------// 
+//Fields
+const QString fieldFirstName("FIRSTNAME"); //QVariant( QString )
+const QString fieldLastName("LASTNAME");
+const QString fieldNickName("NICKNAME");
+const QString fieldNumber("NUMBER"); 
+const QString fieldAddress("ADDRESS"); 
+const QString fieldEmail("EMAIL"); 
+const QString fieldSip("SIP"); 
+const QString fieldPortrait("PORTRAIT"); 
+//....
+
+//Field properties
+const QString typeMobile("MOBILE"); //NUMBER 
+const QString typeFax("FAX"); //NUMBER 
+const QString typeHome("HOME"); //NUMBER & EMAIL & ADDRESS
+const QString typeWork("WORK"); //NUMBER & EMAIL & ADDRESS
+//....
+
+//Field parameters
+const QString parameterStreet("STREET"); //ADDRESS
+const QString parameterPostCode("POSTCODE"); //ADDRESS
+
+
+//-------------- Field Collections supported by the database --------------------//
+//All fields used for call (e.g. number and sip)
+const QString callFields("CALL");
+
+//All fields used for sms
+const QString smsFields("SMS");
+
+//All fields used for email (home, business etc.)
+const QString emailFields("EMAIL");
+
+#endif // QCONTACTFIELDS_H_
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/phonecntfinder.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 
+;
+; Languages
+&EN
+
+; Header
+#{"PhoneCntFinder"}, (0x10005998), 10, 1, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+"\epoc32\RELEASE\armv5\UREL\phonecntfinder.dll"-"z:\sys\bin\phonecntfinder.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/phonecntfinder2.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = lib
+TARGET = phonecntfinder
+CONFIG += qtgui
+CONFIG += qtcore
+
+TARGET.EPOCALLOWDLLDATA =1
+TARGET.CAPABILITY = ALL -TCB
+TARGET.UID3 = 0x10005998
+TARGET.VID = VID_DEFAULT
+
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+INCLUDEPATH += ../../inc 
+                   
+defFiles = \
+    "$${LITERAL_HASH}ifdef WINSCW" \
+     "DEFFILE bwins/phonecntfinder.def" \
+     "$${LITERAL_HASH}else" \
+     "DEFFILE eabi/phonecntfinder.def" \
+     "$${LITERAL_HASH}endif"
+
+MMP_RULES += defFiles
+
+LIBS += -leuser \
+            -lrfs \
+            -fbscli.lib \
+            -lprofileeng \
+            -lcenrepnotifhandler \
+            -lcentralrepository \
+            -lecom \
+            -lbafl \
+            -lfeatmgr \
+            -lcharconv \
+            -lqtcontacts
+
+
+HEADERS += ./inc/cphcntfactoryimpl2.h
+HEADERS += ./inc/phcntpanic.h
+HEADERS += ./inc/cphcntmatch2.h
+HEADERS    += ./inc/cphcntcontactidimpl2.h            
+HEADERS += ./inc/cphcntmatcherimpl2.h
+
+
+SOURCES += ./src/cphcntfactoryimpl2.cpp
+SOURCES  += ./src/phcntpanic.cpp
+SOURCES  += ./src/cphcntmatch2.cpp
+SOURCES    += ./src/cphcntcontactidimpl2.cpp
+SOURCES  += ./src/cphcntmatcherimpl2.cpp
+
+include(api_headers.pri)
+
+headers.sources = $$CNTFINDER2_API_HEADERS
+headers.path = |../../inc
+# This is for new exporting system coming in garden
+for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$headers.path/$$basename(header)"       
+
+BLD_INF_RULES.prj_exports += \
+ "$${LITERAL_HASH}include <platform_paths.hrh>" \
+ "./rom/phonecntfinder.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(phonecntfinder.iby)"
+
+
+    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/rom/phonecntfinder.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  IBY file
+ *
+*/
+
+#ifndef __PHONECNTFINDER_IBY__
+#define __PHONECNTFINDER_IBY__
+
+file=ABI_DIR\BUILD_DIR\phonecntfinder.dll           SHARED_LIB_DIR\phonecntfinder.dll
+data=ZSYSTEM\install\phonecntfinder_stub.sis        System\Install\phonecntfinder_stub.sis
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/src/cphcntcontactidimpl2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,128 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Wraps the QContact for the legacy handling in the phone engine
+*/
+
+#include <e32base.h>
+#include <utf.h>
+#include <qcontact.h>
+#include "cphcntcontactidimpl2.h"
+// ---------------------------------------------------------------------------
+// c'tor
+// ---------------------------------------------------------------------------
+//
+
+CPhCntContactIdImpl2::~CPhCntContactIdImpl2() 
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// copy c'tor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactIdImpl2::CPhCntContactIdImpl2(const QContact aContact)
+:iContact(aContact), iValid(true)
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntContactIdImpl2* CPhCntContactIdImpl2::NewL(const QContact aContact)
+    {
+    CPhCntContactIdImpl2* self = new( ELeave ) CPhCntContactIdImpl2(aContact);
+    return self;
+    }
+ 
+// ---------------------------------------------------------------------------
+// CloneL
+// ---------------------------------------------------------------------------
+//
+CPhCntContactId* CPhCntContactIdImpl2::CloneL() const
+    {
+    return CPhCntContactIdImpl2::NewL(Contact());
+    }
+     
+// ---------------------------------------------------------------------------
+// Invalidate
+// ---------------------------------------------------------------------------
+//
+
+void CPhCntContactIdImpl2::Invalidate()
+    {
+    iValid = false;
+    }
+     
+// ---------------------------------------------------------------------------
+// IsValid
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntContactIdImpl2::IsValid() const
+    {
+    return iValid;
+    }
+     
+// ---------------------------------------------------------------------------
+// ContactId
+// ---------------------------------------------------------------------------
+//
+TContactItemId CPhCntContactIdImpl2::ContactId() const
+    {
+    if (IsValid())
+        {
+        return iContact.localId();
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+     
+// ---------------------------------------------------------------------------
+// PackLC
+// ---------------------------------------------------------------------------
+//
+HBufC8* CPhCntContactIdImpl2::PackLC() const
+
+
+    {
+    HBufC8* valueToReturn = NULL;
+    
+    if (IsValid())
+        {
+        QString str; 
+        str.setNum(iContact.localId());
+        TPtrC16 value(str.utf16());
+        valueToReturn =  CnvUtfConverter::ConvertFromUnicodeToUtf8L(value);
+        CleanupStack::PushL(valueToReturn);
+        }
+        
+    return valueToReturn;
+    }
+
+// ---------------------------------------------------------------------------
+// Contact
+// ---------------------------------------------------------------------------
+//
+const QContact CPhCntContactIdImpl2::Contact() const
+    {
+    return iContact;
+    }
+
+
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/src/cphcntfactoryimpl2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// INCLUDE FILES
+#include    <qglobal.h>
+#include    <e32cmn.h>  
+#include    <qcontactmanager.h>
+#include    <CProfileChangeNotifyHandler.h>
+#include    <MProfileChangeObserver.h>
+#include    <featmgr.h>     // Feature Manager
+#include    <QString>
+#include    "cphcntfactoryimpl2.h"
+#include    "cphcntmatcherimpl2.h"
+#include    "qtphonelog.h"
+
+
+static const QString SYMBIAN_CONTACTS_BACKEND  = "symbian";
+
+
+// -----------------------------------------------------------------------------
+// CPhCntFactoryImpl::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhCntFactoryImpl2* CPhCntFactoryImpl2::NewL()
+    {
+    PHONE_DEBUG("CPhCntFactoryImpl2::NewL - enter");
+    CPhCntFactoryImpl2* self = new (ELeave) CPhCntFactoryImpl2;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    PHONE_DEBUG("CPhCntFactoryImpl2::cntfinder2 is ready. lets rock.");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl2::~CPhCntFactoryImpl2
+// ---------------------------------------------------------------------------
+//
+CPhCntFactoryImpl2::~CPhCntFactoryImpl2()
+    {
+
+    FeatureManager::UnInitializeLib();
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl2::CreateContactMatcherL
+// 
+//  Create contact matcher
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcher* CPhCntFactoryImpl2::CreateContactMatcherL()
+    {
+    QContactManager* contactMgr = NULL;
+    QT_TRYCATCH_LEAVING(contactMgr = new QContactManager(SYMBIAN_CONTACTS_BACKEND));
+    CPhCntMatcher*matcher = CPhCntMatcherImpl2::NewL(contactMgr);
+    return matcher;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl2::CreateProfileEngineNotifyHandlerL
+// ---------------------------------------------------------------------------
+//
+CBase* CPhCntFactoryImpl2::CreateProfileEngineNotifyHandlerL( 
+        MProfileChangeObserver* aObserver )
+    {
+    return CProfileChangeNotifyHandler::NewL( aObserver );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl2::CreateContactIdL
+// ---------------------------------------------------------------------------
+//
+/*
+CPhCntContactId* CPhCntFactoryImpl2::CreateContactIdL()
+    {
+    return NULL;
+    }
+*/   
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl2::CreateContactIdL
+// ---------------------------------------------------------------------------
+//    
+CPhCntContactId* CPhCntFactoryImpl2::CreateContactIdL( 
+    TContactItemId /* aContactId*/)
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CPhCntFactoryImpl2::CreateContactIdL
+// ---------------------------------------------------------------------------
+//    
+CPhCntContactId* CPhCntFactoryImpl2::CreateContactIdL( 
+    const TDesC8& /*aContactId*/ )
+    {
+    return NULL;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPhCntFactoryImpl2::CPhCntFactoryImpl2
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPhCntFactoryImpl2::CPhCntFactoryImpl2()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCntFactoryImpl2::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPhCntFactoryImpl2::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    }
+
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+// ---------------------------------------------------------------------------
+// CreateCntFactoryL
+// 
+//  Creates instance of contact factory.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPhCntFactory* CreateCntFactoryL()
+    {
+    return CPhCntFactoryImpl2::NewL();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/src/cphcntmatch2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,274 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <qcontact.h>
+#include <qcontactdetail.h>
+#include <qcontactname.h>
+#include <qcontactavatar.h>
+#include <qcontactphonenumber.h>
+#include <qtcontactsglobal.h>
+#include "cphcntmatch2.h"
+#include "cphcntcontactidimpl2.h"
+#include "qtphonelog.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatch2::CPhCntMatch2(const QContact aContact):
+iContact(aContact), iNumber(NULL), iContactId(NULL), iDummyArray(NULL)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CPhCntMatch2::~CPhCntMatch2()
+    {
+    delete iNumber;
+    delete iDummyArray;
+    delete iContactId; 
+    }
+    
+// -----------------------------------------------------------------------------
+// CPhCntMatch2::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPhCntMatch2* CPhCntMatch2::NewL(const QContact aContact)
+    {
+    CPhCntMatch2* self = new( ELeave ) CPhCntMatch2(aContact);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// Release
+// -----------------------------------------------------------------------------
+//
+void CPhCntMatch2::Release()
+{
+    delete iNumber;
+    iNumber = NULL;
+}
+
+// -----------------------------------------------------------------------------
+// NewL
+// -----------------------------------------------------------------------------
+//
+CPhCntContactId* CPhCntMatch2::ContactId() const
+{
+    return iContactId;
+}
+
+// -----------------------------------------------------------------------------
+// NumberType
+// -----------------------------------------------------------------------------
+//
+MPhCntMatch::TNumberType CPhCntMatch2::NumberType() const
+{
+
+    MPhCntMatch::TNumberType valueToReturn = MPhCntMatch::EMobileNumber;
+    /* -> TODO not yet supported
+    switch (iContact->field(fieldNumber).property())
+        {
+        case propertyMobile: 
+            {
+            valueToReturn = MPhCntMatch::EMobileNumber;
+            break;
+            }
+        default:
+            {
+            valueToReturn = MPhCntMatch::ENone;
+            }
+        
+        }//switch
+    */
+    
+    return valueToReturn;
+}
+
+// -----------------------------------------------------------------------------
+// Cli
+// -----------------------------------------------------------------------------
+//
+
+MPhCntMatch::TCliType CPhCntMatch2::Cli( HBufC*& /*aCliText*/ ) const
+{
+    return ECliNumber;
+}
+
+// -----------------------------------------------------------------------------
+// FirstName
+// -----------------------------------------------------------------------------
+//
+TPtrC CPhCntMatch2::FirstName() const
+{
+    return FieldValue(QContactName::DefinitionName, QContactName::FieldFirst); 
+
+}
+// -----------------------------------------------------------------------------
+// LastName
+// -----------------------------------------------------------------------------
+//
+TPtrC CPhCntMatch2::LastName() const
+{
+    return FieldValue(QContactName::DefinitionName, QContactName::FieldLast);
+   
+}
+// -----------------------------------------------------------------------------
+// CompanyName
+// -----------------------------------------------------------------------------
+//
+TPtrC CPhCntMatch2::CompanyName() const
+{
+  return KNullDesC();
+}
+// -----------------------------------------------------------------------------
+// Number
+// -----------------------------------------------------------------------------
+//
+TPtrC CPhCntMatch2::Number() const
+{
+//how many numbers are returned here? should be only one that matched
+    return iNumber? iNumber->Des() : 
+           FieldValue(QContactPhoneNumber::DefinitionName, 
+                      QContactPhoneNumber::FieldNumber);
+}
+// -----------------------------------------------------------------------------
+// PersonalRingingTone
+// -----------------------------------------------------------------------------
+//
+TPtrC CPhCntMatch2::PersonalRingingTone() const
+{
+    /*
+    //TODO
+    QString returnValue;
+    QList<QContactAvatar> details = iContact.details<QContactAvatar>();
+    
+    for (int i=0;i<details.count();++i) {
+        if (details.at(i).subType() == QContactAvatar::SubTypeAudioRingtone) {
+            returnValue = details.at(i).avatar();
+            break;
+        }
+    }
+
+    return returnValue.utf16();*/
+    return KNullDesC();
+}
+// -----------------------------------------------------------------------------
+// BelongsToGroups
+// -----------------------------------------------------------------------------
+//
+TBool CPhCntMatch2::BelongsToGroups( 
+    const CArrayFix<TContactItemId>& /*aGroupArray*/ ) const
+{
+    return EFalse;
+}
+// -----------------------------------------------------------------------------
+// TextToSpeechTextL
+// -----------------------------------------------------------------------------
+//
+HBufC* CPhCntMatch2::TextToSpeechTextL() const
+{
+    return NULL;
+}
+// -----------------------------------------------------------------------------
+// CallText
+// -----------------------------------------------------------------------------
+//    
+TPtrC CPhCntMatch2::CallText() const
+{
+    return KNullDesC();
+}
+// -----------------------------------------------------------------------------
+// CallImage
+// -----------------------------------------------------------------------------
+//       
+TPtrC CPhCntMatch2::CallImage() const
+{
+    QString returnValue;
+    QList<QContactAvatar> details = iContact.details<QContactAvatar>();
+
+    for (int i=0;i<details.count();++i) {
+        if (details.at(i).subType() == QContactAvatar::SubTypeImage) {
+            returnValue = details.at(i).avatar();
+            break;
+        }
+    }
+    
+    return returnValue.utf16();
+}
+// -----------------------------------------------------------------------------
+// HasThumbnailImage
+// -----------------------------------------------------------------------------
+//       
+TBool CPhCntMatch2::HasThumbnailImage() const
+{
+    return EFalse;
+}
+// -----------------------------------------------------------------------------
+// AllDtmfNumbers
+// -----------------------------------------------------------------------------
+//
+CDesCArray& CPhCntMatch2::AllDtmfNumbers() const
+{
+    return *iDummyArray;
+}
+// -----------------------------------------------------------------------------
+// SetNumberL
+// -----------------------------------------------------------------------------
+//
+
+void CPhCntMatch2::SetNumberL(const TDesC& aNumber)
+{
+    delete iNumber;
+    iNumber = NULL;
+    iNumber = aNumber.AllocL();
+}
+
+// -----------------------------------------------------------------------------
+// ConstructL
+// -----------------------------------------------------------------------------
+//
+void CPhCntMatch2::ConstructL()
+    {
+    iContactId = CPhCntContactIdImpl2::NewL(iContact);
+    iDummyArray = new CDesCArrayFlat(1);
+    }
+
+// -----------------------------------------------------------------------------
+// FieldValue
+// -----------------------------------------------------------------------------
+//
+TPtrC CPhCntMatch2::FieldValue(const QString& name, const QString& key) const
+{
+    QString returnValue;
+    QList<QContactDetail> details = iContact.details(name);
+    if (details.count() == 1)
+        {
+        returnValue = details.first().value(key);        
+        }
+    PHONE_DEBUG4("CPhCntMatch2::FieldValue:: key is :", key, "..value is :", returnValue);
+    return returnValue.utf16();    
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/src/cphcntmatcherimpl2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QList>
+#include <QString>
+#include <QChar>
+#include <qcontact.h>
+#include <qcontactdetailfilter.h>
+#include <qcontactphonenumber.h>
+#include <qtcontactsglobal.h>
+#include <qcontactmanager.h>
+
+#include "cphcntmatcherimpl2.h"
+#include "cphcntmatch2.h"
+#include "qtphonelog.h"
+
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPhCntMatcherImpl2* CPhCntMatcherImpl2::NewL(QContactManager* aContactManager) 
+    {
+    __ASSERT_ALWAYS(aContactManager!=NULL, User::Leave(KErrArgument));
+    CPhCntMatcherImpl2* self = new( ELeave )CPhCntMatcherImpl2(aContactManager);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//    
+CPhCntMatcherImpl2::~CPhCntMatcherImpl2() 
+    {
+    delete iMatch;
+    delete iContactManager;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Tries to find a contact which has aTelNumber.
+// ---------------------------------------------------------------------------
+//    
+TInt CPhCntMatcherImpl2::MatchNumber( 
+    MPhCntMatch*& aMatch,   
+    const TDesC& aTelNumber) 
+    {
+    TInt err = KErrNone;
+    QString telnumber((QChar*)aTelNumber.Ptr(),aTelNumber.Length());
+    QContactDetailFilter filter;
+    filter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldNumber);
+    filter.setValue(telnumber);
+    QList<QContactLocalId> contacts;
+    contacts = iContactManager->contactIds(filter);
+    PHONE_DEBUG2("CPhCntMatcherImpl2::MatchNumber(): matched contacts count is:", contacts.count());
+    //only 1 exact match returns a contact to be used 
+    if (contacts.isEmpty() || contacts.count() > 1 )
+        {
+        return KErrNotFound;
+        }
+    else 
+        {
+        delete iMatch;
+        iMatch = NULL;
+        TRAP(err, iMatch = CPhCntMatch2::NewL(iContactManager->contact(contacts.at(0))));
+        if (!err)
+        {
+            aMatch = iMatch;
+            PHONE_DEBUG("CPhCntMatcherImpl2::MatchNumber() -- matched contact is ready");
+        }
+        return err;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Tries to find a contact which has aTelNumber.
+// ---------------------------------------------------------------------------
+//  
+TInt CPhCntMatcherImpl2::MatchNumber( 
+    MPhCntMatch*& /*aMatch*/,
+    const TDesC& /*aTelNumber*/,
+    const CPhCntContactId& /*aContactId*/ )
+    {
+    return KErrNone;
+    }
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Tries to find a contact which has aTelNumber, contactId and fieldId
+// ---------------------------------------------------------------------------
+// 
+TInt CPhCntMatcherImpl2::MatchNumber(
+    MPhCntMatch*& /*aMatch*/,
+    const TDesC& /*aTelNumber*/,
+    const CPhCntContactId& /*aContactId*/,
+    const TFieldId /*aFieldId*/ )
+    {
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Empty implementation. 
+// ---------------------------------------------------------------------------
+//    
+TInt CPhCntMatcherImpl2::MatchVoipNumber(
+    MPhCntMatch*& /*aMatch*/,
+    const TDesC& /*aMatchString*/,
+    TBool /*aAllowUserNameMatch*/,
+    TInt /*aCharsForMatching*/ )
+    {
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Empty implementation. 
+// ---------------------------------------------------------------------------
+//
+TInt CPhCntMatcherImpl2::MatchVoipNumber(
+    MPhCntMatch*& /*aMatch*/,
+    const CPhCntContactId& /*aContactId*/ )
+    {
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// Empty implementation. Implemented in CPhCntMatcherVoIPImpl.
+// ---------------------------------------------------------------------------
+//
+TBool CPhCntMatcherImpl2::HasCSNumbers( const CPhCntContactId& /*aContactId*/ )
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// From CPhCntMatcher
+// ---------------------------------------------------------------------------
+// 
+ TInt CPhCntMatcherImpl2::MatchNumber( 
+            MPhCntMatch*& aMatch, 
+            const TDesC& aTelNumber,
+            TInt aContactId )
+    {
+    TInt err = KErrNone;
+    //now there's no way to check if the contact is valid or not
+    QContact contact;
+    contact = iContactManager->contact(aContactId);
+    //should check if valid or not
+    delete iMatch;
+    iMatch = NULL;
+    TRAP(err, iMatch = CPhCntMatch2::NewL(contact));
+    if (!err)
+    {
+        TRAP(err, iMatch->SetNumberL(aTelNumber));
+    }
+    if (!err)
+    {   
+        aMatch = iMatch;
+        PHONE_DEBUG("CPhCntMatcherImpl2::MatchNumber(ContactId) -- matched contact is ready");
+    }
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//   
+CPhCntMatcherImpl2::CPhCntMatcherImpl2(QContactManager* aContactManager)
+:iContactManager(aContactManager)
+    {
+    iMatch = NULL;
+    }
+
+
+    
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//    
+void CPhCntMatcherImpl2::ConstructL()
+    { 
+    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/src/phcntpanic.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "phcntpanic.h"
+
+_LIT( KPanicTxt, "PhCntFinder" );
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Panics current thread
+// ---------------------------------------------------------------------------
+//
+void PhCntPanic( TPhCntPanic aPanicCode )
+    {
+    User::Panic( KPanicTxt, aPanicCode );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/common.pri	Fri Jun 04 10:19:18 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: 
+#
+######################################################################
+# Unit tests
+######################################################################
+
+CONFIG += hb
+CONFIG += qtestlib
+DEFINES += dll \
+            BUILD_QTCONTACTS \
+
+            
+            
+
+LIBS += -lphoneengine \
+        -lFeatMgr \
+        -lrfs \
+        -lsecui \
+        -lprofileeng \
+        -leuser \
+        -lbafl \
+        -lqtcore \
+        -lqtgui \
+        -lcharconv \
+        -lqtcontacts
+        
+        
+TARGET.EPOCALLOWDLLDATA =1
+        
+
+        
+        
+        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontact.h	Fri Jun 04 10:19:18 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 QCONTACT_H
+#define QCONTACT_H
+
+#include <QString>
+#include <QList>
+#include <QMetaType>
+
+#include <qcontactid.h>
+#include "qcontactdetail.h"
+#include "qtcontactsglobal.h"
+// This is not available yet
+// #include "quniqueid.h"
+
+
+class QContact
+{
+public:
+    QContact();
+
+    ~QContact();
+
+    QContact(const QContact& other);
+	QContact& operator=(const QContact& other);
+
+	//QContactId id() const;
+    
+    QContactLocalId localId() const;
+
+    QList<QContactDetail> details(const QString& definitionId = QString()) const;
+
+public: //for testing
+    void setDetails(const QList<QContactDetail>& details);
+
+private:
+    QList<QContactDetail> mDetails;
+ 
+};
+Q_DECLARE_METATYPE(QContact)
+#endif //__QCONTACT_H_
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontact_stub.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QDebug>
+#include "qcontact.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QContact::QContact
+// -----------------------------------------------------------------------------
+//
+QContact::QContact(  )
+    {    
+    }
+
+// -----------------------------------------------------------------------------
+// QContact::QContact
+// -----------------------------------------------------------------------------
+//
+QContact::QContact( 
+        const QContact & contact )
+    {
+    mDetails = contact.details("");
+    }
+
+// -----------------------------------------------------------------------------
+// QContact::QContact
+// -----------------------------------------------------------------------------
+//
+QContact& QContact::operator=(const QContact& other)
+{
+    mDetails = other.details();
+    return *this;
+}
+// -----------------------------------------------------------------------------
+// QContact::~QContact
+// -----------------------------------------------------------------------------
+//
+QContact::~QContact(  )
+    {   
+    }
+
+// -----------------------------------------------------------------------------
+// QContact::uid
+// -----------------------------------------------------------------------------
+//
+/*QContactId QContact::id(  ) const
+    {
+    QContactId temp;
+    return temp;
+    }*/
+
+// -----------------------------------------------------------------------------
+// QContact::localId
+// -----------------------------------------------------------------------------
+//
+QContactLocalId QContact::localId(  ) const
+    {
+    return 3;
+    }
+
+// -----------------------------------------------------------------------------
+// QContact::details
+// -----------------------------------------------------------------------------
+//
+QList<QContactDetail> QContact::details(const QString& definitionId) const
+{
+	Q_UNUSED(definitionId)
+	return mDetails;
+	
+}
+// -----------------------------------------------------------------------------
+// QContact::setDetails
+// -----------------------------------------------------------------------------
+//
+void QContact::setDetails(const QList<QContactDetail>& details)
+{   
+    mDetails.clear();
+    QContactDetail detail;
+    qDebug() << "QContact::setDetails, list count is: " << details.count();
+    foreach (detail, details)
+    {
+        mDetails.append(detail);
+        qDebug() << "QContact::setDetails, mDetails count is: " << mDetails.count();
+        qDebug() << "QContact::setDetails, mDetails[0].value is: " << mDetails[0].value("");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactdetail.h	Fri Jun 04 10:19:18 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 QCONTACTDETAIL_H
+#define QCONTACTDETAIL_H
+
+#include "qtcontactsglobal.h"
+
+#include <QString>
+
+
+class QContactDetail
+{
+public:
+    QContactDetail();
+	QContactDetail(const QString& definitionName);
+    virtual ~QContactDetail();
+	QContactDetail(const QContactDetail& other);
+	QContactDetail& operator=(const QContactDetail& other);
+    QString value(const QString& key) const;
+	QString definitionName() const;
+public: //for testing 
+	void setValue(const QString& value);
+	
+
+
+private:
+    QString mValue;
+	QString mDefinition;
+
+};
+
+
+
+#define Q_DECLARE_CUSTOM_CONTACT_DETAIL(className, definitionNameString) \
+    className() : QContactDetail(DefinitionName) {}\
+    Q_DECLARE_LATIN1_LITERAL(DefinitionName, definitionNameString);
+
+#define Q_IMPLEMENT_CUSTOM_CONTACT_DETAIL(className, definitionNameString) \
+    Q_DEFINE_LATIN1_LITERAL(className::DefinitionName, definitionNameString)
+	
+#endif //qcontactdetail
+	
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactdetail_stub.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QDebug>
+#include "qcontactdetail.h"
+#include "qcontactname.h"
+#include "qcontactphonenumber.h"
+
+Q_DEFINE_LATIN1_LITERAL(QContactName::DefinitionName, "Name");
+Q_DEFINE_LATIN1_LITERAL(QContactPhoneNumber::DefinitionName, "PhoneNumber");
+Q_DEFINE_LATIN1_LITERAL(QContactPhoneNumber::FieldNumber, "PhoneNumber");
+Q_DEFINE_LATIN1_LITERAL(QContactName::FieldFirst, "First");
+Q_DEFINE_LATIN1_LITERAL(QContactName::FieldLast, "Last");
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QContactDetail::QContactDetail
+// -----------------------------------------------------------------------------
+//
+QContactDetail::QContactDetail()
+{
+}
+// -----------------------------------------------------------------------------
+// QContactDetail::QContactDetail
+// -----------------------------------------------------------------------------
+//
+QContactDetail::QContactDetail(const QString& definitionName)
+{
+	mDefinition = definitionName;
+}
+// -----------------------------------------------------------------------------
+// D'tor
+// -----------------------------------------------------------------------------
+//
+QContactDetail::~QContactDetail()
+{
+}
+
+QString QContactDetail::definitionName () const
+{
+	return mDefinition;
+}
+// -----------------------------------------------------------------------------
+// Copy c'tor
+// -----------------------------------------------------------------------------
+//
+QContactDetail::QContactDetail(const QContactDetail& other)
+{
+	mValue = other.value("");
+}
+// -----------------------------------------------------------------------------
+// Operator =
+// -----------------------------------------------------------------------------
+//
+QContactDetail& QContactDetail::operator=(const QContactDetail& other)
+{
+    mValue = other.value("");
+    return *this;
+}
+// -----------------------------------------------------------------------------
+// QContactDetail
+// -----------------------------------------------------------------------------
+//
+QString QContactDetail::value(const QString& key) const
+{
+	Q_UNUSED(key)
+	return mValue;
+}
+
+// -----------------------------------------------------------------------------
+// QContactDetail
+// -----------------------------------------------------------------------------
+//
+void QContactDetail::setValue(const QString& value)
+{
+	mValue = value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactdetailfilter.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 QCONTACTDETAILFILTER_H
+#define QCONTACTDETAILFILTER_H
+
+#include <QString>
+#include <QVariant>
+
+#include "qcontactfilter.h"
+
+class QContactDetailFilter: public QContactFilter
+{
+public:
+    QContactDetailFilter()
+	{
+	};
+   // QContactDetailFilter(const QContactFilter& other);
+
+    /* Mutators */
+    void setDetailDefinitionName(const QString& definition, const QString& fieldName = QString())
+	{
+	Q_UNUSED(definition)
+	Q_UNUSED(fieldName)
+	};
+    //void setMatchFlags(Qt::MatchFlags flags);
+
+    /* Filter Criterion */
+    void setValue(const QVariant& value)
+	{
+	Q_UNUSED(value)
+	};
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactfilter.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 QCONTACTFILTER_H
+#define QCONTACTFILTER_H
+
+#include <QVariant>
+#include <QList>
+#include <QDateTime>
+
+#include "qtcontactsglobal.h"
+
+class QContactFilter
+{
+public:
+    QContactFilter() {};
+
+
+    enum FilterType {
+        InvalidFilter,
+        ContactDetailFilter,
+        ContactDetailRangeFilter,
+        ChangeLogFilter,
+        ActionFilter,
+        GroupMembershipFilter,
+        IntersectionFilter,
+        UnionFilter,
+        IdListFilter,
+        DefaultFilter
+    };
+
+ };
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactmanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 QCONTACTMANAGER_H
+#define QCONTACTMANAGER_H
+
+#include <QList>
+#include <QString>
+#include <qcontact.h>
+#include <qcontactfilter.h>
+#include <qcontactsortorder.h>
+#include <qtcontactsglobal.h>
+
+/*
+*  This is very simple copy of the one function from QContactManager interface that contactfinder2 is using
+*/
+
+
+class QContactManager 
+{
+
+public:
+    QContactManager() { };
+	QContactManager(const QString &name) {Q_UNUSED(name) };
+    virtual ~QContactManager() {};
+
+public:
+ 
+	virtual QContact contact(const QContactLocalId& contactId) const
+	{
+	Q_UNUSED(contactId);
+	QContact cnt;
+	return cnt;
+	
+	};// retrieve a contact
+	
+	virtual QList<QContactLocalId> contacts(const QContactFilter& filter, 
+									 const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>()) const
+	{
+	Q_UNUSED(filter)
+	Q_UNUSED(sortOrders)
+	QList<QContactLocalId> list;
+	return list;
+	};
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactmanager_moc.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QDebug>
+#include "qcontactmanager_moc.h"
+
+
+QContactManager_Moc::QContactManager_Moc()
+{   
+
+    mExpectedResult = -1;
+    qDebug()<<"QContactManager_Moc constructed";
+}
+
+QContactManager_Moc::~QContactManager_Moc()
+{
+    mList.clear();
+}
+
+/* get the contact*/
+QContact QContactManager_Moc::contact(const QContactLocalId& contactId) const
+{
+	Q_UNUSED(contactId)
+	return mContact;
+}
+
+/* match */
+QList<QContactLocalId> QContactManager_Moc::contacts(const QContactFilter& filter, 
+									 const QList<QContactSortOrder>& sortOrders) const
+{
+Q_UNUSED(filter)
+Q_UNUSED(sortOrders)
+
+	mList.clear();
+	qDebug()<<"Moc - mExpectedResult is: " << mExpectedResult;
+	if (mExpectedResult == 1)
+		{
+		mList << cnt1;
+		qDebug()<<"Moc - match == 1 - list count is: " << mList.count();
+		}
+	else if (mExpectedResult == 2)
+		{
+		mList << cnt1;
+		mList << cnt2;
+		}
+	return mList;
+}
+
+//--- moc functions
+
+void QContactManager_Moc::setExpectedResult(int matchNumber)
+    {
+    mExpectedResult = matchNumber;
+    qDebug()<<"Moc - mExpectedResult is: " << mExpectedResult;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactmanager_moc.h	Fri Jun 04 10:19:18 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 QCONTACTMANAGER_MOC_H
+#define QCONTACTMANAGER_MOC_H
+
+#include <e32base.h>
+#include "qcontactmanager.h"
+#include <qtcontactsglobal.h>
+#include <QList>
+
+
+
+class QContactManager_Moc : public QContactManager
+{
+
+
+public:
+    QContactManager_Moc();
+    virtual ~QContactManager_Moc();
+    
+public:
+    
+	QContact contact(const QContactLocalId& contactId) const;
+	QList<QContactLocalId> contacts(const QContactFilter& filter, 
+									 const QList<QContactSortOrder>& sortOrders = QList<QContactSortOrder>()) const;
+    void setExpectedResult(int matchNumber);
+ 
+private:
+    int mExpectedResult;
+    mutable QList<QContactLocalId> mList;
+    QContactLocalId cnt1;
+    QContactLocalId cnt2;
+	QContact  mContact;
+    
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactname.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 QCONTACTNAME_H
+#define QCONTACTNAME_H
+
+#include <QString>
+
+#include "qtcontactsglobal.h"
+#include "qcontactdetail.h"
+#include "qcontact.h"
+
+class QContactName : public QContactDetail
+{
+public:
+
+    Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactName, "Name")
+    Q_DECLARE_LATIN1_LITERAL(FieldPrefix, "Prefix");
+    Q_DECLARE_LATIN1_LITERAL(FieldFirst, "First");
+    Q_DECLARE_LATIN1_LITERAL(FieldMiddle, "Middle");
+    Q_DECLARE_LATIN1_LITERAL(FieldLast, "Last");
+    Q_DECLARE_LATIN1_LITERAL(FieldSuffix, "Suffix");
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactphonenumber.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 QCONTACTPHONENUMBER_H
+#define QCONTACTPHONENUMBER_H
+
+#include <QString>
+
+#include "qcontactdetail.h"
+#include "qcontact.h"
+#include <qtcontactsglobal.h>
+
+
+/* Leaf class */
+//! [0]
+class QContactPhoneNumber : public QContactDetail
+{
+public:
+
+    Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactPhoneNumber, "PhoneNumber");
+    Q_DECLARE_LATIN1_LITERAL(FieldNumber, "PhoneNumber");
+    Q_DECLARE_LATIN1_LITERAL(FieldSubTypes, "SubTypes");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeLandline, "Landline");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeMobile, "Mobile");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeFacsimile, "Facsimile");
+    Q_DECLARE_LATIN1_LITERAL(SubTypePager, "Pager");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeVoice, "Voice");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeModem, "Modem");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeVideo, "Video");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeCar, "Car");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeBulletinBoardSystem, "BulletinBoardSystem");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeMessagingCapable, "MessagingCapable");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeAssistant, "Assistant");
+    Q_DECLARE_LATIN1_LITERAL(SubTypeDtmfMenu, "DtmfMenu");
+	
+
+};
+//! [0]
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/mocks/qcontactsortorder.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 QCONTACTSORTORDER_H
+#define QCONTACTSORTORDER_H
+
+#include "qtcontactsglobal.h"
+
+#include <QString>
+#include <QList>
+
+
+class QContactSortOrder
+{
+public:
+    QContactSortOrder() {};
+    ~QContactSortOrder() {};
+
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/runtests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,35 @@
+@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
+
+del \epoc32\winscw\c\private\e84eae66\u_testmatch2.log
+\epoc32\release\winscw\udeb\testmatch2.exe -o u_testmatch2.log
+type \epoc32\winscw\c\private\e84eae66\u_testmatch2.log
+
+del \epoc32\winscw\c\private\e39991fe\u_cphcntcontactidimpl2.log
+\epoc32\release\winscw\udeb\testcphcntcontactidimpl2.exe -o u_cphcntcontactidimpl2.log
+type \epoc32\winscw\c\private\e39991fe\u_cphcntcontactidimpl2.log
+
+del \epoc32\winscw\c\private\e38991fe\u_testfactoryimpl2.log
+\epoc32\release\winscw\udeb\testfactoryimpl2.exe -o u_testfactoryimpl2.log
+type \epoc32\winscw\c\private\e38991fe\u_testfactoryimpl2.log
+
+del \epoc32\winscw\c\private\e84eae56\u_testmatcherimpl2.log
+\epoc32\release\winscw\udeb\testmatcherimpl2.exe -o u_testmatcherimpl2.log
+type \epoc32\winscw\c\private\e84eae56\u_testmatcherimpl2.log
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntcontactidimpl2/testcphcntcontactidimpl2.pro	Fri Jun 04 10:19:18 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: Project file for building Phone components
+#
+#
+
+include(..\common.pri)
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+INCLUDEPATH += ..\..\inc
+INCLUDEPATH += ..\mocks
+INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include \
+                   \epoc32\include\platform\app \
+                   \epoc32\include\app
+               
+# Input
+HEADERS += ..\..\inc\cphcntcontactidimpl2.h
+HEADERS += ..\..\inc\cphcntfactoryimpl2.h
+HEADERS += ..\mocks\qcontactdetail.h
+HEADERS += ..\mocks\qcontact.h
+
+
+SOURCES += ..\..\src\cphcntcontactidimpl2.cpp
+SOURCES += u_cphcntcontactidimpl2.cpp
+SOURCES += ..\mocks\qcontactdetail_stub.cpp
+SOURCES += ..\mocks\qcontact_stub.cpp
+
+
+
+
+TARGET.CAPABILITY = ALL -TCB
+TARGET.UID3 = 0xe39991fe
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntcontactidimpl2/u_cphcntcontactidimpl2.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QDebug>
+#include <e32base.h>
+#include <qcontactid.h>
+#include "qcontact.h"
+#include "cphcntcontactidimpl2.h"
+
+
+
+//---- test class
+
+class U_CPhCntContactIdImpl2: public QObject
+{
+Q_OBJECT
+
+public:
+    U_CPhCntContactIdImpl2();
+	~U_CPhCntContactIdImpl2();
+
+private slots:
+	void initTestCase();
+    void cleanupTestCase();
+    void testValidContact();
+    void testClone();
+    void testPackLC();
+    void testInvalidate();
+
+	
+private:
+	
+    QContact mContact;
+    CPhCntContactId* mContactId; //SUT 
+};
+
+
+
+U_CPhCntContactIdImpl2::U_CPhCntContactIdImpl2()
+    {
+
+    }
+
+U_CPhCntContactIdImpl2::~U_CPhCntContactIdImpl2()
+    {
+
+    }
+
+void U_CPhCntContactIdImpl2::initTestCase()
+    {
+    
+    TRAP_IGNORE( mContactId = CPhCntContactIdImpl2::NewL(mContact) );
+    }
+
+void U_CPhCntContactIdImpl2::cleanupTestCase()
+    {
+	delete mContactId;
+	
+    }
+
+void U_CPhCntContactIdImpl2::testValidContact()
+    {
+    Q_ASSERT(mContactId->IsValid());
+    Q_ASSERT(mContactId->ContactId() == mContact.localId()); 
+    }
+
+void U_CPhCntContactIdImpl2::testClone()
+    {
+     CPhCntContactId* clone = NULL;
+     clone = mContactId->CloneL();
+     Q_ASSERT(clone->ContactId() == mContactId->ContactId());
+     delete clone; 
+    }
+
+void U_CPhCntContactIdImpl2::testPackLC()
+    {
+    HBufC8* buf = NULL;
+    qDebug() << "mContactId->PackLC() calling";
+    TRAP_IGNORE( 
+        buf = mContactId->PackLC(); 
+        if (buf != NULL)
+            {
+            qDebug() << "mContactId->PackLC() done";
+            CleanupStack::Pop(buf);
+            TBuf8<100> buf1;
+            buf1.AppendNum(mContactId->ContactId());
+            Q_ASSERT(buf->Des() == buf1 );
+            delete buf;
+            buf = NULL;
+            }
+        else 
+            {
+            qDebug() << "mContactId->PackLC()returned NULL";
+            }
+    );
+    }
+ 
+void U_CPhCntContactIdImpl2::testInvalidate()
+    {
+    mContactId->Invalidate();
+    Q_ASSERT(!mContactId->IsValid());
+    Q_ASSERT(mContactId->ContactId() == KErrNotFound); 
+    Q_ASSERT(mContactId->PackLC() == NULL);
+    }
+
+QTEST_MAIN(U_CPhCntContactIdImpl2)
+#include "u_cphcntcontactidimpl2.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntfactoryimpl2/testfactoryimpl2.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+include(..\common.pri)
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+INCLUDEPATH += ..\mocks
+INCLUDEPATH += ..\..\inc
+INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include \
+                   \epoc32\include\platform\app \
+                   \epoc32\include\app
+               
+# Input
+HEADERS += ..\mocks\qcontactmanager.h
+HEADERS += ..\mocks\qcontactmanager_moc.h
+HEADERS += ..\mocks\qcontact.h
+HEADERS += ..\mocks\qcontactdetail.h
+HEADERS += ..\mocks\qcontactphonenumber.h
+HEADERS += ..\..\inc\cphcntmatcherimpl2.h
+HEADERS += ..\..\inc\cphcntmatch2.h
+HEADERS += ..\..\inc\cphcntcontactidimpl2.h
+HEADERS += ..\..\inc\cphcntfactoryimpl2.h
+
+SOURCES += ..\mocks\qcontactdetail_stub.cpp
+SOURCES += ..\mocks\qcontact_stub.cpp
+SOURCES += ..\mocks\qcontactmanager_moc.cpp
+SOURCES += ..\..\src\cphcntmatcherimpl2.cpp
+SOURCES += ..\..\src\cphcntmatch2.cpp
+SOURCES += ..\..\src\cphcntcontactidimpl2.cpp
+SOURCES += u_cphcntfactoryimpl2.cpp
+SOURCES += ..\..\src\cphcntfactoryimpl2.cpp
+
+
+
+
+TARGET.CAPABILITY = ALL -TCB
+TARGET.UID3 = 0xe38991fe
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntfactoryimpl2/u_cphcntfactoryimpl2.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include <QDebug>
+#include <cprofilechangenotifyhandler.h>
+#include <mprofilechangeobserver.h>
+#include "cphcntfactoryimpl2.h"
+#include "cphcntmatcherimpl2.h"
+
+//---- test stub
+class CProfileChangeObserverImp: public CBase, public MProfileChangeObserver
+    {
+public:
+    static CProfileChangeObserverImp* NewL();
+    ~CProfileChangeObserverImp();
+    void HandleActiveProfileEventL(
+                TProfileEvent aProfileEvent, TInt aProfileId );
+private:
+    CProfileChangeObserverImp();
+        
+    };
+
+CProfileChangeObserverImp::CProfileChangeObserverImp()
+    {
+    }
+CProfileChangeObserverImp* CProfileChangeObserverImp::NewL()
+    {
+    CProfileChangeObserverImp* self = NULL;
+    self = new (ELeave) CProfileChangeObserverImp();
+    return self;
+    }
+
+CProfileChangeObserverImp::~CProfileChangeObserverImp()
+    {
+    }
+
+void CProfileChangeObserverImp::HandleActiveProfileEventL(
+        TProfileEvent /*aProfileEvent*/, TInt /*aProfileId*/)
+    {
+    
+    }
+
+//---- test class
+
+class U_CPhCntFactoryImpl2: public QObject
+{
+Q_OBJECT
+
+public:
+    U_CPhCntFactoryImpl2();
+	~U_CPhCntFactoryImpl2();
+
+private slots:
+	void initTestCase();
+    void cleanupTestCase();
+	void test_CreateContactMatcherL();
+	void test_CreateProfileEngineNotifyHandlerL();
+    void test_CreateContactId1L();
+    void test_CreateContactId2L();
+
+	
+private:
+	
+    CPhCntFactoryImpl2* mFactory; // implementation under test
+
+};
+
+U_CPhCntFactoryImpl2::U_CPhCntFactoryImpl2()
+{
+}
+
+U_CPhCntFactoryImpl2::~U_CPhCntFactoryImpl2()
+{
+}
+
+void U_CPhCntFactoryImpl2::initTestCase()
+{
+
+    TRAP_IGNORE( mFactory = CPhCntFactoryImpl2::NewL() );
+	
+}
+
+void U_CPhCntFactoryImpl2::cleanupTestCase()
+{
+	delete mFactory;
+}
+
+
+void U_CPhCntFactoryImpl2::test_CreateContactMatcherL()
+    {
+    CPhCntMatcher* matcher = NULL;
+    TRAP_IGNORE( matcher = mFactory->CreateContactMatcherL() );
+    Q_ASSERT(matcher);
+    delete matcher;   
+    }
+
+
+void U_CPhCntFactoryImpl2::test_CreateProfileEngineNotifyHandlerL()
+    {
+    CProfileChangeObserverImp* obs = NULL;
+    obs = CProfileChangeObserverImp::NewL();
+    CBase* engine = NULL;
+    TRAP_IGNORE( engine = mFactory->CreateProfileEngineNotifyHandlerL(obs) );
+    Q_ASSERT(engine);
+    delete engine;
+    delete obs;
+    }
+
+    
+void U_CPhCntFactoryImpl2::test_CreateContactId1L()
+    {
+    Q_ASSERT(!mFactory->CreateContactIdL(999));
+    }
+void U_CPhCntFactoryImpl2::test_CreateContactId2L()
+    {
+    Q_ASSERT(!mFactory->CreateContactIdL(_L8("abcd")));
+    }
+
+
+
+QTEST_MAIN(U_CPhCntFactoryImpl2)
+#include "u_cphcntfactoryimpl2.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntmatch2/testmatch2.pro	Fri Jun 04 10:19:18 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(..\common.pri)
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+INCLUDEPATH += ..\..\inc
+INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include \
+                   \epoc32\include\platform\app \
+                   \epoc32\include\app 
+               
+# Input
+HEADERS += ..\mocks\qcontact.h
+HEADERS += ..\mocks\qcontactdetail.h
+HEADERS += ..\..\inc\cphcntmatch2.h
+HEADERS += ..\..\inc\cphcntcontactidimpl2.h
+
+SOURCES += ..\mocks\qcontact_stub.cpp
+SOURCES += ..\mocks\qcontactdetail_stub.cpp
+SOURCES += ..\..\src\cphcntmatch2.cpp
+SOURCES += ..\..\src\cphcntcontactidimpl2.cpp
+SOURCES += u_cphcntmatch2.cpp
+
+
+TARGET.CAPABILITY = ALL -TCB
+TARGET.UID3 = 0xe84eae66
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntmatch2/u_cphcntmatch2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+#include <QDebug>
+#include <e32cmn.h> //KNullDesC
+#include "qcontact.h"
+#include "qcontactdetail.h"
+#include "qcontactname.h"
+#include "qcontactphonenumber.h"
+#include "cphcntmatch2.h"
+#include "cphcntcontactidimpl2.h"
+
+
+//---- test class
+
+class U_CPhCntMatch2: public QObject
+{
+Q_OBJECT
+
+public:
+    U_CPhCntMatch2();
+    ~U_CPhCntMatch2();
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+    void testFirstNameEmpty();
+    void testFirstNameNotEmpty();
+    void testLastNameEmpty();
+    void testLastNameNotEmpty();
+    void testNumberEmpty();
+    void testNumberNotEmpty();
+    //void testSeveralFirstNames();
+    //void testEmptyList();
+    void testPhoneNumberOverride();
+    void testRelease();
+    void testCli();
+    void testContactId();
+    void testNumberType();
+    void testCompanyName();
+    void testPersonalRingingTone();
+    void testBelongsToGroups();
+    void testTextToSpeechText();
+    void testCallText();
+    void testCallImage();
+    void testHasThumbnailImage();
+    void testAllDtmfNumbers();
+    
+private:
+    
+    CPhCntMatch2* mMatch; // SUT 
+    MPhCntMatch* mMatchIf;
+    QContact mContact;
+    QContactDetail mDetail;
+  
+};
+
+//--- testing
+
+U_CPhCntMatch2::U_CPhCntMatch2()
+    {
+    }
+
+U_CPhCntMatch2::~U_CPhCntMatch2()
+    {
+
+    }
+
+void U_CPhCntMatch2::initTestCase()
+    {
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatchIf = mMatch;
+    
+    }
+
+void U_CPhCntMatch2::cleanupTestCase()
+    {
+    delete mMatch;
+    }
+
+void U_CPhCntMatch2::testFirstNameEmpty()
+    {
+    QVariant name(""); 
+    mDetail.setValue(QContactName::FieldFirst,name);
+    bool err = mContact.saveDetail(&mDetail);
+    Q_ASSERT(mMatchIf->FirstName().Length() == 0);
+    // reset mDetail
+    mDetail.removeValue(QContactName::FieldFirst);
+    }
+
+void U_CPhCntMatch2::testFirstNameNotEmpty()
+    {
+     _LIT(KFirstName, "firstname");
+     QString name((QChar*)KFirstName().Ptr(),KFirstName().Length());
+     mDetail.setValue(QContactName::FieldFirst,name);
+     bool err = mContact.saveDetail(&mDetail);
+     delete mMatch;
+     TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+     mMatchIf = mMatch;
+     qDebug()<<"U_CPhCntMatch2 : mContact.details().count() " << mContact.details().count();
+     qDebug()<<"U_CPhCntMatch2 : mContact.details().at(0).value() " << mContact.details().at(0).value("");
+     HBufC* buf = NULL;
+     buf = mMatchIf->FirstName().AllocL();
+     QString qBuf((QChar*)buf->Ptr(),buf->Length());
+     qDebug()<<"mMatchIf->FirstName() returned...: " << qBuf;
+     Q_ASSERT( *buf == KFirstName()); 
+     delete buf;
+     // reset mDetail
+     mDetail.removeValue(QContactName::FieldFirst);
+    }
+
+void U_CPhCntMatch2::testLastNameEmpty()
+    {
+     QVariant name(""); 
+     mDetail.setValue(QContactName::FieldLast,name);
+     bool err = mContact.saveDetail(&mDetail);
+     delete mMatch;
+     TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+     mMatchIf = mMatch;
+     Q_ASSERT(mMatchIf->LastName().Length() == 0);
+     // reset mDetail
+     mDetail.removeValue(QContactName::FieldLast);
+    }
+
+
+void U_CPhCntMatch2::testLastNameNotEmpty()
+    {
+    _LIT(KLastName, "lastname");
+    QString name((QChar*)KLastName().Ptr(),KLastName().Length());
+    mDetail.setValue(QContactName::FieldLast,name);
+    bool err = mContact.saveDetail(&mDetail);
+    delete mMatch;
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatchIf = mMatch;
+    HBufC* buf = NULL;
+    buf = mMatchIf->LastName().AllocL();
+    QString qBuf((QChar*)buf->Ptr(),buf->Length());
+    Q_ASSERT(*buf == KLastName());
+    delete buf;
+    qDebug()<<"testLastNameNotEmpty() -- exit ";
+    // reset mDetail
+    mDetail.removeValue(QContactName::FieldLast);
+    }
+
+void U_CPhCntMatch2::testNumberEmpty()
+    {
+    QVariant number(""); 
+    mDetail.setValue(QContactPhoneNumber::FieldNumber,number);
+    bool err = mContact.saveDetail(&mDetail);
+    delete mMatch;
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatchIf = mMatch;
+    Q_ASSERT(mMatchIf->Number().Length() == 0);
+    // reset mDetail
+    mDetail.removeValue(QContactPhoneNumber::FieldNumber);
+    }
+    
+void U_CPhCntMatch2::testNumberNotEmpty()
+    {
+    _LIT(KNumber, "05012345678");
+    QString number((QChar*)KNumber().Ptr(),KNumber().Length());
+    mDetail.setValue(QContactPhoneNumber::FieldNumber,number);
+    bool err = mContact.saveDetail(&mDetail);
+    delete mMatch;
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatchIf = mMatch;
+    HBufC* buf = NULL;
+    buf = mMatchIf->Number().AllocL();
+    QString qBuf((QChar*)buf->Ptr(),buf->Length());
+    Q_ASSERT(*buf == KNumber());
+    delete buf;
+    // reset mDetail
+    mDetail.removeValue(QContactPhoneNumber::FieldNumber);
+    }
+/*
+void U_CPhCntMatch2::testSeveralFirstNames() //in case pb returns bad variants
+    {
+    mDetail.setValue("Abba");
+    mList.clear();
+    mList << mDetail;
+    mList << mDetail;
+    mList << mDetail;
+    mContact.setDetails(mList);
+    delete mMatch;
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatchIf = mMatch;
+    Q_ASSERT(mMatchIf->FirstName().Length() == 0);
+    }
+    
+void U_CPhCntMatch2::testEmptyList()
+    {
+    QList<QContactDetail> list;
+    mContact.setDetails(list);
+    delete mMatch;
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatchIf = mMatch;
+    Q_ASSERT(mMatchIf->FirstName().Length() == 0);
+    }
+*/
+void U_CPhCntMatch2::testPhoneNumberOverride()
+    {
+    _LIT(KNumber, "05012345678");
+    _LIT(KNumberOverride, "888888888");
+    QString number((QChar*)KNumber().Ptr(),KNumber().Length());
+    mDetail.setValue(QContactPhoneNumber::FieldNumber,number);
+    bool err = mContact.saveDetail(&mDetail);
+    delete mMatch;
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatch->SetNumberL(KNumberOverride());
+    mMatchIf = mMatch;
+    HBufC* buf = NULL;
+    buf = mMatchIf->Number().AllocL();
+    QString qBuf((QChar*)buf->Ptr(),buf->Length());
+    Q_ASSERT(*buf == KNumberOverride());
+    delete buf;
+    // reset mDetail
+    mDetail.removeValue(QContactPhoneNumber::FieldNumber);
+    }
+
+void U_CPhCntMatch2::testRelease()
+    {
+    _LIT(KNumber, "1234");
+    QVariant number("1234"); 
+    mDetail.setValue(QContactPhoneNumber::FieldNumber,number);
+    bool err = mContact.saveDetail(&mDetail);
+    delete mMatch;
+    TRAP_IGNORE( mMatch = CPhCntMatch2::NewL(mContact) );
+    mMatchIf = mMatch;
+    mMatchIf->Release();
+    Q_ASSERT(mMatchIf->Number() == KNumber());
+    // reset mDetail
+    mDetail.removeValue(QContactPhoneNumber::FieldNumber);
+    }
+
+void U_CPhCntMatch2::testCli()
+    {
+    HBufC* buf = NULL;
+    Q_ASSERT(mMatchIf->Cli(buf) == MPhCntMatch::ECliNumber );
+    }
+
+void U_CPhCntMatch2::testContactId()
+    {
+    CPhCntContactId* id = NULL;
+    id = mMatchIf->ContactId();
+    Q_ASSERT(id->ContactId()== mContact.localId());
+    }
+
+void U_CPhCntMatch2::testNumberType()
+    {
+    Q_ASSERT(mMatchIf->NumberType() == MPhCntMatch::EMobileNumber);
+    }
+
+void U_CPhCntMatch2::testCompanyName()
+    {
+    Q_ASSERT(mMatchIf->CompanyName().Length() == 0);
+    }
+
+void U_CPhCntMatch2::testPersonalRingingTone()
+    {
+    Q_ASSERT(mMatchIf->PersonalRingingTone().Length() == 0);
+    }
+
+void U_CPhCntMatch2::testBelongsToGroups()
+    {
+    CArrayFix<TContactItemId>* groups = NULL;
+    Q_ASSERT(mMatchIf->BelongsToGroups(*groups) == false);
+    }
+
+void U_CPhCntMatch2::testTextToSpeechText()
+    {
+    Q_ASSERT(mMatchIf->TextToSpeechTextL() == NULL);
+    }
+
+void U_CPhCntMatch2::testCallText()
+    {
+    Q_ASSERT(mMatchIf->CallText().Length() == 0);
+    }
+
+void U_CPhCntMatch2::testCallImage()
+    {
+    Q_ASSERT(mMatchIf->CallImage().Length() == 0);
+    }
+
+void U_CPhCntMatch2::testHasThumbnailImage()
+    {
+    Q_ASSERT(mMatchIf->HasThumbnailImage()== false);
+    }
+
+void U_CPhCntMatch2::testAllDtmfNumbers()
+    {
+    //dummy array for now
+    Q_ASSERT(mMatchIf->AllDtmfNumbers().Count() == 0);
+    }
+
+
+QTEST_MAIN(U_CPhCntMatch2)
+#include "u_cphcntmatch2.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntmatcherimpl2/testmatcherimpl2.pro	Fri Jun 04 10:19:18 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(..\common.pri)
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+DEPENDPATH += ..\mocks
+INCLUDEPATH += .
+INCLUDEPATH += ..\mocks
+INCLUDEPATH += ..\..\inc
+INCLUDEPATH += \epoc32\include\platform\mw \
+                   \epoc32\include\platform \
+                   \epoc32\include\platform\app \
+                   \epoc32\include\app
+
+               
+# Input
+HEADERS += ..\mocks\qcontactmanager.h
+HEADERS += ..\mocks\qcontactmanager_moc.h
+HEADERS += ..\mocks\qcontactdetail.h
+HEADERS += ..\mocks\qcontact.h
+HEADERS += ..\..\inc\cphcntmatch2.h
+HEADERS += ..\..\inc\cphcntcontactidimpl2.h
+HEADERS += ..\..\inc\cphcntmatcherimpl2.h
+
+SOURCES += ..\..\src\cphcntmatch2.cpp
+SOURCES += ..\..\src\cphcntcontactidimpl2.cpp
+SOURCES += ..\..\src\cphcntmatcherimpl2.cpp
+SOURCES += ..\mocks\qcontactmanager_moc.cpp
+SOURCES += ..\mocks\qcontactdetail_stub.cpp
+SOURCES += ..\mocks\qcontact_stub.cpp
+SOURCES += u_cphcntmatcherimpl2.cpp
+
+
+
+TARGET.CAPABILITY = ALL -TCB
+TARGET.UID3 = 0xe84eae56
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonecntfinder2/tsrc/u_cphcntmatcherimpl2/u_cphcntmatcherimpl2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+#include <QDebug>
+#include <qcontactfields.h>
+#include <qcontact.h>
+#include "qcontactmanager_moc.h"
+#include "cphcntmatch2.h"
+#include "cphcntcontactidimpl2.h"
+#include "cphcntmatcherimpl2.h"
+
+
+
+
+//---- test class
+
+class U_CPhCntMatcherImpl2: public QObject
+{
+Q_OBJECT
+
+public:
+    U_CPhCntMatcherImpl2();
+	~U_CPhCntMatcherImpl2();
+
+private slots:
+	void initTestCase();
+    void cleanupTestCase();
+    void test_MatchNumberFalse(); //test basic match
+    void test_MatchNumberExact(); //1 exact match
+    void test_MatchNumberSeveralReturned(); //returns 2 matches
+    void test_MatchNumber1(); //test match when contacid is given
+    void test_MatchNumber2(); //test match 3 overload
+    void test_MatchVoipNumber();
+    void test_MatchVoipNumber1(); // test 2nd overload
+    void test_HasCSNumbers();
+	void test_MatchNumberWithContactId(); //now happy day scenario, cannot test if the contact is valid
+	
+private:
+	
+    CPhCntMatcherImpl2* mMatcher; // implementation under test
+    QContactManager_Moc* mManager;
+
+};
+
+//--- testing
+
+U_CPhCntMatcherImpl2::U_CPhCntMatcherImpl2()
+    {
+    }
+
+U_CPhCntMatcherImpl2::~U_CPhCntMatcherImpl2()
+    {
+    }
+
+void U_CPhCntMatcherImpl2::initTestCase()
+    {
+    mManager = new QContactManager_Moc();
+    TRAP_IGNORE( mMatcher = CPhCntMatcherImpl2::NewL(mManager) ); //the ownership is transferred
+	
+    }
+
+void U_CPhCntMatcherImpl2::cleanupTestCase()
+    {
+	delete mMatcher;
+    }
+
+void U_CPhCntMatcherImpl2::test_MatchNumberFalse()
+    {
+    MPhCntMatch* match = NULL;
+    TInt err = KErrNotSupported;
+    mManager->setExpectedResult(0); //no match
+    _LIT(KNumber, "123456");
+    TRAP_IGNORE( err = mMatcher->MatchNumber(match, KNumber()) );
+    
+    Q_ASSERT(err == KErrNotFound);
+    Q_ASSERT(!match);
+    }
+
+void U_CPhCntMatcherImpl2::test_MatchNumberExact()
+    {
+    MPhCntMatch* match = NULL;
+    TInt err = KErrNotSupported;
+    mManager->setExpectedResult(1); //1 exact match
+    _LIT(KNumber, "123456");
+    TRAP_IGNORE( err = mMatcher->MatchNumber(match, KNumber()));
+     Q_ASSERT(err==KErrNone);
+     Q_ASSERT(match);
+    }
+void U_CPhCntMatcherImpl2::test_MatchNumberSeveralReturned()
+    {
+    MPhCntMatch* match = NULL;
+    TInt err = KErrNotSupported;
+    mManager->setExpectedResult(2); //2 matches returned
+    _LIT(KNumber, "123456");
+    TRAP_IGNORE( err = mMatcher->MatchNumber(match, KNumber()) );
+     Q_ASSERT(err==KErrNotFound);
+     Q_ASSERT(!match);   
+    }
+
+void U_CPhCntMatcherImpl2::test_MatchNumber1()
+    {
+    
+    MPhCntMatch* match = NULL;
+    TInt err = KErrNotFound;
+    _LIT(KNumber, "1234567890");
+    CPhCntContactIdImpl2* cnt = NULL;
+    QContact contact;
+    TRAP_IGNORE( cnt = CPhCntContactIdImpl2::NewL(contact) );
+    TRAP_IGNORE( err = mMatcher->MatchNumber(match, KNumber(), *cnt ) );
+    Q_ASSERT(err == KErrNone);
+    Q_ASSERT(!match);
+    delete cnt;
+    }
+
+void U_CPhCntMatcherImpl2::test_MatchNumber2()
+    {
+    MPhCntMatch* match = NULL;
+    TInt err = KErrNotFound;
+    TFieldId field (989);
+    _LIT(KNumber, "1234567890");
+    CPhCntContactIdImpl2* cnt = NULL;
+    QContact contact;
+    TRAP_IGNORE( cnt = CPhCntContactIdImpl2::NewL(contact) );
+    TRAP_IGNORE( err = mMatcher->MatchNumber(match, KNumber(), *cnt, field ) );
+    Q_ASSERT(err == KErrNone);
+    Q_ASSERT(!match);
+    delete cnt;
+    }
+
+
+void U_CPhCntMatcherImpl2::test_MatchVoipNumber()
+    {
+    MPhCntMatch* match = NULL;
+    TInt err = KErrNotSupported;
+    _LIT(KNumber, "sip:user@domain.com");
+    TRAP_IGNORE( err = mMatcher->MatchVoipNumber(match, KNumber(), ETrue) );
+    Q_ASSERT(err == KErrNotFound);
+    Q_ASSERT(!match);
+    }
+
+void U_CPhCntMatcherImpl2::test_MatchVoipNumber1()
+    {
+    MPhCntMatch* match = NULL;
+    TInt err = KErrNotSupported;
+    CPhCntContactIdImpl2* cnt = NULL;
+    QContact contact;
+    TRAP_IGNORE( cnt = CPhCntContactIdImpl2::NewL(contact) );  
+    TRAP_IGNORE( err = mMatcher->MatchVoipNumber(match, *cnt) );
+    Q_ASSERT(err == KErrNotFound);
+    Q_ASSERT(!match);
+    delete cnt;
+    }
+
+void U_CPhCntMatcherImpl2::test_HasCSNumbers()
+    {
+    CPhCntContactIdImpl2* cnt = NULL;
+    QContact contact;
+    TRAP_IGNORE(cnt = CPhCntContactIdImpl2::NewL(contact) );
+    TBool has = ETrue;
+    TRAP_IGNORE( has = mMatcher->HasCSNumbers(*cnt) );
+    Q_ASSERT(has==EFalse);
+    delete cnt;
+    }
+	
+void U_CPhCntMatcherImpl2::test_MatchNumberWithContactId()
+	{
+	 MPhCntMatch* match = NULL;
+    _LIT(KNumber, "123456");
+	 TInt id = 765;
+	 TInt err = KErrNotFound;
+	 TRAP_IGNORE( err = mMatcher->MatchNumber(match, KNumber(), id) );
+     Q_ASSERT(match);
+	 Q_ASSERT(match->Number() == KNumber());
+	 Q_ASSERT(err == KErrNone);
+
+	}
+
+QTEST_MAIN(U_CPhCntMatcherImpl2)
+#include "u_cphcntmatcherimpl2.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/api_headers.pri	Fri Jun 04 10:19:18 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: 
+#
+
+PHONEENGINE_API_HEADERS = ./inc/pevirtualengine.h \
+                          ./inc/mpecallcontrolif.h \
+                          ./inc/mpecallsettersif.h \
+                          ./inc/mpekeysequencerecognitionif.h \
+                          ./inc/telinternalcrkeys.h \
+                          ./inc/telinternalpskeys.h \
+                          ./inc/telinternalpstypes.h \
+                          ./inc/telephonyvariant.hrh \
+                          ./inc/cpephonemodelif.h \
+                          ./inc/mphonedevicemodeobserver.h \
+                          ./inc/mpephonemodelinternal.h \
+                          ./inc/mpeexternaldatahandler.h \
+                          ./inc/talogger.h \
+                          ./inc/pepanic.pan \
+                          ./inc/qtphonelog.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/bwins/phoneengineu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,4 @@
+EXPORTS
+	?CreateL@CPEPhoneModelIF@@SAPAV1@AAVMEngineMonitor@@AAVCPEAudioFactory@@@Z @ 1 NONAME ; class CPEPhoneModelIF * CPEPhoneModelIF::CreateL(class MEngineMonitor &, class CPEAudioFactory &)
+	?CreateL@CPEPhoneModelIF@@SAPAV1@AAVMEngineMonitor@@@Z @ 2 NONAME ; class CPEPhoneModelIF * CPEPhoneModelIF::CreateL(class MEngineMonitor &)
+
Binary file phoneengine/phonemodel/cenrep/keys_s60telephony.xls has changed
Binary file phoneengine/phonemodel/conf/s60telephony.confml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_101F87E3.crml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_102828B1.crml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_102828B2.crml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_102828B8.crml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_102828F8.crml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_102830B6.crml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_2001B2E6.crml has changed
Binary file phoneengine/phonemodel/conf/s60telephony_japan.confml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/data/phonemodel_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing phoneengine stub.
+;
+; phonemodel_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"phoneengine"},(0x1000A86C),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\phoneengine.dll"
\ No newline at end of file
Binary file phoneengine/phonemodel/data/phonemodel_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/eabi/phoneengineu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,4 @@
+EXPORTS
+	_ZN15CPEPhoneModelIF7CreateLER14MEngineMonitor @ 1 NONAME
+	_ZN15CPEPhoneModelIF7CreateLER14MEngineMonitorR15CPEAudioFactory @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeaccessorymodemonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file for CPEAccessoryModeMonitor class
+*
+*/
+
+
+#ifndef CPEACCESSORYMODEMONITOR_H
+#define CPEACCESSORYMODEMONITOR_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <AccessoryServer.h>
+#include <AccessoryMode.h>
+#include <AccPolAccessoryMode.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+ 
+// CLASS DECLARATION
+
+/**
+*   
+* For accessory mode
+* 
+* @since Series 60 3.1
+*/
+NONSHARABLE_CLASS( CPEAccessoryModeMonitor ) : public CActive
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPEAccessoryModeMonitor* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPEAccessoryModeMonitor();
+
+    public: // New functions
+    
+        RAccessoryServer AccessoryServer();
+    
+        /**
+        * Accessory mode
+        */
+        TInt AccessoryMode();
+        /**
+        * Accessory output status 
+        */
+        TBool Status();
+ 
+    protected:  // Functions from base classes
+    
+        /** @see CActive::RunL */
+        void RunL();
+
+        /** @see CActive::DoCancel */
+        void DoCancel();
+        
+           
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPEAccessoryModeMonitor();
+        
+        /**
+        * Mode notifying is started
+        */
+        void Start();
+           
+    private: // Data
+    
+        // Accessory mode
+        TInt iAccessoryMode;
+
+        // Status of accessory output
+        TBool iAudioOutputStatus;
+
+        // Accessory Server session 
+        RAccessoryServer   iAccServer;
+
+        // Accessory mode 
+        RAccessoryMode     iMode;
+
+        // Accessory Mode structure
+        TAccPolAccessoryMode iPolAccessoryMode;
+        
+        // Accessory server status
+        TBool iAccConn;
+        
+        // Accessory mode session status
+        TBool iAccSess;
+        };
+
+#endif  //  CPEACCESSORYMODEMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeactivestarter.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEActiveStarter class.
+*
+*/
+
+
+#ifndef CPEACTIVESTARTER_H
+#define CPEACTIVESTARTER_H
+
+//INCLUDES
+#include <e32base.h>
+#include "mpeactivestarter.h"
+
+//CONSTANTS
+//None.
+
+// MACROS
+//None.
+
+// DATA TYPES
+//None.
+
+// FUNCTION PROTOTYPES
+//None.
+
+// FORWARD DECLARATIONS
+//None.
+
+// CLASS DECLARATION
+
+/**
+*  Starts Phone Engine's modules asynchronically. 
+*  
+*
+*  @lib PhoneEngineBase.lib
+*  @since Series60_2.7
+*/
+NONSHARABLE_CLASS( CPEActiveStarter ) : public CActive
+    {
+    public:    //Constructors and descructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPEActiveStarter* NewL( MPEActiveStarter* aPEActiveStarter );
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CPEActiveStarter();
+
+    public:    //New functions
+
+        /**
+        * Starts Phone engine constuction.
+        * @since Series60_2.7
+        */        
+        void StartUp();
+
+    protected: // From CActive
+
+        /**
+        * Cancels asyncronous request(s).
+        * @since Series60_2.7
+        */
+        void DoCancel();
+
+        /**
+        * Standard RunError() method
+        * @since Series60_2.7
+        * @param  aError The leave code.
+        * @return KErrNone.
+        */
+        TInt RunError( TInt aError );
+
+        /**
+        * Standard RunL() method
+        * @since Series60_2.7
+        */
+        void RunL();
+        
+    private:
+    
+        /**
+        * C++ default constructor.
+        */
+        CPEActiveStarter( MPEActiveStarter* aPEActiveStarter );
+        
+    private:    //Data
+
+        // protocol specific active starter pointer
+        MPEActiveStarter* iActiveStarter;
+    };
+
+#endif // CPEACTIVESTARTER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeaudiooutputpreferencemonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file for CPEAudioOutputPreferenceMonitor class
+*
+*/
+
+
+#ifndef CPEAUDIOOUTPUTPREFERENCEMONITOR_H
+#define CPEAUDIOOUTPUTPREFERENCEMONITOR_H
+
+//INCLUDES
+#include "cpepubsubmonitor.h"
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+
+// CLASS DECLARATION
+
+/**
+*  CPEAudioOutputPreferenceMonitor
+*  Not exposed externally
+*  Monitors the audio output preference P&S key for changes
+*  and retrieves current settings
+*
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPEAudioOutputPreferenceMonitor ) 
+    : public CPEPubSubMonitor
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CPEAudioOutputPreferenceMonitor* NewL( MPEPhoneModelInternal& aModel );
+               
+    protected:
+        /**
+        * C++ default constructor.
+        */    
+        CPEAudioOutputPreferenceMonitor( MPEPhoneModelInternal& aModel );
+
+        /**
+        * Second-phase constructor.
+        */
+        void ConstructL();    
+        
+    protected:
+        /**
+        * Defines the actions that take place when a change indication
+        * is received. Most common approach would be to save the data to internal
+        * data store and send a message via phone model if neccessary.
+        */  
+        virtual void UpdateL();
+        
+    };
+
+#endif  //  CPEAUDIOOUTPUTPREFERENCEMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpecalldurationdisplaysettingmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header of the phone engine base 
+*                central repository monitor class
+*
+*/
+
+
+#ifndef CPECALLDURATIONDISPLAYSETTINGMONITOR_H
+#define CPECALLDURATIONDISPLAYSETTINGMONITOR_H
+
+// INCLUDE FILES
+#include "cpecenrepmonitor.h"
+
+// CLASS DECLARATION
+
+/**
+*   CPECallDurationDisplaySettingMonitor
+*   Retrieves call duration display setting from the central repository
+*
+*  @lib PhoneEngineBase.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPECallDurationDisplaySettingMonitor ) : public CPECenRepMonitor
+{
+public:
+    static CPECallDurationDisplaySettingMonitor* NewL();
+    ~CPECallDurationDisplaySettingMonitor();
+    TInt GetValue(TInt& aValue);
+protected: // From base class
+    virtual void UpdateL();
+protected:
+    CPECallDurationDisplaySettingMonitor();
+    void ConstructL();
+private:
+    TBool iDisplayCallDuration;
+    TInt iError;
+};
+
+#endif // CPECALLDURATIONDISPLAYSETTINGMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpecenrepmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header of the phone engine base 
+*                central repository monitor classes 
+*
+*/
+
+
+#ifndef CPECENREPMONITOR_H
+#define CPECENREPMONITOR_H
+
+// INCLUDE FILES
+#include <e32base.h>
+
+// Forward declarations
+class CRepository;
+
+// BASE CLASS
+
+// CLASS DECLARATION
+
+/**
+*   CPECenRepMonitor
+*   Active object base class for central repository monitor code - not instantiable
+*   Exported methods are used by variant phone engine or other PE components
+*   This class should not be used by components external to the TelephonyEngine
+*
+*  @lib PhoneEngineBase.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPECenRepMonitor )
+    : public CActive
+    {
+    protected:
+
+        ~CPECenRepMonitor();
+        CPECenRepMonitor( TUint32 aMonitorSetting );
+
+        /**
+        * Creates a new repository object and submits a notification request
+        */
+        void BaseConstructL( TUid aRepositoryUid );
+
+    protected:
+
+        /**
+        * Submits a notification request
+        */
+        void SubmitNotifyRequestL();
+
+        /**
+        * Defines the actions that take place when a change indication
+        * is received. Each deriving monitor has to define the implementation for
+        * this method. Most common approach would be to save the data to internal
+        * data store and send a message via phone model if neccessary.
+        */
+        virtual void UpdateL() = 0;
+
+    public:
+
+        /**
+        * Gets the current value of the monitored setting
+        * @param aValue the current value of the monitored setting
+        * @return TInt Symbian OS error code from central repository
+        */
+        virtual TInt Get( TInt& aValue );
+
+    protected: // From CActive
+
+        virtual void DoCancel();
+        virtual TInt RunError( TInt aError );
+        virtual void RunL();
+
+    protected: // Owned by this object
+
+        // Handle to repository object
+        CRepository* iRepository;
+        // Repository key, i.e. the identification number of the monitored setting
+        TUint32 iMonitorSetting;
+};
+
+#endif // CPECENREPMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeclientcallrequestmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEClientCallRequestMonitor class.
+*
+*/
+
+
+
+#ifndef CPECLIENTCALLREQUESTMONITOR_H
+#define CPECLIENTCALLREQUESTMONITOR_H
+
+//INCLUDES
+#include <e32base.h>
+#include <rphcltserver.h>
+#include "mpeclientcallrequestmonitor.h"
+#include <mphcltdialrequestobserver.h>
+
+
+// FORWARD DECLARATIONS
+class RTASecuritySession;
+class MPEPhoneModelInternal;
+class CPhCltCallNotify;
+class CPhCltDialData;
+
+
+// CLASS DECLARATION
+
+/**
+*  Monitor call requests from the phone server(/phone client). 
+*  
+*
+*  @lib PhoneEngineBase.lib
+*  @since S60_5.0
+*/
+NONSHARABLE_CLASS( CPEClientCallRequestMonitor ) 
+        : public CBase,
+          public MPEClientCallRequestMonitor,
+          public MPhCltDialRequestObserver
+{
+    public: //Constructors and destructor
+        /**
+        * Two-phased constructor.
+        * @param aModel Used to send client dial message to phone application.
+        * @param aEngineInfo To where phone number is saved.
+        * @param aPhoneServer Gived to RPhCltCallNotify in Open call.
+        */
+        static CPEClientCallRequestMonitor* NewL( 
+            MPEPhoneModelInternal& aModel, 
+            CPhCltCallNotify& aCallNotifier );
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CPEClientCallRequestMonitor(); 
+        
+    public:    //From MPEClientCallRequestMonitor
+        /**
+        * Gets dial data
+        * @return Reference to TPhCltTelephoneNumber, telephony number.
+        */
+        CPhCltDialData* ClientDialData();
+        
+        /**
+        * Sends respond to the phone client
+        * @param aRespond  contains respond to the phone client.
+        */
+        void SendRespond( const TInt aRespond );
+        
+    public: // From MPhCltDialRequestObserver
+        /**
+        * Dial request.
+        * @param aDialData data which ownership is transferred.
+        */
+        virtual void DialRequest( CPhCltDialData* aDialData );
+
+    public:    //New functions
+        /**
+        * Starts monitoring phone client.
+        */
+        void StartMonitoring( );
+        
+    public:
+        /**
+        * Cancels asyncronous request(s).
+        */
+        void Cancel();
+        
+        /**
+        * Tells whether this monitor is active.
+        */
+        TBool IsActive();
+
+
+    private:
+        /**
+        * C++ default constructor.
+        * @param aModel Used to send client dial message to phone application.
+        * @param aEngineInfo To where phone number is saved.
+        */
+        CPEClientCallRequestMonitor( MPEPhoneModelInternal& aModel,
+                                     CPhCltCallNotify& aCallNotifier );
+    
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    private:    //Data
+        // MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        //  Notifies call request from the client/server interface.
+        CPhCltCallNotify& iCallNotifier;
+        // Dial Data
+        CPhCltDialData* iDialData;
+        // Client originated call (on/off)
+        TBool iClientOriginatedCall;
+        // Monitoring flag
+        TBool iMonitoring;
+        
+    };
+
+#endif // CPECLIENTCALLREQUESTMONITOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeclientcommandhandlermonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitors AT command requests.
+*
+*/
+
+
+
+#ifndef CPECLIENTCOMMANDHANDLERMONITOR_H
+#define CPECLIENTCOMMANDHANDLERMONITOR_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <cphcltcommandhandler.h>
+#include <cphcltcallnotify.h>
+#include <rphcltserver.h>
+#include <pevirtualengine.h>
+#include <mphcltcomhandrequestobserver.h>
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+class MPECallHandling;
+class CPEMessageHandler;
+class CPEManualCallControlHandler;
+
+
+/**
+*  Monitors AT command requests.
+*/
+NONSHARABLE_CLASS( CPEClientCommandHandlerMonitor ) : public CBase, 
+    public MPhCltComHandRequestObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @return Pointer to created CPEClientCommandHandlerMonitor instance.
+        */
+        static CPEClientCommandHandlerMonitor* NewL(          
+            MPECallHandling& aCallHandling,
+            CPEMessageHandler& aMessageHandler,
+            MPEPhoneModelInternal& aModel, 
+            RPhCltServer& aPhoneServer,
+            CPEManualCallControlHandler& aManualCallControlHandler );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEClientCommandHandlerMonitor();
+
+    public: // New functions
+        
+        /**
+        * Start listening for AT command requests.
+        */
+        void Start();
+
+        /**
+        * Sends response to AT command request 
+        * and starts listening again.
+        * 
+        * @param aErrorCode Symbian OS error code of the success of the command.
+        */
+        void Respond( const TInt aErrorCode );
+        
+        /**
+        * Sends response to atd command.
+        * 
+        * @param aFlag ETrue if dialing started.
+        */
+        void DoCompleteCmdAtd( TBool aFlag );
+        
+    // from MPhCltComHandRequestObserver
+        /**
+        * Handles completed request.
+        */ 
+        void ComHandRequest();
+        
+        /**
+        * Cancels pending request.
+        */
+        void Cancel();
+        
+        /**
+        * Tells whether this monitor is active.
+        */
+        TBool IsActive();
+        
+
+
+    private: // Constructors
+
+        /**
+        * Constructor.
+        */
+        CPEClientCommandHandlerMonitor(           
+            MPECallHandling& aCallHandling,
+            CPEMessageHandler& aMessageHandler,
+            MPEPhoneModelInternal& aModel,
+            RPhCltServer& aPhoneServer,
+            CPEManualCallControlHandler& aManualCallControlHandler);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:
+
+        /**
+        * Sends response to server.
+        */
+        void SendResponse( const TInt aResponse );
+
+        /* Handles a leave occurring in the request completion.
+        * @since Series60_2.7 
+        * @param aError The leave code.
+        * @return KErrNone because leave has been handled.
+        */
+        TInt RunError( TInt aError );
+
+
+        
+
+        /**
+        * Handles various BT AT commands
+        * 
+        * @param aArgs command arguments, if any
+        * @return TNone
+        */
+        void HandleCommandRequestL(const TPhCltComHandCommandParameters& aArgs );
+
+        /**
+        * Processing ATA command.
+        */
+        void HandleCmdAta();
+
+        /**
+        * Processing CHUP command.
+        */
+        void HandleCmdChup();
+
+        /**
+        * Processing VTS command
+        * 
+        * @param aDtmfTone dtfm tone to be played
+        * @param aAction action to be done for a dtmf tone
+        * @return none
+        */
+        void HandleCmdVtsL( const TPhCltDtmfTone aDtmfTone,
+                            const TPhCltDtmfAction aAction  );
+
+        /**
+        * Handles ATD command.
+        * @param aPhoneNumber phone number.
+        */
+        void HandleCmdAtdL( const TPhCltTelephoneNumber& aPhoneNumber );
+         
+        /**
+        * Handles CHLD command.
+        * @param aChldCommand call parameters.
+        * @param aCallNo Call index in GSM.
+        */
+        void HandleCmdChldL( 
+            const TPhCltChldCommand aChldCommand,
+            const TUint aCallNo );
+        
+        /**
+        * Handles mute ringing tone command.
+        */
+        void HandleCmdMuteRingingTone();
+        
+        /**
+        * Handles mute microphone command.
+        * @param aMute 0 -> activate mic, 1 -> mute mic
+        */
+        void HandleCmdMuteMic( const TBool aMute );
+        
+    private: // utility method
+        
+        /** 
+        * Finds a conference call or a single call (in that order) in specified 
+        * state and tries to hang it up. 
+        *  
+        * @param aState The call state 
+        * @return KErrNone if succesfull, otherwise an error code. Especially 
+        *         KErrNotFound if there are no calls in the specified state and 
+        *         KErrGeneral or KErrAlreadyExists if a hangup request already 
+        *         exists for a call in the specified state. 
+        */ 
+        TInt HangUp( TPEState aState );
+
+    private:    // Data
+
+        // PhoneServer session.
+        RPhCltServer&                               iServer;
+        // Command handler notifier.
+        CPhCltCallNotify*                           iNotify;
+        // Command arguments.
+        TPckgBuf< TPhCltComHandCommandParameters >  iArgs;
+        // Library loader.
+        RLibrary                                    iLibrary;   
+        // MPECallHandling handles call related commands to CallHandling subsystem.
+        MPECallHandling&                            iCallHandling;
+        // CPEMessageHandler object which handles messages
+        CPEMessageHandler&                          iMessageHandler;    
+        // MPEPhoneModelInternal owns this object.
+        MPEPhoneModelInternal&                      iModel;
+        // Flag to indicate is the response from Phone UI is outstanding
+        TBool                                       iWaitingForResponse;
+        // Manual call control handler
+        CPEManualCallControlHandler&                iManualCallControlHandler;
+
+    };
+
+#endif      // CPECLIENTCOMMANDHANDLERMONITOR_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeclientemergencycallmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEClientEmergencyCallMonitor class.
+*
+*/
+
+#ifndef CPECLIENTEMERGENCYCALLMONITOR_H
+#define CPECLIENTEMERGENCYCALLMONITOR_H
+
+//INCLUDES
+#include <e32base.h>
+#include <cphcltemergencycall.h>
+#include <mphcltdialemergencyrequestobserver.h>
+#include "mpeclientcallrequestmonitor.h"
+
+// FORWARD DECLARATIONS
+class RTASecuritySession;
+class CPEMessageHandler;
+class MPEPhoneModelInternal;
+class CPhCltCallNotify;
+class CPhCltDialData;
+
+// CLASS DECLARATION
+
+/**
+*  Monitor Emergency call requests from the phone server(/phone client). 
+*  
+*
+*  @lib PhoneEngine.lib
+*  @since S60_5.0
+*/
+NONSHARABLE_CLASS( CPEClientEmergencyCallMonitor ) 
+        : public CBase,
+          public MPEClientCallRequestMonitor,
+          public MPhCltDialEmergencyRequestObserver  
+{
+    public: //Constructors and destructor
+        /**
+        * Two-phased constructor.
+        * @param aModel Used to send client dial message to phone application.
+        * @param aEngineInfo To where phone number is saved.
+        * @param aPhoneServer Gived to RPhCltCallNotify in Open call.
+        */
+        static CPEClientEmergencyCallMonitor* NewL( 
+            MPEPhoneModelInternal& aModel, 
+            CPhCltCallNotify& ACallNotifier );
+    
+        /**
+        * Destructor.
+        */
+        virtual ~CPEClientEmergencyCallMonitor(); 
+        
+    public:    //From MPEClientCallMonitor
+        /**
+        * Gets dial data
+        * @return Reference to TPhCltTelephoneNumber, telephony number.
+        */
+        CPhCltDialData* ClientDialData();
+        
+        /**
+        * Sends respond to the phone client
+        * @param aRespond  contains respond to the phone client.
+        */
+        void SendRespond( const TInt aRespond );
+        
+    public: 
+        /**
+        * Emergency dial request observer
+        */
+        void EmergencyDialRequest();
+
+    public:    //New functions
+        /**
+        * Starts monitoring phone client.
+        */
+        void StartMonitoring( );
+        
+        /**
+        * Cancels asyncronous request(s).
+        */
+        void Cancel();
+        
+        /**
+        * Tells whether this monitor is active.
+        */
+        TBool IsActive();
+
+        
+    public:
+
+        /**
+        * Informs object that asyncronous request is ready.
+        */
+        void DialEmergencyRequest();
+
+    private:
+        /**
+        * C++ default constructor.
+        * @param aModel Used to send client dial message to phone application.
+        * @param aEngineInfo To where phone number is saved.
+        */
+        CPEClientEmergencyCallMonitor( MPEPhoneModelInternal& aModel,
+                                     CPhCltCallNotify& aCallNotifier );
+      
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    private:    //Data
+        // MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        //  Notifies call request from the client/server interface.
+        CPhCltCallNotify& iCallNotifier;
+        // Client originated call (on/off)
+        TBool iClientOriginatedCall;
+        //Emergency number.
+        TBuf<KPhCltEmergencyNumberSize> iEmergencyNumber;        
+        // Monitoring flag
+        TBool iMonitoring;
+    };
+
+#endif // CPECLIENTEMERGENCYCALLMONITOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeclientservices.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEClientServices class.
+*
+*/
+
+
+
+#ifndef CPECLIENTSERVICES_H
+#define CPECLIENTSERVICES_H
+
+//INCLUDES
+#include <e32base.h>
+#include <rphcltserver.h>
+#include  <cphcltemergencycall.h>
+
+
+// FORWARD DECLARATIONS
+class CPEClientCallRequestMonitor;
+class CPEClientCommandHandlerMonitor;
+class CPEDeviceModeHandler;
+class CPEMessageHandler;
+class MPEPhoneModelInternal;
+class CPhCltUssd;
+class MPECallHandling;
+class RTASecuritySession;
+class CPEClientEmergencyCallMonitor;
+class CPhCltCallNotify;
+class MPEClientCallRequestMonitor;
+class CPhCltDialData;
+class CPEManualCallControlHandler;
+
+// CLASS DECLARATION
+
+/**
+*  Monitor client requests from the phone server(/phone client). 
+*  
+*
+*  @lib PhoneEngine.lib
+*  @since Series60_2.7
+*/
+NONSHARABLE_CLASS( CPEClientServices ) : public CBase
+    {
+    public: //Constructors and destructor
+    
+        /**
+        * Destructor.
+        */
+        ~CPEClientServices();
+
+        /**
+        * Two-phased constructor.
+        */
+         static CPEClientServices* NewL(
+             MPEPhoneModelInternal& aModel,
+             CPEMessageHandler& aMessageHandler, 
+             MPECallHandling& aCallHandling,
+             CPEManualCallControlHandler& aManualCallControlHandler );  
+        
+    public:    //New functions
+
+        /**
+        * Return whether the number specified would initiate an emergency call
+        * @param aNumber a number to be checked
+        * @param aIsEmergencyNumber Etrue, if the number is an emergency number.
+        * @param aMode emergency number checking mode.
+        * @return TInt Return value from PhoneClient.
+        */
+        TInt IsEmergencyPhoneNumber( 
+            TPhCltTelephoneNumber& aNumber, 
+            TBool& aIsEmergencyNumber );
+
+        /**
+        * Process USSD request
+        * @param aString, Unicode string to be sent.
+        */
+        TInt SendUssd( const TDesC& aString );
+
+        /**
+        * Start Monitoring
+        */
+        void StartMonitoring();
+
+        /**
+        * Return pointer of dial data.
+        */
+        MPEClientCallRequestMonitor* CallRequestMonitor();
+        
+        /**
+        * Return pointer of CPEClientCommandHandlerMonitor
+        */
+        CPEClientCommandHandlerMonitor* CommandHandlerMonitor();
+        
+
+    protected:
+
+        /**
+        * C++ default constructor.
+        */
+        CPEClientServices(
+            MPEPhoneModelInternal& aModel,
+            CPEMessageHandler& aMessageHandler,
+            MPECallHandling& aCallHandling,
+            CPEManualCallControlHandler& aManualCallControlHandler );
+
+        void ConstructL();
+
+
+    private:    //Data
+        // MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        // CPEMessageHandler object which owns this requester.
+        CPEMessageHandler& iMessageHandler;
+        // Handle to Call Handling subsystem
+        MPECallHandling& iCallHandling;
+        // Handle to Phone Client/Server
+        RPhCltServer iPhoneServer;
+        // Service for checking emergency number.
+        CPhCltEmergencyCall* iEmergency;
+        // Handle to CPEClientEmergencyCallMonitor
+        CPEClientEmergencyCallMonitor* iClientEmergencyMonitor;
+        //  Notifies call request from the client/server interface.
+        CPhCltCallNotify* iCallNotifier;
+        // Handle to Phone Client/Server USSD interface
+        CPhCltUssd* iUssdClient;
+        // Handle to CPEClientCommandHandlerMonitor
+        CPEClientCommandHandlerMonitor* iClientCommandHandlerMonitor;
+        // Handle to CPEClientCallRequestMonitor
+        CPEClientCallRequestMonitor* iClientCallRequestMonitor;
+        // USSD string to be sent
+        TPtrC iString;
+        // Handle to CPEDeviceModeHandler
+        CPEDeviceModeHandler* iDeviceModeHandler;
+        // Manual Call Control Handler
+        CPEManualCallControlHandler& iManualCallControlHandler;
+    };
+
+#endif // CPECLIENTSERVICES_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpedevicemodehandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Device mode handler
+*
+*/
+
+
+
+#ifndef CPEDEVICEMODEHANDLER_H
+#define CPEDEVICEMODEHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <mphonedevicemodeobserver.h>
+
+// FORWARD DECLARATIONS
+class MPECallHandling;
+class CPEMessageHandler;
+class CTelDMHandler;
+
+
+/**
+*  Device mode handler.
+*/
+NONSHARABLE_CLASS( CPEDeviceModeHandler ) : public CBase, public MPhoneDeviceModeObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @return Pointer to created CPEDeviceModeHandler instance.
+        */
+        static CPEDeviceModeHandler* NewL(          
+            MPECallHandling& aCallHandling,
+            CPEMessageHandler& aMessageHandler );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEDeviceModeHandler();
+
+    public: // New functions
+        
+    protected:
+      
+        /**
+        * @see MPhoneDeviceModeObserver
+        */
+        void Answer();
+
+        /**
+        * @see MPhoneDeviceModeObserver
+        */
+        void EndVoiceCalls();
+
+ 
+    private: // Constructors
+
+        /**
+        * Constructor.
+        */
+        CPEDeviceModeHandler(           
+            MPECallHandling& aCallHandling,
+            CPEMessageHandler& aMessageHandler );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Loads Telephony Device mode library.
+        */
+        void LoadLibraryL();
+    
+    private:    // Data
+       
+        // Library loader.
+        RLibrary            iLibrary;   
+
+        // MPECallHandling handles call related commands to CallHandling subsystem.
+        MPECallHandling&    iCallHandling;
+
+        // CPEMessageHandler object which handles messages
+        CPEMessageHandler&  iMessageHandler;    
+   
+        // TelDeviceMode instance.
+        CTelDMHandler*      iTelDevModeHandler;
+
+    };
+
+#endif      // CPEDEVICEMODEHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeexternaldatahandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEExternalDataHandler class
+*
+*/
+
+
+#ifndef CPEEXTERNALDATAHANDLER_H
+#define CPEEXTERNALDATAHANDLER_H
+
+//  INCLUDE FILES
+#include "cpeaudiooutputpreferencemonitor.h"
+#include "cpecalldurationdisplaysettingmonitor.h"
+#include "cpenetworkregistrationstatusmonitor.h"
+#include "cpeprofilesettingmonitor.h"
+#include "mpeexternaldatahandler.h"
+#include "cpeaccessorymodemonitor.h"
+#include "penetworkhandler.h"
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MPEDataStore;
+class MPEPhoneModelInternal;
+
+// DATA TYPES
+// None
+
+// CLASS DECLARATION
+
+/**
+*  CPEExternalDataHandler
+*  For derivation only, not to be instantiated!
+*  A container for Phone Engine base Central Repository monitors and
+*  a command class for Central Repository settings.
+*
+*  @lib Phoneengine.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPEExternalDataHandler )
+        : public CBase,
+          public MPEExternalDataHandler
+    {
+    public:
+
+        static CPEExternalDataHandler* NewL( MPEPhoneModelInternal& aModel );
+        ~CPEExternalDataHandler();
+        
+// from base class MPEExternalDataHandler        
+        
+        /**
+        * Gets the current value of the specified setting,
+        * if the operation was successful then aValue contains the current valid
+        * value of the setting
+        * @param aSetting specifies the setting to be read
+        * @param aValue the current value of the monitored setting
+        * @return Symbian OS error code
+        */
+        TInt Get( const TPEExternalDataId aSetting, TInt& aValue ) const;
+
+        /**
+        * Gets the current value of the specified setting,
+        * if the operation was successful then aValue contains the current valid
+        * value of the setting
+        * @param aSetting specifies the setting to be read
+        * @param aValue the current value of the monitored setting
+        * @return Symbian OS error code
+        */
+        TInt GetText( const TPEExternalDataId aSetting, TDesC& aValue ) const;
+
+        /**
+        * Sets the value of the specified setting,
+        * @param aSetting specifies the setting to be written
+        * @param aValue the value of the setting
+        * @return Symbian OS error code
+        */
+        TInt Set( const TPEExternalDataId aSetting, const TInt aValue );
+
+    private:
+
+        CPEExternalDataHandler( MPEDataStore& aEngineInfo );
+        void ConstructL( MPEPhoneModelInternal& aModel );
+
+        /**
+        * Check if automatic answer is defined for connected accessory.
+        * @param aSetting specifies accessory type of setting
+        * @param aValue the value of the setting
+        * @return Symbian OS error code
+        */
+        TInt GetAutomaticAnswer( TUint32 aSetting,TInt& aValue ) const;
+        
+    protected: // Owned by this object
+
+        // Reference to engine info object
+        MPEDataStore& iDataStore;
+
+        // Monitor objects
+        CPEAudioOutputPreferenceMonitor* iAudioOutputPreferenceMonitor;
+        CPECallDurationDisplaySettingMonitor* iCallDurationDisplay;     
+        CPENetworkRegistrationStatusMonitor* iNetworkRegistrationStatus;
+        CPEProfileSettingMonitor* iProfileSettings;
+        CPEAccessoryModeMonitor* iAccessoryModeMonitor;
+        PeNetworkHandler* iNetworkHandler;
+
+        // Repository objects
+        CRepository* iAccessorySettingsRepository;
+        CRepository* iTelephonySettingsRepository;
+        CRepository* iTelephonyVariationRepository;
+        CRepository* iCoreApplicationRepository;
+    };
+
+#endif  //  CPEEXTERNALDATAHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeidlestatusmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file for CPEIdleStatusMonitor class
+*
+*/
+
+
+#ifndef CPEIdleStatusMonitor_H
+#define CPEIdleStatusMonitor_H
+
+//INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class CPEPhoneModel;
+
+// CLASS DECLARATION
+
+/**
+*  CPEIdleStatusMonitor
+*  Monitors the idle status P&S key for changes
+*
+*  @since S60_5.0
+*/
+NONSHARABLE_CLASS( CPEIdleStatusMonitor ) : public CActive
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CPEIdleStatusMonitor* NewL( 
+            CPEPhoneModel& aOwner );
+            
+        /**
+        * Destructor.
+        */
+        virtual ~CPEIdleStatusMonitor();     
+               
+    protected:
+        /**
+        * C++ default constructor.
+        */    
+        CPEIdleStatusMonitor( CPEPhoneModel& aOwner );
+
+        /**
+        * Second-phase constructor.
+        */
+        void ConstructL();    
+        
+    private: // From CActive
+
+        /**
+        * Implements cancellation of an outstanding request.
+        */
+        void DoCancel();
+
+        /**
+        * Handles request completion event.
+        */
+        void RunL();
+        
+    private:
+
+        // MPEPhoneModelInternal owns this object.
+        CPEPhoneModel& iOwner;
+        // The interface to Publish And Subscribe.
+        RProperty iProperty;
+    };
+
+#endif  //  CPEIdleStatusMonitor_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpemanualcallcontrolhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Manual call control handler
+*
+*/
+
+
+#ifndef CPEMANUALCALLCONTROLHANDLER_H
+#define CPEMANUALCALLCONTROLHANDLER_H
+
+//  INCLUDES
+#include <cphcltcommandhandler.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPEMessageHandler;
+class MPECallHandling;
+class MPEDataStore;
+
+// CLASS DECLARATION
+
+/**
+*  Handles Manual call control sequences.
+*
+*  @lib phoneenginebase.dll
+*  @since Series60_5.0
+*/
+NONSHARABLE_CLASS( CPEManualCallControlHandler ) : public CBase
+    {
+    public:  // Destructor
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEManualCallControlHandler();
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPEManualCallControlHandler* NewL( 
+                MPECallHandling& aCallHandling, 
+                CPEMessageHandler& aMessageHandler,
+                MPEDataStore& aDataStore );
+
+    public: // New functions
+
+        /**
+        * Handles Chld AT message.
+        * @since Series60_5.0
+        * @param aChldCommand Chld message
+        * @param aCallNo Call Nro.
+        */
+        void HandleChldL( 
+            const TPhCltChldCommand aChldCommand,
+            const TUint aCallNo );
+
+        /**
+        * Handles Going private in Conference Call
+        * @since Series60_5.0
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleGoOneToOne();
+            
+        /**
+        * Release held calls or reject a waiting call.
+        */
+        TInt HandleChldZero();
+        
+        /**
+        * Release all active calls and accept other (held or waiting) call.
+        */
+        TInt HandleChldOne();
+        
+        /**
+        * Release specific active call or accept specific waiting call.
+        */
+        void HandleChldOneXL( TInt aCallNo );
+        
+        /**
+        * Place all active calls on hold(SWAP) and accept the other 
+        * (held or waiting) call.
+        */
+        TInt HandleChldTwo();
+        
+        /**
+        * Hold all active calls except specific call.
+        */
+        void HandleChldTwoXL( TInt aCallNo );
+        
+        /**
+        * Add a held call to the conversation.
+        */
+        TInt HandleChldThree();
+        
+        /**
+        * Connect held and active call each other. Locally both calls are disconnect
+        * (Explicit call transfer).
+        */
+         TInt HandleChldFour();
+
+         /**
+         * Fetch call id using given call index
+         */
+         TInt CallIdByIndexL( const TInt& aCallIndex );
+        
+        
+    public: // Functions from base classes
+        // None.        
+    protected:  // New functions
+        // None.
+    private:  // Functions from base classes
+        // None.
+
+    private: //Constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CPEManualCallControlHandler( MPECallHandling& aCallHandling, 
+                CPEMessageHandler& aMessageHandler,
+                MPEDataStore& aDataStore );
+    
+    protected:  // Data
+        // None.
+    private:    // Data
+        // MPECallHandling handles call related commands to CallHandling subsystem.
+        MPECallHandling& iCallHandling;
+        // MEngineMonitor handles interface structures to phone application
+        CPEMessageHandler& iMessageHandler;
+        // reference to data store
+        MPEDataStore& iDataStore;
+    public:     // Friend classes
+        // None.
+    protected:  // Friend classes
+        // None.
+    private:    // Friend classes
+        // None.
+
+    };
+
+#endif      // CPEMANUALCALLCONTROLHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpemessagehandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,876 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Message handler
+*
+*/
+
+
+
+#ifndef CPEMESSAGEHANDLER_H
+#define CPEMESSAGEHANDLER_H
+
+//  INCLUDES
+#include <pevirtualengine.h>
+#include <DosSvrServices.h>
+#include <cphcltcommandhandler.h>
+#include <cphcltdialdata.h>
+
+#include "mpecallhandling.h"
+#include "mpecallcontrolif.h" 
+#include "mpekeysequencerecognitionif.h"
+
+// CONSTANTS
+const TInt KModeNormal = 0;  // Normal System mode  
+const TInt KModeFligth = 1;  // Flight mode 
+const TInt KModePDA    = 2;  // PDA mode 
+
+// Valid characters in an dialing string
+_LIT( KPEClientValidChars, "+0123456789*#pwPW" );
+_LIT( KPEValidDTMFChars, "0123456789*#pwPW" );
+_LIT( KPEValidDTMFStringStopChars, "+pPwW" );
+
+// DTMF Speed dial substitution
+_LIT( KPEValidSpeedDialChars, "23456789" );
+const TInt KPEDtmfSpeedDialSubstitutionsMax = 2; // prevent infinite loop.
+const TInt KPESpeedDialIndexMin = 2;
+const TInt KPESpeedDialIndexMax = 9;
+
+// DTMF parsing status for Speed dial location
+enum TPESpeedDialSubstituionStatus
+    {
+    EPEDtmfSpeedDialOk,
+    EPEDtmfSpeedDialPromptUser,
+    EPEDtmfSpeedDialNotAssigned,
+    EPEDtmfSpeedDialInvalidSpeedDial
+    };
+
+// Invalid characters in an dialing string, these chars can be removed from dial string
+_LIT( KPECharsThatCanBeDelete, "\"/ ().-" );
+
+// MACROS
+// None.
+
+// DATA TYPES
+
+// Phone number prefix text, for prefix change
+typedef TBuf<10> TPEPrefixText;
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+class MPECallHandling;
+class MEngineMonitor;
+class CPEGsmAudioData;
+class CPESimStateMonitor;
+class CPEMMParserBase;
+class CPETimer;
+class MPEAudioData;
+class MPELogHandling;
+class MPEContactHandling;
+class CPEMMHandlerContainer;
+class RTASecuritySession;
+class CPEClientInformation;
+class CPEClientServices;
+class CPEClientCallRequestMonitor;
+class CPEExternalDataHandler;
+class MPEDataStore;
+class CPhoneGsmOptionContainerBase;
+class CPEParserPhoneNumberHandler;
+class CPEParserSSHandler;
+class CPhoneGsmParserBase;
+class CPhoneGsmHandlerContainer;
+class CPhoneGsmParserResult;
+class CPEParserEmergencyNumberHandler;
+class CPEParserVoipNumberHandler;
+class CPEManualCallControlHandler;
+class MPEServiceHandling;
+
+// CLASS DECLARATION
+
+/**
+*  Handles phone related messages from the MPEPhoneModelInternal object.
+*
+*  @lib phoneenginebase.dll
+*  @since S60_5.0
+*/
+NONSHARABLE_CLASS( CPEMessageHandler ) 
+    : 
+        public CBase, 
+        public MPECallControlIF,
+        public MPEKeySequenceRecognitionIF
+    {
+    public:  // Destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPEMessageHandler* NewL( 
+                MPEPhoneModelInternal& aModel,
+                MPECallHandling& aCallHandling,
+                MEngineMonitor& aEngineMonitor,
+                CPEGsmAudioData& aAudioData,
+                MPELogHandling& aLogHandling,
+                MPEContactHandling& aContactHandling,
+                CPESimStateMonitor& aSimStateMonitor,
+                CPEExternalDataHandler& aGsmExternalDataHandler,
+                                           MPEServiceHandling& aServiceHandling,
+                RFs& aFsSession );
+        /**
+        * Destructor.
+        */
+        ~CPEMessageHandler();
+
+    public: // New functions
+
+        /**
+        * Handles answer call message from the phone application.
+        * @param aAutomaticAnswer, ETrue if triggered by automatic answer
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleAnswerCall( const TBool aAutomaticAnswer );
+
+        /**
+        * Handles accessory mode changed message from AudioHandling subsystem.
+        * @param aVideoCall, ETrue if call type video call
+        * @return possible error code from the AudioHandling subsystem
+        */
+        TInt HandleAudioRouting( TBool aVideoCall, TInt aCallId );
+
+        /**
+        * Handles route preference changed message from AudioHandling subsystem.
+        * @return possible error code from the AudioHandling subsystem
+        */
+        TInt HandleRoutePreferenceChanged();
+        
+        /**
+        * Handles continue dtmf sending ('w' character in the dtmf string have defected stop in the dtmf sending)
+        * @param aContinue, informs continue or not.
+        */
+        void HandleContinueDtmfSending( const TBool aContinue );
+
+        /**
+        * Handles release all message from phone application 
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleReleaseAll( );
+
+        /**
+        * Handles release message from phone application 
+        * @param aAutoResumeOption if options for autoresume.
+        * @return Return possible error code.
+        */
+        TInt HandleReleaseCall( TPEHangUpOptions aAutoResumeOption = ETPEHangUpDefault );
+
+        /**
+        * Handles send dtmf message from phone application 
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleSendDtmf();
+
+        /**
+        * Handles audio mute message from the phone application. 
+        */
+        void HandleSetAudioMute();
+        
+        /**
+        * Handles audio output message from the phone application. 
+        * @return possible error code from the AudioHandling subsystem.
+        */
+        TInt HandleSetAudioOutput();
+
+        /**
+        * Handles change volume message from the phone application.
+        */
+        void HandleSetAudioVolume();
+
+        /**
+        * Starts tone playing. 
+        */
+        void HandlePlayDTMFL();
+
+        /**
+        * Stops tone playing. 
+        * @return error code.
+        */
+        TInt HandleEndDTMF();
+
+        /**
+        * Terminates all connected calls, waiting call, data connections.
+        * @return errorCode.
+        */        
+        TInt HandleTerminateAllConnections(); 
+
+        /**
+        * Sets phone client information
+        * @param aCallId, the dentification number of the call.
+        * @param aMainPartOfPhoneNumber The phone number, 
+        *        where extra chaters "/ ().-" and possible prefix are removed. 
+        */        
+        void SetClientInformation( const TInt aCallId, 
+            const TDesC& aMainPartOfPhoneNumber );
+            
+         /**
+        * Sets phone client information
+        * @param aClientDialData Client dial data 
+        */  
+        void SetClientData( 
+            const CPhCltDialData& aClientDialData ); 
+        
+        /**
+        * Checks if the current char is removable
+        * @param TChar, current character from inspected string.
+        * @return TBool.
+        */
+        TBool IsItCharThatCanDelete( const TChar& aChar ) const;
+
+        /**
+        * Checks if the current char is valid
+        * @param TChar, current character from inspected string.
+        * @return TBool.
+        */
+        TBool IsValidChar( const TChar& aChar, const TDesC& aValidChars ) const;
+
+        /**
+        * Removes invalid char if it is removable
+        * @param TDesc, current string from wich we are interested in.
+        * @return TBool.
+        */
+        TBool RemoveInvalidChars( TDes& aString, 
+                                           const TDesC& aValidChars, 
+                                           const TBool aCheckForDelete ) const;
+
+        /**
+        * Handles lifetimer data from customa api -> engineinfo.
+        * @return TInt possible error code..
+        */
+        TInt HandleGetLifeTimerData() const;
+
+        /**
+        * Handles EPEMessageDTMFSent message from call handling subsystem
+        * @param ECCPErrorNone or KPEDontSendMessage
+        */
+        TInt HandleDtmfSent();
+        
+        /**
+        * Stops DTMF sending and resets DTMF processing state
+        */
+        void StopDtmfSending();
+        
+        /**
+        * Handles reject call message 
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleRejectCall();
+        
+        /**
+        * Called asyncronously from callback. Calls HandleSendDtmf()
+        * function.
+        * @param aAny Pointer to 'this' object.
+        * @return error code.
+        */
+        static TInt CallBackHandleSendDtmf( TAny* aAny );
+
+        /**
+        * Handles plus (+) sign in a DTMF string.
+        * @param aDtmfString Current DTMF string to process.
+        */
+        void HandlePlusSignInDtmf( const TPEDtmfString& aDtmfString );
+        
+        /**
+        * Called asyncronously from callback.
+        * @param aAny Pointer to 'this' object.
+        * @return error code.
+        */
+        static TInt CallbackSendMessageStoppedDTMF( TAny* aAny );
+        
+        /**
+        * Handles build conference message from phone application
+        * @return Return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleBuildConferenceCall();
+
+        /**
+        * Handles Going private in Conference Call
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleGoOneToOne();        
+
+        /**
+        * Gets basic service group value. 
+        * @return basic service group.
+        */
+        inline RMobilePhone::TMobileService BasicServiceGroup();
+        
+        /**
+        * Handles add conference member message from phone application
+        * @return possible error code.
+        */
+        TInt HandleAddConferenceMember();
+
+        /**
+        * Handles dropped conference member message
+        */
+        void HandleDroppedConferenceMember();
+        
+        /**
+        * Handles EPEMessageALSLineChanged message.
+        */
+        void HandleALSLineChanged();
+
+        /**
+        * Handles error message from the CallHandling subsystem.
+        * @param aCallId is the identification number of the call.
+        * @param aBusyCall informs that error cause was busy remote party.
+        */
+        void HandleCallHandlingError( const TInt aCallId, const TBool aBusyCall );
+        
+        /**
+        * Handles cancel SS string command.
+        * @return Possible error code from the Settings utility subsystem.
+        *         Security module don't have return value from cancel command.
+        */
+        TInt HandleCancelSSstringCommand();
+
+        /**
+        * Handles conference idle state
+        * @param aCallId is the identification number of the call.
+        * @return Return possible error code.
+        */
+        TInt HandleConferenceIdleState( const TInt aCallId );
+
+        /**
+        * Handles connected message from the CallHandling subsystem.
+        * @param aCallId, identification number of the call.
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleConnectedState( const TInt aCallId );
+
+        /**
+        * Handles video call logging in Connected state
+        * @param aCallId is the identification number of the call.
+        * @return Return possible error code.
+        */
+        TInt HandleVideoCallConnected( const TInt aCallId );
+
+        /**
+        * Handles video call logging in Idle state
+        * @param aCallId is the identification number of the call.
+        * @return Return possible error code.
+        */
+        TInt HandleVideoCallIdle( const TInt aCallId );
+
+        /**
+        * Handles EPEMessageSetALSLine message.
+        */
+        void HandleSetALSLineL();
+
+        /**
+        * Handles dial message from phone application or phone client.
+        * @param aClientCall, Informs is the current call client originated or not.
+        * @return Return possible error code.
+        */
+        TInt HandleDialCall( const TBool aClientCall );        
+
+        /**
+        * Handles dial emergency message from phone application or phone client.
+        * Phase one of emergency call initialization
+        * @param aClientCall, Informs is the current call client originated or not.
+        * @return Return possible error code.
+        */
+        TInt HandleDialEmergencyCall( const TBool aClientCall );        
+
+        /**
+        * Handles Sat dial request completed message from the phone application 
+        */
+        void HandleSatCallRequestCompleted( );
+
+        /**
+        * Phase two of emergency call initialization
+        */
+        void ContinueDialEmergency();
+
+        /**
+        * Handles dialing state transition for voice and video calls
+        * @param aCallId is the identification number of the call.
+        */
+        void HandleDialingStateL( const TInt aCallId );
+
+        /**
+        * Handles incoming voice and video call
+        * @param aCallId is the identification number of the call.
+        */
+        void HandleIncomingCallL( const TInt aCallId );
+
+        /**
+        * Handles disconnecting without inband tones.
+        * @param aCallId is the identification number of the call.
+        * @return possible error code.
+        */
+        TInt HandleDisconnecting( const TInt aCallId ); 
+
+        /**
+        * Handles disconnecting with inband tones.
+        * @param aCallId is the identification number of the call.
+        * @return possible error code.
+        */
+        TInt HandleDisconnectingWithInband( const TInt aCallId );
+
+        /**
+        * Handles drop conference member message from phone application
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleDropConferenceMember();
+
+        /**
+        * Handles hold message from the phone application 
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleHoldCall( );
+
+        /**
+        * Handles video call switch to video or voice from phoneui 
+        */
+        TInt HandleSwitchToVideoOrVoice( const TInt aCallId ); 
+        
+        /**
+        * Continue switch to video call or voice call.
+        * Calls dial method to create new video call or voice call 
+        * to same phonenumber.
+        * @param aCallId is the identification number of the call.
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt ContinueSwitchToCall( const TInt aCallId );  
+
+        /**
+        * Handles idle state message from the CallHandling subsystem.
+        * @param aCallId is the identification number of the call.
+        * @return Return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleVoiceCallIdleState( const TInt aCallId );
+
+        /**
+        * Handles play DMTF message from phone application 
+        */
+        void ProcessPlayDTMFL( );
+
+        /**
+        * Handles end DTMF playing message from phone application 
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt ProcessEndDTMF( );
+
+        /**
+        * Handles resume message from phone application 
+        * @return possible error code from the CallHandling subsystem.
+        */
+        TInt HandleResumeCall( );
+
+        /**
+        * Handles send USSD request from CPEGsmParserMiscHandler
+        * @param aString, USSD string to be sent
+        * @return Symbian OS error code
+        */
+        TInt HandleSendUssd( const TDesC& aString );
+
+        /**
+        * Handles EPEMessageSimStateChanged from Dos Server.
+        * @return None.
+        */
+        void HandleSimStateChanged( );
+
+        /**
+        * Handles startup message from the phone application.
+        * @return None.
+        */
+        void HandleStartUp();
+
+        /**
+        * Handles Phone Number Edited message from phone application 
+        */
+        void HandlePhoneNumberEditedL();
+
+        /**
+        * Handles service enabled message from service handling subsystem
+        * @since Series60_5.0
+        * @return possible error code from the ServiceHandling subsystem
+        */
+        TInt HandleServiceEnabled();
+        
+        /**
+         * Handles remote party information changed         
+         * @since Series60_5.2         
+         */
+        void HandleRemotePartyInfoChanged( );
+
+        /**
+        * Handles swap message from the phone application 
+        * @return possible error code from the CallHandling subsystem.
+        */
+        inline TInt HandleSwapCalls();
+
+        /**
+        * Handles transfer message from phone application.
+        * @return possible error code from the CallHandling subsystem.
+        */
+        inline TInt HandleTransferCalls();
+    
+        /**
+        * Sets basic service group for future using,
+        * @param aServiceGroup, includes basic service group.
+        * @return None.
+        */
+        inline void SetBasicServiceGroup( const RMobilePhone::TMobileService& aServiceGroup );
+        
+        /**
+        * Sets gsm parser error code for future using.
+        * @param aGsmParserErrorCode, includes possible error code from parser process.
+        * @return None.
+        */
+        inline void SetGsmParserErrorCode( TInt aGsmParserErrorCode);
+
+        /**
+        * Check is given number emergency number
+        * @return Epoc errorcodes.
+        */
+        TInt HandleEmergencyCheck( );
+
+        /**
+        * Stops playing a inband tone. 
+        */
+        void HandleStopInbandTonePlay();
+
+        /**
+        * Handles automatic answer off from customa api -> engineinfo.
+        * @return TInt possible error code..
+        */
+        void HandleAutomaticAnswerOff( ) const;
+
+        /**
+        * Handles AT dialing started
+        * @param aSucceed true if succeeded
+        */
+        void HandleATDialingStarted( const TBool aSucceed ) const;
+        
+        /**
+        * Replace active call
+        * @return Possible error code
+        */
+        TInt HandleReplaceActive();
+        
+        /**
+        * Check if phone is locked, if locked leave with ECCPErrorAuthenticationFailed error.
+        */
+        void CheckIfPhoneIsLockedL();
+        
+        /**
+         * Handles unattended transfer request response.
+         * @param    aAcceptRequest     ETrue to accept, EFalse to reject request.
+         */
+        TInt HandleUnattendedTransferRequestResponse( TBool aAcceptRequest );
+
+        /**
+        * Handle unattended transfer
+        * @return KErrNone if succesfull
+        */
+        TInt HandleUnattendedTransfer();
+
+        /**
+        * Handle call forward
+        * @return KErrNone if succesfull
+        */ 
+        TInt ForwardCallToAddress();
+ 
+        /**
+        * Handle disable service
+        */     
+        void HandleDisableService();
+
+        /**
+        * Handle dial service call
+        */ 
+        TInt HandleDialServiceCall(
+            const TBool aClientCall );
+    
+    public: // from MPEKeySequenceRecognitionIF
+        /**
+         * Executes provided key sequence if recognized.
+         */ 
+        TBool ExecuteKeySequenceL(const TDesC16 &aSequence);
+    
+    private: // New functions
+        
+        /**
+        * C++ default constructor.
+        */
+        CPEMessageHandler( MPEPhoneModelInternal& aModel, 
+                           MPECallHandling& aCallHandling, 
+                           MEngineMonitor& aEngineMonitor, 
+                           CPEGsmAudioData& aAudioData, 
+                           MPELogHandling& aLogHandling, 
+                           MPEContactHandling& aContactHandling,
+                           CPESimStateMonitor& aSimStateMonitor,
+                           CPEExternalDataHandler& aExternalDataHandler,
+                              MPEServiceHandling& aServiceHandling,
+                           RFs& aFsSession );
+        void ConstructL();
+        
+        /**
+        * Checks the status of phone number prefix change setting
+        * and calls CPEMessageHandler::ChangePrefix for execution
+        * If error occurs the phone number is left untouched
+        * @param aPhoneNumber, phone number to be checked
+        */
+        void CheckPrefix();
+
+        /**
+        * Replaces phone number prefix with the one provided
+        * @param aPrefixText, prefix to be used in replacement
+        * @return possible Symbian OS error code
+        */
+        TInt ChangePrefix( const TPEPrefixText& aPrefixText );
+        
+        /**
+        * Remove '+' begin of the string
+        */
+        void RemovePlusPrefix( TPEPhoneNumber& aPhoneNumber );
+
+        /**
+        * Checks if automatic answer is on for audio accessory
+        * @param TInt aCallId, call identification.
+        * @return TBool.
+        */
+        TBool AutomaticAnswer( const TInt aCallId ) const;
+
+        /**
+        * Returns a boolean to indicate whether emergency call is allowed or not.  
+        * @return Return a True or False. 
+        */
+        TBool IsEmergencyAllowed() const;
+
+        /**
+        * Handle Client Call Data.
+        * @return Return possible error.
+        */
+        void HandleClientCallData();
+
+        /**
+        * HandleEngineInfo. Set information to EngineInfo.
+        * @param TInt aCallId, call identification.
+        * @return Return possible error.
+        */
+        TInt HandleEngineInfo( const TInt aCallId ); 
+        
+        /**
+        * Update Client information
+        * @param TInt aCallId, call identification.
+        */        
+        TInt UpdateClientInfo( const TInt aCallId );
+        
+        /**
+        * Check is phoneNumber emergency number and 
+        * should phonenumber hide for User
+        * @param TInt aCallId, call identification.
+        */
+        void CheckAndHideIdentity( const TInt aCallId );
+
+        /**
+        * Finds callInfo form TSY.
+        * @param TInt aCallId, call identification.
+        * @return Return possible error.
+        */
+        TInt FindCallInfo( const TInt aCallId );
+
+        /**
+        * Set phonenumber for call logging
+        * @param TInt aCallId, call identification.
+        * @return None.
+        */
+        void SetPhoneNumberForCallLogging( const TInt aCallId );
+
+        /**
+        * Store call information for logging
+        * @param TInt aCallId, call identification.
+        * @param TPEState aCallState, call's state.
+        * @return None.
+        */
+        void SetLoggingInfo( const TInt aCallId, TPEState aCallState );
+
+        /**
+        * Set name to the EngineInfo.
+        * @param TInt aCallId, call identification
+        * @return None.
+        */
+        void SetName( const TInt aCallId );
+
+        /**
+        * Set rest of info to the EngineInfo.
+        * @param TPEPhoneNumberIdType aPhoneNumberId, phonenumber type
+        * @param TInt aCallId, call identification
+        * @return None.
+        */
+        void HideIdentification(
+            TPEPhoneNumberIdType aPhoneNumberId,
+            const TInt aCallId );
+
+        /**
+        * Checks is the current call the missed call.
+        * @param TInt aCallId, call identification.
+        * @param TPEState aCallState, call's state.
+        * @return None.
+        */
+        void IsMissedCall( const TInt aCallId, TPEState aCallState );
+
+        /**
+        * Notifies DevSound that there is no active call
+        * and audio should be routed accordingly.
+        */
+        void ClearCallAudio();
+             
+        /**
+        * Remove pre and post fix from phone number.
+        * @param TDes aString, phonenumber. 
+        * @return None
+        */
+        void RemovePreAndPostFix( TDes& aString );
+        
+        /**
+        * Remove pre fix from phone number.
+        * @param TLex aLex, orginal phonenumber.
+        * @return None
+        */
+        void RemovePrefix( TLex& aLex );
+        
+        /**
+        * Handle number part.
+        * @param TLex aLex, orginal phonenumber.
+        * @param TDes aNumberPart, TDes for edited phone numeber.
+        * @return None
+        */
+        void HandleNumberPart( TLex& aLex, TDes& aNumberPart );
+        
+        /**
+        * EqualsLeft combare if aString contains aPrefix.
+        * @param TDesC aString, orginal phonenumber.
+        * @param TDes aPrefix, 
+        * @return TBool ETrue if match.
+        */
+        TBool EqualsLeft( const TDesC& aString, const TDesC& aPrefix );
+
+        /**
+        * Handles dial message from phone application or phone client.
+        * @param aClientCall, Informs is the current call client originated or not.
+        * @return Return possible error code.
+        */
+        TInt HandleDialCallL( const TBool aClientCall );      
+
+        /**
+        * Checks if there are any connected video calls
+        * @return   EFalse: no active video call,
+        *           ETrue: active video call
+        */
+        TBool IsActiveVideo();
+        
+        /**
+        * Checks that string contains only valid dtmf characters 
+        * @param aString string to be checked
+        * @return ETrue if valid dtmf string 
+        */
+        TBool IsValidDtmfString( TDes& aString );
+        
+        /**
+         * Updates remote party info to Mediator.
+         */
+        void UpdateRemotePartyInfo();
+
+    private:  // Data
+        
+        // MPEPhoneModelInternal owns this object.
+        MPEPhoneModelInternal& iModel;
+        // It is container for parser options
+        CPhoneGsmOptionContainerBase* iOptions;
+        // Handles phone number from the parser.
+        // Not owned
+        CPEParserPhoneNumberHandler* iPhoneNumberHandler;
+        // Handles supplementary service requests from the parser.
+        CPEParserSSHandler* iSSHandler;
+        // MPECallHandling handles call related commands to CallHandling subsystem.
+        MPECallHandling& iCallHandling;
+        // MEngineMonitor handles interface structures to phone application
+        MEngineMonitor& iEngineMonitor;
+        // CPEGsmAudioData handles audio commands
+        CPEGsmAudioData& iGsmAudioData;
+        // CPELogsData object which handles logs related commands
+        MPELogHandling& iLogHandling;
+        // Handle to contact handling
+        MPEContactHandling& iContactHandling;
+        // Handle to external data handler
+        CPEExternalDataHandler& iExternalDataHandler; 
+        // Mobile call info.
+        RMobileCall::TMobileCallInfoV3* iCallInfo;
+        // Sim state monitor
+        CPESimStateMonitor& iSimStateMonitor;
+        // Handle to a file server session
+        RFs& iFsSession; 
+        // Handles call request from the client/server interface.
+        CPEClientServices* iClientServices;
+        // Automatic answer timer.
+        CPETimer* iAutomaticAnswerTimer;
+        // Number parser object
+        CPhoneGsmParserBase* iParser;
+        // Container for parser handlers.
+        CPhoneGsmHandlerContainer* iParserHandlerContainer;
+        // Includes identification number of the waiting call.
+        TInt iWaitingCallId;
+        // Call start time
+        TTime iTime;
+        //Current emergency call state.
+        TBool iEmergencyCallActive;
+        //
+        TBool iBtaaDisconnected;
+        //Client Information, member variable because emergency call from phone client
+        //is not allowed to allocate memory. 
+        CPEClientInformation* iClientInformation;
+        // Dial Data
+        CPhCltDialData* iClientDialData;
+        // Instances will contain the results of the parsing
+        CPhoneGsmParserResult* iResult;
+        // Handles emergency number from the parser.
+        // Not owned
+        CPEParserEmergencyNumberHandler* iEmergencyNumberHandler;
+        // Handles voip number from the parser.
+        // Not owned
+        CPEParserVoipNumberHandler* iVoipNumberHandler;
+        // Handles manual call control.
+        // Owned
+        CPEManualCallControlHandler* iManualCallControlHandler;
+        MPEServiceHandling& iServiceHandling;
+        // reference to data store
+        MPEDataStore& iDataStore;
+        // Asyncromous callback
+        CAsyncCallBack* iAsyncCallBack;
+        // Includes basic service value.
+        RMobilePhone::TMobileService iBasicServiceGroup;
+        // Includes possible Gsm Parser error code.
+        TInt iGsmParserErrorCode;
+        // Cheks if audio is registred and system is ready for startup
+        TBool iPEReadyForStartUpMessageSent;
+    };
+
+#include "cpemessagehandler.inl"
+
+#endif      // CPEMESSAGEHANDLER_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpemessagehandler.inl	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Message handler
+*
+*/
+
+
+// -----------------------------------------------------------------------------
+// Gets basic service group value.
+// -----------------------------------------------------------------------------
+//
+inline RMobilePhone::TMobileService CPEMessageHandler::BasicServiceGroup()
+    { 
+    return iBasicServiceGroup;
+    }
+
+// -----------------------------------------------------------------------------
+// Handles swap message from the phone application 
+// -----------------------------------------------------------------------------
+//
+inline TInt CPEMessageHandler::HandleSwapCalls() 
+    { 
+    return iCallHandling.SwapCalls(); 
+    }
+
+// -----------------------------------------------------------------------------
+// Handles transfer message from phone application.
+// -----------------------------------------------------------------------------
+//
+inline TInt CPEMessageHandler::HandleTransferCalls() 
+    {
+    return iCallHandling.TransferCalls();
+    }
+
+// -----------------------------------------------------------------------------
+// Sets basic service group for future using.
+// -----------------------------------------------------------------------------
+//
+inline void CPEMessageHandler::SetBasicServiceGroup( 
+        const RMobilePhone::TMobileService& aServiceGroup )
+    { 
+    iBasicServiceGroup = aServiceGroup;
+    }
+
+// -----------------------------------------------------------------------------
+// Sets gsm parser error code for future using.
+// -----------------------------------------------------------------------------
+//
+inline void CPEMessageHandler::SetGsmParserErrorCode( 
+        TInt aGsmParserErrorCode)
+    {
+    iGsmParserErrorCode = aGsmParserErrorCode;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpenetworkregistrationstatusmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file for CPENetworkRegistrationStatusMonitor class
+*
+*/
+
+
+#ifndef CPENETWORKREGISTRATIONSTATUSMONITOR_H
+#define CPENETWORKREGISTRATIONSTATUSMONITOR_H
+
+//INCLUDES
+#include "cpepubsubmonitor.h"
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+
+// CLASS DECLARATION
+
+/**
+*  CPENetworkRegistrationStatusMonitor
+*  Not exposed externally
+*  Monitors the network registration status P&S key for changes
+*  and retrieves current settings
+*
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPENetworkRegistrationStatusMonitor ) 
+    : public CPEPubSubMonitor
+    {
+    public:
+        /**
+        * Two-phased constructor.
+        */
+        static CPENetworkRegistrationStatusMonitor* NewL( MPEPhoneModelInternal& aModel );
+               
+    protected:
+        /**
+        * C++ default constructor.
+        */    
+        CPENetworkRegistrationStatusMonitor( MPEPhoneModelInternal& aModel );
+
+        /**
+        * Second-phase constructor.
+        */
+        void ConstructL();    
+        
+    protected:
+        /**
+        * Defines the actions that take place when a change indication
+        * is received. Most common approach would be to save the data to internal
+        * data store and send a message via phone model if neccessary.
+        */  
+        virtual void UpdateL();
+        
+    };
+
+#endif  //  CPENETWORKREGISTRATIONSTATUSMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparseremergencynumberhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file of the CPEGsmParserPhoneNumberHandler class.
+*
+*/
+
+
+#ifndef CPEPARSEREMERGENCYNUMBERHANDLER_H
+#define CPEPARSEREMERGENCYNUMBERHANDLER_H
+
+//  INCLUDES
+#include <cphonegsmemergencynumberhandler.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPECallHandling;
+class CPEMessageHandler;
+class MPEDataStore;
+
+// CLASS DECLARATION
+
+/**
+*  Handles phone related messages from the CPEPhoneModel object.
+*
+*  @lib PhoneEngineGsm.lib
+*  @since since S60 5.0
+*/
+NONSHARABLE_CLASS( CPEParserEmergencyNumberHandler ) : public CPhoneGsmEmergencyNumberHandler
+    {
+    public:  //Constructors and descructor
+
+        /**
+        * C++ default constructor.
+        */
+        CPEParserEmergencyNumberHandler( 
+            CPEMessageHandler& aOwner, 
+            MPECallHandling& aCallHandling,
+            MPEDataStore& aGsmDataStore );
+
+    public: // Functions from base classes
+        
+        /**
+        * Process dial to emergency number
+        * @param aNumber main number part.
+        */
+        void ProcessDialToEmergencyNumberL( 
+            const TDesC& aNumber
+            );
+
+    //public: //New functions
+
+    private:    
+        // CPEMessageHandler object which owns this requester.
+        CPEMessageHandler& iOwner;
+        // CPEPhoneData is used to create request to the CallHandling subsystem.
+        MPECallHandling& iCallHandling;
+        // Reference to common data store
+        MPEDataStore& iDataStore;
+    };
+
+#endif      // CPEPARSEREMERGENCYNUMBERHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparsermanufacturerhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the
+*                CPEParserManufacturerHandler object
+*
+*/
+
+
+#ifndef CPEPARSERMANUFACTURERHANDLER_H
+#define CPEPARSERMANUFACTURERHANDLER_H
+
+//INCLUDES
+#include <cphonegsmmanufacturerhandler.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+enum
+    {
+    EPhoneCmdDebugPrint,
+    EPhoneCmdHeapFailure
+    };
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+class MPECallHandling;
+
+// CLASS DECLARATION
+
+/**
+*  Provides processing for manufacturer specific Phone Parser requests
+*
+*  @lib phoneengine.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPEParserManufacturerHandler ) : public CPhoneGsmManufacturerHandler
+    {
+    public:  //Constructors and descructor    
+        /**
+        * C++ default constructor.
+        */
+        CPEParserManufacturerHandler( MPEPhoneModelInternal& aModel, 
+                                      MPECallHandling& aCallHandling,
+                                      RFs& aFsSession );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEParserManufacturerHandler();
+
+    public: // Functions from base classes
+
+        /**
+        * Process manufacturer specific command.
+        * @param aCommand command to be performed.
+        */
+        void ProcessCommandL( TUint aCommand );
+
+        /**
+        * Process debug code.
+        * @param aCode code to be processed.
+        */
+        void ProcessDebugL( const TDesC& aCode );
+    
+    private:
+    
+        /**
+        * Gets phone model and sw version
+        * @param aSwVersion sw version
+        * return Error Code
+        */
+        TInt GetSwVersionAndPhoneModelL( TDes& aSwVersion );
+        
+        /**
+        * Add phone model to sw version
+        * @param aSwVersion sw version
+        */
+        void AppendPhoneModelL( TDes& aSwVersion );
+        
+        /**
+        * Remove needless line from string
+        * @param aSwVersion sw version
+        */
+        void RemoveLinesAfterThreeLines( TDes& aSwVersion );
+        
+    private:    
+        //MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        // CPEPhoneData is used to create request to the CallHandling subsystem.
+        MPECallHandling& iCallHandling;
+        // Handle to a file server session
+        RFs& iFsSession; 
+        
+    };
+
+#endif // CPEPARSERMANUFACTURERHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparsermischandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPhoneGsmMiscHandler 
+*                class
+*
+*/
+
+
+#ifndef CPEPARSERMISCHANDLER_H
+#define CPEPARSERMISCHANDLER_H
+
+//INCLUDES
+#include "cphonegsmmischandler.h"
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CPEMessageHandler;
+class MPECallHandling;
+
+// CLASS DECLARATION
+
+/**
+*  Provides processing for miscellaneous Phone Parser requests
+*
+*  @lib phoneenginegsm.lib
+*  @since Series 60 4.0
+*/
+NONSHARABLE_CLASS( CPEParserMiscHandler )
+    : public CPhoneGsmMiscHandler
+{
+    public:  //Constructors and descructor    
+        /**
+        * C++ default constructor.
+        */
+        CPEParserMiscHandler( CPEMessageHandler& aOwner, MPECallHandling& aCallHandling );
+
+        /**
+        * Destructor.
+        */
+        ~CPEParserMiscHandler();
+
+    public: // Functions from base classes
+
+        /**
+        * Process IMEI display
+        */
+        void ProcessShowIMEIL();
+
+        /**
+        * Process USSD request
+        * @param aString, USSD string to be sent
+        */
+        void ProcessUssdL( const TDesC& aString );
+
+    private:
+        // Handle to object which owns this requester
+        CPEMessageHandler& iOwner;
+        // Handle to the protocol specific Call Handling subsystem
+        MPECallHandling& iCallHandling;
+    };
+
+#endif // CPEPARSERMISCHANDLER_H         
+   
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparserphonenumberhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file of the CPEParserPhoneNumberHandler class.
+*
+*/
+
+
+#ifndef CPEPARSERPHONENUMBERHANDLER_H
+#define CPEPARSERPHONENUMBERHANDLER_H
+
+//  INCLUDES
+#include <cphonegsmphonenumberhandler.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+const TUint KDtmfPlus = '+';
+const TUint KDtmfWait = 'w';
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPECallHandling;
+class CPEMessageHandler;
+class MPEDataStore;
+
+// CLASS DECLARATION
+
+/**
+*  Handles phone related messages from the CPEPhoneModel object.
+*
+*  @lib PhoneEngineGsm.lib
+*  @since since S90 1.0
+*/
+NONSHARABLE_CLASS( CPEParserPhoneNumberHandler ) : public CPhoneGsmPhoneNumberHandler
+    {
+    public:  //Constructors and descructor
+
+        /**
+        * C++ default constructor.
+        */
+        CPEParserPhoneNumberHandler( 
+            CPEMessageHandler& aOwner, 
+            MPECallHandling& aCallHandling,
+            MPEDataStore& aGsmDataStore );
+
+
+    public: // Functions from base classes
+
+        /**
+        * Process dial to number(derived from CPEGsmPhoneNumberHandler)
+        * @since since S90 1.0
+        * @param aNumber main number part.
+        * @param aDtmfPostfix dtmf postfix.
+        * @param aClir clir part.
+        */
+        void ProcessDialToNumberL( 
+            const TDesC& aNumber, 
+            const TDesC& aDtmfPostfix,
+            TClir aClir );
+
+    private: 
+    
+        /**
+        * Removes non-GSM standard postfix characters before dialling attempt.
+        * Leaves with ECCPErrorInvalidPhoneNumber if recognizes + char.
+        * @since 5.0
+        * @param aPostfix postfix to modify.
+        * @return modified postfix.
+        */
+        TPtrC FilterPostfixL( TPtrC aPostfix );
+
+        /**
+        * Checks if phone is offline
+        * @since 5.0
+        * @return offline status
+        */
+        TBool IsPhoneOffline();
+
+    private:    
+        // CPEMessageHandler object which owns this requester.
+        CPEMessageHandler& iOwner;
+        // CPEPhoneData is used to create request to the CallHandling subsystem.
+        MPECallHandling& iCallHandling;
+        // Reference to common data store
+        MPEDataStore& iDataStore;
+    };
+
+#endif      // CPEPARSERPHONENUMBERHANDLER_H
+            
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparsersimcontrolhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the
+*                CPEParserSimControlHandler object
+*
+*/
+
+
+#ifndef CPEPARSERSIMCONTROLHANDLER_H
+#define CPEPARSERSIMCONTROLHANDLER_H
+
+//INCLUDES
+#include <cphonegsmsimcontrolhandler.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPEContactHandling;
+class MPEPhoneModelInternal;
+class CManualSecuritySettings;
+
+// CLASS DECLARATION
+
+/**
+*  Provides processing for ICC/SIM related Phone Parser requests
+*
+*  @lib phoneenginegsm.lib
+*  @since Series 60 4.0
+*/
+NONSHARABLE_CLASS( CPEParserSimControlHandler ) : public CPhoneGsmSimControlHandler
+    {
+    public:  //Constructors and descructor    
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPEParserSimControlHandler* NewL
+            (
+            MPEPhoneModelInternal& aModel, 
+            MPEContactHandling& aContactHandling );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEParserSimControlHandler();
+
+    public: // Functions from base classes
+
+        /**
+        * Change pin code
+        *
+        * @param aType It is type of pin.
+        * @param aOldPin It is old pin.
+        * @param aNewPin It is new pin.
+        * @param aNewPin2 It is new pin.
+        * @return None. 
+        */
+        void ProcessChangePinL
+                ( 
+                TPinCode aType, 
+                const TDesC& aOldPin, 
+                const TDesC& aNewPin, 
+                const TDesC& aVerifyNew 
+                );
+
+        /**
+        * Unblock pin code.
+        *
+        * @param aType It is type of pin to unblock.
+        * @param aPuk It is unblocking code.
+        * @param aNewPin It is new pin.
+        * @param aNewPin2 It is new pin.
+        * @return None. 
+        */
+        void ProcessUnblockPinL
+                ( 
+                TPinCode aType, 
+                const TDesC& aPuk, 
+                const TDesC& aNewPin, 
+                const TDesC& aVerifyNew 
+                );
+    
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CPEParserSimControlHandler
+                ( 
+                MPEPhoneModelInternal& aModel, 
+                MPEContactHandling& aContactHandling
+                );
+
+    private:
+        //MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        // Handle to contact handling
+        MPEContactHandling& iContactHandling;
+        // Contains information of the Suplementary Services command.
+        TPESSCommandInfo iSupplementaryServicesCommandInfo;
+        // Security model
+        CManualSecuritySettings* iSecurityModel;
+    };
+
+#endif // CPEPARSERSIMCONTROLHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparsersscallhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEParserSSCallHandler 
+*                class
+*
+*/
+
+
+#ifndef CPEPARSERSSCALLHANDLER_H
+#define CPEPARSERSSCALLHANDLER_H
+
+//INCLUDES
+#include <cphonegsmsscallhandler.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class CPEMessageHandler;
+class CPEGsmPhoneData;
+class MPEPhoneModelInternal;
+class CPEManualCallControlHandler;
+
+// CLASS DECLARATION
+
+/**
+*  Provides processing for supplementary service related Phone Parser requests
+*
+*  @lib phoneenginegsm.lib
+*  @since Series 60 4.0
+*/
+NONSHARABLE_CLASS( CPEParserSSCallHandler ) : public CPhoneGsmSsCallHandler
+{
+    public:  //Constructors and descructor    
+        /**
+        * C++ default constructor.
+        */
+        CPEParserSSCallHandler( 
+            CPEMessageHandler& aOwner, 
+            MPEPhoneModelInternal& aModel,
+            CPEManualCallControlHandler& aManualCallControlHandler );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEParserSSCallHandler();
+
+    public: // Functions from base classes
+
+        /**
+        * Ends a call and accepts another.
+        *
+        * Command: 1 SEND.
+        * @param None. 
+        * @return None. 
+        */
+        void ProcessEndAndAcceptL();
+
+        /**
+        * End specific active call.
+        *
+        * Command: 1X SEND.
+        * @param aCallNo, the number of the call
+        * @return None.
+        */
+        void ProcessEndCallL( TInt aCallNo );
+
+        /**
+        * Reject a call.
+        *
+        * Command: 0 SEND.
+        * @param None.
+        * @return None.
+        */
+        void ProcessEndOrRejectL();
+
+        /**
+        * Perform explicit call transfer
+        *
+        * Command: 4 SEND.
+        * @param None.
+        * @return None.
+        */ 
+        void ProcessExplicitCallTransferL();
+
+        /**
+        * Hold all active calls except specific call.
+        *
+        * Command: 2X SEND.
+        * @param None.
+        * @return None.
+        */
+        void ProcessHoldAllCallsExceptL( TInt aCallNo );
+
+        /**
+        * Join two calls to conference.
+        *
+        * Command: 3 SEND.
+        * @param aCallNo, the number of the call.
+        * @return None.
+        */
+        void ProcessJoinL();
+
+        /**
+        * Swap
+        *
+        * Command: 2 SEND.
+        * @param None.
+        * @return None.
+        */
+        void ProcessSwapL();
+
+    private:  
+        // CPEMessageHandler object which owns this requester.
+        CPEMessageHandler& iOwner;
+        // MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        // Manual Call Control Handler
+        CPEManualCallControlHandler& iManualCallControlHandler;
+    };
+
+#endif // CPEPARSERSSCALLHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparsersshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,301 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEParserSSHandler
+*                object
+*
+*/
+
+
+
+#ifndef CPEPARSERSSHANDLER_H
+#define CPEPARSERSSHANDLER_H
+
+//  INCLUDES
+#include <cphonegsmsshandler.h>
+#include <pevirtualengine.h>
+#include <nwdefs.h>
+#include <mpsetrequestobs.h>
+
+// FORWARD DECLARATIONS
+class CPEMessageHandler;
+class CPsetContainer;
+class CPsetCallWaiting;
+class CPsetCallBarring;
+class CPsetCallDiverting;
+class CPsetCli;
+class CPsuiContainer;
+class CPsuiWaitingObs;
+class CPsuiBarringObs;
+class CPsuiDivertObs;
+class CPsuiCliObserver;
+
+// CLASS DECLARATION
+
+/**
+*  Handles phone related messages from the MPEPhoneModelInternal object.
+*
+*  @lib phoneenginegsm
+*  @since Series60 4.0
+*/
+NONSHARABLE_CLASS( CPEParserSSHandler ) : public CPhoneGsmSsHandler, 
+                              public MPsetRequestObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPEParserSSHandler* NewL
+            (
+            CPEMessageHandler& aOwner,   
+            MPEPhoneModelInternal& aModel 
+            );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEParserSSHandler();
+
+     public: // New functions
+
+        /**
+        * Returns RMobilePhone::TMobileService type of basic service code.
+        *
+        * @param aBasicCode It is basic service code.
+        * @return basic service code.
+        */
+        RMobilePhone::TMobileService BasicService( const TDesC& aBasicCode ); 
+
+        /**
+        * changes parameter to basic service code
+        */
+        TBasicServiceGroups ChangeToBsc( const TDesC& aBasicCode );
+
+    public: // Functions from base classes
+
+        /**
+        * Cancel SS string command. Method cancel command from Settings utility
+        * subsytem or security module.
+        *
+        * @return possible error code
+        */
+        TInt Cancel();
+
+        /**
+        * Process barring procedures(derived from CPESsHandler).
+        *
+        * See comments for forwarding, they apply also in here.
+        *
+        * @param aAction It is action.
+        * @param aBarring It contains barring procedure.
+        * @param aPassword It should be barring password, if required.
+        * @param aBasicCode It is basic service code.
+        */
+        void ProcessBarringL( TAction aAction, 
+                              TBarringProcedure aBarring, 
+                              const TDesC& aPassword, 
+                              const TDesC& aBasicCode );
+
+        /**
+        * Process calling line identification presentation status
+        * (derived from CPEGsmSsHandler).
+        */
+        void ProcessClipStatusL();
+
+        /**
+        * Process calling line idnetification restriction status
+        * (derived from CPEGsmSsHandler).
+        */
+        void ProcessClirStatusL();
+
+        /**
+        * Process Calling Name Presentation (CNAP) status check.
+        */
+        void ProcessCnapStatusL();
+
+        /**
+        * Process connected line presentation status(derived from CPEGsmSsHandler).
+        */
+        void ProcessColpStatusL();
+
+        /**
+        * Process connected line restriction status(derived from CPEGsmSsHandler).
+        */
+        void ProcessColrStatusL();
+
+        /**
+        * Process enhanced Multi-Level Precedence and Pre-emption (eMLPP).
+        *
+        * @param aAction It is action.
+        * @param aNumber It is directory number.
+        * @param aServiceCode It is service code.
+        */
+        void ProcessEmlppL( TAction aAction, 
+                            const TDesC& /*aNumber*/,
+                            const TInt aServiceCode );
+
+        /**
+        * Process forwarding procedures(derived from CPEGsmSsHandler).
+        *
+        * If a parameter is not allowed for a procedure,
+        * then it is empty. If a parameter is not explicitly given,
+        * then it is empty. If a parameter is present, then it can
+        * be assumed to contain appropriate values.
+        *
+        * @param aAction It is action.
+        * @param aForwarding It contains forwarding procedure.
+        * @param aNumber It is directory number.
+        * @param aBasicCode It is basic service code.
+        * @param aTimer It is timer(delay time).
+        */
+        void ProcessForwardingL( TAction aAction, 
+                                 TForwardingProcedure aForwarding, 
+                                 const TDesC& aNumber, 
+                                 const TDesC& aBasicCode, 
+                                 const TDesC& aTimer );
+        
+        /**
+        * Process Multiple Subscriber Profile (MSP).
+        *
+        * @param aAction It is action.
+        * @param aNumber It is directory number.
+        * @param aServiceCode It is service code.
+        */
+        void ProcessMspL( TAction aAction, 
+                          const TDesC& aNumber, 
+                          const TInt aServiceCode );
+
+        /**
+        * Process password change(derived from CPEGsmSsHandler).
+        *
+        * @param aPassword It is password procedure.
+        * @param aOldPassword It should be old password.
+        * @param aNewPassword1 It is new password.
+        * @param aNewPassword2 It is new password.
+        */
+        void ProcessPasswordChangeL( TPasswordProcedure aPassword, 
+                                    const TDesC& aOldPassword, 
+                                    const TDesC& aNewPassword1, 
+                                    const TDesC& aNewPassword2 );
+
+        /**
+        * Process Support for Private Numbering Plan (SPNP).
+        *
+        * @param aAction It is action.
+        * @param aServiceCode It is service code.
+        */
+        void ProcessSpnpL( TAction aAction, const TInt aServiceCode );
+
+        /**
+        * Process waiting(derived from CPEGsmSsHandler).
+        *
+        * @param aAction It is action.
+        * @param aBasicCode It is basic service code.
+        */
+        void ProcessWaitingL( TAction aAction, const TDesC& aBasicCode );   
+
+        /**
+        * From MPsetRequestObs, called when request is completed  
+        * so that also ui browsing is ended
+        */
+        void RequestComplete();
+            
+        /**
+        * From MPsetRequestObs, called when request state changes  
+        * @param aNewStatus Request status, when request finishes
+        */
+        void RequestStatusChanged( TInt aNewStatus );
+
+    private: 
+
+        /**
+        * C++ default constructor.
+        */
+        CPEParserSSHandler( CPEMessageHandler& aOwner,  
+                                MPEPhoneModelInternal& aModel); 
+        
+        /**
+        * Connects class to the phonesettings
+        */
+        void ConnectToSsEngineL();
+
+        /**
+        * Create call barring observer
+        */
+        void CPEParserSSHandler::CreateCBObsL();
+    
+        /**
+        * Create call cli observer
+        */
+        void CPEParserSSHandler::CreateCliObsL();          
+        
+        /**
+        * Create call divert observer
+        */
+        void CPEParserSSHandler::CreateCFObsL();
+
+        /**
+        * Create call waiting observer
+        */
+        void CPEParserSSHandler::CreateCWObsL();
+
+        /**
+        * if ConnectSsToEngine leaves, this is called
+        */
+        static void DoClean( TAny* aAny );
+        
+        /**
+        * deletes member variables
+        */
+        void ResetVariables();
+
+        /**
+        * Copies destructor. If does not fit, then leaves with
+        * KErrOverflow error code.
+        */
+        static void CopyL( TDes& aDest, const TDesC& aSource );
+
+    private:
+        // CPEGsmMessageHandler object which owns this requester.
+        CPEMessageHandler& iOwner;
+        //MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        // Contains information of the Suplementary Services command.
+        TPESSCommandInfo iSupplementaryServicesCommandInfo;     
+        // Owned phone settings container.
+        CPsetContainer* iSettings;
+        // Owned phone settings ui container.
+        CPsuiContainer* iObsContainer;
+        // Owned call waiting.
+        CPsetCallWaiting* iWaiting;
+        // Owned waiting observer.
+        CPsuiWaitingObs* iCwObserver;
+        // Owned call barring.
+        CPsetCallBarring* iBarring;
+        // Owned call barring observer.
+        CPsuiBarringObs* iCbObserver;
+        // Owned call diverting.
+        CPsetCallDiverting* iDivert;
+        // Owned call diverting observer.
+        CPsuiDivertObs* iCfObserver;
+        // Owned calling line identity.
+        CPsetCli* iCli;
+        // Owned calling line identity observer.
+        CPsuiCliObserver* iCliObserver;
+
+    };
+
+#endif      // CPEPARSERSSHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeparservoipnumberhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file of the CPEParserVoipNumberHandler class.
+*
+*/
+
+
+#ifndef CPEPARSERVOIPNUMBERHANDLER_H
+#define CPEPARSERVOIPNUMBERHANDLER_H
+
+//  INCLUDES
+#include <cphonevoipnumberhandler.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+class MPECallHandling;
+class CPEMessageHandler;
+class MPEDataStore;
+class MPEServiceHandling;
+
+// CLASS DECLARATION
+
+/**
+*  Handles phone related messages from the CPEPhoneModel object.
+*
+*  @lib PhoneEngineGsm.lib
+*  @since since S60 5.0
+*/
+NONSHARABLE_CLASS( CPEParserVoipNumberHandler ) : public CPhoneVoipNumberHandler
+    {
+    public:  //Constructors and descructor
+    
+        static CPEParserVoipNumberHandler* NewL( CPEMessageHandler& aOwner, 
+                                             MPECallHandling& aCallHandling,
+                                             MPEServiceHandling& aServiceHandling,
+                                             MPEDataStore& aDataStore );
+
+        static CPEParserVoipNumberHandler* NewLC( CPEMessageHandler& aOwner, 
+                                              MPECallHandling& aCallHandling,
+                                              MPEServiceHandling& aServiceHandling,
+                                              MPEDataStore& aDataStore );
+
+        ~CPEParserVoipNumberHandler();
+        
+    public: // Functions from base classes
+        /**
+        * Process dial to voip number
+        * @param aNumber main number part.
+        * @param aPostFix DTMF part of the number
+        */
+        void ProcessDialToVoipNumberL( 
+            const TDesC& aNumber,
+            const TDesC& aDtmfPostfix
+            );
+
+        /**
+        * Continue VoIP call after service is enabled.
+        * @return error code.
+        */ 
+        TInt ContinueVoipDial() const;
+        
+
+    private:
+    
+        /**
+        * Removes non-GSM standard postfix characters before dialling attempt.
+        * @since 5.0
+        * @param aPostfix postfix to modify.
+        * @return modified postfix.
+        */
+       TPtrC FilterPostfix( TPtrC aPostfix );
+        
+        /**
+        * C++ default constructor.
+        */
+        CPEParserVoipNumberHandler( 
+            CPEMessageHandler& aOwner, 
+            MPECallHandling& aCallHandling,
+            MPEServiceHandling& aServiceHandling,
+            MPEDataStore& aDataStore );
+
+        void ConstructL();
+            
+    private:    
+        // CPEMessageHandler object which owns this requester.
+        CPEMessageHandler& iOwner;
+        // CPEPhoneData is used to create request to the CallHandling subsystem.
+        MPECallHandling& iCallHandling;
+        // Reference to common data store
+        MPEDataStore& iDataStore;
+        // Reference to Service handling object
+        MPEServiceHandling& iServiceHandling;
+        // If phone number contains dtmf string it is saved here 
+        TPEDtmfString iDtmfString; 
+    };
+
+#endif      // CPEPARSERVOIPNUMBERHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpepcnparserprocedurehandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file of the CPhoneGsmPcnProcedureHandler class.
+*
+*/
+
+
+#ifndef CPEPCNPARSERPROCEDUREHANDLER_H
+#define CPEPCNPARSERPROCEDUREHANDLER_H
+
+//  INCLUDES
+#include    <cphonegsmpcnprocedurehandler.h>
+#include    "pevirtualengine.h"
+
+// CONSTANTS
+//None
+
+// MACROS
+//None
+
+// DATA TYPES
+//None
+
+// FUNCTION PROTOTYPES
+//None
+
+// FORWARD DECLARATIONS
+//None
+
+// CLASS DECLARATION
+class CPEMessageHandler;
+class CPESecurityCommand;
+class CManualSecuritySettings;
+class MPEPhoneModelInternal;
+
+// DESCRIPTION
+// It is handler for GsmPcn procedures.
+
+NONSHARABLE_CLASS( CPEPcnParserProcedureHandler )
+        :public CPhoneGsmPcnProcedureHandler
+    {
+    public:  //Constructors and descructor    
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPEPcnParserProcedureHandler* NewL
+            (
+            CPEMessageHandler& aOwner,   // The owner of this object.  
+            MPEPhoneModelInternal& aModel   // The reference parameter of the 
+            );                              // phone model object which is used
+                                            // to send message to the phone 
+                                            // application.
+        /**
+        * Destructor.
+        */
+        virtual ~CPEPcnParserProcedureHandler();
+
+
+    public: // New functions
+        
+        /**
+        * Process SIM locking.
+        *
+        * Parameters are empty strings if SIM lock
+        * code was just garbage.
+        * 
+        * @param aPassword sequence of digits.
+        * @param aType sequence of digits.
+        */
+        void ProcessSimLockL( 
+            const TDesC& aPassword, 
+            const TDesC& aType );
+
+        /**
+        * Process SIM unlocking.
+        *
+        * Parameters are empty strings if SIM unlock
+        * code was just garbage.
+        * 
+        * @param aPassword sequence of digits.
+        * @param aType sequence of digits.
+        */
+        void ProcessSimUnlockL(
+            const TDesC& aPassword,
+            const TDesC& aType );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * C++ default constructor.
+        */
+        CPEPcnParserProcedureHandler
+            ( 
+            CPEMessageHandler& aOwner,  
+            MPEPhoneModelInternal& aModel
+            );
+
+
+    private:    
+        // CPEGsmMessageHandler object which owns this requester.
+        CPEMessageHandler& iOwner;
+        // Contains information of the Suplementary Services command.
+        TPESSCommandInfo iSupplementaryServicesCommandInfo;
+        //MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        // Security model
+        CManualSecuritySettings* iSecurityModel;
+
+    };
+
+#endif      // CPEPCNPARSERPROCEDUREHANDLER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpephonemodel.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,338 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEPhoneModel class.
+*
+*/
+
+
+#ifndef CPEPHONEMODEL_H
+#define CPEPHONEMODEL_H
+
+//INCLUDES
+#include "mpeactivestarter.h"
+#include "mpephonemodelinternal.h"
+#include <apgtask.h>
+#include <coemain.h>
+#include <cpephonemodelif.h>
+#include <DosSvrServices.h>
+#include <e32base.h>
+#include <talogger.h>
+
+// FORWARD DECLARATIONS
+class CPEActiveStarter;
+class CCCE;
+class CPEEngineInfo;
+class CPEGsmAudioData;
+class CPEExternalDataHandler;
+class CPEMessageHandler;
+class CPESimStateMonitor;
+class CPEIdleStatusMonitor;
+class MEngineMonitor;
+class MPEContactHandling;
+class MPECallHandling;
+class MPELogHandling;
+class MCCEDtmfInterface;
+class CPEAudioFactory;
+class MPEServiceHandling;
+class CPERemotePartyInfoMediator;
+class PhoneServices;
+class ParserRecognizer;
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+// Handles phone related events from the phone application.
+//
+NONSHARABLE_CLASS( CPEPhoneModel ) 
+    : public CPEPhoneModelIF,
+      public MPEPhoneModelInternal,
+      public MPEActiveStarter
+    {
+    public:  //Constructors and destructor
+
+        // Starting modules of active starter (StepL method)
+        enum TActiveStarterSteps
+            {
+            EPEInitializeCceConnection = 0,
+            EPEExternalData,
+            EPECallHandling,
+            EPEAudioHandling,
+            EPELogHandlingPhaseOne,
+            EPEContactHandlingPhaseOne,
+            EPESimStateMonitor,
+            EPEServiceHandling,
+            EPEMessageHandler,
+            EPESimChangedMonitor,
+            EPESimStatusMonitorStart,
+            EPELogHandlingPhaseTwo,
+            EPEContactHandlingPhaseTwo,
+            EPEMediatorCommandHandler,
+            EPEPhoneServices,
+            EPEParserRecognizer,
+            EPENetworkHandling
+            };
+
+        /**
+        * Two-phased constructor.
+        * 
+        * @param aEngineMonitor, for phone application communication
+        */
+        static CPEPhoneModel* NewL( MEngineMonitor& aEngineMonitor );
+        
+        /**
+        * Two-phased constructor for module tests.
+        * 
+        * @param aEngineMonitor, for phone application communication
+        * @param aAudioFactory for creating audio related classes.
+        */
+        static CPEPhoneModel* NewL( 
+            MEngineMonitor& aEngineMonitor,
+            CPEAudioFactory& aAudioFactory );       
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPEPhoneModel( );
+
+    public:    //New functions 
+
+       /**
+        * Recalls starting of modules after leave occured in the middle of StepL sequence.
+        * 
+        */
+        void RecallSteps( );
+
+       /**
+        * Starts modules of PhoneEngine.
+        * 
+        * @return True or False depending on wether to continue stepping. 
+        */
+        TBool StepL( );
+        
+       /**
+        * Constructs Contact Handling Phase Two
+        */           
+        void ConstructContactHandlingPhaseTwoL();
+
+// Functions from CPEPhonemodelIF
+
+       /**
+        * From CPEPhonemodelIF
+        * Returns the name of the specified message to PhoneEngine
+        *
+        * @since S60 v.4.0
+        * @param aMessage is the message code
+        * @return String containing the name of the message
+        */
+        TPtrC NameByMessageToPhoneEngine( const TInt aMessage ) const; 
+        
+       /**
+        * From CPEPhonemodelIF
+        * Returns the name of the specified message from PhoneEngine
+        
+        * @since S60 v.4.0
+        * @param aMessage is the message code
+        * @return String containing the name of the message
+        */
+        TPtrC NameByMessageFromPhoneEngine( const TInt aMessage ) const;    
+       
+// Functions from MPEPhoneModel base class
+       
+       /**
+        * From MPEPhoneModel
+        * Returns pointer to information object (CPEEngineInfo) 
+        * 
+        * @return Return pointer to CPEEngineInfo object as MPEEngineInfo.
+        */
+        MPEEngineInfo* EngineInfo();
+        
+       /**
+        * From MPEPhoneModel
+        * Reroutes messages from the phone application to the message handler
+        * 
+        * @param aMessage is the message code.
+        * @return Return possible error code.
+        */
+        void HandleMessage( const TInt aMessage );
+        
+// Functions from MPEPhoneModelInternal base class
+        
+       /**
+        * From MPEPhoneModelInternal
+        * Returns pointer to information object (CPEEngineInfo) 
+        *
+        * @return pointer to CPEEngineInfo object as MPEDataStore
+        */
+        MPEDataStore* DataStore();
+
+       /**
+        * From MPEPhoneModelInternal
+        * Returns pointer to external data handler
+        *
+        * @return pointer to CPEExternalDataHandler as MPEExternalDataHandler
+        */
+        MPEExternalDataHandler* DataStoreExt(); 
+        
+        /**
+         * From MPEPhoneModelInternal
+         * Returns pointer to Mediator Command handler
+         *
+         * @return pointer to CPERemotePartyInfoMediator object
+         */
+        CPERemotePartyInfoMediator* MediatorCommunicationHandler();
+        
+       /**
+        * From MPEPhoneModelInternal
+        * Handle internal message
+        *
+        * @since S60 v4.0
+        * @param aMessage specifies the event that has taken place
+        * @param aCallId is the call id number.
+        */
+        void HandleInternalMessage( const TInt aMessage );
+
+     
+       /**
+        * From MPEPhoneModelInternal
+        * Reroutes messages from the subsystems to the message handler
+        * 
+        * @param aMessage is the message id.
+        * @return None.
+        */
+        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage );
+        
+       /**
+        * From MPEPhoneModelInternal
+        * Reroutes messages from the subsystems to the message handler.
+        * 
+        * @param aMessage is the message id.
+        * @param aCallId is the call id number.
+        * @return None.
+        */
+        void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+                          const TInt aCallId );
+        
+
+    private: 
+        
+        /**
+         * C++ default constructor.
+         * @param aAudioFactory Makes copy of aAudioFactory
+         */
+        CPEPhoneModel( 
+            MEngineMonitor& aEngineMonitor );
+
+        /**
+        * C++ default constructor.
+        * @param aAudioFactory Makes copy of aAudioFactory
+        */
+        CPEPhoneModel( 
+            MEngineMonitor& aEngineMonitor,
+            CPEAudioFactory& aAudioFactory );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * Static callback function to send message
+        * @param aSelf - pointer to itself
+        * @return KErrNone
+        */
+        static TInt CallBackMessageSend( TAny* aSelf );
+        
+        /**
+        * Process messages from the subsystems.
+        * 
+        * @param aMessage is the message id.
+        * @param aCallId is the call id number.
+        * @return error from message handler.        
+        */
+        TInt ProcessMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+                             const TInt aCallId );
+        
+        /**
+         * Determines which messages needs to be delayed and delays
+         * sending them to Engine monitor.
+         * 
+         * @param aMessage is the message id.  
+         * @param aCallId is the call id number.       
+         * @return info indicating wheather message sending needs to be delayed.         
+         */
+        TBool DelayMessageSending( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+                                   const TInt aCallId ); 
+        
+
+    private:    //Data
+
+        // Starts Phone Engine's modules asynchronically.
+        CPEActiveStarter* iActiveStarter;
+        // MEngineMonitor is the message api to phone application
+        MEngineMonitor& iEngineMonitor;
+        // CPEEngineInfo object which handles engine information
+        CPEEngineInfo* iEngineInfo;    
+        // CPEMessageHandler object which handles messages
+        CPEMessageHandler* iMessageHandler;    
+        // MPECallHandling object which handles call related commands
+        MPECallHandling* iCallHandling;
+        // CPEAudioHandling object which handles audio related commands
+        CPEGsmAudioData* iAudioData;
+        // Handle to log handling
+        MPELogHandling* iLogHandling;
+        // Handle to contact handling
+        MPEContactHandling* iContactHandling;
+        MPEServiceHandling* iServiceHandling;
+        // handle to file server session
+        RFs iFsSession;
+        // External data handler
+        CPEExternalDataHandler* iExternalDataHandler;
+        // SIM changed monitor
+        CPESimStateMonitor* iSimChangedMonitor;
+        // SIM state monitor
+        CPESimStateMonitor* iSimStatusMonitor;
+        // Idle status monitor
+        CPEIdleStatusMonitor* iIdleStatusMonitor;
+        // DosServer connect error code.
+        TInt iErrorCode;
+        // Stepper counter
+        TInt iStep;
+        // CCE interface
+        CCCE* iConvergedCallEngine;
+        // CCE dtmf interface
+        MCCEDtmfInterface* iDtmfInterface;
+        /*
+        * Audio factory
+        * Not own.
+        */      
+        CPEAudioFactory* iAudioFactory;
+        // Callback
+        CIdle* iCallStackCutter;
+        // Message Id for callback       
+        MEngineMonitor::TPEMessagesFromPhoneEngine iCallBackMessage; 
+        // Call Id for callback
+        TInt iCallBackCallId ;
+        
+        // Mediator command handler
+        CPERemotePartyInfoMediator* iMediatorCommunicationHandler;
+        
+        // Phone Services offered via Qt Highway
+        PhoneServices* iPhoneServices;
+        ParserRecognizer* iParserRecognizer;
+
+    };
+
+#endif // CPEPHONEMODEL_H  
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpephonemodelif.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface class of PhoneEngineGsm
+*
+*/
+
+
+#ifndef C_CPEPHONEMODELIF_H
+#define C_CPEPHONEMODELIF_H
+
+#include <e32base.h>
+#include <pevirtualengine.h>
+#include <mpeengineinfo.h>
+
+class MEngineMonitor;
+class CPEAudioFactory;
+
+/**
+ * Offers message interface from phone application GSM to phone engine GSM.
+ *
+ *  @lib phoneenginegsm
+ *  @since S60 v.4.0
+ */
+NONSHARABLE_CLASS( CPEPhoneModelIF ) : public CBase,
+                           public MPEPhoneModel
+    {
+
+public:
+
+    typedef TInt TPEMessagesToPhoneEngineGsm;
+
+    enum
+        {
+        // Audio messages                         11000 - 11199
+
+        // Call messages                          11200 - 11399
+        EPEMessageAddConferenceMember           = KPEMessagesToPhoneEngineGsmFirst + 200,
+        EPEMessageCreateConference,
+        EPEMessageDropConferenceMember,
+        EPEMessageGoOneToOne,
+        EPEMessageHangUpConference,
+        EPEMessageHold,
+        EPEMessageHoldConference,
+        EPEMessageResume,
+        EPEMessageResumeConference,
+        EPEMessageSwap,
+        EPEMessageSwapConference,
+        EPEMessageTransfer,
+                
+        // Contact messages                       11400 - 11599
+
+        // Error messages                         11600 - 11799
+
+        // Network messages                       11800 - 12999
+
+        // Parser messages                        12000 - 12199
+        EPEMessageCancelSSstringCommand         = KPEMessagesToPhoneEngineGsmFirst + 1000, // Start last SS string command canceling
+
+        // Security messages                      12200 - 12399
+
+        // Settings messages                      12400 - 12599
+        EPEMessageSetALSLine                    = KPEMessagesToPhoneEngineGsmFirst + 1400,
+        // Miscellaneous messages                 12600 - 12799
+
+        // Last                                   12999
+        // Exposing this allows the compiler to detect the overlapping enumerations.
+        EPEMessageLastVariantItem               = KPEMessagesToPhoneEngineGsmLast
+        };
+
+     ~CPEPhoneModelIF();
+
+    /**
+     * Initiates Phone Engine construction
+     *
+     * @since S60 v.4.0
+     * The construction of Phone Application Engine is an asynchronous operation.
+     * The Engine Monitor observer will be notified using the message interface when
+     * the operation completes:
+     *      message EPEMessagePEConstructionReady signifies a successful procedure
+     *      message EPEMessagePEConstructionFailed signifies a failed procedure
+     *
+     * @param aEngineMonitor reference to Engine Monitor instance
+     * @return pointer to protocol specific phone model object
+     */
+     IMPORT_C static CPEPhoneModelIF* CreateL( MEngineMonitor& aEngineMonitor );
+     
+     /**
+      * Initiates Phone Engine construction for Module testing
+      *
+      * @since S60 v.4.0
+      * The construction of Phone Application Engine is an asynchronous operation.
+      * The Engine Monitor observer will be notified using the message interface when
+      * the operation completes:
+      *      message EPEMessagePEConstructionReady signifies a successful procedure
+      *      message EPEMessagePEConstructionFailed signifies a failed procedure
+      *
+      * @param aEngineMonitor reference to Engine Monitor instance
+      * @param aAudioFactory Factory to create audio related classes.
+      * @return pointer to protocol specific phone model object
+      */
+      IMPORT_C static CPEPhoneModelIF* CreateL( 
+          MEngineMonitor& aEngineMonitor,
+          CPEAudioFactory& aAudioFactory );
+     
+protected:
+    
+    CPEPhoneModelIF();
+          
+
+    };
+          
+#endif // C_CPEPHONEMODELIF_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpeprofilesettingmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPEProfileSettingMonitor
+*                class
+*
+*/
+
+
+#ifndef CPEPROFILESETTINGMONITOR_H
+#define CPEPROFILESETTINGMONITOR_H
+
+//  INCLUDE FILES
+#include <e32base.h>
+
+// Profiles headers
+#include <Profile.hrh>
+#include <MProfile.h>
+#include <MProfileEngine.h>
+#include <MProfileTones.h>
+#include <MProfileName.h>
+#include <TProfileToneSettings.h>
+#include <MProfileChangeObserver.h>
+#include <CProfileChangeNotifyHandler.h>
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+
+// CLASS DECLARATION
+
+/**
+*  CPEProfileSettingMonitor
+*  Used to retrieve profiles settings and provide callback to profiles engine
+*  for notification of changes to profiles
+*
+*  @lib Phoneenginebase.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPEProfileSettingMonitor ) : public CBase, public MProfileChangeObserver
+{
+public:
+    static CPEProfileSettingMonitor* NewL( MPEPhoneModelInternal& aModel );
+    ~CPEProfileSettingMonitor();
+public: // From MProfileChangeObserver
+    virtual void HandleActiveProfileEventL( TProfileEvent aProfileEvent, TInt aProfileId );
+protected:
+    CPEProfileSettingMonitor( MPEPhoneModelInternal& aModel );
+    void ConstructL();
+    void GetProfileSettingsL();
+private: // Not owned by this object
+    MPEPhoneModelInternal& iModel; 
+private: // Owned by this object
+    MProfileEngine* iProfileEngine;  
+    CProfileChangeNotifyHandler* iProfileEventHandler;
+};
+
+#endif // CPEPROFILESETTINGMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpepubsubmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header of the phone engine base 
+*                central repository monitor classes 
+*
+*/
+
+
+#ifndef CPEPUBSUBMONITOR_H
+#define CPEPUBSUBMONITOR_H
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <e32property.h>
+#include <talogger.h>
+
+// Forward declarations
+class CRepository;
+class MPEPhoneModelInternal;
+class RProperty;
+
+// BASE CLASS
+
+// CLASS DECLARATION
+
+/**
+*   CPEPubSubMonitor
+*   Active object base class for publish&subscribe monitor code - not instantiable
+*   Exported methods are used by variant phone engine or other PE components
+*   This class should not be used by components external to the TelephonyEngine
+*
+*  @lib PhoneEngineBase.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPEPubSubMonitor ) : public CActive
+    {
+    protected:
+
+        ~CPEPubSubMonitor();
+        
+        CPEPubSubMonitor( MPEPhoneModelInternal& aModel );
+
+        /**
+        * Creates a new property object and submits a notification request
+        */
+        void BaseConstructL( TUid aCategory, TUint aKey, TUint aType );
+
+    protected:
+
+        /**
+        * Submits a notification request
+        */
+        void SubmitNotifyRequestL();
+
+        /**
+        * Defines the actions that take place when a change indication
+        * is received. Each deriving monitor has to define the implementation for
+        * this method. Most common approach would be to save the data to internal
+        * data store and send a message via phone model if neccessary.
+        */
+        virtual void UpdateL() = 0;
+
+    public:
+
+        /**
+        * Gets the current integer value of the monitored key
+        * @param TInt& aValue the current value of the monitored setting
+        * @return TInt Symbian OS error code from central repository
+        */
+        virtual TInt Get( TInt& aValue );
+
+        /**
+        * Gets the current binary value of the monitored key
+        * @param TDes8& aValue the current value of the monitored setting
+        * @return TInt Symbian OS error code from central repository
+        */
+        virtual TInt Get( TDes8& aValue );
+
+        /**
+        * Gets the current text value of the monitored key
+        * @param TDes16& aValue the current value of the monitored setting
+        * @return TInt Symbian OS error code from central repository
+        */
+        virtual TInt Get( TDes16& aValue );
+        
+    protected: // From CActive
+
+        virtual void DoCancel();
+        virtual TInt RunError( TInt aError );
+        virtual void RunL();
+
+    protected:         
+
+        // Not owned by this object: reference to phone model object    
+        MPEPhoneModelInternal& iModel;   
+        
+    private:        
+        // Owns handle to property object
+        RProperty iProperty;
+
+    #ifdef TEF_LOGGING_ENABLED            
+        // Category of property
+        TUid iCategory;
+        
+        // Key of property
+        TUint iKey;
+    #endif
+};
+
+#endif // CPEPUBSUBMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cperemotepartyinfomediator.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Registers mediator command to get the initial 
+*               remote party information.
+*
+*/
+
+#ifndef CPEREMOTEPARTYINFOMEDIATOR_H_
+#define CPEREMOTEPARTYINFOMEDIATOR_H_
+
+#include <e32base.h>
+
+#include "mpemediator.h"
+
+class CMediatorCommandResponder;
+class CMediatorEventProvider;
+class MPEPhoneModelInternal;
+class CPERemotePartyInfoProxy;
+class TPERemotePartyInfoMediatorUpdater;
+
+
+/**
+ *  Registers mediator command to get the initial remote party information.
+ * 
+ *  @lib phonemodel.lib
+ *  @since S60 5.2
+ */
+NONSHARABLE_CLASS( CPERemotePartyInfoMediator ) : 
+    public CBase,
+    public MPEMediator
+    {
+public:
+
+    static CPERemotePartyInfoMediator* NewL( MPEPhoneModelInternal& aModel );
+    static CPERemotePartyInfoMediator* NewLC( MPEPhoneModelInternal& aModel );
+    
+    /**
+    * Destructor.
+    */
+    virtual ~CPERemotePartyInfoMediator();
+    
+    /**
+     * Updates remote party info information to mediator clients.
+     * 
+     * @since S60 5.2
+     */
+    void UpdateRemotePartyInfo();
+    
+    /**
+     * From base class MPEMediator.
+     * @see MPEMediator.
+     */
+    virtual void SendResponse( TUid aCategory,
+                               TInt aCommandId, 
+                               const TDesC8& aData );   
+    
+    /**
+     * From base class MPEMediator
+     * @see MPEMediator.
+     */
+    virtual void RaiseEvent( TUid aCategory, 
+                             TInt aEventId,
+                             const TDesC8& aData );
+
+private:
+
+    CPERemotePartyInfoMediator( );
+
+    void ConstructL( MPEPhoneModelInternal& aModel );
+
+private: // data
+    
+    /**
+     * To register and respond commands.
+     * Own.
+     */
+    CMediatorCommandResponder* iResponder;
+    
+    /**
+     * To register and raise events.
+     * Own.
+     */
+    CMediatorEventProvider* iEventProvider;
+    
+    /**
+     * To filter events that contain unchanged data.
+     * Own.
+     */
+    CPERemotePartyInfoProxy* iProxy; 
+    
+    /**
+     * To update the call info to mediator clients.
+     * Own.
+     */
+    TPERemotePartyInfoMediatorUpdater* iUpdater;
+
+    };
+
+
+#endif /* CPEREMOTEPARTYINFOMEDIATOR_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cperemotepartyinfoproxy.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Proxy for remote party information sending
+*               to Mediator. Proxy checks if data has changed and 
+*               only in that case sends update event further.
+*
+*/
+
+#ifndef CPEREMOTEPARTYINFOPROXY_H_
+#define CPEREMOTEPARTYINFOPROXY_H_
+
+#include <e32base.h>
+
+#include "mpemediator.h"
+
+
+
+/**
+ *  Sends event about remote party information change if data has changed.
+ * 
+ *  @lib phonemodel.lib
+ *  @since S60 5.2
+ */
+NONSHARABLE_CLASS( CPERemotePartyInfoProxy ) : 
+    public CBase,
+    public MPEMediator
+    {
+public:
+    static CPERemotePartyInfoProxy* NewL( MPEMediator& aMediator );
+    static CPERemotePartyInfoProxy* NewLC( MPEMediator& aMediator );
+        
+    /**
+     * Destructor.
+     */
+    virtual ~CPERemotePartyInfoProxy();       
+    
+        
+    /**
+     * From base class MPEMediator.
+     * @see MPEMediator.
+     */
+    virtual void SendResponse( TUid aCategory,
+            TInt aCommandId, 
+            const TDesC8& aData );   
+        
+    /**
+     * From base class MPEMediator
+     * @see MPEMediator.
+     */
+    virtual void RaiseEvent( TUid aCategory, 
+            TInt aEventId,
+            const TDesC8& aData );
+
+private:
+
+    CPERemotePartyInfoProxy( MPEMediator& aMediator );
+    
+    void ConstructL( );
+    
+private: // data        
+        
+    
+    // Access to mediator service which this class is proxy for
+    MPEMediator& iMediator;
+    
+    // current remote party data
+    HBufC8* iRemotePartyData;
+
+    };
+
+
+#endif /* CPEREMOTEPARTYINFOPROXY_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpesettingscommand.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPESettingsCommand.h 
+*                object.
+*
+*/
+
+
+
+#ifndef CPESETTINGSCOMMAND_H
+#define CPESETTINGSCOMMAND_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <nwdefs.h>
+#include "pepanic.pan"
+#include "pevirtualengine.h"
+#include <msssettingsobserver.h>
+
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+class CPESettingsObserver;
+
+// CLASS DECLARATION
+
+/**
+*  CPESettingsCommand observer SSSettings changes
+*
+*  @lib phoneenginegsm
+*  @since Series_60 4.0
+*/
+NONSHARABLE_CLASS( CPESettingsCommand ) : public CBase,
+                           public MSSSettingsObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPESettingsCommand* NewL( 
+            MPEPhoneModelInternal& aModel );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPESettingsCommand( );
+
+    public: // New functions
+        
+        /**
+        * GetALSLineL
+        * @param aALSLine, Als line information to be updated
+        */
+        void GetALSLineL( RMobilePhone::TMobilePhoneALSLine& aALSLine );
+
+        /**
+        * SetALSLineL
+        * @param aALSLine, Als line information to set
+        */
+        void SetALSLineL( RMobilePhone::TMobilePhoneALSLine& aALSLine );
+        
+        /**
+        * GetClirL
+        * @param aClir, Clir information to be updated
+        */
+        void GetClirL( RMobileCall::TMobileCallIdRestriction& aClir );
+        
+        /**
+        * GetCugL
+        * @param aCugIndex, CUG index
+        */
+        void GetCugL( TInt aCugIndex );
+
+    public: // Functions from MSSSettingsObserver
+
+        /*
+        * Observer functoin 
+        * @param aSetting Current setting
+        * @param aNewValue New value for the setting
+        */
+        virtual void PhoneSettingChanged( 
+            TSSSettingsSetting aSetting, 
+            TInt aNewValue );
+
+    private:
+
+        /**
+        * Constructor.
+        */
+        CPESettingsCommand( MPEPhoneModelInternal& aModel );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private: // Data
+
+        //MPEPhoneModelInternal is used to send message to the phone application
+        MPEPhoneModelInternal& iModel;
+        //Pointer to instance of Settings
+        RSSSettings iSSSettings;
+
+    };
+
+#endif      // CPESETTINGSCOMMAND_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpesimstatemonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sim monitoring class definition
+*
+*/
+
+
+
+#ifndef CPESIMSTATEMONITOR_H
+#define CPESIMSTATEMONITOR_H
+
+//  INCLUDES
+#include "pevirtualengine.h"
+#include <e32base.h>
+#include <e32property.h>
+#include <startupdomainpskeys.h>
+
+
+// FORWARD DECLARATIONS
+class MPEPhoneModelInternal;
+
+// CLASS DECLARATION
+
+/**
+*  This class monitors Sim state changes from System Agent.
+*
+*  @lib PhoneEngine.lib
+*  @since Series60_4.0
+*/
+NONSHARABLE_CLASS( CPESimStateMonitor ) : public CActive
+    {
+
+    public: // Constants and data types
+
+    // Monitored Sim event given to constructor
+    enum TEvent
+        {
+        EEventSimStatus,
+        EEventSimChanged
+        };
+
+    public: // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CPESimStateMonitor* NewL( 
+            MPEPhoneModelInternal& aModel, 
+            const TEvent aEvent );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CPESimStateMonitor();
+
+    public: // New functions
+
+        /**
+        * Gets Sim state.
+        * @since Series60_4.0
+        * @return Sim state
+        */
+        TPESimState SimState( ) const;
+
+        /**
+        * Completes this monitor for initialization purposes and starts monitoring
+        * @since Series60_4.0
+        */
+        void Start();
+
+    private: // Constructors 
+
+        /**
+        * C++ default constructor.
+        */
+        CPESimStateMonitor( MPEPhoneModelInternal& aModel, const TEvent aEvent );
+
+        /**
+        * By default EPOC constructor is private.
+        */
+        void ConstructL();
+
+    private: // New functions
+
+         /**
+        * Converts and saves Sim state
+        * @since Series60_4.0
+        * @param aState Sim state from System Agent
+        * @return result of checking valid values.
+        */
+        TBool SaveSimState( const TInt aState );
+
+        /**
+        * Starts monitoring
+        * @since Series60_4.0
+        */
+        void StartMonitoring( );
+
+    private: // From CActive
+
+        /**
+        * Implements cancellation of an outstanding request.
+        */
+        void DoCancel();
+
+        /**
+        * Handles request completion event.
+        */
+        void RunL();
+
+    private: // Data
+
+        // To send messages
+        MPEPhoneModelInternal&  iModel;
+        // The interface to Publish And Subscribe.
+        RProperty iProperty;
+        // To maintain Sim property
+        TInt iSimState;
+        // To handle startup logic, init value ETrue
+        TBool iStartUp;
+        // Select Sim property of interest
+        TUint iPropertyKey;
+    };
+
+#endif // CPESIMSTATEMONITOR_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/cpetimer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the CPECallData object
+*
+*/
+
+
+#ifndef CPETIMER_H
+#define CPETIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <pevirtualengine.h>
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+// CLASS DECLARATION
+class MPEPhoneModelInternal;
+
+/**
+*  Offers timer service to the phone engine modules 
+*  
+*
+*  @lib PhoneEngineBase.lib
+*  @since Series60_2.7
+*/
+NONSHARABLE_CLASS( CPETimer ) : public CActive
+    {
+    public: //Constructors and descructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CPETimer* NewL( MPEPhoneModelInternal& aModel );
+
+        /**
+        * Destructor.
+        */
+        ~CPETimer();
+
+    public:    //New functions
+        /**
+        * Gets callId
+        * @since Series60_2.7
+        * @param aCallId is origival callId which is going to be redialed
+        */
+        void GetCallId( TInt& aCallId ) const;
+
+        /**
+        * Resets Timer
+        * @since Series60_2.7
+        */
+        void ResetTimer();
+
+        /**
+        * Starts Timer
+        * @since Series60_2.7
+        * @param aSenconds includes timer delay
+        * @param aCallId the identification number of the response message
+        * @param aResponseMessage the identification number of the response message
+        * @return possible error code
+        */
+        TInt StartTimer( 
+            const TTimeIntervalMicroSeconds32 aSeconds, 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aResponseMessage, 
+            const TInt aCallId );
+
+    protected: // From CActive
+        /**
+        * Cancels asyncronous request(s).
+        * @since Series60_2.7
+        */
+        void DoCancel();
+
+        /**
+        * Informs object that asyncronous request is ready.
+        * @since Series60_2.7
+        */
+        void RunL();
+
+    private:
+        
+        /**
+        * C++ default constructor.
+        */
+        CPETimer( MPEPhoneModelInternal& aModel );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    
+        // MPEPhoneModelInternal is used to message sending.
+        MPEPhoneModelInternal& iModel;
+        // RTimer object 
+        RTimer iTimer;
+        // Responce message
+        MEngineMonitor::TPEMessagesFromPhoneEngine iResponseMessage;
+        // The identification number of the call( it is used to rerouting responce message to the right call )
+        TInt iCallId;
+};
+
+#endif // CPETIMER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpeactivestarter.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the MPEActiveStarter class.
+*
+*/
+
+
+
+#ifndef MPEACTIVESTARTER_H
+#define MPEACTIVESTARTER_H
+
+//INCLUDES
+
+// CLASS DECLARATION
+
+/**
+*  Virtual interface for a protocol specific active starter of Phone Engine.
+*
+*  @lib PhoneEngineBase.lib
+*  @since Series60_2.7
+*/
+NONSHARABLE_CLASS( MPEActiveStarter )
+    {
+    public:
+
+        /**
+        * Recalls starting of modules after leave occured in the middle of StepL sequence.
+        * @since Series60_2.7
+        */
+        virtual void RecallSteps( ) = 0;
+
+        /**
+        * Calls a protocol specific step method, which starts modules of PhoneEngine.
+        * @since Series60_2.7
+        * @return EFalse when starting sequence completed. 
+        */
+        virtual TBool StepL( ) = 0;
+
+    };
+
+#endif // MPEACTIVESTARTER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpecallcontrolif.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the interface for dialling a phone call.
+*
+*/
+
+#ifndef MPECALLCONTROLIF_H
+#define MPECALLCONTROLIF_H
+
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  Dials a phone call. 
+* 
+*  @lib phoneengine.lib
+*  @since S60_10.1
+*/
+NONSHARABLE_CLASS( MPECallControlIF ) 
+{
+    public:    //New functions
+
+        /**
+        * Dials a phone call.
+        * @param aClientCall, Informs is the current call client originated or not.
+        *                     By default not client originated.
+        * @return Return possible error code.
+        */
+        virtual TInt HandleDialServiceCall( 
+                const TBool aClientCall = EFalse ) = 0;        
+
+        /**
+        * Starts tone playing. 
+        */
+        virtual void HandlePlayDTMFL() = 0;
+
+        /**
+        * Stops tone playing. 
+        * @return error code.
+        */
+        virtual TInt HandleEndDTMF() = 0;
+
+    };
+
+#endif // MPECALLCONTROLIF_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpecallsettersif.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the interface for setters needed needed for dialling a phone call.
+*
+*/
+
+#ifndef MPECALLSETTERSIF_H
+#define MPECALLSETTERSIF_H
+
+// INCLUDES
+#include <pevirtualengine.h>
+
+// CLASS DECLARATION
+
+/**
+*  Call for setting needed parameters before making a phone call.
+* 
+*  @lib phoneengine.lib
+*  @since S60_10.1
+*/
+NONSHARABLE_CLASS( MPECallSettersIF ) 
+{
+    public:    //New functions
+
+        /**
+        * Sets key code value to TPEBasicInfo-structure
+        * @param aKeyCode is the key code value.
+        * @return None.
+        */
+        virtual void SetKeyCode( const TChar& aKeyCode ) = 0; 
+
+        /**
+        * Sets phone number to TPECallCommandInfo-structure
+        * @param aPhoneNumber is the phone number
+        * @return None.
+        */
+        virtual void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber ) = 0;
+
+        /**
+        * Sets call type information for following command message
+        * Used for specifying the call type of the next attempted call
+        * @param aCallType is the call type of the next attempted call
+        */
+        virtual void SetCallTypeCommand( const TPECallType& aCallType ) =  0;
+        
+        /**
+        * Sets call Phonebook contact identifier.
+        * @param aContactId is the contact identifier for a call
+        */
+        virtual void SetContactId2( const TInt aContactId ) = 0;
+        
+        /**
+        * Sets service identifier.
+        * @param aServiceId service id
+        */
+        virtual void SetServiceIdCommand( TUint32 aServiceId ) = 0;
+
+    };
+
+#endif // MPECALLSETTERSIF_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpeclientcallrequestmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the interface for using call request monitors.
+*
+*/
+
+
+
+#ifndef MPEClientCallRequestMonitor_H
+#define MPEClientCallRequestMonitor_H
+
+//INCLUDES
+#include <cphcltdialdata.h>
+
+// CLASS DECLARATION
+
+/**
+*  Monitor call requests from the phone server(/phone client). 
+*  
+* 
+*  @lib PhoneEngineBase.lib
+*  @since S60_5.0
+*/
+NONSHARABLE_CLASS( MPEClientCallRequestMonitor ) 
+{
+    public:    //New functions
+        /**
+        * Gets dial data
+        * @return Reference to TPhCltTelephoneNumber, telephony number.
+        */
+        virtual CPhCltDialData* ClientDialData() = 0;
+        
+        /**
+        * Sends respond to the phone client
+        * @param aRespond  contains respond to the phone client.
+        */
+        virtual void SendRespond( const TInt aRespond ) = 0;
+        
+        /**
+        * Tells whether this monitor is active.
+        */
+        virtual TBool IsActive() = 0;
+
+    };
+
+#endif // MPEClientCallRequestMonitor_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpeexternaldatahandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file defines the protocol independent interface
+*                of the Phone Engine external data store framework for
+*                Phone Engine submodule use.
+*
+*/
+
+
+#ifndef MPEEXTERNALDATAHANDLER_H
+#define MPEEXTERNALDATAHANDLER_H
+
+//  INCLUDE FILES
+#include <pevirtualengine.h>
+
+// FORWARD DECLARATIONS
+// None
+
+// DATA TYPES
+enum TPEExternalDataId
+    {
+    EPEAudioOutputPreference,
+    EPEAutomaticAnswerHeadsetSetting,
+    EPEAutomaticAnswerLoopsetSetting,
+    EPEAutomaticAnswerCarkitSetting,
+    EPEAutomaticAnswerMusicStandSetting,
+    EPEAutomaticAnswerWirelessCarkitSetting,
+    EPECallDurationDisplaySetting,
+    EPEDialPrefixChangeSetting,
+    EPEDialPrefixTextSetting,  
+    EPETelephonyVariationFlags,
+    EPEAccessoryMode,
+    EPEEmergencyCallInfo,
+    EPENetworkConnectionAllowedSetting
+    };
+
+// CLASS DECLARATION
+
+/**
+*  MPEExternalDataHandler
+*  This internal interface provides for an access to Phone Engines external data
+*   store, i.e. settings stored in Central Repository and Publish and Subscribe.
+*
+*  @lib Phoneengine.lib
+*/
+NONSHARABLE_CLASS( MPEExternalDataHandler )
+    {
+    public:
+
+        /**
+        * Gets the current value of the specified setting,
+        * if the operation was successful then aValue contains the current valid
+        * value of the setting
+        * @param aSetting specifies the setting to be read
+        * @param aValue the current value of the monitored setting
+        * @return Symbian OS error code
+        */
+        virtual TInt Get( const TPEExternalDataId aSetting, TInt& aValue ) const = 0;
+
+        /**
+        * Gets the current value of the specified setting,
+        * if the operation was successful then aValue contains the current valid
+        * value of the setting
+        * @param aSetting specifies the setting to be read
+        * @param aValue the current value of the monitored setting
+        * @return Symbian OS error code
+        */
+        virtual TInt GetText( const TPEExternalDataId aSetting, TDesC& aValue ) const = 0;
+
+        /**
+        * Sets the value of the specified setting,
+        * @param aSetting specifies the setting to be written
+        * @param aValue the value of the setting
+        * @return Symbian OS error code
+        */
+        virtual TInt Set( const TPEExternalDataId aSetting, const TInt aValue ) = 0;
+
+    };
+
+#endif  //  MPEEXTERNALDATAHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpekeysequencerecognitionif.h	Fri Jun 04 10:19:18 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:  This file contains the interface for key sequence recognition.
+*
+*/
+
+#ifndef MPEKEYSEQUENCERECOGNITIONIF_H
+#define MPEKEYSEQUENCERECOGNITIONIF_H
+
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+/**
+*  Defines interface for key sequence recognition and execution. 
+* 
+*  @lib phoneengine.lib
+*  @since S60_10.1
+*/
+NONSHARABLE_CLASS( MPEKeySequenceRecognitionIF ) 
+{
+    public:    //New functions
+
+        /**
+         * Executes provided key sequence if the sequence is recognized.
+         * @param   aSequence   The key sequence.
+         * @return  ETrue if the key sequence was executed, EFalse otherwise.
+         */
+        virtual TBool ExecuteKeySequenceL(const TDesC16& aSequence) = 0;   
+    };
+
+#endif // MPEKEYSEQUENCERECOGNITIONIF_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpemediator.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Mediator interface
+*
+*/
+
+#ifndef MPEMEDIATOR_H
+#define MPEMEDIATOR_H
+
+#include <e32std.h>
+
+/**
+ *  Mediator interface
+ *
+ *  @lib PhoneModel.lib
+ *  @since S60 5.1
+ */
+NONSHARABLE_CLASS( MPEMediator )
+    {
+
+public:
+    
+    /**
+     * Sends response to mediator command.
+     * 
+     * @param aCategory Command category
+     * @param aCommandId Id of the command
+     * @param aData Data to be sent.
+     */
+    virtual void SendResponse( 
+        TUid aCategory, 
+        TInt aCommandId, 
+        const TDesC8& aData ) = 0;
+    
+    /**
+     * Raises mediator event.
+     * 
+     * @param aCategory Event category
+     * @param aEventId Id of the event
+     * @param aData Data to be sent.
+     */
+    virtual void RaiseEvent( 
+        TUid aCategory, 
+        TInt aEventId,
+        const TDesC8& aData ) = 0;
+
+    };
+
+
+#endif // MPEMEDIATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mpephonemodelinternal.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Definition of MPEPhoneModelInternal class.
+*
+*/
+
+
+#ifndef M_MPEPHONEMODELINTERNAL
+#define M_MPEPHONEMODELINTERNAL
+
+#include <pevirtualengine.h>
+
+class MPEDataStore;
+class MPEExternalDataHandler;
+class CPERemotePartyInfoMediator;
+
+
+/**
+ *  Phone Model internal interface.
+ *
+ *  
+ *
+ *  @lib phoneengine
+ *  @since S60 v4.0 
+ */
+NONSHARABLE_CLASS( MPEPhoneModelInternal ) 
+    {
+
+public:
+
+    /**
+     * Returns pointer to information object (CPEEngineInfo) 
+     *
+     * @since S60 v4.0
+     * @return pointer to CPEEngineInfo object as MPEDataStore
+     */
+     virtual MPEDataStore* DataStore() = 0;    
+
+    /**
+     * Handle internal message
+     *
+     * @since S60 v4.0
+     * @param aMessage specifies the event that has taken place
+     * @param aCallId is the call id number.
+     */
+     virtual void HandleInternalMessage( const TInt aMessage ) = 0;
+
+    /**
+     * Reroutes messages from the susbsystems to the message handler
+     *
+     * @since S60 v4.0
+     * @param aMessage is the message id.
+     */
+     virtual void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ) = 0;
+
+    /**
+     * Reroutes messages from the susbsystems to the message handler
+     *
+     * @since S60 v4.0
+     * @param aMessage is the message id.
+     * @param aCallId is the call id number.
+     */
+     virtual void SendMessage( 
+            const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+            const TInt aCallId ) = 0;
+     
+    /**
+     * Returns pointer to external data handler
+     *
+     * @since S60 v4.0
+     * @return pointer to MPEExternalDataHandler object
+     */
+     virtual MPEExternalDataHandler* DataStoreExt() = 0;
+     
+     
+     /**
+      * Returns pointer to Mediator Command handler
+      *
+      * @since S60 v5.2
+      * @return pointer to CPERemotePartyInfoMediator object
+      */
+     virtual CPERemotePartyInfoMediator* MediatorCommunicationHandler() = 0;
+   
+    };
+
+
+#endif // M_MPEPHONEMODELINTERNAL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/mphonedevicemodeobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer for device call event
+*
+*/
+
+
+#ifndef MPHONEDEVICEMODEOBSERVER_H
+#define MPHONEDEVICEMODEOBSERVER_H
+
+#include <e32def.h>
+
+/**
+*  Observer for device call events 
+*
+*  @since Series60 3.0
+*/
+NONSHARABLE_CLASS( MPhoneDeviceModeObserver )
+    {
+    public: // New functions
+        
+        /**
+        * Answers the arriving call
+        */
+        virtual void Answer()=0;
+
+        /**
+        * Ends the CS and DS voice calls
+        */
+        virtual void EndVoiceCalls()=0;
+    };
+
+#endif      // MPHONEDEVICEMODEOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/penetworkhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,84 @@
+/*!
+* 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:  Network handling.
+*
+*/
+
+#ifndef PENETWORKHANDLER_H
+#define PENETWORKHANDLER_H
+
+#include <QObject>
+#include <qsysteminfo.h>
+#include <networkhandlingdomainpskeys.h>
+#include "mpephonemodelinternal.h"
+
+QTM_USE_NAMESPACE
+
+class PeNetworkHandler : public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    /*!
+       Constructor
+     */
+    PeNetworkHandler(MPEPhoneModelInternal& aModel);
+    
+    /*!
+       Destructor
+     */
+    virtual ~PeNetworkHandler ();
+    
+    
+public slots:
+
+    /*!
+        \fn void networkStatusChanged()
+    
+        Slot is called when network status is changed.
+    */
+    void networkStatusChanged(
+            QSystemNetworkInfo::NetworkMode mode, 
+            QSystemNetworkInfo::NetworkStatus status);
+    
+private:
+    
+    /*!
+        \fn void sendStatus()
+    
+        Sends new status.
+    */
+    void sendStatus(QSystemNetworkInfo::NetworkStatus status);
+        
+    /*!
+        \fn void convertStatus ()
+    
+        Converts QSystemNetworkInfo::NetworkStatus to 
+        TNWNetworkRegistrationStatus.
+    */
+    TNWNetworkRegistrationStatus convertStatus(
+            QSystemNetworkInfo::NetworkStatus status);
+    
+
+private:
+
+    // Reference to phone model object
+    MPEPhoneModelInternal& iModel;
+        
+    QSystemNetworkInfo* m_networkInfo;
+    
+};
+
+#endif // PENETWORKHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/pepanic.pan	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains panic enumerations
+*
+*/
+
+
+#ifndef     PEPANIC_PAN
+#define     PEPANIC_PAN
+
+//  INCLUDES
+#include <e32def.h>
+#include <e32cmn.h>
+
+// CONSTANTS
+
+// Phone Engine panic
+_LIT( KPEPhoneEnginePanic, "Phone Engine Panic!" );
+
+    enum TPEPanic
+        {
+        EPEPanicAccessingDataOnIncompleteRequest = 1,
+        EPEPanicAllSettingsDataObjectsAlreadyInUse = 2,
+        EPEPanicBadHandle = 3,
+        EPEPanicCallDataNull = 4,
+        EPEPanicCallIndexOutOfRange = 5,
+        EPEPanicConferenceIndexOutOfRange = 6,
+        EPEPanicDebugDangerousMove = 7,
+        EPEPanicIllegalCommand = 8,
+        EPEPanicIndexOutOfRange = 9,
+        EPEPanicInvalidCommand = 10,
+        EPEPanicInvalidHandle = 11,
+        EPEPanicInvalidMode = 12,
+        EPEPanicInvalidRequest = 13,
+        EPEPanicInvalidRequestId = 14,
+        EPEPanicInvalidState = 15,
+        EPEPanicLineNotFound = 16,
+        EPEPanicNoCallInState = 17,
+        EPEPanicNoCallOrLine = 18,
+        EPEPanicNoConferenceCall = 19,
+        EPEPanicNoErrorCodeInSuccessfulRequest = 20,
+        EPEPanicNoEtel = 21,
+        EPEPanicNoFreeCalls = 22,
+        EPEPanicNoObserver = 23,
+        EPEPanicNoPhoneServer = 24,
+        EPEPanicNoRepository = 25,
+        EPEPanicNotCompleted = 26,
+        EPEPanicNullPointer = 27,
+        EPEPanicObserverAlreadySet = 28,
+        EPEPanicRepositoryAlreadyActive = 29,
+        EPEPanicPropertyAlreadyActive = 30,
+        EPEPanicSplitWithoutConference = 31,
+        EPEPanicStupidUser = 32,
+        EPEPanicUIHasBeenLeaved = 33,
+        EPEPanicVideoLibraryNotFound = 34,
+        EPEPanicInvalidIncomingCallMonitor = 35,
+        EPEPanicInvalidCallAddedMonitor = 36,
+        EPEPanicInvalidCallEventMonitor = 37,
+        EPEPanicExternalDataIdOutOfRange = 38,
+        EPEPanicCallIsAlreadyAddedToConference = 39,
+        EPEPanicInvalidParameter = 40,
+        EPEPanicAudioInitializeError = 41,
+        
+        EPEPanicMaximum = 100
+        };
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// CLASS DECLARATION
+// None.
+
+GLREF_C void Panic( TPEPanic aPanic );
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/pevirtualengine.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,941 @@
+/*
+* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file defines the protocol independent interface of the Phone Engine.
+*
+*/
+
+#ifndef PEVIRTUALENGINE_H
+#define PEVIRTUALENGINE_H
+
+// INCLUDES
+#include <badesca.h>
+#include <bldvariant.hrh>   //protocol definition, component configuration definitions
+#include <cphcntcontactid.h>
+#include <ctsydomainpskeys.h>
+#include <etelmm.h>
+#include <exterror.h>
+#include <fbs.h>
+#include <mccecall.h>
+#include <mmtsy_names.h>
+#include <networkhandlingdomainpskeys.h>
+#include <phclttypes.h>
+#include <Profile.hrh>
+#include <rmmcustomapi.h>
+#include <rsssettings.h>
+#include <sysutil.h>
+
+
+// CONSTANTS
+
+//Call origin types
+enum TPECallOrigin
+    {
+    EPECallOriginPhone,
+    EPECallOriginClient,
+    EPECallOriginSAT
+    };
+
+//Output types
+enum TPEAudioOutput
+    {
+    EPENotActive,
+    EPEHandset,
+    EPELoudspeaker,
+    EPEWiredAudioAccessory,
+    EPEBTAudioAccessory,
+    EPETTY
+    };
+
+//Error types
+enum TPEErrorType
+    {
+    EPECcp = 0,
+    EPECch
+    };
+
+// PhoneEngine Errors
+const TInt KErrPhoneEngineErrorBase = -30000;
+const TInt KErrPhoneEngineNoWcdmaNetwork = KErrPhoneEngineErrorBase - 1;
+const TInt KErrPhoneEngineVideoCallNotAllowedDuringRestore = KErrPhoneEngineErrorBase - 2;
+const TInt KErrPhoneEngineVideoCallSetupFailed = KErrPhoneEngineErrorBase - 3;
+
+// Phone Engine dll uid
+const TUid KUidPhoneEngine = { 0x1000A86C };
+
+// Maximum length of phone number 
+const TInt KPEPhoneNumberMaxLength = 100;
+//Phone number type defined using the custom maximum length
+typedef TBuf<KPEPhoneNumberMaxLength> TPEPhoneNumber;
+//Maximum length of dtmf string        
+const TInt KPEDtmfMaxLength = KPEPhoneNumberMaxLength;
+
+//Maximum number of the SS service groups
+const TInt KPEMaxServiceGroup = 53; // Maximum value taken from etelmm.h(TMobileService)    
+
+const TInt KPEAutomaticAnswerTimeout = 5000000; // 5 seconds;
+
+// Enumerations for variant messages
+// For enumeration TPEMessagesToPhoneEngine
+const TInt KPEMessagesToPhoneEngineGsmFirst = 11000;
+const TInt KPEMessagesToPhoneEngineGsmLast = 12999;
+const TInt KPEMessagesToPhoneEngineVariantFirst = KPEMessagesToPhoneEngineGsmFirst;
+
+// For enumeration TPEMessagesFromPhoneEngine
+const TInt KPEMessagesFromPhoneEngineGsmFirst = 11000;
+const TInt KPEMessagesFromPhoneEngineGsmLast = 12999;
+const TInt KPEMessagesFromPhoneEngineVariantFirst = KPEMessagesFromPhoneEngineGsmFirst;
+
+// Lifetimer data in hours and minutes
+NONSHARABLE_STRUCT( TPELifeTimeData )                      
+    {
+    TUint32 iHours;                         //range 0-999999 
+    TUint8 iMinutes;                        //range 0-59
+    };
+
+// Used when initializing number variables with non negative value range.
+const TInt KPENumberInitValue = -1; 
+//CallId not used in SendErrorMessageL
+const TInt KPECallIdNotUsed = -1;            
+//ErrorCode not used in SendErrorMessageL
+const TInt KPEErrorCodeNotUsed = -1;        
+// Informs to phone engine that dont send message to the phone application
+const TInt KPEDontSendMessage = 1;
+ 
+// Maximum lenght of timer
+const TInt KPESsTimerMaxLength = 2;
+
+// Audio player repeats tone forever
+const TInt KPEAudioPlayerRepeatForever = -2;
+// Default Audio volume value
+const TInt KPEDefaultAudioVolume = 7;
+// Default volume value for accessory
+const TInt KPEDefaultAccessoryVolume = 5;
+// Default keypad volume
+const TProfileKeypadVolume KPEDefaultKeypadVolume = EProfileKeypadVolumeLevel2;
+
+// Dtmf stop character, PE handles internally DTMF characters as lowercase.
+const TUint KPEDtmfStopCharLowercase = 'w';
+const TUint KPEDtmfStopCharUppercase = 'W';
+const TUint KPEDtmfPauseCharLowercase = 'p';
+const TUint KPEDtmfPauseCharUppercase = 'P';
+const TUint KPEDtmfPlusChar = '+';
+
+enum TPELoggingIndicator
+    {
+    EPENormalLogging = 0,
+    EPEContinuousLogging 
+    };
+
+// Maximum Length of profile name
+const TInt KPEProfileNameLength = 64;
+// Profile is alerting all incoming calls.
+_LIT( KPEAlertForAllCalls, "1");
+// Informs how many profiles there are
+const TInt KPEProfileGroups = 3;
+// Informs how much time it take's to change ringing tone volume from minimum to maximum(Ascending)
+const TInt KPERingingToneRampDuration = 5000000;
+// Informs how many ringing tone volume levels there are in the profile db
+const TInt KPEProfileRingingToneLevels = 10;
+// Includes default tone volume
+const TInt KPEDefaultToneVolume = 30000;
+// Contact group id string length
+const TInt KPEContactGroupString = 100;
+
+//The length of a pause created during dialling by the comma character (',') measured in seconds.  
+const TUint KPEDefaultInterval = 2;
+
+// CommDB constants for Data calls
+// Internet Access Point service type
+_LIT( KPEIAPServiceTypeName, "IAP\\IAPServiceType" );
+// Dial Out Internet Serivce Provider Table name
+_LIT( KPEIAPDialOutISPTableName, "DialOutISP" );
+// Dial In Internet Service Provider Table name
+_LIT( KPEIAPDialInISPTableName, "DialInISP" );
+// Access Point Name column on IAP table
+_LIT( KPEIAPAccessPointName, "IAP\\NAME" );
+
+const TInt KPEMaxAudioOutputs = EPETTY + 1; // enum count
+
+// DATA TYPES
+
+// Contact name definition
+typedef TBuf<KCntMaxTextFieldLength> TPEContactName;
+// Contact company definition
+typedef TBuf<KCntMaxTextFieldLength> TPEContactCompany;
+// Contact group definition
+typedef TBuf<KCntMaxTextFieldLength> TPEContactGroup;
+// Contact filename definition
+typedef TBuf<KMaxFileName>         TPEContactFileName;
+// Contact group ids sting
+typedef TBuf<KPEContactGroupString> TPEContactGroupId;
+//Dtmf-string definition
+typedef TBuf<KPEDtmfMaxLength> TPEDtmfString;
+//Profile name definition
+typedef TBuf<KPEProfileNameLength> TPEProfileName;
+//Call control caps
+typedef TUint32 TPECallControlCaps;
+//User to user info
+typedef TBuf<KPhCltUUILength> TPEUserToUserInfo;
+
+// Phone identity parameters type.
+typedef TBuf<RMobilePhone::KPhoneManufacturerIdSize> TPEManufacturer;
+typedef TBuf<RMobilePhone::KPhoneModelIdSize> TPEModel;
+typedef TBuf<KSysUtilVersionTextLength> TPERevision;
+typedef TBuf<RMobilePhone::KPhoneSerialNumberSize> TPESerialNumber;
+
+//Call States
+typedef TUint TPEState;
+
+enum
+    {
+    // Call states                        0 - 499
+    EPEStateUnknown                     = 0,
+    EPEStateIdle,
+    EPEStateDialing,
+    EPEStateEmergencyDialing,
+    EPEStateRinging,
+    EPEStateConnecting,
+    EPEStateConnected,
+    EPEStateHangingUp,
+    EPEStateHeld,
+    EPEStateAnswering,
+    EPEStateRejecting,
+    EPEStateDisconnecting,
+    // conference call states
+    EPEStateConferenceIdle,
+    EPEStateConnectedConference,
+    EPEStateHeldConference,
+    EPEStateCreatingConference,
+    EPEStateHangingUpConference,
+    EPEStateSwappingConference,
+    EPEStateResumeHoldConference,        
+    EPEStateGoingOneToOne,
+    EPEStateAddingConferenceMember,
+    EPEStateAddedConferenceMember,
+    EPEStateDroppingConferenceMember,
+    EPEStateDroppedConferenceMember,
+    // maximum value for boundary checks
+    EPEStateMaximumState                = 1000
+    };
+
+NONSHARABLE_STRUCT( TPEErrorInfo )
+    {
+    //Symbian OS error code
+    TInt iErrorCode;
+    //Call Id number, equals KPECallIdNotUsed if call id is not available or is
+    //invalid for this error condition
+    TInt iCallId;
+    // Error type( Cch or Ccp )
+    TPEErrorType iErrorType;
+    };
+    
+enum TPECallType
+    { // maintain compatibility with P&S type enum
+    // Used to initialize call type information
+    EPECallTypeUninitialized    = EPSCTsyCallTypeUninitialized,
+    // Circuit switched voice call
+    EPECallTypeCSVoice          = EPSCTsyCallTypeCSVoice,
+    // Circuit switched multimedia call
+    EPECallTypeVideo            = EPSCTsyCallTypeH324Multimedia,
+    // Packet switched voice call
+    EPECallTypeVoIP             = EPSCTsyCallTypeVoIP
+    };
+
+enum TPEPinCode 
+    {
+    EPEPinCode,
+    EPEPin2Code
+    };
+
+enum TPEPhoneCommandType
+    {
+    EPESendingFlash
+    };
+
+// Enumeration which defines the search keys with which
+// contact information is searched
+enum TPEFindContactKey
+    {
+    //Search keys
+    EPEFindWithPhoneNumber = 0,
+    EPEFindWithContactId,
+    EPEFindKeyNotDefined
+    };
+
+enum TPESecurityCommand 
+    {
+    EPESecurityCommandUnknown,
+    EPESecurityCommandChangePinCode,
+    EPESecurityCommandUnblockPinCode,
+    EPESecurityCommandChangeBarringPassword,
+    EPESecurityCommandChangeSimLock
+    };
+
+enum TPEPhoneNumberIdType
+    {
+    EPEUnknownNumber,
+    EPEMobileNumber,
+    EPEPager,
+    EPETelephoneNumber,
+    EPEVmbxNumberLine1,
+    EPEVmbxNumberLine2,
+    EPEPrivateNumber,
+    EPEEmergencyNumber,
+    EPEFaxNumber,
+    EPEVoipNumber,
+    EPEVideoNumber,
+    EPEAssistantNumber,
+    EPECarNumber,
+    EPEHomeNumber,
+    EPEWorkNumber
+    };
+
+enum TPERxTimeSlots
+    {
+    EPERxSlots1 = 1,
+    EPERxSlots2 = 2,
+    EPERxSlots3 = 3
+    };
+
+//VoiceMailBoxNumbers
+NONSHARABLE_STRUCT( TPEVoiceMailBoxNumberInfo )
+    {
+    TPEPhoneNumber iVMBXL1; // Line 1 VoiceMailBoxNumber
+    TPEPhoneNumber iVMBXL2; // Line 2 VoiceMailBoxNumber
+    TPEPhoneNumber iDTMFVMBXL1; // Line 1 DTMFVoiceMailBoxNumber
+    TPEPhoneNumber iDTMFVMBXL2; // Line 2 DTMFVoiceMailBoxNumber
+    };
+
+
+// Contains information of PhoneIdentity paramteres
+NONSHARABLE_STRUCT( TPEPhoneIdentityParameters )
+    {
+    TPEManufacturer iManufacturer;
+    TPEModel iModel;
+    TPERevision iRevision;
+    TPESerialNumber iSerialNumber;
+    };
+
+// Contains information of call audio route parameters
+NONSHARABLE_STRUCT( TPEPhoneAudioRouteParameters )
+    {
+    TPEAudioOutput iAudioOutput;
+    TPEAudioOutput iPreviousOutput;
+    TBool iShowNote;
+    };
+
+// Enumerate definitions for MMI Service Codes from MMETel API:
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+
+class MPEEngineInfo;
+
+// CLASS DECLARATION
+
+/**
+*  Offers message interface from phone engine to phone application.
+*  
+*  @lib phonenegine.lib
+*  @since S60 v.4.0
+*/
+NONSHARABLE_CLASS( MEngineMonitor )
+    {
+
+    public:
+
+        enum TPEMessagesFromPhoneEngine
+        {
+        // Audio messages                     1000 - 1999
+        EPEMessageAudioDtmfEvent            = 1000,
+        EPEMessageAudioDTMFPlayComplete,
+        EPEMessageAudioMuteChanged,
+        EPEMessageAudioOutputChanged,
+        EPEMessageAudioOutputPreferenceChanged,
+        EPEMessageAudioPlayStopped,
+        EPEMessageAudioVolumeChanged,
+        EPEMessageAvailableAudioOutputsChanged,
+
+        // Call messages                      2000 - 2999
+        EPEMessageAnswer                    = 2000,
+        EPEMessageAnswering,
+        EPEMessageCallAdded,
+        EPEMessageCallControlCapsChanged,
+        EPEMessageCallWaiting,
+        EPEMessageCallWaitingAnswered,
+        EPEMessageChangedCallDuration,
+        EPEMessageConferenceCapsChange,        
+        EPEMessageConferenceIdle,
+        EPEMessageConnected,
+        EPEMessageConnectedConference,                
+        EPEMessageConnecting,
+        EPEMessageContinuingDTMFSending,
+        EPEMessageDialing,
+        EPEMessageDialingError,
+        EPEMessageDisconnecting,
+        EPEMessageDisconnectingConference,        
+        EPEMessageDisconnectingWithInband,  //UI doesn't get this message, it is mapped as EPEMessageDisconnecting
+        EPEMessageDTMFSendingAborted,
+        EPEMessageHeld,
+        EPEMessageHeldConference,        
+        EPEMessageIdle,
+        EPEMessageIncoming,
+        EPEMessageInitiatedEmergencyCall,
+        EPEMessageInitiatedEmergencyWhileActiveVideo,
+        EPEMessageInvalidSpeedDial,
+        EPEMessageIssuingUSSDRequest,
+        EPEMessageIssuedUSSDRequest,
+        EPEMessagePacketNetworkDetached,   
+        EPEMessagePromptSpeedDial,
+        EPEMessageRemoteBusy,
+        EPEMessageRemoteTerminated,               
+        EPEMessageSendingDTMF,
+        EPEMessageSentDTMF,
+        EPEMessageSentSSString,
+        EPEMessageSpeedDialNotAssigned,
+        EPEMessageStoppedDTMF,
+        EPEMessageSwapped,
+        EPEMessageTransferDone,
+        EPEMessageTransferring,
+        EPEMessageUnknown,
+        EPEMessageWentOneToOne,        
+        EPEMessageRemotePartyInfoChanged,
+        EPEMessageConnectingWithInband, //UI doesn't get this message, it is mapped as EPEMessageConnecting
+
+        EPEMessageUnattendedTransferRequest,
+
+        EPEMessageRemoteForwarding,
+        EPEMessageMovedPermanently,        
+        EPEMessageMultipleChoices,        
+
+        // Contact messages                   3000 - 3999
+        EPEMessageThumbnailLoadingCompleted  = 3000,
+
+        // Error messages                     4000 - 4999
+        EPEMessageError                     = 4000,
+        EPEMessageAudioHandlingError,
+        EPEMessageCallHandlingError,
+        EPEMessageConferenceErrorAddCall,
+        EPEMessageConferenceErrorRemoveCall,
+        EPEMessageConferenceErrorSwap,
+        EPEMessageConferenceErrorHold,
+        EPEMessageConferenceErrorResume,
+        EPEMessageConferenceErrorGoOneToOne,
+        EPEMessageConferenceErrorCurrentCallsToConference,
+        EPEMessageConferenceErrorHangUp,
+        EPEMessageContactHandlingError,
+        EPEMessageLogHandlingError,
+        EPEMessageServiceHandlingError,
+
+        // Network messages                   5000 - 5999
+        EPEMessageCallSecureStatusChanged= 5000,
+        EPEMessageNetworkRegistrationStatusChange,
+
+        // Parser messages                    6000 - 6999
+        EPEMessageActivateRfsDeep           = 6000,
+        EPEMessageActivateRfsNormal,
+        EPEMessageActivateWarrantyMode,
+        EPEMessageShowBTDeviceAddress,
+        EPEMessageShowBTLoopback,
+        EPEMessageShowIMEI,
+        EPEMessageShowVersion,
+        EPEMessageShowWlanMacAddress,
+        EPEMessageSSRequestFailed,
+        EPEMessageBTDebugMode,
+
+        // Security messages                  7000 - 7999
+        EPEMessageBadBarringPasswordChange  = 7000,
+        EPEMessageBadPin1Change,
+        EPEMessageBadPin1Unblock,
+        EPEMessageBadPin2Change,
+        EPEMessageBadPin2Unblock,
+        EPEMessageBarringPasswordChanged,
+        EPEMessageChangedSimLock,
+        EPEMessageFailedChangeSimLock,
+        EPEMessageFailedNewPin1AndPin2NotEqual,         // Error message, NewPin1 and NewPin2 are not equal
+        EPEMessageFailedSecurityCommandAlreadyActive,   // Error message, SecurityCommand is already active
+        EPEMessagePin1Changed,
+        EPEMessagePin1Unblocked,
+        EPEMessagePin2Changed,
+        EPEMessagePin2Unblocked,
+        EPEMessageSIMChanged,
+        EPEMessageSIMStateChanged,
+
+        // Settings and Shared Data messages  8000 - 8999
+        EPEMessageProfileChanged            = 8000,
+
+        // Startup messages                   9000 - 9999
+        EPEMessagePEConstructionReady       = 9000,     // Phone Engine is initialized and fully operational
+        EPEMessagePEConstructionFailed,
+        EPEMessagePEConstructionTwoPhaseReady,
+        // Miscellaneous messages             10000 - 10999
+        EPEMessageDoNotSendMe               = 10000,
+        EPEMessageInValidEmergencyNumber,
+        EPEMessageLogEventSaved, 
+        EPEMessagePhoneIdentityReady,
+        EPEMessageStartATDialing,
+        EPEMessageValidEmergencyNumber,
+        EPEMessageMuteRingingTone,
+
+        // Audio messages                         11000 - 11199
+
+        // Call messages                          11200 - 11399
+        EPEMessageActiveBarring                 = KPEMessagesFromPhoneEngineGsmFirst + 200,
+        EPEMessageActiveCallForwarding,
+        EPEMessageAddedConferenceMember,
+        EPEMessageALSLineChanged,
+        EPEMessageCallBarred,
+        EPEMessageIncCallIsForw,
+        EPEMessageIncCallForwToC,
+        EPEMessageOutCallForwToC,
+        EPEMessageForwardUnconditionalModeActive,
+        EPEMessageForwardConditionallyModeActive,
+        EPEMessageDroppedConferenceMember,
+        EPEMessageGoingOneToOne,
+        EPEMessageRemoteCreatedConference,
+        EPEMessageRemoteHeld,
+        EPEMessageRemoteResumed,
+        EPEMessageTempClirSuppressUnsuccessful,
+        EPEMessageTempClirActivationUnsuccessful,
+        EPEMessageShowIncCallGroupIndex,
+        EPEMessageDataPortLoaned,
+        // Contact messages                       11400 - 11599
+
+        // Error messages                         11600 - 11799
+
+        // VoIP service messages                       11800 - 12999
+        EPEMessageServiceEnabled               = KPEMessagesFromPhoneEngineGsmFirst + 800,
+        EPEMessageServiceEnabling,
+        EPEMessageNoService,
+        EPEMessageServiceDisabled,
+
+        // Parser messages                        12000 - 12199
+        EPEMessageIssuedSSRequest               = KPEMessagesFromPhoneEngineGsmFirst + 1000,
+        EPEMessageIssuingSSRequest,
+
+        // Security messages                      12200 - 12399
+        EPEMessageSecureNotSpecified,
+
+        // Settings and Shared Data messages      12400 - 12599
+        EPEMessageAlsStatusChanged              = KPEMessagesFromPhoneEngineGsmFirst + 1400,
+        EPEMessageBarringNotification,
+        EPEMessageClipStatusNotification,
+        EPEMessageClirStatusNotification,
+        EPEMessageCnapStatusNotification,
+        EPEMessageColpStatusNotification,
+        EPEMessageColrStatusNotification,
+        EPEMessageForwardingNotification,
+        EPEMessageVmbxNumberLine1Changed,
+        EPEMessageVmbxNumberLine2Changed,
+        EPEMessageWaitingNotification,
+
+
+        // Miscellaneous messages                 12600 - 12799
+
+        // Last                                   12999
+        // Exposing this allows the compiler to detect the overlapping enumerations.
+        EPEMessageLastVariantItem               = KPEMessagesFromPhoneEngineGsmLast
+        };
+        
+        /**
+        * HandleError
+        * Phone Application implements this callback method to provide a framework
+        * for proceeding in an error condition.
+        * @param aErrorInfo is the call id number.
+        */
+        virtual void HandleError( const TPEErrorInfo& aErrorInfo ) = 0;
+
+        /**
+        * HandleMessage
+        * Phone Application implements this callback method to provide a response
+        * for an event message sent by the Phone Engine.
+        * @param aMessage specifies the event that has taken place
+        * @param aCallId is the call id number.
+        */
+        virtual void HandleMessage( const TInt aMessage, const TInt aCallId ) = 0;
+        
+    }; // MEngineMonitor
+
+
+// Maximum number of the conference members.
+const TInt KPEMaximumNumberOfConferenceMembers = 5;
+// Maximum number of voice calls
+const TInt KPEMaximumNumberOfVoiceCalls = 8; // Phone engine user can change this value if needed.
+// Maximum number of data calls
+const TInt KPEMaximumNumberOfDataCalls = 2; 
+// Maximum number of conference calls
+const TInt KPEMaximumNumberOfConferenceCalls = 1;    
+// Maximum number of all calls
+const TInt KPEMaximumNumberOfCalls = KPEMaximumNumberOfVoiceCalls + 
+    KPEMaximumNumberOfDataCalls + KPEMaximumNumberOfConferenceCalls;
+
+// Emergency CallId
+const TInt KPEEmergencyCallId = KPEMaximumNumberOfVoiceCalls - 1;
+// Conference Call ID
+const TInt KPEConferenceCallID = KPEMaximumNumberOfVoiceCalls;
+
+// Invalid call index, note not the same as call id
+const TInt KPEInvalidCallIndex = -1;
+// These two are needed in TPECallInfo's conference field
+// Indicates, that this is Conference Master
+const TInt KPEConferenceMaster = -1;
+// Indicates, that this is Normal voice call
+const TInt KPENormalVoiceCall = -2;
+
+// All MMI Service Codes are defined in standard 3GPP TS 02.30 V7.1.1, Annex C.
+// MMI Service Codes: No service code was specified
+_LIT( KPENoServiceCode, "" );
+// MMI Service Codes: All teleservices
+_LIT( KPEAllTeleservices, "10" );
+// MMI Service Codes: Voice teleservices
+_LIT( KPETelephony, "11" );
+// MMI Service Codes: All Data Services
+_LIT( KPEAllDataServices, "12" );
+// MMI Service Codes: Fax Services
+_LIT( KPEFacsimileServices, "13" );
+// MMI Service Codes: SMS Services
+_LIT( KPEShortMessageServices, "16" );
+// MMI Service Codes: Voice Group Call Service
+_LIT( KPEVoiceGroupCallService, "17" );
+// MMI Service Codes: Voice Broadcast Service
+_LIT( KPEVoiceBroadcastService, "18" );
+// MMI Service Codes: All teleservices except SMS
+_LIT( KPEAllTeleservicesExceptSMS, "19" );
+// MMI Service Codes: All Bearer Service
+_LIT( KPEAllBearerServices, "20" );
+// MMI Service Codes: All Async Services
+_LIT( KPEAllAsyncServices, "21" );
+// MMI Service Codes: All Sync Services
+_LIT( KPEAllSyncServices, "22" );
+// MMI Service Codes: All Data Circuit Sync
+_LIT( KPEAllDataCircuitSync, "24" );
+// MMI Service Codes: All Data Circuit Async
+_LIT( KPEAllDataCircuitAsync, "25" );
+// MMI Service Codes: All Dedicated Packet Access
+_LIT( KPEAllDedicatedPacketAccess, "26" );
+// MMI Service Codes: All Dedicated Pad Access
+_LIT( KPEAllDedicatedPadAccess, "27" );
+// MMI Service Codes: All Gprs Beares Services
+_LIT( KPEAllGprsBearerServices, "99" );
+// MMI Service Codess: PLMN specific teleservices
+_LIT( KPEAllPlmnSpecificTeleservices, "50" );
+_LIT( KPEPlmnSpecificTeleservice1, "51" );
+_LIT( KPEPlmnSpecificTeleservice2, "52" );
+_LIT( KPEPlmnSpecificTeleservice3, "53" );
+_LIT( KPEPlmnSpecificTeleservice4, "54" );
+_LIT( KPEPlmnSpecificTeleservice5, "55" );
+_LIT( KPEPlmnSpecificTeleservice6, "56" );
+_LIT( KPEPlmnSpecificTeleservice7, "57" );
+_LIT( KPEPlmnSpecificTeleservice8, "58" );
+_LIT( KPEPlmnSpecificTeleservice9, "59" );
+_LIT( KPEPlmnSpecificTeleservice10, "60" );
+_LIT( KPEPlmnSpecificTeleservice11, "61" );
+_LIT( KPEPlmnSpecificTeleservice12, "62" );
+_LIT( KPEPlmnSpecificTeleservice13, "63" );
+_LIT( KPEPlmnSpecificTeleservice14, "64" );
+_LIT( KPEPlmnSpecificTeleservice15, "65" );
+// MMI Service Codess: PLMN specific bearer services
+_LIT( KPEAllPlmnSpecificBearerServices, "70" );
+_LIT( KPEPlmnSpecificBearerService1, "71" );
+_LIT( KPEPlmnSpecificBearerService2, "72" );
+_LIT( KPEPlmnSpecificBearerService3, "73" );
+_LIT( KPEPlmnSpecificBearerService4, "74" );
+_LIT( KPEPlmnSpecificBearerService5, "75" );
+_LIT( KPEPlmnSpecificBearerService6, "76" );
+_LIT( KPEPlmnSpecificBearerService7, "77" );
+_LIT( KPEPlmnSpecificBearerService8, "78" );
+_LIT( KPEPlmnSpecificBearerService9, "79" );
+_LIT( KPEPlmnSpecificBearerService10, "80" );
+_LIT( KPEPlmnSpecificBearerService11, "81" );
+_LIT( KPEPlmnSpecificBearerService12, "82" );
+_LIT( KPEPlmnSpecificBearerService13, "83" );
+_LIT( KPEPlmnSpecificBearerService14, "84" );
+_LIT( KPEPlmnSpecificBearerService15, "85" );
+// ALS
+_LIT( KPEAuxVoiceService, "89" );
+
+//Fax Modem UI application UID
+const TInt KPEFaxModemUIUid = 0x1000594E;
+// TPESimState fisrt value
+const TInt KPEStartupEnumerationFirstValue = 100;
+
+// Indicates that dtmf sending is possible with this call. 
+const TUint KPECapsDtmf = 0x00080000;
+
+// SIM states
+enum TPESimState
+    {
+    EPESimStatusUninitialized = KPEStartupEnumerationFirstValue,
+    EPESimUsable,       // The Sim card is fully usable.    
+    EPESimReadable,     // The SIM card is not fully usable, but the emergency number can be read.
+    EPESimNotReady,     // The Sim card is present but not ready or usable.
+    EPESimNotPresent,   // The Sim card is not present.
+    EPESimNotSupported  // SIM/RUIM is not supported. Some CDMA phones do not support a SIM/RUIM at all.
+    };
+    
+// Supplementary Services action type
+enum TPESSAction
+    {
+    EPESSActionUnspecified = 0,
+    EPESSActivation,
+    EPESSDeactivation,
+    EPESSInterrogation,
+    EPESSRegistration,
+    EPESSErasure,
+    EPEPasswordOperation
+    };
+
+// Supplementary Services type
+enum TPESSType
+    {
+    EPESSTypeUnspecified = 0,
+    EPECallForwardingNotReachable,
+    EPECallForwardingNoReply,
+    EPECallForwardingBusy,
+    EPECallForwardingUnconditional,
+    EPECallForwardingAll,
+    EPECallForwardingAllConditional,
+    EPECallBarringAllOutgoing,
+    EPECallBarringAllOutgoingInternational,
+    EPECallBarringAllOutgoingInternationalExcHome,
+    EPECallBarringAllIncoming,
+    EPECallBarringAllIncomingWhenRoaming,
+    EPECallBarringAllServices,
+    EPECallBarringAllOutgoingServices,
+    EPECallBarringAllIncomingServices,
+    EPECallBarringPassword,
+    EPECallWaiting,
+    EPEClip,
+    EPEClir,
+    EPECnap,
+    EPEColp,
+    EPEColr,
+    EPEEmlpp,
+    EPEMsp,
+    EPESpnp,
+    EPEPin,
+    EPEUnblockPin,
+    EPESimLock
+    };
+
+//Forwarded information definition
+NONSHARABLE_STRUCT( TPEForwardedInfo )
+    {
+    RMobilePhone::TMobilePhoneCFCondition iCondition;
+    RMobilePhone::TMobileService iServiceGroup;
+    RMobilePhone::TMobilePhoneCFStatus iStatus; 
+    TPEPhoneNumber iPhoneNumber;
+    TInt iTimeout;
+    };
+
+// Forwarding information definition
+NONSHARABLE_STRUCT( TPEForwardingInfo )
+    {
+    TInt iGroupCount;
+    TFixedArray<TPEForwardedInfo, KPEMaxServiceGroup> iForwardedInfo;
+    };
+
+NONSHARABLE_STRUCT( TPEActiveForwardInfo )
+    {
+    RMobilePhone::TMobilePhoneCFActive iActiveType;
+    RMobilePhone::TMobileService  iServiceGroup;
+    };
+
+//Wait information definition
+NONSHARABLE_STRUCT( TPEWaitInfo )
+    {
+    RMobilePhone::TMobileService iServiceGroup;
+    RMobilePhone::TMobilePhoneCWStatus iStatus; 
+    };
+
+// Waiting information definition
+NONSHARABLE_STRUCT( TPEWaitingInfo )
+    {
+    TInt iGroupCount;
+    TFixedArray<TPEWaitInfo, KPEMaxServiceGroup> iWaitInfo;
+    };
+
+//Barred information definition
+NONSHARABLE_STRUCT( TPEBarredInfo )
+    {
+    RMobilePhone::TMobilePhoneCBCondition iCondition;
+    RMobilePhone::TMobileService iServiceGroup;
+    RMobilePhone::TMobilePhoneCBStatus iStatus; 
+    };
+
+// Barring information definition
+NONSHARABLE_STRUCT( TPEBarringInfo )
+    {
+    TInt iGroupCount;
+    TFixedArray<TPEBarredInfo, KPEMaxServiceGroup> iBarredInfo;
+    };
+
+// Contains information of the Suplementary Services command.
+NONSHARABLE_STRUCT( TPESSCommandInfo )                   // For SS Commands.
+    {
+    TPESSAction action;     // SS Action
+    /*RMobilePhone::TMobileService*/ TInt group;       // MMI Service Code
+    TPESSType type;         // Supplementary Services type
+    };
+
+NONSHARABLE_STRUCT( TPEConferenceMemberInfo )
+    {
+    TName iConferenceMemberName;
+    TInt iConferenceMemberId;
+    };
+
+/**
+ *  Offers message interface from phone application to phone engine.
+ *
+ *  ?more_complete_description
+ *
+ *  @lib phoneengine
+ *  @since S60 v4.0 
+ */
+NONSHARABLE_CLASS( MPEPhoneModel ) 
+    {
+public:
+
+    typedef TInt TPEMessagesToPhoneEngine;
+
+    enum
+        {
+        // Audio messages                     1000 - 1999
+        EPEMessageSetAudioMute              = 1000,
+        EPEMessageSetAudioVolume,
+        EPEMessageSetAudioOutput,
+
+        // Call messages                      2000 - 2999
+        EPEMessageAnswer                    = 2000,
+        EPEMessageClientDial,
+        EPEMessageContinueDTMFSending,
+        EPEMessageDial,
+        EPEMessagePlayDTMF,
+        EPEMessageEndDTMF,
+        EPEMessagePhoneNumberEdited,
+        EPEMessageRelease,
+        EPEMessageReleaseAll,
+        EPEMessageReject,
+        EPEMessageSendDTMF,
+        EPEMessageStopDTMFSending,
+        EPEMessageStopTonePlay,
+        EPEMessageAutomaticAnswerOff,       //UI sends when soft reject is needed
+        EPEMessageTerminateAllConnections,
+        EPEMessageSetSwitchToCallFlag,
+        EPEMessageSwitchToVideoOrVoice,
+        EPEMessageSatCallRequestCompleted,
+        EPEMessageClientDialEmergency,
+        EPEMessageReplaceActive,
+        EPEMessageContinueEmergencyCallInitialization,
+        EPEMessageAcceptUnattendedTransfer,
+        EPEMessageRejectUnattendedTransfer,
+
+        EPEMessageDoUnattendedTransfer,
+        EPEMessageForwardCallToAddress,
+        EPEMessageDialServiceCall,
+        // Contact messages                   3000 - 3999
+
+        // Error messages                     4000 - 4999
+
+        // Network messages                   5000 - 5999
+
+        // Parser messages                    6000 - 6999
+
+        // Security messages                  7000 - 7999
+
+        // Service messages                   8000 - 8999
+        EPEMessageDisableService            = 8000,
+
+        // Startup messages                   9000 - 9999
+        EPEMessagePEConstructionReady       = 9000,
+
+        // Miscellaneous messages             10000 - 10999
+        EPEMessageCheckEmergencyNumber      = 10000 // Request engine to check is entered number emergency.
+
+        // Variant messages                   11000 - 12999
+        // From KPEMessagesToPhoneEngineGsmFirst
+        // to KPEMessagesToPhoneEngineGsmLast
+        };
+
+     virtual ~MPEPhoneModel() {};
+
+    /**
+     * Returns pointer to information object (CPEEngineInfo) 
+     *
+     * @since S60 v4.0
+     * @return Return pointer to CPEEngineInfo object
+     */
+     virtual MPEEngineInfo* EngineInfo() = 0;
+     
+    /**
+     * Reroutes messages from the phone application to the message handler
+     *
+     * @since S60 v4.0
+     * @param aMessage is the message code
+     */
+     virtual void HandleMessage( const TInt aMessage ) = 0;
+     
+    /**
+     * Returns the name of the specified message to PhoneEngine
+     *
+     * @since S60 v4.0
+     * @param aMessage is the message code
+     * @return String containing the name of the message
+     */
+     virtual TPtrC NameByMessageToPhoneEngine( const TInt aMessage ) const = 0;
+
+    /**
+     * Returns the name of the specified message from PhoneEngine
+     *
+     * @param aMessage is the message code
+     * @return String containing the name of the message
+     */
+     virtual TPtrC NameByMessageFromPhoneEngine( const TInt aMessage ) const = 0;
+     
+    }; // MPEPhoneModel 
+
+/**
+* Utility class for call id.
+*
+*  @lib PhoneEngine.lib
+*/
+NONSHARABLE_CLASS( CallIdCheck )
+    {
+    public:
+        static inline TBool IsValid( TInt aCallId ) 
+            {
+            return aCallId >= 0 && aCallId < KPEMaximumNumberOfCalls;
+            }
+        static inline TBool IsVoice( TInt aCallId )
+            {
+            return aCallId >= 0 && aCallId < KPEMaximumNumberOfVoiceCalls;
+            }
+        static inline TBool IsConference( TInt aCallId )
+            {
+            return aCallId >= KPEMaximumNumberOfVoiceCalls && 
+                   aCallId < ( KPEMaximumNumberOfVoiceCalls + KPEMaximumNumberOfConferenceCalls );
+            }
+        static inline TBool IsVideo( TInt aCallId )
+            {
+            return aCallId >= ( KPEMaximumNumberOfVoiceCalls + KPEMaximumNumberOfConferenceCalls ) 
+                && aCallId < ( KPEMaximumNumberOfVoiceCalls + KPEMaximumNumberOfConferenceCalls + 
+                KPEMaximumNumberOfDataCalls );
+            }            
+    };
+
+#endif // PEVIRTUALENGINE_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/qtphonelog.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* 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:  Provides macros for logging
+*
+*/
+
+
+
+#ifndef __QTPHONELOG_H__
+#define __QTPHONELOG_H__
+
+//  INCLUDES
+#include <e32def.h>
+#include <QDebug>
+
+// Q_FUNC_INFO does not print function signature in Symbian..
+
+#ifdef _DEBUG
+#define PHONE_DEBUG(A)                   qDebug() <<A;
+#define PHONE_DEBUG2(A, B)               qDebug() <<A <<B
+#define PHONE_DEBUG3(A, B, C)            qDebug() <<A <<B <<C
+#define PHONE_DEBUG4(A, B, C, D)         qDebug() <<A <<B <<C <<D
+
+#define PHONE_TRACE                      qDebug() <<__PRETTY_FUNCTION__;
+#define PHONE_TRACE1(A)                  qDebug() <<__PRETTY_FUNCTION__ <<A;
+#define PHONE_TRACE2(A, B)               qDebug() <<__PRETTY_FUNCTION__ <<A <<B
+#define PHONE_TRACE3(A, B, C)            qDebug() <<__PRETTY_FUNCTION__ <<A <<B <<C
+#define PHONE_TRACE4(A, B, C, D)         qDebug() <<__PRETTY_FUNCTION__ <<A <<B <<C <<D
+#else
+#define PHONE_DEBUG(A)
+#define PHONE_DEBUG2(A, B)
+#define PHONE_DEBUG3(A, B, C)
+#define PHONE_DEBUG4(A, B, C, D)
+
+#define PHONE_TRACE
+#define PHONE_TRACE1(A)
+#define PHONE_TRACE2(A, B)
+#define PHONE_TRACE3(A, B, C)
+#define PHONE_TRACE4(A, B, C, D)
+#endif
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/talogger.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,223 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Provides macros for logging
+*
+*/
+
+
+
+#ifndef __TALOGGER_H__
+#define __TALOGGER_H__
+
+//  INCLUDES
+#include <e32def.h>
+
+/* 
+-----------------------------------------------------------------------------
+
+    USER LOG SELECTION
+
+-----------------------------------------------------------------------------
+*/
+
+inline TUint KTALOGMASK()
+    {
+    return 0x8fffffff;          // This is default mask value.    
+    }                           // User can change mask value to get different king of logging.
+
+#ifndef _DEBUG
+
+/***************************
+* Logging method variants:
+* 0 = No logging
+* 1 = Flogger
+* 2 = RDebug
+***************************/ 
+
+#define TEF_LOGGING_METHOD      0   // UREL BUILD
+
+#else
+
+#ifdef __WINS__
+#define TEF_LOGGING_METHOD      2   // UDEB BUILD, WINS
+#else
+#define TEF_LOGGING_METHOD      2   // UDEB BUILD, HW
+#endif // __WINS__
+
+#endif // _DEBUG
+
+
+// Next is for backward compatibility
+#if TEF_LOGGING_METHOD > 0
+#define TEF_LOGGING_ENABLED     
+#define TF_LOGGING_ENABLED
+#endif
+
+
+/* 
+-----------------------------------------------------------------------------
+
+    LOGGING OPTIONS
+
+-----------------------------------------------------------------------------
+*/
+
+#define KTAOBJECT  0x00000001   // Construction and destruction
+
+#define KTAERROR   0x00000002   // Error that can be handled. Describe reason for error situation.
+#define KTAPANIC   0x00000004   // Critical error: Panic.
+
+#define KTAMESIN   0x00000008   // From client to TELE message
+#define KTAMESOUT  0x00000010   // From TELE to client message
+#define KTAMESINT  0x00000020   // TELE internal message
+
+#define KTAREQIN   0x00000040   // Public interface methods
+#define KTAREQOUT  0x00000080   // Set outgoing request
+#define KTAREQEND  0x00000100   // Complete request
+
+#define KTAINT     0x00000200   // Internal activity
+
+#define KTAMSTATE  0x00000400   // Component state changes
+
+#define KTAGENERAL 0x00000800   // For deprecated TFLOGxxx-macros and for temporary usage
+
+
+/* 
+-----------------------------------------------------------------------------
+
+    LOG SETTINGS
+
+-----------------------------------------------------------------------------
+*/
+
+#if TEF_LOGGING_METHOD == 1      // Flogger
+
+#include <flogger.h>
+_LIT(KTfLogFolder,"PE");
+_LIT(KTfLogFile,"TALOG.TXT");
+
+#elif TEF_LOGGING_METHOD == 2    // RDebug
+
+#include <e32svr.h>
+
+#endif
+
+
+/*
+-----------------------------------------------------------------------------
+
+    LOGGING MACROs
+
+    USE THESE MACROS IN YOUR CODE !
+
+-----------------------------------------------------------------------------
+*/
+#define MESSAGE(A)                        _L(A)
+
+#if TEF_LOGGING_METHOD == 1      // Flogger
+
+#define TEFLOGTEXT(Type,AAA)            { \
+                                        if((KTALOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            RFileLogger::Write(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend, AAA); \
+                                            } \
+                                        }
+#define TEFLOGSTRING(Type,AAA)          { \
+                                        if((KTALOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            _LIT(tempLogDes,AAA); \
+                                            RFileLogger::Write(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend,tempLogDes()); \
+                                            } \
+                                        }
+#define TEFLOGSTRING2(Type,AAA,BBB)     { \
+                                        if((KTALOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            _LIT(tempLogDes,AAA); \
+                                            RFileLogger::WriteFormat(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend, \
+                                            TRefByValue<const TDesC>(tempLogDes()),BBB); \
+                                            } \
+                                        }
+#define TEFLOGSTRING3(Type,AAA,BBB,CCC) { \
+                                        if((KTALOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            _LIT(tempLogDes,AAA); \
+                                            RFileLogger::WriteFormat(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend, \
+                                            TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); \
+                                            } \
+                                        }
+#define TEFLOGSTRING4(Type,AAA,BBB,CCC,DDD) { \
+                                            if((KTALOGMASK()&(Type))==(Type)) \
+                                                { \
+                                                _LIT(tempLogDes,AAA); \
+                                                RFileLogger::WriteFormat(KTfLogFolder(), \
+                                                KTfLogFile(),EFileLoggingModeAppend, \
+                                                TRefByValue<const TDesC>(tempLogDes()), \
+                                                BBB,CCC,DDD); \
+                                                } \
+                                            }
+
+#elif TEF_LOGGING_METHOD == 2    // RDebug
+
+#define TEFLOGTEXT(Type,AAA)                { \
+                                            if((KTALOGMASK()&(Type))==(Type)) RDebug::Print(AAA); \
+                                            }
+#define TEFLOGSTRING(Type,AAA)              { \
+                                            if((KTALOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA)); \
+                                            }
+#define TEFLOGSTRING2(Type,AAA,BBB)         { \
+                                            if((KTALOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA),BBB); \
+                                            }
+#define TEFLOGSTRING3(Type,AAA,BBB,CCC)     { \
+                                            if((KTALOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA),BBB,CCC); \
+                                            }
+#define TEFLOGSTRING4(Type,AAA,BBB,CCC,DDD) { \
+                                            if((KTALOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA),BBB,CCC,DDD); \
+                                            }
+
+#else   // TEF_LOGGING_METHOD == 0 or invalid
+
+#define TEFLOGTEXT(Type,AAA)              // Example: TFLOGTEXT(KTAMESOUT, own_desc)
+#define TEFLOGSTRING(Type,AAA)            // Example: TFLOGSTRING(KTAMESIN, "Test")
+#define TEFLOGSTRING2(Type,AAA,BBB)       // Example: TFLOGSTRING(KTAMESINT, "Test %i", aValue)
+#define TEFLOGSTRING3(Type,AAA,BBB,CCC)   // Example: TFLOGSTRING(KTAMESOUT, "Test %i %i", aValue1, aValue2)
+#define TEFLOGSTRING4(Type,AAA,BBB,CCC,DDD)   // Example: TFLOGSTRING(KTAMESOUT, "Test %i %i %i", aValue1, aValue2, aValue3)
+
+#endif  // TEF_LOGGING_METHOD
+
+
+/*
+-----------------------------------------------------------------------------
+
+    DEPRECATED LOGGING MACROs
+
+    DON'T USE THESE MACROS IN YOUR CODE ANYMORE!
+
+-----------------------------------------------------------------------------
+*/
+
+#define TFLOGTEXT(AAA)              TEFLOGTEXT(KTAGENERAL,AAA);
+#define TFLOGSTRING(AAA)            TEFLOGSTRING(KTAGENERAL,AAA);
+#define TFLOGSTRING2(AAA,BBB)       TEFLOGSTRING2(KTAGENERAL,AAA,BBB);
+#define TFLOGSTRING3(AAA,BBB,CCC)   TEFLOGSTRING3(KTAGENERAL,AAA,BBB,CCC);
+#define TFLOGSTRING4(AAA,BBB,CCC,DDD)   TEFLOGSTRING4(KTAGENERAL,AAA,BBB,CCC,DDD);
+
+#endif  // TALOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/telephonyvariant.hrh	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  The file contains values for shared data keys specifying
+*       telephony specific software settings. 
+*
+*
+*/
+
+
+#ifndef TELEPHONYVARIANT_HRH
+#define TELEPHONYVARIANT_HRH
+
+/** 
+* KTelephonyLVFlagCLIName is on/off setting for 3 line calling feature.
+* When it is set on in KTelephonyConfigFlags 3 line calling is enabled
+* (both number and name are shown in call bubble).
+*/
+#define KTelephonyLVFlagCLIName 0x00000002
+
+/**
+* Keypad cover hides Send and End key 
+* If set, softkeys are updated to handle call 
+* @since Series 60 3.1
+*/
+#define KTelephonyLVFlagCoverHideSendEndKey 0x00000004
+
+/** 
+* KTelephonyLVFlagScrollSoftKeys defines status of scroll softkeys. When the 
+* flag is set on in KTelephonyConfigFlags scroll softkeys are enabled. 
+*/
+#define KTelephonyLVFlagScrollSoftKeys 0x00000010
+
+/**
+* KTelephonyLVFlagScrollVolumeKeys defines if up/down scroll keys are used to 
+* adjust volume. 
+* 
+* When the flag is turned on scroll keys up/down are used to change volume. 
+* If flag is disabled scroll key do not adjust volume but if KFeatureIdSideVolumeKeys 
+* is disabled then scroll keys affects to volume.
+*/
+#define KTelephonyLVFlagScrollVolumeKeys 0x00000020
+
+/**
+* KTelephonyLVFlagAdvancedGPRS defines if advanced GPRS termination
+* functionality is enabled. The Connection Utility ECom component
+* encapsulates the functionality and it must be present in ROM.
+*
+* When the flag is set, the CCoUtlInterface class is used to
+* terminate GPRS connections. Otherwise, simpler GPRS termination
+* provided by Phone Engine is applied.
+*/
+#define KTelephonyLVFlagAdvancedGPRS 0x00000040
+
+/**
+* KTelephonyLVFlagSwivelInDevice defines if the device has a
+* swivel mechanism.
+*
+* When the flag is set, a special handler class is created. This
+* class is presented in phoneuis/TelephonyDeviceMode/CTelDMSwivelHandler.h.
+* The implementation is used to capture open and close events for the
+* swivel mechanism and it can be used to answer or hangup calls depending
+* on used settings.
+*/
+#define KTelephonyLVFlagSwivelInDevice 0x00000080
+
+/**
+* KTelephonyLVFlagThreeLineBubbles defines if three lines in-call bubble 
+* is enabled. 
+* When the flag is set, three lines in-call bubble feature is enabled.
+*/
+#define KTelephonyLVFlagThreeLineBubbles 0x00000100 
+
+/**
+* KTelephonyLVFlagAdvancedENCheck defines if advanced emergency number check
+* is enabled. 
+* When the flag is set, the advanced emergency number check feature is enabled.
+* @since Series 60 2.6
+*/
+#define KTelephonyLVFlagAdvancedENCheck 0x00000200
+
+/**
+* KTelephonyLVFlagDisableCallControlHardKeysWhileLocked 
+*/
+#define KTelephonyLVFlagDisableCallControlHardKeysWhileLocked 0x00000400 
+
+/**
+* KTelephonyLVFlagUssdTone defines if the USSD tone play functionality is 
+* enabled.
+* When the flag is set, tone is played when USSD message is received. 
+* @since Series 60 2.6
+*/
+#define KTelephonyLVFlagUssdTone 0x00000800
+
+
+/**
+* KTelephonyLVFlagArbitraryVideoScaling defines if video player
+* implementation in the device support arbitrary scaling.
+* When the flag is set, arbitrary scaling is applied.
+* @since Series 60 3.1
+*/
+#define KTelephonyLVFlagArbitraryVideoScaling 0x00001000
+
+/**
+* KTelephonyLVFlagAllowUnlockOnIncoming 
+*/
+#define KTelephonyLVFlagAllowUnlockOnIncoming 0x00002000 
+
+/**
+* KTelephonyLVFlagMannerMode defines if the manner mode is enabled.
+* When the flag is set, long press on hash key toggles silent on/off
+* @since Series 60 2.8
+*/
+#define KTelephonyLVFlagMannerMode 0x00004000
+
+/**
+* KTelephonyLVFlagUUS defines if UUS feature is enabled
+* When the flag is set, bubble will show Skype ID if available.
+* @since Series 60 3.2
+*/
+#define KTelephonyLVFlagUUS 0x00008000
+
+/**
+* KTelephonyLVFlagCloseApplications defines if applications should
+* be closed when End key is pressed.
+* When the flag is set, foreground application is closed when End key
+* is pressed.
+* @since Series 60 2.6
+*/
+#define KTelephonyLVFlagCloseApplications 0x00040000
+
+/**
+* InCall menu options modifications
+* If set, option "Replace" is changed to "Answer"
+* in incall_active_held_waiting state
+* @since Series 60 5.0
+*/
+#define KTelephonyLVFlagOptionsChange 0x00400000
+
+/**
+* Ussd ( service command ) shows number of remaining characters 
+* Requirement RM-RIM TOOL ID 107-8820 
+* @since Series 60 3.0
+*/
+#define KTelephonyLVFlagUssdUIRemainingChars 0x10000000
+
+#endif // TELEPHONYVARIANT_HRH
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/telinternalcrkeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony internal Central Repository keys
+*
+*/
+
+
+#ifndef TELINTERNALCRKEYS_H
+#define TELINTERNALCRKEYS_H
+
+#include <e32std.h>
+
+/******************************************************************************
+* Telephony Variation API
+* Keys under this category are used in defining telephony variation.
+******************************************************************************/
+const TUid KCRUidTelVariation = {0x102828F8};
+
+/**
+* Telephony Local Variation Flags. Values are defined in TelephonyVariant.hrh.
+*/
+const TUint32 KTelVariationFlags                            = 0x00000001;
+
+/**
+* Contains a space separated list of product specific contact stores.
+* Can be empty, contain 1 or more stores.
+* Varies in different product variants.
+* Exact match search strategy is applied to the additional stores, if match 
+* is not found from additional stores default stores are checked.
+*/
+const TUint32 KTelAdditionalStores                          = 0x00000002;
+
+/**
+* Timeout of VoIP service enabling 
+* if enabling time is longer than this value,
+* cancel the enabling
+*/
+const TUint32 KTelEnableTimeOut                            = 0x00000003;
+
+
+#endif      // TELEPHONYINTERNALCRKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/telinternalpskeys.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Telephony internal Publish and Subscribe keys.
+*
+*/
+
+
+#ifndef TELINTERNALPSKEYS_H
+#define TELINTERNALPSKEYS_H
+
+#include <e32std.h>
+#include <telcommsinfopskeys.h>
+
+// CONSTANTS
+
+/*****************************************************************************
+* Telephony Internal Information API UID 
+*****************************************************************************/
+
+const TUid KPSUidTelInternalInformation = {0x102029A3}; 
+
+/**
+* Used between Telephony and Telephony service engine.
+* The telephony does a contact match and provides it to TSE.
+* It contain an information on remote party contact info.
+* NOTE: Key to be removed in Taco release
+* @see TTelRemotePartyContactInfo in TelephonyInternalPSTypes.h
+* @type RProperty::EByteArray
+*/
+const TUint32 KTelRemotePartyContactInfo = 0x00000001;
+
+/**
+* Identifier of Video Telephone application.
+* This key has two special values, see TPSTelVTAppState.
+* 
+* @type RProperty::EInt
+*/
+const TUint32 KTelVideoCallUid = 0x00000002;
+enum TPSTelVTAppState
+    {
+    // Video Telephone was on background when call ended, no need
+    // to set Phone/Idle on foreground.
+    EPSTelVTAppStateBackground = -1,
+    // Video Telephone
+    EPSTelVTAppStateNone = 0
+    };
+
+/*****************************************************************************
+* Telephony Audio Preference API UID 
+*****************************************************************************/
+const TUid KPSUidTelAudioPreference = {0x102029A4};
+    
+/**
+* Indicates the in call audio routing
+* preference to the phone (public/private)
+* This key has two special values, see EPSTelAudioOutput.
+* 
+* @type RProperty::EInt
+*/          
+const TUint32 KTelAudioOutput = 0x00000001;
+enum EPSTelAudioOutput
+    {
+    EPSAudioPrivate = 0,
+    EPSAudioPublic    
+    };    
+
+/******************************************************************************
+* Number entry Information API UID 
+******************************************************************************/
+const TUid KPSUidNEInformation = {0x102029A5};
+
+/**
+* Indication to Idle that whether number entry
+* is open in phone or not
+* NOTE:  deprecated in taco
+*/
+const TUint32 KTelNumberEntryInfo = 0x00000001; 
+enum TPSTelNumberEntryInfo 
+    {
+    EPSTelNumberEntryClosed = 0,
+    EPSTelNumberEntryOpen    
+    };
+
+/*****************************************************************************
+* Telephony Generic Command API
+* This can be used for requesting simple services from
+* other process/application when it is inconvenient to implement
+* client/server or similar complex pattern.
+*****************************************************************************/
+const TUid KPSUidTelGenericCommand = {0x102029A7};
+
+/*
+* Command operation values that should be used with keys in 
+* Telephony Generic Command API. Client entity sets value
+* to EPSTelGenCmdPerform. Service provider sets value 
+* back to EPSTelGenCmdReset when command was succesfully 
+* completed. In case of failure it may set it to EPSTelGenCmdFail
+* to indicate error to requester.
+* 
+*/
+enum {
+    // Values to be set by service provider.
+    EPSTelGenCmdFail = -1,
+    EPSTelGenCmdReset,    
+    
+    // Client uses this value to request a service.
+    EPSTelGenCmdPerform
+    };
+
+/**
+* Command key for launching Log application.
+* @type RProperty::EInt
+*/
+const TUint32 KTelGenCmdLaunchLogApp = 0x00000001;
+
+#endif      // TELINTERNALPSKEYS_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/telinternalpstypes.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Data types passed through Publish and Subscribe
+*
+*/
+
+
+#ifndef TELINTERNALPSTYPES_H
+#define TELINTERNALPSTYPES_H
+
+// INCLUDES
+#include <cntdef.h>
+
+// CONSTANTS
+
+
+// DATA TYPES
+typedef TUint8 TCallId;
+
+/**
+* Contact information of the remote party
+* Note: Size of the data must not exceed RProperty::KMaxPropertySize.
+*/
+struct TTelRemotePartyContactInfo
+    {
+    /**
+    * Type of remote address
+    */
+    enum TCLIAddressType
+        {
+        ENotSet,
+        EHome,
+        EMobile,
+        EWork,
+        EPhone,
+        EFaxNumber,
+        EPager,
+        EVideo,
+        ESIP,
+        EEmergency
+        };
+
+    // call identity
+    TCallId                 iCallId;
+
+    // Contact item id
+#ifdef RD_VIRTUAL_PHONEBOOK
+    // Contact Link packed
+    TBuf8<255>               iPackedLinks;
+#else // RD_VIRTUAL_PHONEBOOK
+    // Contact item id
+    TContactItemId          iContactItemId;
+#endif // RD_VIRTUAL_PHONEBOOK
+
+    // CLI address
+    TPhCltTelephoneNumber   iAddress;
+
+    // Address type
+    TCLIAddressType         iAddressType;
+
+    typedef TPckg<TTelRemotePartyContactInfo> TInfoPckg;
+    };
+
+#endif    // TELINTERNALPSTYPES_H
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/inc/tperemotepartyinfomediatorupdater.h	Fri Jun 04 10:19:18 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:  Updates remote party information via mediator.
+*
+*/
+
+#ifndef TPEREMOTEPARTYINFOMEDIATORUPDATER_H
+#define TPEREMOTEPARTYINFOMEDIATORUPDATER_H
+
+#include <e32std.h>
+#include <MediatorCommandResponder.h>
+#include <callremotepartyinformation.h>
+
+class MPEMediator;
+class MPEDataStore;
+
+/**
+ *  Updates remote party information to mediator
+ *
+ *  @lib phonemodel.lib
+ *  @since S60 5.1
+ */
+NONSHARABLE_CLASS( TPERemotePartyInfoMediatorUpdater ) : public MMediatorCommandObserver
+    {
+public:
+
+    TPERemotePartyInfoMediatorUpdater( 
+        MPEMediator& aMediator,
+        MPEDataStore& iDataStore );
+    
+    /**
+     * Updated remote party information to mediator 
+     */
+    void Update();
+    
+    /**
+    * From base class MMediatorCommandObserver
+    */
+    virtual void MediatorCommandL( TUid aDomain,
+                                   TUid aCategory, 
+                                   TInt aCommandId,
+                                   TVersion aVersion, 
+                                   const TDesC8& aData );
+
+    /**
+     * From base class MMediatorCommandObserver
+     */
+    virtual void CancelMediatorCommand( TUid aDomain,
+                                        TUid aCategory, 
+                                        TInt aCommandId );
+    
+private:
+    
+    /**
+     * Takes all remote party infos and packages infos to descriptor.
+     * 
+     * @return Descriptor containing remote party informations.
+     */
+    HBufC8* TakeSnapshotOfRemotePartyInfosL();    
+    
+    /**
+     * Resolves remote party identity.
+     * 
+     * @return remote party identity.     
+     */
+    MCallRemotePartyInfo::TRemoteIdentityStatus ResolveRemoteIdentity( const TInt aCallId );
+    
+    /**
+     * Converts remote party identity.
+     * 
+     * @return remote party identity.
+     */
+    MCallRemotePartyInfo::TRemoteIdentityStatus ConvertRemoteIdentity( const TInt aCallId );
+
+private: // data
+    
+    // Access to mediator service
+    MPEMediator& iMediator;
+    
+    // Engine info to gather data
+    MPEDataStore& iDataStore;
+
+    };
+
+#endif // TPEREMOTEPARTYINFOMEDIATORUPDATER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/phonemodel.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,189 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 = phoneengine
+
+CONFIG += mobility
+MOBILITY = systeminfo
+QT -= gui
+QT += network
+
+symbian {
+    TARGET.UID3 = 0x1000A86C
+    TARGET.VID = VID_DEFAULT
+    TARGET.CAPABILITY = ALL -TCB
+    
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE  \
+                   $$OS_LAYER_GLIB_SYSTEMINCLUDE
+    INCLUDEPATH += ../../inc \
+                   ../inc \
+                   ../phoneservices/inc \
+                   ../parserrecognizer/inc \
+                   
+    engineDefFiles = \
+        "$${LITERAL_HASH}ifdef WINSCW" \
+        "DEFFILE bwins/phoneengine.def" \
+        "$${LITERAL_HASH}else" \
+        "DEFFILE eabi/phoneengine.def" \
+        "$${LITERAL_HASH}endif"
+    
+    MMP_RULES += engineDefFiles
+
+    LIBS += -lcce \
+            -lAccClient \
+            -lapgrfx \
+            -lapparc \
+            -laudiohandling \
+            -lcallhandling \
+            -lcentralrepository \
+            -lcommonEngine \
+            -lcontacthandling \
+            -lefsrv \
+            -letel \
+            -letelmm \
+            -leuser \
+            -lFeatMgr \
+            -lflogger \
+            -lloghandling \
+            -lphoneparser \
+            -lphonesettings \
+            -lPsui \
+            -lsecui \
+            -lSysUtil \
+            -lws32 \
+            -lPlatformEnv \
+            -lPhoneClient \
+            -lprofileeng \
+            -lbafl \
+            -lcallprovider \
+            -lpeservicehandling \
+            -lphoneservices \
+            -lengineinfo \
+            -lparserrecognizer \
+            -lmediatorclient \
+            -lestor \
+	    -lxqservice \
+            -llibglib
+            
+    TARGET.EPOCALLOWDLLDATA =1
+    
+}
+
+HEADERS += ./inc/cpeaccessorymodemonitor.h
+HEADERS += ./inc/cpeactivestarter.h
+HEADERS += ./inc/cpeaudiooutputpreferencemonitor.h
+HEADERS += ./inc/cpecalldurationdisplaysettingmonitor.h
+HEADERS += ./inc/cpecenrepmonitor.h
+HEADERS += ./inc/cpeclientcallrequestmonitor.h
+HEADERS += ./inc/cpeclientcommandhandlermonitor.h
+HEADERS += ./inc/cpeclientemergencycallmonitor.h
+HEADERS += ./inc/cpeclientservices.h
+HEADERS += ./inc/cpedevicemodehandler.h
+HEADERS += ./inc/cpeexternaldatahandler.h
+HEADERS += ./inc/cpeidlestatusmonitor.h
+HEADERS += ./inc/cpemanualcallcontrolhandler.h
+HEADERS += ./inc/cpemessagehandler.h
+HEADERS += ./inc/cpemessagehandler.inl
+HEADERS += ./inc/cpenetworkregistrationstatusmonitor.h
+HEADERS += ./inc/cpeparseremergencynumberhandler.h
+HEADERS += ./inc/cpeparsermanufacturerhandler.h
+HEADERS += ./inc/cpeparsermischandler.h
+HEADERS += ./inc/cpeparserphonenumberhandler.h
+HEADERS += ./inc/cpeparsersimcontrolhandler.h
+HEADERS += ./inc/cpeparsersscallhandler.h
+HEADERS += ./inc/cpeparsersshandler.h
+HEADERS += ./inc/cpeparservoipnumberhandler.h
+HEADERS += ./inc/cpepcnparserprocedurehandler.h
+HEADERS += ./inc/cpephonemodel.h
+HEADERS += ./inc/cpephonemodelif.h
+HEADERS += ./inc/cpeprofilesettingmonitor.h
+HEADERS += ./inc/cpepubsubmonitor.h
+HEADERS += ./inc/cpesettingscommand.h
+HEADERS += ./inc/cpesimstatemonitor.h
+HEADERS += ./inc/cpetimer.h
+HEADERS += ./inc/mpeactivestarter.h
+HEADERS += ./inc/mpecallcontrolif.h
+HEADERS += ./inc/mpecallsettersif.h
+HEADERS += ./inc/mpeclientcallrequestmonitor.h
+HEADERS += ./inc/mpeexternaldatahandler.h
+HEADERS += ./inc/mpephonemodelinternal.h
+HEADERS += ./inc/mphonedevicemodeobserver.h
+HEADERS += ./inc/pepanic.pan
+HEADERS += ./inc/pevirtualengine.h
+HEADERS += ./inc/talogger.h
+HEADERS += ./inc/telephonyvariant.hrh
+HEADERS += ./inc/telinternalcrkeys.h
+HEADERS += ./inc/telinternalpskeys.h
+HEADERS += ./inc/telinternalpstypes.h
+HEADERS += ./inc/penetworkhandler.h
+
+SOURCES += ./src/cpeaccessorymodemonitor.cpp
+SOURCES += ./src/cpeactivestarter.cpp
+SOURCES += ./src/cpeaudiooutputpreferencemonitor.cpp
+SOURCES += ./src/cpecalldurationdisplaysettingmonitor.cpp
+SOURCES += ./src/cpecenrepmonitor.cpp
+SOURCES += ./src/cpeclientcallrequestmonitor.cpp
+SOURCES += ./src/cpeclientcommandhandlermonitor.cpp
+SOURCES += ./src/cpeclientemergencycallmonitor.cpp
+SOURCES += ./src/cpeclientservices.cpp
+SOURCES += ./src/cpedevicemodehandler.cpp
+SOURCES += ./src/cpeexternaldatahandler.cpp
+SOURCES += ./src/cpemessagehandler.cpp
+SOURCES += ./src/cpenetworkregistrationstatusmonitor.cpp
+SOURCES += ./src/cpeprofilesettingmonitor.cpp
+SOURCES += ./src/cpepubsubmonitor.cpp
+SOURCES += ./src/cpetimer.cpp
+SOURCES += ./src/pepanic.cpp
+SOURCES += ./src/cpemanualcallcontrolhandler.cpp
+SOURCES += ./src/cpeidlestatusmonitor.cpp
+SOURCES += ./src/cpeparsermanufacturerhandler.cpp
+SOURCES += ./src/cpeparsermischandler.cpp
+SOURCES += ./src/cpeparserphonenumberhandler.cpp
+SOURCES += ./src/cpeparsersimcontrolhandler.cpp
+SOURCES += ./src/cpeparsersscallhandler.cpp
+SOURCES += ./src/cpeparsersshandler.cpp
+SOURCES += ./src/cpephonemodel.cpp
+SOURCES += ./src/cpephonemodelif.cpp
+SOURCES += ./src/cpesimstatemonitor.cpp
+SOURCES += ./src/cpepcnparserprocedurehandler.cpp
+SOURCES += ./src/cpeparseremergencynumberhandler.cpp
+SOURCES += ./src/cpeparservoipnumberhandler.cpp
+SOURCES += ./src/phoneengineproxy.cpp
+SOURCES += ./src/cperemotepartyinfomediator.cpp 
+SOURCES += ./src/cperemotepartyinfoproxy.cpp
+SOURCES += ./src/tperemotepartyinfomediatorupdater.cpp
+SOURCES += ./src/penetworkhandler.cpp
+
+include(api_headers.pri)
+    
+headers.sources = $$PHONEENGINE_API_HEADERS
+headers.path = |../../inc
+# This is for new exporting system coming in garden
+for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$headers.path/$$basename(header)"       
+
+BLD_INF_RULES.prj_exports += \
+ "$${LITERAL_HASH}include <platform_paths.hrh>" \
+ "./rom/phonengengine.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(phonengengine.iby)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony.confml APP_LAYER_CONFML(s60telephony.confml)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony_japan.confml CONFML_EXPORT_PATH(s60telephony_japan.confml,japan)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony_101F87E3.crml APP_LAYER_CRML(s60telephony_101F87E3.crml)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony_102828B1.crml APP_LAYER_CRML(s60telephony_102828B1.crml)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony_102828B2.crml APP_LAYER_CRML(s60telephony_102828B2.crml)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony_102828B8.crml APP_LAYER_CRML(s60telephony_102828B8.crml)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony_102828F8.crml APP_LAYER_CRML(s60telephony_102828F8.crml)"
+BLD_INF_RULES.prj_exports += "./conf/s60telephony_102830B6.crml APP_LAYER_CRML(s60telephony_102830B6.crml)"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/rom/phonengengine.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone Engine iby file
+*
+*/
+
+
+#ifndef PHONEENGINE_IBY
+#define PHONEENGINE_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+// Phone Engine
+file=ABI_DIR\BUILD_DIR\phoneengine.dll        SHARED_LIB_DIR\phoneengine.dll
+
+// Engine Info
+file=ABI_DIR\BUILD_DIR\engineinfo.dll        SHARED_LIB_DIR\engineinfo.dll
+
+// Audio Handling
+file=ABI_DIR\BUILD_DIR\audiohandling.dll    SHARED_LIB_DIR\audiohandling.dll
+data=MULTI_LINGUIFY(RSC DATAZ_\RESOURCE_FILES_DIR\defaultbeep RESOURCE_FILES_DIR\defaultbeep)
+
+// Call Handling
+file=ABI_DIR\BUILD_DIR\callhandling.dll     SHARED_LIB_DIR\callhandling.dll
+
+// Contact Handling
+file=ABI_DIR\BUILD_DIR\contacthandling.dll  SHARED_LIB_DIR\contacthandling.dll
+
+// Log Handling
+file=ABI_DIR\BUILD_DIR\loghandling.dll      SHARED_LIB_DIR\loghandling.dll
+
+// Service Handling
+file=ABI_DIR\BUILD_DIR\peservicehandling.dll      SHARED_LIB_DIR\peservicehandling.dll
+
+// <-- QT PHONE START --> 
+// Dial Service
+file=ABI_DIR\BUILD_DIR\phoneservices.dll      SHARED_LIB_DIR\phoneservices.dll
+// Parser recognizer
+file=ABI_DIR\BUILD_DIR\parserrecognizer.dll      SHARED_LIB_DIR\parserrecognizer.dll
+// <-- QT PHONE END--> 
+data=DATAZ_\private\1000A86C\backup_registration.xml  private\1000A86C\backup_registration.xml
+
+
+// SIS stubs
+data=ZSYSTEM\install\audiohandling_stub.sis     System\Install\audiohandling_stub.sis
+data=ZSYSTEM\install\callhandling_stub.sis      System\Install\callhandling_stub.sis
+data=ZSYSTEM\install\contacthandling_stub.sis   System\Install\contacthandling_stub.sis
+data=ZSYSTEM\install\loghandling_stub.sis       System\Install\loghandling_stub.sis
+data=ZSYSTEM\install\phonemodel_stub.sis        System\Install\phonemodel_stub.sis
+data=ZSYSTEM\install\servicehandling_stub.sis   System\Install\servicehandling_stub.sis
+
+#endif // PHONEENGINE_IBY
+
+//  End of File  
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeaccessorymodemonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEAccessoryModeMonitor class 
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpeaccessorymodemonitor.h"
+#include <talogger.h>
+   
+// CONSTANTS
+ 
+// FORWARD DECLARATIONS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::CPEAccessoryModeMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEAccessoryModeMonitor::CPEAccessoryModeMonitor():
+    CActive( CActive::EPriorityStandard )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEAccessoryModeMonitor* CPEAccessoryModeMonitor::NewL()
+    {
+    CPEAccessoryModeMonitor* self = 
+        new (ELeave) CPEAccessoryModeMonitor();
+
+    CleanupStack::PushL( self );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+    
+// Destructor
+CPEAccessoryModeMonitor::~CPEAccessoryModeMonitor()
+    {
+    Cancel();
+    iMode.CloseSubSession();
+    iAccServer.Disconnect();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::AccessoryServer
+// -----------------------------------------------------------------------------
+//
+RAccessoryServer CPEAccessoryModeMonitor::AccessoryServer()
+    {
+    if ( !iAccConn )
+        {
+        TInt error = iAccServer.Connect();
+        if ( error == KErrNone )
+            {
+            iAccConn = ETrue;
+            }
+        }
+    return iAccServer;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::AccessoryMode
+// -----------------------------------------------------------------------------
+//
+TInt CPEAccessoryModeMonitor::AccessoryMode()
+    {
+
+    if ( !iAccSess )
+        {
+        if ( !iAccConn )
+            {
+            AccessoryServer();    
+            }
+        if ( iAccConn )
+            {
+            TInt error = iMode.CreateSubSession( iAccServer );
+            if ( error == KErrNone )
+                {
+                iAccSess = ETrue;    
+                }
+            }
+        }
+    if ( iAccSess && !IsActive() )
+        {
+        iMode.GetAccessoryMode( iPolAccessoryMode );
+        iAccessoryMode = iPolAccessoryMode.iAccessoryMode;    
+        iAudioOutputStatus = iPolAccessoryMode.iAudioOutputStatus;
+        Start();        
+        }
+    TEFLOGSTRING2( KTAINT, 
+        "CPEAccessoryModeMonitor.AccessoryMode< Mode: %d ", iAccessoryMode );        
+    return iAccessoryMode;           
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::Status
+// -----------------------------------------------------------------------------
+//
+ 
+TBool CPEAccessoryModeMonitor::Status()
+    {
+    if ( !iAccSess )
+        {
+        AccessoryMode();
+        }
+    return iAudioOutputStatus;
+    }    
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::DoCancel
+//
+// -----------------------------------------------------------------------------
+//
+void CPEAccessoryModeMonitor::DoCancel()
+    {
+    iMode.CancelNotifyAccessoryModeChanged();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::RunL
+// Receives event on accessory mode change.
+//
+// -----------------------------------------------------------------------------
+//
+void CPEAccessoryModeMonitor::RunL()
+    {
+    TEFLOGSTRING2(KTAINT, "CPEAccessoryModeMonitor::RunL %d", iStatus.Int() );
+    
+    switch ( iStatus.Int() )
+        {
+        case KErrNone:
+            {
+            iAccessoryMode = iPolAccessoryMode.iAccessoryMode;    
+            iAudioOutputStatus = iPolAccessoryMode.iAudioOutputStatus;
+            // Issue request again if needed.
+            Start();
+            }
+            break;
+        case KErrCancel:
+        case KErrNotSupported:
+            break;
+        default:
+            // Issue request again if needed.
+             Start();
+            break;
+        }
+     }
+
+
+// -----------------------------------------------------------------------------
+// CPEAccessoryModeMonitor::Start
+// 
+//
+// -----------------------------------------------------------------------------
+//     
+void CPEAccessoryModeMonitor::Start()
+    {
+    TEFLOGSTRING(KTAINT, "CPEAccessoryModeMonitor::Start" );
+    if ( !IsActive() )
+        {
+        iMode.NotifyAccessoryModeChanged( iStatus, iPolAccessoryMode );
+        SetActive();                          
+        }    
+    }
+ 
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeactivestarter.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEActiveStarter class 
+                 member functions.
+*
+*/
+
+
+//  INCLUDE FILES
+#include "cpeactivestarter.h"
+#include <talogger.h>
+
+// EXTERNAL DATA STRUCTURES
+//None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//None;
+
+// CONSTANTS
+//None
+
+// MACROS
+//None
+
+// LOCAL CONSTANTS AND MACROS
+//None
+
+// MODULE DATA STRUCTURES
+//None
+
+// LOCAL FUNCTION PROTOTYPES
+//None
+
+// FORWARD DECLARATIONS
+//None
+
+// ============================= LOCAL FUNCTIONS ===============================
+//None
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEActiveStarter::CPEActiveStarter
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEActiveStarter::CPEActiveStarter(
+    MPEActiveStarter* aActiveStarter ) 
+    : CActive( CActive::EPriorityStandard ), 
+      iActiveStarter ( aActiveStarter )
+    {
+        
+    CActiveScheduler::Add( this );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEActiveStarter::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEActiveStarter* CPEActiveStarter::NewL( 
+    MPEActiveStarter* aActiveStarter )
+    {
+        
+    return new( ELeave ) CPEActiveStarter( aActiveStarter );
+    
+    }
+
+// Destructor
+CPEActiveStarter::~CPEActiveStarter()
+    {
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEActiveStarter::StartUp
+// Starts the Phone Engine modules asynchronically.
+// -----------------------------------------------------------------------------
+//
+void CPEActiveStarter::StartUp()
+    {
+    SetActive();
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone ); // complete request.
+    }
+
+// -----------------------------------------------------------------------------
+// CPEActiveStarter::DoCancel
+// Method cancels asynchronous request.
+// -----------------------------------------------------------------------------
+//
+void CPEActiveStarter::DoCancel()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEActiveStarter::RunError
+// Method recalls Phone Engine module starts.
+// -----------------------------------------------------------------------------
+//
+TInt CPEActiveStarter::RunError( TInt aError )
+    {
+    TEFLOGSTRING2( KTAOBJECT, "CPEActiveStarter::RunError(): Leave %d in step.", aError );
+    aError = aError; // for compiler warning
+    iActiveStarter->RecallSteps();
+
+    delete this; // ugly suicide thingie so don't implement any new code that reserver anything after this
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEActiveStarter::RunL
+// Starts all Phone Engine modules asynchronically.
+// -----------------------------------------------------------------------------
+//
+void CPEActiveStarter::RunL()
+    { 
+    // Protocol specific step.
+    TEFLOGSTRING( KTAOBJECT, "CPEActiveStarter::RunL(): Starting step." );
+
+    TBool continueStep = iActiveStarter->StepL( );
+
+    TEFLOGSTRING( KTAOBJECT, "CPEActiveStarter::RunL(): Completed step." );
+    if ( continueStep ) 
+        {
+        // Start the next module.
+        SetActive();
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete( status, KErrNone );
+        }
+    else
+        {
+        delete this;// ugly suicide thingie so don't implement any new code that reserver anything after this
+        }
+    }
+    
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+//None    
+
+
+//  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeaudiooutputpreferencemonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEAudioOutputPreferenceMonitor class 
+*
+*/
+
+
+// INCLUDES
+#include "cpeaudiooutputpreferencemonitor.h"
+#include "cpepubsubmonitor.h"
+#include "mpephonemodelinternal.h"
+#include <e32property.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+#include <telinternalpskeys.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEAudioOutputPreferenceMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+CPEAudioOutputPreferenceMonitor* CPEAudioOutputPreferenceMonitor::NewL(
+        MPEPhoneModelInternal& aModel ) 
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEAudioOutputPreferenceMonitor::NewL");
+    CPEAudioOutputPreferenceMonitor* self = new (ELeave) CPEAudioOutputPreferenceMonitor( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return( self );
+    }
+                                                                            
+// -----------------------------------------------------------------------------
+// CPEAudioOutputPreferenceMonitor::CPEAudioOutputPreferenceMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEAudioOutputPreferenceMonitor::CPEAudioOutputPreferenceMonitor(
+        MPEPhoneModelInternal& aModel
+        ): CPEPubSubMonitor( aModel )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEAudioOutputPreferenceMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEAudioOutputPreferenceMonitor::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEAudioOutputPreferenceMonitor::ConstructL");
+   
+    BaseConstructL( KPSUidTelAudioPreference, KTelAudioOutput, RProperty::EInt );
+  
+    //  Now retrieve the value
+    TInt value;
+    TInt error = Get( value );
+    
+    // if not able to retrieve the value, set it to the default value
+    if ( error != KErrNone )
+        {   
+        value = EPSAudioPrivate;
+        }
+   
+    iModel.DataStore()->SetAudioOutputPreference( static_cast<EPSTelAudioOutput>(value) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::UpdateL
+// -----------------------------------------------------------------------------
+//
+void CPEAudioOutputPreferenceMonitor::UpdateL()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEAudioOutputPreferenceMonitor::UpdateL" );
+   
+    //  Now retrieve the value
+    TInt value;
+    User::LeaveIfError(Get(value)); 
+    
+    TInt old = iModel.DataStore()->AudioOutputPreference();
+    
+    // If value has not changed, do not send message about change.
+    // This reason for this check is that during phone startup sequence,
+    // the key gets updated but phoneengine already has te value correctly.
+    if (value != old)
+        {
+        iModel.DataStore()->SetAudioOutputPreference( static_cast<EPSTelAudioOutput>(value) );    
+        iModel.SendMessage( MEngineMonitor::EPEMessageAudioOutputPreferenceChanged );
+        }
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpecalldurationdisplaysettingmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains phone engine base central repository monitor class 
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpecalldurationdisplaysettingmonitor.h"
+#include <LogsDomainCRKeys.h>
+#include <talogger.h>
+
+// -----------------------------------------------------------------------------
+// CPECallDurationDisplaySettingMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPECallDurationDisplaySettingMonitor* CPECallDurationDisplaySettingMonitor::NewL(
+        // None
+        )
+    {
+    TEFLOGSTRING(KTAOBJECT, "CPECallDurationDisplaySettingMonitor::NewL");
+    CPECallDurationDisplaySettingMonitor* me = new ( ELeave ) CPECallDurationDisplaySettingMonitor();
+    CleanupStack::PushL( me );
+    me->ConstructL();
+    CleanupStack::Pop( me );
+    return ( me );
+    }
+
+// Destructor
+CPECallDurationDisplaySettingMonitor::~CPECallDurationDisplaySettingMonitor()
+    {
+    // Base class object cancels outstanding request and deletes the repository
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallDurationDisplaySettingMonitor::CPECallDurationDisplaySettingMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPECallDurationDisplaySettingMonitor::CPECallDurationDisplaySettingMonitor()
+    : CPECenRepMonitor( KLogsShowCallDuration )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallDurationDisplaySettingMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPECallDurationDisplaySettingMonitor::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPECallDurationDisplaySettingMonitor::ConstructL" );
+    BaseConstructL( KCRUidLogs );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallDurationDisplaySettingMonitor::UpdateL
+// Hardcoded values according to LogsDomainCRKeys.h
+// 0 (call duration not shown)
+// 1 (call duration shown)
+// -----------------------------------------------------------------------------
+//
+void CPECallDurationDisplaySettingMonitor::UpdateL()
+    {
+    // Retrieve current value for call duration display
+    iError = Get( iDisplayCallDuration );
+    User::LeaveIfError( iError );
+    TEFLOGSTRING2( KTAINT, "CPECallDurationDisplaySettingMonitor::UpdateL %d", iDisplayCallDuration );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECallDurationDisplaySettingMonitor::GetValue
+// -----------------------------------------------------------------------------
+//
+TInt CPECallDurationDisplaySettingMonitor::GetValue(TInt& aValue)
+    {
+    aValue = (TInt)iDisplayCallDuration;
+    return iError;
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpecenrepmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains phone engine central repository monitor base class
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpecenrepmonitor.h"
+#include <centralrepository.h>
+#include <pepanic.pan>
+#include <talogger.h>
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::CPECenRepMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPECenRepMonitor::CPECenRepMonitor(
+        TUint32 aMonitorSetting
+        ) : CActive( EPriorityStandard ),
+            iMonitorSetting( aMonitorSetting )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// Destructor
+CPECenRepMonitor::~CPECenRepMonitor(
+        // None
+        )
+    {
+    Cancel();
+    delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::BaseConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPECenRepMonitor::BaseConstructL(
+        TUid aRepositoryUid
+        )
+    {
+    // Create repository instance
+    iRepository = CRepository::NewL( aRepositoryUid );
+
+    // Store current value
+    UpdateL();
+
+    // Start monitoring
+    SubmitNotifyRequestL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::Get
+// -----------------------------------------------------------------------------
+//
+TInt CPECenRepMonitor::Get(
+        TInt& aValue
+        )
+    {
+    return ( iRepository->Get( iMonitorSetting, aValue ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::SubmitNotifyRequestL
+// -----------------------------------------------------------------------------
+//
+void CPECenRepMonitor::SubmitNotifyRequestL(
+        // None
+        )
+    {
+    __ASSERT_DEBUG( iRepository, Panic( EPEPanicNoRepository ) );
+    __ASSERT_DEBUG( !IsActive(), Panic( EPEPanicRepositoryAlreadyActive ) );
+    iRepository->NotifyRequest( iMonitorSetting, iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CPECenRepMonitor::DoCancel(
+        // None
+        )
+    {
+    __ASSERT_DEBUG( iRepository, Panic( EPEPanicNoRepository ) );
+    iRepository->NotifyCancel( iMonitorSetting );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::RunError
+// -----------------------------------------------------------------------------
+//
+TInt CPECenRepMonitor::RunError(
+        #ifdef _DEBUG
+        TInt aError // Log the leavecode from RunL
+        #else
+        TInt /*aError*/
+        #endif
+        )
+    {
+    #ifdef _DEBUG
+    TEFLOGSTRING3( KTAERROR, "CPECenRepMonitor::RunError %d MonitorSetting: %d", aError, iMonitorSetting );
+    #endif
+    return ( KErrNone );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::RunL
+// -----------------------------------------------------------------------------
+//
+void CPECenRepMonitor::RunL(
+        // None
+        )
+    {
+    TEFLOGSTRING3( KTAREQEND, "CPECenRepMonitor::RunL, status: %d, monitored setting: %d", iStatus.Int(), iMonitorSetting );
+
+    // Don't resubmit the request on error
+    // Central repositry completes notifications with id of setting
+    // so check only that value of iStatus is negative
+    User::LeaveIfError( iStatus.Int() < KErrNone ); 
+    SubmitNotifyRequestL();
+    UpdateL();
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeclientcallrequestmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of 
+*                CPEClientCallRequestMonitor class 
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeclientcallrequestmonitor.h"
+#include "cpemessagehandler.h"
+#include "mpephonemodelinternal.h"
+#include "pevirtualengine.h"
+#include <cphcltcallnotify.h>
+#include <cphcltdialdata.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::CPEClientCallRequestMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEClientCallRequestMonitor::CPEClientCallRequestMonitor( 
+        MPEPhoneModelInternal& aModel,
+        CPhCltCallNotify& aCallNotifier ): 
+            iModel( aModel ),
+            iCallNotifier( aCallNotifier )
+    {
+    TEFLOGSTRING( KTAOBJECT, 
+        "PE CPEClientCallRequestMonitor::CPEClientCallRequestMonitor complete");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::ConstructL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+void CPEClientCallRequestMonitor::ConstructL()
+    {
+    iDialData = NULL;    
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEClientCallRequestMonitor* CPEClientCallRequestMonitor::NewL( 
+    MPEPhoneModelInternal& aModel,
+    CPhCltCallNotify& aCallNotifier )
+    {
+    CPEClientCallRequestMonitor* self = new( ELeave ) 
+        CPEClientCallRequestMonitor( aModel, aCallNotifier  );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CPEClientCallRequestMonitor::~CPEClientCallRequestMonitor()
+    {
+    Cancel();
+    if( iDialData )
+        {
+        delete iDialData;
+        iDialData = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::SendRespond
+// Sends respond to the phone client.
+// -----------------------------------------------------------------------------
+//
+void CPEClientCallRequestMonitor::SendRespond( 
+        const TInt aRespond )
+    {
+    if ( iClientOriginatedCall )
+        {
+        TEFLOGSTRING2( KTAMESOUT, 
+            "PE CPEClientCallRequestMonitor::SendRespond, CPhCltCallNotify::RespondClient( %d )"
+            ,aRespond );
+        iCallNotifier.RespondClient( aRespond );
+        iClientOriginatedCall = EFalse;
+        StartMonitoring();
+        }    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::DialRequest
+// -----------------------------------------------------------------------------
+//
+void CPEClientCallRequestMonitor::DialRequest( CPhCltDialData* aDialData )
+    {
+    TEFLOGSTRING( KTAMESOUT, 
+        "PE CPEClientCallRequestMonitor::DialRequest" );
+    iMonitoring = EFalse;
+    iDialData = aDialData;
+    iClientOriginatedCall = ETrue;
+    iModel.DataStore()->SetPhoneNumber( 
+        static_cast<TPEPhoneNumber>( iDialData->TelephoneNumber() ) );
+        
+    if ( aDialData->SATCall() )
+        {
+        iModel.DataStore()->SetCallOriginCommand( EPECallOriginSAT );
+        }
+    else
+        {
+        iModel.DataStore()->SetCallOriginCommand( EPECallOriginClient );
+        }
+
+    iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageClientDial );
+    
+    // Clear data so that following dials during created call does not
+    // use these values.
+    iModel.DataStore()->SetUserToUserInformation( KNullDesC() );
+    iModel.DataStore()->SetCallOriginCommand( EPECallOriginPhone );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::StartMonitoring
+// Starts monitoring phone client for client dials.
+// -----------------------------------------------------------------------------
+//
+void CPEClientCallRequestMonitor::StartMonitoring()
+    {
+    TEFLOGSTRING( KTAMESOUT, 
+        "PE CPEClientCallRequestMonitor::StartMonitoring, RPhCltCallNotify::NotifyDialRequest( )" );
+    
+    iCallNotifier.NotifyDialRequest( this );
+    if( iDialData )
+        {
+        delete iDialData;
+        iDialData = NULL;
+        }
+    iMonitoring = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::DoCancel
+// Cancel active object request
+// -----------------------------------------------------------------------------
+//
+void CPEClientCallRequestMonitor::Cancel()
+    {
+    TEFLOGSTRING( KTAREQEND, "PE CPEClientCallRequestMonitor::DoCancel" );
+    iCallNotifier.CancelNotifyDialRequest( );
+    iMonitoring = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::ClientDialData
+// -----------------------------------------------------------------------------
+//
+CPhCltDialData* CPEClientCallRequestMonitor::ClientDialData()
+    {
+    return iDialData;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEClientCallRequestMonitor::IsActive
+// -----------------------------------------------------------------------------
+//    
+TBool CPEClientCallRequestMonitor::IsActive()
+    {
+    return iMonitoring;
+    }
+        
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeclientcommandhandlermonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,463 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  AT command request monitor
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpeclientcommandhandlermonitor.h"
+#include "cpemanualcallcontrolhandler.h"
+#include "cpemessagehandler.h"
+#include "mpecallhandling.h"
+#include "mpephonemodelinternal.h"
+#include <mpedatastore.h>
+#include <rphcltserver.h>
+#include <talogger.h>
+#include <telephonyvariant.hrh>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::CPEClientCommandHandlerMonitor
+// Constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEClientCommandHandlerMonitor::CPEClientCommandHandlerMonitor(
+    MPECallHandling& aCallHandling,
+    CPEMessageHandler& aMessageHandler,
+    MPEPhoneModelInternal& aModel,
+    RPhCltServer& aServer,
+    CPEManualCallControlHandler& aManualCallControlHandler )
+    : iServer ( aServer ),
+      iCallHandling( aCallHandling ),
+      iMessageHandler ( aMessageHandler),
+      iModel ( aModel ),
+      iManualCallControlHandler( aManualCallControlHandler )
+    {
+    iWaitingForResponse = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::ConstructL()
+    {
+    iNotify = CPhCltCallNotify::NewL();
+    // Open subsession
+    User::LeaveIfError( iNotify->Open( iServer ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEClientCommandHandlerMonitor* CPEClientCommandHandlerMonitor::NewL(
+    MPECallHandling& aCallHandling,
+    CPEMessageHandler& aMessageHandler,
+    MPEPhoneModelInternal& aModel,
+    RPhCltServer& aPhoneServer,
+    CPEManualCallControlHandler& aManualCallControlHandler )
+    {
+    CPEClientCommandHandlerMonitor* self = new( ELeave ) CPEClientCommandHandlerMonitor(
+        aCallHandling, aMessageHandler, aModel, aPhoneServer, aManualCallControlHandler );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+ 
+// Destructor
+CPEClientCommandHandlerMonitor::~CPEClientCommandHandlerMonitor()
+    {
+    Cancel();
+
+    if ( iNotify )
+        {
+        iNotify->Close();
+        delete iNotify;
+        }
+    iLibrary.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::Start
+// Start listening for AT command requests.
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::Start()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEClientCommandHandlerMonitor::Start()" );
+    iNotify->NotifyComHandCommand( this, iArgs );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::Respond
+// Sends response to AT command request 
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::Respond( const TInt aErrorCode )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEClientCommandHandlerMonitor::Respond: error %d", aErrorCode );
+ 
+    SendResponse( aErrorCode );
+    Start();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::SendResponse
+// Sends response to server.
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::SendResponse( const TInt aResponse )
+    {
+    iNotify->RespondComHandClient( aResponse );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::RunL
+// 
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::ComHandRequest()
+    {
+    TEFLOGSTRING( KTAREQEND, "PE CPEClientCommandHandlerMonitor::ComHandRequest");
+    TRAPD( err, HandleCommandRequestL( iArgs() ) );
+    if ( err != ECCPErrorNone )
+        {
+        Respond( err );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::DoCancel
+// 
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::Cancel()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::Cancel" );
+    if ( iNotify )
+        {
+        iNotify->CancelNotifyComHandCommand();
+        }
+    }
+    
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleAtCommandRequestL
+// Processing various supported BT AT commands
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCommandRequestL(
+        const TPhCltComHandCommandParameters& aArgs )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEClientCommandHandlerMonitor::HandleCommandRequestL: command %d"
+        , aArgs.iCommandHandlerCommand );
+    
+    switch ( aArgs.iCommandHandlerCommand )
+        {
+        case EPhCltCommandAta:
+            HandleCmdAta();
+            break;
+
+        case EPhCltCommandChup:
+            HandleCmdChup();
+            break;
+      
+        case EPhCltCommandVts:
+            HandleCmdVtsL( aArgs.iDtmfTone, aArgs.iDtmfAction );
+            break;
+            
+        case EPhCltCommandAtd:
+            HandleCmdAtdL( aArgs.iTelNumber );
+            break;
+            
+        case EPhCltCommandChld:
+            HandleCmdChldL( aArgs.iChldCommand, aArgs.iChldCallNumber );
+            break;
+            
+        case EPhCltCommandMuteMic:
+            HandleCmdMuteMic( aArgs.iMute );
+            break;
+        
+        case EPhCltCommandMuteRingingTone:
+            HandleCmdMuteRingingTone();
+            break;
+        
+        default:
+            Respond( ECCPErrorNotSupported );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleCmdAta
+// Processing ATA command
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCmdAta()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::HandleCmdAta" );
+    // Checking for available ringing call is done in CallHandling,
+    // no need to do it here. If a ringing call was not found, the
+    // error code equals "ECCPErrorNotFound".
+    Respond( iMessageHandler.HandleAnswerCall( EFalse ));
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleCmdChup
+// Processing CHUP command
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCmdChup()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::HandleCmdChup" );
+    if ( iCallHandling.IsCallInState( EPEStateRinging ) &&
+         iCallHandling.GetNumberOfCalls() == 1 )
+        {
+        Respond( iCallHandling.RejectCall() );
+        }
+    else if( iCallHandling.GetNumberOfCalls() > 1 )
+        {
+        // Hang up the calls in the order specified by Multicall Handling UI spec. 
+        // If the call has a hang up request pending already, hang up the next call. 
+        TInt err = HangUp( EPEStateDisconnecting );
+        if ( ECCPErrorNone != err )
+             {
+             err = HangUp( EPEStateCreatingConference );
+             if ( ECCPErrorNone != err ) 
+                 {
+                 err = HangUp( EPEStateDialing ); 
+                 if ( ECCPErrorNone != err ) 
+                     { 
+                     err = HangUp( EPEStateConnecting ); 
+                     if ( ECCPErrorNone != err ) 
+                         { 
+                         err = HangUp( EPEStateConnectedConference ); 
+                         if ( ECCPErrorNone != err ) 
+                             { 
+                             err = HangUp( EPEStateConnected ); 
+                             if ( ECCPErrorNone != err ) 
+                                 { 
+                                 err = HangUp( EPEStateHeldConference ); 
+                                 if ( ECCPErrorNone != err ) 
+                                     { 
+                                     err = HangUp( EPEStateHeld ); 
+                                     } 
+                                 } 
+                             } 
+                         } 
+                     } 
+                 } 
+             }
+        Respond( err ); // Responds KErrNone or any error code 
+        }
+    else if( iCallHandling.GetNumberOfCalls() == 1 )
+        {
+        Respond( iCallHandling.ReleaseAll() );    
+        }
+    else
+        {
+        Respond( ECCPErrorGeneral );
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleCmdVtsL
+// Processing VTS command
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCmdVtsL(
+        const TPhCltDtmfTone aDtmfTone,
+        const TPhCltDtmfAction aAction )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::HandleCmdVtsL" );
+    TInt errorCode;
+
+    switch ( aAction )
+        {
+        case EPhCltDtmfNotUsed:
+            iModel.DataStore()->SetKeyCode( aDtmfTone );
+            iMessageHandler.HandlePlayDTMFL();
+            errorCode = iMessageHandler.HandleEndDTMF();
+            break;
+        case EPhCltDtmfStart:
+            iModel.DataStore()->SetKeyCode( aDtmfTone );
+            iMessageHandler.HandlePlayDTMFL();
+            errorCode = ECCPErrorNone;
+            break;
+        case EPhCltDtmfStop:
+            errorCode = iMessageHandler.HandleEndDTMF();
+            break;
+        default:
+            errorCode = ECCPErrorNotSupported;
+            break;
+        }
+    Respond( errorCode );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleCmdAtdL
+// Handle AT dial.
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCmdAtdL( 
+        const TPhCltTelephoneNumber& aPhoneNumber )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::HandleCmdAtdL" );
+    iModel.DataStore()->SetPhoneNumber( 
+        static_cast<TPEPhoneNumber>( aPhoneNumber ) );
+    iWaitingForResponse = ETrue;
+    iModel.SendMessage( MEngineMonitor::EPEMessageStartATDialing );
+    }
+  
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleCmdChldL
+// Processing CHLD command
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCmdChldL( 
+        const TPhCltChldCommand aChldCommand,
+        const TUint aCallNo ) // Only used in GSM.
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::HandleCmdChldL" );
+    TInt errorCode = ECCPErrorNone;
+
+    // All commands are meant for incall situations.
+    if ( iCallHandling.GetNumberOfCalls() > 0 )
+        {
+        // Leaves on error code. The leave error is sent as a response
+        // to the client.
+        TRAP( errorCode, iManualCallControlHandler.HandleChldL( aChldCommand, aCallNo ));
+        }
+    else
+        {
+        errorCode = ECCPErrorGeneral;
+        }
+
+    Respond( errorCode );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::DoCompleteCmdAtd
+// Processing response from Phone UI (dialing started indication)
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::DoCompleteCmdAtd( TBool aFlag )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::DoCompleteCmdAtd" );
+    if ( iWaitingForResponse )
+        {
+        iWaitingForResponse = EFalse;
+        if ( aFlag )
+            {
+            Respond( ECCPErrorNone );
+            }
+        else
+            {
+            Respond( ECCPErrorGeneral );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleCmdMuteRingingTone
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCmdMuteRingingTone()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::HandleCmdMuteRingingTone" );
+    TInt errorCode( ECCPErrorNone );
+
+    // command is meant for incall situations.
+    if ( iCallHandling.GetNumberOfCalls() > 0 )
+        {
+        iModel.SendMessage( MEngineMonitor::EPEMessageMuteRingingTone );
+        }
+    else
+        {
+        errorCode = ECCPErrorGeneral;
+        }
+
+    Respond( errorCode );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientCommandHandlerMonitor::HandleCmdMuteMic
+// -----------------------------------------------------------------------------
+//
+void CPEClientCommandHandlerMonitor::HandleCmdMuteMic( TBool aMute )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEClientCommandHandlerMonitor::HandleCmdMuteMic" );
+    // command is meant for incall situations.
+    if ( iCallHandling.GetNumberOfCalls() > 0 )
+        {
+        iModel.DataStore()->SetAudioMuteCommand( aMute );
+        iMessageHandler.HandleSetAudioMute();
+        Respond( ECCPErrorNone );
+        }
+    else
+        {
+        Respond( ECCPErrorGeneral );
+        }
+    }
+
+// ----------------------------------------------------------------------------- 
+// CPEClientCommandHandlerMonitor::HangUp 
+// Finds a conference call or a single call (in that order) in specified 
+// state and tries to hang it up. 
+// ----------------------------------------------------------------------------- 
+// 
+TInt CPEClientCommandHandlerMonitor::HangUp( TPEState aState ) 
+    { 
+    TEFLOGSTRING2( KTAINT, "CPEClientCommandHandlerMonitor::HangUp aState=%d", aState); 
+    TInt ret( ECCPErrorNotFound ); 
+  
+    TPEState conferenceState = iCallHandling.GetCallState( KPEConferenceCallID ); 
+    if ( conferenceState == aState ) 
+        { 
+        ret = iCallHandling.HangUp( KPEConferenceCallID, ETPEHangUpDefault ); 
+        } 
+    else 
+        { 
+        TInt callId = iCallHandling.GetCallIdByState( aState ); 
+        if ( KPECallIdNotUsed != callId ) 
+            { 
+            ret = iCallHandling.HangUp( callId, ETPEHangUpDefault ); 
+            } 
+        } 
+  
+    TEFLOGSTRING2( KTAINT, "CPEClientCommandHandlerMonitor::HangUp ret=%d", ret ); 
+    return ret; 
+    } 
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeclientemergencycallmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of 
+*                CPEClientEmergencyCallMonitor class 
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeclientemergencycallmonitor.h"
+#include "cpemessagehandler.h"
+#include "mpephonemodelinternal.h"
+#include "pevirtualengine.h"
+#include <cphcltcallnotify.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::CPEClientEmergencyCallMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEClientEmergencyCallMonitor::CPEClientEmergencyCallMonitor( 
+        MPEPhoneModelInternal& aModel,
+        CPhCltCallNotify& aCallNotifier )
+        :   iModel( aModel ),
+            iCallNotifier( aCallNotifier ),
+            iClientOriginatedCall( EFalse )
+    {
+    TEFLOGSTRING( KTAOBJECT, 
+        "PE CPEClientEmergencyCallMonitor::CPEClientEmergencyCallMonitor complete");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::ConstructL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+void CPEClientEmergencyCallMonitor::ConstructL()
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEClientEmergencyCallMonitor* CPEClientEmergencyCallMonitor::NewL( 
+    MPEPhoneModelInternal& aModel,
+    CPhCltCallNotify& aCallNotifier )
+    {
+    CPEClientEmergencyCallMonitor* self = new( ELeave ) 
+        CPEClientEmergencyCallMonitor( aModel, aCallNotifier );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CPEClientEmergencyCallMonitor::~CPEClientEmergencyCallMonitor()
+    {
+    Cancel();    
+    }
+
+// -----------------------------------------------------------------------------
+// CPhCltDialData* CPEClientEmergencyCallMonitor::ClientDialData
+// -----------------------------------------------------------------------------
+//    
+CPhCltDialData* CPEClientEmergencyCallMonitor::ClientDialData()
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::SendRespond
+// Sends respond to the phone client.
+// -----------------------------------------------------------------------------
+//
+void CPEClientEmergencyCallMonitor::SendRespond( 
+        const TInt aRespond )
+    {
+    if ( iClientOriginatedCall )
+        {
+        TEFLOGSTRING2( KTAMESOUT, 
+            "PE CPEClientEmergencyCallMonitor::SendRespond, CPhCltCallNotify::RespondClient( %d )"
+            ,aRespond );
+        iCallNotifier.RespondEmergencyToClient( aRespond );
+        iClientOriginatedCall = EFalse;
+       // StartMonitoring();
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::StartMonitoring
+// Starts monitoring phone client for client dials.
+// -----------------------------------------------------------------------------
+//
+void CPEClientEmergencyCallMonitor::StartMonitoring() 
+    {
+    TEFLOGSTRING( KTAMESOUT, 
+        "PE CPEClientEmergencyCallMonitor::StartMonitoring, CPhCltCallNotify::NotifyEmergencyCall( )" );
+    iCallNotifier.NotifyEmergencyCall( this, iEmergencyNumber );
+    iMonitoring = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::Cancel
+// Cancel active object request
+// -----------------------------------------------------------------------------
+//
+void CPEClientEmergencyCallMonitor::Cancel()
+    {
+    TEFLOGSTRING( KTAREQEND, "PE CPEClientEmergencyCallMonitor::Cancel" );
+    iCallNotifier.CancelNotifyEmergencyCall();
+    iMonitoring = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::DialEmergencyRequest
+// -----------------------------------------------------------------------------
+//
+void CPEClientEmergencyCallMonitor::DialEmergencyRequest()
+    {
+    iMonitoring = EFalse;
+    TEFLOGSTRING( KTAREQEND, 
+        "PE CPEClientEmergencyCallMonitor::DialEmergencyRequest" );
+    iClientOriginatedCall = ETrue;
+    iModel.DataStore()->SetPhoneNumber( 
+        static_cast<TPEPhoneNumber>( iEmergencyNumber ) );
+    iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageClientDialEmergency );
+    StartMonitoring();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientEmergencyCallMonitor::IsActive
+// -----------------------------------------------------------------------------
+//    
+TBool CPEClientEmergencyCallMonitor::IsActive()
+    {
+    return iMonitoring;
+    }
+        
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeclientservices.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEClientServices class 
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeclientcallrequestmonitor.h"
+#include "cpeclientcommandhandlermonitor.h"
+#include "cpeclientemergencycallmonitor.h"
+#include "cpeclientservices.h"
+#include "cpedevicemodehandler.h"
+#include "cpemessagehandler.h"
+#include "mpecallhandling.h"
+#include "mpephonemodelinternal.h"
+#include <apgtask.h>
+#include <cphcltcallnotify.h>
+#include <cphcltemergencycall.h>
+#include <cphcltussd.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::CPEClientServices
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEClientServices::CPEClientServices( 
+        MPEPhoneModelInternal& aModel,
+        CPEMessageHandler& aMessageHandler,
+        MPECallHandling& aCallHandling,
+        CPEManualCallControlHandler& aManualCallControlHandler
+        ) : iModel( aModel ),
+            iMessageHandler( aMessageHandler ),
+            iCallHandling( aCallHandling ),
+            iManualCallControlHandler( aManualCallControlHandler )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::ConstructL
+// Symbian OS default constructor may leave.
+// -----------------------------------------------------------------------------
+//
+void CPEClientServices::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEClientServices::ConstructL()" );
+
+    User::LeaveIfError( iPhoneServer.Connect( ) );
+
+    // Need to call CreateAll so that Phone Server creates all managers
+    // (f.ex. USSD manager). Otherwise USSD requests/notifications don't
+    // get through unless USSD request is sent from Mobile Terminal first.
+    TRequestStatus phoneServerStatus;
+    iPhoneServer.CreateAll( phoneServerStatus );
+    User::WaitForRequest( phoneServerStatus );
+    User::LeaveIfError( phoneServerStatus.Int() );
+        
+    iEmergency = CPhCltEmergencyCall::NewL( NULL );
+    
+    iCallNotifier = CPhCltCallNotify::NewL();
+    User::LeaveIfError( iCallNotifier->Open( iPhoneServer ) );
+    
+    iClientCallRequestMonitor = CPEClientCallRequestMonitor::NewL( 
+        iModel, 
+        *iCallNotifier ); 
+
+    iClientEmergencyMonitor = CPEClientEmergencyCallMonitor::NewL(
+        iModel, 
+        *iCallNotifier ); 
+
+    iClientCommandHandlerMonitor = CPEClientCommandHandlerMonitor::NewL( 
+        iCallHandling, 
+        iMessageHandler, 
+        iModel, 
+        iPhoneServer,
+        iManualCallControlHandler );
+        
+    iDeviceModeHandler = CPEDeviceModeHandler::NewL( 
+        iCallHandling, 
+        iMessageHandler );      
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEClientServices* CPEClientServices::NewL(
+    MPEPhoneModelInternal& aModel,
+        CPEMessageHandler& aMessageHandler,
+        MPECallHandling& aCallHandling,
+        CPEManualCallControlHandler& aManualCallControlHandler )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEClientServices::NewL()" );
+    
+    CPEClientServices* self = new ( ELeave ) CPEClientServices( 
+        aModel, 
+        aMessageHandler, 
+        aCallHandling,
+        aManualCallControlHandler );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return (self);
+    }
+
+
+// Destructor
+CPEClientServices::~CPEClientServices ()
+    {
+    delete iClientCommandHandlerMonitor;
+    delete iClientCallRequestMonitor;
+    delete iDeviceModeHandler;
+
+    // Cancel any outstanding USSD requests
+    if ( iUssdClient )
+        {
+        iUssdClient->SendUssdCancel();
+        }
+    delete iUssdClient;
+    delete iClientEmergencyMonitor;
+    iCallNotifier->Close();
+    delete iCallNotifier;
+    delete iEmergency;
+    iPhoneServer.Close();  
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::IsEmergencyPhoneNumber
+// Check if the given telephone number is an emergency number.
+// -----------------------------------------------------------------------------
+//
+TInt CPEClientServices::IsEmergencyPhoneNumber( 
+    TPhCltTelephoneNumber& aNumber, 
+    TBool& aIsEmergencyNumber )
+    {
+    TInt errorCode = iEmergency->IsEmergencyPhoneNumber( aNumber, 
+                                                         aIsEmergencyNumber );
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::SendUssd
+// Process USSD request
+// -----------------------------------------------------------------------------
+//
+TInt CPEClientServices::SendUssd( 
+        const TDesC& aString )   // USSD string to be sent.
+    {
+    TInt errorCode( KErrNone );
+
+    TRAP( errorCode, ( iUssdClient = CPhCltUssd::NewL() ) );
+    if( errorCode == KErrNone )
+        {
+        iString.Set( aString );
+        iModel.SendMessage( MEngineMonitor::EPEMessageIssuingUSSDRequest );
+        errorCode = iUssdClient->SendUssd( iString );
+        iModel.SendMessage( MEngineMonitor::EPEMessageIssuedUSSDRequest );
+        TEFLOGSTRING2( KTAINT, 
+            "PE CPEClientServices::SendUssd, error code: %d", errorCode );
+
+        delete iUssdClient;
+        iUssdClient = NULL;
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, 
+            "PE CPECLIENTSERVICES::SENDUSSD > CPHCLTUSSD::NEWL FAILED" );
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::StartMonitoring
+// Start monitoring
+// -----------------------------------------------------------------------------
+//
+void CPEClientServices::StartMonitoring()
+    {
+    iClientCallRequestMonitor->StartMonitoring();
+    iClientEmergencyMonitor->StartMonitoring();
+    iClientCommandHandlerMonitor->Start();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::CallRequestMonitor
+// Returns MPEClientCallRequestMonitor object
+// -----------------------------------------------------------------------------
+//
+MPEClientCallRequestMonitor* CPEClientServices::CallRequestMonitor()
+    {
+    // Both monitors are accessed when in RunL, only in Sat call case call 
+    // request monitor's SendRespond method is called later when monitoring 
+    // already started.
+    if ( !iClientEmergencyMonitor->IsActive() )
+        {
+        return iClientEmergencyMonitor;
+        }
+    return iClientCallRequestMonitor;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEClientServices::CommandHandlerMonitor
+// Returns CPEClientCommandHandlerMonitor object
+// -----------------------------------------------------------------------------
+//
+CPEClientCommandHandlerMonitor* CPEClientServices::CommandHandlerMonitor()
+    {
+    return iClientCommandHandlerMonitor;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpedevicemodehandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Device mode handler
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpedevicemodehandler.h"
+#include "cpemessagehandler.h"
+#include "mpecallhandling.h"
+#include <talogger.h>
+#include <cteldmhandler.h>
+
+// CONSTANTS
+
+_LIT( KPhoneTelDevModeLoadedLib, "telephonydevicemode.dll" );
+const TInt KPhoneTelDevModeOrdinal = 1;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEDeviceModeHandler::CPEDeviceModeHandler
+// Constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEDeviceModeHandler::CPEDeviceModeHandler(
+    MPECallHandling& aCallHandling,
+    CPEMessageHandler& aMessageHandler
+)
+    : iCallHandling( aCallHandling ),
+      iMessageHandler ( aMessageHandler)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDeviceModeHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEDeviceModeHandler::ConstructL()
+    {
+    LoadLibraryL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDeviceModeHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEDeviceModeHandler* CPEDeviceModeHandler::NewL(
+    MPECallHandling& aCallHandling,
+    CPEMessageHandler& aMessageHandler
+    )
+    {
+    CPEDeviceModeHandler* self = new( ELeave ) CPEDeviceModeHandler(
+        aCallHandling, aMessageHandler );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+ 
+// Destructor
+CPEDeviceModeHandler::~CPEDeviceModeHandler()
+    {
+    if ( iTelDevModeHandler )
+        {
+        delete iTelDevModeHandler;
+        iLibrary.Close();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+//  CPEDeviceModeHandler::Answer
+// -----------------------------------------------------------------------------
+//
+void CPEDeviceModeHandler::Answer()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEDeviceModeHandler::Answer" );
+    
+    // Checking for available ringing call is done in CallHandling,
+    // no need to do it here. If a ringing call was not found, the
+    // error code equals "ECCPErrorNotFound".
+    iMessageHandler.HandleAnswerCall( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDeviceModeHandler::EndVoiceCalls
+// -----------------------------------------------------------------------------
+//
+void CPEDeviceModeHandler::EndVoiceCalls()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEDeviceModeHandler::EndVoiceCalls" );
+    
+    if ( iCallHandling.GetNumberOfCalls() > 0 ) // there is ongoing call(s)
+        {
+        iMessageHandler.HandleReleaseAll();    
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEDeviceModeHandler::LoadLibraryL
+// -----------------------------------------------------------------------------
+//
+void CPEDeviceModeHandler::LoadLibraryL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEDeviceModeHandler::LoadLibraryL" );
+    
+    if ( !iTelDevModeHandler )
+        {
+        
+        User::LeaveIfError( iLibrary.Load( KPhoneTelDevModeLoadedLib ) );
+             
+        TInt res = iLibrary.Lookup( KPhoneTelDevModeOrdinal )();
+        iTelDevModeHandler = reinterpret_cast< CTelDMHandler* >( res );
+        
+        if( !iTelDevModeHandler )
+            {
+            iLibrary.Close();
+            // Null returned, so leave.
+            User::Leave( ECCPErrorNotSupported );
+            }        
+        else
+            {
+            iTelDevModeHandler->SetObserverL( this );
+            }
+        }
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeexternaldatahandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of 
+*                CPEExternalDataHandler class 
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeexternaldatahandler.h"
+#include "mpephonemodelinternal.h"
+#include <accessoriescrkeys.h>
+#include <centralrepository.h>
+#include <CoreApplicationUIsSDKCRKeys.h>
+#include <ctsydomainpskeys.h>
+#include <mpedatastore.h>
+#include <pepanic.pan>
+#include <settingsinternalcrkeys.h>
+#include <talogger.h>
+#include <telephonyvariant.hrh>
+#include <telinternalcrkeys.h>
+
+CPEExternalDataHandler* CPEExternalDataHandler::NewL( MPEPhoneModelInternal& aModel )
+    {
+    CPEExternalDataHandler* self = new ( ELeave ) CPEExternalDataHandler( *aModel.DataStore() );
+    CleanupStack::PushL( self );
+    self->ConstructL( aModel );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEExternalDataHandler::CPEExternalDataHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEExternalDataHandler::CPEExternalDataHandler(
+        MPEDataStore& aDataStore
+        ) : iDataStore( aDataStore )
+    {
+    }
+
+// Destructor
+CPEExternalDataHandler::~CPEExternalDataHandler()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::~CPEExternalDataHandler" );    
+
+    delete iTelephonyVariationRepository;
+    delete iTelephonySettingsRepository;
+    delete iProfileSettings;
+    delete iNetworkRegistrationStatus;   
+    delete iCallDurationDisplay;
+    delete iAudioOutputPreferenceMonitor;
+    delete iAccessorySettingsRepository;
+    delete iAccessoryModeMonitor;
+    delete iCoreApplicationRepository;
+    delete iNetworkHandler;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEExternalDataHandler::BaseConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEExternalDataHandler::ConstructL(
+        MPEPhoneModelInternal& aModel )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL" );
+
+    // Instantiate monitor objects
+    iAudioOutputPreferenceMonitor = CPEAudioOutputPreferenceMonitor::NewL( aModel );    
+    iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL(); 
+    iProfileSettings = CPEProfileSettingMonitor::NewL( aModel );
+    
+    iNetworkHandler = new PeNetworkHandler(aModel);
+    //TODO
+    /*
+    iNetworkRegistrationStatus = CPENetworkRegistrationStatusMonitor::NewL( aModel );
+    iAccessoryModeMonitor = CPEAccessoryModeMonitor::NewL(); 
+
+    // Instantiate repository objects for later use
+    iAccessorySettingsRepository = CRepository::NewL( KCRUidAccessorySettings );*/
+    //iTelephonySettingsRepository = CRepository::NewL( KCRUidTelephonySettings );
+    iTelephonyVariationRepository = CRepository::NewL( KCRUidTelVariation );
+    //iCoreApplicationRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); 
+   
+    TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL 2" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEExternalDataHandler::Get
+// Gets the current value of the specified setting, if the operation was successful
+// aValue contains the current valid value of the setting
+// -----------------------------------------------------------------------------
+//
+TInt CPEExternalDataHandler::Get(
+        const TPEExternalDataId aSetting,
+        TInt& aValue ) const
+    {
+    TInt errorCode( KErrNotFound );
+
+    //TODO
+
+    if ( EPETelephonyVariationFlags == aSetting )
+        {
+        errorCode = iTelephonyVariationRepository->Get( KTelVariationFlags, aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPETelephonyVariationFlags, error code: %d", errorCode );
+        }
+    else if ( EPEAudioOutputPreference == aSetting )
+        {
+        errorCode = iAudioOutputPreferenceMonitor->Get( aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode );
+        }    
+    else if ( EPECallDurationDisplaySetting == aSetting )
+        {
+        errorCode = iCallDurationDisplay->Get( aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode );
+        }
+    else
+        {
+        errorCode = KErrNone;
+        aValue = 0;        
+        }
+    
+    // Process Common id
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEExternalDataHandler::Get
+// Gets the current value of the specified setting, if the operation was successful
+// aValue contains the current valid value of the setting
+// -----------------------------------------------------------------------------
+//
+TInt CPEExternalDataHandler::GetText(
+        const TPEExternalDataId /*aSetting*/,
+        TDesC& aValue ) const
+    {
+    TInt errorCode( KErrNotFound );
+    //TODO
+    aValue = KNullDesC;
+    errorCode = KErrNone;
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEExternalDataHandler::GetAutomaticAnswer
+// Check if automatic answer is defined for connected accessory.
+// -----------------------------------------------------------------------------
+//
+TInt CPEExternalDataHandler::GetAutomaticAnswer(
+        TUint32 /*aSetting*/,
+        TInt& aValue ) const
+    {
+    TInt errorCode( KErrNotFound );
+    
+    TEFLOGSTRING( KTAINT, "CPEExternalDataHandler::GetAutomaticAnswer" );
+    errorCode = KErrNone;
+    aValue = 0;
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEExternalDataHandler::Set
+// Sets the value of the specified setting
+// -----------------------------------------------------------------------------
+//
+TInt CPEExternalDataHandler::Set(
+        const TPEExternalDataId aSetting,
+        const TInt aValue )
+    {
+    TInt errorCode( KErrNotFound );
+
+    switch ( aSetting )
+        {
+        case EPEEmergencyCallInfo:
+            {
+            errorCode = RProperty::Set( KPSUidCtsyEmergencyCallInfo, 
+                                        KCTSYEmergencyCallInfo, aValue );
+            TEFLOGSTRING2( KTAERROR, 
+            "PE CPEExternalDataHandler::Set KPSUidCtsyEmergencyCallInfo: %d", aValue );
+            break;            
+            }
+        default:
+            {
+            TEFLOGSTRING2( KTAERROR, "PE CPEEXTERNALDATAHANDLER::SET UNKNOWN SETTING ID ! %d", aSetting );
+            break;
+            }
+        }
+    return errorCode;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeidlestatusmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEIdleStatusMonitor class 
+*
+*/
+
+
+// INCLUDES
+#include <talogger.h>
+#include "cpephonemodel.h"
+#include "cpeidlestatusmonitor.h"
+#include <activeidle2domainpskeys.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEIdleStatusMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+CPEIdleStatusMonitor* CPEIdleStatusMonitor::NewL(
+        CPEPhoneModel& aOwner ) 
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEIdleStatusMonitor::NewL ");
+    CPEIdleStatusMonitor* self = new (ELeave) CPEIdleStatusMonitor( 
+        aOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return( self );
+    }
+
+// Destructor
+CPEIdleStatusMonitor::~CPEIdleStatusMonitor()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEIdleStatusMonitor::~CPEIdleStatusMonitor, start ");
+    Cancel();
+    iProperty.Close();
+    TEFLOGSTRING( KTAOBJECT, "PE CPEIdleStatusMonitor::~CPEIdleStatusMonitor, complete ");
+    }
+                                       
+// -----------------------------------------------------------------------------
+// CPEIdleStatusMonitor::CPEIdleStatusMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEIdleStatusMonitor::CPEIdleStatusMonitor(
+        CPEPhoneModel& aOwner
+        ): CActive( EPriorityStandard ),
+           iOwner( aOwner )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIdleStatusMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEIdleStatusMonitor::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEIdleStatusMonitor::ConstructL");
+    User::LeaveIfError( iProperty.Attach( KPSUidAiInformation, KActiveIdleState ) );
+       
+    TInt value;
+    iProperty.Get( KPSUidAiInformation, KActiveIdleState, value );
+    
+    if ( value == EPSAiForeground )
+        {
+        // Don't implement any new code that reserver anything after this.
+        iOwner.ConstructContactHandlingPhaseTwoL();
+        }
+    else
+        {
+        iProperty.Subscribe( iStatus );
+        SetActive();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEIdleStatusMonitor::DoCancel
+// Callback method from CActive.
+// -----------------------------------------------------------------------------
+//
+void CPEIdleStatusMonitor::DoCancel()
+    {   
+    TEFLOGSTRING( KTAREQOUT, "PE CPEIdleStatusMonitor::DoCancel()" );
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::RunL
+// -----------------------------------------------------------------------------
+//
+void CPEIdleStatusMonitor::RunL()
+    {
+    TEFLOGSTRING2( KTAREQEND, 
+        "PE CPEIdleStatusMonitor::RunL,iStatus: %d", iStatus.Int() );
+   
+    //  Now retrieve the value
+    TInt value;
+    iProperty.Get( KPSUidAiInformation, KActiveIdleState, value );
+        
+    if ( value == EPSAiForeground )
+        {
+        TEFLOGSTRING( KTAOBJECT, 
+            "PE CPEIdleStatusMonitor::RunL, starting contact handling creation");
+        // Don't implement any new code that reserver anything after this.
+        iOwner.ConstructContactHandlingPhaseTwoL();
+        TEFLOGSTRING( KTAOBJECT, 
+            "PE CPEIdleStatusMonitor::RunL, starting contact handling creation done ");
+        }
+    else
+        {
+        iProperty.Subscribe( iStatus );
+        SetActive();
+        }
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpemanualcallcontrolhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,452 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Manual call control handler
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpemanualcallcontrolhandler.h"
+#include "cpemessagehandler.h"
+#include <ccpdefs.h>
+#include <mpecallhandling.h>
+#include <mpedatastore.h>
+#include <pepanic.pan>
+#include <pevirtualengine.h>
+#include <talogger.h>
+
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// cpemanualcallcontrolhandler::CPEManualCallControlHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEManualCallControlHandler::CPEManualCallControlHandler( 
+        MPECallHandling& aCallHandling,
+        CPEMessageHandler& aMessageHandler,
+        MPEDataStore& aDataStore )
+        :   iCallHandling( aCallHandling ),
+            iMessageHandler( aMessageHandler ),
+            iDataStore( aDataStore )
+    {
+    }
+  
+// Destructor
+CPEManualCallControlHandler::~CPEManualCallControlHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEManualCallControlHandler* CPEManualCallControlHandler::NewL
+        ( 
+        MPECallHandling& aCallHandling,
+        CPEMessageHandler& aMessageHandler,
+        MPEDataStore& aDataStore )
+    {
+    CPEManualCallControlHandler* handler = new ( ELeave ) CPEManualCallControlHandler( 
+        aCallHandling, 
+        aMessageHandler,
+        aDataStore);
+
+    return handler;
+    }
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldL
+// Handles common Chld (swap, answer waiting call, ... )
+// -----------------------------------------------------------------------------
+//
+void CPEManualCallControlHandler::HandleChldL( 
+            const TPhCltChldCommand aChldCommand,
+            const TUint aCallNo )
+    {
+    TEFLOGSTRING3( KTAMESINT, 
+            "PE CPEManualCallControlHandler::HandleChldL, aChldCommand: %d, aCallNo: %d"
+            , aChldCommand
+            , aCallNo ); 
+    TInt error( KErrNotFound );
+    
+    switch ( aChldCommand )
+        {
+        case EPhCltChldZero:
+            // Release held calls or set UDUB for a waiting call.
+            error = HandleChldZero();
+            break;
+
+        case EPhCltChldOne:
+            // Release all active calls and accept other (held or waiting) call.
+            {
+            if( aCallNo )
+                {
+                HandleChldOneXL( aCallNo );
+                error = ECCPErrorNone;
+                }
+            else
+                {
+                error = HandleChldOne();
+                }
+            }
+            break;
+
+        case EPhCltChldTwo:
+            // Place all active calls on hold and accept the other (held or waiting) call.
+            {
+            if( aCallNo )
+                {
+                HandleChldTwoXL( aCallNo );
+                error = ECCPErrorNone;
+                }
+            else
+                {
+                error = HandleChldTwo();
+                }
+            }
+            break;
+            
+        case EPhCltChldThree:
+            // Add a held call to the conversation.
+            error = HandleChldThree();
+            break;
+
+        case EPhCltChldFour:
+            // Connect the two calls and disconnect the subscriber from 
+            // both calls (Explicit call transfer).
+            error = HandleChldFour();
+            break;
+
+        default:
+            {
+            TEFLOGSTRING2( KTAERROR, 
+                "PE CPEManualCallControlHandler::HandleChldL, aChldCommand; %d"
+                ,aChldCommand );
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicIllegalCommand ) );
+            break;
+            }
+        }
+    User::LeaveIfError( error );     
+    }
+
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldZero
+// -----------------------------------------------------------------------------
+//
+TInt CPEManualCallControlHandler::HandleChldZero()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldZero" );
+    TInt error( ECCPErrorNotAllowed );
+    
+    if ( iCallHandling.IsCallInState( EPEStateRinging ) )
+        {
+        error = iCallHandling.RejectCall();
+        }
+    else if( iDataStore.ConferenceCallState( ) == EPEStateHeldConference )
+        {
+        iDataStore.SetCallId( KPEConferenceCallID );
+        error = iMessageHandler.HandleReleaseCall();
+        }
+    else if ( iCallHandling.IsCallInState( EPEStateHeld ) )
+        {
+        TInt callId = iCallHandling.GetCallIdByState( EPEStateHeld );
+        if ( callId != KPECallIdNotUsed )
+            {
+            iDataStore.SetCallId( callId );
+            error = iMessageHandler.HandleReleaseCall();
+            }
+        }
+
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldZero, error: %d", error );
+    return error;  
+    } 
+
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldOne
+// -----------------------------------------------------------------------------
+//
+TInt CPEManualCallControlHandler::HandleChldOne()
+    {
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldOne" );
+
+    TInt error( ECCPErrorNotAllowed );
+    // Find active call
+    TInt callId( KPECallIdNotUsed );
+
+    if ( ( iDataStore.ConferenceCallState( ) == EPEStateConnectedConference ) )
+        {
+        callId = KPEConferenceCallID;
+        }
+    else if ( iCallHandling.IsCallInState( EPEStateConnected ) )
+        {
+        callId = iCallHandling.GetCallIdByState( EPEStateConnected );
+        }
+    else if ( iCallHandling.IsCallInState( EPEStateConnecting ) )  
+        {
+        callId = iCallHandling.GetCallIdByState( EPEStateConnecting );
+        }
+    else if ( iCallHandling.IsCallInState( EPEStateDialing ) )  
+        {
+        callId = iCallHandling.GetCallIdByState( EPEStateDialing );
+        }
+    else if ( iCallHandling.IsCallInState( EPEStateAnswering ) )  
+        {
+        callId = iCallHandling.GetCallIdByState( EPEStateAnswering );
+        }
+    
+    // Replace 
+    if ( iCallHandling.IsCallInState( EPEStateConnected ) &&
+         iCallHandling.IsCallInState( EPEStateRinging ) )
+        {
+        TInt callIdConn = iCallHandling.GetCallIdByState( EPEStateConnected );
+        TInt callIdRing = iCallHandling.GetCallIdByState( EPEStateRinging );
+        if ( iDataStore.CallType( callIdConn ) == iDataStore.CallType( callIdRing ) )
+            {
+            // Replace allowed for same call types
+            error = iCallHandling.ReplaceActive();
+            }
+        }
+    else 
+        {
+         // Relese active call
+        if ( callId != KPECallIdNotUsed )
+            {
+            iDataStore.SetCallId( callId );
+            error = iMessageHandler.HandleReleaseCall( ETPEHangUpResumeHeldCall );
+            }
+        // accept held or waiting call
+        if ( iCallHandling.IsCallInState( EPEStateRinging ) )    
+            {
+            error = iCallHandling.AnswerCall();
+            }
+        else if ( iCallHandling.IsCallInState( EPEStateHeld ) )  
+            {
+            error = iCallHandling.ResumeCall();
+            }    
+        }
+
+        
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldOne, error: %d", error );    
+    return error;         
+    }
+
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldOneXL
+// -----------------------------------------------------------------------------
+//
+void CPEManualCallControlHandler::HandleChldOneXL( TInt aCallNo )
+    {
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEManualCallControlHandler::HandleChldOneXL, aCallNo %d", 
+        aCallNo );
+
+    TInt error( ECCPErrorNotAllowed );
+    TPEState callState;
+    
+    if ( ( KPEMaximumNumberOfVoiceCalls > aCallNo ) && ( aCallNo > 0 ) ) 
+        {
+        callState = iDataStore.CallState( CallIdByIndexL( aCallNo ) );
+        TEFLOGSTRING2( KTAINT,
+            "PE CPEManualCallControlHandler::HandleChldOneXL, callState %d", 
+            callState );
+        if ( callState == EPEStateRinging && 
+             !( iCallHandling.IsCallInState( EPEStateDialing ) || iCallHandling.IsCallInState( EPEStateConnecting ) ) )
+            {
+            error = iMessageHandler.HandleAnswerCall( EFalse );
+            TEFLOGSTRING2( KTAINT,
+                "PE CPEManualCallControlHandler::HandleChldOneXL > HandleAnswerCall, Error code %d", 
+                error );
+            }
+        else if ( callState == EPEStateConnected )
+            {
+            iDataStore.SetCallId( CallIdByIndexL( aCallNo ) );
+            error = iMessageHandler.HandleReleaseCall( ETPEHangUpNotResumeHeldCall );
+            TEFLOGSTRING2( KTAINT,
+                "PE CPEManualCallControlHandler::HandleChldOneXL > HandleReleaseCall, Error code %d", 
+                error );
+            }
+        }        
+        
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldOneXL, error: %d", error );    
+    User::LeaveIfError( error );        
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldTwo
+// -----------------------------------------------------------------------------
+//
+TInt CPEManualCallControlHandler::HandleChldTwo()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldTwo");
+    
+    TInt error( ECCPErrorNotAllowed );
+    
+    if ( iCallHandling.IsCallInState( EPEStateDialing ) || 
+         iCallHandling.IsCallInState( EPEStateConnecting ) )
+        {
+        TEFLOGSTRING( 
+            KTAERROR, 
+            "PE CPEManualCallControlHandler::HandleChldTwo: Call found in EPEStateDialing or EPEStateConnecting,state > swap NOT ALLOWED" );
+        }
+    else
+        {
+        if ( iCallHandling.IsCallInState( EPEStateConnected ) && 
+             iCallHandling.IsCallInState( EPEStateHeld ) )
+            {
+            error = iCallHandling.SwapCalls();
+            }
+        else if ( iCallHandling.IsCallInState( EPEStateConnected ) && 
+                  !iCallHandling.IsCallInState( EPEStateRinging ) )
+            {
+            error = iCallHandling.HoldCall();
+            }
+        else if ( iCallHandling.IsCallInState( EPEStateHeld ) &&
+            !( iCallHandling.IsCallInState( EPEStateRinging ) ) )
+            {
+            error = iCallHandling.ResumeCall();
+            }
+        else if ( iCallHandling.IsCallInState( EPEStateRinging ) )
+            {
+            error = iCallHandling.AnswerCall();
+            }
+        }
+
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldtwo, error: %d", error );    
+    return error; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldTwoXL
+// -----------------------------------------------------------------------------
+//
+void CPEManualCallControlHandler::HandleChldTwoXL( TInt aCallNo )
+    {
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldTwoXL" );
+
+    TInt error( ECCPErrorNotAllowed );
+    
+    if ( ( KPEMaximumNumberOfVoiceCalls > aCallNo ) && ( aCallNo > 0 ) ) 
+        {   
+        if ( ( iDataStore.CallState( CallIdByIndexL( aCallNo ) ) ==  EPEStateConnected )
+            && ( iDataStore.ConferenceCallState( ) == EPEStateConnectedConference ) )
+            {
+            iDataStore.SetCallId( CallIdByIndexL( aCallNo ) );
+            error = iMessageHandler.HandleGoOneToOne();
+            }
+        }
+
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldTwoXL, error: %d", error );    
+    User::LeaveIfError( error );       
+    }
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldThree
+// -----------------------------------------------------------------------------
+//
+TInt CPEManualCallControlHandler::HandleChldThree()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldThree");
+    
+    TInt error( ECCPErrorNotAllowed );
+    
+    if( iDataStore.ConferenceCallState( ) == EPEStateConferenceIdle ) 
+        {
+        TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldThree: HandleBuildConferenceCall" );
+        error = iMessageHandler.HandleBuildConferenceCall();
+        }
+    else if ( iDataStore.ConferenceCallState( ) == EPEStateConnectedConference )
+        {
+        TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldThree: EPEStateConnectedConference" );
+        if ( iCallHandling.IsCallInState( EPEStateHeld ) )
+            {
+            TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldThree: AddConferenceMember" );
+            error = iCallHandling.AddConferenceMember();
+            }
+        }
+    else if( iDataStore.ConferenceCallState( ) == EPEStateHeldConference ) 
+        {
+        TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldThree: EPEStateHeldConference" );
+        if ( iCallHandling.IsCallInState( EPEStateConnected ) )
+            {
+            TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldThree: AddConferenceMember" );
+            error = iCallHandling.AddConferenceMember();
+            }
+        }
+        
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldTree, error: %d", error );
+    return error;         
+    }
+
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::HandleChldFour
+// -----------------------------------------------------------------------------
+//
+TInt CPEManualCallControlHandler::HandleChldFour()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldFour" );
+   
+    TInt error( ECCPErrorNotAllowed );
+            
+    if ( ( iCallHandling.IsCallInState( EPEStateConnected ) || iCallHandling.IsCallInState( EPEStateConnecting ) ) && 
+         iCallHandling.IsCallInState( EPEStateHeld ) )
+        {
+        TEFLOGSTRING( KTAINT, "PE CPEManualCallControlHandler::HandleChldFour > TransferCalls" );
+        error = iCallHandling.TransferCalls();
+        }
+        
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEManualCallControlHandler::HandleChldFour, error: %d", error );
+    return error;        
+    }
+
+// -----------------------------------------------------------------------------
+// CPEManualCallControlHandler::CallIdByIndexL
+// -----------------------------------------------------------------------------
+//
+TInt CPEManualCallControlHandler::CallIdByIndexL( const TInt& aCallIndex )
+    {
+    TInt i, errorCode( ECCPErrorNotAllowed );
+    for( i = 0; i < KPEMaximumNumberOfCalls; i++ )
+        {
+        if( iDataStore.CallIndex( i ) == aCallIndex )
+            {
+            errorCode = ECCPErrorNone;
+            break;
+            }
+        }
+    User::LeaveIfError( errorCode );
+    return i;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpemessagehandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,3033 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Message handler
+*
+*/
+
+// INCLUDE FILES
+#include "cpecenrepmonitor.h"
+#include "cpeclientcallrequestmonitor.h"
+#include "cpeclientcallrequestmonitor.h"
+#include "cpeclientcommandhandlermonitor.h"
+#include "cpeclientservices.h"
+#include "cpeexternaldatahandler.h"
+#include "cpemanualcallcontrolhandler.h"
+#include "cpemessagehandler.h"
+#include "cpeparseremergencynumberhandler.h"
+#include "cpeparsermanufacturerhandler.h"
+#include "cpeparsermischandler.h"
+#include "cpeparserphonenumberhandler.h"
+#include "cpeparsersimcontrolhandler.h"
+#include "cpeparsersscallhandler.h"
+#include "cpeparsersshandler.h"
+#include "cpeparservoipnumberhandler.h"
+#include "cpepcnparserprocedurehandler.h"
+#include "cpesimstatemonitor.h"
+#include "cpetimer.h"
+#include "mpephonemodelinternal.h"
+#include "mpeservicehandling.h"
+#include "cperemotepartyinfomediator.h"
+
+#include <apacmdln.h>
+#include <apgcli.h>
+#include <apgtask.h>
+#include <AudioPreference.h>
+#include <barsc.h> 
+#include <barsread.h>
+#include <bldvariant.hrh>
+#include <ccpdefs.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include <cpeclientinformation.h>
+#include <cpegsmaudiodata.h>
+#include <cphonegsmhandlercontainer.h>
+#include <cphonegsmoptioncontainerbase.h>
+#include <cphonegsmparserbase.h>
+#include <cphonegsmparserresult.h>
+#include <featmgr.h>
+#include <mccecall.h>
+#include <mpeaudiodata.h>
+#include <mpecallhandling.h>
+#include <mpecontacthandling.h>
+#include <mpedatastore.h>
+#include <mpeloghandling.h>
+#include <pathinfo.h>
+#include <pepanic.pan>
+#include <phclttypes.h>
+#include <phonegsmparser.h>
+#include <ProfileEngineDomainConstants.h>
+#include <talogger.h>
+#include <w32std.h>
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// Prefix change off. See SettingsInternalCRKeys.h
+const TInt KPEPrefixChangeOff = 0;
+// Prefix change on. See SettingsInternalCRKeys.h
+const TInt KPEPrefixChangeOn = 1;
+// International prefix
+_LIT( KPEIntPrefix, "+" );
+// Japan prefix
+_LIT( KPEJapanPrefix, "+81" );
+// Zero prefix
+_LIT( KPEZeroPrefix, "0" );
+// Valid dtmf sting
+_LIT( KValidDtmfChars, "0123456789pw*+#" );
+
+// Timeout for automatic answer. 
+const TInt KPEAutomaticAnswerTimeOut = 5000000;
+
+_LIT( KPEClirSuppress, "*31#" );
+_LIT( KPEClirInvoke, "#31#" );
+
+const TInt KPENumberPlus = '+';
+const TInt KPENumberHash = '#'; 
+const TInt KPENumberAsterisk = '*'; 
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEMessageHandler* CPEMessageHandler::NewL
+        ( 
+        MPEPhoneModelInternal& aModel,
+        MPECallHandling& aCallHandling,
+        MEngineMonitor& aEngineMonitor,
+        CPEGsmAudioData& aAudioData,
+        MPELogHandling& aLogHandling,
+        MPEContactHandling& aContactHandling,
+        CPESimStateMonitor& aSimStateMonitor,
+        CPEExternalDataHandler& aGsmExternalDataHandler,
+        MPEServiceHandling& aServiceHandling,
+        RFs& aFsSession )
+    {
+    CPEMessageHandler* self = new ( ELeave ) CPEMessageHandler( 
+        aModel, 
+        aCallHandling, 
+        aEngineMonitor, 
+        aAudioData, 
+        aLogHandling, 
+        aContactHandling, 
+        aSimStateMonitor,
+        aGsmExternalDataHandler,
+        aServiceHandling,
+        aFsSession );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::CPEMessageHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEMessageHandler::CPEMessageHandler( 
+        MPEPhoneModelInternal& aModel,                 // The model of the phone object which owns this object
+        MPECallHandling& aCallHandling,              // The reference parameter of the phone data object which is used to create call handling request
+        MEngineMonitor& aEngineMonitor,        // The reference parameter of the engine monitor object which is used to communication with phone application
+        CPEGsmAudioData& aAudioData,              // The reference parameter of the audio data object which is used to handle audio requests
+        MPELogHandling& aLogHandling,                // The reference parameter of the logs data object which is used to handle log requests   
+        MPEContactHandling& aContactHandling,          // The reference parameter of the contact data object which is used to handle contact requests
+        CPESimStateMonitor& aSimStateMonitor,
+        CPEExternalDataHandler& aExternalDataHandler, // The reference parameter of external data handler object
+        MPEServiceHandling& aServiceHandling,
+        RFs& aFsSession )                // The reference parameter of CustomAPI
+        : iModel( aModel ), 
+            iCallHandling( aCallHandling ),
+            iEngineMonitor( aEngineMonitor ),
+            iGsmAudioData( aAudioData ),
+            iLogHandling( aLogHandling ),
+            iContactHandling( aContactHandling ),
+            iExternalDataHandler( aExternalDataHandler ),
+            iSimStateMonitor( aSimStateMonitor ),
+            iFsSession( aFsSession ),
+            iServiceHandling( aServiceHandling ),
+            iDataStore( *aModel.DataStore() )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::BaseConstructL
+// Performs base construction of the object.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::ConstructL()
+    {
+    iClientInformation = CPEClientInformation::NewL();
+
+    iParser = PhoneGsmParser::CreateParserL();
+    iOptions = PhoneGsmParser::CreateOptionContainerL();
+    iManualCallControlHandler = CPEManualCallControlHandler::NewL( iCallHandling, *this, iDataStore );
+    iClientServices = CPEClientServices::NewL( iModel, *this, iCallHandling, *iManualCallControlHandler );
+    iParserHandlerContainer = CPhoneGsmHandlerContainer::NewL();
+
+    // NOTE: The handler objects will break some CleanUpStack usage rules:
+    // CPEMessageHandler class construct handler objects but ownership will be 
+    // transfered to Handler Container. And therefore CleanUpStack will be 
+    // used to member object because if iParserHandlerContainer->AddHandlerL 
+    // leaves CPEMessageHandler don't delete handler object hence CleanUpStack
+    // must delete handler object. 
+
+    // Handles manufacturer specific codes from the parser.
+    CPEParserManufacturerHandler* manufacturerHandler = 
+        new ( ELeave ) CPEParserManufacturerHandler( iModel, iCallHandling, iFsSession );
+    CleanupStack::PushL( manufacturerHandler );
+    iParserHandlerContainer->AddHandlerL( *manufacturerHandler ); // ownership will be transfered to Handler Container.
+    CleanupStack::Pop( manufacturerHandler );
+
+    // Handles misc codes from the parser.
+    CPEParserMiscHandler* miscHandler = new ( ELeave ) CPEParserMiscHandler( 
+        *this, 
+        iCallHandling );
+    CleanupStack::PushL( miscHandler );
+    iParserHandlerContainer->AddHandlerL( *miscHandler );// ownership will be transfered to Handler Container.
+    CleanupStack::Pop( miscHandler );
+
+    CPEParserPhoneNumberHandler* tempPhoneNumberHandler = 
+        new ( ELeave ) CPEParserPhoneNumberHandler( *this, 
+                                                       iCallHandling, 
+                                                       iDataStore );
+    CleanupStack::PushL( tempPhoneNumberHandler );
+    iParserHandlerContainer->AddHandlerL( *tempPhoneNumberHandler ); // ownership will be transfered to Handler Container.
+    CleanupStack::Pop( tempPhoneNumberHandler );
+    iPhoneNumberHandler = tempPhoneNumberHandler;
+
+    // Handles sim control procedures from the parser.
+    CPEParserSimControlHandler* simControlHandler = CPEParserSimControlHandler::NewL( 
+        iModel, 
+        iContactHandling );
+    CleanupStack::PushL( simControlHandler );
+    iParserHandlerContainer->AddHandlerL( *simControlHandler );// ownership will be transfered to Handler Container.
+    CleanupStack::Pop( simControlHandler );
+
+    // Handles supplementary services during calls from the parser.
+    CPEParserSSCallHandler* sSCallHandler = new ( ELeave ) CPEParserSSCallHandler( 
+        *this, 
+        iModel, 
+        *iManualCallControlHandler );
+    CleanupStack::PushL( sSCallHandler );
+    iParserHandlerContainer->AddHandlerL( *sSCallHandler );// ownership will be transfered to Handler Container.
+    CleanupStack::Pop( sSCallHandler );
+
+    iSSHandler = CPEParserSSHandler::NewL( *this, iModel ); 
+    iParserHandlerContainer->AddHandlerL( *iSSHandler );// ownership will be transfered to Handler Container.
+
+    // Handles pcn service requests from the parser.
+    CPEPcnParserProcedureHandler* pcnProcedureHandler = CPEPcnParserProcedureHandler::NewL( 
+        *this, 
+        iModel ); 
+    CleanupStack::PushL( pcnProcedureHandler );
+    iParserHandlerContainer->AddHandlerL( *pcnProcedureHandler );// ownership will be transfered to Handler Container.
+    CleanupStack::Pop( pcnProcedureHandler );
+    
+    // Handles emergency phone number
+    CPEParserEmergencyNumberHandler* tempEmergencyNumberHandler 
+        = new ( ELeave ) CPEParserEmergencyNumberHandler( *this, 
+                                                          iCallHandling, 
+                                                          iDataStore );
+    CleanupStack::PushL( tempEmergencyNumberHandler );
+    iParserHandlerContainer->AddHandlerL( *tempEmergencyNumberHandler ); // ownership will be transfered to Handler Container.
+    CleanupStack::Pop( tempEmergencyNumberHandler );
+    iEmergencyNumberHandler = tempEmergencyNumberHandler;
+
+    CPEParserVoipNumberHandler* tempVoipNumberHandler
+        = CPEParserVoipNumberHandler::NewLC( *this, 
+                                               iCallHandling, 
+                                               iServiceHandling,
+                                               iDataStore );
+
+    iParserHandlerContainer->AddHandlerL( *tempVoipNumberHandler ); // ownership will be transfered to Handler Container.
+    CleanupStack::Pop( tempVoipNumberHandler );
+    iVoipNumberHandler = tempVoipNumberHandler;
+    
+    iAutomaticAnswerTimer = CPETimer::NewL( iModel );
+ 
+    // Reserve needed callinfo and remoteinfo from heap.
+    iCallInfo = new ( ELeave ) RMobileCall::TMobileCallInfoV3;
+    
+    iResult = PhoneGsmParser::CreateResultL();
+    }
+        
+// Destructor
+CPEMessageHandler::~CPEMessageHandler()
+    {
+    delete iClientInformation;
+    delete iAsyncCallBack;
+    delete iCallInfo;
+    delete iAutomaticAnswerTimer;
+    delete iParserHandlerContainer;
+    delete iClientServices;
+    delete iManualCallControlHandler;
+    delete iOptions;
+    delete iParser;
+    delete iResult;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleAnswerCall
+// Handles answer message from phone application. Method calls AnswerCall 
+// method from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleAnswerCall(
+        const TBool aAutomaticAnswer ) // Informs is this automatic answer or not
+    {
+    // Stop DTMF sending and empty buffers if answer was requested in the
+    // middle of DTMF sequence.
+    StopDtmfSending();
+    
+    //Check if this is automatic answer and play redialCompletedTone (confusing naming)
+    if( !aAutomaticAnswer )
+        {
+        iAutomaticAnswerTimer->Cancel();
+        }
+
+    return iCallHandling.AnswerCall();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleAudioRouting
+// Handles accessory mode changed message from AudioHandling subsystem. Method 
+// fecths accessory mode from AudioHandling subsystem and method sets new accessory
+// mode value to the CPEEngineInfo class. Method finds previously used volume
+// values for accessory and changes volume accordingly.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleAudioRouting( TBool aVideoCall, TInt aCallId )
+    {
+    TInt error( ECCPErrorNone );
+    
+    if ( aCallId == KPEEmergencyCallId )     
+         {
+         error = iGsmAudioData.HandleEnergencyCallStarting();
+         }
+     else
+         {
+         error = iGsmAudioData.HandleCallStarting( aVideoCall );
+         }
+    
+    return error;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleRoutePreferenceChanged
+// Handles route preference changed message from AudioHandling subsystem. 
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleRoutePreferenceChanged()
+    {
+    TInt error( ECCPErrorNone );
+    
+    TEFLOGSTRING( KTAMESINT, "PE CPEMessageHandler::HandleRoutePreferenceChanged()" );
+    
+    error = iGsmAudioData.CallAudioRoutePreferenceChanged();
+     
+    return error;
+    }    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleContinueDtmfSending
+// Handles continue dtmf sending after 'w' character in the dtmf string
+// Method calls ContinueDtmfSending or StopDtmfSending method from the 
+// CallHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleContinueDtmfSending( 
+        const TBool aContinue )
+    {
+    if ( aContinue )
+        {
+        HandleSendDtmf();
+        }
+    else
+        {
+        StopDtmfSending();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleReleaseAll
+// Handles release all message from phone application
+// Method calls ReleaseAll method from the CallHandling subsystem object..
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleReleaseAll()
+    {
+    return iCallHandling.ReleaseAll();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleReleaseCall
+// Handles release message from phone application
+// Method fecths call id number from the CPEEngineInfo structure and then
+// Method calls HangUp method from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleReleaseCall( TPEHangUpOptions aAutoResumeOption )
+    {
+    TInt callId;
+    TInt errorCode( ECCPErrorNone );
+    callId = iDataStore.CallId();
+    
+    if ( CallIdCheck::IsVideo( callId ) )
+        {
+        //Video call
+        iGsmAudioData.StopInbandTonePlay();
+        errorCode = iCallHandling.HangUp( callId, ETPEHangUpNotResumeHeldCall );
+        }
+    else
+        {
+        errorCode = iCallHandling.HangUp( callId, aAutoResumeOption );
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSendDtmf
+// Handles send dtmf message from phone application
+// Method fetches dtmf string from the CPEEngineInfo class and then
+// Method parses the DTMF string and then take action properly: 
+// hard pause: triggers sending MEngineMonitor::EPEMessageStoppedDTMF 
+//      to phone model
+// '+': triggers substitution speed dial digit with speed dial number. 
+//
+// Method calls SendDtmf method from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleSendDtmf()
+    {
+    TInt errorCode( ECCPErrorNone );
+    TPEDtmfString dtmfString = iDataStore.DtmfStringCommand();
+
+    RemoveInvalidChars( dtmfString, KPEClientValidChars, EFalse );
+
+    if ( dtmfString.Length() == 0 )
+        {
+        iDataStore.SetDtmfString( KNullDesC() ); 
+        errorCode = KErrArgument;
+        }
+    // Parse the first character of the string
+    else if ( dtmfString[ 0 ] == KPEDtmfStopCharLowercase || 
+              dtmfString[ 0 ] == KPEDtmfStopCharUppercase ) // hard pause
+        {
+        TEFLOGSTRING( KTAMESINT, "PE CPEMessageHandler::HandleSendDtmf(), Processing W" );
+        // remove the hard pause char from the string
+        iDataStore.SetDtmfString( dtmfString.Mid( 1 ) );
+        iDataStore.SetDtmfStringCommand( dtmfString.Mid( 1 ) );
+        
+        // Send EPEMessageStoppedDTMF message asynchronic.
+
+        TCallBack callBack( CallbackSendMessageStoppedDTMF, this );
+        delete iAsyncCallBack;
+        iAsyncCallBack = NULL;
+        // Function does not allow to leave.
+        iAsyncCallBack = new CAsyncCallBack( callBack, CActive::EPriorityHigh );
+        if ( iAsyncCallBack )
+            {
+            iAsyncCallBack->CallBack();
+            }
+        else
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageStoppedDTMF );
+            }
+        
+        dtmfString = KNullDesC;
+        }    
+    else if ( dtmfString[ 0 ] == KPEDtmfPlusChar ) // speed-dial substitution
+        {
+        TEFLOGSTRING( KTAMESINT, "PE CPEMessageHandler::HandleSendDtmf(), Processing +" );
+        HandlePlusSignInDtmf( dtmfString );
+        dtmfString = KNullDesC;
+        }
+    else if ( dtmfString[ 0 ] == KPEDtmfPauseCharLowercase || 
+              dtmfString[ 0 ] == KPEDtmfPauseCharUppercase ) // soft pause
+        {
+        TEFLOGSTRING( KTAMESINT, "PE CPEMessageHandler::HandleSendDtmf(), Processing P" );
+        
+        // store the full string for UI to display 
+        iDataStore.SetDtmfString( dtmfString );
+
+        if ( dtmfString.Length() > 1 )
+            {
+            // store the remainder of the string to be processed later
+            iDataStore.SetDtmfStringCommand( dtmfString.Mid( 1 ) ); 
+            }
+        else
+            {
+            // nothing left to process
+            iDataStore.SetDtmfStringCommand( KNullDesC() );
+            }
+        // set the dtmf string to send 
+        dtmfString = dtmfString.Left( 1 );
+        }
+    else 
+        {
+        // store the full string for UI to display 
+        iDataStore.SetDtmfString( dtmfString );
+        
+        // Find the next stop point
+        TInt stopPoint = ECCPErrorNotFound;
+        TPtrC validDtmfStringStopChars( KPEValidDTMFStringStopChars );
+        for ( TInt index = 0 ; index < dtmfString.Length(); index++ )
+            {
+            if ( validDtmfStringStopChars.Locate( dtmfString[index] ) != ECCPErrorNotFound )
+                {
+                stopPoint = index;
+                break; 
+                }
+            }
+
+        if ( stopPoint != ECCPErrorNotFound ) 
+            {
+            // store the remainder of the string to be processed later
+            iDataStore.SetDtmfStringCommand( dtmfString.Mid( stopPoint ) ); 
+            // set the dtmf string to send 
+            dtmfString = dtmfString.Left( stopPoint );            
+            }
+        else
+            {
+            // nothing left to process
+            iDataStore.SetDtmfStringCommand( KNullDesC() );
+            }
+        }
+
+    if ( dtmfString.Length() )  
+        {
+        TEFLOGSTRING2( KTAMESINT, "PE CPEMessageHandler::HandleSendDtmf(), Starting to play %S", &dtmfString );
+        // send the dtmf string to call handling subsystem
+        errorCode = iCallHandling.SendDtmf( dtmfString );
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::CallBackHandleSendDtmf
+// Asyncronous callback for HandleSendDtmf() function.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::CallBackHandleSendDtmf( TAny* aAny )
+    {
+    __ASSERT_ALWAYS( aAny , Panic( EPEPanicNullPointer ) );
+    CPEMessageHandler* self = static_cast<CPEMessageHandler*>(aAny);
+
+    delete self->iAsyncCallBack;
+    self->iAsyncCallBack = NULL;
+    return self->HandleSendDtmf();  
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandlePlusSignInDtmf
+// Handles plus (+) sign in a DTMF string.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandlePlusSignInDtmf(const TPEDtmfString& aDtmfString )
+    {
+    TEFLOGSTRING2( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), aDtmfString: %S", &aDtmfString ); 
+          
+    // Find the SD index after the plus sign
+    TPtrC validManualDTMFChars( KPEValidSpeedDialChars );
+    TInt index = ECCPErrorNotFound;
+    for ( index = 1 ; index < aDtmfString.Length() ; index++ )
+        {
+        if ( validManualDTMFChars.Locate( aDtmfString[index] ) == ECCPErrorNotFound )
+            {
+            TEFLOGSTRING( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), Not Found" ); 
+            break; 
+            }
+        }
+    TPESpeedDialSubstituionStatus sdStatus = EPEDtmfSpeedDialOk;
+    
+    // Empty string after the plus sign
+    if ( index == 1 )
+        {
+        if ( aDtmfString.Length() > 1 )
+            {
+            // pw+ after the plus sign.
+            sdStatus = EPEDtmfSpeedDialInvalidSpeedDial;
+            }
+        else
+            {
+            // string ended with the plus sign.
+            sdStatus = EPEDtmfSpeedDialPromptUser;
+            }
+        // Clear DTMF string.
+        iDataStore.SetDtmfString( KNullDesC() );
+        }
+    // Else if the SD location ends the DTMF string, move the index to the
+    // last character instead of one over.
+    else if ( index == aDtmfString.Length() )
+        {
+        index--;
+        }
+    
+    // Check that the index is valid
+    TInt sdIndex = ECCPErrorNotFound; 
+    if ( sdStatus == EPEDtmfSpeedDialOk )
+        {
+        TLex lexer( aDtmfString.Mid( 1, index ) );
+        // convert it to a number
+        if ( lexer.Val(sdIndex) == ECCPErrorNone )
+            {
+            // Is it out of range
+            if ( sdIndex < KPESpeedDialIndexMin  ||
+                sdIndex > KPESpeedDialIndexMax )
+                {
+                sdStatus = EPEDtmfSpeedDialInvalidSpeedDial;
+                }
+            }
+        else
+            {
+            sdStatus = EPEDtmfSpeedDialInvalidSpeedDial;
+            }
+        }
+    
+    // Fetch the SD location
+    TPEPhoneNumber speedDialLocationString;
+    if ( sdStatus == EPEDtmfSpeedDialOk )
+        {
+        TEFLOGSTRING2( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), SD location %i", sdIndex ); 
+        if ( iContactHandling.GetSpeedDialLocation( 
+            sdIndex, speedDialLocationString ) == ECCPErrorNone )
+            {
+            // Is content found
+            if ( speedDialLocationString.Length() == 0)
+                {
+                sdStatus = EPEDtmfSpeedDialNotAssigned;
+                }
+            else if ( speedDialLocationString[0] == KPEDtmfPlusChar)  
+                {
+                // plus char must be removed from dtmf string before sending
+                RemovePlusPrefix( speedDialLocationString );
+                }
+            }
+        else
+            {
+            sdStatus = EPEDtmfSpeedDialInvalidSpeedDial;
+            }
+        }
+    
+    // Now interpret the sdStatus to the next action
+    switch ( sdStatus )
+        {
+        case EPEDtmfSpeedDialOk:
+            {
+            TEFLOGSTRING2( KTAMESINT, "PE CPEMessageHandler::HandlePlusSignInDtmf(), SD result: %S", &speedDialLocationString ); 
+            // Take the SD location string and use that as new DTMF string
+            iDataStore.SetDtmfStringCommand( speedDialLocationString );
+            
+            // Do recursion asyncronously                        
+            TCallBack callBack( CallBackHandleSendDtmf, this );
+            delete iAsyncCallBack;
+            iAsyncCallBack = NULL;
+            // Function does not allow to leave.
+            iAsyncCallBack = new CAsyncCallBack( callBack, CActive::EPriorityStandard );
+            if ( iAsyncCallBack )
+                {
+                iAsyncCallBack->CallBack();
+                }
+            else
+                {
+                iModel.SendMessage( MEngineMonitor::EPEMessageDTMFSendingAborted );
+                }
+            }
+            break;
+        case EPEDtmfSpeedDialPromptUser:
+            // Speed dial location not given.
+            iDataStore.SetDtmfString( KNullDesC() );
+            iModel.SendMessage( MEngineMonitor::EPEMessagePromptSpeedDial );
+            break;
+        case EPEDtmfSpeedDialNotAssigned:
+            // Speed dial location valid but not assigned
+            iDataStore.SetDtmfString( KNullDesC() );
+            iDataStore.SetDtmfStringCommand( KNullDesC() );
+            iModel.SendMessage( MEngineMonitor::EPEMessageDTMFSendingAborted);
+            iModel.SendMessage( MEngineMonitor::EPEMessageSpeedDialNotAssigned );
+            break;
+        case EPEDtmfSpeedDialInvalidSpeedDial:
+            // Speed dial location invalid
+            iDataStore.SetDtmfString( KNullDesC() );
+            iDataStore.SetDtmfStringCommand( KNullDesC() );
+            iModel.SendMessage( MEngineMonitor::EPEMessageDTMFSendingAborted);
+            iModel.SendMessage( MEngineMonitor::EPEMessageInvalidSpeedDial );
+            break;
+        default:
+            Panic( EPEPanicInvalidState );
+            break;
+        } // end switch
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::CheckPrefix
+// Checks the status of phone number prefix change setting
+// and calls CPEMessageHandler::ChangePrefix for execution.
+// If error occurs the phone number is left untouched
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::CheckPrefix()
+    {
+    TInt err = ECCPErrorNone;
+    TBool checkPrefix = 
+        FeatureManager::FeatureSupported( KFeatureIdJapanPrefixChange );
+
+    if ( checkPrefix )
+        {
+        TInt prefixMode = KPEPrefixChangeOff; // Default is "off"
+
+        err = iExternalDataHandler.Get(
+            EPEDialPrefixChangeSetting,
+            prefixMode );
+
+        if ( !err )
+            {
+            if ( prefixMode == KPEPrefixChangeOn )
+                {
+                TPEPrefixText prefixText;
+                
+                err = iExternalDataHandler.GetText(
+                    EPEDialPrefixTextSetting,
+                    prefixText );
+
+                if ( !err )
+                    {
+                    err = ChangePrefix( prefixText );
+                    }
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::ChangePrefix
+// Executes phone number prefix change.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::ChangePrefix(
+    const TPEPrefixText& aPrefixText )
+    {
+    TInt err = ECCPErrorNone;
+
+    const TInt beginning = 0; // The beginning for replacement.
+    TInt replaceLength = 0; // The string length to be replaced.
+    TInt location = ECCPErrorNotFound; // The location of searched string.
+    TPEPhoneNumber phoneNumber = iDataStore.PhoneNumber();
+
+    // Try to find Japan prefix.
+    location = phoneNumber.Find( KPEJapanPrefix );
+    if ( location == beginning )
+        {
+        // The string was found, so make replacement. 
+        // Safe because KPEZeroPrefix < KPEJapanPrefix.
+        replaceLength = KPEJapanPrefix().Length();
+        phoneNumber.Replace( beginning, replaceLength, KPEZeroPrefix );
+        }
+    else
+        {
+        // Try to find international prefix.
+        location = phoneNumber.Find( KPEIntPrefix );
+        if ( location == beginning )
+            {
+            replaceLength = KPEIntPrefix().Length();
+            // The string was found, so try to make replacement. 
+            const TInt phoneNumLength = phoneNumber.Length();
+            const TInt prefixLength = aPrefixText.Length();
+
+            TInt stringLength = 
+                ( phoneNumLength + prefixLength - replaceLength );
+
+            if ( phoneNumber.MaxLength() >= stringLength )
+                {
+                // There is enough space to make this replace.
+                phoneNumber.Replace( beginning, replaceLength, aPrefixText );
+                }
+            else
+                {
+                // There is no space to combine the strings, so inform it.
+                err = KErrOverflow;
+                }
+            }
+        }
+
+    if ( err == ECCPErrorNone )
+        {
+        iDataStore.SetPhoneNumber( phoneNumber );
+        }
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDtmfSent
+// Handles DTMF sent message from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleDtmfSent()
+    {
+    TInt errorCode( ECCPErrorNone );
+
+    // check if there are still parts of the string left to process
+    if ( iDataStore.DtmfStringCommand().Length() ) 
+        {
+        HandleSendDtmf();
+        errorCode = KPEDontSendMessage;
+        }
+    else 
+        {
+        // dtmf sending complete
+        iDataStore.SetDtmfString( KNullDesC() );
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::StopPlayingDtmf
+// Stops/Cancels playing dtmf tones and string (audio feedback and network)
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::StopDtmfSending()
+    {
+    // cancel subtitution callback:
+    if ( iAsyncCallBack )
+        {
+        iAsyncCallBack->Cancel();
+        delete iAsyncCallBack;
+        iAsyncCallBack = NULL;
+        }
+
+    iCallHandling.StopDtmfSending();
+    
+    iDataStore.SetDtmfString( KNullDesC() ); 
+    iDataStore.SetDtmfStringCommand( KNullDesC() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSetAudioMute
+// Handles audio mute message from the phone application.
+// Method fecths mute value from the CPEEngineInfo and then
+// Method sets mute value to the AudioHandling subsystem.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleSetAudioMute()
+    {
+    TEFLOGSTRING( KTAGENERAL, "PE: CPEMessageHandler::HandleSetAudioMute" );
+    TBool mute = iDataStore.AudioMuteCommand();
+    iGsmAudioData.SetAudioMuteSync( mute );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSetAudioOutput
+// Handles audio output from the phone application.
+// Method fecths output and note values from the CPEEngineInfo and then
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleSetAudioOutput()
+    {
+    TEFLOGSTRING( KTAGENERAL, "PE: CPEMessageHandler::HandleSetAudioOutput" );
+    return iGsmAudioData.SetAudioOutput( iDataStore.AudioOutputCommand(),
+                                      iDataStore.ShowNoteCommand() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSetAudioVolume
+// Handles change volume message from the phone application.
+// Method fecths volume value from the CPEEngineInfo and then
+// Method sets volume value to the AudioHandling subsystem.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleSetAudioVolume()
+    {    
+    TInt volume = iDataStore.AudioVolumeCommand();
+    TEFLOGSTRING2( KTAGENERAL, "PE: CPEMessageHandler::HandleSetAudioVolume %d", volume );
+    iGsmAudioData.SetAudioVolumeSync( volume );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandlePlayDTMFL
+// Handles key down event.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandlePlayDTMFL()
+    {
+    ProcessPlayDTMFL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleEndDTMF
+// Handles key up event.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleEndDTMF()
+    {
+    return ProcessEndDTMF();
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::SetClientInformation
+// Sets client information.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::SetClientInformation(
+        const TInt aCallId,  
+        const TDesC& aMainPartOfPhoneNumber ) 
+    {
+    // Other ClientInformation it was already set before, in SetClientData
+    // method. Methods is called from HandleClientCallDataL before CallId is known.
+    iClientInformation->SetNumber( aMainPartOfPhoneNumber );
+    
+    iDataStore.SetCallClientInformation( *iClientInformation, aCallId );
+    
+    const TPECallOrigin& origin = iDataStore.CallOriginCommand();    
+    iDataStore.SetCallOrigin( origin, aCallId );    
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::SetClientData
+// Sets client dial data to member variable.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::SetClientData(
+        const CPhCltDialData& aClientDialData ) 
+    {
+    CCCECallParameters& params = iDataStore.CallParameters();
+    
+    iClientDialData = &const_cast<CPhCltDialData&>( aClientDialData );
+
+    iClientInformation->SetName( iClientDialData->Name() );
+    
+    if ( iClientDialData->CallType() == EPhCltVideo || 
+        iClientDialData->CallType() == EPhCltForcedVideo )
+        {
+        iClientInformation->SetCallType( EPECallTypeVideo );
+        iDataStore.SetCallTypeCommand( EPECallTypeVideo );
+        params.SetCallType( CCPCall::ECallTypeVideo );
+        }
+    else if ( iClientDialData->CallType() == EPhCltCallVoIP )
+        {
+        iClientInformation->SetCallType( EPECallTypeVoIP );
+        iDataStore.SetCallTypeCommand( EPECallTypeVoIP );        
+        params.SetCallType( CCPCall::ECallTypePS );
+        }
+    else
+        {
+        iClientInformation->SetCallType( EPECallTypeCSVoice );
+        iDataStore.SetCallTypeCommand( EPECallTypeCSVoice );
+        params.SetCallType( CCPCall::ECallTypeCSVoice );
+        }
+      
+    iClientInformation->SetEndOtherCalls( iClientDialData->EndOtherCalls() );
+    
+    iClientInformation->SetAllowMatch( iClientDialData->AllowMatch() );
+    
+    iClientInformation->SetContactLink( iClientDialData->ContactLink() );
+   
+    iClientInformation->SetShowNumber( iClientDialData->ShowNumber() );
+
+    // Not accept 0, TODO Requirement clarification needed, 
+    // does service id 0 need special handling!
+    if ( iClientDialData->ServiceId() != 0 )
+        {
+        iDataStore.SetServiceIdCommand( iClientDialData->ServiceId() );
+        params.SetServiceId( iClientDialData->ServiceId() );
+        }
+        
+    iDataStore.SetUserToUserInformation( iClientDialData->UUI() );
+    
+    params.SetBearer( iClientDialData->Bearer() );
+    params.SetSubAddress( iClientDialData->SubAddress() );
+    
+    if ( iClientDialData->SATCall() )
+        {
+        params.SetOrigin( CCCECallParameters::ECCECallOriginSAT );
+        }
+    else
+        {
+        params.SetOrigin( CCCECallParameters::ECCECallOriginPhone );
+        }
+    }
+     
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleTerminateAllConnections
+// Method resets redial timer if active and calls TerminateAllConnection 
+// method from the CallHandling subsytem object.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleTerminateAllConnections()
+    {
+    TInt errorCode( ECCPErrorNone );
+    errorCode = iCallHandling.TerminateAllConnections();
+    TEFLOGSTRING2( 
+        KTAGENERAL, 
+        "PE: CPEMessageHandler::HandleTerminateAllConnections: Callhandling::TerminateAllConnections() called, Error code: %d", 
+        errorCode );
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::IsItCharThatCanDelete
+// Checks if character can be delete. If given charter can be located from 
+// KPECharsThatCanBeDelete, method returns ETrue else EFalse.
+// -----------------------------------------------------------------------------
+//
+TBool CPEMessageHandler::IsItCharThatCanDelete( 
+        const TChar& aChar ) const
+    {
+    TPtrC Invalid( KPECharsThatCanBeDelete );
+
+    return Invalid.Locate( aChar ) != ECCPErrorNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::IsValidChar
+// Checks if character is acceptable. If given charter can be located from 
+// KPEClientValidChars, method returns ETrue else EFalse.
+// -----------------------------------------------------------------------------
+//
+TBool CPEMessageHandler::IsValidChar( 
+        const TChar& aChar, //character to be checked
+        const TDesC& aValidChars ) const
+    {
+    return aValidChars.Locate( aChar ) != ECCPErrorNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::RemoveInvalidChars
+// Check all characters validity from descriptor one by one. 
+//    (1) If chater is valid then OK and next charter... 
+//    (2) If invalid check if that can be delete from string.
+//    (3) If it can be delete then DELETE and next charter... 
+//    (4) But if charter can NOT be delete then return value is EFalse.
+// -----------------------------------------------------------------------------
+//
+TBool CPEMessageHandler::RemoveInvalidChars( 
+        TDes& aString, //string to be processed
+        const TDesC& aValidChars,
+        const TBool aCheckForDelete ) const
+    {
+    TBool returnValue = ETrue;
+    TInt index = aString.Length() - 1;
+
+    TEFLOGSTRING2( KTAGENERAL, 
+        "PE: CPEMessageHandler::RemoveInvalidChars, String to parse = %S", &aString );
+
+    for ( ; index >= 0; index-- )
+        {
+        if ( !IsValidChar( aString[ index ], aValidChars ) )//(1)
+            {
+            if ( !aCheckForDelete 
+                || ( aCheckForDelete && IsItCharThatCanDelete( aString[index] ) ) )//(2)
+                {
+                aString.Delete( index, 1 ); // one character  //(3)
+                }
+            else
+                {
+                returnValue = EFalse;//(4) //if String includes alphabets or other forbidden characters return TFalse
+                }
+            }
+        }
+    if ( aCheckForDelete )
+        {
+        TLex input( aString );
+
+        TLexMark start;
+        input.Mark( start );
+
+        while ( input.Peek().IsDigit() ) 
+            {
+            input.Inc();
+            }
+
+        TPtrC mainpart( input.MarkedToken( start ) );
+        if ( mainpart.Length() )
+            {
+            aString = mainpart;
+            }
+    
+        if ( input.Remainder().Length() > 0 )
+            {
+            TPEDtmfString dtmfString = input.Remainder();
+            iDataStore.SetDtmfStringCommand( dtmfString );
+            }
+        else
+            {
+            TPEDtmfString dtmfString( KNullDesC );
+            iDataStore.SetDtmfStringCommand( dtmfString );
+            } 
+        
+        }
+    TEFLOGSTRING2( 
+        KTAGENERAL, 
+        "PE: CPEMessageHandler::RemoveInvalidChars, Parsed string = %S", 
+        &aString);
+    return returnValue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleGetLifeTimerData
+// Reads lifetimerdata from custom api and stores it to engine info
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleGetLifeTimerData() const
+    {
+    TCCPLifeTimeData lifeTimeData; 
+    TCCPLifeTimeDataPckg pckg( lifeTimeData );
+
+    if ( iCallHandling.GetLifeTime( pckg ) )
+        {
+        TEFLOGSTRING2( 
+            KTAGENERAL, 
+            "PE: CPEMessageHandler::HandleGetLifeTimerData, iHours = %d", 
+            lifeTimeData.iHours);
+        TEFLOGSTRING2( 
+            KTAGENERAL, 
+            "PE: CPEMessageHandler::HandleGetLifeTimerData, iMinutes = %d", 
+            lifeTimeData.iMinutes);
+            
+        iDataStore.SetLifeTimerData( pckg );
+        }
+    
+    return ECCPErrorNone;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::CallbackSendMessageStoppedDTMF
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::CallbackSendMessageStoppedDTMF( TAny* aAny )
+    {
+    __ASSERT_ALWAYS( aAny , Panic( EPEPanicNullPointer ) );
+    CPEMessageHandler* self = static_cast<CPEMessageHandler*>(aAny);
+
+    delete self->iAsyncCallBack;
+    self->iAsyncCallBack = NULL;
+    self->iModel.SendMessage( MEngineMonitor::EPEMessageStoppedDTMF ); 
+
+    return ECCPErrorNone;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::RemovePlusPrefix
+// Remove '+' from begin of the string
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::RemovePlusPrefix(
+    TPEPhoneNumber& aPhoneNumber )
+    {
+    TLex input( aPhoneNumber);
+
+    if ( input.Peek() == KPEDtmfPlusChar )
+        {
+        // remove plus char 
+        input.Inc();
+        aPhoneNumber = input.Remainder();
+        TEFLOGSTRING2( KTAMESINT, 
+            "PE CPEMessageHandler::RemovePlusPrefix(), aPhoneNumber: %S"
+            , &aPhoneNumber ); 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleBuildConferenceCall
+// Handles Create conference message from phone application.
+// Method calls BuildConference method from MPECallHandling object.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleBuildConferenceCall()
+    {
+    return iCallHandling.BuildConference();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleGoOneToOne
+// Handles GoOneToOne message from PhoneApplication. Calls GoOneToOne
+// method from CallHandling object.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleGoOneToOne()
+    {
+    TInt callId = iDataStore.CallId();
+    __ASSERT_DEBUG( CallIdCheck::IsVoice( callId ), 
+        Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCallHandling.GoOneToOne( callId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleAddConferenceMember
+// Handles Add conference member message from phone application.
+// Method creates AddMember request to the CallHandling object.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleAddConferenceMember()
+    {
+    TEFLOGSTRING( KTAINT, 
+       "PE CPEMessageHandler::HandleAddConferenceMember ");
+    return iCallHandling.AddConferenceMember();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleAddConferenceMember
+// Handles dropped conference member message from callhandling subsystem.
+// In case a long dtmf string is being sent, cancels the sending process.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleDroppedConferenceMember()
+    {
+    TEFLOGSTRING( KTAINT, 
+       "PE CPEMessageHandler::HandleDroppedConferenceMember");
+    
+    StopDtmfSending();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleCallHandlingError
+// Handles error message from CallHandling subsystem
+// Method fetches error code from CallHandling subsystem and
+// Method sends error code to SAT
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::HandleCallHandlingError(
+        const TInt aCallId,
+        const TBool /*aBusyCall*/ )
+    {
+    // Call data not valid for call id -1, i.e. non-call error situations
+    if ( aCallId != KPECallIdNotUsed )
+        {
+        //Update local call info
+        const TInt errorCode = iCallHandling.GetCallInfo( *iCallInfo, aCallId );
+        
+        // Take the error from call handling.
+        TInt errorForClient = iDataStore.ErrorCode(); 
+        if (  errorCode == ECCPErrorNone )
+            {
+            const TInt diagnosticInfo = 
+                iCallHandling.CallTerminatedError( aCallId );
+            if ( diagnosticInfo != ECCPErrorNone )
+                {
+                errorForClient = diagnosticInfo;
+                }
+            }
+        
+        TEFLOGSTRING2( KTAINT,
+                "PE CPEMessageHandler::HandleCallHandlingError, SendRespond errorForClient: %d", errorForClient );
+        iClientServices->CallRequestMonitor()->SendRespond( errorForClient );            
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleEngineInfo
+// Handles call logging. Method add and update the call info.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleEngineInfo(
+    const TInt aCallId )       
+    {
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEMessageHandler::HandleEngineInfo, call id: %d", aCallId );
+    TInt errorCode(  ECCPErrorNone );
+    TPEState callState;
+    
+    errorCode = FindCallInfo( aCallId );
+
+    if ( !errorCode )
+        {
+        callState = iCallHandling.GetCallState( aCallId );
+        TEFLOGSTRING2( KTAINT, 
+            "PE CPEMessageHandler::HandleEngineInfo, call state: %d", 
+            callState );
+
+        SetPhoneNumberForCallLogging( aCallId );
+
+        if ( callState == EPEStateDialing || callState == EPEStateRinging )
+            {
+            errorCode = UpdateClientInfo( aCallId );
+
+            iDataStore.SetRemoteIdentity( 
+                static_cast< RMobileCall::TMobileCallRemoteIdentityStatus > ( 
+                    iCallInfo->iRemoteParty.iRemoteIdStatus ), 
+                aCallId );
+            iTime.UniversalTime();
+            iDataStore.SetCallStartTime( iTime, aCallId );
+            iDataStore.SetCallDuration( 0, aCallId );
+            }
+
+        // Calls have to log also without a contact (ECCPErrorNotFound).
+        if ( errorCode == ECCPErrorNone || errorCode == ECCPErrorNotFound)
+            {
+            errorCode = ECCPErrorNone;
+            
+            // If call is emergency call, phonenumber must be fetched from engine info
+            // Log type must be recognized from call id also, because in idle state
+            // TSY has cleaned call info information
+            CheckAndHideIdentity( aCallId );
+
+            // Save the rest of information to EngineInfo.
+            SetLoggingInfo( aCallId, callState );
+            // Set missed call to EngineInfo.
+            IsMissedCall( aCallId, callState );
+            errorCode = iLogHandling.SaveCallEntry( aCallId );
+            }
+        } //if ( !errorCode )
+        
+    return errorCode;
+    }   
+ 
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::UpdateClientInfo
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::UpdateClientInfo( 
+    const TInt aCallId )
+    {
+    TInt errorCode( ECCPErrorNone );
+    const MPEClientInformation& clientInformation = iDataStore.CallClientInformation( aCallId );
+    
+    TEFLOGSTRING2( 
+        KTAINT, 
+        "PE CPEMessageHandler::UpdateClientInfo, remote name: '%S'", 
+        &iDataStore.RemoteName( aCallId ) );
+
+    TEFLOGSTRING2( 
+        KTAINT, 
+        "PE CPEMessageHandler::UpdateClientInfo, name: '%S'", 
+        &clientInformation.Name() );
+
+    TEFLOGSTRING2( 
+        KTAINT, 
+        "PE CPEMessageHandler::UpdateClientInfo, allowmatch: %d", 
+        clientInformation.AllowMatch() );
+    
+    if ( EPECallOriginSAT != iDataStore.CallOrigin(aCallId) && 
+       ( aCallId != KPEEmergencyCallId ) )
+        {
+        TEFLOGSTRING2( 
+            KTAINT, 
+            "PE CPEMessageHandler::UpdateClientInfo, match phone number: '%S'", 
+            &iDataStore.RemotePhoneNumber( aCallId ) );
+        if ( clientInformation.ContactLink().Length() > 0 )
+            {
+            errorCode = iContactHandling.FindContactInfoSync( 
+            aCallId, 
+            EPEFindWithContactId );
+            }    
+        else
+            {
+            errorCode = iContactHandling.FindContactInfoSync( 
+            aCallId, 
+            EPEFindWithPhoneNumber );            
+            }
+            
+        TEFLOGSTRING2( 
+            KTAINT, 
+            "PE CPEMessageHandler::UpdateClientInfo > MPEContactHandling::FindContactInfoSync( EPEFindWithPhoneNumber ), error code: %d", 
+            errorCode );
+        }
+    
+    // Calls have to log also without a contact (ECCPErrorNotFound).
+    if ( errorCode == ECCPErrorNone || errorCode == ECCPErrorNotFound)
+        {
+        // Set name to EngineInfo
+        SetName( aCallId );
+        }
+     return errorCode;   
+     }   
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::CheckAndHideIdentity
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::CheckAndHideIdentity(
+    const TInt aCallId )   
+    {
+    // If call is emergency call, phonenumber must be fetched from engine info
+    // Log type must be recognized from call id also, because in idle state
+    // TSY has cleaned call info information
+    RMobileCall::TMobileCallRemoteIdentityStatus tempIdentity;
+    tempIdentity = iDataStore.RemoteIdentity( aCallId );
+    
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEMessageHandler::CheckAndHideIdentity, Identity: %d", tempIdentity );
+    if ( iCallInfo->iEmergency || aCallId == KPEEmergencyCallId ) 
+        {
+        iDataStore.SetRemotePhoneNumberType( EPEEmergencyNumber, aCallId );
+        }
+    else if( iDataStore.CallDirection( aCallId ) != RMobileCall::EMobileOriginated )
+        {
+        switch( tempIdentity )
+            {
+            case RMobileCall::ERemoteIdentitySuppressed:
+                {
+                // It is neccessary to perform an additional check for available
+                // remote party phone number to comply with Italian operator
+                // requirement: "If CLIR is active but network still provides
+                // the device with a phone number, it should not be blocked
+                // but passed to a client when requested."
+                if( iDataStore.RemotePhoneNumber( aCallId ).Length() == 0 )
+                    {
+                    HideIdentification( EPEPrivateNumber, aCallId );
+                    }
+                else
+                    {
+                    // Align remote identity with remote phone number availability.
+                    iDataStore.SetRemoteIdentity( RMobileCall::ERemoteIdentityAvailable, aCallId );
+                    }
+                break;
+                }
+            case RMobileCall::ERemoteIdentityAvailableNoCliRejectedByUser:
+                {
+                HideIdentification( EPEPrivateNumber, aCallId );
+                break;
+                }
+            case RMobileCall::ERemoteIdentityUnknown:
+            case RMobileCall::ERemoteIdentityAvailableNoCliInteractionWithOtherService:
+            case RMobileCall::ERemoteIdentityUnavailableNoCliInteractionWithOtherService:
+            case RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone:
+            case RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone:
+            case RMobileCall::ERemoteIdentityAvailableNoCliUnavailable:
+                {
+                HideIdentification( EPEUnknownNumber, aCallId );
+                break;
+                }
+            case RMobileCall::ERemoteIdentityAvailable:
+            default:
+                {
+                TEFLOGSTRING( KTAINT,
+                    "PE CPEMessageHandler::CheckAndHideIdentity, CLI available" );
+                break;
+                }
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::FindCallInfo
+// Return callInfo from Etel/TSY.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::FindCallInfo(
+        const TInt aCallId )
+    {
+    TInt errorCode( ECCPErrorNone );
+    if ( CallIdCheck::IsVoice( aCallId ) || CallIdCheck::IsVideo( aCallId ) )
+        {
+        // Single call
+        errorCode = iCallHandling.GetCallInfo( *iCallInfo, aCallId );
+        TEFLOGSTRING3( 
+            KTAREQOUT, 
+            "CNT CPEMessageHandler::FindCallInfo > MPECallHandling::GetCallInfo, call id: %d, error code: %d", 
+            aCallId, 
+            errorCode );
+        TEFLOGSTRING2( 
+            KTAINT, 
+            "CNT CPEMessageHandler::FindCallInfo, remote number: '%S'", 
+            &iCallInfo->iRemoteParty.iRemoteNumber );
+        TEFLOGSTRING2( 
+            KTAINT, 
+            "CNT CPEMessageHandler::FindCallInfo, direction: %d", 
+            iDataStore.CallDirection( aCallId ) );
+        TEFLOGSTRING2( 
+            KTAINT, 
+            "CNT CPEMessageHandler::FindCallInfo, id status: %d", 
+            iCallInfo->iRemoteParty.iRemoteIdStatus );
+        }
+    else
+        {
+        // We don't log the master conference call and other unknown calls.
+        errorCode = KErrUnknown;
+        }
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::SetPhoneNumberForCallLogging
+// Set phonenumber for call logging
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::SetPhoneNumberForCallLogging(
+        const TInt aCallId )
+    {
+    // if call is MO then the phonenumber must be stored from dialled party.
+    if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated )
+        {
+
+        TPEPhoneNumber number;        
+        const TPECallOrigin origin = iDataStore.CallOrigin( aCallId );
+        
+        if ( origin == EPECallOriginSAT )
+            {
+            // Dont set for SAT calls >> number not logged
+            }
+        else if( iDataStore.PhoneNumber().Length() )
+            {
+            // Phonenumber given by user, includes pfe- and postfix.
+            number = iDataStore.PhoneNumber();
+            }   
+        else
+            {
+            // If call is made using ETel api, then phonenumber must take from callinfo.
+            number = iCallInfo->iDialledParty.iTelNumber;
+            }
+        
+        
+        // WholeOutgoingPhoneNumber should set only one time because in connected state 
+        // PhoneNumber is cleaned from datastore.
+        if( !iDataStore.WholeOutgoingPhoneNumber( aCallId ).Length() )
+            {
+        
+            TEFLOGSTRING2( KTAINT,
+                    "PE CPEMessageHandler::SetPhoneNumberAndDataCallLogging, number: '%S'"
+                    ,&number );
+            iDataStore.SetWholeOutgoingPhoneNumber( number, aCallId ); 
+            }
+        
+        // RemotePhoneNumber should set only one time because user can edit DataStore::PhoneNumber after dialing was started.
+        if( !iDataStore.RemotePhoneNumber( aCallId ).Length() )
+            {
+            TEFLOGSTRING3( 
+                KTAMESINT, 
+                "PE CPEMessageHandler::SetPhoneNumberForCallLogging, remote phone number: '%S', call id: %d", 
+                &number, aCallId );
+                                         
+            RemovePreAndPostFix( number );
+  
+            iDataStore.SetRemotePhoneNumber( number, aCallId );
+            }
+        
+        // The Colp number is stored to remoteparty in connected state.
+        TPEPhoneNumber colpNumber = iCallInfo->iRemoteParty.iRemoteNumber.iTelNumber;
+        RemovePreAndPostFix( colpNumber );
+        iDataStore.SetRemoteColpNumber( colpNumber, aCallId ); 
+        TEFLOGSTRING3( 
+            KTAMESINT, 
+            "PE CPEMessageHandler::SetPhoneNumberForCallLogging, colp number: '%S', call id: %d", 
+            &colpNumber, aCallId );
+        }
+    else if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileTerminated )
+        {
+        iDataStore.SetRemotePhoneNumber( iCallInfo->iRemoteParty.iRemoteNumber.iTelNumber, aCallId );
+        TEFLOGSTRING2( 
+            KTAMESINT, 
+            "PE CPEMessageHandler::SetPhoneNumberForCallLogging: remote phone number: '%S'", 
+            &iCallInfo->iRemoteParty.iRemoteNumber.iTelNumber );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::SetLoggingInfo
+// Store call information for logging
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::SetLoggingInfo(
+        const TInt aCallId,
+        TPEState aCallState )
+    {
+    if ( aCallState == EPEStateConnected )
+        {
+        iDataStore.SetCallStartTime( iCallInfo->iStartTime, aCallId );   
+        }
+    iDataStore.SetCallForwarded( iCallInfo->iForwarded, aCallId );
+    iDataStore.SetCallService( iCallInfo->iService, aCallId );
+    iDataStore.SetCallState( aCallState, aCallId );
+    iDataStore.SetCallDuration( iCallInfo->iDuration.Int() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::SetName
+// Set calling name or client name to RemoteInfo.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::SetName( const TInt aCallId )
+    {
+    if ( iDataStore.RemoteName( aCallId ).Length() <= 0 &&
+         iDataStore.RemoteCompanyName( aCallId ).Length() <= 0 &&
+         iCallInfo->iRemoteParty.iCallingName.Length() >0 ) 
+        { 
+        iDataStore.SetRemoteName( iCallInfo->iRemoteParty.iCallingName, aCallId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HideIdentification
+// Hide identification to RemoteInfo.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::HideIdentification(
+        TPEPhoneNumberIdType aPhoneNumberId,
+        const TInt aCallId )
+    {
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEMessageHandler::HideIdentification: aPhoneNumberId = %d", aPhoneNumberId );
+    iDataStore.SetRemotePhoneNumberType( aPhoneNumberId, aCallId );
+    iDataStore.SetRemotePhoneNumber( KNullDesC(), aCallId );
+    iDataStore.SetRemoteName( KNullDesC(), aCallId );
+    iDataStore.SetRemotePartyName( KNullDesC(), aCallId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::IsMissedCall
+// Check missed call in the idle state.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::IsMissedCall(
+        const TInt aCallId,
+        TPEState aCallState )
+    {
+    if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileTerminated )
+        {
+        // If remote party has hanged up the current call on Ringing state, 
+        // this call is the missed call in the idle state.
+        if ( aCallState == EPEStateIdle )
+            {
+            TBool missedCall = EFalse;
+
+            if ( CallIdCheck::IsVoice( aCallId ) || CallIdCheck::IsVideo( aCallId ) )
+                {
+                iCallHandling.GetMissedCall( missedCall, aCallId );
+                }
+
+            iDataStore.SetMissedCall( missedCall, aCallId );
+            } 
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleCancelSSstringCommand
+// Handles cancel SS string command.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleCancelSSstringCommand()
+    {
+    TInt returnValue( ECCPErrorNone );
+
+    returnValue = iSSHandler->Cancel();
+
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleConferenceIdleState
+// Handles EPEMessageConferenceIdle message.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleConferenceIdleState( 
+        const TInt aCallId )
+    {
+    TInt counter;
+    TInt conferenceValue;
+
+    TTimeIntervalSeconds duration;
+    TInt errorCode = iCallHandling.GetCallDuration( duration, aCallId );
+    
+    // Duration offset is stored previously to data store using conference members
+    // duration. If we do not check for null here then the stored offset is ignored..
+    if ( ECCPErrorNone == errorCode && duration.Int() > 0 ) 
+        {
+        // Set last conference duration
+        iDataStore.SetCallDuration( duration.Int() );
+        }
+    else if ( ECCPErrorNone == errorCode && duration.Int() == 0 )
+        {
+        // copy conference call duration to last call duration
+        // all call specific data is erased a few lines down
+        iDataStore.SetCallDuration( iDataStore.CallDuration( aCallId ).Int() );
+        }   
+
+    //Reset values to the TPECallInfo structure
+    iDataStore.ResetCallInfo( aCallId );
+
+    // Reset Conference Master info from all ex-members
+    for ( counter = 0; counter < KPEMaximumNumberOfVoiceCalls; counter++ )
+        {
+        conferenceValue = iDataStore.CallConference( counter );
+        if ( conferenceValue == aCallId )
+            {
+            iDataStore.SetCallConference( KPENormalVoiceCall, counter );
+            }
+        }
+    
+    //Stops possible ringing tone playing
+    //APS Stops possible remote alerting tone playing
+    TEFLOGSTRING( KTAMESINT, 
+        "PE  CPEMessageHandler::HandleConferenceIdleState > iGsmAudioData.StopInbandTonePlay()");
+    iGsmAudioData.StopInbandTonePlay(); 
+    
+    ClearCallAudio();    
+        
+    return ECCPErrorNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleConnectedState
+// Handles connected message from the CallHandling subsystem 
+// 
+//  Method fetches call state and ALS line values from the Callhandling subsystem and then
+//  Method fetches remote information from the CPEEngineInfo class and then
+//  Method sets new values to the logInfo parameters and then
+//  Method updates call values to the LogHandling subsystem and then
+//  Method sets new values to the CPEEngineInfo class and then
+//  Method fecths possible dtmf string from the CPEParserPhoneNumberHandler class and then
+//  Method calls HandleSendDtmf method if dtmf string lenght was more than zero.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleConnectedState( 
+        const TInt aCallId )
+    {
+    TInt errorCode( ECCPErrorNone );
+    TPEState callState;
+    TPEDtmfString dtmfString;
+
+    RMobileCall::TMobileCallDirection callDirection;
+    callDirection = iDataStore.CallDirection( aCallId );
+
+    //Stops possible local playing of remote alerting tone
+    TEFLOGSTRING( 
+        KTAMESINT, 
+        "PE  CPEMessageHandler::HandleConnectedState: Calling iGsmAudioData.StopInbandTonePlay()");
+    iGsmAudioData.StopInbandTonePlay();
+
+    //If call was held then no logging is done.
+    callState = iDataStore.CallState( aCallId );
+    if ( callState != EPEStateHeld )
+        {
+        errorCode = HandleEngineInfo( aCallId );
+
+        // If phone number has contained dtmf string, phone engine sends dtmf string now.
+        // Only in MO - call.
+
+        if ( callDirection == RMobileCall::EMobileOriginated )
+            {
+            if ( aCallId == KPEEmergencyCallId )
+                {
+                dtmfString = iDataStore.DtmfStringCommand();
+                if ( dtmfString.Length() > 0 )
+                    {
+                    errorCode = HandleSendDtmf();
+                    }
+                }
+             else 
+                {
+
+                dtmfString = iDataStore.DtmfPostFix( aCallId );
+                
+                if ( dtmfString.Length() > 0 )
+                    {
+                    iDataStore.SetDtmfStringCommand( dtmfString );
+                    errorCode = HandleSendDtmf();
+                    }
+                }
+
+            iDataStore.SetErrorCode( errorCode );
+            }
+        }
+    // For Sat call ( normal or emergency )    
+    iClientServices->CallRequestMonitor()->SendRespond( ECCPErrorNone );
+    
+    // Reset Phonenumber from engine info, this is necessary so that call number
+    // logging works OK (see CPEMessageHandler::SetPhoneNumberForCallLogging).  
+    iDataStore.SetPhoneNumber( KNullDesC() );
+    
+    // COLP number is updated in connected state 
+    UpdateRemotePartyInfo();
+   
+    return ECCPErrorNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDialCall
+// Handles dial message from phone application
+// 
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleDialCall(
+    const TBool aClientCall )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDialCall" );
+    TInt errorCode( ECCPErrorNone );
+
+    TRAPD( trapError, errorCode = HandleDialCallL( aClientCall ));
+
+    if ( trapError )    
+        {
+        if ( aClientCall )    
+            {
+            iClientServices->CallRequestMonitor()->SendRespond( trapError );                    
+            }
+        TEFLOGSTRING2( KTAINT, "PE CPEMessageHandler::HandleDialCall: trapError = %d", trapError );
+        return trapError;
+        }
+    return errorCode;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDialEmergencyCall
+// Handles dial message from phone application
+// 
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleDialEmergencyCall(
+    const TBool aClientCall )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDialEmergencyCall" );
+    TInt errorCode( ECCPErrorNone );
+
+    if( iEmergencyCallActive && aClientCall )
+        {
+        // Client tried to make an emergency call even though we already
+        // have an active emergency call.
+        iClientServices->CallRequestMonitor()->SendRespond( ECCPErrorAlreadyInUse );
+        // Notify PhoneApp which is responsible for showing the error note
+        return ECCPErrorAlreadyInUse;
+        }
+    
+    iDataStore.SetCallTypeCommand( EPECallTypeCSVoice );
+        
+    // Check the phone number and change the prefix if needed
+    CheckPrefix();
+    
+    if ( aClientCall )
+        {
+        TPEPhoneNumber phoneNumber = iDataStore.PhoneNumber();
+        __ASSERT_DEBUG( !( phoneNumber == KNullDesC ), Panic( EPEPanicInvalidParameter));
+
+        TBuf<KPEPhoneNumberMaxLength> tempPhoneNumber = phoneNumber;
+        RemoveInvalidChars( tempPhoneNumber, KPEClientValidChars, ETrue );
+        RemovePreAndPostFix( tempPhoneNumber );
+        
+        SetClientInformation( KPEEmergencyCallId, tempPhoneNumber );
+        iClientServices->CallRequestMonitor()->SendRespond( ECCPErrorNone );
+        }
+
+    if ( IsActiveVideo() )
+        {
+        // PhoneApp needs to request releasing of data port from video telephony engine
+        // Emergency call initialization will continue after receiving MPEPhoneModel::
+        // EPEMessageContinueEmergencyCallInitialization
+        iModel.SendMessage( MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo );
+        }
+    else
+        {
+        ContinueDialEmergency();
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDialCallL
+// Handles dial message from phone application
+// 
+//  Method fecths phone number from the CPEEngineInfo class and then
+//  Method sets process type to the CPEParserPhoneNumberHandler and then
+//  Method fecths clir settings from the Settings utility subsystem and tehn
+//  Method fecths call parameters from the CallHandling subsystem and then
+//  Method sets updated call parameter to the CallHandling subsystem and then
+//  Method parsers phonenumber and then
+//  Method process parsing result with PhoneParser
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleDialCallL(
+    const TBool aClientCall )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDialCallL" );
+    TBool parsingResult;
+    TPEPhoneNumber phoneNumber;
+    TInt errorCode( ECCPErrorNone );
+    TInt numberOfCalls;
+    
+    if ( aClientCall )
+        {
+        HandleClientCallData();
+        }
+    else 
+        {
+        iDataStore.SetCallOriginCommand(EPECallOriginPhone);
+        }
+        
+    //Get number of calls
+    numberOfCalls = iCallHandling.GetNumberOfCalls();
+
+    // Check the phone number for prefix change and change the prefix if needed
+    CheckPrefix();
+
+    phoneNumber = iDataStore.PhoneNumber();
+  
+    __ASSERT_ALWAYS( !( phoneNumber == KNullDesC ), User::Leave( ECCPErrorInvalidPhoneNumber ));
+    
+    // Number parser operations
+    iOptions->SetOptionStatus( KPhoneOptionSend, ETrue );
+    iOptions->SetOptionStatus( KPhoneOptionInCall, numberOfCalls > 0 );
+    // If voip call request
+    if( iDataStore.CallTypeCommand() == EPECallTypeVoIP )
+        {
+        iOptions->SetOptionStatus( KPhoneOptionVoipCall, ETrue );
+        }
+    else
+        {
+        iOptions->SetOptionStatus( KPhoneOptionVoipCall, EFalse );
+        }
+
+    parsingResult = iParser->ParseL( phoneNumber, *iResult, *iOptions );
+    if ( parsingResult )
+        {
+        iGsmParserErrorCode = ECCPErrorNone;
+        iParserHandlerContainer->ProcessL( *iResult );
+        errorCode = iGsmParserErrorCode;
+        }
+    else
+        {
+        // string was not recognised by any of the parser objects
+        TEFLOGSTRING( KTAERROR, 
+            "PE CPEMessageHandler::HANDLEDIALCALLL: PHONEPARSER DID NOT RECOGNIZE THE STRING!" );
+        errorCode = KErrArgument;
+        }
+
+    if ( aClientCall )
+        {
+        // Do not sent the response to SAT, unless there is error.
+        const TPECallOrigin& origin = iDataStore.CallOriginCommand();            
+        if ( origin != EPECallOriginSAT || errorCode )    
+            {
+            iClientServices->CallRequestMonitor()->SendRespond( errorCode );                    
+            }
+        }
+
+    TEFLOGSTRING2( KTAINT, "PE CPEMessageHandler::HandleDialCallL: errorCode = %d", errorCode );
+        
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSatCallRequestCompleted
+// Sends respond to SAT after dial request completion
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::HandleSatCallRequestCompleted()
+    {
+    // Monitor with active request completes
+    iClientServices->CallRequestMonitor()->
+        SendRespond( iCallHandling.CallTerminatedError( iDataStore.CallId() ));                    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDialEmergency
+// Handles emergency call message from phone application
+//
+//  Method calls DialEmergencyCall method from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::ContinueDialEmergency()
+    {
+    iDataStore.SetCallId( KPEEmergencyCallId );
+    if ( !iEmergencyCallActive )
+        {
+        iExternalDataHandler.Set( EPEEmergencyCallInfo, ETrue );  
+        iEmergencyCallActive = ETrue;        
+        }
+        // unmute mic
+        iDataStore.SetAudioMuteCommand( EFalse );
+        HandleSetAudioMute();
+
+    iCallHandling.DialEmergencyCall( iDataStore.PhoneNumber() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDialingStateL
+// Handles dialing state transition for voice and video calls
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::HandleDialingStateL( 
+        const TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDialingStateL <");
+    
+    // Save call direction to engine info.
+    iDataStore.SetCallDirection( RMobileCall::EMobileOriginated, aCallId );
+    
+    // Log the call information.
+    User::LeaveIfError( HandleEngineInfo( aCallId ) );
+    
+    // publish remote party info to Mediator after contact matching is done
+    // as remote party info contains information from contact matching. 
+    UpdateRemotePartyInfo();
+    
+    TBool videoCall =
+        ( iDataStore.CallType( aCallId ) == EPECallTypeVideo ) ? ETrue : EFalse;
+
+    TEFLOGSTRING2(
+            KTAINT,
+            "CPEMessageHandler::HandleDialingStateL, callType: %d",
+            iDataStore.CallType( aCallId ) );
+        
+    // Determine the preferred output for call audio and route accordingly.
+    // Routing for incoming voice call is done in answering state.
+    HandleAudioRouting( videoCall, aCallId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleIncomingCallL
+// Handles incoming voice and video call
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleIncomingCallL( 
+        const TInt aCallId )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleIncomingCallL <");
+    
+    // Save call direction to engine info.
+    iDataStore.SetCallDirection( RMobileCall::EMobileTerminated, aCallId );
+
+    // Log the call information.
+    User::LeaveIfError( HandleEngineInfo( aCallId ) );
+    
+    // publish remote party info to Mediator after contact matching is done
+    // as remote party info contains information from contact matching. 
+    UpdateRemotePartyInfo();    
+    
+    TInt numberOfCalls = iCallHandling.GetNumberOfCalls();
+    
+    if( numberOfCalls > 1 )
+        {
+        TEFLOGSTRING( 
+            KTAMESINT, 
+            "PE  CPEMessageHandler::HandleIncomingCallL: Calling iGsmAudioData->PlayInbandTone() for call waiting tone");
+        iDataStore.SetInbandTone( ECCPCallWaiting );
+        iGsmAudioData.PlayInbandTone();
+        iWaitingCallId = aCallId;
+        }
+
+    if( AutomaticAnswer( aCallId ) )
+        {
+        TEFLOGSTRING( KTAINT, 
+        "PE  CPEMessageHandler::HandleIncomingCallL: iAutomaticAnswerTimer->StartTimer");
+        iAutomaticAnswerTimer->StartTimer( KPEAutomaticAnswerTimeOut, MEngineMonitor::EPEMessageAnswer, aCallId );
+        }
+
+    // Cancel EnableService, if in progress
+    iServiceHandling.CancelServiceEnabling();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDisconnecting
+// Handles disconnecting. This means network doesn't play inband tones, but PE must play those.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleDisconnecting
+        (
+        const TInt /*aCallId*/  //The identification number of the call.
+        )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDisconnecting" );
+
+    iAutomaticAnswerTimer->Cancel();
+
+    TEFLOGSTRING( KTAMESOUT, 
+        "PE CPEMessageHandler::HandleDisconnecting > iGsmAudioData.PlayInbandTone()");
+    iGsmAudioData.PlayInbandTone();
+    
+    return ECCPErrorNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDisconnectingWithInband
+// Handles disconnecting with inband. This means network plays the inband tones
+// and PhoneEngine does not.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleDisconnectingWithInband(
+        const TInt /*aCallId*/ )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDisconnectingWithInband" );
+    return ECCPErrorNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDropConferenceMember
+// Handles drop message from phone application
+// Method calls DropMember method from CallHandling object.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleDropConferenceMember()
+    {
+    TInt callId = iDataStore.CallId();
+    __ASSERT_DEBUG( CallIdCheck::IsVoice( callId ), 
+        Panic( EPEPanicCallIndexOutOfRange ) );
+    return iCallHandling.DropMember( callId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleHoldCall
+// Handles hold message from phone application
+// Method fecths call id number from the CPEEngineInfo class and then
+// Method calls HoldCall method from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleHoldCall()
+    {
+    return iCallHandling.HoldCall();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleVoiceCallIdleState
+// Handles idle message from the CallHandling subsystem.
+//
+//  Method stops playing possible ringing tone and the
+//  Method gets call and ALS line information from the CallHandling subsystem and then
+//  Method fecth remote party information from the CPEEngineInfo class and then
+//  Method sets new values to the logInfo parameter and then
+//  Method updates log values to the LogHandling subsystem and then
+//  Method updates Engine Info's call terminated diagnostics value and then
+//  Method resets call information.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleVoiceCallIdleState( 
+    const TInt aCallId )
+    {
+    TInt errorCode( ECCPErrorGeneral );
+    TInt returnValue( ECCPErrorNone );
+    TInt numberOfCalls;
+
+    //Stops possible ringing tone playing
+    //APS Stops possible remote alerting tone playing
+    TEFLOGSTRING( KTAMESINT, 
+        "PE  CPEMessageHandler::HandleVoiceCallIdleState > iGsmAudioData.StopInbandTonePlay()");
+    iGsmAudioData.StopInbandTonePlay(); 
+    
+    ClearCallAudio();
+    
+    errorCode = iCallHandling.GetCallInfo( *iCallInfo, aCallId );
+    
+    if (  errorCode == ECCPErrorNone )
+        {
+        TInt diagnosticInfo = iCallHandling.GetCallTerminatedDiagnostics( 
+            iCallInfo->iCallName );
+        // if diagnosticInfo available set diagnostic error code to DataStore    
+        if ( diagnosticInfo != ECCPErrorNone )
+            {
+            iDataStore.SetErrorCode( diagnosticInfo );
+            }
+        }
+
+    errorCode = HandleEngineInfo( aCallId );  
+    iDataStore.SetErrorCode( ECCPErrorNone );
+
+    numberOfCalls = iCallHandling.GetNumberOfCalls();
+
+    if ( numberOfCalls == 0 )
+        {
+        // unmute mic
+        iDataStore.SetAudioMuteCommand( EFalse );
+        HandleSetAudioMute();
+        
+        if ( iEmergencyCallActive )
+            {
+            iExternalDataHandler.Set( EPEEmergencyCallInfo, EFalse );
+            iEmergencyCallActive = EFalse;
+            }
+        }
+
+    // If there is a waiting call (voice or data) on 
+    // the line, and no other calls, play ringing tones for it.
+    else if ( numberOfCalls == 1 )
+        {
+        TPEState callState;
+        callState = iCallHandling.GetCallState( iWaitingCallId );
+        // EPEStateRinging equals MT call
+        if( callState == EPEStateRinging )
+            {
+            // unmute mic
+            iDataStore.SetAudioMuteCommand( EFalse );
+            HandleSetAudioMute();
+            TEFLOGSTRING2( KTAMESINT, 
+                "CPEMessageHandler::HandleVoiceCallIdleState: aCallId = %d", 
+                aCallId );
+            }
+        else 
+            {
+            TEFLOGSTRING2( KTAMESINT, 
+                "CPEMessageHandler::HandleVoiceCallIdleState: callState = %d", 
+                callState );
+            }
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAMESINT, 
+            "CPEMessageHandler::HandleVoiceCallIdleState: numberOfCalls = %d", 
+            numberOfCalls );
+        }
+    
+    iDataStore.ResetCallInfo( aCallId );    
+    
+    //publish remote party info to Mediator after call info has been cleared.
+    UpdateRemotePartyInfo();    
+
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::ProcessPlayDTMFL
+// Handles key down message from phone application
+//
+//  Method fecths key code value from the CallHandling subsystem and then
+//  Method calls StartDtmfTone method from the CallHandling subsystem.
+
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::ProcessPlayDTMFL()
+    {
+    const TChar keyCode = iDataStore.KeyCode();
+    
+    TBuf<1> keyCodeBuf;
+    keyCodeBuf.Append( keyCode );
+    
+    if ( KPEValidDTMFChars().Find( keyCodeBuf ) >= 0 )
+        {
+        if ( iCallHandling.GetNumberOfCalls() > 0 )
+            {   //There is ongoing call(s)
+            iCallHandling.StartDtmfTone( keyCode );
+            }
+        else
+            {
+            iGsmAudioData.PlayDtmfTone( keyCode );            
+            }
+        }
+        
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::ProcessEndDTMF
+// Handles end playing DTMF message from phone application
+// Method calls StopDtmfTone method from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::ProcessEndDTMF()
+    {
+    TInt returnValue( ECCPErrorNone ); 
+    // Number parser operations
+    if ( iCallHandling.GetNumberOfCalls() > 0 )
+        {   //There is ongoing call(s)
+        returnValue =  iCallHandling.StopDtmfTone();
+        }
+    iGsmAudioData.StopDtmfTonePlay();
+    return returnValue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleRejectCall
+// Handles reject message from phone application
+//  Method stops playing possible ringing tone and then
+//  Method calls RejectCall method from the CallHandling subsystem.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleRejectCall
+        (
+        // None.
+        )
+    {
+    //Stops playing ringing tone
+    //Data call
+    iGsmAudioData.StopInbandTonePlay(); 
+    iAutomaticAnswerTimer->Cancel();
+    return iCallHandling.RejectCall( );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleResumeCall
+// Handles resume message from phone application
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleResumeCall()
+    {
+    return iCallHandling.ResumeCall();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSendUssd
+// Handles request from CPEParserMiscHandler
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleSendUssd(
+        const TDesC& aString )   // USSD string to be sent.
+
+    {
+    return iClientServices->SendUssd( aString );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSimStateChanged
+// Handles EPEMessageSIMStateChanged message from DosServer.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::HandleSimStateChanged()  
+    {
+    iDataStore.SetSimState( iSimStateMonitor.SimState() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleStartUpL
+// Handles startup message from the phone application.
+// Method calls StartUp method from the CallHandling subsystem and then
+// Method calls StartUp method from the AudioHandling subsystem and then
+// Method starts monitoring client originated calls.
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::HandleStartUp()
+    {
+    iCallHandling.StartUp( );
+    iGsmAudioData.StartUp( );
+    
+    iClientServices->StartMonitoring( );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleVideoCallConnected
+// Handles data call logging in connected and idle state.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleVideoCallConnected(
+        const TInt aCallId )
+    {
+    //Stops possible remote alerting tone playing
+    TEFLOGSTRING( 
+        KTAINT, 
+        "PE  CPEMessageHandler::HandleVideoCallConnected > CPEGsmAudioData::StopInbandTonePlay()");
+    iGsmAudioData.StopInbandTonePlay(); 
+    // EFalse updates log information.
+    TInt errorCode = HandleEngineInfo( aCallId );
+    iDataStore.SetErrorCode( errorCode );
+    return ECCPErrorNone; 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleVideoCallIdle
+// Handles data call logging and a possible waiting voice call in Idle state.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleVideoCallIdle(
+        const TInt aCallId )
+    {
+    TInt numberOfCalls;
+    //Stops possible remote alerting tone playing
+    TEFLOGSTRING( KTAINT,
+        "PE CPEMessageHandler::HandleVideoCallIdle > CPEGsmAudioData::StopInbandTonePlay()");
+    iGsmAudioData.StopInbandTonePlay(); 
+    HandleEngineInfo( aCallId );
+    iDataStore.SetErrorCode( ECCPErrorNone );
+    TInt returnValue( ECCPErrorNone );
+
+    numberOfCalls = iCallHandling.GetNumberOfCalls();
+    if ( numberOfCalls == 0 )
+        {
+        iGsmAudioData.HandleCallEnding();
+
+        // unmute mic
+        iDataStore.SetAudioMuteCommand( EFalse );
+        HandleSetAudioMute();
+        }
+    else if ( numberOfCalls == 1 )
+        {
+        TPEState callState;
+        callState = iCallHandling.GetCallState( iWaitingCallId );
+        // EPEStateRinging equals MT call
+        if ( callState == EPEStateRinging )
+            {
+            TEFLOGSTRING2( KTAMESINT, 
+                "CPEMessageHandler::HandleVideoCallIdle: aCallId = %d", 
+                aCallId );
+            iGsmAudioData.HandleCallEnding();
+            
+            // unmute mic
+            iDataStore.SetAudioMuteCommand( EFalse );
+            HandleSetAudioMute();
+            }
+        else 
+            {
+            TEFLOGSTRING2( KTAMESINT, 
+                "CPEMessageHandler::HandleVideoCallIdle: callState = %d", 
+                callState );
+            }
+        }
+    else
+        {
+        TEFLOGSTRING2( KTAMESINT, 
+            "CPEMessageHandler::HandleVideoCallIdle: numberOfCalls = %d", 
+            numberOfCalls );
+        }
+    iDataStore.ResetCallInfo( aCallId );
+    
+    //publish remote party info to Mediator after call info has been cleared.
+    UpdateRemotePartyInfo();    
+    
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleEmergencyCheck
+// Check is given number emergency number.
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleEmergencyCheck( )
+    {
+    TInt errorCode( ECCPErrorNone );
+    TPEPhoneNumber emergencyNumber;
+    TBool isEmergency;
+    emergencyNumber = iDataStore.PhoneNumber();
+
+    errorCode = iClientServices->IsEmergencyPhoneNumber( emergencyNumber, isEmergency );
+    if ( isEmergency  && errorCode == ECCPErrorNone )
+        {
+        iModel.SendMessage( MEngineMonitor::EPEMessageValidEmergencyNumber );
+        }
+    else
+        {
+        iModel.SendMessage( MEngineMonitor::EPEMessageInValidEmergencyNumber );
+        }
+
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandlePhoneNumberEditedL
+// Handles Phone Number Edited message from phone application, 
+// called when user is used paste or delete command.
+// Method check if there is ongoing call(s) if there is return ECCPErrorNone else
+// method fecths phone number from the CPEEngineInfo class and 
+// then method parsers phonenumber and then method process parsing result
+// with PhoneParser and Phoneengine.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+// 
+void CPEMessageHandler::HandlePhoneNumberEditedL()
+    {
+    TBool isServiceCode( EFalse );
+
+    iOptions->SetOptionStatus( KPhoneOptionInCall, 
+        ( iCallHandling.GetNumberOfCalls() > 0 ) );
+
+    iOptions->SetOptionStatus( KPhoneOptionSend, EFalse );
+    iOptions->SetOptionStatus( KPhoneOptionVoipCall, EFalse );
+
+    if( iParser->ParseL( iDataStore.PhoneNumber(), *iResult, *iOptions ) )
+        {
+        isServiceCode = ETrue;
+        iGsmParserErrorCode = ECCPErrorNone;
+        iParserHandlerContainer->ProcessL( *iResult );
+        }
+    else // check for service codes that require SEND
+        {
+        iOptions->SetOptionStatus( KPhoneOptionSend, ETrue );
+        if ( iParser->ParseL( iDataStore.PhoneNumber(), *iResult, *iOptions ) )
+            {
+            // if there is an incoming call only certain codes are allowed       
+            if ( iCallHandling.IsCallInState( EPEStateRinging ) &&
+                 !iCallHandling.IsCallInState( EPEStateConnected ) )
+                {
+                isServiceCode = PhoneGsmParser::IsAllowedForArriving( *iResult );
+                }
+            else
+                {
+                const PhoneGsmParser::TContentType type = 
+                    PhoneGsmParser::DetermineContentType( *iResult );
+                    
+                if ( type == PhoneGsmParser::EContentSupplementaryService ||
+                     type == PhoneGsmParser::EContentUnstructuredService )
+                    {
+                    isServiceCode = ETrue;
+                    }
+                }
+            }
+        }
+        
+    iDataStore.SetPhoneNumberIsServiceCode( isServiceCode );    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::AutomaticAnswer
+// Checks if automatic answer is defined for connected accessory.
+// -----------------------------------------------------------------------------
+// 
+TBool CPEMessageHandler::AutomaticAnswer( const TInt aCallId ) const
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::AutomaticAnswer <" );
+    
+    TInt automaticAnswer( EFalse );
+    TInt accessory( 0 );
+         
+    if ( iCallHandling.GetNumberOfCalls() > 1 ) // The new call need to be the first in the array
+        {
+        return EFalse;
+        }
+        
+    iExternalDataHandler.Get( EPEAccessoryMode, accessory );
+    
+    switch ( accessory )
+        {
+        case EAccModeWiredHeadset:    //Wired headset
+        case EAccModeWirelessHeadset: //Wireless headset
+            {
+            // Safe to ignore error code here, 
+            // automatic answer setting just equals zero == EFalse if it fails
+            iExternalDataHandler.Get( EPEAutomaticAnswerHeadsetSetting, automaticAnswer );
+            break;
+            }
+        case EAccModeWiredCarKit:     //Wired carkit
+            {
+            iExternalDataHandler.Get( EPEAutomaticAnswerCarkitSetting, automaticAnswer );
+            break;
+            }           
+        case EAccModeWirelessCarKit:  //Wireless carkit
+            {
+            iExternalDataHandler.Get( EPEAutomaticAnswerWirelessCarkitSetting, automaticAnswer );                
+            break;
+            }           
+        case EAccModeLoopset:         //Loopset
+            {
+            iExternalDataHandler.Get( EPEAutomaticAnswerLoopsetSetting, automaticAnswer );                
+            break;
+            }           
+        case EAccModeMusicStand:      //Musicstand
+            {
+            iExternalDataHandler.Get( EPEAutomaticAnswerMusicStandSetting, automaticAnswer );                
+            break;
+            }
+         default:
+            break;
+         }
+
+    if ( automaticAnswer )
+        {
+        TFileName noneFilepath;
+        noneFilepath.Append( TParsePtrC( PathInfo::RomRootPath() ).Drive() );
+        noneFilepath.Append( KProfileNoSoundPath() );
+        
+        TProfileRingingType ringingType = iDataStore.RingingType(); 
+        TPEContactFileName ringingTone = iDataStore.RingingTone( aCallId );
+         
+        if ( ringingType == EProfileRingingTypeBeepOnce ||
+             ringingType == EProfileRingingTypeSilent ||
+             ringingTone == noneFilepath )
+            {
+            automaticAnswer = EFalse;
+            }
+        } 
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEMessageHandler::AutomaticAnswer > ret: %d", automaticAnswer );
+    return automaticAnswer;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleStopInbandTonePlay
+// Stop playing a InBand tone
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleStopInbandTonePlay()
+    {
+    iGsmAudioData.StopInbandTonePlay();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleAutomaticAnswerOff
+// Gets EPEMessageAutomaticAnswerOff from UI and makes soft cancelation of the
+// automatic answer when needed
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleAutomaticAnswerOff() const
+    {
+    iAutomaticAnswerTimer->Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleATDialingStarted()
+// Handles AT dialing completed message from Phone UI
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleATDialingStarted( const TBool aSucceed ) const
+    {
+    iClientServices->CommandHandlerMonitor()->DoCompleteCmdAtd( aSucceed ); 
+    }    
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::IsEmergencyAllowed()
+// Checks if emergency call is allowed. 
+// -----------------------------------------------------------------------------
+//
+TBool CPEMessageHandler::IsEmergencyAllowed() const
+    {
+    TBool networkConnectionAllowed( EFalse );
+    //It is safe to ignore error code here: a default value of EFalse is used if the get fails
+    iExternalDataHandler.Get( EPENetworkConnectionAllowedSetting, networkConnectionAllowed );
+    return networkConnectionAllowed;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleClientCallData()
+// Handle Client Call Data.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleClientCallData() 
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleClientCallData" );
+    
+    CPhCltDialData* dialData = iClientServices->CallRequestMonitor()->ClientDialData();
+    
+    // Set already known Client information
+    SetClientData( *dialData );
+    
+    if ( dialData->CallType() == EPhCltVideo || dialData->CallType() == EPhCltForcedVideo )
+        {
+        iDataStore.SetCallTypeCommand( EPECallTypeVideo );
+        }
+    else if( dialData->CallType() == EPhCltCallVoIP )
+        {
+        iDataStore.SetCallTypeCommand( EPECallTypeVoIP );
+        }
+    else
+        {
+        iDataStore.SetCallTypeCommand( EPECallTypeCSVoice );
+        }
+        
+    // End other calls before dial SAT call
+    if ( dialData->EndOtherCalls() )
+        {
+        HandleReleaseAll();
+        TEFLOGSTRING( KTAINT,
+            "PE CPEMessageHandler::HandleClientCallData > HandleReleaseAll()" );
+         }       
+    }    
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::ClearCallAudio
+// Notifies audio handling that there is no active call and audio should be routed
+// accordingly.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::ClearCallAudio()
+    {
+    TEFLOGSTRING( KTAMESINT, "PE CPEMGsmessageHandler::ClearCallAudio()" );
+    TBool restrictingCalls( EFalse );
+
+    if ( iCallHandling.GetNumberOfCalls() > 0 )
+        {
+        restrictingCalls = 
+            // Single call states restricting the devsound notification
+            iCallHandling.IsCallInState( EPEStateConnected ) ||
+            iCallHandling.IsCallInState( EPEStateConnecting ) ||
+            iCallHandling.IsCallInState( EPEStateDialing ) ||
+            iCallHandling.IsCallInState( EPEStateHeld ) ||
+            // Conference call states restricting the devsound notification
+            ( iDataStore.CallState( KPEConferenceCallID )== EPEStateConnectedConference ) ||
+            ( iDataStore.CallState( KPEConferenceCallID ) == EPEStateCreatingConference ) ||
+            ( iDataStore.CallState( KPEConferenceCallID ) == EPEStateGoingOneToOne ) ||
+            ( iDataStore.CallState( KPEConferenceCallID ) == EPEStateAddingConferenceMember ) ||
+            ( iDataStore.CallState( KPEConferenceCallID ) == EPEStateAddedConferenceMember ) ||
+            ( iDataStore.CallState( KPEConferenceCallID ) == EPEStateDroppingConferenceMember ) ||
+            ( iDataStore.CallState( KPEConferenceCallID ) == EPEStateDroppedConferenceMember );
+        }
+    
+    if ( restrictingCalls == EFalse )
+        {
+        // deactivate audio
+        TEFLOGSTRING( KTAMESINT, "PE CPEMGsmessageHandler::ClearCallAudio() Deactivating" );
+        iGsmAudioData.HandleCallEnding();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleSwitchToVideoOrVoice 
+// This method handle EPEMessageSwitchToVideoOrVoice message. If current call id
+// is Data then call will be switched to Voice call and the other way around. 
+// Method set current phonenumber to dataStore and get call parameter and call 
+// hangUp to current call. 
+// When hangUp is completed (EPEMessageIdle was sent) sequence will be continue 
+// from ContinueSwitchToCall method.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleSwitchToVideoOrVoice( const TInt aCallId )
+    {
+    // First get the current phone number and then end voice call
+    // or video call.
+    TInt err( ECCPErrorNone );
+    
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEMessageHandler::HandleSwitchToVideoOrVoice, aCallId : %d", aCallId );
+    // if out of memory case then phonenumber is already datastore.
+    if( aCallId != KPECallIdNotUsed )
+        {
+        if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated )
+            {
+            iDataStore.SetSwitchToNumberCommand( iDataStore.WholeOutgoingPhoneNumber( aCallId ) );  
+            // Clear phonenumber to prevent using the wrong number in MO video call.
+            iDataStore.SetPhoneNumber( KNullDesC() );
+            }
+        else
+            {
+            iDataStore.SetSwitchToNumberCommand( iDataStore.RemotePhoneNumber( aCallId ) );
+            // Remote phone number must be stored as the phone number in case of low-memory situation where 
+            // an MO voice call can be initiated after failing to answer an MT video call.
+            iDataStore.SetPhoneNumber( iDataStore.RemotePhoneNumber( aCallId ) );
+            }
+
+        err = HandleReleaseCall();
+        }
+
+    return err;
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::ContinueSwitchToCall
+// Metdod calls dial to multimedia call or voice call.
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::ContinueSwitchToCall( const TInt aCallId )  
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEMessageHandler::ContinueSwitchToCall, aCallId : %d", aCallId );
+    TInt callId;
+    TInt errorCode( ECCPErrorNone );
+  
+    TPEPhoneNumber phoneNumber = iDataStore.SwitchToNumberCommand();
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEMessageHandler::ContinueSwitchToCall, phoneNumber : %S", 
+        &phoneNumber );
+
+    // Check is current call voice or video
+    if ( CallIdCheck::IsVoice( aCallId ) )
+        {
+        // Create new video call to same phonenumber
+        iDataStore.SetCallTypeCommand( EPECallTypeVideo );
+        errorCode = iCallHandling.DialMultimedia( phoneNumber, callId );
+        }
+    else if ( CallIdCheck::IsVideo( aCallId ) )
+        {
+        // Create new voice call to same phonenumber
+        iDataStore.SetCallTypeCommand( EPECallTypeCSVoice );
+        errorCode = iCallHandling.DialCall( phoneNumber, callId );
+        }
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEMessageHandler::ContinueSwitchToCall(), error : %d", errorCode );    
+    return errorCode;    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::RemovePreAndPostFix
+// Remmove supplementary service prefix and dtmf postfix.
+// Phone number can contain following parts: supplementary
+// service prefix, main part and dtmf postfix.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::RemovePreAndPostFix( 
+        TDes& aString )
+    {
+    // Check that string contains only valid dtmf characters.
+    if ( IsValidDtmfString( aString ))
+        {
+        TLex input( aString ); 
+        
+        RemovePrefix( input );
+        // Take number part.
+        HandleNumberPart( input, aString );        
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::RemovePrefix
+// Removes clir suppress/invoke prefix in the string.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::RemovePrefix( 
+        TLex& aLex )
+    {
+    TPtrC remainder( aLex.Remainder() );
+
+    if ( EqualsLeft( remainder, KPEClirSuppress ) )
+        {
+        aLex.Inc( KPEClirSuppress().Length() );
+        }
+    else if ( EqualsLeft( remainder, KPEClirInvoke ) )
+        {
+        aLex.Inc( KPEClirSuppress().Length() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleNumberPart
+// Search the main part of the phone number.
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleNumberPart(
+        TLex& aLex,
+        TDes& aNumberPart )
+    {   
+    TLexMark start;
+    aLex.Mark( start );
+  
+    // Optional forced call prefixes. 
+    if ( aLex.Peek() == KPENumberAsterisk || 
+         aLex.Peek() == KPENumberHash ) 
+         {
+         aLex.Inc(); 
+         }
+         
+    // Optional international prefix. 
+    if ( aLex.Peek() == KPENumberPlus ) 
+        { 
+        aLex.Inc(); 
+        } 
+
+    // And the rest of number. 
+    while ( ( aLex.Peek().IsDigit() ) ||  
+            ( aLex.Peek() == KPENumberAsterisk ) || 
+            ( aLex.Peek() == KPENumberHash ) ) 
+        {
+        aLex.Inc(); 
+        }
+
+    TPtrC mainpart( aLex.MarkedToken( start ) );
+    const TInt length = mainpart.Length();
+    if ( length <= KPEPhoneNumberMaxLength )
+        {
+        aNumberPart.Copy( mainpart );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::EqualsLeft
+// -----------------------------------------------------------------------------
+//
+TBool CPEMessageHandler::EqualsLeft( 
+        const TDesC& aString, 
+        const TDesC& aPrefix )
+    {
+    TBool result = EFalse;
+
+    if ( aPrefix.Length() <= aString.Length() )
+        {
+        TPtrC part( aString.Left( aPrefix.Length() ) );
+
+        result = ( part == aPrefix );
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleReplaceActive
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleReplaceActive()
+    {
+    return iCallHandling.ReplaceActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::CheckIfPhoneIsLockedL
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::CheckIfPhoneIsLockedL()
+    {
+    // Check if phone is locked
+    TInt  keyLockStatus( EAutolockStatusUninitialized );
+    TInt err = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, keyLockStatus );
+    const TBool phoneIsLocked = ( keyLockStatus > EAutolockOff );
+
+    if ( phoneIsLocked && err == KErrNone )
+        {
+        // New call is not possible if device lock is on 
+        TEFLOGSTRING2( KTAERROR,
+            "PE CPEMessageHandler::CheckIfPhoneIsLockedL, keyLockStatus : %d", keyLockStatus );
+        User::Leave( ECCPErrorAuthenticationFailed );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::IsActiveVideo
+// Checks if there are any connected video calls
+// -----------------------------------------------------------------------------
+// 
+TBool CPEMessageHandler::IsActiveVideo()
+    {
+    TBool activeVideoCall( EFalse );
+    
+    TInt callId = iCallHandling.GetCallIdByState( EPEStateConnected );
+    if ( callId > ECCPErrorNotFound && iDataStore.CallType( callId ) == EPECallTypeVideo )
+        {
+        activeVideoCall = ETrue;
+        }
+    return activeVideoCall;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleServiceEnabled
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleServiceEnabled()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleServiceEnabled ");
+
+    
+    return iVoipNumberHandler->ContinueVoipDial();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleRemotePartyInfoChanged
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleRemotePartyInfoChanged()
+    {
+    UpdateRemotePartyInfo();      
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleUnattendedTransferRequestResponse
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleUnattendedTransferRequestResponse( 
+        TBool aAcceptRequest )
+    {
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEMessageHandler::HandleUnattendedTransferRequestResponse" );
+    
+    if ( aAcceptRequest )
+        {
+        return iCallHandling.AcceptUnattendedTransfer();
+        }
+    else
+        {
+        return iCallHandling.RejectUnattendedTransfer();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleUnattendedTransfer
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::HandleUnattendedTransfer()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleUnattendedTransfer ");
+    TInt errorCode = iCallHandling.DoUnattendedTransfer( 
+            iDataStore.TransferTargetCommand() );
+     
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::ForwardCallToAddress
+// -----------------------------------------------------------------------------
+//
+TInt CPEMessageHandler::ForwardCallToAddress()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::ForwardCallToAddress ");
+    TInt errorCode = iCallHandling.ForwardCallToAddress( 
+            iDataStore.ForwardAddressIndex() );
+     
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDisableService
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::HandleDisableService()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDisableService ");
+    iServiceHandling.DisableService();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::IsValidDtmfString
+// -----------------------------------------------------------------------------
+//
+TBool CPEMessageHandler::IsValidDtmfString( TDes& aString )
+    { 
+    TBool validDtmf = ETrue;
+
+    for( TInt i = 0; i < aString.Length(); i++ )
+        {
+        if ( KErrNotFound == KValidDtmfChars().Locate( aString[i] ) )
+            {
+            validDtmf = EFalse;
+            break;
+            }      
+        }
+    return validDtmf;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::UpdateRemotePartyInfo
+// -----------------------------------------------------------------------------
+//
+void CPEMessageHandler::UpdateRemotePartyInfo( )
+    { 
+    CPERemotePartyInfoMediator* mediatorUpdater = iModel.MediatorCommunicationHandler();
+    if ( mediatorUpdater ) 
+        {
+        mediatorUpdater->UpdateRemotePartyInfo();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::HandleDialCall
+// Handles dial message from dial service
+// 
+// -----------------------------------------------------------------------------
+// 
+TInt CPEMessageHandler::HandleDialServiceCall(
+    const TBool /*aClientCall*/ )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEMessageHandler::HandleDialCall" );
+    TInt errorCode( ECCPErrorNone );
+    //TODO 
+    iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageDialServiceCall );
+    return errorCode;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEMessageHandler::ExecuteKeySequenceL
+// Only sequences which are not issued with send-key are handled here. SS 
+// commands etc. are processed in HandleDialCallL().
+// -----------------------------------------------------------------------------
+//
+TBool CPEMessageHandler::ExecuteKeySequenceL( const TDesC16 &aSequence )
+{
+    TBool keySequenceProcessed( EFalse );
+    
+    iOptions->SetOptionStatus( KPhoneOptionInCall, 
+        ( iCallHandling.GetNumberOfCalls() > 0 ) );
+    iOptions->SetOptionStatus( KPhoneOptionSend, EFalse );
+    iOptions->SetOptionStatus( KPhoneOptionVoipCall, EFalse );
+    
+    if ( iParser->ParseL( aSequence, *iResult, *iOptions ) )
+        {
+        keySequenceProcessed = ETrue;
+        iGsmParserErrorCode = ECCPErrorNone;
+        iParserHandlerContainer->ProcessL( *iResult );
+        }
+    
+    return keySequenceProcessed;
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpenetworkregistrationstatusmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPENetworkRegistrationStatusMonitor class 
+*
+*/
+
+
+// INCLUDES
+#include "cpenetworkregistrationstatusmonitor.h"
+#include "cpepubsubmonitor.h"
+#include "mpephonemodelinternal.h"
+#include <e32property.h>
+#include <mpedatastore.h>
+#include <networkhandlingdomainpskeys.h>
+#include <talogger.h>
+
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None. 
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPENetworkRegistrationStatusMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+CPENetworkRegistrationStatusMonitor* CPENetworkRegistrationStatusMonitor::NewL(
+        MPEPhoneModelInternal& aModel
+        ) 
+    {
+    TEFLOGSTRING(KTAOBJECT, "CPENetworkRegistrationStatusMonitor::NewL");
+    CPENetworkRegistrationStatusMonitor* self = new (ELeave) CPENetworkRegistrationStatusMonitor( 
+        aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return( self );
+    }
+                                                                            
+// -----------------------------------------------------------------------------
+// CPENetworkRegistrationStatusMonitor::CPENetworkRegistrationStatusMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPENetworkRegistrationStatusMonitor::CPENetworkRegistrationStatusMonitor(
+        MPEPhoneModelInternal& aModel
+        ): CPEPubSubMonitor( aModel )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPENetworkRegistrationStatusMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPENetworkRegistrationStatusMonitor::ConstructL(
+        // None
+        )
+        {
+    TEFLOGSTRING(KTAOBJECT, "CPENetworkRegistrationStatusMonitor::ConstructL");
+    
+    BaseConstructL( KPSUidNetworkInfo, KNWRegistrationStatus, RProperty::EInt );
+       
+    //  Now retrieve the value
+    TInt value;
+    TInt error = Get( value );
+    
+    // if not able to retrieve the value, set it to the default value of ENWStatusRegistrationUnknown
+    if ( error != KErrNone )
+        {
+        value = ENWStatusRegistrationUnknown; 
+        }
+        
+    iModel.DataStore()->SetNetworkRegistrationStatus( 
+        static_cast< TNWNetworkRegistrationStatus > ( value ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPECenRepMonitor::UpdateL
+// -----------------------------------------------------------------------------
+//
+void CPENetworkRegistrationStatusMonitor::UpdateL(
+        // None
+        )
+    {
+    TEFLOGSTRING(KTAINT, "CPENetworkRegistrationStatusMonitor::UpdateL" );
+   
+    //  Now retrieve the value
+    TInt value;
+    User::LeaveIfError(Get(value)); 
+        
+    iModel.DataStore()->SetNetworkRegistrationStatus( 
+        static_cast< TNWNetworkRegistrationStatus > ( value ) );
+    iModel.SendMessage( MEngineMonitor::EPEMessageNetworkRegistrationStatusChange );
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparseremergencynumberhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CPEParserEmergencyNumberHandler class methods implementation
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpeclientcallrequestmonitor.h"
+#include "cpemessagehandler.h"
+#include "cpeparseremergencynumberhandler.h"
+#include <mpecallhandling.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPEParserEmergencyNumberHandler::CPEParserEmergencyNumberHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEParserEmergencyNumberHandler::CPEParserEmergencyNumberHandler( 
+        CPEMessageHandler& aOwner, 
+        MPECallHandling& aCallHandling,
+        MPEDataStore& aDataStore
+        ) : iOwner( aOwner ), 
+            iCallHandling( aCallHandling ),
+            iDataStore( aDataStore )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEParserEmergencyNumberHandler::CPEParserEmergencyNumberHandler" )
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserEmergencyNumberHandler::ProcessDialToEmergencyNumberL
+// Process dial to number.
+// -----------------------------------------------------------------------------
+//
+void CPEParserEmergencyNumberHandler::ProcessDialToEmergencyNumberL( 
+        const TDesC& aNumber
+        )
+    {
+    TEFLOGSTRING2( KTAINT, 
+        "PE CPEParserEmergencyNumberHandler::ProcessDialToEmergencyNumberL, number: %S", 
+        &aNumber);
+    /* 
+    * DTMF string is nulled here because if this not done here it is possible that
+    * some old DTMF string is send when emergency call connects(for more information
+    * about connect handling see CPEMessageHandler class HandleConnectedState method ).
+    */
+    iDataStore.SetDtmfStringCommand( KNullDesC() );
+    
+    if ( aNumber.Length() == 0 )
+        {
+        User::Leave( ECCPErrorInvalidPhoneNumber );
+        }
+
+    if ( iDataStore.CallOriginCommand() != EPECallOriginPhone )
+        {
+        iOwner.SetClientInformation( KPEEmergencyCallId, aNumber );
+        }
+
+    iDataStore.SetPhoneNumber( aNumber );
+    iOwner.HandleDialEmergencyCall( EFalse );
+
+    iOwner.SetGsmParserErrorCode( KErrNone );
+    }
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparsermanufacturerhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,294 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Battery state monitoring class methods implementation
+*
+*/
+ 
+
+//  ==================== INCLUDE FILES  ====================
+#include "cpeparsermanufacturerhandler.h"
+#include "mpephonemodelinternal.h"
+#include <mpecallhandling.h>
+#include <mpedatastore.h>
+#include <sysutil.h>
+#include <talogger.h>
+
+
+// CONSTANTS
+const TInt KPESwVersionLineCount = 3;
+const TInt KPEVersionLineFeed = '\n';
+const TInt KPESalesModelNameMaxLength = 20; 
+_LIT( KPESalesModelFileName, "Z:\\resource\\versions\\model.txt");
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPEParserManufacturerHandler::CPEParserManufacturerHandler( 
+        MPEPhoneModelInternal& aModel,
+        MPECallHandling& aCallHandling,
+        RFs& aFsSession )
+        : iModel( aModel ),
+            iCallHandling( aCallHandling ),
+            iFsSession( aFsSession )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEParserManufacturerHandler::CPEParserManufacturerHandler()" );
+    }
+
+// Destructor
+CPEParserManufacturerHandler::~CPEParserManufacturerHandler()
+    {    
+    TEFLOGSTRING( KTAOBJECT, "PE CPEParserManufacturerHandler::~CPEParserManufacturerHandler()" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPhoneManufacturerHandler::ProcessCommandL
+// -----------------------------------------------------------------------------
+//
+void CPEParserManufacturerHandler::ProcessCommandL( 
+        TUint aCommand )       // aCommand command enumeration.
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEParserManufacturerHandler::ProcessCommandL" );
+
+    switch ( aCommand )
+        {
+        case EShowVersion: // *#0000#
+            {
+            TEFLOGSTRING( KTAINT, "PE CPEParserManufacturerHandler::ProcessCommandL, EShowVersion" );
+            
+            TPEPhoneIdentityParameters phoneIdentity;
+            phoneIdentity = iModel.DataStore()->PhoneIdentityParameters();
+            if ( GetSwVersionAndPhoneModelL( phoneIdentity.iRevision ) == KErrNone )
+                {
+                iModel.DataStore()->SetPhoneIdentityParameters( phoneIdentity );
+                iModel.SendMessage( MEngineMonitor::EPEMessageShowVersion );
+                }
+            else
+                {
+                iModel.SendMessage( MEngineMonitor::EPEMessageError );
+                TEFLOGSTRING( KTAERROR, 
+                    "PE CPEGSMPARSERMANUFACTURERHANDLER::PROCESSCOMMANDL: FAILED TO RETRIEVE SW VERSION" );
+                }
+            break;
+            }
+        case EBadPinChange:    
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageBadPin1Change );
+            break;
+            }
+        case EBadPin2Change:
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageBadPin2Change );
+            break;
+            }
+        case EBadPinUnblock:    
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageBadPin1Unblock );
+            break;
+            }
+        case EBadPin2Unblock:
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageBadPin2Unblock );
+            break;
+            }
+        case EActivateRfsNormal:
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageActivateRfsNormal );
+            break;
+            }
+        case EActivateRfsDeep:    
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageActivateRfsDeep );
+            break;
+            }
+        case EActivateWarranty:
+            //lint -fallthrough
+        case ELifeTimer:
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageActivateWarrantyMode );
+            break;
+            }
+        case EShowBtAddress: // *#2820#
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageShowBTDeviceAddress );
+            break;
+            }
+        case EBTLoopback: // *#9990#
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageShowBTLoopback );
+            break;
+            }
+        case EShowWlanMac: // *#62209526#
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageShowWlanMacAddress );
+            break;
+            }
+        case EBTDebugMode: // *#2873#
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageBTDebugMode );
+            break;
+            }
+        default:
+            {
+            TEFLOGSTRING( KTAERROR, "PE CPEGSMPARSERMANUFACTURERHANDLER::PROCESSCOMMANDL: UNEXPECTED COMMAND" );
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserManufacturerHandler::ProcessDebugL
+// -----------------------------------------------------------------------------
+//
+void CPEParserManufacturerHandler::ProcessDebugL(
+        const TDesC& aCode
+        )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEParserManufacturerHandler::ProcessDebugL" );
+    
+    if ( aCode.Length() )
+        {
+        TInt cmd = KErrNotFound;
+        TLex( aCode.Left( 1 ) ).Val( cmd ); // first character.
+
+        TInt param = KErrNotFound;
+        TLex( aCode.Mid( 1 ) ).Val( param ); // rest
+
+        switch ( cmd )
+            {
+            case EPhoneCmdDebugPrint:
+                {
+                //Copied from S60 Telephony. To be migrated to CoTe
+                TEFLOGSTRING( KTAERROR, "PE CPEGSMPARSERMANUFACTURERHANDLER::PROCESSDEBUGL EPHONECMDDEBUGPRINT" );
+                }
+                break;
+
+            case EPhoneCmdHeapFailure:
+                {
+#ifdef PHONE_HEAP_FAILURE_SUPPORT
+                if ( param <= 0 )
+                    {
+                    // Reset alloc failure
+                    User::__DbgSetAllocFail(
+                        RHeap::EUser,
+                        RHeap::ENone,
+                        1 );
+                    }
+                else
+                    {
+                    // Set heap failure
+                    User::__DbgSetAllocFail(
+                        RHeap::EUser,
+                        RHeap::ERandom,
+                        param );
+                    }
+#endif // PHONE_HEAP_FAILURE_SUPPORT
+                } 
+                break;
+
+            default:
+                break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserManufacturerHandler::GetSwVersionAndPhoneModelL
+// Gets sw version from SysUtil::GetSwVersion and loads phone model information
+// from file. This information is set to aSwVersion.
+// -----------------------------------------------------------------------------
+//
+TInt CPEParserManufacturerHandler::GetSwVersionAndPhoneModelL( 
+    TDes& aSwVersion )
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEParserManufacturerHandler::GetSwVersionAndPhoneModelL" );
+    
+    TInt errorCode = SysUtil::GetSWVersion( aSwVersion ) ;
+    
+    TEFLOGSTRING2( KTAINT,
+        "PE CPEParserManufacturerHandler::GetSwVersionAndPhoneModelL > SysUtil::GetSWVersion, error code: %d",
+        errorCode );
+
+    if ( errorCode == KErrNone )
+        {
+        // Remove needless lines
+        RemoveLinesAfterThreeLines( aSwVersion );
+        // Add phone model
+        AppendPhoneModelL( aSwVersion );
+        }
+        
+    return errorCode;  
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserManufacturerHandler::RemoveNeedlessLinesL
+// Removes lines after 3 end-of-line (\n) chars.
+// -----------------------------------------------------------------------------
+//
+void CPEParserManufacturerHandler::RemoveLinesAfterThreeLines( 
+    TDes& aSwVersion ) 
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEParserManufacturerHandler::RemoveLinesAfterThreeLines" );
+    
+    TInt lineFeedCount = 0;
+    
+    const TInt swVersionLength( aSwVersion.Length() );
+    for( TInt i = 0; i < swVersionLength ; i++ )
+        {
+        if( aSwVersion[i] == KPEVersionLineFeed )
+            {
+            lineFeedCount++;
+            if( lineFeedCount == KPESwVersionLineCount )
+                {
+                const TInt charsToDelete( aSwVersion.Length() - i );
+                
+                // Dont delete the last line feed characted, thats why
+                // i + 1.
+                aSwVersion.Delete( i + 1, charsToDelete );
+                return;
+                }
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEParserManufacturerHandler::AppendPhoneModelL
+// Reads phone model info from disk and appends it to aSwVersion.
+// -----------------------------------------------------------------------------
+//
+void CPEParserManufacturerHandler::AppendPhoneModelL(   
+    TDes& aSwVersion ) 
+    {   
+    RFile file;
+    User::LeaveIfError( file.Open( iFsSession, 
+                                   KPESalesModelFileName, 
+                                   EFileShareReadersOnly | EFileRead ) );
+    CleanupClosePushL( file );
+    
+    HBufC* model = HBufC::NewLC( KPESalesModelNameMaxLength );
+    TPtr ptr = model->Des();
+
+    // Read the data from file.
+    TFileText reader;
+    reader.Set( file );
+    User::LeaveIfError( reader.Read( ptr ) );
+
+    // Append the phone model to aSwVersion
+    aSwVersion.Append( *model );
+    
+    CleanupStack::PopAndDestroy( 2 ); // model, file
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparsermischandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  implementation of CPEParserMiscHandler class.
+*
+*/
+
+
+// INCLUDES
+#include "cpeparsermischandler.h"
+#include "cpemessagehandler.h"
+#include <mpecallhandling.h>
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEParserMiscHandler::CPEParserMiscHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEParserMiscHandler::CPEParserMiscHandler(
+        CPEMessageHandler& aOwner,
+        MPECallHandling& aCallHandling
+        ) : iOwner( aOwner ),
+            iCallHandling( aCallHandling )
+    {
+    }
+
+// Destructor
+CPEParserMiscHandler::~CPEParserMiscHandler()
+    {    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserMiscHandler::ProcessShowIMEIL
+// Process IMEI display
+// -----------------------------------------------------------------------------
+//
+void CPEParserMiscHandler::ProcessShowIMEIL()
+    {
+    iCallHandling.UpdatePhoneIdentity( MEngineMonitor::EPEMessageShowIMEI );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserMiscHandler::ProcessUssdL
+// Process USSD request
+// -----------------------------------------------------------------------------
+//
+void CPEParserMiscHandler::ProcessUssdL(
+        const TDesC& aString
+        )
+    {
+    iOwner.HandleSendUssd( aString );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparserphonenumberhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,227 @@
+/*
+* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CPEParserPhoneNumberHandler class methods implementation
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpeclientcallrequestmonitor.h"
+#include "cpemessagehandler.h"
+#include "cpeparserphonenumberhandler.h"
+#include <featmgr.h>
+#include <gsmerror.h>
+#include <mpecallhandling.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+
+// CONSTANTS
+_LIT( KClirSuppress, "*31#" );
+_LIT( KClirInvoke, "#31#" );
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPEParserPhoneNumberHandler::CPEParserPhoneNumberHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEParserPhoneNumberHandler::CPEParserPhoneNumberHandler( 
+        CPEMessageHandler& aOwner, 
+        MPECallHandling& aCallHandling,
+        MPEDataStore& aDataStore
+        ) : iOwner( aOwner ), 
+            iCallHandling( aCallHandling ),
+            iDataStore( aDataStore )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEParserPhoneNumberHandler::CPEParserPhoneNumberHandler" )
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserPhoneNumberHandler::ProcessDialToNumberL
+// Process dial to number.
+// -----------------------------------------------------------------------------
+//
+void CPEParserPhoneNumberHandler::ProcessDialToNumberL( 
+        const TDesC& aNumber,
+        const TDesC& aDtmfPostfix,
+        TClir aClir )
+    {
+    TInt errorCode( ECCPErrorNotFound );
+    TPEPhoneNumber phoneNumber;
+    TInt callId;
+        
+    TEFLOGSTRING3( KTAINT, 
+        "PE CPEParserPhoneNumberHandler::ProcessDialToNumberL, number: %S, dtmf postfix: %S", 
+        &aNumber, 
+        &aDtmfPostfix );
+    
+    // Check if phone is locked
+    iOwner.CheckIfPhoneIsLockedL();
+    
+    if ( aNumber.Length() == 0 )
+        {
+        User::Leave( ECCPErrorInvalidPhoneNumber );
+        }
+
+    if ( aClir == EClirSuppress )
+        {
+        phoneNumber.Copy( KClirSuppress );
+        }
+    else if ( aClir == EClirInvoke )
+        {
+        phoneNumber.Copy( KClirInvoke );
+        }
+    
+    phoneNumber.Append( aNumber );
+    
+    TPECallType processType = iDataStore.CallTypeCommand();
+    if( processType != EPECallTypeVideo )
+        {
+        // TSY not accept phone number that include + or w chartes.
+        TPEPhoneNumber postfix = FilterPostfixL( aDtmfPostfix );
+        if( postfix.Length() )
+            {
+            phoneNumber.Append( postfix );
+            }
+        }
+    TEFLOGSTRING2( KTAINT, 
+          "PE CPEParserPhoneNumberHandler::ProcessDialToNumberL, phoneNumber: %S"
+            , &phoneNumber );
+    //Check for Offline mode
+    if ( IsPhoneOffline() )
+        {
+        //Offline mode is active or network registration failed,
+        //only emergency calls allowed
+        TEFLOGSTRING( KTAERROR, 
+            "PE CPEGSMPARSERPHONENUMBERHANDLER::PROCESSDIALTONUMBERL: CURRENTLY IN OFFLINE MODE: EMERGENCY CALLS ONLY! " );
+        errorCode = ECCPErrorNotAllowedInOfflineMode;
+        }
+    else
+        {
+        switch ( processType )
+            { 
+            case EPECallTypeUninitialized: // There is no information about call, assume voice call
+            case EPECallTypeCSVoice: //Make Dial request
+            case EPECallTypeVoIP:
+                {
+
+                TBool clientCall = iDataStore.CallOriginCommand() != EPECallOriginPhone;
+                errorCode = iCallHandling.DialCall( phoneNumber, callId );
+                //PhoneClient originated call
+                if( clientCall && ( ECCPErrorNone == errorCode ) )
+                    {
+                    iOwner.SetClientInformation( callId, phoneNumber );
+                    }
+                break;
+                }
+            case EPECallTypeVideo:
+                {
+
+                TBool clientCall = iDataStore.CallOriginCommand() != EPECallOriginPhone;
+                errorCode = iCallHandling.DialMultimedia( phoneNumber, callId );
+                // Note that video call dialing does not return an error code if it fails
+                // due to insufficient free memory, so we have to check the call identifier as well.
+                if( clientCall
+                        && callId != KPECallIdNotUsed
+                        && ( ECCPErrorNone == errorCode ) )
+                    {
+                    iOwner.SetClientInformation( callId, phoneNumber );
+                    }
+                break;
+                }
+            default:
+                {
+                errorCode = ECCPErrorNotFound;
+                break;
+                }
+            } 
+        if ( !errorCode )
+            {
+            //Set Dtmf string to dataStore
+            iDataStore.SetDtmfPostFix( aDtmfPostfix, callId );
+            }
+        }
+    iOwner.SetGsmParserErrorCode( errorCode );
+
+    // KErrInUse is returned when we are not allowed to make the call.
+    // One of these cases would be where a MO call is alerting and the user
+    // tries to dial another number via Dialer
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserPhoneNumberHandler::FilterPostfix
+// -----------------------------------------------------------------------------
+// 
+TPtrC CPEParserPhoneNumberHandler::FilterPostfixL( TPtrC aPostfix )
+    {
+    TLex input( aPostfix );
+    TInt stripStart = KErrNotFound;
+    TInt postfixLength = aPostfix.Length();
+    for ( TInt i = 0; i != postfixLength; i ++ )
+        {
+        TChar ch( input.Peek() );
+        if (ch == KDtmfPlus)
+            {
+            User::Leave ( ECCPErrorInvalidPhoneNumber );
+            }
+        else if ( ch == KDtmfWait )
+            {
+            if ( i < stripStart || stripStart == KErrNotFound )
+                {
+                stripStart = i;
+                }
+            }
+        }
+    if ( stripStart != KErrNotFound )
+        {
+        return aPostfix.Left( stripStart );
+        }
+    else
+        {
+        return aPostfix;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserPhoneNumberHandler::IsPhoneOffline
+// -----------------------------------------------------------------------------
+// 
+TBool CPEParserPhoneNumberHandler::IsPhoneOffline()
+    {
+    TBool isPhoneOffline( EFalse );
+
+    if( FeatureManager::FeatureSupported( KFeatureIdOfflineMode )
+        && ( iDataStore.ProfileId() == EProfileOffLineId ) )
+        {
+        isPhoneOffline = ETrue;
+        }
+    
+    TNWNetworkRegistrationStatus networkRegStatus
+        = iDataStore.NetworkRegistrationStatus();
+    
+    if( ( networkRegStatus == ENWStatusRegistrationUnknown )
+        || ( networkRegStatus == ENWStatusNotRegisteredNoService )
+        || ( networkRegStatus == ENWStatusNotRegisteredEmergencyOnly )
+        || ( networkRegStatus == ENWStatusRegistrationDenied ) )
+        {
+        isPhoneOffline = ETrue;
+        }
+
+    return isPhoneOffline;
+    }
+    
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparsersimcontrolhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  implementation of CPEParserSimControlHandler class.
+*
+*/
+
+
+//  1.0 INCLUDE FILES
+#include "cpeparsersimcontrolhandler.h"
+#include "mpephonemodelinternal.h"
+#include <mpecontacthandling.h>
+#include <mpedatastore.h>
+#include <pepanic.pan>
+#include <secui.h>
+#include <secuimanualsecuritysettings.h>
+#include <talogger.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPEParserSimControlHandler::CPEParserSimControlHandler( 
+        MPEPhoneModelInternal& aModel,        
+        MPEContactHandling& aContactHandling
+        ) : iModel( aModel ),
+            iContactHandling( aContactHandling )
+    {
+    iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
+    iSupplementaryServicesCommandInfo.type = EPESSTypeUnspecified;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    TEFLOGSTRING( KTAOBJECT,
+        "PE CPEParserSimControlHandler::CPEParserSimControlHandler: complete");
+    }
+
+// Destructor
+CPEParserSimControlHandler::~CPEParserSimControlHandler()
+    {
+    if( iSecurityModel != NULL )
+        {
+        iSecurityModel->CancelChangePin();
+        iSecurityModel->CancelUnblockPin();
+        delete iSecurityModel;
+        TSecUi::UnInitializeLib();  
+        }
+    TEFLOGSTRING( KTAOBJECT,
+        "PE CPEParserSimControlHandler::~CPEParserSimControlHandler: complete");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSimControlHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEParserSimControlHandler* CPEParserSimControlHandler::NewL(
+        MPEPhoneModelInternal& aModel,      
+        MPEContactHandling& aContactHandling )
+    {
+    CPEParserSimControlHandler* self = new ( ELeave ) CPEParserSimControlHandler( 
+        aModel, 
+        aContactHandling );
+
+    TEFLOGSTRING( KTAOBJECT,
+        "PE CPEParserSimControlHandler::NewL complete" );
+
+    return self;
+    } //NewL
+
+// -----------------------------------------------------------------------------
+// CPEExternalDataHandler::ProcessChangePin
+// Change pin code.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSimControlHandler::ProcessChangePinL( 
+        TPinCode aType,         // It is type of pin.
+        const TDesC& aOldPin,   // It is old pin.
+        const TDesC& aNewPin,   // It is new pin.
+        const TDesC& aVerifyNew )  // It is new pin(confirmation).
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSimControlHandler::ProcessChangePinL ");
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    CManualSecuritySettings::TPin pin= CManualSecuritySettings::EPin1;
+
+    switch ( aType )
+        {
+        case EPinCode:
+            pin = CManualSecuritySettings::EPin1;
+            break;
+        case EPin2Code:
+            pin = CManualSecuritySettings::EPin2;
+            break;
+        default:
+            // Case not handled, panic.
+            User::Panic( KPEPhoneEnginePanic, EPEPanicStupidUser );
+            break;
+        }
+        
+    if( iSecurityModel == NULL )
+        {
+        TSecUi::InitializeLibL();
+        iSecurityModel = CManualSecuritySettings::NewL();
+        TEFLOGSTRING( KTAOBJECT,
+            "PE CPEParserSimControlHandler::ConstructL" );
+        }
+        
+    if( iSecurityModel->ChangePinL( pin, aOldPin, aNewPin, aVerifyNew ) )
+        {
+        iSupplementaryServicesCommandInfo.action = EPEPasswordOperation;
+        iSupplementaryServicesCommandInfo.type = EPEPin;
+        iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+        iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+        TEFLOGSTRING( KTAINT,
+            "PE CPEParserSimControlHandler::ProcessChangePinL: iSecurityModel->ChangePinL called ");
+        }
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEGsmExternalDataHandler::ProcessUnblockPin
+// Unblock pin code.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSimControlHandler::ProcessUnblockPinL( 
+        TPinCode aType,         // It is type of pin to unblock.
+        const TDesC& aPuk,      // It is unblocking code.
+        const TDesC& aNewPin,   // It is new pin.
+        const TDesC& aVerifyNew ) // It is new pin.
+    {
+       
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    CManualSecuritySettings::TPin pin= CManualSecuritySettings::EPin1;
+
+    switch ( aType )
+        {
+        case EPinCode:
+            pin = CManualSecuritySettings::EPin1;
+            break;
+        case EPin2Code:
+            pin = CManualSecuritySettings::EPin2;
+            break;
+        default:
+            // Case not handled, panic.
+            User::Panic( KPEPhoneEnginePanic, EPEPanicStupidUser );
+            break;
+        }
+
+    if( iSecurityModel == NULL )
+        {
+        TSecUi::InitializeLibL();
+        iSecurityModel = CManualSecuritySettings::NewL();
+        TEFLOGSTRING( KTAOBJECT,
+            "PE CPEParserSimControlHandler::ConstructL" );
+        }
+        
+    if( iSecurityModel->UnblockPinL( pin, aPuk, aNewPin, aVerifyNew ) )
+        {
+        iSupplementaryServicesCommandInfo.action = EPEPasswordOperation;
+        iSupplementaryServicesCommandInfo.type = EPEUnblockPin;
+        iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+        iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+        TEFLOGSTRING( KTAINT,
+            "PE CPEParserSimControlHandler::ProcessUnblockPinL: iSecurityModel->UnblockPinL called ");
+        }
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );        
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparsersscallhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of CPEParserSSCallHandler class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpemanualcallcontrolhandler.h"
+#include "cpemessagehandler.h"
+#include "cpeparsersscallhandler.h"
+#include "mpephonemodelinternal.h"
+#include <etel.h>
+#include <etelmm.h>
+#include <gsmerror.h>
+#include <mcceconferencecallobserver.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// ============================= LOCAL FUNCTIONS ===============================
+// None.
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::CPEParserSSCallHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEParserSSCallHandler::CPEParserSSCallHandler
+        ( 
+        CPEMessageHandler& aOwner, // Reference to owner of this object.  
+        MPEPhoneModelInternal& aModel,
+        CPEManualCallControlHandler& aManualCallControlHandler
+        ) : iOwner( aOwner ),
+            iModel( aModel ),
+            iManualCallControlHandler( aManualCallControlHandler )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::~CPEParserSSCallHandler
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CPEParserSSCallHandler::~CPEParserSSCallHandler
+        (
+        // None.
+        )
+    {    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::ProcessEndCall
+// End or reject a call. Activate entering string "0" + SEND
+// If there is waiting call reject it.
+// If there is not waiting call but tere is held call then end held call.
+// If there is no waiting or held call then set error code ECCPErrorNotAllowed.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSCallHandler::ProcessEndOrRejectL
+        ( 
+        // None.
+        )
+    {   
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSCallHandler::ProcessEndOrRejectL: Start" ); 
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    
+    TInt errorCode = iManualCallControlHandler.HandleChldZero();
+    iOwner.SetGsmParserErrorCode( errorCode );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSCallHandler::ProcessEndOrRejectL: Stop" ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::ProcessEndAndAccept
+// Ends a call and accepts another. Activate entering string "1" + SEND
+// 1. Check if conference call or voice call is active and release it.
+// 2. If there is waiting call then answer waiting call.
+// 3. If there is no waiting and if there is held call then resume held call. 
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSCallHandler::ProcessEndAndAcceptL
+        ( 
+        // None.
+        )
+    {
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEParserSSCallHandler::ProcessEndAndAcceptL: Start" );      
+    TInt error( ECCPErrorNotAllowed );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    
+    error = iManualCallControlHandler.HandleChldOne();
+    iOwner.SetGsmParserErrorCode( error );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEParserSSCallHandler::ProcessEndAndAcceptL: Stop" ); 
+    }  
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::ProcessEndCall
+// End specific active call. Activate entering string "1x" + SEND 
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSCallHandler::ProcessEndCallL
+        ( 
+        TInt aCallNo // The number of the call.
+        )
+    {
+    TEFLOGSTRING( KTAINT,"PE CPEParserSSCallHandler::ProcessEndCallL: Start" ); 
+    TInt errorCode( ECCPErrorNotAllowed );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    
+    TRAP( errorCode, iManualCallControlHandler.HandleChldOneXL( aCallNo ) );
+    iOwner.SetGsmParserErrorCode( errorCode );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT,"PE CPEParserSSCallHandler::ProcessEndCallL: Stop" ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::ProcessSwap
+// Swaps active and held calls. Activate entering string "2" + SEND.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSCallHandler::ProcessSwapL
+        ( 
+        // None.
+        )
+    { 
+    TEFLOGSTRING( KTAINT, "PE CPEParserSSCallHandler::ProcessSwapL: Start" );    
+    TInt errorCode( ECCPErrorNotAllowed );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    errorCode = iManualCallControlHandler.HandleChldTwo();
+    iOwner.SetGsmParserErrorCode( errorCode );
+
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT, "PE: CPEParserSSCallHandler::ProcessSwapL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::ProcessEndCall
+// Hold all active calls except specific call. Activate entering string "2x" + SEND.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSCallHandler::ProcessHoldAllCallsExceptL
+        ( 
+        TInt aCallNo    // The number of the call.
+        )
+    {
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEParserSSCallHandler::ProcessHoldAllCallsExceptL: Start" );
+    TInt errorCode( ECCPErrorNotAllowed );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    
+    TRAP( errorCode, iManualCallControlHandler.HandleChldTwoXL( aCallNo ) );
+    iOwner.SetGsmParserErrorCode( errorCode );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+        
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEParserSSCallHandler::ProcessHoldAllCallsExceptL: Stop" ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::ProcessJoinL
+// Build conference call or add new member to conference call.
+// Activate entering string "3" + SEND.
+// 1. If there is no conference call then join two calls to conference.
+// 2. If there is active conference call and held call then add member 
+// (held call) to conference call.
+// 3. If there is held conference call and active call then add member 
+// (active call) to conference call.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSCallHandler::ProcessJoinL
+        ( 
+        // None.
+        )
+    { 
+    TEFLOGSTRING( KTAINT, "PE CPEParserSSCallHandler::ProcessJoinL: Start" );
+    TInt errorCode( ECCPErrorNotAllowed );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    errorCode = iManualCallControlHandler.HandleChldThree();
+    iOwner.SetGsmParserErrorCode( errorCode );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT, "PE CPEParserSSCallHandler::ProcessJoinL: Stop" ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSCallHandler::ProcessEndCall
+// Perform explicit call transfer. Activate entering string "4" + SEND.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSCallHandler::ProcessExplicitCallTransferL
+        ( 
+        // None.
+        )
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSCallHandler::ProcessExplicitCallTransferL: Start" );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    
+    TInt errorCode = iManualCallControlHandler.HandleChldFour();
+    iOwner.SetGsmParserErrorCode( errorCode );
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSCallHandler::ProcessExplicitCallTransferL: Stop" ); 
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None.
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparsersshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1107 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of 
+*                CPEParserSSHandler class
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpemessagehandler.h"
+#include "cpeparsersshandler.h"
+#include "mpephonemodelinternal.h"
+#include "pepanic.pan"
+#include <bldvariant.hrh>
+#include <etelmm.h>
+#include <featmgr.h>
+#include <mpedatastore.h>
+#include <nwdefs.h>
+#include <psetcallbarring.h>
+#include <psetcalldiverting.h>
+#include <psetcallwaiting.h>
+#include <psetcli.h>
+#include <psetcontainer.h>
+#include <psetcontainer.h>
+#include <psuibarringobs.h>
+#include <psuibarringobs.h>
+#include <psuicliobserver.h>
+#include <psuicontainer.h>
+#include <psuidivertobs.h>
+#include <psuiwaitingobs.h>
+#include <psuiwaitingobs.h>
+#include <talogger.h>
+
+
+// CONSTANTS
+const TInt KPEDefinedBasicServiceGroup = 99;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::CPEParserSSHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEParserSSHandler::CPEParserSSHandler( 
+        CPEMessageHandler& aOwner,       // The owner of this object.  
+        MPEPhoneModelInternal& aModel       // The reference parameter of the 
+        ) : iOwner( aOwner ),               // phone model object which is used
+            iModel( aModel )                // to send message to the phone app.
+
+    {
+    iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
+    iSupplementaryServicesCommandInfo.type = EPESSTypeUnspecified;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    TEFLOGSTRING( KTAOBJECT, "CPEParserSSHandler::CPEParserSSHandler" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEParserSSHandler* CPEParserSSHandler::NewL(
+        CPEMessageHandler& aOwner,   // The owner of this object.  
+        MPEPhoneModelInternal& aModel ) // The reference parameter of the phone 
+                                        // model object which is used to send
+                                        // message to the phone application
+    {
+    CPEParserSSHandler* self = new ( ELeave ) CPEParserSSHandler( aOwner, aModel );
+
+    TEFLOGSTRING( KTAOBJECT, "CPEParserSSHandler::NewL" );
+
+    return self;
+    } //NewL
+
+// Destructor
+CPEParserSSHandler::~CPEParserSSHandler()
+    {    
+    delete iCli;
+    delete iCliObserver;
+    delete iBarring;
+    delete iCbObserver;
+    delete iDivert;
+    delete iCfObserver;
+    delete iWaiting;
+    delete iCwObserver;
+    delete iSettings;
+    delete iObsContainer;
+
+    TEFLOGSTRING( KTAOBJECT, "CPEParserSSHandler::~CPEParserSSHandler" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::GetBasicService.
+// Returns RMobilePhone::TMobileService type of basic service value.
+// -----------------------------------------------------------------------------
+//
+RMobilePhone::TMobileService CPEParserSSHandler::BasicService( 
+        const TDesC& aBasicCode ) // It is basic service code.
+    {
+    RMobilePhone::TMobileService serviceGroup( RMobilePhone::EServiceUnspecified );
+
+    if ( aBasicCode ==  KPENoServiceCode )
+        {
+        serviceGroup = RMobilePhone::EAllServices;
+        }
+    else if ( aBasicCode == KPEAllTeleservices )
+        {                    
+        serviceGroup = RMobilePhone::EAllTele;
+        }
+    else if ( aBasicCode == KPETelephony )
+        {                    
+        serviceGroup = RMobilePhone::ETelephony;
+        }
+    else if ( aBasicCode == KPEAllDataServices )
+        {                    
+        serviceGroup = RMobilePhone::EAllDataTele;
+        }
+    else if ( aBasicCode == KPEFacsimileServices )
+        {                    
+        serviceGroup = RMobilePhone::EFaxService;
+        }
+    else if ( aBasicCode == KPEShortMessageServices )
+        {                    
+        serviceGroup = RMobilePhone::EShortMessageService;
+        }
+    else if ( aBasicCode == KPEVoiceGroupCallService )
+        {                    
+        serviceGroup = RMobilePhone::EVoiceGroupCall;
+        }
+    else if ( aBasicCode == KPEVoiceBroadcastService )
+        {                    
+        serviceGroup = RMobilePhone::EVoiceBroadcast;
+        }
+    else if ( aBasicCode == KPEAllTeleservicesExceptSMS )
+        {                    
+        serviceGroup = RMobilePhone::EAllTeleExcSms;
+        }
+    else if ( aBasicCode == KPEAllBearerServices )
+        {                    
+        serviceGroup = RMobilePhone::EAllBearer;
+        }
+    else if ( aBasicCode == KPEAllAsyncServices )
+        {                    
+        serviceGroup = RMobilePhone::EAllAsync;
+        }
+    else if ( aBasicCode == KPEAllSyncServices )
+        {                    
+        serviceGroup = RMobilePhone::EAllSync;
+        }
+    else if ( aBasicCode == KPEAllDataCircuitSync )
+        {                    
+        serviceGroup = RMobilePhone::ESyncData;
+        }
+    else if ( aBasicCode == KPEAllDataCircuitAsync )
+        {                    
+        serviceGroup = RMobilePhone::EAsyncData;
+        }
+    // Not supported in MM ETel API, CR maded to Symbian.
+    /*  
+    else if ( aBasicCode == KPEAllDedicatedPacketAccess )
+        {                    
+        serviceGroup = EPE???;
+        }
+    */
+    else if ( aBasicCode == KPEAllDedicatedPadAccess )
+        {                    
+        serviceGroup = RMobilePhone::EPadAccess;
+        }
+    else if ( aBasicCode == KPEAllGprsBearerServices )
+        {                    
+        serviceGroup = RMobilePhone::EAllGprsBearer;
+        }
+    else if ( aBasicCode == KPEAllPlmnSpecificTeleservices )
+        {                    
+        serviceGroup = RMobilePhone::EAllPlmnTele;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice1 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele1;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice2 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele2;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice3 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele3;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice4 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele4;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice5 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele5;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice6 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele6;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice7 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele7;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice8 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele8;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice9 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTele9;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice10 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTeleA;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice11 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTeleB;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice12 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTeleC;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice13 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTeleD;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice14 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTeleE;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificTeleservice15 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnTeleF;
+        }
+    else if ( aBasicCode == KPEAllPlmnSpecificBearerServices )
+        {                    
+        serviceGroup = RMobilePhone::EAllPlmnBearer;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService1 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ1;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService2 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ2;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService3 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ3;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService4 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ4;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService5 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ5;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService6 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ6;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService7 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ7;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService8 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ8;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService9 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServ9;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService10 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServA;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService11 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServB;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService12 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServC;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService13 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServD;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService14 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServE;
+        }
+    else if ( aBasicCode == KPEPlmnSpecificBearerService15 )
+        {                    
+        serviceGroup = RMobilePhone::EPlmnBearerServF;
+        }
+    else if ( aBasicCode == KPEAuxVoiceService )
+        {                    
+        serviceGroup = RMobilePhone::EAuxVoiceService;
+        }
+    else
+        {
+        TEFLOGSTRING( KTAINT, "PE CPEParserSSHandler::BasicService: Unspecified Service code ");
+        }
+    iOwner.SetBasicServiceGroup( serviceGroup );
+    return serviceGroup;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::Cancel
+// Method cancel command from Settings utility subsystem or security module.
+// Security module don't have return value from cancel command.
+// -----------------------------------------------------------------------------
+//    
+TInt CPEParserSSHandler::Cancel()
+    { 
+    // request cancellation is taken care of mainly in
+    // the actual ss-objects. They are also able to handle
+    // situation, where there is no ongoing request.
+    TInt returnValue( ECCPErrorNone );
+    if ( iWaiting )
+        {
+        TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iWaiting->CancelProcess()" );
+        iWaiting->CancelProcess();
+        }
+    else if ( iBarring )
+        {
+        TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iBarring->CancelCurrentRequest()" );
+        iBarring->CancelCurrentRequest();
+        }
+    else if ( iDivert )
+        {
+        TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iDivert->CancelCurrentRequest()" );
+        iDivert->CancelCurrentRequest();
+        }
+    else if ( iCli )
+        {
+        TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::Cancel() > iCli->CancelAll()" );
+        iCli->CancelAll();
+        }
+    else
+        {
+        TEFLOGSTRING( KTAERROR, "PE CPEParserSSHandler::Cancel() ! Not Found" );
+        returnValue = ECCPErrorNotFound;
+        }
+
+    return returnValue;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessBarringL
+// Process barring procedures
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessBarringL( 
+        TAction aAction,                // It is action
+        TBarringProcedure aBarring,     // It contains barring procedure.
+        const TDesC& aPassword,         // It should be barring password, if required.
+        const TDesC& aBasicCode )       // It is basic service code.
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessBarringL: Start" );
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    // convert into bsc
+    TBasicServiceGroups bsc = ChangeToBsc( aBasicCode );
+    // Basic service group for S90 UI...
+    RMobilePhone::TMobileService serviceGroup = BasicService( aBasicCode );
+    iSupplementaryServicesCommandInfo.group = serviceGroup;
+
+    // connect to ss engine
+    CreateCBObsL();
+    TCallBarringSetting setBarring;
+    // set basic service group to be used in line init.
+    setBarring.iServiceGroup = EServiceGroupVoice;
+    // copy the password
+    setBarring.iPassword = aPassword;
+    // chooses the right barring program
+    switch( aBarring )
+        {
+        case EBarringAllOutgoingCalls:
+            setBarring.iType = EBarringTypeAllOutgoing;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoing;
+            break;
+        case EBarringAllOutgoingInternationalCalls:
+            setBarring.iType = EBarringTypeOutgoingInternational;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoingInternational;
+            break;
+        case EBarringAllOutgoingInternationalCallsExceptHome:
+            setBarring.iType = 
+                EBarringTypeOutgoingInternationalExceptToHomeCountry;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoingInternationalExcHome;
+            break;
+        case EBarringAllIncomingCalls:
+            setBarring.iType = EBarringTypeAllIncoming;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllIncoming;
+            break;
+        case EBarringAllIncomingCallsWhenRoaming:
+            setBarring.iType = EBarringTypeIncomingWhenRoaming;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllIncomingWhenRoaming;
+            break;
+        case EBarringAllServices:
+            setBarring.iType = EBarringTypeAllServices;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllServices;
+            break;
+        case EBarringAllOutgoingServices:
+            setBarring.iType = EBarringTypeAllOutgoingServices;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllOutgoingServices;
+            break;
+        case EBarringAllIncomingServices:
+            setBarring.iType = EBarringTypeAllIncomingServices;
+            iSupplementaryServicesCommandInfo.type = EPECallBarringAllIncomingServices;
+            break;
+        default:
+            break;
+        }
+    // right function of the iBarring is called according to aAction
+    switch( aAction )
+        {
+        case EActivate:
+            setBarring.iSetting = EActivateBarring;
+            iSupplementaryServicesCommandInfo.action = EPESSActivation;
+            iBarring->SetBarringL( setBarring, bsc );
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case EDeactivate: 
+            setBarring.iSetting = ECancelBarring;
+            iSupplementaryServicesCommandInfo.action = EPESSDeactivation;
+            iBarring->SetBarringL( setBarring, bsc );
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case EInterrogate:
+            iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+            iBarring->GetBarringStatusL( EServiceGroupVoice, setBarring.iType );
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case ERegister:
+        case EErase:
+        default:
+            iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
+            iModel.SendMessage( MEngineMonitor::EPEMessageSSRequestFailed );
+            break;
+        }
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessBarringL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessClipStatusL.
+// Process calling line identification presentation status.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessClipStatusL()
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessBarringL: Start" );
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    CreateCliObsL();
+    iCli->GetClipModeL();
+
+    iSupplementaryServicesCommandInfo.type = EPEClip;
+    iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessBarringL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessClirStatusL
+// Process connected line presentation status.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessClirStatusL()
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessClirStatusL: Start" );
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    CreateCliObsL();
+    iCli->GetClirModeL();
+
+    iSupplementaryServicesCommandInfo.type = EPEClir;
+    iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessClirStatusL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessCnapStatusL
+// Process Calling Name Presentation (CNAP) status check.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessCnapStatusL()
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessCnapStatusL: Start" );
+    if ( FeatureManager::FeatureSupported( KFeatureIdPhoneCnap ) )
+        {
+        // Notify Phone Application that an SS string was identified
+        // and is about to be processed. This procedure is needed to quarantee
+        // that an incoming call will not be blocked by the confirmation dialog
+        iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+        CreateCliObsL();
+        iCli->GetCnapL(); 
+
+        iSupplementaryServicesCommandInfo.type = EPECnap;
+        iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+        iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+        iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+        iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+        }
+    else
+        {
+        iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
+        }
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessCnapStatusL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessColpStatusL
+// Process connected line presentation status.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessColpStatusL()
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessColpStatusL: Start" );
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    CreateCliObsL();
+    iCli->GetColpModeL();
+
+    iSupplementaryServicesCommandInfo.type = EPEColp;
+    iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessColpStatusL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessColrStatusL
+// Process connected line restriction status.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessColrStatusL()
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessColrStatusL: Start" );
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    CreateCliObsL();
+    iCli->GetColrModeL();
+
+    iSupplementaryServicesCommandInfo.type = EPEColr;
+    iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessColrStatusL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessEmlppL
+// Process enhanced Multi-Level Precedence and Pre-emption (eMLPP).
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessEmlppL( 
+        TAction /*aAction*/,          // It as action.
+        const TDesC& /*aNumber*/, // It is directory number.
+        const TInt ) /*aServiceCode*/   // It is service code.
+    {
+    TEFLOGSTRING( KTAINT,
+        "PE CPEParserSSHandler::ProcessEmlppL: " );
+    //This feature is not supported.
+    iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessForwardingL
+// If a parameter is not allowed for a procedure,then it is empty. If a 
+// parameter is not explicitly given, then it is empty. If a parameter is 
+// present, then it can be assumed to contain appropriate values.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessForwardingL( 
+        TAction aAction,                    // It is action
+        TForwardingProcedure aForwarding,   // It contains forwarding procedure.
+        const TDesC& aNumber,               // It is directory number.
+        const TDesC& aBasicCode,            // It is basic service code.
+        const TDesC& aTimer )               // It is timer.
+    {
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL: Start" );
+     
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    // connect to ss engine
+    CreateCFObsL();
+
+    RMobilePhone::TMobileService serviceGroup = BasicService( aBasicCode );
+    iSupplementaryServicesCommandInfo.group = serviceGroup;
+
+    TCallDivertSetting setDivert;
+    // forwarded-to number copied
+    if ( aNumber.Length() > KPsetPhoneNumberLength )
+        {   
+        User::Leave( KErrArgument );
+        }       
+    setDivert.iNumber.Copy( aNumber );
+    // default basic service group used for line initialization is set
+    setDivert.iServiceGroup = EServiceGroupData;
+
+    // convert into bsc
+    TBasicServiceGroups bsc = ChangeToBsc( aBasicCode );
+    // to get the divert indicator correctly 
+    // (needed when voice is concerned)
+    if ( bsc == EAllTeleAndBearer ||
+        bsc == EAllTele ||
+        bsc == ETelephony ||
+        bsc == EAllTeleExcSms ||
+        bsc == EAltTele )
+        {
+        setDivert.iServiceGroup = EServiceGroupVoice;
+        }
+    
+    // status initialized
+    setDivert.iStatus = EDivertingStatusUnknown;
+    setDivert.iNoReplyTimer = 0;
+
+    // chooses the correct forwarding program
+
+    switch ( aForwarding )
+        {
+        case EForwardingNotReachable:
+            setDivert.iCondition = EDivertConditionNotReachable;
+            iSupplementaryServicesCommandInfo.type = EPECallForwardingNotReachable;
+            break;
+        case EForwardingNoReply:
+            {
+            // set the timer in case of timer concerned function call
+            if ( aTimer.Length() != 0 )
+                {
+                TLex input( aTimer );
+                User::LeaveIfError( input.Val( setDivert.iNoReplyTimer ) );
+                }
+            else 
+                {
+                setDivert.iNoReplyTimer = iDivert->GetTimerValueL();
+                }
+            setDivert.iCondition = EDivertConditionNoReply;
+            iSupplementaryServicesCommandInfo.type = EPECallForwardingNoReply;
+            break;
+            }
+        case EForwardingBusy:
+            setDivert.iCondition = EDivertConditionBusy;
+            iSupplementaryServicesCommandInfo.type = EPECallForwardingBusy;
+            break;
+        case EForwardingUnconditional:
+            setDivert.iCondition = EDivertConditionUnconditional;
+            iSupplementaryServicesCommandInfo.type = EPECallForwardingUnconditional;
+            break;
+        case EForwardingAll:
+            setDivert.iCondition = EDivertConditionAllCalls;
+            iSupplementaryServicesCommandInfo.type = EPECallForwardingAll;
+            break;
+        case EForwardingAllConditional:
+            setDivert.iCondition = EDivertConditionAllConditionalCases;
+            iSupplementaryServicesCommandInfo.type = EPECallForwardingAllConditional;
+            break;
+        default:
+            break;
+        }
+    // right function chosen from iDivert according to aAction
+    switch( aAction )
+        {
+        case EActivate:
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL EActivate" );
+            setDivert.iSetting = EActivateDiverting;
+            iDivert->SetDivertingL( setDivert, bsc );
+            iSupplementaryServicesCommandInfo.action = EPESSActivation;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case EDeactivate: 
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL EDeactivate" );
+            setDivert.iSetting = ECancelDiverting;
+            iDivert->SetDivertingL( setDivert, bsc );
+            iSupplementaryServicesCommandInfo.action = EPESSDeactivation;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case EInterrogate:
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL EInterrogate" );
+            iDivert->GetDivertingStatusL( EServiceGroupVoice, 
+                setDivert.iCondition, bsc );
+            iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case ERegister:
+            setDivert.iSetting = ERegisterDiverting;
+            iDivert->SetDivertingL( setDivert, bsc );
+            iSupplementaryServicesCommandInfo.action = EPESSRegistration;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case EErase:
+            setDivert.iSetting = EEraseDiverting;
+            iDivert->SetDivertingL( setDivert, bsc );
+            iSupplementaryServicesCommandInfo.action = EPESSErasure;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        default:
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL default FAIL" );
+            iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageSSRequestFailed );
+            break;
+        }
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessForwardingL: End" ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessMspL
+// Process Multiple Subscriber Profile (MSP).
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessMspL( 
+        TAction /*aAction*/,        // It is action.
+        const TDesC& /*aNumber*/,   // It is directory number.
+        const TInt ) /*aServiceCode*/ // It is service code.
+    {
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessMspL" );
+    //This feature is not supported.
+    iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessPasswordChange
+// Process password change.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessPasswordChangeL
+        ( 
+        TPasswordProcedure aPassword,   // It is password procedure.
+        const TDesC& aOldPassword,      // It should be old password.
+        const TDesC& aNewPassword,
+        const TDesC& aVerifyNewPassword )
+    {
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessPasswordChangeL: Start" ); 
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    CreateCBObsL(); 
+
+    if ( aPassword == EPasswordBarring )
+        {
+        RMobilePhone::TMobilePhonePasswordChangeV2 password;
+        CopyL( password.iOldPassword, aOldPassword );
+        CopyL( password.iNewPassword, aNewPassword );
+        CopyL( password.iVerifiedPassword, aVerifyNewPassword );
+        iBarring->ChangePasswordL( password, ETrue );
+        iSupplementaryServicesCommandInfo.type = EPECallBarringPassword;
+        }
+    else 
+        {
+        RMobilePhone::TMobilePhonePasswordChangeV2 password;
+        CopyL( password.iOldPassword, aOldPassword );
+        CopyL( password.iNewPassword, aNewPassword );
+        CopyL( password.iVerifiedPassword, aVerifyNewPassword );
+        iBarring->ChangePasswordL( password, EFalse );
+        iSupplementaryServicesCommandInfo.type = EPESSTypeUnspecified;
+        }
+
+    iSupplementaryServicesCommandInfo.action = EPEPasswordOperation;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessPasswordChangeL: End" ); 
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessSpnpL
+// Process Support for Private Numbering Plan (SPNP).
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessSpnpL( 
+        TAction      /*aAction*/,        // It is action.
+        const TInt ) /*aServiceCode*/ // It is service code.
+    {
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessSpnpL" ); 
+    //This feature is not supported.
+    iOwner.SetGsmParserErrorCode( ECCPErrorNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessWaitingL
+// Process waiting.
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ProcessWaitingL( 
+        TAction aAction,          // It is action.
+        const TDesC& aBasicCode ) // It is basic service code.
+    {
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL: Start" );
+    // Notify Phone Application that an SS string was identified
+    // and is about to be processed. This procedure is needed to quarantee
+    // that an incoming call will not be blocked by the confirmation dialog
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+
+    // changes aBasicCode to basic service group
+    TBasicServiceGroups bsc = ChangeToBsc( aBasicCode );
+    // Basic service group for S90 UI...
+    RMobilePhone::TMobileService serviceGroup = BasicService( aBasicCode );
+    iSupplementaryServicesCommandInfo.group = serviceGroup;
+    iSupplementaryServicesCommandInfo.type = EPECallWaiting;
+    // connects to ss engine
+    CreateCWObsL();
+    switch( aAction )
+        {
+        case EActivate:
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL EActivate" );
+            iWaiting->SetCallWaitingL( 
+                MPsetCallWaiting::EActivateCallWaiting, 
+                bsc );
+            iSupplementaryServicesCommandInfo.action = EPESSActivation;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case EDeactivate: 
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL EDeactivate" );
+            iWaiting->SetCallWaitingL( 
+                MPsetCallWaiting::EDeactivateCallWaiting, 
+                bsc );
+            iSupplementaryServicesCommandInfo.action = EPESSDeactivation;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case EInterrogate:
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL EInterrogate" );
+            iWaiting->GetCallWaitingStatusL();
+            iSupplementaryServicesCommandInfo.action = EPESSInterrogation;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+            break;
+        case ERegister:
+        case EErase:
+        default:
+            TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL default" );
+            iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
+            iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+            iModel.SendMessage( MEngineMonitor::EPEMessageSSRequestFailed );
+            break;
+        } 
+    TEFLOGSTRING( KTAMESINT, "PE CPEParserSSHandler::ProcessWaitingL: End" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ChangeToBsc
+// -----------------------------------------------------------------------------
+//
+TBasicServiceGroups CPEParserSSHandler::ChangeToBsc( 
+    const TDesC& aBasicCode )
+    {
+    //null values must be handled as well, length == 0
+    if ( aBasicCode.Length() == 0 )
+        {
+        return EAllTeleAndBearer;
+        }
+    TInt value( 0 ); 
+    TLex input( aBasicCode );
+    TInt error = input.Val( value );
+    __ASSERT_ALWAYS( error > -1, 
+        User::Panic( KPEPhoneEnginePanic, EPEPanicStupidUser ) );
+    TBasicServiceGroups returnValue = EAllTeleAndBearer;
+    if ( (EAllTele <= value && value <= EFax) ||
+        (ESms <= value && value <= EAllSync) ||
+        (ESyncData <= value && value <= EPadAccess) ||
+        (EAllPlmnTele <= value && value <= EPlmnTeleF) ||
+        (EAllPlmnBearer <= value && value <= EPlmnBearerServF) ||
+        value == EAltTele ||
+        value == KPEDefinedBasicServiceGroup )
+        {
+        returnValue = ( TBasicServiceGroups ) value;
+        }
+    else 
+        {
+        User::Panic( KPEPhoneEnginePanic, EPEPanicStupidUser );
+        }
+    return returnValue;      
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ConnectToSsEngineL
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ConnectToSsEngineL()
+    {
+    if ( iSettings )
+        {
+        return;
+        }
+    CleanupStack::PushL( TCleanupItem( DoClean, this ) );
+ 
+    //creates the containers
+    iSettings = CPsetContainer::NewL();
+    iObsContainer = CPsuiContainer::NewL();
+
+    CleanupStack::Pop( this );
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::CreateCWObsL
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::CreateCWObsL()
+    {
+    ConnectToSsEngineL();
+    //call waiting observer and engine
+    if ( !iCwObserver )
+        {
+        iCwObserver = iObsContainer->CreateCWObsL();
+        iWaiting = iSettings->CreateCWObjectL( *iCwObserver );
+        iWaiting->SetRequestObserver( this );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::CreateCBObsL
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::CreateCBObsL()
+    {
+    ConnectToSsEngineL();
+    //call barring observer and engine
+    if ( !iCbObserver )
+        {  
+        iCbObserver = iObsContainer->CreateCBObsL();
+        iBarring = iSettings->CreateCBObjectL( *iCbObserver );
+        iBarring->SetRequestObserver( this );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::CreateCFObsL
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::CreateCFObsL()
+    {
+    ConnectToSsEngineL();
+    //call divert observer and engine
+    if ( !iCfObserver )
+        {   
+        iCfObserver = iObsContainer->CreateCFObsL();
+        iDivert = iSettings->CreateCFObjectL( *iCfObserver );
+        iDivert->SetRequestObserver( this );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::CreateCliObsL
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::CreateCliObsL()
+    {
+    ConnectToSsEngineL();
+    // cli observer and engine 
+    if ( !iCliObserver )
+        {  
+        iCliObserver = iObsContainer->CreateCliObsL();
+        iCli = iSettings->CreateCliObjectL( *iCliObserver );
+        iCli->SetRequestObserver( this );
+        }
+    }   
+     
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ProcessForwardingL
+// -----------------------------------------------------------------------------
+void CPEParserSSHandler::RequestComplete()
+    {
+    ResetVariables();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::RequestStatusChanged
+// -----------------------------------------------------------------------------
+void CPEParserSSHandler::RequestStatusChanged( 
+    TInt /*aNewStatus*/ )
+    {
+    // Phone app is not interested in Ss state changes.
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::DoClean
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::DoClean( 
+    TAny* aAny )
+    {
+    CPEParserSSHandler* ssHandler = 
+        static_cast< CPEParserSSHandler* >( aAny );
+    
+    ssHandler->ResetVariables();
+    }       
+
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::ResetVariables
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::ResetVariables()
+    {
+    delete iCfObserver;
+    iCfObserver = NULL;
+    delete iCbObserver;
+    iCbObserver = NULL;
+    delete iCwObserver;
+    iCwObserver = NULL;
+    delete iCliObserver;
+    iCliObserver = NULL;
+    delete iDivert;
+    iDivert = NULL;
+    delete iBarring;
+    iBarring = NULL;
+    delete iWaiting;
+    iWaiting = NULL;
+    delete iCli;
+    iCli = NULL;
+    delete iSettings;
+    iSettings = NULL;
+    delete iObsContainer;
+    iObsContainer = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserSSHandler::CopyL
+// -----------------------------------------------------------------------------
+//
+void CPEParserSSHandler::CopyL( 
+        TDes& aDest, 
+        const TDesC& aSource )
+    {
+    if ( aDest.MaxLength() < aSource.Length() )
+        {
+        User::Leave( KErrOverflow );
+        }
+
+    aDest = aSource;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeparservoipnumberhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,200 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CPEParserVoipNumberHandler class methods implementation
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpeclientcallrequestmonitor.h"
+#include "cpemessagehandler.h"
+#include "cpeparservoipnumberhandler.h"
+#include "mpeservicehandling.h"
+#include "pevirtualengine.h"
+#include <featmgr.h>
+#include <mpecallhandling.h>
+#include <mpedatastore.h>
+#include <talogger.h>
+
+
+// CONSTANTS
+const TUint KDtmfPlus = '+';
+const TUint KDtmfWait = 'w';
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPEParserVoipNumberHandler::CPEParserVoipNumberHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEParserVoipNumberHandler::CPEParserVoipNumberHandler( 
+        CPEMessageHandler& aOwner, 
+        MPECallHandling& aCallHandling,
+        MPEServiceHandling& aServiceHandling,
+        MPEDataStore& aDataStore
+        ) : iOwner( aOwner ), 
+            iCallHandling( aCallHandling ),
+            iDataStore( aDataStore ),
+            iServiceHandling( aServiceHandling )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEParserVoipNumberHandler::CPEParserVoipNumberHandler" )
+    }
+    
+CPEParserVoipNumberHandler* CPEParserVoipNumberHandler::NewL( CPEMessageHandler& aOwner, 
+                                     MPECallHandling& aCallHandling,
+                                     MPEServiceHandling& aServiceHandling,
+                                     MPEDataStore& aDataStore )
+    {
+    CPEParserVoipNumberHandler* self = CPEParserVoipNumberHandler::NewLC( aOwner, aCallHandling, aServiceHandling, aDataStore );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CPEParserVoipNumberHandler* CPEParserVoipNumberHandler::NewLC( CPEMessageHandler& aOwner, 
+                                      MPECallHandling& aCallHandling,
+                                      MPEServiceHandling& aServiceHandling,
+                                      MPEDataStore& aDataStore )
+    {
+    CPEParserVoipNumberHandler* self = new( ELeave ) CPEParserVoipNumberHandler( aOwner, aCallHandling, aServiceHandling, aDataStore );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+void CPEParserVoipNumberHandler::ConstructL()
+    {
+    }
+
+CPEParserVoipNumberHandler::~CPEParserVoipNumberHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserVoipNumberHandler::ProcessDialToVoipNumberL
+// Process dial to number.
+// -----------------------------------------------------------------------------
+//
+void CPEParserVoipNumberHandler::ProcessDialToVoipNumberL( 
+        const TDesC& aNumber,
+        const TDesC& aDtmfPostfix
+        )
+    {
+    TEFLOGSTRING3( KTAINT, 
+          "PE CPEParserVoipNumberHandler::ProcessDialToVoipNumberL, aNumber: %S, aDtmfPostfix: %S", 
+          &aNumber, 
+          &aDtmfPostfix );
+
+    TPEPhoneNumber phoneNumber;
+    
+    // Check if phone is locked
+    iOwner.CheckIfPhoneIsLockedL();
+  
+    if ( aNumber.Length() == 0 )
+        {
+        User::Leave( ECCPErrorInvalidPhoneNumber );
+        }
+    
+    phoneNumber.Append( aNumber );
+    
+    TPECallType processType = iDataStore.CallTypeCommand();
+ 
+    // Remove possible + or w chartes.      
+    TPEPhoneNumber postfix = FilterPostfix( aDtmfPostfix );
+    if( postfix.Length() )
+        {
+        phoneNumber.Append( postfix );
+        }
+    iDtmfString = aDtmfPostfix;
+     
+    TEFLOGSTRING3( KTAINT, 
+          "PE CPEParserVoipNumberHandler::ProcessDialToVoipNumberL, phoneNumber: %S, iDtmfString: %S"
+            , &phoneNumber
+            , &iDtmfString );
+  
+    // Temporary hack for enabling client calls with service id 3
+    // Proper solution to be done to CallUi and AIW dial data
+        
+
+    TUint32 serviceId = iDataStore.ServiceIdCommand();
+    iServiceHandling.EnableServiceL( serviceId );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CPEParserVoipNumberHandler::FilterPostfix
+// -----------------------------------------------------------------------------
+// 
+TPtrC CPEParserVoipNumberHandler::FilterPostfix( TPtrC aPostfix )
+    {
+    TLex input( aPostfix );
+    TInt stripStart = KErrNotFound;
+    TInt postfixLength = aPostfix.Length();
+    for ( TInt i = 0; i != postfixLength; i ++ )
+        {
+        TChar ch( input.Peek() );
+        if ( ch == KDtmfWait ||
+             ch == KDtmfPlus )
+            {
+            if ( i < stripStart || stripStart == KErrNotFound )
+                {
+                stripStart = i;
+                }
+            }
+        }
+    if ( stripStart != KErrNotFound )
+        {
+        return aPostfix.Left( stripStart );
+        }
+    else
+        {
+        return aPostfix;
+        }
+    } 
+
+// -----------------------------------------------------------------------------
+// CPEParserVoipNumberHandler::::ContinueVoipDial
+// -----------------------------------------------------------------------------
+//
+TInt CPEParserVoipNumberHandler::ContinueVoipDial() const
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEParserVoipNumberHandler::ContinueVoipDial" );
+    TInt callId = 0;
+    
+    TPEPhoneNumber phoneNumber = iDataStore.PhoneNumber();
+    TEFLOGSTRING2( KTAINT, 
+          "PE CPEParserVoipNumberHandler::ContinueVoipDial, phoneNumber: %S", 
+          &phoneNumber );
+    TBool clientCall = ( iDataStore.CallOriginCommand() != EPECallOriginPhone );
+    // DialCall method will set call origin as unknow
+    TInt errorCode = iCallHandling.DialCall( phoneNumber, callId );
+    
+    // Set dtmf string to dataStore
+    iDataStore.SetDtmfPostFix( iDtmfString, callId );
+    
+    //PhoneClient originated call
+    if( clientCall && ( ECCPErrorNone == errorCode ) )
+        {
+        iOwner.SetClientInformation( callId, phoneNumber );
+        }
+    
+    TEFLOGSTRING2( KTAINT, 
+            "PE CPEParserVoipNumberHandler::ContinueVoipDial, error code: %d"
+            , errorCode );
+
+    return errorCode;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpepcnparserprocedurehandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  implementation of CPEPcnParserProcedureHandler class.
+*
+*/
+
+
+//  ==================== INCLUDE FILES  ==================== 
+#include "cpepcnparserprocedurehandler.h"
+#include "mpephonemodelinternal.h"
+#include <mpedatastore.h>
+#include <secui.h>
+#include <secuimanualsecuritysettings.h>
+#include <talogger.h>
+
+
+// ==================== LOCAL FUNCTIONS ====================
+// None.
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CPEPcnParserProcedureHandler::CPEPcnParserProcedureHandler 
+        ( 
+        CPEMessageHandler& aOwner,              // The owner of this object.
+        MPEPhoneModelInternal& aModel
+        ) : iOwner( aOwner ),
+            iModel( aModel )
+    {
+    iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified;
+    iSupplementaryServicesCommandInfo.type = EPESSTypeUnspecified;
+    iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+    TFLOGSTRING("PhoneEngine: PEPcnParserProcedureHandler::CPEPcnParserProcedureHandler complete");
+    }
+
+// Destructor
+CPEPcnParserProcedureHandler::~CPEPcnParserProcedureHandler
+        (
+        // None.
+        )
+    {
+    if( iSecurityModel != NULL )
+        {
+        iSecurityModel->CancelChangePin();
+        iSecurityModel->CancelUnblockPin();
+        delete iSecurityModel;
+        TSecUi::UnInitializeLib();  
+        }
+    TFLOGSTRING("PhoneEngine: PEPcnParserProcedureHandler::~CPEPcnParserProcedureHandler complete");
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPcnParserProcedureHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEPcnParserProcedureHandler* CPEPcnParserProcedureHandler::NewL
+        (
+        CPEMessageHandler& aOwner,              // The owner of this object.
+        MPEPhoneModelInternal& aModel
+        )
+    {
+    CPEPcnParserProcedureHandler* self = new ( ELeave ) CPEPcnParserProcedureHandler( 
+        aOwner, 
+        aModel );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, "CPEPcnParserProcedureHandler::NewL" );
+
+    return self;
+    } //NewL
+
+// -----------------------------------------------------------------------------
+// CPEPcnParserProcedureHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEPcnParserProcedureHandler::ConstructL
+        (
+        //None
+        )
+    {
+    TEFLOGSTRING( KTAOBJECT, "tape: CPEPcnParserProcedureHandler::ConstructL" );
+    }
+
+/*
+-----------------------------------------------------------------------------
+
+    Class: CPEPcnParserProcedureHandler
+
+    Method: ProcessSimLock
+
+    Description: Process SIM locking.
+
+    Type: -
+
+    Parameters: TDesC& aPassword, in coming value, accepted values are number strings, 
+                Password for change Sim lock status.
+                TDesC& aType, in coming value, accepted values are 1-6, 
+                tell what Sim lock will be changed.
+    
+    Return Values: -
+
+    Errors/Exceptions: -
+
+    Status: Approved
+    
+-----------------------------------------------------------------------------
+*/
+void CPEPcnParserProcedureHandler::ProcessSimLockL( 
+            const TDesC& aPassword, 
+            const TDesC& aType )
+    {
+    if( iSecurityModel == NULL )
+        {
+        TSecUi::InitializeLibL();
+        iSecurityModel = CManualSecuritySettings::NewL();
+        TEFLOGSTRING( KTAOBJECT,
+            "PE CPEPcnParserProcedureHandler::ProcessSimLockL > CManualSecuritySettings::NewL()" );
+        }
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    if( iSecurityModel->LockSimL( aPassword, aType ) )
+        {
+        iSupplementaryServicesCommandInfo.action = EPESSActivation;
+        iSupplementaryServicesCommandInfo.type = EPESimLock;
+        iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+        iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+        }
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    }
+
+/*
+-----------------------------------------------------------------------------
+
+    Class: CPEPcnParserProcedureHandler
+
+    Method: ProcessSimUnlock
+
+    Description: Process SIM locking.
+
+    Type: -
+
+    Parameters: TDesC& aPassword, in coming value, accepted values are number strings, 
+                Password for change Sim lock status.
+                TDesC& aType, in coming value, accepted values are 1-6, 
+                tell what Sim lock will be changed.
+    
+    Return Values: -
+
+    Errors/Exceptions: -
+
+    Status: Approved
+    
+-----------------------------------------------------------------------------
+*/
+void CPEPcnParserProcedureHandler::ProcessSimUnlockL( 
+            const TDesC& aPassword, 
+            const TDesC& aType )
+    { 
+    if( iSecurityModel == NULL )
+        {
+        TSecUi::InitializeLibL();
+        iSecurityModel = CManualSecuritySettings::NewL();
+        TEFLOGSTRING( KTAOBJECT,
+            "PE CPEPcnParserProcedureHandler::ProcessSimUnlockL > CManualSecuritySettings::NewL()" );
+        }
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest );
+    if( iSecurityModel->UnlockSimL( aPassword, aType ) )
+        {
+        iSupplementaryServicesCommandInfo.action = EPESSDeactivation;
+        iSupplementaryServicesCommandInfo.type = EPESimLock;
+        iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified;
+        iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo );
+        }
+    iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest );
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpephonemodel.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1517 @@
+/*
+* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEPhoneModel class 
+                 member functions.
+*
+*/
+
+
+//  INCLUDE FILES
+#include "cpeactivestarter.h"
+#include "cpeexternaldatahandler.h"
+#include "cpeidlestatusmonitor.h"
+#include "cpemessagehandler.h"
+#include "cpephonemodel.h"
+#include "cpeservicehandling.h"
+#include "cpesimstatemonitor.h"
+#include "pepanic.pan"
+#include "cperemotepartyinfomediator.h"
+
+#include <ccce.h>
+#include <cpeaudiodata.h>
+#include <cpecallhandling.h>                   
+#include <cpecontacthandlingproxy.h>
+#include <cpeengineinfo.h>
+#include <cpegsmaudiodata.h>
+#include <cpeloghandlingproxy.h>
+#include <featmgr.h>
+#include <mccedtmfinterface.h>
+#include <mpecontacthandling.h>
+#include <mpeloghandling.h>
+#include <xqservicerequest.h>
+#include "phoneservices.h"
+#include "parserrecognizer.h"
+
+// CONSTANTS
+const TInt KDriveProfile ( 6 );
+const TInt KPECallTimerOff = 0;
+
+// ==================== LOCAL FUNCTIONS ====================
+
+// ================= MEMBER FUNCTIONS =======================
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::CPEPhoneModel
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEPhoneModel::CPEPhoneModel(
+        MEngineMonitor& aEngineMonitor      // The reference parameter for phone application communication
+        ) : CPEPhoneModelIF(),
+            iEngineMonitor( aEngineMonitor ),
+            iStep( 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::CPEPhoneModel
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEPhoneModel::CPEPhoneModel(
+        MEngineMonitor& aEngineMonitor ,     // The reference parameter for phone application communication
+        CPEAudioFactory& aAudioFactory
+        ) : CPEPhoneModelIF(),
+            iEngineMonitor( aEngineMonitor ),
+            iStep( 0 ),
+            iAudioFactory( &aAudioFactory )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::ConstructL
+// EPOC default constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEPhoneModel::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 1" );
+    iEngineInfo = CPEEngineInfo::NewL();
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 2" );
+    User::LeaveIfError( iFsSession.Connect() );
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 3" );
+    FeatureManager::InitializeLibL();
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 4" );
+    iActiveStarter = CPEActiveStarter::NewL( this );
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 5" );
+    iActiveStarter->StartUp();
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ConstructL: 6" );
+    }// ConstructL
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPEPhoneModel* CPEPhoneModel::NewL(
+        MEngineMonitor& aEngineMonitor   //for phone application communication
+        )
+    {
+    CPEPhoneModel* self = new ( ELeave ) CPEPhoneModel( aEngineMonitor );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }// NewL
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::NewL
+// Two-phased constructor for module testing.
+// -----------------------------------------------------------------------------
+//
+CPEPhoneModel* CPEPhoneModel::NewL( 
+    MEngineMonitor& aEngineMonitor,
+    CPEAudioFactory& aAudioFactory )
+    {
+    CPEPhoneModel* self = 
+        new ( ELeave ) CPEPhoneModel( aEngineMonitor, aAudioFactory );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CPEPhoneModel::~CPEPhoneModel()
+    {   
+    delete iMediatorCommunicationHandler;
+    delete iSimChangedMonitor;
+    delete iMessageHandler;
+    delete iServiceHandling;
+    delete iSimStatusMonitor;
+    delete iContactHandling;
+    delete iLogHandling;
+    delete iAudioData;
+    delete iCallHandling;
+    delete iExternalDataHandler;
+    delete iCallStackCutter;
+
+    if ( iActiveStarter )
+        {
+        delete iActiveStarter;
+        }
+
+    FeatureManager::UnInitializeLib();
+    iFsSession.Close();
+    delete iEngineInfo;
+    delete iConvergedCallEngine;
+    if ( iIdleStatusMonitor )
+        {
+        delete iIdleStatusMonitor;
+        } 
+    delete iPhoneServices;
+    delete iParserRecognizer;
+    }// ~CPEPhoneModel
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::EngineInfo
+// Returns the pointer of the CPEEngineInfo object.
+// -----------------------------------------------------------------------------
+//
+MPEEngineInfo* CPEPhoneModel::EngineInfo()
+    {
+    return iEngineInfo;
+    }
+
+// -----------------------------------------------------------------------------
+// Returns the pointer of the CPEEngineInfo object.
+// -----------------------------------------------------------------------------
+//
+MPEDataStore* CPEPhoneModel::DataStore()
+    {
+    return iEngineInfo;
+    }    
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::DataStoreExt
+// Returns the pointer to CPEExternalDataHandler object
+// -----------------------------------------------------------------------------
+//
+MPEExternalDataHandler* CPEPhoneModel::DataStoreExt()
+    {
+    return iExternalDataHandler;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::MediatorCommandHandler
+// Returns the pointer to CPERemotePartyInfoMediator object
+// -----------------------------------------------------------------------------
+//
+CPERemotePartyInfoMediator* CPEPhoneModel::MediatorCommunicationHandler()
+    {
+    return iMediatorCommunicationHandler;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::NameByMessageToPhoneEngine
+// Return message name, given the id of message.
+// -----------------------------------------------------------------------------
+//
+#ifdef TEF_LOGGING_ENABLED
+TPtrC CPEPhoneModel::NameByMessageToPhoneEngine(
+        const MPEPhoneModel::TPEMessagesToPhoneEngine aMessage
+        ) const
+    {
+    switch ( aMessage )
+        {
+        // Audio messages                     1000 - 1999
+        case MPEPhoneModel::EPEMessageSetAudioMute:
+            return MESSAGE("EPEMessageSetAudioMute");
+        case MPEPhoneModel::EPEMessageSetAudioVolume:
+            return MESSAGE("EPEMessageSetAudioVolume");
+        case MPEPhoneModel::EPEMessageSetAudioOutput:
+            return MESSAGE("EPEMessageSetAudioOutput");
+
+        // Call messages                      2000 - 2999
+        case MPEPhoneModel::EPEMessageAnswer:
+            return MESSAGE("EPEMessageAnswer");
+        case MPEPhoneModel::EPEMessageClientDial:
+            return MESSAGE("EPEMessageClientDial");
+        case MPEPhoneModel::EPEMessageClientDialEmergency:
+            return MESSAGE("EPEMessageClientDialEmergency");
+        case MPEPhoneModel::EPEMessageDialServiceCall:
+            return MESSAGE("EPEMessageDialServiceCall");
+        case MPEPhoneModel::EPEMessageContinueEmergencyCallInitialization:
+            return MESSAGE("EPEMessageContinueEmergencyCallInitialization");
+        case MPEPhoneModel::EPEMessageContinueDTMFSending:
+            return MESSAGE("EPEMessageContinueDTMFSending");
+        case MPEPhoneModel::EPEMessageDial:
+            return MESSAGE("EPEMessageDial");
+        case MPEPhoneModel::EPEMessagePlayDTMF:
+            return MESSAGE("EPEMessagePlayDTMF");
+        case MPEPhoneModel::EPEMessageEndDTMF:
+            return MESSAGE("EPEMessageEndDTMF");
+        case MPEPhoneModel::EPEMessagePhoneNumberEdited:
+            return MESSAGE("EPEMessagePhoneNumberEdited");
+        case MPEPhoneModel::EPEMessageRelease:
+            return MESSAGE("EPEMessageRelease");
+        case MPEPhoneModel::EPEMessageReleaseAll:
+            return MESSAGE("EPEMessageReleaseAll");
+        case MPEPhoneModel::EPEMessageReject:
+            return MESSAGE("EPEMessageReject");
+        case MPEPhoneModel::EPEMessageSendDTMF:
+            return MESSAGE("EPEMessageSendDTMF");
+        case MPEPhoneModel::EPEMessageStopDTMFSending:
+            return MESSAGE("EPEMessageStopDTMFSending");
+        case MPEPhoneModel::EPEMessageStopTonePlay:
+            return MESSAGE("EPEMessageStopTonePlay");
+        case MPEPhoneModel::EPEMessageAutomaticAnswerOff:
+            return MESSAGE("EPEMessageAutomaticAnswerOff");
+        case MPEPhoneModel::EPEMessageTerminateAllConnections:
+            return MESSAGE("EPEMessageTerminateAllConnections");
+        case MPEPhoneModel::EPEMessageSatCallRequestCompleted:
+            return MESSAGE("EPEMessageSatCallRequestCompleted");
+            
+        case MPEPhoneModel::EPEMessageAcceptUnattendedTransfer:
+            return MESSAGE("EPEMessageAcceptUnattendedTransfer");
+        case MPEPhoneModel::EPEMessageRejectUnattendedTransfer:
+            return MESSAGE("EPEMessageRejectUnattendedTransfer");
+
+        case MPEPhoneModel::EPEMessageDoUnattendedTransfer:
+            return MESSAGE("EPEMessageDoUnattendedTransfer");
+        case MPEPhoneModel::EPEMessageForwardCallToAddress:
+            return MESSAGE("EPEMessageForwardCallToAddress");
+
+        // Contact messages                   3000 - 3999
+
+        // Error messages                     4000 - 4999
+
+        // Network messages                   5000 - 5999
+
+        // Parser messages                    6000 - 6999
+
+        // Security messages                  7000 - 7999
+
+        // Settings and Shared Data messages  8000 - 8999
+
+        // Service messages                   8000 - 8999
+        case MPEPhoneModel::EPEMessageDisableService:
+            return MESSAGE("EPEMessageDisableService");
+        // Startup messages                   9000 - 9999
+        case MPEPhoneModel::EPEMessagePEConstructionReady:
+            return MESSAGE("EPEMessagePEConstructionReady");
+
+        // Miscellaneous messages             10000 - 10999
+        case MPEPhoneModel::EPEMessageCheckEmergencyNumber:
+            return MESSAGE("EPEMessageCheckEmergencyNumber");
+            
+        // Variant messages                   11000 - 12999
+        
+        // Audio messages                         11000 - 11199
+
+        // Call messages                          11200 - 11399
+        case CPEPhoneModelIF::EPEMessageAddConferenceMember:
+            return MESSAGE("EPEMessageAddConferenceMember");
+        case CPEPhoneModelIF::EPEMessageCreateConference:
+            return MESSAGE("EPEMessageCreateConference");
+        case CPEPhoneModelIF::EPEMessageDropConferenceMember:
+            return MESSAGE("EPEMessageDropConferenceMember");
+        case CPEPhoneModelIF::EPEMessageGoOneToOne:
+            return MESSAGE("EPEMessageGoOneToOne");
+        case CPEPhoneModelIF::EPEMessageHangUpConference:
+            return MESSAGE("EPEMessageHangUpConference");
+        case CPEPhoneModelIF::EPEMessageHold:
+            return MESSAGE("EPEMessageHold");
+        case CPEPhoneModelIF::EPEMessageHoldConference:
+            return MESSAGE("EPEMessageHoldConference");
+        case CPEPhoneModelIF::EPEMessageResume:
+            return MESSAGE("EPEMessageResume");
+        case CPEPhoneModelIF::EPEMessageResumeConference:
+            return MESSAGE("EPEMessageResumeConference");
+        case CPEPhoneModelIF::EPEMessageSwap:
+            return MESSAGE("EPEMessageSwap");
+        case CPEPhoneModelIF::EPEMessageSwapConference:
+            return MESSAGE("EPEMessageSwapConference");
+        case CPEPhoneModelIF::EPEMessageTransfer:
+            return MESSAGE("EPEMessageTransfer");
+        case CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice:
+            return MESSAGE("EPEMessageSwitchToVideoOrVoice");   
+
+        // Contact messages                       11400 - 11599
+
+        // Error messages                         11600 - 11799
+
+        // Network messages                       11800 - 12999
+
+        // Parser messages                        12000 - 12199
+        case CPEPhoneModelIF::EPEMessageCancelSSstringCommand:
+            return MESSAGE("EPEMessageCancelSSstringCommand");
+
+        // Security messages                      12200 - 12399
+
+        // Settings and Shared Data messages      12400 - 12599
+
+        // Miscellaneous messages                 12600 - 12799
+        
+        default:
+            TEFLOGSTRING2( KTAINT, "pe:cpephonemodel::namebymessagetophoneengine, unknown message = %d", static_cast<TInt>(aMessage));
+            return MESSAGE("Unknown message");
+        } 
+    }
+#else
+TPtrC CPEPhoneModel::NameByMessageToPhoneEngine(
+        const TInt /*aMessage*/ ) const
+    {
+    return MESSAGE("Not available");
+    }
+#endif // TEF_LOGGING_ENABLED
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::NameByMessageFromPhoneEngine
+// Return message name, given the id of message.
+// -----------------------------------------------------------------------------
+//
+#ifdef TEF_LOGGING_ENABLED
+TPtrC CPEPhoneModel::NameByMessageFromPhoneEngine(
+        const TInt aMessage ) const
+    {
+    switch ( aMessage )
+        {
+        // Audio messages                     1000 - 1999
+        case MEngineMonitor::EPEMessageAudioDtmfEvent:
+            return MESSAGE("EPEMessageAudioDtmfEvent");
+        case MEngineMonitor::EPEMessageAudioDTMFPlayComplete:
+            return MESSAGE("EPEMessageAudioDTMFPlayComplete");
+        case MEngineMonitor::EPEMessageAudioOutputPreferenceChanged:
+            return MESSAGE("EPEMessageAudioOutputPreferenceChanged");
+        case MEngineMonitor::EPEMessageAudioMuteChanged:
+            return MESSAGE("EPEMessageAudioMuteChanged");
+        case MEngineMonitor::EPEMessageAudioOutputChanged:
+            return MESSAGE("EPEMessageAudioOutputChanged");
+        case MEngineMonitor::EPEMessageAvailableAudioOutputsChanged:
+            return MESSAGE("EPEMessageAvailableAudioOutputsChanged");
+        case MEngineMonitor::EPEMessageAudioPlayStopped:
+            return MESSAGE("EPEMessageAudioPlayStopped");
+        case MEngineMonitor::EPEMessageAudioVolumeChanged:
+            return MESSAGE("EPEMessageAudioVolumeChanged");
+
+        // Call messages                      2000 - 2999
+        case MEngineMonitor::EPEMessageAnswer:
+            return MESSAGE("EPEMessageAnswer");
+        case MEngineMonitor::EPEMessageAnswering:
+            return MESSAGE("EPEMessageAnswering");
+        case MEngineMonitor::EPEMessageCallControlCapsChanged:
+            return MESSAGE("EPEMessageCallControlCapsChanged");
+        case MEngineMonitor::EPEMessageCallWaiting:
+            return MESSAGE("EPEMessageCallWaiting");
+        case MEngineMonitor::EPEMessageCallWaitingAnswered:
+            return MESSAGE("EPEMessageCallWaitingAnswered");
+        case MEngineMonitor::EPEMessageChangedCallDuration:
+            return MESSAGE("EPEMessageChangedCallDuration");
+        case MEngineMonitor::EPEMessageConferenceIdle:
+            return MESSAGE("EPEMessageConferenceIdle");
+        case MEngineMonitor::EPEMessageConferenceCapsChange:
+            return MESSAGE("EPEMessageConferenceCapsChange");
+        case MEngineMonitor::EPEMessageConnected:
+            return MESSAGE("EPEMessageConnected");
+        case MEngineMonitor::EPEMessageConnectedConference:
+            return MESSAGE("EPEMessageConnectedConference");
+        case MEngineMonitor::EPEMessageConnecting:
+            return MESSAGE("EPEMessageConnecting");
+        case MEngineMonitor::EPEMessageDialing:
+            return MESSAGE("EPEMessageDialing");
+        case MEngineMonitor::EPEMessageDialingError:
+            return MESSAGE("EPEMessageDialingError");
+        case MEngineMonitor::EPEMessageDisconnecting:
+            return MESSAGE("EPEMessageDisconnecting");
+        case MEngineMonitor::EPEMessageDisconnectingConference:
+            return MESSAGE("EPEMessageDisconnectingConference");
+        case MEngineMonitor::EPEMessageDTMFSendingAborted:
+            return MESSAGE("EPEMessageDTMFSendingAborted");
+        case MEngineMonitor::EPEMessageHeld:
+            return MESSAGE("EPEMessageHeld");
+        case MEngineMonitor::EPEMessageHeldConference:
+            return MESSAGE("EPEMessageHeldConference");
+        case MEngineMonitor::EPEMessageIdle:
+            return MESSAGE("EPEMessageIdle");
+        case MEngineMonitor::EPEMessageIncoming:
+            return MESSAGE("EPEMessageIncoming");
+        case MEngineMonitor::EPEMessageInitiatedEmergencyCall:
+            return MESSAGE("EPEMessageInitiatedEmergencyCall");
+        case MEngineMonitor::EPEMessageInitiatedEmergencyWhileActiveVideo:
+            return MESSAGE("EPEMessageInitiatedEmergencyWhileActiveVideo");
+        case MEngineMonitor::EPEMessagePacketNetworkDetached:
+            return MESSAGE("EPEMessagePacketNetworkDetached");
+        case MEngineMonitor::EPEMessageRemoteBusy:
+            return MESSAGE("EPEMessageRemoteBusy");            
+        case MEngineMonitor::EPEMessageSendingDTMF:
+            return MESSAGE("EPEMessageSendingDTMF");
+        case MEngineMonitor::EPEMessageSentDTMF:
+            return MESSAGE("EPEMessageSentDTMF");
+        case MEngineMonitor::EPEMessageSentSSString:
+            return MESSAGE("EPEMessageSentSSString");
+        case MEngineMonitor::EPEMessageStoppedDTMF:
+            return MESSAGE("EPEMessageStoppedDTMF");
+        case MEngineMonitor::EPEMessageSwapped:
+            return MESSAGE("EPEMessageSwapped");
+        case MEngineMonitor::EPEMessageTransferDone:
+            return MESSAGE("EPEMessageTransferDone");
+        case MEngineMonitor::EPEMessageWentOneToOne:
+            return MESSAGE("EPEMessageWentOneToOne");
+        case MEngineMonitor::EPEMessageDisconnectingWithInband:
+            return MESSAGE("EPEMessageDisconnectingWithInband");
+        case MEngineMonitor::EPEMessageContinuingDTMFSending:
+            return MESSAGE("EPEMessageContinuingDTMFSending");
+        case MEngineMonitor::EPEMessageCallAdded:
+            return MESSAGE("EPEMessageCallAdded");
+        case MEngineMonitor::EPEMessageRemoteTerminated:
+            return MESSAGE("EPEMessageRemoteTerminated");
+        case MEngineMonitor::EPEMessageShowIMEI:
+            return MESSAGE("EPEMessageShowIMEI");
+        case MEngineMonitor::EPEMessageUnknown:
+            return MESSAGE("EPEMessageUnknown");
+        case MEngineMonitor::EPEMessagePromptSpeedDial:
+            return MESSAGE("EPEMessagePromptSpeedDial");
+        case MEngineMonitor::EPEMessageSpeedDialNotAssigned:
+            return MESSAGE("EPEMessageSpeedDialNotAssigned");
+        case MEngineMonitor::EPEMessageInvalidSpeedDial:
+            return MESSAGE("EPEMessageInvalidSpeedDial"); 
+        case MEngineMonitor::EPEMessageDataPortLoaned:
+            return MESSAGE("EPEMessageDataPortLoaned");
+            
+        case MEngineMonitor::EPEMessageUnattendedTransferRequest:
+            return MESSAGE("EPEMessageUnattendedTransferRequest");
+        case MEngineMonitor::EPEMessageRemoteForwarding:
+            return MESSAGE("EPEMessageRemoteForwarding");
+        case MEngineMonitor::EPEMessageMovedPermanently:
+            return MESSAGE("EPEMessageMovedPermanently");
+        case MEngineMonitor::EPEMessageMultipleChoices:
+            return MESSAGE("EPEMessageMultipleChoices");
+        case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
+            return MESSAGE("EPEMessageRemotePartyInfoChanged");
+        case MEngineMonitor::EPEMessageConnectingWithInband:
+            return MESSAGE("EPEMessageConnectingWithInband");
+
+        // Contact messages                   3000 - 3999
+        case MEngineMonitor::EPEMessageThumbnailLoadingCompleted:
+            return MESSAGE("EPEMessageThumbnailLoadingCompleted");
+
+        // Error messages                     4000 - 4999
+        case MEngineMonitor::EPEMessageError:
+            return MESSAGE("EPEMessageError");
+        case MEngineMonitor::EPEMessageAudioHandlingError:
+            return MESSAGE("EPEMessageAudioHandlingError");
+        case MEngineMonitor::EPEMessageCallHandlingError:
+            return MESSAGE("EPEMessageCallHandlingError");
+        case MEngineMonitor::EPEMessageContactHandlingError:
+            return MESSAGE("EPEMessageContactHandlingError");
+        case MEngineMonitor::EPEMessageLogHandlingError:
+            return MESSAGE("EPEMessageLogHandlingError");
+
+        case MEngineMonitor::EPEMessageServiceHandlingError:
+            return MESSAGE("EPEMessageServiceHandlingError");
+        // Network messages                   5000 - 5999
+        case MEngineMonitor::EPEMessageCallSecureStatusChanged:
+            return MESSAGE("EPEMessageCallSecureStatusChanged");
+        case MEngineMonitor::EPEMessageNetworkRegistrationStatusChange:
+            return MESSAGE("EPEMessageNetworkRegistrationStatusChange");
+
+        // Parser messages                    6000 - 6999
+        case MEngineMonitor::EPEMessageSSRequestFailed:
+            return MESSAGE("EPEMessageSSRequestFailed");
+
+        // Security messages                  7000 - 7999
+        case MEngineMonitor::EPEMessageBadBarringPasswordChange:
+            return MESSAGE("EPEMessageBadBarringPasswordChange");
+        case MEngineMonitor::EPEMessageBadPin1Change:
+            return MESSAGE("EPEMessageBadPin1Change");
+        case MEngineMonitor::EPEMessageBadPin2Change:
+            return MESSAGE("EPEMessageBadPin2Change");
+        case MEngineMonitor::EPEMessageBadPin1Unblock:
+            return MESSAGE("EPEMessageBadPin1Unblock");
+        case MEngineMonitor::EPEMessageBadPin2Unblock:
+            return MESSAGE("EPEMessageBadPin2Unblock");
+        case MEngineMonitor::EPEMessageBarringPasswordChanged:
+            return MESSAGE("EPEMessageBarringPasswordChanged");
+        case MEngineMonitor::EPEMessageChangedSimLock:
+            return MESSAGE("EPEMessageChangedSimLock");
+        case MEngineMonitor::EPEMessageFailedChangeSimLock:
+            return MESSAGE("EPEMessageFailedChangeSimLock");
+        case MEngineMonitor::EPEMessageFailedNewPin1AndPin2NotEqual:
+            return MESSAGE("EPEMessageFailedNewPin1AndPin2NotEqual");
+        case MEngineMonitor::EPEMessageFailedSecurityCommandAlreadyActive:
+            return MESSAGE("EPEMessageFailedSecurityCommandAlreadyActive");
+        case MEngineMonitor::EPEMessagePin1Changed:
+            return MESSAGE("EPEMessagePin1Changed");
+        case MEngineMonitor::EPEMessagePin2Changed:
+            return MESSAGE("EPEMessagePin2Changed");
+        case MEngineMonitor::EPEMessagePin1Unblocked:
+            return MESSAGE("EPEMessagePin1Unblocked");
+        case MEngineMonitor::EPEMessagePin2Unblocked:
+            return MESSAGE("EPEMessagePin2Unblocked");
+
+        // Settings and Shared Data messages  8000 - 8999
+        case MEngineMonitor::EPEMessageProfileChanged:
+            return MESSAGE("EPEMessageProfileChanged");
+
+        // Startup messages                   9000 - 9999
+        case MEngineMonitor::EPEMessagePEConstructionReady:
+            return MESSAGE("EPEMessagePEConstructionReady");
+        case MEngineMonitor::EPEMessagePEConstructionFailed:
+            return MESSAGE("EPEMessagePEConstructionFailed");
+        case MEngineMonitor::EPEMessagePEConstructionTwoPhaseReady:
+            return MESSAGE("EPEMessagePEConstructionTwoPhaseReady");     
+
+        // Miscellaneous messages             10000 - 10999
+        case MEngineMonitor::EPEMessageInValidEmergencyNumber:
+            return MESSAGE("EPEMessageInValidEmergencyNumber");
+        case MEngineMonitor::EPEMessageValidEmergencyNumber:
+            return MESSAGE("EPEMessageValidEmergencyNumber");
+        case MEngineMonitor::EPEMessagePhoneIdentityReady:
+            return MESSAGE("EPEMessagePhoneIdentityReady");
+        case MEngineMonitor::EPEMessageStartATDialing:
+            return MESSAGE("EPEMessageStartATDialing");
+        case MEngineMonitor::EPEMessageLogEventSaved:
+            return MESSAGE("EPEMessageLogEventSaved");
+        case MEngineMonitor::EPEMessageDoNotSendMe:
+            return MESSAGE("EPEMessageDoNotSendMe");
+            
+        // Variant messages                   11000 - 12999
+        
+        // Audio messages                         11000 - 11199
+
+        // Call messages                          11200 - 11399
+        case MEngineMonitor::EPEMessageActiveBarring:
+            return MESSAGE("EPEMessageActiveBarring");
+        case MEngineMonitor::EPEMessageActiveCallForwarding:
+            return MESSAGE("EPEMessageActiveCallForwarding");
+        case MEngineMonitor::EPEMessageAddedConferenceMember:
+            return MESSAGE("EPEMessageAddedConferenceMember");
+        case MEngineMonitor::EPEMessageALSLineChanged:
+            return MESSAGE("EPEMessageALSLineChanged");
+        case MEngineMonitor::EPEMessageCallBarred:
+            return MESSAGE("EPEMessageCallBarred");
+        case MEngineMonitor::EPEMessageIncCallIsForw:
+            return MESSAGE("EPEMessageIncCallIsForw");
+        case MEngineMonitor::EPEMessageIncCallForwToC:
+            return MESSAGE("EPEMessageIncCallForwToC");
+        case MEngineMonitor::EPEMessageOutCallForwToC:
+            return MESSAGE("EPEMessageOutCallForwToC");
+        case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
+            return MESSAGE( "EPEMessageForwardUnconditionalModeActive" );
+        case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
+            return MESSAGE( "EPEMessageForwardConditionallyModeActive" );
+        case MEngineMonitor::EPEMessageDroppedConferenceMember:
+            return MESSAGE("EPEMessageDroppedConferenceMember");
+        case MEngineMonitor::EPEMessageGoingOneToOne:
+            return MESSAGE("EPEMessageGoingOneToOne");
+        case MEngineMonitor::EPEMessageIssuedUSSDRequest:
+            return MESSAGE("EPEMessageIssuedUSSDRequest");
+        case MEngineMonitor::EPEMessageRemoteCreatedConference:
+            return MESSAGE("EPEMessageRemoteCreatedConference");
+        case MEngineMonitor::EPEMessageRemoteHeld:
+            return MESSAGE("EPEMessageRemoteHeld");
+        case MEngineMonitor::EPEMessageRemoteResumed:
+            return MESSAGE("EPEMessageRemoteResumed");
+        case MEngineMonitor::EPEMessageShowVersion:
+            return MESSAGE("EPEMessageShowVersion");
+        case MEngineMonitor::EPEMessageTempClirSuppressUnsuccessful:
+            return MESSAGE("EPEMessageTempClirSuppressUnsuccessful");
+        case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
+            return MESSAGE("EPEMessageTempClirActivationUnsuccessful");
+
+        // Contact messages                       11400 - 11599
+
+        // Error messages                         11600 - 11799
+
+        // Network messages                       11800 - 12999
+        case MEngineMonitor::EPEMessageServiceEnabled:
+            return MESSAGE("EPEMessageServiceEnabled");
+        case MEngineMonitor::EPEMessageServiceEnabling:
+            return MESSAGE("EPEMessageServiceEnabling");    
+        case MEngineMonitor::EPEMessageNoService:
+            return MESSAGE("EPEMessageNoService");  
+        case MEngineMonitor::EPEMessageServiceDisabled:
+            return MESSAGE("EPEMessageServiceDisabled");  
+
+        // Parser messages                        12000 - 12199
+        case MEngineMonitor::EPEMessageActivateRfsDeep:
+            return MESSAGE("EPEMessageActivateRfsDeep");
+        case MEngineMonitor::EPEMessageActivateRfsNormal:
+            return MESSAGE("EPEMessageActivateRfsNormal");
+        case MEngineMonitor::EPEMessageActivateWarrantyMode:
+            return MESSAGE("EPEMessageActivateWarrantyMode");
+        case MEngineMonitor::EPEMessageIssuedSSRequest:
+            return MESSAGE("EPEMessageIssuedSSRequest");
+        case MEngineMonitor::EPEMessageIssuingSSRequest:
+            return MESSAGE("EPEMessageIssuingSSRequest");
+
+        // Security messages                      12200 - 12399
+
+        // Settings messages                      12400 - 12599
+        case MEngineMonitor::EPEMessageBarringNotification:
+            return MESSAGE("EPEMessageBarringNotification");
+        case MEngineMonitor::EPEMessageClipStatusNotification:
+            return MESSAGE("EPEMessageClipStatusNotification");
+        case MEngineMonitor::EPEMessageClirStatusNotification:
+            return MESSAGE("EPEMessageClirStatusNotification");
+        case MEngineMonitor::EPEMessageCnapStatusNotification:
+            return MESSAGE("EPEMessageCnapStatusNotification");
+        case MEngineMonitor::EPEMessageColpStatusNotification:
+            return MESSAGE("EPEMessageColpStatusNotification");
+        case MEngineMonitor::EPEMessageColrStatusNotification:
+            return MESSAGE("EPEMessageColrStatusNotification");
+        case MEngineMonitor::EPEMessageForwardingNotification:
+            return MESSAGE("EPEMessageForwardingNotification");
+        case MEngineMonitor::EPEMessageVmbxNumberLine1Changed:
+            return MESSAGE("EPEMessageVmbxNumberLine1Changed");
+        case MEngineMonitor::EPEMessageVmbxNumberLine2Changed:
+            return MESSAGE("EPEMessageVmbxNumberLine2Changed");
+        case MEngineMonitor::EPEMessageWaitingNotification:
+            return MESSAGE("EPEMessageWaitingNotification");
+        case MEngineMonitor::EPEMessageAlsStatusChanged:
+            return MESSAGE("EPEMessageAlsStatusChanged");
+
+        // Miscellaneous messages                 12600 - 12799
+        case MEngineMonitor::EPEMessageSIMChanged:
+            return MESSAGE("EPEMessageSIMChanged");
+        case MEngineMonitor::EPEMessageSIMStateChanged:
+            return MESSAGE("EPEMessageSIMStateChanged");
+        default:
+            TEFLOGSTRING2( KTAINT, "pe: cpephonemodel::namebymessagefromphoneengine, unknown message = %d", static_cast<TInt>(aMessage));
+            return MESSAGE("Unknown message");
+        } 
+    }
+#else
+TPtrC CPEPhoneModel::NameByMessageFromPhoneEngine(
+        const TInt /*aMessage*/ ) const
+    { 
+    return MESSAGE("Not available");
+    }
+#endif // TEF_LOGGING_ENABLED
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::HandleMessage
+// Handles messages from phone application.
+// -----------------------------------------------------------------------------
+//
+void CPEPhoneModel::HandleMessage(
+        const TInt aMessage ) 
+    {
+    TInt errorCode( ECCPErrorNone );
+    #ifdef TEF_LOGGING_ENABLED
+    TInt callId;
+    callId = iEngineInfo->CallId(); // Get CallId
+    TPtrC messageName = NameByMessageToPhoneEngine( aMessage );
+    TEFLOGSTRING3( KTAINT, 
+        "PE cpephonemodel::handlemessage, messageName=%s, callId=%d", 
+        messageName.Ptr( ), 
+        callId );
+    #endif
+    
+    if ( !iMessageHandler )
+        {
+        TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::HandleMessage: Not ready" );
+        return;
+        }
+
+    switch ( aMessage )
+        {
+        case MPEPhoneModel::EPEMessageTerminateAllConnections:
+            errorCode = iMessageHandler->HandleTerminateAllConnections( );
+            break;
+        case MPEPhoneModel::EPEMessageDial:
+            //Make a dial request
+            errorCode = iMessageHandler->HandleDialCall( EFalse );
+            break;
+        case MPEPhoneModel::EPEMessageReleaseAll: //Make HangUp requests to all calls
+            errorCode = iMessageHandler->HandleReleaseAll( );            
+            break;
+        case MPEPhoneModel::EPEMessageRelease:     //Make HangUp request
+        case CPEPhoneModelIF::EPEMessageHangUpConference:
+            errorCode = iMessageHandler->HandleReleaseCall( );            
+            break;
+        case MPEPhoneModel::EPEMessageAnswer:                        //Make Answer request
+            errorCode = iMessageHandler->HandleAnswerCall( EFalse );
+            break;
+        case MPEPhoneModel::EPEMessageReject:                        //Make Reject request
+            errorCode = iMessageHandler->HandleRejectCall( );
+            break;
+        case MPEPhoneModel::EPEMessageSetAudioMute:                  //Make Mute microphone request
+            iMessageHandler->HandleSetAudioMute( );
+            break;
+        case MPEPhoneModel::EPEMessageSetAudioOutput:
+            errorCode = iMessageHandler->HandleSetAudioOutput();
+            break;
+        case MPEPhoneModel::EPEMessageSetAudioVolume:              //Sets audio volume.
+            iMessageHandler->HandleSetAudioVolume( );
+            break;
+        case CPEPhoneModelIF::EPEMessageHold:                        //Make Hold request
+        case CPEPhoneModelIF::EPEMessageHoldConference:
+            errorCode = iMessageHandler->HandleHoldCall( );
+            break;
+        case CPEPhoneModelIF::EPEMessageSwap:                        //Make Swap request
+        case CPEPhoneModelIF::EPEMessageSwapConference:
+            errorCode = iMessageHandler->HandleSwapCalls( );
+            break;
+        case CPEPhoneModelIF::EPEMessageResume:         //Make Resume request
+        case CPEPhoneModelIF::EPEMessageResumeConference:
+            errorCode = iMessageHandler->HandleResumeCall( );
+            break;
+        case CPEPhoneModelIF::EPEMessageDropConferenceMember:        // Drop conference member.
+            errorCode = iMessageHandler->HandleDropConferenceMember( );
+            break;
+        case CPEPhoneModelIF::EPEMessageTransfer:                    //Make Transfer request
+            errorCode = iMessageHandler->HandleTransferCalls( );
+            break;
+        case CPEPhoneModelIF::EPEMessageCreateConference:            // Build conference call.
+            errorCode = iMessageHandler->HandleBuildConferenceCall( );
+            break;
+        case CPEPhoneModelIF::EPEMessageGoOneToOne:          // Go one to one. 
+            errorCode = iMessageHandler->HandleGoOneToOne( );
+            break;
+        case CPEPhoneModelIF::EPEMessageAddConferenceMember:            //Add call to conference request
+            errorCode = iMessageHandler->HandleAddConferenceMember();
+            break;
+        case MPEPhoneModel::EPEMessageSendDTMF:                    //Send dtmf string
+            errorCode = iMessageHandler->HandleSendDtmf( );
+            break;
+        case MPEPhoneModel::EPEMessagePlayDTMF:                        //Play DTMF
+            TRAP( errorCode, iMessageHandler->HandlePlayDTMFL() );
+            break;
+        case MPEPhoneModel::EPEMessageEndDTMF:                        //End DTMF playing
+            errorCode = iMessageHandler->HandleEndDTMF();
+            break;
+        case MPEPhoneModel::EPEMessageStopTonePlay:    //Stop InBand tone playing.
+            iMessageHandler->HandleStopInbandTonePlay( );
+            break;
+        case MPEPhoneModel::EPEMessageClientDial:  //Make Dial request(Client originated)
+            errorCode = iMessageHandler->HandleDialCall( ETrue );
+            break;
+        case MPEPhoneModel::EPEMessageClientDialEmergency:  
+            //Make emergency dial request(Client originated)
+            errorCode = iMessageHandler->HandleDialEmergencyCall( ETrue );
+            break;
+        case MPEPhoneModel::EPEMessageContinueEmergencyCallInitialization:
+            //Make emergency dial request
+            iMessageHandler->ContinueDialEmergency();
+            break;
+        case MPEPhoneModel::EPEMessageContinueDTMFSending:     //Continue DTMF sending.
+            iMessageHandler->HandleContinueDtmfSending( ETrue );
+            break;
+        case MPEPhoneModel::EPEMessageStopDTMFSending: //Stop DTMF sending.
+            iMessageHandler->HandleContinueDtmfSending( EFalse );
+            break;
+        case CPEPhoneModelIF::EPEMessageCancelSSstringCommand:
+            errorCode = iMessageHandler->HandleCancelSSstringCommand( );
+            break;
+        case MPEPhoneModel::EPEMessagePhoneNumberEdited:
+            TRAP( errorCode, iMessageHandler->HandlePhoneNumberEditedL( ) );
+            break;
+        case MPEPhoneModel::EPEMessageCheckEmergencyNumber:
+            errorCode = iMessageHandler->HandleEmergencyCheck( );
+            break;
+        case MPEPhoneModel::EPEMessageAutomaticAnswerOff:
+            iMessageHandler->HandleAutomaticAnswerOff( );
+            break;
+        case CPEPhoneModelIF::EPEMessageSetALSLine:
+            iCallHandling->SetActiveLine();
+            break;     
+        case CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice:
+            iEngineInfo->SetIsSwitchToOperationOngoing( ETrue );
+            errorCode = iMessageHandler->HandleSwitchToVideoOrVoice( iEngineInfo->CallId() );
+            break; 
+        case MPEPhoneModel::EPEMessageSatCallRequestCompleted: 
+            iMessageHandler->HandleSatCallRequestCompleted();
+            break;
+        case MPEPhoneModel::EPEMessageReplaceActive:
+            errorCode = iMessageHandler->HandleReplaceActive();
+            break;
+        case MPEPhoneModel::EPEMessageAcceptUnattendedTransfer:
+            errorCode = iMessageHandler->
+                HandleUnattendedTransferRequestResponse( ETrue );
+            break;
+        case MPEPhoneModel::EPEMessageRejectUnattendedTransfer:
+            errorCode = iMessageHandler->
+                HandleUnattendedTransferRequestResponse( EFalse );
+            break;
+
+        case MPEPhoneModel::EPEMessageDoUnattendedTransfer:
+            errorCode = iMessageHandler->HandleUnattendedTransfer();
+            break;
+        case MPEPhoneModel::EPEMessageForwardCallToAddress:
+            errorCode = iMessageHandler->ForwardCallToAddress();
+            break;
+        case MPEPhoneModel::EPEMessageDisableService:
+            iMessageHandler->HandleDisableService();
+            break;
+        case MPEPhoneModel::EPEMessageDialServiceCall:  //Make Dial request
+            errorCode = iMessageHandler->HandleDialCall( EFalse );
+            break;
+        default:
+            errorCode = ECCPErrorNotFound;
+            break;
+        } 
+
+    if( errorCode )
+        {
+        TPEErrorInfo errorInfo;
+        errorInfo.iErrorCode = errorCode;
+        errorInfo.iCallId = KPECallIdNotUsed;
+        errorInfo.iErrorType = EPECcp;
+        iEngineMonitor.HandleError( errorInfo );
+        }
+    }// HandleMessage
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::SendMessage
+// Reroutes messages to the over loaded SendMessage( TInt aMessage, TInt aCallId ) method.
+// Method creates new callid and calls overloaded method.
+// -----------------------------------------------------------------------------
+//
+void CPEPhoneModel::SendMessage(
+       const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage )
+    {    
+    SendMessage( aMessage, KPECallIdNotUsed );
+    }// SendMessage( 1 param )
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::SendMessage
+// Sends messages to the phone application
+// Method sets call parameters to the CPEEngineInfo object and
+// Method reroutes messages to the phone application.
+// -----------------------------------------------------------------------------
+//
+void CPEPhoneModel::SendMessage( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+        const TInt aCallId )
+    {
+    TInt errorCode( ECCPErrorNone );
+    TPEState callState;      
+    //Save message to local variable so that it can be modified
+    TInt message( aMessage );
+
+    #ifdef TEF_LOGGING_ENABLED
+    TPtrC messageName = NameByMessageFromPhoneEngine( 
+        static_cast<MEngineMonitor::TPEMessagesFromPhoneEngine>( aMessage ) );
+    TEFLOGSTRING3( KTAINT, 
+        "PE cpephonemodel::sendmessage, messageName=%s, callId=%d"
+        , messageName.Ptr( )
+        , aCallId );
+    #endif
+    
+    if ( iMessageHandler )
+        {
+        errorCode = ProcessMessage( aMessage, aCallId );          
+        }    
+        
+    if ( DelayMessageSending( aMessage, aCallId ) )
+        {
+        message = KPEDontSendMessage;
+        }    
+    
+    // Set Call State to the EngineInfo
+    if ( CallIdCheck::IsConference( aCallId ))
+        {
+        callState = iCallHandling->GetCallState( aCallId );
+        if ( callState > EPEStateUnknown && callState < EPEStateMaximumState )
+            {   
+            iEngineInfo->SetConferenceCallState( static_cast<TPEState>( callState ) );
+            }
+        else
+            {
+            iEngineInfo->SetConferenceCallState( EPEStateUnknown );
+            }
+        }
+    if ( CallIdCheck::IsValid( aCallId ))
+        {
+        callState = iCallHandling->GetCallState( aCallId );
+        if ( callState > EPEStateUnknown && callState < EPEStateMaximumState )
+            {   
+            iEngineInfo->SetCallState( static_cast<TPEState>( callState ), aCallId );
+            }
+        else
+            {
+            iEngineInfo->SetCallState( EPEStateUnknown, aCallId );
+            }
+        }
+
+    if ( ( message == MEngineMonitor::EPEMessageIncoming ) )
+        {
+        if ( FeatureManager::FeatureSupported( KFeatureIdDriveMode ) )
+            {
+            //Check for Drive mode
+            if ( iEngineInfo->ProfileId() == KDriveProfile )
+                {
+                //Drive mode is enabled, do not forward message
+                message = KPEDontSendMessage;
+                }
+            }
+        }
+
+    if ( message == MEngineMonitor::EPEMessageChangedCallDuration )    
+        {   
+        TInt callTimerSetting( EFalse );
+        // safe to ignore error code here, duration display equals to zero == off if it fails
+        iExternalDataHandler->Get( EPECallDurationDisplaySetting, callTimerSetting );
+        // Message EPEMessageChangedCallDuration send supressed, if duration display is OFF
+        if ( callTimerSetting == KPECallTimerOff )
+            {
+            message = KPEDontSendMessage;
+            }
+        }
+
+    //MessageHandler may return error code
+    if ( errorCode != ECCPErrorNone && errorCode != KPEDontSendMessage )
+        {
+        #ifdef TEF_LOGGING_ENABLED
+        TPtrC messageName2 = 
+            NameByMessageFromPhoneEngine( 
+            static_cast<MEngineMonitor::TPEMessagesFromPhoneEngine>( message ) );
+        TEFLOGSTRING3( 
+            KTAERROR,
+            "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=%s, CallId=%d",
+        messageName2.Ptr( ), aCallId );
+        #endif
+        TPEErrorInfo errorInfo;
+        errorInfo.iErrorCode = errorCode;
+        errorInfo.iCallId = aCallId;
+        errorInfo.iErrorType = EPECcp;
+        iEngineMonitor.HandleError( errorInfo );
+        }
+    else if ( message == MEngineMonitor::EPEMessageCallHandlingError )
+        {
+        TEFLOGSTRING2( 
+            KTAERROR, 
+            "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=EPEMessageCallHandlingError, CallId=%d"
+        , aCallId );
+        TPEErrorInfo errorInfo = iEngineInfo->ErrorInfo();
+        errorInfo.iCallId = aCallId;
+        errorInfo.iErrorType = EPECcp;
+        iEngineMonitor.HandleError( errorInfo );
+        }
+    else if ( message == MEngineMonitor::EPEMessageServiceHandlingError )
+        {
+        TEFLOGSTRING( 
+            KTAERROR, 
+            "PE cpephonemodel::sendmessage > iEngineMonitor.HandleError: messageName=EPEMessageServiceHandlingError" );
+        TPEErrorInfo errorInfo = iEngineInfo->ErrorInfo();
+        errorInfo.iCallId = aCallId;
+        errorInfo.iErrorType = EPECch;
+        iEngineMonitor.HandleError( errorInfo );
+        }
+    else if ( message != KPEDontSendMessage && errorCode != KPEDontSendMessage )
+        {
+        // Map message for PhoneApplication, since it doesn't use 
+        // EPEMessageDisconnectingWithInband message
+        if( message == MEngineMonitor::EPEMessageDisconnectingWithInband )
+            {
+            message = MEngineMonitor::EPEMessageDisconnecting;
+            }
+        else if ( message == MEngineMonitor::EPEMessageConnectingWithInband )
+            {
+            iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+            message = MEngineMonitor::EPEMessageConnecting;
+            }
+        #ifdef TEF_LOGGING_ENABLED
+        TPtrC messageName2 = NameByMessageFromPhoneEngine
+            ( static_cast<MEngineMonitor::TPEMessagesFromPhoneEngine>( message ) );
+        TEFLOGSTRING3( 
+            KTAINT, 
+            "PE cpephonemodel::sendmessage > iEngineMonitor HandleMessage: messageName=%s, CallId=%d"
+        , messageName2.Ptr( ), aCallId );
+        #endif
+        
+        __ASSERT_DEBUG( 
+            ( KPEDontSendMessage <= message < KPEMessagesFromPhoneEngineGsmLast ),
+            Panic( EPEPanicIllegalCommand ) );
+        iEngineMonitor.HandleMessage( 
+            static_cast<MEngineMonitor::TPEMessagesFromPhoneEngine>( message ), 
+            aCallId );
+        }
+
+        if( iParserRecognizer )
+            {
+            iParserRecognizer->sendMessage( aMessage, aCallId );
+            }
+
+    }// SendMessage( 2 params )
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::ProcessMessage
+// Process messages from the subsystems by passing them to message handlder.
+// -----------------------------------------------------------------------------
+TInt CPEPhoneModel::ProcessMessage( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+        const TInt aCallId )
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::ProcessMessage" );
+    TInt errorCode( ECCPErrorNone );
+    
+    //Get Message
+    switch ( aMessage )
+        {
+        case MEngineMonitor::EPEMessageDialing:
+            TRAP( errorCode, iMessageHandler->HandleDialingStateL( aCallId ) );
+            break;
+
+        case MEngineMonitor::EPEMessageIncoming:
+            TRAP( errorCode, iMessageHandler->HandleIncomingCallL( aCallId ) );
+            // Since it is possible that incoming call interrupts switch to operation
+            // we need to reset this value.
+            iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+            break;
+
+        case MEngineMonitor::EPEMessageAnswering:
+            if ( CallIdCheck::IsVideo( aCallId )  )
+                {
+                // Answering video calls
+                iMessageHandler->HandleStopInbandTonePlay( );
+                iMessageHandler->HandleAudioRouting( ETrue, aCallId  );
+                }
+            else if ( iEngineInfo->CallType( aCallId ) == EPECallTypeCSVoice || 
+                    iEngineInfo->CallType( aCallId ) == EPECallTypeVoIP )
+                {
+                iMessageHandler->HandleAudioRouting( EFalse, aCallId);
+                }
+                
+            break;
+
+        case MEngineMonitor::EPEMessageConnected:
+            // Switch to status needs to be set false here because some networks
+            // do not use connecting state.
+            iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+            iEngineInfo->SetResumeHeldCall( ETrue, aCallId );
+            if ( CallIdCheck::IsVoice( aCallId ))
+                {
+                errorCode = iMessageHandler->HandleConnectedState( aCallId );
+                }
+            else if ( CallIdCheck::IsVideo( aCallId )) 
+                {
+                // Video call : for video call logging and duration
+                errorCode = iMessageHandler->HandleVideoCallConnected( aCallId );
+                    
+                }
+            // VoIP call audio routing happens when 'connected' message is
+            // received because of differences in VoIP and CS call audio
+            // activation.
+            if ( EPECallTypeVoIP == iEngineInfo->CallType( aCallId ) )
+                {
+                iMessageHandler->HandleAudioRouting( EFalse, aCallId );
+                }
+                
+            break;                        
+
+        case MEngineMonitor::EPEMessageIdle:
+            if ( CallIdCheck::IsVoice( aCallId ))
+                {
+                errorCode = iMessageHandler->HandleVoiceCallIdleState( aCallId );
+                }
+            else if ( CallIdCheck::IsVideo( aCallId )) 
+                {
+                // Video call : for video call logging and duration
+                errorCode = iMessageHandler->HandleVideoCallIdle( aCallId );
+                }
+            if ( errorCode == ECCPErrorNone && iEngineInfo->IsSwitchToOperationOngoing() )
+                {
+                errorCode = iMessageHandler->ContinueSwitchToCall( aCallId );
+                }
+            break;
+
+        case MEngineMonitor::EPEMessageRemoteBusy:
+            if ( CallIdCheck::IsVoice( aCallId ))
+                {                
+                // Set video/voice boolean to false because error occured.
+                iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+                iMessageHandler->HandleCallHandlingError( aCallId, ETrue );                
+                }
+            break;
+
+        case MEngineMonitor::EPEMessageCallHandlingError:
+            // Set video/voice boolean to false because error occured.
+            iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+            iMessageHandler->HandleCallHandlingError( aCallId, EFalse );            
+            break;
+                
+        case MEngineMonitor::EPEMessageAudioOutputPreferenceChanged:
+            errorCode = iMessageHandler->HandleRoutePreferenceChanged();
+            break;
+                    
+        case MEngineMonitor::EPEMessageConferenceIdle:
+            if ( CallIdCheck::IsConference( aCallId ) )
+                {
+                errorCode = iMessageHandler->HandleConferenceIdleState( aCallId );
+                }
+            break;
+            
+        case MEngineMonitor::EPEMessageAnswer: // Automatic answer complete
+            errorCode = iMessageHandler->HandleAnswerCall( ETrue );
+            break;
+
+        case MEngineMonitor::EPEMessageAlsStatusChanged:
+        case MEngineMonitor::EPEMessageSIMStateChanged:
+            iMessageHandler->HandleSimStateChanged( );
+            break;
+
+        case MEngineMonitor::EPEMessagePEConstructionReady:
+            iMessageHandler->HandleStartUp( );
+            break;
+
+        case MEngineMonitor::EPEMessageDisconnecting:
+            errorCode = iMessageHandler->HandleDisconnecting( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageDisconnectingWithInband:
+            errorCode = iMessageHandler->HandleDisconnectingWithInband( aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageConnectedConference:
+            iEngineInfo->SetResumeHeldCall( ETrue, aCallId );
+            break;
+
+        case MEngineMonitor::EPEMessageSentDTMF:
+            errorCode = iMessageHandler->HandleDtmfSent();
+            break;
+
+        case MEngineMonitor::EPEMessageActivateWarrantyMode:
+            errorCode = iMessageHandler->HandleGetLifeTimerData( );
+            break;
+          
+        case MEngineMonitor::EPEMessageStartATDialing:
+            errorCode = iMessageHandler->HandleDialCall( EFalse );
+            iMessageHandler->HandleATDialingStarted( errorCode ? EFalse : ETrue );
+            break;
+
+        // MO call connecting.
+        case MEngineMonitor::EPEMessageConnecting:
+            iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+            iEngineInfo->SetInbandTone( ECCPRemoteAlerting );
+            iAudioData->PlayInbandTone();
+            break;   
+        /*        
+        case MEngineMonitor::EPEMessageInitiatedEmergencyCall:
+            iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+            if ( iCallStackCutter )
+                {
+                delete iCallStackCutter;
+                iCallStackCutter = NULL;
+                }
+            TRAPD( err, iCallStackCutter = CIdle::NewL( CActive::EPriorityHigh ) );
+            if ( !err )
+                {
+                iCallBackMessage = aMessage; 
+                iCallBackCallId  = aCallId;
+                iCallStackCutter->Start( TCallBack( CallBackMessageSend , this ) );
+                }
+            message = KPEDontSendMessage;
+            break;
+        */        
+        case MEngineMonitor::EPEMessageDroppedConferenceMember:
+            iMessageHandler->HandleDroppedConferenceMember();
+            break;
+                
+        case MEngineMonitor::EPEMessageDTMFSendingAborted:
+            iEngineInfo->SetDtmfString( KNullDesC() );
+            break;
+
+        case MEngineMonitor::EPEMessageServiceEnabled:
+            errorCode = iMessageHandler->HandleServiceEnabled();
+            break;
+            
+        case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
+            iMessageHandler->HandleRemotePartyInfoChanged( );
+            break;    
+
+        default:
+            break;
+            }    
+    
+    return errorCode;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::DelayMessageSending
+// Determines which messages needs to be delayed and delays sending them
+// to Engine monitor.
+// -----------------------------------------------------------------------------
+TBool CPEPhoneModel::DelayMessageSending( 
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
+        const TInt aCallId )
+    {    
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::DelayMessageSending" );
+        
+    TBool sendingDelayed( EFalse );
+    
+    if ( MEngineMonitor::EPEMessageInitiatedEmergencyCall == aMessage )
+        {
+        iEngineInfo->SetIsSwitchToOperationOngoing( EFalse );
+        if ( iCallStackCutter )
+            {
+            delete iCallStackCutter;
+            iCallStackCutter = NULL;
+            }
+        TRAPD( err, iCallStackCutter = CIdle::NewL( CActive::EPriorityHigh ) );
+        if ( !err )
+            {
+            iCallBackMessage = aMessage; 
+            iCallBackCallId  = aCallId;
+            iCallStackCutter->Start( TCallBack( CallBackMessageSend , this ) );
+            }
+        sendingDelayed = ETrue;        
+        }
+    return sendingDelayed;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::RecallSteps
+// Method informs about failures in starting modules.
+// -----------------------------------------------------------------------------
+//
+void CPEPhoneModel::RecallSteps()
+    {
+    SendMessage( MEngineMonitor::EPEMessagePEConstructionFailed );
+    iActiveStarter = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPhoneModel::StepL
+// Method starts and connects modules asynchronically.
+// -----------------------------------------------------------------------------
+//
+TBool CPEPhoneModel::StepL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 1" );
+    TBool continueStepping = ETrue;
+
+    switch ( iStep )
+        {
+        case CPEPhoneModel::EPEInitializeCceConnection:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 2.1" );
+            iConvergedCallEngine = CCCE::NewL();
+            MCCEDtmfObserver* tempPointer( NULL );
+            MCCEDtmfInterface& tempReference = iConvergedCallEngine->DtmfInterfaceL( *tempPointer );
+            iDtmfInterface = &tempReference;
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 2.2" );
+            break;
+            }
+        case CPEPhoneModel::EPEExternalData:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 3.1" );
+            iExternalDataHandler = CPEExternalDataHandler::NewL( *this );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 3.2" );
+            break;
+            }
+        case CPEPhoneModel::EPECallHandling:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 4.1" );
+            iCallHandling = CPECallHandling::NewL( *this, *iConvergedCallEngine, *iDtmfInterface  );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 4.2" );
+            break;
+            }
+        case CPEPhoneModel::EPEAudioHandling:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 5.1" );
+            if ( iAudioFactory )
+                {
+                iAudioData = CPEGsmAudioData::NewL( 
+                        *this, iFsSession, *iAudioFactory );
+                }
+            else
+                {
+                iAudioData = CPEGsmAudioData::NewL( *this, iFsSession );
+                }
+            iDtmfInterface->AddObserverL( *iAudioData );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 5.2" );
+            break;
+            }
+        case CPEPhoneModel::EPELogHandlingPhaseOne:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 6.1" );
+            // Create Log Handling proxy along with dummy implementation
+            iLogHandling = CPELogHandlingProxy::CreateFirstPhaseL();
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 6.2" );
+            break;
+            }
+        case CPEPhoneModel::EPEContactHandlingPhaseOne:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 7.1" );
+            // Create Contact Handling proxy along with dummy implementation
+            iContactHandling = CPEContactHandlingProxy::CreateFirstPhaseL(); 
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 7.2" );
+            break;
+            }
+        case CPEPhoneModel::EPESimStateMonitor:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 9.1" );
+            //started after message handler construction
+            iSimStatusMonitor = CPESimStateMonitor::NewL( 
+                *this, 
+                CPESimStateMonitor::EEventSimStatus );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 9.2" );
+            break;
+            }
+        case CPEPhoneModel::EPEServiceHandling:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 10.1" );
+            iServiceHandling = CPEServiceHandling::NewL( *this );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 10.2" );
+            break;
+            }
+        case CPEPhoneModel::EPEMessageHandler:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 11.1" );
+            iMessageHandler = CPEMessageHandler::NewL( *this, 
+                                                          *iCallHandling, 
+                                                          iEngineMonitor, 
+                                                          *iAudioData, 
+                                                          *iLogHandling, 
+                                                          *iContactHandling, 
+                                                          *iSimStatusMonitor,
+                                                          *iExternalDataHandler,
+                                                          *iServiceHandling,
+                                                          iFsSession );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 11.2" );
+            break;
+            }
+        case CPEPhoneModel::EPESimChangedMonitor:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 12.1" );
+            iSimChangedMonitor = CPESimStateMonitor::NewL( 
+                *this, 
+                CPESimStateMonitor::EEventSimChanged );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 12.2" );
+            iSimChangedMonitor->Start();
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 12.3" );
+            break;
+            }
+        case CPEPhoneModel::EPESimStatusMonitorStart:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 13.1" );
+            iSimStatusMonitor->Start();
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 13.2" );
+            break;
+            }
+        case CPEPhoneModel::EPELogHandlingPhaseTwo:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 14.1" );
+            // Finalize Log Handling contruction
+            static_cast< CPELogHandlingProxy* > ( iLogHandling )->CreateSecondPhaseL( 
+                *this, 
+                iFsSession );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 14.2" );
+            break;
+            }
+        case CPEPhoneModel::EPEContactHandlingPhaseTwo:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 15.1" );
+            static_cast< CPEContactHandlingProxy* >( iContactHandling )->
+                   CreateSecondPhaseL( *this, iFsSession );
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 15.2" );
+            break; 
+            }
+        case CPEPhoneModel::EPEMediatorCommandHandler:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 16.1" );
+            // Start Mediator command listener
+            iMediatorCommunicationHandler = CPERemotePartyInfoMediator::NewL( *this );
+            break; 
+            }
+        case CPEPhoneModel::EPEPhoneServices:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 16.1" );
+            __ASSERT_DEBUG( iMessageHandler, Panic( EPEPanicNullPointer ) );
+            __ASSERT_DEBUG( iEngineInfo, Panic( EPEPanicNullPointer ) );
+            iPhoneServices = new PhoneServices(
+                *iMessageHandler, *iEngineInfo, *iMessageHandler);
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 16.2" );
+            break;
+            }
+
+        case CPEPhoneModel::EPEParserRecognizer:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 17.1" );
+            iParserRecognizer = new ParserRecognizer;
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 17.2" );
+            break;
+            }
+            
+        case CPEPhoneModel::EPENetworkHandling:
+            {
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 18.1" );
+            XQServiceRequest request("com.nokia.services.networkhandling","start()");
+            bool res = request.send();
+            if  (!res) {
+                int error = request.latestError();
+                TEFLOGSTRING2( 
+                    KTAOBJECT, 
+                    "CPEPhoneModel::StepL 18.2 error %d",
+                    error );
+            }
+            TEFLOGSTRING( KTAOBJECT, "CPEPhoneModel::StepL: 18.2" );
+            continueStepping = EFalse;
+            break;
+            }
+
+        default:
+            {
+            Panic( EPEPanicIndexOutOfRange );
+            break;
+            }
+        }
+
+    if ( !continueStepping )
+        {
+        // Note, if you add cases, you have to set 
+        // continueStepping = EFalse into the last case.
+        SendMessage( MEngineMonitor::EPEMessagePEConstructionReady );
+        iActiveStarter = NULL;
+        }
+    else
+        {
+        ++iStep;
+        }
+    return continueStepping;
+    }// StepL
+
+// -----------------------------------------------------------------------------
+// Handle internal messages
+// -----------------------------------------------------------------------------
+//
+void CPEPhoneModel::HandleInternalMessage( 
+    const TInt aMessage ) 
+    {
+    HandleMessage( aMessage );
+    }
+
+// -----------------------------------------------------------------------------
+// ConstructContactHandlingPhaseTwoL
+// -----------------------------------------------------------------------------
+//
+void CPEPhoneModel::ConstructContactHandlingPhaseTwoL()
+    {
+    TEFLOGSTRING( KTAOBJECT, 
+        "PE CPEPhoneModel::ConstructContactHandlingPhaseTwo, start" );
+    // Finalize Contact Handling contruction
+    static_cast< CPEContactHandlingProxy* >( iContactHandling )->
+        CreateSecondPhaseL( *this, iFsSession );
+    TEFLOGSTRING( KTAOBJECT, 
+        "PE CPEPhoneModel::ConstructContactHandlingPhaseTwo, complete" );
+    SendMessage( MEngineMonitor::EPEMessagePEConstructionTwoPhaseReady );   
+    // not need any more
+    delete iIdleStatusMonitor; 
+    iIdleStatusMonitor = NULL; 
+    }
+
+// -----------------------------------------------------------------------------
+// CallBackSendMessage
+// -----------------------------------------------------------------------------
+//
+TInt CPEPhoneModel::CallBackMessageSend( TAny* aSelf )
+    {
+    TEFLOGSTRING( KTAINT, 
+        "PE CPEPhoneModel::CallBackMessageSend, start" );
+      
+    CPEPhoneModel* self = static_cast<CPEPhoneModel*>( aSelf );
+  
+    self->iEngineMonitor.HandleMessage( self->iCallBackMessage, self->iCallBackCallId );
+   
+    return KErrNone;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpephonemodelif.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MPEPhoneModelInternal handles the creation of protocol specific phone model.
+*
+*/
+
+
+#include "cpephonemodelif.h"
+
+
+// ---------------------------------------------------------------------------
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------------------------
+//
+CPEPhoneModelIF::CPEPhoneModelIF()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPEPhoneModelIF::~CPEPhoneModelIF()
+    {
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpeprofilesettingmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPEProfileSettingMonitor
+*                class 
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpeprofilesettingmonitor.h"
+#include "mpephonemodelinternal.h"
+#include <mpedatastore.h>
+#include <MProfileExtraTones.h>
+#include <talogger.h>
+
+
+/////////////////////////////////////////////////////////////////////////
+// CPEProfileSettingMonitor
+/////////////////////////////////////////////////////////////////////////
+
+CPEProfileSettingMonitor* CPEProfileSettingMonitor::NewL(
+        MPEPhoneModelInternal& aModel )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEProfileSettingMonitor::NewL" );
+    CPEProfileSettingMonitor* self = new ( ELeave ) CPEProfileSettingMonitor( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return ( self );                                                         
+    }
+
+// Destructor
+CPEProfileSettingMonitor::~CPEProfileSettingMonitor( )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEProfileSettingMonitor::~CPEProfileSettingMonitor" );
+    if ( iProfileEventHandler )
+        {
+        delete iProfileEventHandler;
+        iProfileEventHandler = NULL;
+        }
+    if ( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPEProfileSettingMonitor::CPEProfileSettingMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEProfileSettingMonitor::CPEProfileSettingMonitor(
+        MPEPhoneModelInternal& aModel
+        ) : iModel( aModel )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CPEProfileSettingMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEProfileSettingMonitor::ConstructL()
+    {
+    // Create the profile engine
+    iProfileEngine = CreateProfileEngineL();
+    
+    // Retrieve current profile settings    
+    GetProfileSettingsL();
+    
+    iModel.SendMessage( MEngineMonitor::EPEMessageProfileChanged ); 
+    
+    // Start listening for profiles change notifications
+    iProfileEventHandler = CProfileChangeNotifyHandler::NewL( this );    
+    }
+
+// -----------------------------------------------------------------------------
+// CPEProfileSettingMonitor::GetProfileSettingsL
+// Retrieves settings from profiles that are relevant to Phone Engine
+// Called on construction and whenever notification is received that
+// a change has occurred to the profile settings
+// -----------------------------------------------------------------------------
+//
+void CPEProfileSettingMonitor::GetProfileSettingsL()
+    {
+    TEFLOGSTRING( KTAINT, "PE CPEProfileSettingMonitor::GetProfileSettings" );
+    __UHEAP_MARK;
+    //  Get a pointer to the active profile (with ownership)
+    MProfile* activeProfile = iProfileEngine->ActiveProfileLC();
+    
+    // Get profile id
+    iModel.DataStore()->SetProfileId( activeProfile->ProfileName().Id() );
+    // Get profile name
+    iModel.DataStore()->SetProfileName( activeProfile->ProfileName().Name() );
+    
+    const MProfileTones& activeTones = activeProfile->ProfileTones();
+    
+    // Get ringtones for line 1 and 2
+    iModel.DataStore()->SetRingingTone1( activeTones.RingingTone1() );
+    iModel.DataStore()->SetRingingTone2( activeTones.RingingTone2() );
+    
+    // Get video call ringing tone, if it is supported
+    if ( iProfileEngine->IsFeatureSupported( EProfileFeatureVTRingingTone ) )
+        {
+        const MProfileExtraTones& extraTones = activeProfile->ProfileExtraTones();
+        iModel.DataStore()->SetVideoCallRingingTone( 
+            extraTones.VideoCallRingingTone() );
+        }
+    const TProfileToneSettings& toneSettings = activeTones.ToneSettings();  
+    
+    // Get ringing type and volume and keypad volume
+    TProfileRingingType ringingType = toneSettings.iRingingType;    
+    iModel.DataStore()->SetRingingType( static_cast<TProfileRingingType>( ringingType ) );
+    iModel.DataStore()->SetRingingVolume( toneSettings.iRingingVolume );
+    iModel.DataStore()->SetTextToSpeech( toneSettings.iTextToSpeech );
+                  
+    TProfileKeypadVolume keypadVolume = toneSettings.iKeypadVolume;
+        
+    if ( keypadVolume < EProfileKeypadVolumeOff 
+        || keypadVolume > EProfileKeypadVolumeLevel3 )
+        {
+        // Value is out of range - use default
+        keypadVolume = EProfileKeypadVolumeLevel2; // default value
+        }
+    
+    const TInt KKeypadVolume[4] = {0, 2, 5, 10}; // Previous PE settings
+    TInt volume = KKeypadVolume[ keypadVolume ];
+    iModel.DataStore()->SetKeypadVolume( volume );
+
+    //  Get alert for group Ids
+    iModel.DataStore()->SetAlertForGroup( activeProfile->AlertForL() );
+
+    // Pop( activeProfile ) does not recognize ActiveProfileLC created 
+    // item because of casting. However, functionality and cleanup works OK.
+    CleanupStack::Pop(); // activeProfile
+    activeProfile->Release();
+    __UHEAP_MARKEND;
+    }
+
+// -----------------------------------------------------------------------------
+// CPEProfileSettingMonitor::HandleActiveProfileEventL
+// Callback function - implements virtual function from MProfileChangeObserver
+// This is called whenever profiles settings change
+// We're not interested in aProfileId which identifies the number of the active profile changed
+// This notifier doesn't identify the property changed - so update them all by 
+// calling the GetProfileSettingsL() method
+// -----------------------------------------------------------------------------
+//
+void CPEProfileSettingMonitor::HandleActiveProfileEventL(
+        TProfileEvent aProfileEvent,
+        TInt /*aProfileId*/ )
+    {
+    TEFLOGSTRING2( KTAINT, "PE CPEProfileSettingMonitor::HandleActiveProfileEventL %d", aProfileEvent );
+    
+    ASSERT( aProfileEvent != EProfileUnknownEvent );
+    
+    // Update the iEngineInfo with the required profile settings    
+    GetProfileSettingsL();
+    
+    if ( aProfileEvent != EProfileUnknownEvent )
+        {
+        // A new profile has been set
+        iModel.SendMessage( MEngineMonitor::EPEMessageProfileChanged );        
+        }        
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpepubsubmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains phone engine central repository monitor base class
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpepubsubmonitor.h"
+#include <centralrepository.h>
+#include <pepanic.pan>
+#include <talogger.h>
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::CPEPubSubMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPEPubSubMonitor::CPEPubSubMonitor(
+        MPEPhoneModelInternal& aModel
+        ) : CActive( EPriorityStandard ),
+            iModel(aModel)
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// Destructor
+CPEPubSubMonitor::~CPEPubSubMonitor(
+        // None
+        )
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::BaseConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPEPubSubMonitor::BaseConstructL(
+        TUid  aCategory,  // category of the property
+        TUint aKey,       // key of the property
+        TUint /*aType*/ ) // type of the property
+    {
+    #ifdef TF_LOGGING_ENABLED    
+    TUidName name = aCategory.Name();
+    
+    TEFLOGSTRING3( KTAOBJECT, "CPEPubSubMonitor::BaseConstructL: Category %S, key %d", 
+                   &name, aKey );                   
+    
+    iCategory = aCategory;
+    iKey = aKey;
+    #endif
+           
+    TInt error = iProperty.Attach( aCategory, aKey  );   
+    if ( ( error!=KErrNone ) )
+        {
+        TEFLOGSTRING3( KTAOBJECT, 
+            "PE CPEPubSubMonitor::BaseConstructL: Error while attaching. Category %S, key %d", 
+                   &name, aKey );
+        User::Leave(error);
+        }
+    
+
+    SubmitNotifyRequestL();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::Get
+// Getting an integer value
+// -----------------------------------------------------------------------------
+//
+TInt CPEPubSubMonitor::Get(
+        TInt& aValue
+        )
+    {
+    return ( iProperty.Get( aValue ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::Get
+// Getting a binary value
+// -----------------------------------------------------------------------------
+//
+TInt CPEPubSubMonitor::Get(
+        TDes8& aValue
+        )
+    {
+    return ( iProperty.Get( aValue ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::Get
+// Getting a text value
+// -----------------------------------------------------------------------------
+//
+TInt CPEPubSubMonitor::Get(
+        TDes16& aValue
+        )
+    {
+    return ( iProperty.Get( aValue ) );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::SubmitNotifyRequestL
+// -----------------------------------------------------------------------------
+//
+void CPEPubSubMonitor::SubmitNotifyRequestL(
+        // None
+        )
+    {
+    #ifdef TEF_LOGGING_ENABLED    
+    TUidName name = iCategory.Name();
+    #endif    
+    TEFLOGSTRING3( KTAINT, "CPEPubSubMonitor::SubmitNotifyRequestL: Category %S, key %d", 
+                   &name, iKey );
+    
+    __ASSERT_DEBUG( !IsActive(), Panic( EPEPanicPropertyAlreadyActive ) );
+    iProperty.Subscribe( iStatus );
+    SetActive( );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::DoCancel
+// -----------------------------------------------------------------------------
+//
+void CPEPubSubMonitor::DoCancel(
+        // None
+        )
+    {
+    #ifdef TF_LOGGING_ENABLED    
+    TUidName name = iCategory.Name();
+    #endif    
+    TEFLOGSTRING3( KTAINT, "CPEPubSubMonitor::DoCancel: Category %S, key %d", 
+                   &name, iKey );
+    
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::RunError
+// -----------------------------------------------------------------------------
+//
+TInt CPEPubSubMonitor::RunError(
+        #ifdef TEF_LOGGING_ENABLED
+        TInt aError // Log the leavecode from RunL
+        #else
+        TInt /*aError*/
+        #endif
+        )
+    {
+    #ifdef TEF_LOGGING_ENABLED
+    TUidName name = iCategory.Name(); 
+    TEFLOGSTRING4( KTAERROR, "CPEPubSubMonitor::RunError %d, Category: %S, key %d",
+                   aError, &name, iKey );
+                   
+    #endif
+    return ( KErrNone );
+    }
+
+// -----------------------------------------------------------------------------
+// CPEPubSubMonitor::RunL
+// -----------------------------------------------------------------------------
+//
+void CPEPubSubMonitor::RunL(
+        // None
+        )
+    {
+    TEFLOGSTRING2( KTAREQEND, "CPEPubSubMonitor::RunL, status: %d", iStatus.Int() );
+
+    // Don't resubmit the request on error
+    User::LeaveIfError(iStatus.Int());
+    SubmitNotifyRequestL();
+    UpdateL();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cperemotepartyinfomediator.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Forwards remote party info changes to Mediator.
+*
+*/
+
+#include "cperemotepartyinfomediator.h"
+
+#include <MediatorDomainUIDs.h>
+#include <MediatorCommandResponder.h>
+#include <MediatorEventProvider.h>
+#include <callremotepartyinformation.h>
+
+#include "cperemotepartyinfoproxy.h"
+#include "tperemotepartyinfomediatorupdater.h"
+#include "mpephonemodelinternal.h"
+#include "mpedatastore.h"
+#include <talogger.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoMediator* CPERemotePartyInfoMediator::NewL( MPEPhoneModelInternal& aModel )
+    {
+    CPERemotePartyInfoMediator* self = CPERemotePartyInfoMediator::NewLC( aModel );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoMediator* CPERemotePartyInfoMediator::NewLC( MPEPhoneModelInternal& aModel )
+    {
+    CPERemotePartyInfoMediator* self = new( ELeave ) CPERemotePartyInfoMediator;
+    CleanupStack::PushL( self );
+    self->ConstructL( aModel );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoMediator::~CPERemotePartyInfoMediator()
+    {
+    if ( iEventProvider )
+        {
+        TInt ignore = iEventProvider->UnregisterEvent( 
+                        KMediatorTelephonyDomain, 
+                        KCatCallRemotePartyInformation,
+                        EChangesInRemotePartyInformation );
+        }
+    delete iEventProvider;
+    if ( iResponder )
+        {
+        TInt ignore = iResponder->UnregisterCommand( 
+                        KMediatorTelephonyDomain, 
+                        KCatCallRemotePartyInformation,
+                        EGetCallRemotePartyInformation );
+        }
+    delete iResponder;   
+    delete iUpdater;
+    delete iProxy;
+    }
+
+// ---------------------------------------------------------------------------
+// Updates call infos
+// ---------------------------------------------------------------------------
+//
+void CPERemotePartyInfoMediator::UpdateRemotePartyInfo()
+    {
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoMediator::UpdateRemotePartyInfo(): IN" );
+    
+    iUpdater->Update(); 
+    
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoMediator::UpdateRemotePartyInfo(): OUT" );
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPEMediator
+// Sends the response to mediator
+// ---------------------------------------------------------------------------
+//
+void CPERemotePartyInfoMediator::SendResponse( TUid aCategory,
+                                               TInt aCommandId,
+                                               const TDesC8& aData )
+    {
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoMediator::SendResponse(): IN" );
+    const TInt ignore( iResponder->IssueResponse( 
+                                    KMediatorTelephonyDomain,
+                                    aCategory, 
+                                    aCommandId, KErrNone, aData ) ); 
+    TEFLOGSTRING2( KTAINT, "CPERemotePartyInfoMediator::SendResponse() err = %d", ignore );
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoMediator::SendResponse(): OUT" );
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPEMediator
+// Raises the mediator event.
+// ---------------------------------------------------------------------------
+//
+void CPERemotePartyInfoMediator::RaiseEvent( TUid aCategory,
+                                             TInt aEventId,
+                                             const TDesC8& aData )
+    {
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoMediator::RaiseEvent(): IN" );
+    TVersion version( KCallRemotePartyInformationVersionMajor,
+                      KCallRemotePartyInformationVersionMinor, 
+                      KCallRemotePartyInformationVersionBuild );
+    
+    const TInt ignore( iEventProvider->RaiseEvent( 
+                                        KMediatorTelephonyDomain,
+                                        aCategory, 
+                                        aEventId, version, aData ) );
+    TEFLOGSTRING2( KTAINT, "CPERemotePartyInfoMediator::RaiseEvent() err = %d", ignore );
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoMediator::RaiseEvent(): OUT" );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoMediator::CPERemotePartyInfoMediator()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPERemotePartyInfoMediator::ConstructL( MPEPhoneModelInternal& aModel )
+    {
+    MPEDataStore* dataStore = aModel.DataStore();
+    
+    iProxy = CPERemotePartyInfoProxy::NewL(*this );
+    
+    iUpdater = new( ELeave ) TPERemotePartyInfoMediatorUpdater( *iProxy, *dataStore );    
+    
+    iResponder = CMediatorCommandResponder::NewL( iUpdater );
+    TCapabilitySet caps = TCapabilitySet( ECapabilityReadUserData );
+    
+    TVersion version( KCallRemotePartyInformationVersionMajor,
+                      KCallRemotePartyInformationVersionMinor, 
+                      KCallRemotePartyInformationVersionBuild );
+    
+    User::LeaveIfError( iResponder->RegisterCommand( 
+                                        KMediatorTelephonyDomain,
+                                        KCatCallRemotePartyInformation, 
+                                        EGetCallRemotePartyInformation,
+                                        version,
+                                        caps,
+                                        KMediatorTimeoutInfinite ) );
+    
+    iEventProvider = CMediatorEventProvider::NewL();
+    User::LeaveIfError( 
+        iEventProvider->RegisterEvent( 
+            KMediatorTelephonyDomain, KCatCallRemotePartyInformation, 
+            EChangesInRemotePartyInformation, version, caps ) );
+
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cperemotepartyinfoproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "cperemotepartyinfoproxy.h"
+
+#include <talogger.h>
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoProxy::CPERemotePartyInfoProxy( MPEMediator& aMediator )
+    :iMediator( aMediator )
+    {    
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CPERemotePartyInfoProxy::ConstructL()
+    {
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoProxy* CPERemotePartyInfoProxy::NewL( MPEMediator& aMediator )
+    {
+    CPERemotePartyInfoProxy* self = CPERemotePartyInfoProxy::NewLC( aMediator );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoProxy* CPERemotePartyInfoProxy::NewLC( MPEMediator& aMediator )
+    {
+    CPERemotePartyInfoProxy* self = new( ELeave ) CPERemotePartyInfoProxy( aMediator );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPERemotePartyInfoProxy::~CPERemotePartyInfoProxy()
+    {
+    delete iRemotePartyData;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From base class MPEMediator
+// ---------------------------------------------------------------------------
+//
+void CPERemotePartyInfoProxy::SendResponse( TUid aCategory,
+                                            TInt aCommandId,
+                                            const TDesC8& aData )
+    {
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::SendResponse(): IN" );
+    
+    iRemotePartyData = aData.Alloc();
+    
+    // No need to filter command responses
+    iMediator.SendResponse( aCategory,
+                             aCommandId,
+                             aData );
+    
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::SendResponse(): OUT" );    
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MPEMediator
+// ---------------------------------------------------------------------------
+//
+void CPERemotePartyInfoProxy::RaiseEvent( TUid aCategory,
+                                          TInt aEventId,
+                                          const TDesC8& aData )
+    {
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::RaiseEvent(): IN" );
+    
+    
+    
+    // if changes in data or no data --> update proxy's data and pass event forward.
+    if ( !iRemotePartyData || !iRemotePartyData->Match( aData ) == KErrNone )
+        {
+        delete iRemotePartyData;
+        iRemotePartyData = aData.Alloc();
+        iMediator.RaiseEvent( aCategory,
+                              aEventId,
+                              aData );  
+        }
+    
+    TEFLOGSTRING( KTAINT, "CPERemotePartyInfoProxy::RaiseEvent(): OUT" );
+    }
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpesettingscommand.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  implementation of CPESettingsCommand class.
+*
+*/
+
+
+// INCLUDES
+#include "cpesettingscommand.h"
+#include "mpephonemodelinternal.h"
+#include <mpedatastore.h>
+#include <talogger.h>
+
+
+// LOCAL CONSTANTS
+// None.
+
+// ==================== LOCAL FUNCTIONS =====================================
+//None.
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPESettingsCommand::CPESettingsCommand
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPESettingsCommand::CPESettingsCommand(
+        MPEPhoneModelInternal& aModel ) : iModel( aModel )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE: CPESettingsCommand::CPESettingsCommand" );
+    } //CPESettingsCommand
+
+// -----------------------------------------------------------------------------
+// CPESettingsCommand::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPESettingsCommand::ConstructL()
+    {
+    User::LeaveIfError( iSSSettings.Open() );
+    TInt errorCode = iSSSettings.RegisterAll( *this );
+    if ( errorCode == KErrNotSupported )
+        {
+        errorCode = KErrNone;
+        }
+    User::LeaveIfError( errorCode );
+
+    TEFLOGSTRING( KTAOBJECT, "PE CPESettingsCommand::ConstructL" );
+    } //ConstructLb
+
+// -----------------------------------------------------------------------------
+// CPESettingsCommand::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPESettingsCommand* CPESettingsCommand::NewL(
+        MPEPhoneModelInternal& aModel )
+    {
+    CPESettingsCommand* self = new ( ELeave ) CPESettingsCommand( aModel );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+
+    TEFLOGSTRING( KTAOBJECT, "PE CPESettingsCommand::NewL" );
+
+    return self;
+
+    } //NewL
+
+// Destructor
+CPESettingsCommand::~CPESettingsCommand()
+    {
+    iSSSettings.Close();
+    TEFLOGSTRING( KTAOBJECT, "PE CPESettingsCommand::~CPESettingsCommand" );
+    } //~CPESettingsCommand
+
+// -----------------------------------------------------------------------------
+// CPESettingsCommand::GetALSLineL
+// Sends synchronous request to get the ALS line and returns handle to access 
+// the status.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPESettingsCommand::GetALSLineL(
+        RMobilePhone::TMobilePhoneALSLine& aALSLine )
+    {
+    TInt value;
+    User::LeaveIfError( iSSSettings.Get( ESSSettingsAls, value ) );
+
+    TSSSettingsAlsValue alsValue = 
+        static_cast< TSSSettingsAlsValue > ( value );
+
+    switch( alsValue )
+        {
+        case ESSSettingsAlsNotSupported:
+            aALSLine = RMobilePhone::EAlternateLineNotAvailable;
+            break;
+        case ESSSettingsAlsPrimary: 
+            aALSLine = RMobilePhone::EAlternateLinePrimary;       
+            break;
+        case ESSSettingsAlsAlternate:
+            aALSLine = RMobilePhone::EAlternateLineAuxiliary;
+            break;
+        default:
+            break;
+        }
+    } //GetALSLineL
+
+// -----------------------------------------------------------------------------
+// CPESettingsCommand::SetALSLineL
+// Sends synchronous request to set the ALS line and returns handle to access 
+// the status.
+// -----------------------------------------------------------------------------
+//
+void CPESettingsCommand::SetALSLineL(
+        RMobilePhone::TMobilePhoneALSLine& aALSLine )
+    {
+    TSSSettingsAlsValue alsValue = 
+        static_cast<TSSSettingsAlsValue> ( aALSLine );
+        
+    switch( aALSLine )
+        {
+        case RMobilePhone::EAlternateLineUnknown:
+        case RMobilePhone::EAlternateLineNotAvailable:
+            alsValue = ESSSettingsAlsNotSupported;
+            break;
+        case RMobilePhone::EAlternateLinePrimary: 
+            alsValue = ESSSettingsAlsPrimary;       
+            break;
+        case RMobilePhone::EAlternateLineAuxiliary:
+            alsValue = ESSSettingsAlsAlternate;
+            break;
+        default:
+            TEFLOGSTRING( KTAINT,
+                "PE CPESettingsCommand::SetALSLineL: Not valid value" );
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicInvalidRequest ) );
+            break;
+        }
+    User::LeaveIfError( iSSSettings.Set( ESSSettingsAls, alsValue ) );
+    } 
+
+// -----------------------------------------------------------------------------
+// CPESettingsCommand::GetClirL
+// Sends synchronous request to get the CLIR value and returns handle to access 
+// the status.
+// -----------------------------------------------------------------------------
+//
+void CPESettingsCommand::GetClirL(
+        RMobileCall::TMobileCallIdRestriction& aClir )
+    {
+    TInt value;
+    User::LeaveIfError( iSSSettings.Get( ESSSettingsClir, value ) );
+
+    TSSSettingsClirValue clir = 
+        static_cast<TSSSettingsClirValue> ( value );
+    TEFLOGSTRING2( KTAERROR,
+        "PE CPESettingsCommand::GetClirL, clir: %d", clir );
+        
+    switch( clir )
+        {
+        case ESSSettingsClirNetworkDefault:
+            aClir = RMobileCall::EIdRestrictDefault;
+            break;
+        case ESSSettingsClirExplicitInvoke: 
+            aClir = RMobileCall::EDontSendMyId;
+            break;
+        case ESSSettingsClirExplicitSuppress:
+            aClir = RMobileCall::ESendMyId; 
+            break;
+        default:
+            TEFLOGSTRING2( KTAERROR,
+                "PE CPESettingsCommand::GetClirL, NOT VALID aClir: %d", aClir );
+            __ASSERT_DEBUG( EFalse, Panic( EPEPanicInvalidRequest ) );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESettingsCommand::GetCugL
+// Sends synchronous request to get the CUG index and returns handle to access 
+// the status.
+// -----------------------------------------------------------------------------
+//
+void CPESettingsCommand::GetCugL(
+        TInt aCugIndex )
+    {
+    TEFLOGSTRING2( KTAINT,
+        "PE CPESettingsCommand::GetCugL, aCugIndex: %d", aCugIndex );
+    User::LeaveIfError( iSSSettings.Get( ESSSettingsCug, aCugIndex ) );
+    }
+    
+// ---------------------------------------------------------
+// CPESettingsCommand::PhoneSettingChanged
+// ---------------------------------------------------------
+//
+void CPESettingsCommand::PhoneSettingChanged( 
+        TSSSettingsSetting aSetting, 
+        TInt aNewValue )
+    {
+    if ( aSetting == ESSSettingsAls )
+        {
+        TSSSettingsAlsValue alsValue = 
+            static_cast< TSSSettingsAlsValue > ( aNewValue );
+    
+        RMobilePhone::TMobilePhoneALSLine 
+            alsLine( RMobilePhone::EAlternateLineUnknown );
+
+        switch( alsValue )
+            {
+            case ESSSettingsAlsNotSupported:
+                alsLine = RMobilePhone::EAlternateLineNotAvailable;
+                break;
+            case ESSSettingsAlsPrimary: 
+                alsLine = RMobilePhone::EAlternateLinePrimary;       
+                break;
+            case ESSSettingsAlsAlternate:
+                alsLine = RMobilePhone::EAlternateLineAuxiliary;
+                break;
+            default:
+                break;
+            }
+        iModel.DataStore()->SetALSLine( CCCECallParameters::TCCELineType( alsLine ) );
+        iModel.SendMessage( MEngineMonitor::EPEMessageALSLineChanged );
+        }
+    } // PhoneSettingChanged
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpesimstatemonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sim State Monitoring class methods implementation
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "cpesimstatemonitor.h"
+#include "mpephonemodelinternal.h"
+#include <startupdomainpskeys.h>
+#include <talogger.h>
+
+
+// ================= MEMBER FUNCTIONS =======================================
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::CPESimStateMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPESimStateMonitor::CPESimStateMonitor( 
+    MPEPhoneModelInternal& aModel, 
+    const TEvent aEvent )
+   : CActive( EPriorityStandard ),
+     iModel( aModel ),
+     iSimState( EPESimStatusUninitialized ),
+     iStartUp( ETrue )
+    {
+    if ( aEvent == EEventSimStatus )
+        {
+        iPropertyKey = KPSSimStatus;
+        }
+    else
+        {
+        iPropertyKey = KPSSimChanged;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPESimStateMonitor::ConstructL()
+    {
+    TEFLOGSTRING( KTAMESOUT, "PE CPESimStateMonitor::ConstructL start" );
+
+    RProperty::TType type( RProperty::EInt );
+    TInt err = iProperty.Define( KPSUidStartup, iPropertyKey, type );
+
+    //An error of KErrAlready exists should be ignored, as this only
+    //indicates that some other code int system is also interested in the 
+    //value and has created the property.
+    if ( err != KErrNone && err != KErrAlreadyExists )
+        {
+        User::Leave( err );
+        }
+    User::LeaveIfError( iProperty.Attach( KPSUidStartup, iPropertyKey ) );
+
+    // NOTE StartMonitoring() is not called here and this is intentional.
+    // It is undesirable to send out messages before initialization is complete.
+    // The first completion of this monitor is achieved by calling Start() from
+    // MPEPhoneModelInternal::StepL()
+
+    TEFLOGSTRING( KTAMESOUT, "PE CPESimStateMonitor::ConstructL complete" );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPESimStateMonitor* CPESimStateMonitor::NewL( 
+    MPEPhoneModelInternal& aModel, 
+    const TEvent aEvent )
+    {
+    TEFLOGSTRING2( KTAOBJECT, "PE CPESimStateMonitor::Newl %d", aEvent );
+    CPESimStateMonitor* self = new ( ELeave ) CPESimStateMonitor( aModel, aEvent );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    TEFLOGSTRING( KTAMESOUT, "PE CPESimStateMonitor::NewL complete" );
+
+    return self;
+    }
+
+// Destructor
+CPESimStateMonitor::~CPESimStateMonitor()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::Start
+// Completes monitor to finish initialization
+// -----------------------------------------------------------------------------
+//
+void CPESimStateMonitor::Start()
+    {
+    if ( !IsActive() )
+        {
+        CActiveScheduler::Add( this );
+        SetActive();
+        TRequestStatus* status = &iStatus ;
+        User::RequestComplete( status, KErrNone );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::SimState
+// Returns Sim state.
+// -----------------------------------------------------------------------------
+//
+TPESimState CPESimStateMonitor::SimState() const
+    {
+    return static_cast<TPESimState>( iSimState );
+    }
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::StartMonitoring
+// Starts monitoring Sim state
+// -----------------------------------------------------------------------------
+//
+void CPESimStateMonitor::StartMonitoring()
+    {
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::DoCancel
+// Callback method from CActive.
+// -----------------------------------------------------------------------------
+//
+void CPESimStateMonitor::DoCancel()
+    {   
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPESimStateMonitor::RunL
+// In startup reads Sim state from System Agent, otherwise it is called 
+// when Sim state is changed.
+// -----------------------------------------------------------------------------
+//
+void CPESimStateMonitor::RunL()
+    {
+    TInt status = iStatus.Int(); 
+    // resubscribe before processing new value to prevent missing updates
+    StartMonitoring();
+
+    iProperty.Get( KPSUidStartup, iPropertyKey, iSimState );
+
+    if ( iStartUp )
+        {
+        iStartUp = EFalse;
+
+        if ( iPropertyKey == KPSSimStatus )
+            {
+            if( iSimState != EPESimStatusUninitialized && iSimState != EPESimNotSupported )
+                {
+                iModel.SendMessage( MEngineMonitor::EPEMessageSIMStateChanged );
+                }
+            }
+        else
+            {
+            iModel.SendMessage( MEngineMonitor::EPEMessageSIMChanged );
+            }
+        }
+    else // Sim or Sim status has changed
+        {
+        if ( status == KErrNone ) 
+            {
+            TEFLOGSTRING3( KTAMESINT, 
+                "PE CPESimStateMonitor::RunL, event: %d, property: %d"
+                , iPropertyKey
+                , iSimState );
+
+            if ( iPropertyKey == KPSSimStatus )
+                {    
+                iModel.SendMessage( MEngineMonitor::EPEMessageSIMStateChanged );
+                }
+            else 
+                {
+                if ( iSimState == ESimChanged )
+                    {
+                    iModel.SendMessage( MEngineMonitor::EPEMessageSIMChanged );
+                    }
+                }
+            }
+        else
+            {
+            TEFLOGSTRING3( KTAERROR, "PE CPESimStateMonitor::RunL, event: %d, status: %d", iPropertyKey, status );
+            }   
+        }
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// None
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/cpetimer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of CPETimer class 
+*
+*/
+
+
+// INCLUDE FILES
+#include "cpetimer.h"
+#include "mpephonemodelinternal.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+//None
+
+// ==================== LOCAL FUNCTIONS ========================================
+// None.
+
+// ================= MEMBER FUNCTIONS ==========================================
+
+// -----------------------------------------------------------------------------
+// CPETimer::CPETimer
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CPETimer::CPETimer
+        (
+        MPEPhoneModelInternal& aModel   //MPEPhoneModelInternal is used to message sending.
+        ) : CActive( EPriorityStandard ), 
+            iModel( aModel )
+    {
+    CActiveScheduler::Add( this );
+    }
+// -----------------------------------------------------------------------------
+// CPETimer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPETimer::ConstructL()
+    {
+    User::LeaveIfError( iTimer.CreateLocal() );
+    }
+
+// -----------------------------------------------------------------------------
+// CPETimer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPETimer* CPETimer::NewL(
+    MPEPhoneModelInternal& aModel )
+    {
+    CPETimer* self = new ( ELeave ) CPETimer ( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CPETimer::~CPETimer
+        (
+        // None.
+        )
+    {
+    Cancel();
+    iTimer.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CPETimer::ResetTimer
+// Starts CPEtimer object
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPETimer::ResetTimer
+        (
+        // None
+        )
+    {
+    Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CPETimer::StartTimer
+// Starts CPEtimer object
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TInt CPETimer::StartTimer
+        (
+        const TTimeIntervalMicroSeconds32 aSeconds, // includes timer delay
+        const MEngineMonitor::TPEMessagesFromPhoneEngine aResponseMessage,          // the identification number of the response message
+        const TInt aCallId                          // the identification number of the call
+        )
+    {
+    TInt errorCode( ECCPErrorAlreadyInUse );
+    if ( !IsActive() )
+        {
+        iTimer.Cancel();
+        iResponseMessage = aResponseMessage;
+        iCallId = aCallId;
+        iTimer.After( iStatus,  aSeconds );
+        SetActive( );
+        errorCode = ECCPErrorNone;    
+        }
+    return errorCode;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CPETimer::DoCancel
+// Cancels active object requests
+// Method switches the asyncronous request by call status
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPETimer::DoCancel
+        (
+        // None
+        )
+    {
+    iTimer.Cancel();
+    iCallId = KPECallIdNotUsed;
+    }
+
+// -----------------------------------------------------------------------------
+// CPETimer::GetCallId
+// Gets the identification number of the call from intance variable.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPETimer::GetCallId
+        (
+        TInt& aCallId   // Includes identification number of the call.
+        ) const
+    {
+    aCallId = iCallId;
+    }
+
+// -----------------------------------------------------------------------------
+// CPETimer::RunL
+// Method gets notification from etel that asyncronous request is completed.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPETimer::RunL
+        (
+        // None.
+        )
+    {
+    if (iStatus != KErrCancel)
+        {   
+        iModel.SendMessage( iResponseMessage, iCallId );
+        }
+    }
+    
+// ================= OTHER EXPORTED FUNCTIONS ===============================
+//None
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/penetworkhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,108 @@
+/*!
+* 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:  Network handling.
+*
+*/
+
+#include <exception>
+#include <QString>
+#include "penetworkhandler.h"
+#include "mpedatastore.h"
+#include "qtphonelog.h"
+
+PeNetworkHandler::PeNetworkHandler(MPEPhoneModelInternal& aModel) :
+    iModel(aModel)
+{
+    m_networkInfo = new QSystemNetworkInfo();
+            
+    QSystemNetworkInfo::NetworkStatus nwStatus = 
+            m_networkInfo->networkStatus(QSystemNetworkInfo::GsmMode);
+    
+    if (nwStatus == QSystemNetworkInfo::NoNetworkAvailable) {
+        nwStatus = m_networkInfo->networkStatus(QSystemNetworkInfo::WcdmaMode);
+    }
+    
+    if (nwStatus == QSystemNetworkInfo::NoNetworkAvailable) {
+        nwStatus = m_networkInfo->networkStatus(QSystemNetworkInfo::CdmaMode);
+    }
+    
+    QObject::connect(m_networkInfo, SIGNAL(
+            networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus)), 
+            this, SLOT(networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus)));
+
+    iModel.DataStore()->SetNetworkRegistrationStatus( 
+        static_cast< TNWNetworkRegistrationStatus > ( convertStatus(nwStatus) ) );
+}
+
+PeNetworkHandler::~PeNetworkHandler()
+{   
+    delete m_networkInfo;
+}
+
+void PeNetworkHandler::networkStatusChanged(
+        QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status)
+{ 
+    if (mode == QSystemNetworkInfo::GsmMode ||
+        mode == QSystemNetworkInfo::WcdmaMode ||
+        mode == QSystemNetworkInfo::CdmaMode) {
+        sendStatus(status);
+    }
+}
+
+void PeNetworkHandler::sendStatus(
+        QSystemNetworkInfo::NetworkStatus status)
+{
+    iModel.DataStore()->SetNetworkRegistrationStatus( 
+        static_cast< TNWNetworkRegistrationStatus > ( convertStatus(status) ) );
+    iModel.SendMessage(MEngineMonitor::EPEMessageNetworkRegistrationStatusChange);
+}
+
+TNWNetworkRegistrationStatus PeNetworkHandler::convertStatus(
+        QSystemNetworkInfo::NetworkStatus status)
+{
+    TNWNetworkRegistrationStatus ret;
+    switch(status) {
+    case QSystemNetworkInfo::UndefinedStatus:
+        ret = ENWStatusRegistrationUnknown;
+    break;
+    case QSystemNetworkInfo::NoNetworkAvailable:
+        ret = ENWStatusNotRegisteredNoService;
+    break;
+    case QSystemNetworkInfo::EmergencyOnly:
+        ret = ENWStatusNotRegisteredEmergencyOnly;
+    break;
+    case QSystemNetworkInfo::Searching:
+        ret = ENWStatusNotRegisteredSearching;
+    break;
+    case QSystemNetworkInfo::Busy:
+        ret = ENWStatusRegisteredBusy;
+    break;
+    case QSystemNetworkInfo::Connected:
+    case QSystemNetworkInfo::HomeNetwork:
+        ret = ENWStatusRegisteredOnHomeNetwork;
+    break;
+    case QSystemNetworkInfo::Denied:
+        ret = ENWStatusRegistrationDenied;
+    break;
+    case QSystemNetworkInfo::Roaming:
+        ret = ENWStatusRegisteredRoaming;
+    break;
+    default:
+        ret = ENWStatusRegistrationUnknown;
+    break;
+    }
+    
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/pepanic.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of phone engine panic function
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include "pepanic.pan"
+
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+
+// -----------------------------------------------------------------------------
+// Panic
+// Creates PhoneEngine panic.
+// Returns: None.
+// -----------------------------------------------------------------------------
+//
+GLDEF_C void Panic( TPEPanic aPanic )
+    {
+    User::Panic( KPEPhoneEnginePanic, aPanic );
+    }
+
+// ===================== MEMBER FUNCTIONS ==================
+// None.
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+// None.
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/phoneengineproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contain GSM specific implementation of CPEPhoneModeL::CreateL
+*
+*/
+
+
+#include "cpephonemodelif.h"
+#include "cpephonemodel.h"
+
+// ---------------------------------------------------------------------------
+// Returns the pointer of the CPEPhoneModel object.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPEPhoneModelIF* CPEPhoneModelIF::CreateL( MEngineMonitor& aEngineMonitor )
+    {
+    return CPEPhoneModel::NewL( aEngineMonitor );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the pointer of the CPEPhoneModel object.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPEPhoneModelIF* CPEPhoneModelIF::CreateL( 
+    MEngineMonitor& aEngineMonitor,
+    CPEAudioFactory& aAudioFactory )
+    {
+    return CPEPhoneModel::NewL( aEngineMonitor, aAudioFactory );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/src/tperemotepartyinfomediatorupdater.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Updates remote party information via mediator.
+*
+*/
+
+#include "tperemotepartyinfomediatorupdater.h"
+#include "mpemediator.h"
+#include "mpedatastore.h"
+
+#include <talogger.h>
+#include <MediatorDomainUIDs.h>
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+TPERemotePartyInfoMediatorUpdater::TPERemotePartyInfoMediatorUpdater(
+    MPEMediator& aMediator,
+    MPEDataStore& aDataStore ) 
+    : iMediator( aMediator ),
+    iDataStore( aDataStore )
+    {
+    }
+   
+// ---------------------------------------------------------------------------
+// Sends mediator event with remote info.
+// ---------------------------------------------------------------------------
+//
+void TPERemotePartyInfoMediatorUpdater::Update()
+    {
+    HBufC8* data = NULL;
+    TRAPD( err, data = TakeSnapshotOfRemotePartyInfosL() );
+    if ( !err )
+        {
+        iMediator.RaiseEvent( 
+                KCatCallRemotePartyInformation,
+                EChangesInRemotePartyInformation,
+                *data );
+        }
+    delete data;
+        
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MMediatorCommandObserver
+// ---------------------------------------------------------------------------
+//
+void TPERemotePartyInfoMediatorUpdater::MediatorCommandL( 
+    TUid aDomain,
+    TUid aCategory, 
+    TInt aCommandId,
+    TVersion /*aVersion*/, 
+    const TDesC8& /*aData*/ )
+    {
+    if ( aDomain == KMediatorTelephonyDomain &&
+         aCategory == KCatCallRemotePartyInformation &&
+         aCommandId == EGetCallRemotePartyInformation )
+        {
+        HBufC8* data = TakeSnapshotOfRemotePartyInfosL();
+        
+        iMediator.SendResponse( 
+            KCatCallRemotePartyInformation,
+            EGetCallRemotePartyInformation,
+            *data );
+    
+        delete data;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From base class MMediatorCommandObserver
+// ---------------------------------------------------------------------------
+//
+void TPERemotePartyInfoMediatorUpdater::CancelMediatorCommand( 
+    TUid /*aDomain*/,
+    TUid /*aCategory*/, 
+    TInt /*aCommandId*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Takes remote party information from all calls and packs them to 
+// descriptor.
+// ---------------------------------------------------------------------------
+//
+HBufC8* TPERemotePartyInfoMediatorUpdater::TakeSnapshotOfRemotePartyInfosL()
+    {
+    CCallRemotePartyInfos* infos = CCallRemotePartyInfos::NewLC();
+    for ( TInt callId = 0; callId < KPEMaximumNumberOfCalls; callId++ )
+        {
+        const TInt callIndex = iDataStore.CallIndex( callId );
+        if ( callIndex != KPEInvalidCallIndex )
+            {
+            CCallRemotePartyInfo* info = CCallRemotePartyInfo::NewLC();
+            info->SetCallIndex( callIndex );
+            
+            if ( iDataStore.RemoteColpNumber( callId ).Length() )
+                {
+                info->SetAddressL( iDataStore.RemoteColpNumber( callId ) );
+                }
+            else
+                {
+                info->SetAddressL( iDataStore.RemotePhoneNumber( callId ) );    
+                }            
+            
+            info->SetMatchedNameL( iDataStore.RemoteName( callId ) );
+            info->SetCompanyNameL( iDataStore.RemoteCompanyName( callId ) );
+            info->SetNameFromNetworkL( iDataStore.RemotePartyName( callId ) );
+            
+            if ( iDataStore.CallOrigin( callId ) == EPECallOriginSAT )
+                {
+                info->SetSATCall( ETrue );
+                }  
+            
+            info->SetRemoteIdentity( ResolveRemoteIdentity( callId ) );
+                        
+            infos->AddL( info );
+            CleanupStack::Pop( info );
+            }
+        }
+    HBufC8* data = infos->ExternalizeL();
+    CleanupStack::PopAndDestroy( infos );
+    return data;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets remote party identity.
+// ---------------------------------------------------------------------------
+//
+MCallRemotePartyInfo::TRemoteIdentityStatus
+    TPERemotePartyInfoMediatorUpdater::ResolveRemoteIdentity( const TInt aCallId )
+    {    
+    MCallRemotePartyInfo::TRemoteIdentityStatus remoteIdentity;
+    if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileOriginated  )
+        {
+        // In MO case Remote party address is always available 
+        remoteIdentity = MCallRemotePartyInfo::ERemoteIdentityAvailable;
+        }
+    else
+        {
+        remoteIdentity = ConvertRemoteIdentity( aCallId );    
+        }                 
+    
+    return remoteIdentity;
+    }
+
+// ---------------------------------------------------------------------------
+// Converts remote party identity.
+// ---------------------------------------------------------------------------
+//
+MCallRemotePartyInfo::TRemoteIdentityStatus 
+    TPERemotePartyInfoMediatorUpdater::ConvertRemoteIdentity( const TInt aCallId )
+    {    
+    RMobileCall::TMobileCallRemoteIdentityStatus etelRemoteIdentity = iDataStore.RemoteIdentity( aCallId );    
+    MCallRemotePartyInfo::TRemoteIdentityStatus remoteIdentity;
+    
+    switch ( etelRemoteIdentity )
+            {
+            case RMobileCall::ERemoteIdentityUnknown:
+            case RMobileCall::ERemoteIdentityAvailableNoCliUnavailable:
+                {
+                remoteIdentity = MCallRemotePartyInfo::ERemoteIdentityUnknown;
+                }
+                break;
+            case RMobileCall::ERemoteIdentityAvailable:
+                {
+                remoteIdentity = MCallRemotePartyInfo::ERemoteIdentityAvailable;
+                }
+                break;
+            case RMobileCall::ERemoteIdentitySuppressed:
+            case RMobileCall::ERemoteIdentityAvailableNoCliRejectedByUser:
+                {
+                remoteIdentity = MCallRemotePartyInfo::ERemoteIdentityRejectedByUser;
+                }
+                break;
+            case RMobileCall::ERemoteIdentityAvailableNoCliInteractionWithOtherService:
+            case RMobileCall::ERemoteIdentityUnavailableNoCliInteractionWithOtherService:
+                {
+                remoteIdentity = MCallRemotePartyInfo::ERemoteIdentityNoCliInteractionWithOtherService;
+                }
+                break;
+            case RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone:
+            case RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone:
+                {
+                remoteIdentity = MCallRemotePartyInfo::ERemoteIdentityNoCliCoinOrPayphone;
+                }
+                break;
+            default:
+                {
+                TEFLOGSTRING( KTAERROR, "TPERemotePartyInfoMediatorUpdater::ConvertRemoteIdentity, UNKNOWN REMOTE IDENTITY!" );
+                remoteIdentity = MCallRemotePartyInfo::ERemoteIdentityUnknown;                
+                break;
+                }
+            }    
+    return remoteIdentity;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/tsrc/ut_penetworkhandler/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,178 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for PhoneUINetworkHandler.
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QVariant>
+#include <QKeyEvent>
+#include <hbapplication.h>
+#include <qsysteminfo.h>
+#include "cpeengineinfo.h"
+#include "penetworkhandler.h"
+
+
+//CONSTANTS
+
+
+#define PHONE_QT_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+class TestNetworkHandler : public QObject, public MPEPhoneModelInternal
+{
+    Q_OBJECT
+    
+public:
+    TestNetworkHandler ();
+    ~TestNetworkHandler ();
+
+// Functions from MPEPhoneModelInternal base class
+        
+    MPEDataStore* DataStore() {return iEngineInfo;};
+
+    MPEExternalDataHandler* DataStoreExt() {;}; 
+        
+    CPERemotePartyInfoMediator* MediatorCommunicationHandler() {return 0;};
+        
+    void HandleInternalMessage( const TInt aMessage ) {;};
+
+    void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage ) 
+        {
+        if ( MEngineMonitor::EPEMessageNetworkRegistrationStatusChange == aMessage ) 
+            {
+            m_networkStatusChanged = true;
+            }
+        ;};
+
+    void SendMessage( const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
+                          const TInt aCallId ) {;};
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase (); 
+    void init ();
+    void cleanup ();
+    
+private slots:
+    void testNetworkStatusChanged();
+
+
+
+private:
+    PeNetworkHandler *m_nwHandler; // class under test
+    CPEEngineInfo *iEngineInfo;
+    bool m_networkStatusChanged;
+
+};
+
+
+TestNetworkHandler::TestNetworkHandler()
+{    
+}
+
+TestNetworkHandler::~TestNetworkHandler()
+{
+}
+
+void TestNetworkHandler::initTestCase()
+{	
+}
+
+void TestNetworkHandler::cleanupTestCase()
+{
+}
+
+void TestNetworkHandler::init()
+{	
+    TRAP_IGNORE( iEngineInfo = CPEEngineInfo::NewL() );	
+    m_nwHandler = new PeNetworkHandler(*this);    
+}
+
+void TestNetworkHandler::cleanup()
+{
+    delete m_nwHandler;
+    delete iEngineInfo;
+}
+
+void TestNetworkHandler::testNetworkStatusChanged()
+{
+    m_networkStatusChanged = false;
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::UnknownMode,
+            QSystemNetworkInfo::UndefinedStatus);
+    QVERIFY( false == m_networkStatusChanged );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::CdmaMode,
+            QSystemNetworkInfo::UndefinedStatus);
+    QVERIFY( ENWStatusRegistrationUnknown == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    QVERIFY( true == m_networkStatusChanged );
+       
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::WcdmaMode,
+            QSystemNetworkInfo::NoNetworkAvailable);
+    QVERIFY( ENWStatusNotRegisteredNoService == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode,
+            QSystemNetworkInfo::EmergencyOnly);
+    QVERIFY( ENWStatusNotRegisteredEmergencyOnly == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode,
+            QSystemNetworkInfo::Searching);
+    QVERIFY( ENWStatusNotRegisteredSearching == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode,
+            QSystemNetworkInfo::Busy);
+    QVERIFY( ENWStatusRegisteredBusy == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode,
+            QSystemNetworkInfo::HomeNetwork);
+    QVERIFY( ENWStatusRegisteredOnHomeNetwork == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode,
+            QSystemNetworkInfo::Denied);
+    QVERIFY( ENWStatusRegistrationDenied == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode,
+            QSystemNetworkInfo::Roaming);
+    QVERIFY( ENWStatusRegisteredRoaming == 
+             iEngineInfo->NetworkRegistrationStatus() );
+    
+    m_nwHandler->networkStatusChanged(QSystemNetworkInfo::GsmMode,
+            (QSystemNetworkInfo::NetworkStatus)100);
+    QVERIFY( ENWStatusRegistrationUnknown == 
+             iEngineInfo->NetworkRegistrationStatus() );
+}
+
+
+PHONE_QT_TEST_MAIN(TestNetworkHandler)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phonemodel/tsrc/ut_penetworkhandler/ut_penetworkhandler.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+TEMPLATE = app
+TARGET = ut_penetworkhandler
+TARGET.CAPABILITY = ALL -TCB
+TARGET.UID3 = 0xEA9BEFAA
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+CONFIG += hb qtestlib
+
+symbian {
+
+    INCLUDEPATH += /epoc32/include/platform/mw \
+                   /epoc32/include/platform/app \
+                   /epoc32/include/mw \
+                   ../../../inc/ \
+                   ../../../../inc \
+                   ../../../../engineinfo/inc \
+                   ./
+
+    LIBS += -lQtSystemInfo
+    LIBS += -lengineinfo  
+}
+
+
+# Input
+HEADERS += ../../inc/penetworkhandler.h 
+
+SOURCES += ../../src/penetworkhandler.cpp \
+           ./unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/bwins/phoneservicesu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,14 @@
+EXPORTS
+	??_EPhoneServices@@UAE@I@Z @ 1 NONAME ; PhoneServices::~PhoneServices(unsigned int)
+	?tr@PhoneServices@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString PhoneServices::tr(char const *, char const *, int)
+	??1PhoneServices@@UAE@XZ @ 3 NONAME ; PhoneServices::~PhoneServices(void)
+	??0PhoneServices@@QAE@AAVMPECallControlIF@@AAVMPECallSettersIF@@AAVMPEKeySequenceRecognitionIF@@PAVQObject@@@Z @ 4 NONAME ; PhoneServices::PhoneServices(class MPECallControlIF &, class MPECallSettersIF &, class MPEKeySequenceRecognitionIF &, class QObject *)
+	?trUtf8@PhoneServices@@SA?AVQString@@PBD0H@Z @ 5 NONAME ; class QString PhoneServices::trUtf8(char const *, char const *, int)
+	?metaObject@PhoneServices@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * PhoneServices::metaObject(void) const
+	?trUtf8@PhoneServices@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString PhoneServices::trUtf8(char const *, char const *)
+	?qt_metacall@PhoneServices@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 8 NONAME ; int PhoneServices::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacast@PhoneServices@@UAEPAXPBD@Z @ 9 NONAME ; void * PhoneServices::qt_metacast(char const *)
+	?tr@PhoneServices@@SA?AVQString@@PBD0@Z @ 10 NONAME ; class QString PhoneServices::tr(char const *, char const *)
+	?getStaticMetaObject@PhoneServices@@SAABUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const & PhoneServices::getStaticMetaObject(void)
+	?staticMetaObject@PhoneServices@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const PhoneServices::staticMetaObject
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/eabi/phoneservicesu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,14 @@
+EXPORTS
+	_ZN13PhoneServices11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN13PhoneServices11qt_metacastEPKc @ 2 NONAME
+	_ZN13PhoneServices16staticMetaObjectE @ 3 NONAME DATA 16
+	_ZN13PhoneServices19getStaticMetaObjectEv @ 4 NONAME
+	_ZN13PhoneServicesC1ER16MPECallControlIFR16MPECallSettersIFR27MPEKeySequenceRecognitionIFP7QObject @ 5 NONAME
+	_ZN13PhoneServicesC2ER16MPECallControlIFR16MPECallSettersIFR27MPEKeySequenceRecognitionIFP7QObject @ 6 NONAME
+	_ZN13PhoneServicesD0Ev @ 7 NONAME
+	_ZN13PhoneServicesD1Ev @ 8 NONAME
+	_ZN13PhoneServicesD2Ev @ 9 NONAME
+	_ZNK13PhoneServices10metaObjectEv @ 10 NONAME
+	_ZTI13PhoneServices @ 11 NONAME
+	_ZTV13PhoneServices @ 12 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/inc/dialservice.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,155 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Dial API to be used through Qt Highway.
+*
+*/
+
+#ifndef DIALSERVICE_H
+#define DIALSERVICE_H
+
+#include <QObject>
+#include <QString>
+#include <xqserviceprovider.h>
+#include "mpecallcontrolif.h"
+#include "mpecallsettersif.h"
+
+class DialService : public XQServiceProvider
+{
+    Q_OBJECT
+public:
+    DialService(MPECallControlIF &call, MPECallSettersIF &parameters, QObject *parent = 0);
+    ~DialService();
+    
+public slots:
+    /*!
+        \fn dial(const QString& number)
+        
+        This method makes a cellular switched dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString)");
+        snd << "0501234567";        
+    */
+    int dial(const QString& number);
+    
+    /*!
+        \fn dial(const QString& number)
+        
+        This method makes a cellular switched dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString,int)");
+        snd << "0501234567" << 123456;        
+    */
+    int dial(const QString& number, int contactId);
+    
+    /*!
+        \fn dialVideo(const QString& number)
+        
+        This method makes a video call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString)");
+        snd << "0501234567";        
+    */
+    void dialVideo(const QString& number);
+
+    /*!
+        \fn dial(const QString& number)
+        
+        This method makes a video call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString,int)");
+        snd << "0501234567" << 123456;        
+    */
+    void dialVideo(const QString& number, int contactId);
+    
+    /*!
+        \fn dialVoip(const QString& address)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoip(QString)");
+        snd << "address@domain";        
+    */
+    void dialVoip(const QString& address);
+    
+    /*!
+        \fn dialVoip(const QString& address, int contactId)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoip(QString,int)");
+        snd << "address@domain" << 123456;        
+    */
+    void dialVoip(const QString& address, int contactId);
+    
+    /*!
+        \fn dialVoipService(const QString& address, int contactId)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Call is made by given service (id).
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoipService(QString,int)");
+        snd << "address@domain" << 123;        
+    */
+    void dialVoipService(const QString& address, int serviceId);
+    
+    /*!
+        \fn dialVoipService(const QString& address, int serviceId, int contactId)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Call is made by given service (id).
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.ICallDial","dialVoipService(QString,int,int)");
+        snd << "address@domain" << 123 << 12345;        
+    */
+    void dialVoipService(const QString& address, int serviceId, int contactId);
+    
+private:
+    /*!
+        \fn QString simplified(QString& number)
+        
+        Returns a string that has whitespaces, '(', ')', '-', '[', and ']' chars removed 
+    */
+    static QString simplified(const QString &number) Q_REQUIRED_RESULT;
+
+
+private:
+    MPECallControlIF &m_call;
+    MPECallSettersIF &m_parameters;    
+};
+
+#endif // DIALERSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/inc/dialservicedepricated.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,157 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Dial API to be used through Qt Highway.
+*               THIS IS DEPRICATED API - DO NOT USE!
+*               (use DialService instead)
+*
+*/
+
+#ifndef DIALSERVICEDEPRICATED_H
+#define DIALSERVICEDEPRICATED_H
+
+#include <QObject>
+#include <QString>
+#include <xqserviceprovider.h>
+#include "mpecallcontrolif.h"
+#include "mpecallsettersif.h"
+
+class DialServiceDepricated : public XQServiceProvider
+{
+    Q_OBJECT
+public:
+    DialServiceDepricated(MPECallControlIF &call, MPECallSettersIF &parameters, QObject *parent = 0);
+    ~DialServiceDepricated();
+    
+public slots:
+    /*!
+        \fn dial(const QString& number)
+        
+        This method makes a cellular switched dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dial(QString)");
+        snd << "0501234567";        
+    */
+    int dial(const QString& number);
+    
+    /*!
+        \fn dial(const QString& number)
+        
+        This method makes a cellular switched dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dial(QString,int)");
+        snd << "0501234567" << 123456;        
+    */
+    int dial(const QString& number, int contactId);
+    
+    /*!
+        \fn dialVideo(const QString& number)
+        
+        This method makes a video call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dial(QString)");
+        snd << "0501234567";        
+    */
+    void dialVideo(const QString& number);
+
+    /*!
+        \fn dial(const QString& number)
+        
+        This method makes a video call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dial(QString,int)");
+        snd << "0501234567" << 123456;        
+    */
+    void dialVideo(const QString& number, int contactId);
+    
+    /*!
+        \fn dialVoip(const QString& address)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dialVoip(QString)");
+        snd << "address@domain";        
+    */
+    void dialVoip(const QString& address);
+    
+    /*!
+        \fn dialVoip(const QString& address, int contactId)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dialVoip(QString,int)");
+        snd << "address@domain" << 123456;        
+    */
+    void dialVoip(const QString& address, int contactId);
+    
+    /*!
+        \fn dialVoipService(const QString& address, int contactId)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Call is made by given service (id).
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dialVoipService(QString,int)");
+        snd << "address@domain" << 123;        
+    */
+    void dialVoipService(const QString& address, int serviceId);
+    
+    /*!
+        \fn dialVoipService(const QString& address, int serviceId, int contactId)
+        
+        This method makes a voip call dial command to
+        Phone Application. It is intended to be used via Qt Highway.
+        Call is made by given service (id).
+        Caller's name is shown according to the given Phonebook contact
+        identifier.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","dialVoipService(QString,int,int)");
+        snd << "address@domain" << 123 << 12345;        
+    */
+    void dialVoipService(const QString& address, int serviceId, int contactId);
+    
+private:
+    /*!
+        \fn QString simplified(QString& number)
+        
+        Returns a string that has whitespaces, '(', ')', '-', '[', and ']' chars removed 
+    */
+    static QString simplified(const QString &number) Q_REQUIRED_RESULT;
+
+
+private:
+    MPECallControlIF &m_call;
+    MPECallSettersIF &m_parameters;    
+};
+
+#endif // DIALERSERVICEDEPRICATED_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/inc/dtmfservice.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+/*!
+* Copyright (c) 2009-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:  DTMF API to be used through Qt Highway.
+*
+*/
+
+#ifndef DTMFSERVICE_H
+#define DTMFSERVICE_H
+
+#include <QObject>
+#include <QString>
+#include <xqserviceprovider.h>
+#include "mpecallcontrolif.h"
+#include "mpecallsettersif.h"
+
+class DTMFService : public XQServiceProvider
+{
+    Q_OBJECT
+public:
+    DTMFService(
+        MPECallControlIF &call, 
+        MPECallSettersIF &parameters, 
+        QObject *parent = 0);
+    ~DTMFService();
+    
+public slots:
+    /*!
+        \fn playDTMFTone(const QChar& keyToPlay)
+        
+        This method plays DTMF tone matching given character.
+        If character doesn't match any supported DTMF tone
+        it is ignored.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.symbian.IDtmfPlay","playDTMFTone(QChar)");
+        snd << "5";
+    */
+    void playDTMFTone(const QChar& keyToPlay);
+
+    /*!
+        \fn stopDTMFPlay()
+        
+        This method stops playing DTMF tone if it is currently played.
+    */
+    void stopDTMFPlay();
+    
+    
+private:
+    MPECallControlIF &m_call;
+    MPECallSettersIF &m_parameters;    
+};
+
+#endif // DTMFSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/inc/dtmfservicedepricated.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,66 @@
+/*!
+* Copyright (c) 2009-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:  DTMF API to be used through Qt Highway.
+*               THIS IS DEPRICATED API - DO NOT USE!
+*               (use DTMFService instead)
+*
+*/
+
+#ifndef DTMFSERVICEDEPRICATED_H
+#define DTMFSERVICEDEPRICATED_H
+
+#include <QObject>
+#include <QString>
+#include <xqserviceprovider.h>
+#include "mpecallcontrolif.h"
+#include "mpecallsettersif.h"
+
+class DTMFServiceDepricated : public XQServiceProvider
+{
+    Q_OBJECT
+public:
+    DTMFServiceDepricated(
+        MPECallControlIF &call, 
+        MPECallSettersIF &parameters, 
+        QObject *parent = 0);
+    ~DTMFServiceDepricated();
+    
+public slots:
+    /*!
+        \fn playDTMFTone(const QChar& keyToPlay)
+        
+        This method plays DTMF tone matching given character.
+        If character doesn't match any supported DTMF tone
+        it is ignored.
+        
+        Usage example:
+        XQServiceRequest snd("com.nokia.services.telephony","playDTMFTone(QChar)");
+        snd << "5";
+    */
+    void playDTMFTone(const QChar& keyToPlay);
+
+    /*!
+        \fn stopDTMFPlay()
+        
+        This method stops playing DTMF tone if it is currently played.
+    */
+    void stopDTMFPlay();
+    
+    
+private:
+    MPECallControlIF &m_call;
+    MPECallSettersIF &m_parameters;    
+};
+
+#endif // DTMFSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/inc/keysequencerecognitionservice.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,69 @@
+/*!
+* 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:  Provides key sequence recognition and execution services.
+*
+*/
+
+#ifndef KEYSEQUENCERECOGNITIONSERVICE_H
+#define KEYSEQUENCERECOGNITIONSERVICE_H
+
+#include <QObject>
+#include <QString>
+#include <xqserviceprovider.h>
+
+class MPEKeySequenceRecognitionIF;
+
+class KeySequenceRecognitionService : public XQServiceProvider
+{
+    Q_OBJECT
+
+public:
+
+    KeySequenceRecognitionService(
+        MPEKeySequenceRecognitionIF &keySequenceRecognizer,
+        QObject *parent = 0);
+    
+    ~KeySequenceRecognitionService();
+    
+public slots:
+    
+    /*!
+        \fn executeKeySequence(const QString& keySequence)
+        
+        Client can use this method to execute key sequence recognition.
+        Key sequence may contain for example product codes etc. that
+        may cause lower layers to do any specific things.
+
+        If sequence isn't recognized this method doesn't do anything.
+        If sequence is recognized then task related to the code is executed.
+        \param  keySequence          Key sequence to execute.
+        \return True if key sequence was processed, false otherwise.
+        
+        Usage example:
+        XQServiceRequest request(
+            "com.nokia.symbian.IDtmfPlay",
+            "executeKeySequence(QString)",
+            true);
+        request << "*#0000#";
+        QVariant keySequenceProcessed;
+        bool requestOk = request.send(keySequenceProcessed);
+    */
+    bool executeKeySequence(const QString &keySequence);
+    
+private:
+    
+    MPEKeySequenceRecognitionIF &m_keySequenceRecognizer;
+};
+
+#endif // KEYSEQUENCERECOGNITIONSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/inc/keysequencerecognitionservicedepricated.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*!
+* 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:  Provides key sequence recognition and execution services.
+*               THIS IS DEPRICATED API - DO NOT USE!
+*               (use KeySequenceRecognitionService instead)
+*
+*/
+
+#ifndef KEYSEQUENCERECOGNITIONSERVICEDEPRICATED_H
+#define KEYSEQUENCERECOGNITIONSERVICEDEPRICATED_H
+
+#include <QObject>
+#include <QString>
+#include <xqserviceprovider.h>
+
+class MPEKeySequenceRecognitionIF;
+
+class KeySequenceRecognitionServiceDepricated : public XQServiceProvider
+{
+    Q_OBJECT
+
+public:
+
+    KeySequenceRecognitionServiceDepricated(
+        MPEKeySequenceRecognitionIF &keySequenceRecognizer,
+        QObject *parent = 0);
+    
+    ~KeySequenceRecognitionServiceDepricated();
+    
+public slots:
+    
+    /*!
+        \fn executeKeySequence(const QString& keySequence)
+        
+        Client can use this method to execute key sequence recognition.
+        Key sequence may contain for example product codes etc. that
+        may cause lower layers to do any specific things.
+
+        If sequence isn't recognized this method doesn't do anything.
+        If sequence is recognized then task related to the code is executed.
+        \param  keySequence          Key sequence to execute.
+        \return True if key sequence was processed, false otherwise.
+        
+        Usage example:
+        XQServiceRequest request(
+            "com.nokia.services.telephony",
+            "executeKeySequence(QString)",
+            true);
+        request << "*#0000#";
+        QVariant keySequenceProcessed;
+        bool requestOk = request.send(keySequenceProcessed);
+    */
+    bool executeKeySequence(const QString &keySequence);
+    
+private:
+    
+    MPEKeySequenceRecognitionIF &m_keySequenceRecognizer;
+};
+
+#endif // KEYSEQUENCERECOGNITIONSERVICEDEPRICATED_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/inc/phoneservices.h	Fri Jun 04 10:19:18 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:  Phone Services manages all Phone Engine's Qt Highway services.
+*
+*/
+
+#ifndef PHONESERVICES_H
+#define PHONESERVICES_H
+
+#include <QObject>
+#include "mpecallcontrolif.h"
+#include "mpecallsettersif.h"
+
+class DialService;
+class DTMFService;
+class MPEKeySequenceRecognitionIF;
+class KeySequenceRecognitionService;
+
+// Depricated APIs
+class DialServiceDepricated;
+class DTMFServiceDepricated;
+class KeySequenceRecognitionServiceDepricated;
+
+#ifdef BUILD_PHONESERVICES
+#define PHONESERVICES_EXPORT Q_DECL_EXPORT
+#else
+#define PHONESERVICES_EXPORT Q_DECL_IMPORT
+#endif
+
+class PHONESERVICES_EXPORT PhoneServices : public QObject
+{
+    Q_OBJECT
+public:
+    PhoneServices(
+        MPECallControlIF &call, 
+        MPECallSettersIF &parameters,
+        MPEKeySequenceRecognitionIF &keySequenceRecognition,
+        QObject *parent = 0);
+    ~PhoneServices();    
+    
+private:
+    QScopedPointer<DialService> dialService;
+    QScopedPointer<DTMFService> dtmfService;
+    QScopedPointer<KeySequenceRecognitionService> m_keySequenceRecognitionService;
+
+    // Depricated
+    QScopedPointer<DialServiceDepricated> dialServiceDepricated;
+    QScopedPointer<DTMFServiceDepricated> dtmfServiceDepricated;
+    QScopedPointer<KeySequenceRecognitionServiceDepricated> m_keySequenceRecognitionServiceDepricated;
+};
+
+#endif // PHONESERVICES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/phoneservices.pri	Fri Jun 04 10:19:18 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: 
+#
+
+SOURCES=\
+    ./src/phoneservices.cpp \
+    ./src/dialservice.cpp \
+    ./src/dtmfservice.cpp \
+    ./src/keysequencerecognitionservice.cpp \
+    ./src/dialservicedepricated.cpp \
+    ./src/dtmfservicedepricated.cpp \
+    ./src/keysequencerecognitionservicedepricated.cpp
+
+HEADERS=\
+    ./inc/phoneservices.h \
+    ./inc/dialservice.h \
+    ./inc/dtmfservice.h \
+    ./inc/keysequencerecognitionservice.h \
+    ./inc/dialservicedepricated.h \
+    ./inc/dtmfservicedepricated.h \
+    ./inc/keysequencerecognitionservicedepricated.h
+    
+PHONESERVICES_API_HEADERS=\
+		./inc/phoneservices.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/phoneservices.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = lib
+TARGET = phoneservices
+
+symbian {
+    TARGET.UID3 = 0x20029F88
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA =1
+    DEFINES += BUILD_PHONESERVICES
+    
+    INCLUDEPATH += ../../inc \
+                   ../phonemodel/inc
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+    servicesDefFiles = \
+        "$${LITERAL_HASH}ifdef WINSCW" \
+         "DEFFILE bwins/phoneservices.def" \
+         "$${LITERAL_HASH}else" \
+         "DEFFILE eabi/phoneservices.def" \
+         "$${LITERAL_HASH}endif"
+    
+    MMP_RULES += servicesDefFiles
+
+    LIBS += -lxqservice \
+            -lxqserviceutil
+}
+
+# Input
+#include(\ext\mw\qthighway\xqservicebase.pri)
+include(./phoneservices.pri)
+
+headers.sources = $$PHONESERVICES_API_HEADERS
+headers.path = |../../inc
+# This is for new exporting system coming in garden
+for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$headers.path/$$basename(header)"       
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/src/dialservice.cpp	Fri Jun 04 10:19:18 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:  dial service
+*
+*/
+
+#include <xqserviceutil.h>
+#include <e32base.h>
+#include <qregexp.h>
+#include "dialservice.h"
+#include "qtphonelog.h"
+
+
+DialService::DialService(MPECallControlIF &call, MPECallSettersIF &parameters, QObject* parent) : 
+    XQServiceProvider(QLatin1String("com.nokia.symbian.ICallDial"), parent), m_call (call), m_parameters (parameters)
+{
+    publishAll();
+}
+
+DialService::~DialService()
+{
+}
+
+int DialService::dial(const QString& number)
+{
+    PHONE_DEBUG2("DialService::dial number:", number);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr(reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeCSVoice);
+    return m_call.HandleDialServiceCall ();
+}
+
+int DialService::dial(const QString& number, int contactId)
+{
+    PHONE_DEBUG4("DialService::dial number:", number, "contactId:", contactId);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeCSVoice);
+    m_parameters.SetContactId2 (contactId);
+    return m_call.HandleDialServiceCall (); 
+}
+
+void DialService::dialVideo(const QString& number)
+{
+    PHONE_DEBUG2("DialService::dialVideo number:", number);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr(reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeVideo);
+    m_call.HandleDialServiceCall ();
+}
+
+void DialService::dialVideo(const QString& number, int contactId)
+{
+    PHONE_DEBUG4("DialService::dialVideo number:", number, "contactId:", contactId);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeVideo);
+    m_parameters.SetContactId2 (contactId);
+    m_call.HandleDialServiceCall ();    
+}
+
+void DialService::dialVoip(const QString& address)
+{
+    PHONE_DEBUG2("DialService::dialVoip number:", address);
+    TPtrC16 numberPtr(reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_call.HandleDialServiceCall();    
+}
+
+void DialService::dialVoip(const QString& address, int contactId)
+{
+    PHONE_DEBUG4("DialService::dialVoip number:", address, "contactId:", contactId);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_parameters.SetContactId2(contactId);
+    m_call.HandleDialServiceCall();    
+}
+
+void DialService::dialVoipService(const QString& address, int serviceId)
+{
+    PHONE_DEBUG4("DialService::dialVoipService number:", address, "serviceId:", serviceId);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_parameters.SetServiceIdCommand(serviceId);
+    m_call.HandleDialServiceCall();    
+}
+
+void DialService::dialVoipService(
+        const QString& address, int serviceId, int contactId)
+{
+    PHONE_DEBUG2("DialService::dialVoipService number:", address);
+    PHONE_DEBUG2("DialService::dialVoipService serviceId:", serviceId);
+    PHONE_DEBUG2("DialService::dialVoipService contactId:", contactId);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_parameters.SetServiceIdCommand(serviceId);
+    m_parameters.SetContactId2(contactId);
+    m_call.HandleDialServiceCall();    
+}
+
+QString DialService::simplified(const QString &number)
+{
+    QString simplifiedNumber = number;
+    QRegExp rx(QString("[\\s,.\\[\\]\\(\\)\\-]"));
+    simplifiedNumber.remove(rx);
+    return simplifiedNumber;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/src/dialservicedepricated.cpp	Fri Jun 04 10:19:18 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:  dial service
+*
+*/
+
+#include <xqserviceutil.h>
+#include <e32base.h>
+#include <qregexp.h>
+#include "dialservicedepricated.h"
+#include "qtphonelog.h"
+
+
+DialServiceDepricated::DialServiceDepricated(MPECallControlIF &call, MPECallSettersIF &parameters, QObject* parent) : 
+    XQServiceProvider(QLatin1String("com.nokia.services.telephony"), parent), m_call (call), m_parameters (parameters)
+{
+    publishAll();
+}
+
+DialServiceDepricated::~DialServiceDepricated()
+{
+}
+
+int DialServiceDepricated::dial(const QString& number)
+{
+    PHONE_DEBUG2("DialServiceDepricated::dial number:", number);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr(reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeCSVoice);
+    return m_call.HandleDialServiceCall ();
+}
+
+int DialServiceDepricated::dial(const QString& number, int contactId)
+{
+    PHONE_DEBUG4("DialServiceDepricated::dial number:", number, "contactId:", contactId);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeCSVoice);
+    m_parameters.SetContactId2 (contactId);
+    return m_call.HandleDialServiceCall (); 
+}
+
+void DialServiceDepricated::dialVideo(const QString& number)
+{
+    PHONE_DEBUG2("DialServiceDepricated::dialVideo number:", number);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr(reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeVideo);
+    m_call.HandleDialServiceCall ();
+}
+
+void DialServiceDepricated::dialVideo(const QString& number, int contactId)
+{
+    PHONE_DEBUG4("DialServiceDepricated::dialVideo number:", number, "contactId:", contactId);
+    QString simplifiedNumber = simplified(number);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(simplifiedNumber.utf16()));
+    m_parameters.SetPhoneNumber (numberPtr);
+    m_parameters.SetCallTypeCommand (EPECallTypeVideo);
+    m_parameters.SetContactId2 (contactId);
+    m_call.HandleDialServiceCall ();    
+}
+
+void DialServiceDepricated::dialVoip(const QString& address)
+{
+    PHONE_DEBUG2("DialServiceDepricated::dialVoip number:", address);
+    TPtrC16 numberPtr(reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_call.HandleDialServiceCall();    
+}
+
+void DialServiceDepricated::dialVoip(const QString& address, int contactId)
+{
+    PHONE_DEBUG4("DialServiceDepricated::dialVoip number:", address, "contactId:", contactId);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_parameters.SetContactId2(contactId);
+    m_call.HandleDialServiceCall();    
+}
+
+void DialServiceDepricated::dialVoipService(const QString& address, int serviceId)
+{
+    PHONE_DEBUG4("DialServiceDepricated::dialVoipService number:", address, "serviceId:", serviceId);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_parameters.SetServiceIdCommand(serviceId);
+    m_call.HandleDialServiceCall();    
+}
+
+void DialServiceDepricated::dialVoipService(
+        const QString& address, int serviceId, int contactId)
+{
+    PHONE_DEBUG2("DialServiceDepricated::dialVoipService number:", address);
+    PHONE_DEBUG2("DialServiceDepricated::dialVoipService serviceId:", serviceId);
+    PHONE_DEBUG2("DialServiceDepricated::dialVoipService contactId:", contactId);
+    TPtrC16 numberPtr (reinterpret_cast<const TUint16*>(address.utf16 ()));
+    m_parameters.SetPhoneNumber(numberPtr);
+    m_parameters.SetCallTypeCommand(EPECallTypeVoIP);
+    m_parameters.SetServiceIdCommand(serviceId);
+    m_parameters.SetContactId2(contactId);
+    m_call.HandleDialServiceCall();    
+}
+
+QString DialServiceDepricated::simplified(const QString &number)
+{
+    QString simplifiedNumber = number;
+    QRegExp rx(QString("[\\s,.\\[\\]\\(\\)\\-]"));
+    simplifiedNumber.remove(rx);
+    return simplifiedNumber;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/src/dtmfservice.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*!
+* Copyright (c) 2009-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:  DTMF API to be used through Qt Highway.
+*
+*/
+
+#include <xqserviceutil.h>
+#include <e32base.h>
+#include "dtmfservice.h"
+#include "qtphonelog.h"
+
+DTMFService::DTMFService(
+    MPECallControlIF &call, 
+    MPECallSettersIF &parameters, 
+    QObject* parent) 
+    : 
+    XQServiceProvider(
+        QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), 
+    m_call(call), 
+    m_parameters(parameters)
+{
+    publishAll();
+}
+
+DTMFService::~DTMFService()
+{
+}
+
+void DTMFService::playDTMFTone(const QChar& keyToPlay)
+{
+    PHONE_DEBUG2("DTMFService::playDTMFTone keyToPlay:", keyToPlay);
+    m_parameters.SetKeyCode(keyToPlay.unicode());
+    TRAP_IGNORE( m_call.HandlePlayDTMFL() );
+}
+
+void DTMFService::stopDTMFPlay()
+{
+    PHONE_DEBUG("DTMFService::stopDTMFPlay");
+    m_call.HandleEndDTMF(); 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/src/dtmfservicedepricated.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*!
+* Copyright (c) 2009-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:  DTMF API to be used through Qt Highway.
+*
+*/
+
+#include <xqserviceutil.h>
+#include <e32base.h>
+#include "dtmfservicedepricated.h"
+#include "qtphonelog.h"
+
+DTMFServiceDepricated::DTMFServiceDepricated(
+    MPECallControlIF &call, 
+    MPECallSettersIF &parameters, 
+    QObject* parent) 
+    : 
+    XQServiceProvider(
+        QLatin1String("com.nokia.services.telephony.dtmf"), parent), 
+    m_call(call), 
+    m_parameters(parameters)
+{
+    publishAll();
+}
+
+DTMFServiceDepricated::~DTMFServiceDepricated()
+{
+}
+
+void DTMFServiceDepricated::playDTMFTone(const QChar& keyToPlay)
+{
+    PHONE_DEBUG2("DTMFServiceDepricated::playDTMFTone keyToPlay:", keyToPlay);
+    m_parameters.SetKeyCode(keyToPlay.unicode());
+    TRAP_IGNORE( m_call.HandlePlayDTMFL() );
+}
+
+void DTMFServiceDepricated::stopDTMFPlay()
+{
+    PHONE_DEBUG("DTMFServiceDepricated::stopDTMFPlay");
+    m_call.HandleEndDTMF(); 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/src/keysequencerecognitionservice.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,60 @@
+/*!
+* 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:  Provides key sequence recognition and execution services.
+*
+*/
+
+#include <QDebug>
+#include <xqserviceutil.h>
+#include <e32base.h>
+#include "keysequencerecognitionservice.h"
+#include "mpekeysequencerecognitionif.h"
+
+/*!
+  KeySequenceRecognitionService::KeySequenceRecognitionService.
+ */
+KeySequenceRecognitionService::KeySequenceRecognitionService(
+    MPEKeySequenceRecognitionIF &keySequenceRecognizer,
+    QObject* parent) 
+    : 
+    XQServiceProvider(
+        QLatin1String("com.nokia.symbian.IDtmfPlay"), parent),
+        m_keySequenceRecognizer(keySequenceRecognizer)
+{
+    publishAll();
+}
+
+
+/*!
+  KeySequenceRecognitionService::~KeySequenceRecognitionService.
+ */
+KeySequenceRecognitionService::~KeySequenceRecognitionService()
+{
+}
+
+
+/*!
+  KeySequenceRecognitionService::executeKeySequence.
+ */
+bool KeySequenceRecognitionService::executeKeySequence(
+    const QString &keySequence)
+{
+    TPtrC16 keySequencePtr(
+        reinterpret_cast<const TUint16*>(keySequence.utf16()));
+    bool sequenceProcessed = false;
+    TRAPD(leaveCode, sequenceProcessed = static_cast<bool>(
+        m_keySequenceRecognizer.ExecuteKeySequenceL(keySequencePtr)));
+    sequenceProcessed = (KErrNone == leaveCode) ? sequenceProcessed : false;
+    return sequenceProcessed;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/src/keysequencerecognitionservicedepricated.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,60 @@
+/*!
+* 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:  Provides key sequence recognition and execution services.
+*
+*/
+
+#include <QDebug>
+#include <xqserviceutil.h>
+#include <e32base.h>
+#include "keysequencerecognitionservicedepricated.h"
+#include "mpekeysequencerecognitionif.h"
+
+/*!
+  KeySequenceRecognitionServiceDepricated::KeySequenceRecognitionServiceDepricated.
+ */
+KeySequenceRecognitionServiceDepricated::KeySequenceRecognitionServiceDepricated(
+    MPEKeySequenceRecognitionIF &keySequenceRecognizer,
+    QObject* parent) 
+    : 
+    XQServiceProvider(
+        QLatin1String("com.nokia.services.telephony"), parent),
+        m_keySequenceRecognizer(keySequenceRecognizer)
+{
+    publishAll();
+}
+
+
+/*!
+  KeySequenceRecognitionServiceDepricated::~KeySequenceRecognitionServiceDepricated.
+ */
+KeySequenceRecognitionServiceDepricated::~KeySequenceRecognitionServiceDepricated()
+{
+}
+
+
+/*!
+  KeySequenceRecognitionServiceDepricated::executeKeySequence.
+ */
+bool KeySequenceRecognitionServiceDepricated::executeKeySequence(
+    const QString &keySequence)
+{
+    TPtrC16 keySequencePtr(
+        reinterpret_cast<const TUint16*>(keySequence.utf16()));
+    bool sequenceProcessed = false;
+    TRAPD(leaveCode, sequenceProcessed = static_cast<bool>(
+        m_keySequenceRecognizer.ExecuteKeySequenceL(keySequencePtr)));
+    sequenceProcessed = (KErrNone == leaveCode) ? sequenceProcessed : false;
+    return sequenceProcessed;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/src/phoneservices.cpp	Fri Jun 04 10:19:18 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:  Phone Services manages all Phone Engine's Qt Highway services.
+*
+*/
+
+#include "phoneservices.h"
+#include "dialservice.h"
+#include "dtmfservice.h"
+#include "mpekeysequencerecognitionif.h"
+#include "keysequencerecognitionservice.h"
+#include "qtphonelog.h"
+
+// Depricated APIs
+#include "dialservicedepricated.h"
+#include "dtmfservicedepricated.h"
+#include "keysequencerecognitionservicedepricated.h"
+
+PhoneServices::PhoneServices(
+    MPECallControlIF &call, 
+    MPECallSettersIF &parameters, 
+    MPEKeySequenceRecognitionIF &keySequenceRecognition,
+    QObject* parent) 
+    : 
+    QObject(parent),
+    dialService(0),
+    dtmfService(0),
+    m_keySequenceRecognitionService(0)
+    // Depricated
+    , dialServiceDepricated(0)
+    , dtmfServiceDepricated(0)
+    , m_keySequenceRecognitionServiceDepricated(0)
+{
+    PHONE_DEBUG("PhoneServices::PhoneServices");
+    dialService.reset(new DialService(call, parameters));
+    dtmfService.reset(new DTMFService(call, parameters));
+    m_keySequenceRecognitionService.reset( 
+        new KeySequenceRecognitionService(keySequenceRecognition));
+
+    // Depricated
+    dialServiceDepricated.reset(new DialServiceDepricated(call, parameters));
+    dtmfServiceDepricated.reset(new DTMFServiceDepricated(call, parameters));
+    m_keySequenceRecognitionServiceDepricated.reset( 
+        new KeySequenceRecognitionServiceDepricated(keySequenceRecognition));
+}
+
+PhoneServices::~PhoneServices()
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/runtests.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,33 @@
+@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
+
+del \epoc32\winscw\c\private\EEE39B3F\ut_phoneservices.log
+\epoc32\release\winscw\udeb\ut_phoneservices.exe -o ut_phoneservices.log
+type \epoc32\winscw\c\private\EEE39B3F\ut_phoneservices.log
+
+del \epoc32\winscw\c\private\E31F4ECE\ut_dialservice.log
+\epoc32\release\winscw\udeb\ut_dialservice.exe -o ut_dialservice.log
+type \epoc32\winscw\c\private\E31F4ECE\ut_dialservice.log
+
+del \epoc32\winscw\c\private\EEE39B2F\ut_dtmfservice.log
+\epoc32\release\winscw\udeb\ut_dtmfservice.exe -o ut_dtmfservice.log
+type \epoc32\winscw\c\private\EEE39B2F\ut_dtmfservice.log
+
+del \epoc32\winscw\c\private\E31F4ECF\ut_keysequencerecognitionservice.log
+\epoc32\release\winscw\udeb\ut_keysequencerecognitionservice.exe -o ut_keysequencerecognitionservice.log
+type \epoc32\winscw\c\private\E31F4ECF\ut_keysequencerecognitionservice.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/unit.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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
+SUBDIRS += ut_phoneservices
+SUBDIRS += ut_dialservice
+SUBDIRS += ut_dtmfservice
+SUBDIRS += ut_keysequencerecognitionservice
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_dialservice/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,298 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for DialService.
+*
+*/
+
+#include <QtTest/QtTest>
+
+//#include <hbglobal_p.h>
+#include "dialservice.h"
+
+class TestDialService : public QObject, public MPECallControlIF, public MPECallSettersIF
+{
+    Q_OBJECT
+public:
+    TestDialService();
+    virtual ~TestDialService();    
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup ();
+    
+public:
+    void SetKeyCode( const TChar& aKeyCode );
+    void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber );
+    void SetCallTypeCommand( const TPECallType& aCallType );
+    TInt HandleDialServiceCall( const TBool aClientCall = EFalse );
+    void HandlePlayDTMFL();
+    TInt HandleEndDTMF();
+    void SetContactId2( const TInt aContactId );
+    void SetServiceIdCommand( TUint32 aServiceId );
+    
+private slots:
+    void testDial ();
+    void testDial2 ();
+    void testDial3();
+    void testDialVideo ();
+    void testDialVideo2 ();
+    void testDialVoip();
+    void testDialVoip2();
+    void testDialVoipService();
+    void testDialVoipService2();
+//    void testExecuteKeySequence ();
+//    void testPlayDTMFTone ();
+//    void testStopDTMFPlay ();
+
+private:
+    DialService *m_DialService; // class under test
+    bool m_setPhoneNumberCalled;
+    bool m_setCallTypeCommandCalled;
+    bool m_handleDialCallCalled;
+    TPEPhoneNumber m_phoneNumber;
+    TPECallType m_callType;
+    bool m_clientCall;
+    int m_contactId;
+    bool m_setContactIdCalled;
+    bool m_handleEndDTMFCalled;
+    bool m_handlePlayDTMFLCalled;
+    bool m_setKeyCodeCalled;
+    bool m_setServiceIdCalled;
+    int m_serviceId;
+    ushort keyValue;
+};
+
+TestDialService::TestDialService ()
+{
+}
+
+TestDialService::~TestDialService ()
+{
+}
+
+void TestDialService::initTestCase ()
+{
+}
+
+void TestDialService::cleanupTestCase ()
+{
+}
+
+void TestDialService::init ()
+{
+    m_setPhoneNumberCalled = false;
+    m_setCallTypeCommandCalled = false;
+    m_handleDialCallCalled = false;
+    m_clientCall = false;
+    m_setContactIdCalled = false;
+    m_contactId = -1;
+    m_handleEndDTMFCalled = false;
+    m_handlePlayDTMFLCalled = false;
+    m_setKeyCodeCalled = false;
+    keyValue = -1;
+    m_DialService = new DialService (*this, *this, this);
+}
+
+void TestDialService::cleanup ()
+{
+    delete m_DialService;
+}
+
+void TestDialService::SetKeyCode( const TChar& aKeyCode )
+{
+    m_setKeyCodeCalled = true;
+    keyValue = aKeyCode;
+}
+
+void TestDialService::SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber )
+{
+    m_setPhoneNumberCalled = true;
+    m_phoneNumber = aPhoneNumber;	
+}
+
+void TestDialService::SetCallTypeCommand( const TPECallType& aCallType )
+{
+    m_setCallTypeCommandCalled = true;
+    m_callType = aCallType;	
+}
+
+void TestDialService::HandlePlayDTMFL()
+{
+    m_handlePlayDTMFLCalled = true;
+}
+
+TInt TestDialService::HandleEndDTMF()
+{
+    m_handleEndDTMFCalled = true;
+    return 0;
+}
+
+void TestDialService::SetContactId2( const TInt aContactId )
+{
+    m_setContactIdCalled = true;
+    m_contactId = aContactId;	
+}
+
+void TestDialService::SetServiceIdCommand( TUint32 aServiceId )
+{
+    m_setServiceIdCalled = true;
+    m_serviceId = aServiceId;   
+}
+
+TInt TestDialService::HandleDialServiceCall( const TBool aClientCall )
+{
+    m_handleDialCallCalled = true;
+    m_clientCall = aClientCall;
+    return KErrNone;
+}
+
+void TestDialService::testDial()
+{
+    m_DialService->dial(QString("0501234567"));
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("0501234567"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeCSVoice);
+    QVERIFY (m_handleDialCallCalled == true);
+    QVERIFY (m_clientCall == false);
+}
+
+void TestDialService::testDial2()
+{
+    m_DialService->dial(QString("0501234567"), 3127);
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("0501234567"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeCSVoice);
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QVERIFY (m_setContactIdCalled == true);
+    QCOMPARE (m_contactId, 3127);
+    QVERIFY (m_clientCall == false);
+}
+
+void TestDialService::testDial3()
+{
+    m_DialService->dial(QString("[+358] (0) 50-1234 5.6,7"), 3127);
+    QString _number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(_number, QString("+3580501234567"));
+}
+
+void TestDialService::testDialVideo()
+{
+    m_DialService->dialVideo(QString("0501234567"));
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("0501234567"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeVideo);
+    QVERIFY (m_handleDialCallCalled == true);
+    QVERIFY (m_clientCall == false);
+}
+
+void TestDialService::testDialVideo2()
+{
+    m_DialService->dialVideo(QString("+358501234567"), 12345);
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("+358501234567"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeVideo);
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QVERIFY (m_setContactIdCalled == true);
+    QCOMPARE (m_contactId, 12345);
+    QVERIFY (m_clientCall == false);
+}
+
+void TestDialService::testDialVoip()
+{
+    m_DialService->dialVoip(QString("address@domain"));
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("address@domain"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeVoIP);
+}
+
+void TestDialService::testDialVoip2()
+{
+    m_DialService->dialVoip(QString("address@domain"), 123);
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("address@domain"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeVoIP);
+    QVERIFY (m_setContactIdCalled == true);
+    QCOMPARE (m_contactId, 123);
+    QVERIFY (m_clientCall == false);
+}
+
+void TestDialService::testDialVoipService()
+{
+    m_DialService->dialVoipService(QString("address@domain"), 123);
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("address@domain"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeVoIP);
+    QVERIFY (m_setServiceIdCalled == true);
+    QCOMPARE (m_serviceId, 123);
+    QVERIFY (m_clientCall == false);
+}
+
+void TestDialService::testDialVoipService2()
+{
+    m_DialService->dialVoipService(QString("address@domain"), 123, 12345);
+    QString number((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE(number, QString("address@domain"));
+    QVERIFY (m_setCallTypeCommandCalled == true);
+    QCOMPARE((int)m_callType, (int)EPECallTypeVoIP);
+    QVERIFY (m_setServiceIdCalled == true);
+    QCOMPARE (m_serviceId, 123);
+    QVERIFY (m_setContactIdCalled == true);
+    QCOMPARE (m_contactId, 12345);
+    QVERIFY (m_clientCall == false);
+}
+
+/*
+void TestDialService::testExecuteKeySequence()
+{
+    m_DialService->executeKeySequence(QString("*#0000#"));
+    QString keySequence((QChar*)m_phoneNumber.Ptr(), m_phoneNumber.Length());
+    QVERIFY (m_setPhoneNumberCalled == true);
+    QCOMPARE (keySequence, QString("*#0000#"));
+}
+
+void TestDialService::testPlayDTMFTone()
+{
+    QChar six('6');
+    m_DialService->playDTMFTone(six);
+    QVERIFY (m_setKeyCodeCalled == true);
+    QCOMPARE (keyValue, six.unicode());
+    QVERIFY (m_handlePlayDTMFLCalled == true);
+}
+
+void TestDialService::testStopDTMFPlay()
+{
+    m_DialService->stopDTMFPlay();
+    QVERIFY (m_handleEndDTMFCalled == true);
+}
+*/
+QTEST_MAIN(TestDialService)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_dialservice/ut_dialservice.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xE31F4ECE
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform \
+                   \epoc32\include\platform\mw \
+                   \epoc32\include\mw \
+                   ../../../phoneuiutils/inc \
+                   ../../../phoneuicontrol/inc \
+                   ../../../phoneuiqtviewadapter/src \
+                   ../../../../inc
+
+    LIBS += -lxqservice \
+            -lxqserviceutil \
+            -lphoneuicontrol
+
+    TARGET.CAPABILITY = ALL -TCB
+}
+
+# Input
+HEADERS += ../../inc/dialservice.h
+SOURCES += unit_tests.cpp
+SOURCES += ../../src/dialservice.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_dtmfservice/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,176 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for DTMFService.
+*
+*/
+
+#include <QtTest/QtTest>
+
+//#include <hbglobal_p.h>
+#include "dtmfservice.h"
+
+class TestDTMFService : public QObject, public MPECallControlIF, public MPECallSettersIF
+{
+    Q_OBJECT
+public:
+    TestDTMFService();
+    virtual ~TestDTMFService();    
+
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup ();
+    
+public:
+    void SetKeyCode( const TChar& aKeyCode );
+    void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber );
+    void SetCallTypeCommand( const TPECallType& aCallType );
+    TInt HandleDialServiceCall( const TBool aClientCall = EFalse );
+    void HandlePlayDTMFL();
+    TInt HandleEndDTMF();
+    void SetContactId2( const TInt aContactId );
+    void SetServiceIdCommand( TUint32 aServiceId );
+    
+private slots:
+    void testPlayDTMFTone ();
+    void testStopDTMFPlay ();
+
+private:
+    DTMFService *m_dtmfService; // class under test
+    bool m_setPhoneNumberCalled;
+    bool m_setCallTypeCommandCalled;
+    bool m_handleDialCallCalled;
+    TPEPhoneNumber m_phoneNumber;
+    TPECallType m_callType;
+    bool m_clientCall;
+    int m_contactId;
+    bool m_setContactIdCalled;
+    bool m_handleEndDTMFCalled;
+    bool m_handlePlayDTMFLCalled;
+    bool m_setKeyCodeCalled;
+    bool m_handlePlayDtmfLeave;
+    ushort keyValue;
+};
+
+TestDTMFService::TestDTMFService ()
+{
+}
+
+TestDTMFService::~TestDTMFService ()
+{
+}
+
+void TestDTMFService::initTestCase ()
+{
+}
+
+void TestDTMFService::cleanupTestCase ()
+{
+}
+
+void TestDTMFService::init ()
+{
+    m_setPhoneNumberCalled = false;
+    m_setCallTypeCommandCalled = false;
+    m_handleDialCallCalled = false;
+    m_clientCall = false;
+    m_setContactIdCalled = false;
+    m_contactId = -1;
+    m_handleEndDTMFCalled = false;
+    m_handlePlayDTMFLCalled = false;
+    m_setKeyCodeCalled = false;
+    m_handlePlayDtmfLeave = false;
+    keyValue = -1;
+    m_dtmfService = new DTMFService (*this, *this, this);
+}
+
+void TestDTMFService::cleanup ()
+{
+    delete m_dtmfService;
+}
+
+void TestDTMFService::SetKeyCode( const TChar& aKeyCode )
+{
+    m_setKeyCodeCalled = true;
+    keyValue = aKeyCode;
+}
+
+void TestDTMFService::SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber )
+{
+    m_setPhoneNumberCalled = true;
+    m_phoneNumber = aPhoneNumber;	
+}
+
+void TestDTMFService::SetCallTypeCommand( const TPECallType& aCallType )
+{
+    m_setCallTypeCommandCalled = true;
+    m_callType = aCallType;	
+}
+
+void TestDTMFService::HandlePlayDTMFL()
+{
+    m_handlePlayDTMFLCalled = true;
+    
+    if (m_handlePlayDtmfLeave)
+        User::Leave(KErrNotFound);
+}
+
+TInt TestDTMFService::HandleEndDTMF()
+{
+    m_handleEndDTMFCalled = true;
+    return 0;
+}
+
+void TestDTMFService::SetContactId2( const TInt aContactId )
+{
+    m_setContactIdCalled = true;
+    m_contactId = aContactId;	
+}
+
+void TestDTMFService::SetServiceIdCommand( TUint32 aServiceId )
+{
+    Q_UNUSED(aServiceId)
+}
+
+TInt TestDTMFService::HandleDialServiceCall( const TBool aClientCall )
+{
+    m_handleDialCallCalled = true;
+    m_clientCall = aClientCall;
+    return KErrNone;
+}
+
+void TestDTMFService::testPlayDTMFTone()
+{
+    QChar six('6');
+    m_dtmfService->playDTMFTone(six);
+    QVERIFY (m_setKeyCodeCalled == true);
+    QCOMPARE (keyValue, six.unicode());
+    QVERIFY (m_handlePlayDTMFLCalled == true);
+    
+    m_handlePlayDtmfLeave = true;
+    
+    TRAP_IGNORE(m_dtmfService->playDTMFTone(six));
+    
+    m_handlePlayDtmfLeave = false;
+}
+
+void TestDTMFService::testStopDTMFPlay()
+{
+    m_dtmfService->stopDTMFPlay();
+    QVERIFY (m_handleEndDTMFCalled == true);
+}
+
+QTEST_MAIN(TestDTMFService)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_dtmfservice/ut_dtmfservice.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEEE39B2F
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += hb
+CONFIG += qtestlib
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform \
+                   \epoc32\include\platform\mw \
+                   \epoc32\include\mw \
+                   ../../../phoneuiutils/inc \
+                   ../../../phoneuicontrol/inc \
+                   ../../../phoneuiqtviewadapter/src \
+                   ../../../../inc
+
+    LIBS += -lxqservice \
+            -lxqserviceutil \
+            -lphoneuicontrol
+
+    TARGET.CAPABILITY = ALL -TCB
+}
+
+# Input
+HEADERS += ../../inc/dtmfservice.h
+SOURCES += unit_tests.cpp
+SOURCES += ../../src/dtmfservice.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,113 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for DialService.
+*
+*/
+
+#include <QtTest/QtTest>
+
+#include "mpekeysequencerecognitionif.h"
+#include "keysequencerecognitionservice.h"
+
+class UT_KeySequenceRecognitionService 
+    : 
+    public QObject, public MPEKeySequenceRecognitionIF
+{
+    Q_OBJECT
+    
+public:
+    UT_KeySequenceRecognitionService();
+    virtual ~UT_KeySequenceRecognitionService();
+
+public:
+    TBool ExecuteKeySequenceL(const TDesC16& aSequence);
+    
+private slots:
+    void init();
+    void cleanup();
+    void t_executeKeySequence();
+    void t_notRecognizedKeySequence();
+    void t_leaveDuringExecuteKeySequence();
+
+private:
+    KeySequenceRecognitionService *m_RecognitionService;
+    TBool m_keySequenceExecutionResult;
+    TPtrC16 m_keySequencePtr;
+    int m_leaveSimulationCode;
+};
+
+UT_KeySequenceRecognitionService::UT_KeySequenceRecognitionService()
+    :
+    m_RecognitionService(NULL),
+    m_keySequenceExecutionResult(ETrue), 
+    m_leaveSimulationCode(KErrNone)
+{
+}
+
+UT_KeySequenceRecognitionService::~UT_KeySequenceRecognitionService()
+{
+    delete m_RecognitionService;
+}
+
+TBool UT_KeySequenceRecognitionService::ExecuteKeySequenceL(
+    const TDesC16& aSequence)
+{
+    Q_UNUSED(aSequence)
+    User::LeaveIfError(m_leaveSimulationCode);
+    
+    m_keySequencePtr.Set(aSequence.Ptr());
+    return m_keySequenceExecutionResult;
+}
+
+void UT_KeySequenceRecognitionService::init()
+{
+    m_RecognitionService = new KeySequenceRecognitionService(*this);
+    m_keySequenceExecutionResult = ETrue;
+    m_keySequencePtr.Set(NULL, 0);
+    m_leaveSimulationCode = KErrNone;
+}
+
+void UT_KeySequenceRecognitionService::cleanup()
+{
+    delete m_RecognitionService;
+    m_RecognitionService = NULL;
+}
+
+void UT_KeySequenceRecognitionService::t_executeKeySequence()
+{
+    QString sequence("*#06#");
+    bool result = m_RecognitionService->executeKeySequence(sequence);
+    QCOMPARE(result, true);
+    QVERIFY(
+        m_keySequencePtr == TPtrC16(reinterpret_cast<const TUint16*>(sequence.utf16())));
+}
+
+void UT_KeySequenceRecognitionService::t_notRecognizedKeySequence()
+{
+    m_keySequenceExecutionResult = EFalse;
+    QString sequence("*#abc#");
+    bool result = m_RecognitionService->executeKeySequence(sequence);
+    QCOMPARE(result, false);
+}
+
+void UT_KeySequenceRecognitionService::t_leaveDuringExecuteKeySequence()
+{
+    m_leaveSimulationCode = KErrArgument;
+    QString sequence("abc");
+    bool result = m_RecognitionService->executeKeySequence(sequence);
+    QCOMPARE(result, false);
+}
+
+QTEST_MAIN(UT_KeySequenceRecognitionService)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_keysequencerecognitionservice/ut_keysequencerecognitionservice.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,43 @@
+#
+# 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 = 
+TARGET.UID3 = 0xE31F4ECF
+DEPENDPATH += .
+INCLUDEPATH += .
+CONFIG += qtestlib
+
+QT -= gui
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform \
+                   \epoc32\include\platform\mw \
+                   \epoc32\include\mw \
+                   ../../../../inc
+
+    LIBS += -lxqservice \
+            -lxqserviceutil
+
+    TARGET.CAPABILITY = ALL -TCB
+}
+
+# Input
+HEADERS += ../../inc/keysequencerecognitionservice.h
+SOURCES += ../../src/keysequencerecognitionservice.cpp
+SOURCES += unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_phoneservices/unit_tests.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,301 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Unit tests for Phone Services.
+*
+*/
+
+#include <QtTest/QtTest>
+
+//#include <hbglobal_p.h>
+#include "phoneservices.h"
+#include "dialservice.h"
+#include "dtmfservice.h"
+#include "keysequencerecognitionservice.h"
+#include "mpekeysequencerecognitionif.h"
+
+bool m_dialServiceConstructed;
+bool m_dtmfServiceConstructed;
+bool g_keySequenceServiceConstructed;
+MPECallControlIF* m_dialServiceCallPointer;
+MPECallSettersIF* m_dialServiceParameterPointer;
+MPEKeySequenceRecognitionIF* g_keySequenceRecognizerParameterPointer;
+MPECallControlIF* m_dtmfServiceCallPointer;
+MPECallSettersIF* m_dtmfServiceParameterPointer;
+
+class TestPhoneServices 
+    : 
+    public QObject,
+    public MPECallControlIF,
+    public MPECallSettersIF,
+    public MPEKeySequenceRecognitionIF
+{
+    Q_OBJECT
+public:
+    TestPhoneServices();
+    virtual ~TestPhoneServices();    
+
+public:
+    TBool ExecuteKeySequenceL(const TDesC16& aSequence);
+    
+public slots:
+    void initTestCase ();
+    void cleanupTestCase ();
+    void init ();
+    void cleanup ();
+    
+public:
+    void SetKeyCode( const TChar& aKeyCode );
+    void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber );
+    void SetCallTypeCommand( const TPECallType& aCallType );
+    TInt HandleDialServiceCall( const TBool aClientCall = EFalse );
+    void HandlePlayDTMFL();
+    TInt HandleEndDTMF();
+    void SetContactId2( const TInt aContactId );
+    void SetServiceIdCommand( TUint32 aServiceId );
+    
+private slots:
+    void testPhoneServiceStartup();
+
+private:
+    PhoneServices *m_phoneServices; // class under test
+    bool m_setPhoneNumberCalled;
+    bool m_setCallTypeCommandCalled;
+    bool m_handleDialCallCalled;
+    TPEPhoneNumber m_phoneNumber;
+    TPECallType m_callType;
+    bool m_clientCall;
+    int m_contactId;
+    bool m_setContactIdCalled;
+    bool m_handleEndDTMFCalled;
+    bool m_handlePlayDTMFLCalled;
+    bool m_setKeyCodeCalled;
+    ushort keyValue;
+};
+
+DialService::DialService(MPECallControlIF &call, MPECallSettersIF &parameters, QObject* parent) : 
+    XQServiceProvider(QLatin1String("com.nokia.symbian.ICallDial"), parent), m_call (call), m_parameters (parameters)
+{
+    m_dialServiceConstructed = true;
+    m_dialServiceCallPointer = &call;
+    m_dialServiceParameterPointer = &parameters;
+}
+
+DialService::~DialService()
+{
+}
+
+int DialService::dial(const QString& number)
+{
+    Q_UNUSED(number);
+    return 0;
+}
+
+int DialService::dial(const QString& number, int contactId)
+{
+    Q_UNUSED(number);
+    Q_UNUSED (contactId);
+    return 0;
+}
+
+void DialService::dialVideo(const QString& number)
+{
+    Q_UNUSED(number);
+}
+
+void DialService::dialVideo(const QString& number, int contactId)
+{
+    Q_UNUSED(number);
+    Q_UNUSED(contactId);
+}
+
+void DialService::dialVoip(const QString& address)
+{
+Q_UNUSED(address);
+}
+
+void DialService::dialVoip(const QString& address, int contactId)
+{
+Q_UNUSED(address);
+Q_UNUSED(contactId);
+}
+
+void DialService::dialVoipService(const QString& address, int serviceId)
+{
+Q_UNUSED(address);
+Q_UNUSED(serviceId);
+}
+
+void DialService::dialVoipService(
+        const QString& address, int serviceId, int contactId)
+{
+Q_UNUSED(address);
+Q_UNUSED(serviceId);
+Q_UNUSED(contactId);
+}
+
+DTMFService::DTMFService(MPECallControlIF &call, MPECallSettersIF &parameters, QObject* parent) : 
+    XQServiceProvider(QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), m_call (call), m_parameters (parameters)
+{
+    m_dtmfServiceConstructed = true;
+    m_dtmfServiceCallPointer = &call;
+    m_dtmfServiceParameterPointer = &parameters;
+}
+
+DTMFService::~DTMFService()
+{
+}
+
+void DTMFService::playDTMFTone(const QChar& keyToPlay)
+{
+    Q_UNUSED(keyToPlay);
+}
+
+void DTMFService::stopDTMFPlay()
+{
+}
+
+KeySequenceRecognitionService::KeySequenceRecognitionService(
+    MPEKeySequenceRecognitionIF &keySequenceRecognizer,
+    QObject* parent) 
+    : 
+    XQServiceProvider(
+        QLatin1String("com.nokia.symbian.IDtmfPlay"), parent),
+        m_keySequenceRecognizer(keySequenceRecognizer)
+{
+    g_keySequenceServiceConstructed = true;
+    g_keySequenceRecognizerParameterPointer = &keySequenceRecognizer;
+}
+
+bool KeySequenceRecognitionService::executeKeySequence(
+    const QString &keySequence)
+{
+    Q_UNUSED(keySequence);
+    return true;
+}
+
+KeySequenceRecognitionService::~KeySequenceRecognitionService()
+{
+}
+
+TestPhoneServices::TestPhoneServices ()
+{
+}
+
+TestPhoneServices::~TestPhoneServices ()
+{
+}
+
+void TestPhoneServices::initTestCase ()
+{
+}
+
+void TestPhoneServices::cleanupTestCase ()
+{
+}
+
+void TestPhoneServices::init ()
+{
+    m_setPhoneNumberCalled = false;
+    m_setCallTypeCommandCalled = false;
+    m_handleDialCallCalled = false;
+    m_clientCall = false;
+    m_setContactIdCalled = false;
+    m_contactId = -1;
+    m_handleEndDTMFCalled = false;
+    m_handlePlayDTMFLCalled = false;
+    m_setKeyCodeCalled = false;
+    keyValue = -1;
+    m_dialServiceConstructed = false;
+    m_dtmfServiceConstructed = false;
+    g_keySequenceServiceConstructed = false;
+    
+    m_phoneServices = new PhoneServices (*this, *this, *this, this);
+
+    QVERIFY(m_dialServiceConstructed == true);
+    QVERIFY(m_dialServiceCallPointer == this);
+    QVERIFY(m_dialServiceParameterPointer == this);
+    
+    QVERIFY(m_dtmfServiceConstructed == true);
+    QVERIFY(m_dtmfServiceCallPointer == this);
+    QVERIFY(m_dtmfServiceParameterPointer == this);
+    
+    QVERIFY(g_keySequenceServiceConstructed == true);
+    QVERIFY(g_keySequenceRecognizerParameterPointer == this);
+}
+
+void TestPhoneServices::cleanup ()
+{
+    delete m_phoneServices;
+}
+
+TBool TestPhoneServices::ExecuteKeySequenceL(const TDesC16& aSequence)
+{
+    Q_UNUSED(aSequence)
+    return ETrue;
+}
+
+void TestPhoneServices::SetKeyCode( const TChar& aKeyCode )
+{
+    m_setKeyCodeCalled = true;
+    keyValue = aKeyCode;
+}
+
+void TestPhoneServices::SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber )
+{
+    m_setPhoneNumberCalled = true;
+    m_phoneNumber = aPhoneNumber;	
+}
+
+void TestPhoneServices::SetCallTypeCommand( const TPECallType& aCallType )
+{
+    m_setCallTypeCommandCalled = true;
+    m_callType = aCallType;	
+}
+
+void TestPhoneServices::HandlePlayDTMFL()
+{
+    m_handlePlayDTMFLCalled = true;
+}
+
+TInt TestPhoneServices::HandleEndDTMF()
+{
+    m_handleEndDTMFCalled = true;
+    return 0;
+}
+
+void TestPhoneServices::SetContactId2( const TInt aContactId )
+{
+    m_setContactIdCalled = true;
+    m_contactId = aContactId;	
+}
+
+void TestPhoneServices::SetServiceIdCommand( TUint32 aServiceId )
+{
+    Q_UNUSED(aServiceId)
+}
+
+TInt TestPhoneServices::HandleDialServiceCall( const TBool aClientCall )
+{
+    m_handleDialCallCalled = true;
+    m_clientCall = aClientCall;
+    return KErrNone;
+}
+
+void TestPhoneServices::testPhoneServiceStartup()
+{
+
+}
+
+QTEST_MAIN(TestPhoneServices)
+#include "unit_tests.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/phoneservices/tsrc/ut_phoneservices/ut_phoneservices.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+TARGET.UID3 = 0xEEE39B3F
+DEPENDPATH += .
+INCLUDEPATH += .
+#CONFIG += hb
+CONFIG += qtestlib
+QT -= gui
+
+symbian {
+
+    INCLUDEPATH += \epoc32\include\platform \
+                   \epoc32\include\platform\mw \
+                   \epoc32\include\mw \
+                   ../../../phoneuiutils/inc \
+                   ../../../phoneuicontrol/inc \
+                   ../../../phoneuiqtviewadapter/src \
+                   ../../../../inc
+
+    LIBS += -lxqservice \
+            -lxqserviceutil
+
+    TARGET.CAPABILITY = ALL -TCB
+    DEFINES += BUILD_PHONESERVICES
+}
+
+# Input
+HEADERS += ../../inc/phoneservices.h
+HEADERS += ../../inc/dialservice.h
+HEADERS += ../../inc/dtmfservice.h
+HEADERS += ../../inc/keysequencerecognitionservice.h
+HEADERS += ../../inc/dialservicedepricated.h
+HEADERS += ../../inc/dtmfservicedepricated.h
+HEADERS += ../../inc/keysequencerecognitionservicedepricated.h
+SOURCES += ../../src/phoneservices.cpp
+SOURCES += ../../src/dialservicedepricated.cpp
+SOURCES += ../../src/dtmfservicedepricated.cpp
+SOURCES += ../../src/keysequencerecognitionservicedepricated.cpp
+SOURCES += unit_tests.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/bwins/peservicehandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,5 @@
+EXPORTS
+	??1CPEServiceHandling@@UAE@XZ @ 1 NONAME ; CPEServiceHandling::~CPEServiceHandling(void)
+	?NewL@CPEServiceHandling@@SAPAV1@AAVMPEPhoneModelInternal@@@Z @ 2 NONAME ; class CPEServiceHandling * CPEServiceHandling::NewL(class MPEPhoneModelInternal &)
+	?NewLC@CPEServiceHandling@@SAPAV1@AAVMPEPhoneModelInternal@@@Z @ 3 NONAME ; class CPEServiceHandling * CPEServiceHandling::NewLC(class MPEPhoneModelInternal &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/data/servicehandling_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,32 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: For packing servicehandling stub.
+;
+; servicehandling_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"servicehandling"},(0x200194FD),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\peservicehandling.dll"
\ No newline at end of file
Binary file phoneengine/servicehandling/data/servicehandling_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/eabi/peservicehandlingu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,9 @@
+EXPORTS
+	_ZN18CPEServiceHandling4NewLER21MPEPhoneModelInternal @ 1 NONAME
+	_ZN18CPEServiceHandling5NewLCER21MPEPhoneModelInternal @ 2 NONAME
+	_ZN18CPEServiceHandlingD0Ev @ 3 NONAME
+	_ZN18CPEServiceHandlingD1Ev @ 4 NONAME
+	_ZN18CPEServiceHandlingD2Ev @ 5 NONAME
+	_ZThn4_N18CPEServiceHandlingD0Ev @ 6 NONAME
+	_ZThn4_N18CPEServiceHandlingD1Ev @ 7 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build file for service handling.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/cpeservicehandling.h            |../../inc/cpeservicehandling.h
+../inc/mpeservicehandling.h            |../../inc/mpeservicehandling.h
+
+// SIS stubs
+../data/servicehandling_stub.sis       /epoc32/data/z/system/install/servicehandling_stub.sis
+
+PRJ_MMPFILES
+peservicehandling.mmp
+
+
+PRJ_TESTMMPFILES
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/group/peservicehandling.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification file for Service Handling dll
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET                  peservicehandling.dll
+TARGETTYPE              DLL
+UID                     0x1000008d 0x200194FD
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  cpeservicehandling.cpp
+
+USERINCLUDE             ../inc
+
+APP_LAYER_SYSTEMINCLUDE 
+
+SYSTEMINCLUDE   ../../inc       // PhoneEngine private headers
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+LIBRARY                 euser.lib
+// <-- QT PHONE START -->
+//LIBRARY                 cch.lib   
+// <-- QT PHONE END -->
+LIBRARY                 flogger.lib     // for logging
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/inc/cpeservicehandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Provides service enabling implementation.
+*
+*/
+
+
+#ifndef C_PESERVICEHANDLING_H
+#define C_PESERVICEHANDLING_H
+
+#include <e32base.h>
+#include "mpeservicehandling.h"
+
+class  MPEPhoneModelInternal;
+
+/**
+ *  CPEServiceHandling implements the intefaces MPEServiceHandling and 
+ *  thus provides the service enabling imlementation for Phone Engine.
+ *  
+ *  @lib peservicehandling.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CPEServiceHandling ): public CBase,
+                                         public MPEServiceHandling
+    {
+
+    public: // Constructors and destructor
+
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CPEServiceHandling* NewL( MPEPhoneModelInternal& aModel );
+
+        /**
+         * Two-phased constructor.
+         */
+        IMPORT_C static CPEServiceHandling* NewLC( MPEPhoneModelInternal& aModel );
+
+        /**
+         * Destructors.
+         */
+        IMPORT_C virtual ~CPEServiceHandling();
+
+    public: // from MPEServiceHandling
+    
+        /**
+         * From MPEServiceHandling.
+         * Enables service defined by the given identifier.
+         * This function does the service enabling and service status error checking.
+         * If service is enabled successfully, send message 
+         * (EPEMessageServiceEnabled) to PhoneEngine. 
+         * 
+         * @since   S60 5.0
+         * @param   aServiceId      Identifier of the service.
+         */                                     
+        void EnableServiceL( TInt aServiceId );
+       
+        /**
+         * From MPEServiceHandling.
+         * Cancel current service.
+         */ 
+        void CancelServiceEnabling() const;
+        
+        /**
+         * From MPEServiceHandling.
+         * Disable service.
+         */ 
+        void DisableService() const;
+    
+    private: // Constructors
+
+        /**
+         * C++ default constructor.
+         */
+        CPEServiceHandling( MPEPhoneModelInternal& aModel );
+        
+        /**
+         * By default Symbian 2nd phase constructor is private.
+         */
+        void ConstructL();
+               
+    private: // data
+        
+        /**
+         * PhoneModel.
+         * Not own.
+         */
+        MPEPhoneModelInternal& iModel;
+        
+        /**
+         * Current service identifier.
+         */
+        TInt iCurrentServiceId;
+    };
+
+#endif // C_PESERVICEHANDLING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/inc/mpeservicehandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declares interface for service enabling. 
+*
+*/
+
+
+
+#ifndef MPESERVICEHANDLING_H
+#define MPESERVICEHANDLING_H
+
+//INCLUDES
+
+// CLASS DECLARATION
+
+/**
+ *  Declares interface for service enabling.
+ *  
+ *  This interface offers the service enabling and service status error 
+ *  checking services for Phone Engine. VoIP service needs to be enabled 
+ *  before it's possible to make a VoIP call.
+ *
+ *  @lib peservicehandling.lib
+ */
+class MPEServiceHandling
+    {
+    public:
+
+        /**
+         * Destructor.
+         */
+        virtual ~MPEServiceHandling( ) { };
+        
+        /**
+         * Enables service defined by the given identifier.
+         * This function does the service enabling and service status error checking.
+         * If service is enabled successfully, send message 
+         * (EPEMessageServiceEnabled) to PhoneEngine. 
+         * 
+         * @param   aServiceId      Identifier of the service.
+         */                                     
+        virtual void EnableServiceL( TInt aServiceId ) = 0;
+        
+        /**
+         * Cancel current service enabling, if service connecting state.
+         */ 
+        virtual void CancelServiceEnabling() const = 0;
+        
+        /**
+         * Disable service.
+         */ 
+        virtual void DisableService() const = 0;
+        
+    };
+
+#endif // MPESERVICEHANDLING_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/servicehandling/src/cpeservicehandling.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CPEServiceHandling class
+*
+*/
+
+
+#include <mpephonemodelinternal.h>
+#include <mpedatastore.h>
+#include <pevirtualengine.h>
+#include <e32debug.h>
+
+#include "talogger.h"
+#include "cpeservicehandling.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CPEServiceHandling::CPEServiceHandling( MPEPhoneModelInternal& aModel )
+    : iModel( aModel )
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEServiceHandling::CPEServiceHandling" );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+void CPEServiceHandling::ConstructL()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEServiceHandling::ConstructL" );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPEServiceHandling* CPEServiceHandling::NewL( MPEPhoneModelInternal& aModel )
+    {
+    CPEServiceHandling* self = CPEServiceHandling::NewLC(aModel);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPEServiceHandling* CPEServiceHandling::NewLC( MPEPhoneModelInternal& aModel )
+    {
+    CPEServiceHandling* self = new( ELeave ) CPEServiceHandling( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CPEServiceHandling::~CPEServiceHandling()
+    {
+    TEFLOGSTRING( KTAOBJECT, "PE CPEServiceHandling::~CPEServiceHandling" );
+    }
+
+// ---------------------------------------------------------------------------
+// CPEServiceHandling::EnableService
+// ---------------------------------------------------------------------------
+//
+void CPEServiceHandling::EnableServiceL( TInt /*aServiceId*/ )
+    {
+    TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::EnableServiceL" );
+    User::LeaveIfError( 0 );
+    iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabled );
+    }
+    
+// ---------------------------------------------------------------------------
+// CPEServiceHandling::CancelServiceEnabling
+// ---------------------------------------------------------------------------
+//
+void CPEServiceHandling::CancelServiceEnabling() const
+    {
+    TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::CancelServiceEnabling" );
+    }
+        
+// -----------------------------------------------------------------------------
+// CPEServiceHandling::DisableService
+// -----------------------------------------------------------------------------
+//
+void CPEServiceHandling::DisableService() const
+    {
+    TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::DisableService" );
+    } 
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/data/102828e3.rss	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 1028 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 definitions for CS Plugin
+*
+*/
+
+
+#include "ecom/registryinfo.rh"
+
+// -----------------------------------------------------------------------------
+//   
+// CS Plugin ecom resource file.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // csplugin.dll UID
+    dll_uid = 0x102828E3;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // CCP interface UID
+            interface_uid = 0x10282588;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    // CS Plug-in implementation UID
+                    implementation_uid = 0x102828E5;
+                    version_no = 1;
+                    display_name = "CS Plug-in";
+                    default_data = "";
+                    // Note : opaque_data MUST have @ least a single byte of data
+                    // in this instance it is an empty string.
+                    opaque_data = " ";
+                    }
+                // Place additional interface implementations here
+                };
+            }
+        // Place additional interfaces here
+        };
+    }
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/data/csplugin_stub.pkg	Fri Jun 04 10:19:18 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: For packing csplugin stub.
+;
+; csplugin_stub.pkg
+
+; Languages
+&EN
+
+; Header
+#{"csplugin"},(0x102828E3),1,0,0,TYPE=SA
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Target
+
+""-"z:\sys\bin\csplugin.dll"
+""-"z:\resource\plugins\csplugin.rsc" 
\ No newline at end of file
Binary file phoneplugins/csplugin/data/csplugin_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for project CS Call Plugin
+*
+*/
+
+#include <platform_paths.hrh>
+
+// specifies the platforms this component needs to be built 
+PRJ_PLATFORMS
+DEFAULT
+
+
+// Specify the source file followed by its destination here
+PRJ_EXPORTS
+../data/csplugin_stub.sis       /epoc32/data/z/system/install/csplugin_stub.sis
+
+// IBY files
+#if defined(CORE_MW_LAYER_IBY_EXPORT_PATH)
+../rom/csplugin.iby             CORE_MW_LAYER_IBY_EXPORT_PATH(csplugin.iby)
+#endif
+
+// Specify the .mmp files required for building the important component
+// releasables.
+PRJ_MMPFILES
+csplugin.mmp
+
+
+//PRJ_TESTMMPFILES
+//../internal/test/group/mt_cconvergedcallprovider.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/group/csplugin.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for project CS Plugin
+*
+*/
+
+
+#include <data_caging_paths.hrh>    
+#include <platform_paths.hrh>
+
+TARGET                  csplugin.dll
+TARGETTYPE              PLUGIN
+
+// 271067363    0x102828E3     CS Call Plugin     ECom DLL UID
+// 271067364    0x102828E4     CS Call Plugin     ECom Interface UID 
+// 271067365    0x102828E5     CS Call Plugin     ECom Implementation UID 
+
+// ECOM Dll recognition UID followed by the unique UID for this dll
+UID                     0x10009D8D 0x102828E3
+
+CAPABILITY              CAP_ECOM_PLUGIN NetworkControl NetworkServices ReadDeviceData MultimediaDD
+VENDORID                VID_DEFAULT
+
+#ifndef WINSCW 
+EpocAllowDllData
+#endif
+
+
+SOURCEPATH              ../src
+SOURCE                  csprovider.cpp
+SOURCE                  cspproxy.cpp
+SOURCE                  cspcall.cpp
+SOURCE                  cspvoicecall.cpp
+SOURCE                  rcsplinecontainer.cpp
+SOURCE                  cspetelcalleventmonitor.cpp
+SOURCE                  cspetelcallstatusmonitor.cpp
+SOURCE                  cspcallinfomonitor.cpp
+SOURCE                  cspetelincomingcallmonitor.cpp
+SOURCE                  cspetelcallrequester.cpp
+SOURCE                  cspetelcallcapsmonitor.cpp
+SOURCE                  cspetelconferencecallrequester.cpp
+SOURCE                  cspdtmfprovider.cpp
+SOURCE                  cspeteldtmfmonitor.cpp
+SOURCE                  cspeteldtmfstopmonitor.cpp
+SOURCE                  cspconferencecall.cpp
+SOURCE                  cspetelconferencestatusmonitor.cpp
+SOURCE                  cspetelconferenceeventmonitor.cpp
+SOURCE                  cspetelconferencecapsmonitor.cpp
+SOURCE                  csptransferprovider.cpp
+SOURCE                  cspservicesettingshandler.cpp
+SOURCE                  cspvideocall.cpp
+SOURCE                  cspetelvideocallcapsmonitor.cpp
+SOURCE                  cspforwardprovider.cpp
+SOURCE                  cspvideocallconnectionhandler.cpp
+SOURCE                  cspcalladdedhandler.cpp
+SOURCE                  cspcallarray.cpp
+SOURCE                  csppanic.cpp
+SOURCE                  cspaudiohandler.cpp
+SOURCE                  csppubsublistener.cpp
+SOURCE                  cspetelcallwaitingrequester.cpp
+SOURCE                  cspsupplementaryservicesmonitor.cpp
+SOURCE                  cspcipheringstatusmonitor.cpp
+SOURCE                  cspsssettingshandler.cpp
+SOURCE                  cspuuimessagesender.cpp
+SOURCE                  cspuuimonitor.cpp
+SOURCE                  tcspskypeidparser.cpp
+SOURCE                  csptimer.cpp
+SOURCE                  cspcallcommandhandler.cpp
+SOURCE                  cspremotealertingtonelistener.cpp
+SOURCE                  cspetellinestatusmonitor.cpp
+SOURCE                  cspclientvideocall.cpp
+SOURCE                  cspclientvoicecall.cpp
+SOURCE					tmshandler.cpp
+
+// user include paths
+USERINCLUDE             ../inc
+
+// APP_LAYER_SYSTEMINCLUDE is needed for 
+// telmicmutestatuspskeys.h telincallvolcntrlcrkeys.h
+// MW_LAYER_SYSTEMINCLUDE would be preferred
+APP_LAYER_SYSTEMINCLUDE 
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+
+MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_GLIB_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/stdapis/stlport
+
+
+SOURCEPATH              ../data
+START RESOURCE          102828e3.rss
+TARGET                  csplugin.rsc
+END
+
+LIBRARY                 bafl.lib 
+LIBRARY                 euser.lib
+LIBRARY                 ecom.lib
+LIBRARY                 etelmm.lib
+LIBRARY                 etel.lib
+LIBRARY                 customapi.lib
+LIBRARY                 esock.lib
+LIBRARY                 serviceprovidersettings.lib // Reading service id and related
+LIBRARY                 featmgr.lib
+LIBRARY                 centralrepository.lib 
+LIBRARY                 sssettings.lib
+LIBRARY                 telephonyaudiorouting.lib callprovider.lib cce.lib
+
+LIBRARY                 tmsfactory.lib
+LIBRARY                 tmsapi.lib
+LIBRARY                 libglib.lib
+
+DEBUGLIBRARY            flogger.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/group/csplugin_UID_.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: UID for csplugin
+*
+*/
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x10000079,0x10009d8d,0x102828e3,EPriorityForeground,0x000ffffeu,0x00000000u,0x102828e3,0x101fb657,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspaudiohandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2007-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:  Declarations for class CSPAudioHandler
+ *
+ */
+
+#ifndef CSPAUDIOHANDLER_H
+#define CSPAUDIOHANDLER_H
+
+#include <e32base.h>
+
+class TmsHandler;
+/**
+ * Handles call adding from calls not done by the plugin.
+ *
+ */
+class CSPAudioHandler : public CBase
+    {
+public:
+    //Constructors and descructor
+
+    /**
+     * Two-phased constructing for the monitor.
+     *
+     * @param aObserver the observer for getting notification
+     * @param aLine the line to monitor
+     * @param aLineId line identifier
+     */
+    static CSPAudioHandler* NewL();
+
+    /**
+     * C++ default destructor.
+     */
+    virtual ~CSPAudioHandler();
+
+    /**
+     * Start audio streams.
+     */
+    void Start();
+
+    /**
+     * Stop audio streams.
+     */
+    void Stop();
+
+protected:
+    // From CActive
+    /**
+     * From CActive
+     * RunL
+     */
+    void RunL();
+
+    /**
+     * From CActive
+     * Catches errors if RunL leaves
+     * @param aError error code
+     * @return error code
+     */
+    TInt RunError(TInt aError);
+
+    /**
+     * From CActive
+     * Cancels the monitor
+     */
+    void DoCancel();
+
+private:
+    /**
+     * C++ default constructor
+     * @param aObserver the observer for status change (incoming call)
+     * @param aLine the line associated with the call
+     * @param aLineId line identifier
+     */
+    CSPAudioHandler();
+
+    /**
+     * Constructs the monitor in the second phase.
+     */
+    void ConstructL();
+
+private:
+    // data
+
+
+    /**
+     * Audio streams handler.
+     */
+    TmsHandler* iTmsHandler;
+
+    /**
+     * Call count
+     */
+    TInt iCallCount;
+    };
+
+#endif // CSPAUDIOHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspcall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,779 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CSPCall for CS Call Plug-in
+*
+*/
+
+
+
+#ifndef CSPCALL_H
+#define CSPCALL_H
+
+#include <mccpcscall.h>
+#include <mccpcallobserver.h>
+#include <mccptransferobserver.h>
+#include <mccpforwardobserver.h>
+#include <etel.h>
+#include <etelmm.h>
+#include <cccecallparameters.h>
+
+#include "cspconsts.h"
+#include "cspetelcallrequester.h" // For the requester and TRequestType
+#include "mcspcallobserver.h"
+#include "mcspcallerrorobserver.h"
+#include "mcspuusmessageobserver.h"
+#include "mcspcallcommandhandling.h"
+
+
+class MCCPForwardProvider;
+class CSPForwardProvider;
+class CSPTransferProvider;
+class RMobileCall;
+class CSPEtelCallStatusMonitor;
+class CSPEtelCallEventMonitor;
+class CSPCallInfoMonitor;
+class CSPEtelCallCapsMonitor;
+class CSPTransferProvider;
+class CSPEtelCallCapsMonitor;
+class CSPAudioHandler;
+class MCSPCommonInfo;
+class CSPUUIMonitor;
+class CSPUUIMessageSender;
+
+
+/**
+* Call class for CS Call Plug-in. Implements the API defined by CCP in classes
+* MCCPCall and MCCPCSCall
+*
+*  @lib csplugin.dll
+*/
+class CSPCall : public CBase,
+                public MCCPCSCall,
+                public MCSPCallObserver,
+                public MCSPCallErrorObserver,
+                public MCSPUUSMessageObserver,
+                public MCCPCallCommandHandling
+    {
+    public:
+        /*
+        * C++ default destructor
+        */
+        virtual ~CSPCall( );
+       
+        /** 
+        * ETel call name accessor.
+        * @return system wide error code
+        */
+        void CallName( TName& aCallName );
+        
+        /**
+        * Sets the audio handler for the call.
+        * @param aHandler audio handler
+        */
+        void SetAudioHandler( CSPAudioHandler* aHandler );
+        
+        /**
+         * Security setting change notification.
+         * @param aValue new value
+         */
+        void SecuritySettingChanged( TInt aValue );
+        
+        /**
+         * Remote alerting tone status changed notification.
+         * @param aNewStatus New remote alerting tone status.
+         */
+        void RemoteAlertingToneStatusChanged(
+            RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus );
+
+        /**
+         * Set iDontReportTerm flag value to ETrue.
+         */
+        void DontReportTerminationError();
+        
+// from base class MCSPCallObserver
+
+        /**
+        * Updates the call event for observers.
+        * @param aEvent the event to be notified
+        */
+        virtual void NotifyForwardEventOccurred( 
+                        MCCPForwardObserver::TCCPForwardEvent aEvent );
+
+        /**
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state (ETel) of the call 
+        */
+        virtual void NotifyCallStateChangedETel( 
+            RMobileCall::TMobileCallStatus aState );
+
+        /**
+        * Updates the call event for observers.
+        * @param aEvent the event to be notified
+        */
+        virtual void NotifyCallEventOccurred( 
+            MCCPCallObserver::TCCPCallEvent aEvent );
+
+        /**
+        * Updates the transfer event for observers.
+        * @param aEvent the event to be notified
+        */
+        virtual void NotifyTransferCallEventOccurred( 
+                        MCCPTransferObserver::TCCPTransferEvent aEvent );
+        
+        /**
+        * Notifies changed call capabilities.
+        * @param aCapsFlags new capability flags
+        */
+
+        virtual void CallCapsChanged( const TUint32 aCapsFlags );
+        
+// from base class MCSPCallErrorObserver        
+    
+        /**
+        * From MCSPCallErrorObserver
+        * Dial request failed notification.
+        * @param aErrorCode request failing error code
+        */
+        void DialRequestFailed( TInt aErrorCode );
+
+        /**
+        * From MCSPCallErrorObserver
+        * Emergency dial request failed notification.
+        * @param aErrorCode request failing error code
+        */
+        void EmergencyDialRequestFailed( TInt aErrorCode );
+        
+        /**
+        * From MCSPCallErrorObserver
+        * Notifies about error situation for CCE.
+        */
+        virtual void NotifyErrorOccurred( TCCPError aError );
+
+// from base class MCSPUUSMessageObserver
+        
+        /**
+        * From MCSPUUSMessageObserver
+        * UUS message received notification. 
+        */
+        void UUSMessageReceived( TDesC& aMessage );        
+        
+// from base class MCCPCSCall
+
+        /**
+        * From MCCPCSCall
+        * Returns call information
+        * @param aCallInfo TMobileCallInfoV3
+        * @return KErrNone if succesfull
+        *         otherwise another system wide error code
+        */
+        virtual TInt GetMobileCallInfo( TDes8& aCallInfo ) const;
+
+        /**
+        * From MCCPCSCall
+        * Gets the calls data call capabilities
+        * @param aCaps TMobileCallDataCapsV1
+        * @return KErrNone if the function member was successful, 
+        *        KErrNotSupported if call doesn't support circuit switched data
+        *        KErrNotFound if this call is not a data call
+        */
+        virtual TInt GetMobileDataCallCaps( TDes8& aCaps ) const;
+
+// from base class MCCPCall
+        
+        /**
+        * From MCCPCall
+        * Answers to an incoming call.
+        * @return system wide error code
+        */
+        virtual TInt Answer();
+
+        /**
+        * From MCCPCall
+        * Rejects an incoming call.
+        * @return system wide error code
+        */
+        virtual TInt Reject();
+
+        /**
+        * From MCCPCall
+        * Reguests plug-in to queue the call.     
+        * @return system wide error code    
+        */
+        virtual TInt Queue();
+
+        /**
+        * From MCCPCall
+        * Starts dialing to remote party
+        * @return system wide error code
+        */
+        virtual TInt Dial();
+        
+        /**
+        * From MCCPCSCall
+        * Starts dialing to recipient
+        * @param aCallParams Call parameters used 
+        *   by the TSY (TCallParamsPckg)
+        * @return system wide error code
+        */
+        TInt Dial( const TDesC8& aCallParams );
+
+        /**
+        * From MCCPCall
+        * Call is ringning
+        * @return system wide error code
+        */
+        virtual TInt Ringing();
+
+        /**
+        * From MCCPCall
+        * Ends an ongoing call.
+        * @return system wide error code
+        */
+        virtual TInt HangUp();
+
+        /**
+        * From MCCPCall
+        * Cancels the ongoing request
+        * @return system wide error code
+        */
+        virtual TInt Cancel();
+
+        /**
+        * From MCCPCall
+        * Puts the specified call on hold.
+        * @return system wide error code
+        */
+        virtual TInt Hold();
+
+        /**
+        * From MCCPCall
+        * Resumes the call.
+        * @return system wide error code
+        */
+        virtual TInt Resume();
+
+        /**
+        * From MCCPCall
+        * Swaps a connected call to its opposite state either active or on hold
+        * @return system wide error code
+        */
+        virtual TInt Swap();
+
+        /**
+        * From MCCPCall
+        * Returns the remote party of the call.
+        * @return remote party address,
+        */
+        const TDesC& RemoteParty() const;
+
+        /**
+        * From MCCPCall
+        * Returns the remote party name of the call.
+        * @return remote party name
+        */
+        const TDesC& RemotePartyName();
+
+        /**
+        * From MCCPCall
+        * Dialled party.
+        * @return dialled party name
+        */
+        const TDesC& DialledParty() const;
+
+        /**
+        * From MCCPCall
+        * Return boolean value if the incoming call is forwarded or not.
+        * @return ETrue if call is forwarded, else EFalse
+        */
+        virtual TBool IsCallForwarded() const;
+
+        /**
+        * From MCCPCall
+        * Returns boolean value if the call is mobile originated or not.
+        * @return ETrue if call is mobile originated, otherwise EFalse
+        */
+        virtual TBool IsMobileOriginated() const;
+
+        /**
+        * From MCCPCall
+        * Returns the state of the call.
+        * @return TCCPCallState The current state of the call
+        */
+        virtual MCCPCallObserver::TCCPCallState State() const;
+
+        /**
+        * From MCCPCall
+        * Returns TUid of the plug-in used for this call
+        * @return TUid Implementation UID of the Plug-In
+        */
+        virtual TUid Uid() const;
+
+        /**
+        * From MCCPCall
+        * Returns call control caps for this call
+        * @return call capability information
+        */
+        virtual MCCPCallObserver::TCCPCallControlCaps Caps( ) const;
+
+        /**
+        * From MCCPCall
+        * Get call's secure status.
+        * @return TBool ETrue if security is enabled, else EFalse.
+        */
+        virtual TBool IsSecured() const;
+
+        /**
+        * From MCCPCall 
+        * Get call's secure specified status.
+        * @return TBool ETrue if secure specified 
+        */
+        virtual TBool SecureSpecified() const;
+
+        /**
+        * From MCCPCall  
+        * Set call parameters.
+        * @param aNewParams New call paramater information.
+        */
+        virtual void SetParameters( const CCCPCallParameters& aNewParams );
+        
+        /**
+        * From MCCPCall 
+        * Cet call parameters.
+        * @return Current call paramater information.
+        */
+        virtual const CCCPCallParameters& Parameters() const;
+
+        /**
+        * From MCCPCall 
+        * Get Forward provider
+        * @param aObserver - observer class for forward events
+        * @return Pointer to MCCPForwardProvider if succesfull, NULL if not available
+        * @leave on error case system error code
+        */
+        virtual MCCPForwardProvider* ForwardProviderL( const MCCPForwardObserver& aObserver );
+
+        /**
+        * From MCCPCall 
+        * Get Call transfer provider
+        * @param aObserver - observer class for transfer events
+        * @return Pointer to MCCPTransferProvider if succesfull, NULL if not available
+        * @leave on error case system error code
+        */
+        virtual MCCPTransferProvider* TransferProviderL( const MCCPTransferObserver& aObserver );
+          
+        /**
+        * From MCCPCall  
+        * Adds a new observer for MCCECall object. Called in MT call case. In MO 
+        * case observer will be given at call construction.
+        * Plug-in dependent feature if duplicates or more than one observers 
+        * are allowed or not. Currently CCE will set only one observer.
+        * @param aObserver Observer
+        * @leave system error if observer adding fails
+        */
+        virtual void AddObserverL( const MCCPCallObserver& aObserver );
+
+        /**
+        * From MCCPCall  
+        * Remove an observer.
+        * @param aObserver Observer
+        * @return KErrNone if removed succesfully. KErrNotFound if observer was not found.
+        * Any other system error depending on the error.
+        */
+        virtual TInt RemoveObserver( const MCCPCallObserver& aObserver );
+        
+        /**
+        * From MCCPCall 
+        * Returns the inband tone associated to an error condition or a state transition of a call.
+        * See defenition for TCCPTone.
+        * @since S60 3.2
+        * @param None.
+        * @return TCCPTone Used tone.
+        */
+        TCCPTone Tone() const;
+
+// from base class MCCPCSCall
+        
+        /**
+        * From MCCPCSCall
+        * Indicates that FDN check is not used for dial.
+        */
+        virtual void NoFDNCheck( );
+        
+        /**
+        * From MCCPCSCall 
+        * Log dialed  number. SAT related, check if dialed number is to be logged or not.
+        * @since S60 5.0
+        * @param None
+        * @return Log dialed number or not.
+        */
+        virtual TBool LogDialedNumber() const;
+    
+// from base class MCCPCallCommandHandling
+        
+        /**
+        * Perform answer command.
+        * @return system wide error code
+        */
+        TInt PerformAnswerRequest();
+        
+        /**
+        * Perform dial command.
+        * @return system wide error code
+        */
+        TInt PerformDialRequest();
+        
+    protected:
+            
+        /**
+        * Starts dialing to recipient.
+        * Bypasses FDN check according to aFdnCheck.
+        * @param aFdnCheck True if FDN checking is used
+        * @return system wide error code
+        */
+        virtual TInt DialFdnCond( TBool aFdnCheck ) = 0;
+                
+    protected:
+    
+        /**
+        * C++ default constructor.  
+        * 
+        * @param aLine line of the call 
+        * @param aMobileOriginated is call mobile originated 
+        * @param aName contains call name (mobile terminated) or phone number (mobile originated)
+        * @param aCommonInfo reference to common info interface 
+        * @param aIsEmergencyCall is emergency call 
+        */
+        CSPCall(  RMobileLine& aLine, 
+                  TBool aMobileOriginated,
+                  const TDesC& aName,
+                  MCSPCommonInfo& aCommonInfo,
+                  TBool aIsEmergencyCall );
+                  
+        /*
+        * Constructing 2nd phase.
+        * @param aParams call parameters  
+        */
+        virtual void ConstructL( const CCCECallParameters& aParams );
+        
+        /*
+        * Notifies the ringing state to observers.
+        */
+        virtual void NotifyRingingState();
+        
+        /**
+        * Mapping ETel state to CCP state.
+        * @param aEtelState an ETel state
+        * @return corresponding CCP state
+        */
+        MCCPCallObserver::TCCPCallState 
+            CSPCall::CCPStateFromETelState(
+                RMobileCall::TMobileCallStatus aEtelState );
+                
+        /**
+        * From MCSPCallObserver 
+        * Updates the state change including inband tones 
+        * played by network and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        virtual void NotifyCallStateChangedWithInband( 
+            MCCPCallObserver::TCCPCallState aState );
+
+        /**
+        * Updates the state change 
+        * and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        virtual void NotifyCallStateChanged( 
+            MCCPCallObserver::TCCPCallState aState );
+            
+        /**
+        * From MCSPCallObserver
+        * Notify that remote party info has changed.
+        * @param aRemoteParty new remote party information
+        */
+        virtual void NotifyRemotePartyInfoChanged( 
+            const TDesC& aRemoteParty);
+
+        /**
+        * Open call handle.  
+        * Opens a new call handle for MO call  
+        * and an existing handle for MT call.    
+        */
+        virtual void OpenCallHandleL();
+
+        /**
+        * Update call info data including call name,  
+        * remote name and number data.  
+        */
+        virtual void UpdateCallInfo();
+        
+        /**
+         * Implementation for UpdateCallInfo().       
+         */
+        virtual void UpdateCallInfoImpl( RMobileCall::TMobileCallInfoV7 aCallInfo );
+        
+        /**
+         * Set call origin to CCCECallParameters.       
+         */
+        virtual void UpdateCallOrigin( RMobileCall::TMobileCallInfoV7 aCallInfo );
+        
+        /**
+        * Reads information from cenrep.
+        * @param aUid CR Uid
+        * @param aKey CR key
+        * @param aVal value of key, output
+        */
+        void ReadRepositoryL( TUid aUid, TUint aKey, TInt& aVal);
+
+        /**
+        * Check and notify call termination error.
+        */
+        void CheckAndNotifyTerminationError();
+        
+        /**
+        * Error from iExitCode.
+        */
+        TInt ExitCodeError() const;
+        
+        /**
+        * Update call name number info.   
+        * @param aCallInfo RMobileCall::TMobileCallInfoV3
+        * @param aCallCreatedByMonitor, set:  
+        *       EFalse for calls added by plugin owner
+        *       ETrue for calls added by ETel status monitor  
+        */
+        void UpdateCallNameNumberInfo(
+                RMobileCall::TMobileCallInfoV3& aCallInfo, 
+                TBool aCallAddedByMonitor ); 
+
+        /**
+        * Open new call.
+        * New call is opened when the plugin owner adds the new 
+        * call (compare to OpenExistingCall where call is added by 
+        * ETel monitor).  
+        */
+        void OpenNewCall(); 
+
+        /**
+        * Open existing call.
+        * Existing call is opened if one of the ETel
+        * monitors (incoming call monitor or line status monitor) 
+        * has added the call and no new call needs to be 
+        * opened.    
+        * @param aName name of the existing call   
+        */
+        void OpenExistingCallL( const TDesC& aName ); 
+        
+    private:
+
+        /**
+        * Create call handlers for call requests and for 
+        * monitoring call events.   
+        */
+        void CreateCallHandlersL();
+        
+        /**
+        * Update call state from ETel
+        * @return system wide error code 
+        */
+        int UpdateCallState();
+
+    private: 
+
+        enum TCSPCallAudioStatus {
+            ECSPCallAudioStatusInactive,
+            ECSPCallAudioStatusActive
+            };
+
+    protected:
+
+          /**
+          * CCP Call Observer array.
+          */
+          RPointerArray<MCCPCallObserver> iObservers;
+          
+          /**
+          * Actual ETel call handle.
+          */
+          RMobileCall iCall;
+
+          /**
+          * ETel line
+          */
+          RMobileLine& iLine;
+
+          /**
+          * Determines if the call direction is either MO (ETrue) or MT (EFalse)
+          */
+          TBool iMobileOriginated;  
+
+          /**
+          * Name information of the call.
+          * 
+          * Name information is stored during CSPCall construction
+          * and assigned to iCallName (MT or client call) or 
+          * iRemotePartyNumber (MO call) afterwards.    
+          */
+          TBuf<KCSPPhoneNumberMaxLength> iName;
+          
+          /**
+          * Remote party name of the call.
+          */
+          TBuf<KCSPPhoneNumberMaxLength> iRemotePartyNumber;
+          
+          /**
+          * Remote party name of the call.
+          */
+          TBuf<KCSPCallingNameMaxLength> iRemotePartyName;
+
+          /**
+          * Dialled party of the call.
+          */
+          TBuf<KCSPPhoneNumberMaxLength> iDialledParty;
+          
+          /**
+          * Call name for MT call.
+          */
+          TName iCallName;
+
+          /**
+          * Call parameters.
+          */      
+          CCCECallParameters* iParams; 
+         
+          /**
+          * Call state in CCP format
+          */
+          MCCPCallObserver::TCCPCallState iCallState;
+          
+          /**
+          * Capability flags.
+          */
+          TUint32 iCapsFlags;
+
+          /**
+          * Call status monitor
+          */
+          CSPEtelCallStatusMonitor* iCallStatusMonitor;
+            
+          /**
+          * Call event monitor
+          */
+          CSPEtelCallEventMonitor* iCallEventMonitor;
+          
+          /**
+          * Call info monitor
+          */
+          CSPCallInfoMonitor* iCallInfoMonitor;
+          
+          /**
+          * Makes the asynchronic requests for various purposes.
+          */
+          CSPEtelCallRequester* iRequester;
+
+          /**
+          * Dial completion code.
+          */
+          TInt iDialCompletionCode;
+
+          /**
+           * Common information for calls.
+           */
+           MCSPCommonInfo& iCommonInfo;
+
+          /**
+          * Call termination error notification has been sent.
+          */
+          TBool iTerminationErrorNotified;
+          
+          /**
+          * Emergency call.
+          */
+          TBool iIsEmergencyCall;
+    
+    private:
+        
+          /**
+          * Transfer provider.
+          * Own.
+          */
+          CSPTransferProvider* iTransferProvider;
+          
+          /**
+          * Forward provider. No actual implementation.
+          * Own.
+          */          
+          CSPForwardProvider* iForwardProvider;
+          
+          /**
+          * Audio dev sound handler.
+          * Not own.
+          */
+          CSPAudioHandler* iAudioHandler;
+          
+          /**
+          * FDN check usage status. Default is on. (ETrue)
+          */
+          TBool iFdnCheck;          
+          
+          /**
+          * Monitors call capabilities from ETel.
+          * Own.
+          */
+          CSPEtelCallCapsMonitor* iCallCapsMonitor;
+                    
+          /*  
+          * UUS monitor
+          */          
+          CSPUUIMonitor* iUUIMonitor;
+          
+          /*  
+          * UUS sender
+          */
+          CSPUUIMessageSender* iUUIMessageSender;
+          
+          /**
+          * Data for parsed skype id.
+          * Own.
+          */
+          HBufC* iSkypeId;
+          
+          /**
+          * Audio stop requested status. The flag prevents double audio stop.
+          * Stop is executed in Disconnecting state and Idle state 
+          * if previous state has been DisconnectingWithInband.
+          * Audio start status.
+          */
+          TCSPCallAudioStatus iAudioStatus;
+          
+          /**
+          * Defines whether to report KErrGsmCCNormalUnspecified
+          * and KErrGsmCCCallRejected.
+          */
+          TBool iDontReportTerm;
+          
+          /**
+           * User to user information. Sended to network before dial.
+           * Own.
+           */
+          HBufC* iUserToUserInformation;
+          
+          friend class UT_CSPCall;
+          friend class MT_CConvergedCallProvider;
+          
+          
+    };
+
+
+#endif // CSPCALL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspcalladdedhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPCallAddedHandler
+*
+*/
+
+
+#ifndef CSPCALLADDEDHANDLER_H
+#define CSPCALLADDEDHANDLER_H
+
+#include <e32base.h>
+#include <etelmm.h>
+#include "rcsplinecontainer.h"
+#include "mcsplinestatusobserver.h" // For MCSPLineStatusObserver
+
+class CSPCall;
+class CSPCallArray;
+class CSProvider;
+class MCCPCSObserver;
+class RCSPLineContainer;
+class CSPEtelLineStatusMonitor; 
+class CSPEtelCallWaitingRequester;
+class MCSPCommonInfo;
+class CSPAudioHandler;
+
+/**
+* Handles call adding from calls not done by the plugin.
+*
+*  @lib csplugin.dll
+*/
+NONSHARABLE_CLASS(CSPCallAddedHandler): public CBase,                            
+                           public MCSPLineStatusObserver
+    {
+    
+    public: //Constructors and descructor    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aObserver the observer for getting notification
+        * @param aLine the line to monitor
+        * @param aLineId line identifier
+        */
+        static CSPCallAddedHandler* NewL( 
+                const MCCPCSObserver& aObserver,
+                RCSPLineContainer& aLineContainer,
+                CSPCallArray& aCallArray,
+                MCSPCommonInfo& aCommonInfo,
+                CSPAudioHandler& aAudioHandler );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPCallAddedHandler( );
+
+
+// from base class MCSPLineStatusMonitor        
+        
+        /**
+        * Handles line status change notifications 
+        * @param aLine the line to monitor
+        * @param aLineId line identifier
+        * @param aLineStatus
+        */        
+        void LineStatusChanged( RMobileLine& aLine,
+                RCSPLineContainer::TCSPLineId aLineId, 
+                RMobileCall::TMobileCallStatus& aLineStatus );
+
+    protected: // From CActive
+        
+        /**
+        * From CActive
+        * RunL
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Catches errors if RunL leaves
+        * @param aError error code
+        * @return error code
+        */
+        TInt RunError( TInt aError );
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        */
+        void DoCancel();
+
+    private:
+        
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change (incoming call)
+        * @param aLine the line associated with the call
+        * @param aLineId line identifier
+        */
+        CSPCallAddedHandler( const MCCPCSObserver& aObserver, 
+                             RCSPLineContainer& aLineContainer,
+                             CSPCallArray& aCallArray,
+                             MCSPCommonInfo& aCommonInfo,
+                             CSPAudioHandler& aAudioHandler );
+                                          
+        /**
+        * Constructs the monitor in the second phase.
+        */
+        void ConstructL();
+        
+        /**         
+        * Handles call creation 
+        * @param aLine the line to monitor
+        * @param aCallName the call name 
+        * @param aLineId line identifier
+        */
+        void CallAdded( RMobileLine& aLine, 
+                        TName aCallName,
+                        RCSPLineContainer::TCSPLineId aLineId );
+
+    private: // data
+        
+        /**
+        * Line container. 
+        */        
+        RCSPLineContainer& iLineContainer;
+        
+        /**
+        * Notifications observer.
+        */
+        const MCCPCSObserver& iObserver;
+        
+        /**
+        * Line status monitors.
+        */
+        CSPEtelLineStatusMonitor* iVoiceLineMonitor;        
+        CSPEtelLineStatusMonitor* iDataLineMonitor;
+        CSPEtelLineStatusMonitor* iAuxLineMonitor;
+        
+        /**
+        * Array of calls.
+        */
+        CSPCallArray& iCallArray;
+        
+        /**
+        * Common info handle.
+        */
+        MCSPCommonInfo& iCommonInfo;
+        
+        /**
+        * Audio Handler reference.
+        */
+        CSPAudioHandler& iAudioHandler;
+    };
+
+#endif // CSPCALLADDEDHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspcallarray.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPCallArray
+*
+*/
+
+
+#ifndef CSPCALLARRAY_H
+#define CSPCALLARRAY_H
+
+#include <e32base.h>
+
+#include "mcspcallinformation.h"
+
+class CSPCall;
+
+/**
+* Handles call adding from calls not done by the plugin.
+*
+*  @lib csplugin.dll
+*/
+class CSPCallArray: public CBase,
+                    public MCSPCallInformation
+    {
+    
+    public: //Constructors and descructor    
+    
+        /**
+        * Two-phased constructing for the array.
+        *
+        */
+        static CSPCallArray* NewL( );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPCallArray( );
+
+        /**
+         * Remove call from array
+         * @param aCall call to be removed
+         * @return result of removal
+         */        
+        TInt Add( CSPCall* aCall );
+        
+        /**
+         * Remove call from array
+         * @param aCall call to be removed
+         * @return result of removal
+         */
+        TInt Remove( CSPCall* aCall );
+        
+        /**
+         * Get call count.
+         */
+        TInt GetCallCount( );
+        
+        /**
+         * Get call by index.
+         */
+        CSPCall* Get( TInt aIndex );
+        
+// from base class MCSPCallInformation
+
+        /**
+        * From MCSPCallInformation
+        * Finds call pointer specified by call name.
+        * @param aCallName
+        * @return corresponding call pointer or NULL if not found.
+        */
+        CSPCall* FindCall( const TName& aCallName );
+    
+    private:
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change (incoming call)
+        * @param aLine the line associated with the call
+        * @param aLineId line identifier
+        */
+        CSPCallArray( );
+                                          
+    private: // data
+        
+        /**
+        * Pointer array of call objects.     
+        */
+        RPointerArray<CSPCall> iCallArray;
+        
+    };
+
+#endif // CSPCALLARRAY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspcallcommandhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPCallCommandHandler
+*
+*/
+
+
+#ifndef CSPCALLCOMMANDHANDLER_H
+#define CSPCALLCOMMANDHANDLER_H
+
+#include <e32base.h>
+
+#include "mcspcallinformation.h"
+
+class CSPCall;
+class MCCPCallCommandHandling;
+
+/**
+* Handles call adding from calls not done by the plugin.
+*
+*  @lib csplugin.dll
+*/
+enum TCSPPendingCallCommand {
+            ECSPNone,
+            ECSPAnswerCall,
+            ECSPDialCall
+        };
+        
+class CSPCallCommandHandler: public CBase
+    {
+    
+    public: //Constructors and descructor    
+    
+        /**
+        * Two-phased constructing for the array.
+        */
+        static CSPCallCommandHandler* NewL();
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPCallCommandHandler( );
+
+        /**
+        * Indicates active hangup command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateActiveHangup( MCCPCallCommandHandling& aCall );
+        
+        /**
+        * Indicates hangup command complete.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateHangupComplete( MCCPCallCommandHandling& aCall );
+        
+        /**
+        * Indicates active hangup command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateDialRequest( MCCPCallCommandHandling& aCall );
+        
+        /**
+        * Indicates active hangup command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateAnswerRequest( MCCPCallCommandHandling& aCall );
+
+    
+    private:
+        /**
+        * C++ default constructor
+        */
+        CSPCallCommandHandler();
+                                          
+    private: // data
+        
+        /**
+        * Active hangup array.
+        */
+        RPointerArray<MCCPCallCommandHandling> iActiveHangupArray;
+        
+        /**
+        * Pending command.
+        */
+        TCSPPendingCallCommand iPendingCommand;
+        
+        /**
+        * Pending call command object.
+        * Not own
+        */
+        MCCPCallCommandHandling* iPendingCall;
+        
+    };
+
+#endif // CSPCALLCOMMANDHANDLER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspcallinfomonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitors changes in remote party info 
+*                (RMobileCall::TMobileCallRemotePartyInfoV1)
+*  Interface   : 
+*
+*/
+
+
+#ifndef     CSPCALLINFOMONITOR_H
+#define     CSPCALLINFOMONITOR_H
+
+//  INCLUDES
+#include    <etelmm.h>
+#include    "mcspcallobserver.h"
+
+//  FORWARD DECLARATIONS
+
+class   CSPCallData;
+class   CSPPhoneData;
+class   RMobileCall;
+
+//  CLASS DEFINITIONS 
+
+/** Monitors changes in remote party info.
+*   This class monitors remote party info changes in ETel's call objects.
+*   @since 3.1
+*/
+NONSHARABLE_CLASS( CSPCallInfoMonitor ): public CActive
+    {
+    public:
+        /** 
+        * Two-phased constructor 
+        * @param aObserver Call info change observer
+        * @param aCall This is the call to be monitored
+        */
+        static CSPCallInfoMonitor* NewL(
+            MCSPCallObserver& aObserver, RMobileCall &aCall );
+
+        /** D'tor. */
+        ~CSPCallInfoMonitor();
+
+    public:
+        /** 
+        * Starts monitoring.
+        */
+        void StartMonitoring( );
+
+    private:
+        /** Prohibited. */
+        CSPCallInfoMonitor& operator=( const CSPCallInfoMonitor& );
+
+        /**
+        * C++ Constructor
+        * @param aObserver aObserver Call info change observer        
+        * @param aCall This is the call to be monitored.         
+        */
+        CSPCallInfoMonitor( MCSPCallObserver& aObserver, 
+                            RMobileCall &aCall ); 
+
+
+    private:    // from CActive
+        /** @see CActive::RunL() */
+        void RunL();
+
+        /**  @see CActive::DoCancel() */
+        void DoCancel();
+      
+        
+
+    private:
+    
+        /**
+        * Observer for info change.
+        */
+        MCSPCallObserver& iObserver;
+        
+        /**
+        * Pointer to Call object.
+        * Not own.
+        */
+        RMobileCall& iCall;
+        
+        /**
+        * Remote party info.
+        */ 
+        RMobileCall::TMobileCallRemotePartyInfoV1 iRemotePartyInfo;
+        
+        /**
+        * packaged remote party info.
+        */         
+        RMobileCall::TMobileCallRemotePartyInfoV1Pckg iRemotePartyInfoPckg;
+    };
+
+#endif // CSPCALLINFOMONITOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspcipheringstatusmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPCipheringStatusMonitor
+*
+*/
+
+
+#ifndef CSPCIPHERINGSTATUSMONITOR_H
+#define CSPCIPHERINGSTATUSMONITOR_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <etelmm.h>
+
+#include "cspconsts.h"
+
+
+// FORWARD DECLARATIONS
+class RMmCustomAPI;
+class MCSPSecuritySettingObserver;
+
+// CLASS DECLARATION
+
+
+class CSPCipheringStatusMonitor : public CActive
+    {
+    public: //Constructors and descructor
+
+        /**
+        * C++ default constructor
+        */
+        CSPCipheringStatusMonitor( RMmCustomAPI& aMmCustom,
+            MCSPSecuritySettingObserver& aObs );
+
+        /**
+        * Destructor.
+        */
+        ~CSPCipheringStatusMonitor();
+
+    public:
+
+        static CSPCipheringStatusMonitor* NewL( RMmCustomAPI& aMmCustom, 
+            MCSPSecuritySettingObserver& aObs );
+        
+        /**
+        * Starts monitoring the CW notifications
+        */
+        void StartMonitoring();
+        
+        /**
+        * Network security status.
+        * @return secured status
+        */
+        TBool NetworkSecurityStatus() const;
+
+        /**
+        * Secure specified.
+        * @return secure specified status
+        */        
+        TBool SecureSpecified() const;        
+        
+    protected: // From CActive
+    
+        /**
+        * Cancels asyncronous request(s).
+        */
+        void DoCancel();
+
+        /**
+        * Informs object that asyncronous request is ready.
+        */
+        void RunL();
+        
+    private: // data
+
+        /**
+        * Ciphering info 
+        */
+        RMmCustomAPI::TCipheringInfo iCipheringInfo; 
+        
+        /**
+        * CustomAPI handle
+        */        
+        RMmCustomAPI& iMmCustom; 
+        
+        /**
+        * Security setting observer.
+        */
+        MCSPSecuritySettingObserver &iObserver;
+
+        /**
+        * indicates if ciphering status was retreived for the first time
+        */
+        TBool iIsInitialised;
+        
+        /**
+        * Call secure status.
+        */
+        TBool iCallsSecured;
+        
+        /**
+        * Call secure specified status.
+        */
+        TBool iSecureSpecified;
+
+    };
+
+#endif // CSPCIPHERINGSTATUSMONITOR_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspclientvideocall.h	Fri Jun 04 10:19:18 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:  Implements CSPClientVideoCall for CS Call Plug-in
+*
+*/
+
+
+#ifndef CSPCLIENTVIDEOCALL_H
+#define CSPCLIENTVIDEOCALL_H
+
+#include <mccpcscall.h>
+#include <mccpcallobserver.h>
+#include <etel.h>
+#include <etelmm.h>
+#include <cccecallparameters.h>
+
+#include "cspvideocall.h"
+#include "cspconsts.h"
+#include "mcspcallobserver.h"
+#include "mcspcallerrorobserver.h"
+
+
+/**
+* Call class for CS Call Plug-in. Implements the API defined by CCP in classes
+* MCCPCall and MCCPCSCall
+*
+*  @lib csplugin.dll
+*  @since S60 v5.0
+*/
+class CSPClientVideoCall : public CSPVideoCall
+    {
+    
+    public:
+        
+        /*
+        * Creates a new CSPClientVideoCall object.
+        * @since S60 5.0
+        * @param aName dialled number (MT) or call name (MO)
+        * @param aLine line for opening the call
+        * @param aParams call parameters 
+        * @param aCommonInfo common information for call,
+        * @return pointer to created call object
+        */
+        static CSPClientVideoCall* NewL( const TDesC& aName,
+                              RMobileLine& aLine,
+                              const CCCECallParameters& aParams,
+                              MCSPCommonInfo& aCommonInfo );       
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPClientVideoCall( );
+
+// from base class CSPVideoCall
+
+        /**
+        * From CSPCall
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        void NotifyCallStateChanged( MCCPCallObserver::TCCPCallState aState );
+
+        /**
+        * From CSPCall
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        void NotifyCallStateChangedWithInband( MCCPCallObserver::TCCPCallState aState );
+      
+    private:    
+        
+        /*
+        * C++ default constructor
+        * @param aLine open line ready for use
+        * @param aServiceId service ID
+        * @param aCallType type of call
+        * @param aLineType type of line (primary/aux)
+        * @param aMobileOriginated true if MO, false if MT
+        * @param aName call name (MT) or recipient (MO)
+        * @param aExtMoCall is externally created MO call
+        */
+        CSPClientVideoCall( RMobileLine& aLine,
+                 const TDesC& aName,
+                 MCSPCommonInfo& aCommonInfo );
+                 
+        /*
+        * Constructing 2nd phase.
+        * @since S60 3.2
+        */
+        void ConstructL( const CCCECallParameters& aParams );
+        
+        /*
+        * Indicate client call. 
+        * Indication is done in Dialling state and can be done only once 
+        */
+        void IndicateClientCall(); 
+        
+        /**
+        * Open call handle.  
+        * Opens an existing handle for client call.    
+        */
+        void OpenCallHandleL();
+
+        /**
+        * Update call info.  
+        */
+        void UpdateCallInfoImpl( RMobileCall::TMobileCallInfoV7 aCallInfo ); 
+        
+    private: // Data
+        
+        /**
+        * Defines whether client call has been already indicated for this call 
+        * when Dialling state is entered. 
+        */
+        TBool iClientCallIndicated;
+        
+    };
+
+
+#endif // CSPCLIENTVIDEOCALL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspclientvoicecall.h	Fri Jun 04 10:19:18 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:  Implements CSPClientVoiceCall for CS Call Plug-in
+*
+*/
+
+
+#ifndef CSPCLIENTVOICECALL_H
+#define CSPCLIENTVOICECALL_H
+
+#include "cspvoicecall.h" 
+
+/**
+* Client voice call class for CS Call Plug-in. 
+*
+*  @lib csplugin.dll
+*/
+class CSPClientVoiceCall : public CSPVoiceCall
+    {
+    
+    public:
+        
+        /*
+        * Creates a new CSPClientVoiceCall object.
+        * @since S60 5.0
+        * @param aName dialled number (MT) or call name (MO)
+        * @param aLine line for opening the call
+        * @param aParams call parameters 
+        * @param aCommonInfo common information for call,
+        * @return pointer to created call object
+        */
+        static CSPClientVoiceCall* NewL( const TDesC& aName,
+                              RMobileLine& aLine,
+                              const CCCECallParameters& aParams,
+                              MCSPCommonInfo& aCommonInfo );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPClientVoiceCall( );
+      
+    // from base class CSPVoiceCall
+
+        /**
+        * From CSPVoiceCall
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        void NotifyCallStateChanged( MCCPCallObserver::TCCPCallState aState );
+
+        /**
+        * From CSPVoiceCall
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        void NotifyCallStateChangedWithInband( MCCPCallObserver::TCCPCallState aState );
+        
+    private:    
+        
+        /*
+        * Voice call constructor.
+        * @param aLine open line ready for use
+        * @param aName remote party or call name depending on direction
+        * @param aCommonInfo reference to common info interface
+        */
+        CSPClientVoiceCall( RMobileLine& aLine,  
+                 const TDesC& aName,
+                 MCSPCommonInfo& aCommonInfo );
+                 
+        /*
+        * Constructing 2nd phase.
+        */
+        void ConstructL( const CCCECallParameters& aParams );
+        
+        /*
+        * Indicate client call. 
+        * Indication is done in Dialling state and can be done only once 
+        */
+        void IndicateClientCall(); 
+        
+        /**
+        * Open call handle.  
+        * Opens an existing handle for client call.    
+        */
+        void OpenCallHandleL();
+        
+        /**
+        * Update call info.  
+        */
+        void UpdateCallInfoImpl( RMobileCall::TMobileCallInfoV7 aCallInfo );
+        
+    private: // Data
+        
+        /**
+        * Defines whether client call has been already indicated for this call 
+        * when Dialling state is entered. 
+        */
+        TBool iClientCallIndicated;
+        
+    };
+
+
+#endif // CSPCLIENTVOICECALL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspconferencecall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,316 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements CSPConferenceCall for CS Call Plug-in
+*
+*/
+
+
+
+#ifndef CSPCONFERENCECALL_H
+#define CSPCONFERENCECALL_H
+
+#include <mccpconferencecall.h>
+#include <mccpconferencecallobserver.h>
+#include <mccpcallobserver.h>
+#include <mccpcscall.h>
+#include <etel.h>
+#include <etelmm.h>
+
+#include "mcspconferencestatusobserver.h"
+#include "cspconsts.h"
+#include "cspetelconferencecallrequester.h" // For the requester and TConferenceRequestType
+
+
+class MCCPForwardProvider;
+class MCCPTransferProvider;
+class MCCPObserver;
+class MCSPCallInformation;
+class CSPConferenceCallObserver;
+class RMobileConferenceCall;
+class CSPEtelConferenceStatusMonitor; 
+class CSPEtelConferenceEventMonitor;
+class CSPEtelConferenceCapsMonitor;
+
+
+/**
+* Call class for CS Call Plug-in. Implements the API defined by CCP in classes
+* MCCPCall and MCCPCSCall
+*
+*  @lib csplugin.dll
+*/
+class CSPConferenceCall : public CBase,
+                          public MCCPConferenceCall,
+                          public MCSPConferenceStatusObserver
+    {
+    
+    public:
+        /*
+        * Creates a new CSPConferenceCall object.
+        * @param aPhone reference to phone object
+        * @return pointer to created call object
+        * @param aServiceId the service id
+        */
+        static CSPConferenceCall* NewL( 
+                              RMobilePhone& aPhone,
+                              MCSPCallInformation& aCallInfo,
+                              TUint32 aServiceId );
+        
+        /*
+        * C++ default destructor
+        */
+        virtual ~CSPConferenceCall( );
+
+        /** 
+        * Getter for observer
+        * @return observer for CS calls.
+        */
+        MCCPCallObserver* Observer() const;
+
+        /**
+        * Notifies call specific event to observers.
+        * @param aEvent conference event that was occurred
+        * @param aCallName the name of the related call object
+        */        
+        void NotifyEvent( 
+            MCCPConferenceCallObserver::TCCPConferenceCallEvent aEvent,
+            TName& aCallName );
+            
+        /**
+        * Notifies non-'call specific' event to observers.
+        * @param aEvent conference event that was occurred,
+        */        
+        void NotifyEvent( 
+            MCCPConferenceCallObserver::TCCPConferenceCallEvent aEvent );
+
+        /**
+        * Notifies about conference call request related errors.
+        */
+        void NotifyConferenceError( TCCPConferenceCallError aErr );
+
+        /**
+        * Handles caps change.
+        * @param aNewCaps new caps
+        */
+        void ConferenceCapsChanged( TUint32 aNewCaps );
+
+// from base class MCSPConferenceStatusObserver
+        
+        /**
+        * From MCSPConferenceStatusObserver.
+        * Notifies event to observers.
+        * @param aStatus new status of the conference call
+        */        
+        void NotifyStateChange( 
+            MCSPConferenceStatusObserver::TCSPConferenceState aStatus );
+        
+// from base class MCCPConferenceCall
+
+        /**
+        * From MCCPConferenceCall.
+        * Adds new call to conference call.
+        * @param aCall Call to be added to conference
+        * @return Leaves in case of an error. 
+        * KErrArgument, KErrNoMemory
+        */
+        void AddCallL( MCCPCall* aCall );
+    
+        /**
+        * From MCCPConferenceCall.
+        * Removes call from conference call.
+        * @param aCall Call to be removed from conference
+        * @return In error case leaves. 
+        * KErrArgument, KErrNotFound
+        */
+        void RemoveCallL( MCCPCall* aCall );
+    
+        /**
+        * From MCCPConferenceCall.
+        * Returns number of calls in conference call.
+        * @param aCallCount Number of calls in conference.
+        * @return KErrNone if succesfull, otherwise system wide error code.
+        */
+        TInt CallCount( ) const;
+    
+        /**
+        * From MCCPConferenceCall.
+        * Switch to a private call with one call from conference call.
+        * @param aCall Call to be removed from conference
+        * @return In error case leaves. 
+        * KErrArgument, KErrNotFound
+        */
+        void GoOneToOneL( MCCPCall& aCall );
+        
+        /**
+        * Adds current calls (1 hold + connected )
+        * to part of conference
+        * @leave In case of an error system wide error code
+        */
+        void CurrentCallsToConferenceL();        
+        
+        /**
+        * From MCCPConferenceCall
+        * Returns serviceId
+        * @since S60 3.2
+        * @return TUint32 ServiceId
+        */
+        TUint32 ServiceId() const;
+        
+        /**
+        * From MCCPConferencCall
+        * Ends an ongoing call.
+        * @since S60 3.2
+        */
+        TInt HangUp();
+
+        /**
+        * From MCCPConferenceCall
+        * Puts the specified call on hold.
+        * @since S60 3.2
+        */
+        TInt Hold();
+
+        /**
+        * From MCCPConferenceCall
+        * Resumes the call.
+        * @since S60 3.2
+        */
+        TInt Resume();
+
+        /**
+        * From MCCPConferenceCall
+        * Swaps a connected call to its opposite state either active or on hold
+        * @since S60 3.2
+        */
+        TInt Swap();
+
+        /**
+        * Adds a new observer for the conference call object.
+        * @since S60 3.2
+        * @param aObserver the conference observer to be added
+        */
+        void AddObserverL( const MCCPConferenceCallObserver& aObserver );
+        
+        /**
+        * Removes an observer.
+        * @since S60 3.2
+        * @param aObserver the observer to be removed
+        * @return system wide error code
+        */
+        TInt RemoveObserver( const MCCPConferenceCallObserver& aObserver );
+                
+        /**
+        * Get conference participants.  
+        * @since S60 5.0 
+        * @param aCallArray array where participating calls are stored 
+        * @return system wide error code
+        */
+        TInt GetCallArray( RPointerArray<MCCPCall>& aCallArray );  
+        
+    private:    
+        
+        /*
+        * C++ default constructor
+        * @param aPhone handle to the ETel Phone
+        * @param aCallInfo call information 
+        * @param aServiceId service id
+        */
+        CSPConferenceCall( RMobilePhone& aPhone, 
+                           MCSPCallInformation& aCallInfo,
+                           TUint32 aServiceId  );
+                 
+        /*
+        * Constructing 2nd phase.
+        * @since S60 3.2
+        * @param aObserver the CCP call observer,
+        */
+        void ConstructL( );
+                
+        /**
+        * Get conference state from ETel.  
+        * @since S60 5.0 
+        * @param aState param for storing conference call state  
+        * @return system wide error code
+        */
+        TInt GetConferenceCallState( 
+                MCCPConferenceCallObserver::TCCPConferenceCallState& aState ); 
+        
+    private:
+
+      /**
+      * Call status monitor.
+      * Own.
+      */
+      CSPEtelConferenceStatusMonitor* iCallStatusMonitor;
+        
+      /**
+      * Call event monitor.
+      * Own.
+      */
+      CSPEtelConferenceEventMonitor* iCallEventMonitor;
+
+      /**
+      * Call caps monitor.
+      * Own.
+      */
+      CSPEtelConferenceCapsMonitor* iCallCapsMonitor;
+        
+      /**
+      * ETel call object
+      */
+      RMobileConferenceCall iCall;
+      
+      /**
+      * ETel phone
+      */
+      RMobilePhone& iPhone;
+      
+      /**
+      * Conference call state.
+      */ 
+      MCCPConferenceCallObserver::TCCPConferenceCallState iCallState;
+                
+      /**
+      * Makes the asynchronic requests for various purposes.
+      */
+      CSPEtelConferenceCallRequester* iRequester;
+      
+      /**
+      * Observer array for conference states, events and errors.
+      */      
+      RPointerArray<MCCPConferenceCallObserver> iObservers;
+      
+      /**
+      * Call count for adding call.
+      */
+      TInt iCallCountForAddCall;
+      
+      /**
+      * Call Information for resolving call pointers from
+      * the call names.
+      */
+      MCSPCallInformation& iCallInfo;
+      
+      /**
+      * Service ID
+      */
+      TUint32 iServiceId;
+      
+      /**
+      * Call name of a last call added to this conference..
+      */
+      TName iAddedCallName;
+
+    };
+
+#endif // CSPCONFERENCECALL_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspconsts.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Constants for CSP
+*
+*/
+
+
+
+#ifndef CCSPCONSTS_H
+#define CCSPCONSTS_H
+
+_LIT( KCSPName,"CSP" );
+
+
+//The length of a pause created during dialling by the comma character (',') measured in seconds.  
+const TUint KCSPDefaultInterval = 2;
+
+// The boolean indicating the autoreadial is on or off
+const TBool KCSPDefaultAutoRedial = EFalse;
+
+/**
+* Required for notifying Incoming Call Monitor.
+*/ 
+const TInt KCSPImplementationUidInt = 0x102828E5;
+
+/**
+* Implementation uid of CS Plugin.
+*/
+const TUid KCSPImplementationUid = { KCSPImplementationUidInt };
+
+/**
+* Number of message slots in RTelServer
+*/
+const TInt KNbrOfMessageSlots = 128;
+
+const TInt KCSPPhoneNumberMaxLength = 100;
+
+const TInt KCSPCallingNameMaxLength = 80;
+
+#endif // CCSPCONSTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspdtmfprovider.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header of CSPDTMFProvider which provides DTMF functionality.
+*
+*/
+
+
+#ifndef CSPDTMFPROVIDER_H
+#define CSPDTMFPROVIDER_H
+
+
+#include <e32base.h>
+#include <mccpdtmfprovider.h>
+#include <mccpdtmfobserver.h>
+
+
+class RMobilePhone;
+class CSPEtelDtmfMonitor;
+class CSPEtelDtmfStopMonitor;
+class RMmCustomAPI;
+
+/**
+* Makes asynchronic request to ETel interface according to given request type.
+* Provides canceling via CActive::Cancel().
+* 
+*/
+class CSPDTMFProvider: public CActive,
+                       public MCCPDTMFProvider        
+    {
+        
+    public:
+    
+        /**
+        * Two phased constructing of the DTMF provider instance.
+        * @param aPhone mobile phone handle
+        * @param aMmCustom custom API handle for special DTMF event 
+        *        monitoring.
+        * @return the DTMF provider instance
+        */
+        static CSPDTMFProvider* NewL( RMobilePhone& aPhone, 
+                                      RMmCustomAPI& aMmCustom );
+        
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPDTMFProvider( );
+        
+        /**
+        * HandleDTMFEvents.
+        * @since S60 3.2
+        * @param aEvent Event type
+        * @param aError Error code
+        * @param aTone Character
+        */
+        void NotifyDTMFEvent( const MCCPDTMFObserver::TCCPDtmfEvent aEvent,
+                              const TInt aError,
+                              const TChar aTone );
+
+        
+// from base class MCCPDTMFProvider
+        /**
+        * Cancels asynchronous DTMF string sending.
+        * @return KErrNone if succesfull, otherwise another system wide error code
+        */
+        TInt CancelDtmfStringSending();
+
+        /**
+        * Starts the transmission of a single DTMF tone across a
+        * connected and active call.
+        * @param aTone Tone to be played.
+        * @return KErrNone if succesfull, otherwise another system wide error code
+        */
+        TInt StartDtmfTone( const TChar aTone );
+
+        /**
+        * Stops playing current DTMF tone.
+        * @return KErrNone if succesfull, otherwise another system wide error code
+        */
+        TInt StopDtmfTone();
+
+        /**
+        * Plays DTMF string.
+        * @param aString String to be played.
+        * @return KErrNone if succesfull, otherwise another system wide error code
+        * KErrArgument if the specified string contains illegal DTMF characters
+        */
+        TInt SendDtmfToneString( const TDesC& aString );
+
+        /**
+        * Continue or cancel sending DTMF string which was stopped with 'w'-character
+        * in string.
+        * @param aContinue ETrue if sending of the DTMF string should continue,
+        * EFalse if the rest of the DTMF string is to be discarded.
+        * @return KErrNone if succesfull, otherwise another system wide error code
+        */
+        TInt ContinueDtmfStringSending( const TBool aContinue );
+
+        /**
+        * Add an observer for DTMF related events.
+        * Plug-in dependent feature if duplicates or more than one observers 
+        * are allowed or not. Currently CCE will set only one observer.
+        * @since S60 v3.2
+        * @param aObserver Observer
+        * @leave system error if observer adding fails
+        */
+        void AddObserverL( const MCCPDTMFObserver& aObserver );
+
+        /**
+        * Remove an observer.
+        * @since S60 v3.2
+        * @param aObserver Observer
+        * @return KErrNone if removed succesfully. KErrNotFound if observer was not found.
+        * Any other system error depending on the error.
+        */
+        TInt RemoveObserver( const MCCPDTMFObserver& aObserver );
+            
+// from base class CActive
+    protected:
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();  
+
+        
+    private:
+        /**
+        * Constructs the requester.
+        *
+        * @param aPhone handle to ETel phone
+        * @param aMmCustom custom API handle
+        */
+        CSPDTMFProvider( RMobilePhone& aPhone, RMmCustomAPI& aMmCustom );
+        
+        /**
+        * Constructing the provider in the second phase.
+        */
+        void ConstructL();
+    
+    private: // data
+    
+        /**
+        * DTMF event observer.
+        */
+        RPointerArray<MCCPDTMFObserver> iObservers;
+        
+        /**
+        * ETel phone handle for DTMF functionality.
+        */
+        RMobilePhone& iPhone;
+        
+        /**
+        * Monitor for DTMF events and changes.
+        * Own.
+        */
+        CSPEtelDtmfMonitor* iMonitor;
+
+        /**
+        * Monitor for DTMF stopping.
+        * Own.
+        */
+        CSPEtelDtmfStopMonitor* iStopMonitor;
+        
+        /**
+        * Custom API reference.
+        */
+        RMmCustomAPI& iMmCustom;
+        
+    };
+    
+#endif // CSPDTMFPROVIDER
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelcallcapsmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelCallCapsMonitor
+*
+*/
+
+
+#ifndef CSPETELCALLCAPSMONITOR_H
+#define CSPETELCALLCAPSMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+
+class MCSPCallObserver;
+
+
+/**
+* Monitors single ETel RMobileCall for call capss.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPEtelCallCapsMonitor: public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aObserver the observer for getting notification
+        * @param aCall the line to monitor
+        */
+        static CSPEtelCallCapsMonitor* NewL( 
+                MCSPCallObserver& aObserver,
+                RMobileCall& aCall );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelCallCapsMonitor( );
+
+        /**
+        * Start monitoring call capss
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+        
+        /**
+         * Fetches call control caps.
+         * @return call control caps flags.
+         */
+        TUint32 FetchCallControlCapsL();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change (incoming call)
+        * @param aCall the line associated with the call
+        */
+        CSPEtelCallCapsMonitor( MCSPCallObserver& aObserver,
+                            RMobileCall& aCall );
+                                          
+        /**
+        * Constructs the monitor in the second phase.
+        */
+        void ConstructL();
+
+        
+    private: // data
+        /**
+        * Forwards caps change.
+        */
+        MCSPCallObserver& iObserver;
+       
+        /**
+        * Call that is being observed.
+        */
+        RMobileCall& iCall;
+        
+        /**
+        * Call capabilities.
+        */
+        RMobileCall::TMobileCallCapsV1 iCaps;
+        RMobileCall::TMobileCallCapsV1Pckg iCapsPckg;
+      
+
+        
+    };
+
+#endif // CSPETELCALLCAPSMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelcalleventmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitors call events from ETel
+*
+*/
+
+
+#ifndef CSPETELCALLEVENTMONITOR_H
+#define CSPETELCALLEVENTMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+class CSPCall;
+class MCCPCallObserver;
+class MCSPCallObserver;
+
+class CSPEtelCallEventMonitor
+        : public CActive
+    {
+    public: //Constructors and descructor
+
+        /**
+        * Two-phased constructing for the monitor.
+        * @param aObserver the observer for events
+        * @param aCall actual object of the monitoring
+        */
+        static CSPEtelCallEventMonitor* NewL( MCSPCallObserver& aObserver,
+                                              RMobileCall& aCall );
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelCallEventMonitor( );
+        
+        /**
+        * Start monitoring call events
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+
+        /**
+        * From CActive
+        * RunL
+        */
+        void RunL();
+
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+        
+    private:
+    
+        /**
+        * C++ constructor for the monitor.
+        * @param aObserver observers events
+        * @param aCall actual object of the monitoring
+        */
+        CSPEtelCallEventMonitor( MCSPCallObserver& aObserver, 
+                                 RMobileCall& aCall );
+        
+        
+    private: // data
+    
+        /**
+        * Observer for call events.
+        */
+        MCSPCallObserver& iObserver;
+        
+        /**
+        * ETel call which this monitors
+        */
+        RMobileCall& iCall;
+        
+        /**
+        * Pointer for recovering from a situation where CCE releases call 
+        * during observer-call sequence.
+        */
+        TBool* iDestrPtr;
+
+
+    protected:
+        /**
+        * Call event
+        */
+        RMobileCall::TMobileCallEvent iCallEvent;
+
+    };
+
+#endif // CSPETELCALLEVENTMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelcallrequester.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Delivers asynchronous requests to ETel
+*
+*/
+
+
+#ifndef CSPETELCALLREQUESTER_H
+#define CSPETELCALLREQUESTER_H
+
+
+#include <e32base.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
+#include <ccpdefs.h>
+
+class MCSPCallErrorObserver;
+
+/**
+* Makes asynchronic request to ETel interface according to given request type.
+* Provides canceling via CActive::Cancel().
+* 
+*/
+class CSPEtelCallRequester
+        : public CActive
+    {
+        
+    public:
+        /**
+        * Supported request types.
+        */
+        enum TRequestType {
+            ERequestTypeNone,
+            ERequestTypeDial,
+            ERequestTypeAnswer,
+            ERequestTypeHangup,
+            ERequestTypeHold,
+            ERequestTypeResume,
+            ERequestTypeGoOneToOne,
+            ERequestTypeSwap,
+            ERequestTypeDialEmergency
+            };
+        
+        /**
+        * Constructs the requester via two phase.
+        *
+        * @param aObserver the observer for request errors
+        * @param aCall ETel RMobileCall reference that is the object
+        * of the request.
+        */
+        static CSPEtelCallRequester* NewL( MCSPCallErrorObserver& aObserver, 
+                                           RMobileCall& aCall );
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelCallRequester( );
+        
+        /**
+        * Makes the request. Note that ERequestTypeDial is made with a 
+        * separate MakeDialRequest function.
+        *
+        * @since S60 3.2
+        * @param aRequest type of request
+        * @return KErrNone if request was sent successfully.
+        *         KErrNotSupported if the given request is not supported
+        *         KErrArgument if the specified request is not known.
+        *         KErrUnknown if unspecified error (should not happen)
+        */
+        TInt MakeRequest( TRequestType aRequest );
+        
+        /**
+        * Cancels the request. 
+        *
+        * @since S60 3.2
+        * @param aRequest type of request
+        * @return KErrNone if request was sent successfully.
+        *         KErrNotSupported if the given request is not supported
+        *         KErrArgument if the specified request is not known.
+        *         KErrUnknown if unspecified error (should not happen)
+        */
+        TInt CancelRequest( TRequestType aRequest );
+     
+
+        /**
+        * Makes a dial request.
+        * @since S60 3.2
+        * @param aCallParamsPckg call parametrs
+        * @param aRemoteParty phone number
+        * @return KErrNone if successful, else error code
+        */         
+        TInt MakeDialRequest( 
+            const TDesC8& aCallParams, 
+            TDesC& aRemoteParty );
+
+        /**
+        * Makes a dial request without FDN check.
+        * @since S60 3.2
+        * @param aCallParamsPckg call parametrs
+        * @param aRemoteParty phone number
+        * @return KErrNone if successful, else error code
+        */         
+        TInt MakeDialNoFdnCheckRequest( 
+            const TDesC8& aCallParams, 
+            TDesC& aRemoteParty );
+            
+        
+        /**
+        * Makes a answer request.
+        * @since S60 3.2
+        * @param aCallParams call parametrs
+        * @return KErrNone if successful, else error code
+        */         
+        TInt MakeAnswerRequest( 
+            const TDesC8& aCallParams );
+
+        /**
+        * Makes emergency request.
+        * @param aRecipient emengency number
+        * @return error code
+        */
+        TInt MakeDialEmergencyRequest( 
+            const RMobileENStore::TEmergencyNumber& aRecipient );
+            
+        /**
+        * Mapping between ETel and CCP errors.
+        * @param aErrorCode ETel error code
+        * @return CCP error code
+        */ 
+        TCCPError MapError( TInt aErrorCode );
+        
+        /**
+        * Getter for the active request.
+        * @return request.
+        */
+        TRequestType Request();
+    
+        /**
+        * Cancel dial (applies both emergency and normal calls)
+        * @return result of cancel (system wide error code)
+        */
+        TInt CSPEtelCallRequester::DialCancel();
+        
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+        
+    private:
+    
+        /**
+        * Constructs the requester.
+        *
+        * @param aObserver the observer for request errors
+        * @param aCall ETel RMobileCall reference that is the object
+        * of the request.
+        */
+        CSPEtelCallRequester( MCSPCallErrorObserver& aObserver, 
+                              RMobileCall& aCall );
+        
+        
+    private: // data
+        /**
+        * Observer for request errors.
+        */
+        MCSPCallErrorObserver& iObserver;
+        
+        /**
+        * ETel call which this monitors
+        */
+        RMobileCall& iCall;
+        
+        /**
+        * Type of request.
+        */
+        TRequestType iRequestType;
+
+    };
+
+#endif // CSPETELCALLREQUESTER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelcallstatusmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitors call status changes from ETel
+*
+*/
+
+
+#ifndef CSPETELCALLSTATUSMONITOR_H
+#define CSPETELCALLSTATUSMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+class MCSPCallObserver;
+
+
+NONSHARABLE_CLASS(CSPEtelCallStatusMonitor) : public CActive
+    {
+    public: //Constructors and descructor
+    
+        /**
+        * Two-phased constructing for the monitor.
+        * @param aObserver observer for call status changes
+        * @param aCall actual object of the monitoring
+        */
+        static CSPEtelCallStatusMonitor* NewL( MCSPCallObserver& aObserver, 
+                                               RMobileCall& aCall );
+        
+        /**
+        * Destructor of the monitor which cancels ongoing monitoring.
+        */
+        virtual ~CSPEtelCallStatusMonitor( );
+        
+        /**
+        * Start monitoring call events
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+        
+        /**
+        * State of call.
+        * @return ETel state
+        */
+        RMobileCall::TMobileCallStatus State();
+        
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+        
+    private:
+    
+        /**
+        * C++ constructor for the monitor.
+        * @param aObserver observer for status changes
+        * @param aCall actual object of the monitoring
+        */
+        CSPEtelCallStatusMonitor( MCSPCallObserver& aObserver, RMobileCall& aCall );
+        
+    private: // data
+        /**
+        * Observer for state changes.
+        */
+        MCSPCallObserver& iObserver;
+        
+        /**
+        * ETel call which this monitors
+        */
+        RMobileCall& iCall;
+        
+        /**
+        * Pointer for recovering from a situation where CCE releases call 
+        * during observer-call sequence.
+        */
+        TBool* iDestrPtr;
+
+    protected:
+        /**
+        * ETel call status
+        */
+        RMobileCall::TMobileCallStatus iCallStatus;
+
+    };
+
+#endif // CSPETELCALLSTATUSMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelcallwaitingrequester.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Fetches call waiting status from ETel
+*
+*/
+
+
+#ifndef CSPETELCALLWAITINGREQUESTER_H
+#define CSPETELCALLWAITINGREQUESTER_H
+
+
+#include <e32base.h>
+#include <mccpcscall.h>
+#include <mccecall.h>
+#include <etelmm.h>
+
+class RMobilePhone;
+class CRetrieveMobilePhoneCWList;
+
+/**
+* Makes asynchronic request to ETel interface according to given request type.
+* Provides canceling via CActive::Cancel().
+* 
+*/
+class CSPEtelCallWaitingRequester
+        : public CActive
+    {
+        
+    public:
+        
+        /**
+        * Constructs the requester via two phase.
+        *
+        * @param aPhone mobile phone reference needed for reading cw setting
+        * @return requester object
+        */
+        static CSPEtelCallWaitingRequester* NewL( RMobilePhone& aPhone );
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelCallWaitingRequester( );
+        
+        /**
+        * Makes the request. Note that ERequestTypeDial is made with a 
+        * separate MakeDialRequest function.
+        *
+        * @since S60 3.2
+        * @param aRequest type of request
+        * @return ETrue if active, EFalse if not
+        */
+        void GetCallWaitingL( const CCCECallParameters& iParams,
+                              TBool& aCallWaitingStatus );
+        
+
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+
+    private:
+    
+        /**
+        * Requester can be inactive (from boot to first Cw request),
+        * requesting value from network 
+        *       (with first MT call that gets Queue-request from CCE),
+        * or monitoring (after first request).
+        */        
+        enum ECSPCwRequesterMode {
+            ECwRequesterInactive,
+            ECwRequesterGetStarted,
+            ECwRequesterMonitoring
+        };
+        
+    private:
+    
+        /**
+        * Constructor.
+        * @param aPhone mobile phone reference needed for reading cw setting
+        *
+        */
+        CSPEtelCallWaitingRequester::CSPEtelCallWaitingRequester(RMobilePhone& aPhone);
+                              
+        /**
+        * Constructs the requester.
+        *
+        * @param aPhone phone reference
+        */
+        void CSPEtelCallWaitingRequester::ConstructL();
+        
+        /**
+        * Starts monitoring call waiting setting.
+        */
+        void StartMonitoring();
+        
+        /**
+        * Returns the call waiting status from call waiting status list by linetype.
+        */
+        void GetCallWaitingStatusByLineType( const CCCECallParameters& iParams,
+                                             TBool& aCallWaitingStatus );
+        
+        
+    private: // data
+        
+        /**
+        * List of call waiting settings.
+        * Own.
+        */        
+        CRetrieveMobilePhoneCWList* iList;
+        
+        /**
+        * Making the asynchronous request synchronous.
+        */ 
+        CActiveSchedulerWait iWait;
+        
+        /**
+        * Phone handle for listening cw status changes.
+        */
+        RMobilePhone& iPhone;
+        
+        /**
+        * Cw status descriptor for reading changed cw status.
+        */
+        TPckgBuf<RMobilePhone::TMobilePhoneCWInfoEntryV1> iDesCwStatus;
+        
+        /**
+        * Current mode according to the enumeration.
+        */
+        ECSPCwRequesterMode iMode;
+        
+        /**
+        * Actual call waiting status for primary line: On/Off = True/False.
+        */
+        TBool iPrimaryLineCwStatus;
+        
+        /**
+        * Actual call waiting status for aux line: On/Off = True/False.
+        */
+        TBool iAuxLineCwStatus;
+    };
+
+#endif // CSPETELCALLWAITINGREQUESTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelconferencecallrequester.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Delivers asynchronous requests to ETel
+*
+*/
+
+
+#ifndef CSPETELCONFERENCECALLREQUESTER_H
+#define CSPETELCONFERENCECALLREQUESTER_H
+
+
+#include <e32base.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
+
+class CSPCall;
+class MCCPCallObserver;
+class CSPConferenceCall;
+
+/**
+* Makes asynchronic request to ETel interface according to given request type.
+* Provides canceling via CActive::Cancel().
+* 
+*/
+class CSPEtelConferenceCallRequester
+        : public CActive
+    {
+        
+    public:
+        /**
+        * Supported request types.
+        */
+        enum TConferenceRequestType {
+            EConferenceRequestTypeAddCall,
+            EConferenceRequestTypeHangup,
+            EConferenceRequestTypeHold,
+            EConferenceRequestTypeResume,
+            EConferenceRequestTypeCreateConference,
+            EConferenceRequestTypeSwap
+            };
+        
+        /**
+        * Constructs the requester via two phase.
+        *
+        * @param aOwner the owner for the requester
+        * @param aCall ETel RMobileCall reference that is the object
+        * of the request.
+        */
+        static CSPEtelConferenceCallRequester* NewL( 
+                                           CSPConferenceCall& aOwner, 
+                                           RMobileConferenceCall& aCall );
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelConferenceCallRequester( );
+        
+        /**
+        * Makes the request. Note that ERequestTypeDial is made with a 
+        * separate MakeDialRequest function.
+        *
+        * @since S60 3.2
+        * @param aRequest type of request
+        * @return KErrNone if request was sent successfully.
+        *         KErrNotSupported if the given request is not supported
+        *         KErrArgument if the specified request is not known.
+        *         KErrUnknown if unspecified error (should not happen)
+        */
+        TInt MakeRequest( TConferenceRequestType aRequest );
+     
+
+        /**
+        * Makes a dial request.
+        * @since S60 3.2
+        * @param aCallName call name to be added
+        * @return KErrNone if successful, else error code
+        */         
+        TInt MakeAddCallRequest( const TName& aCallName );
+
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+        
+    private:
+    
+        /**
+        * Constructs the requester.
+        *
+        * @param aOwner the owner for the requester
+        * @param aCall ETel RMobileCall reference that is the object
+        * of the request.
+        */
+        CSPEtelConferenceCallRequester( CSPConferenceCall& aOwner, 
+                                        RMobileConferenceCall& aCall );
+        
+        /**
+        * Constructing in the second phase.
+        */
+        void ConstructL();
+        
+    private: // data
+        /**
+        * Call object which owns this monitor
+        */
+        CSPConferenceCall& iOwner;
+        
+        /**
+        * ETel call which this monitors
+        */
+        RMobileConferenceCall& iCall;
+        
+        /**
+        * Type of request.
+        */
+        TConferenceRequestType iRequestType;
+
+    };
+
+#endif // CSPETELCONFERENCECALLREQUESTER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelconferencecapsmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelConferenceCapsMonitor
+*
+*/
+
+
+#ifndef CSPETELCONFERENCECAPSMONITOR_H
+#define CSPETELCONFERENCECAPSMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+
+class CSPConferenceCall;
+
+
+/**
+* Monitors single ETel RMobileConferenceCall for conference call capss.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPEtelConferenceCapsMonitor: public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aOwner the observer for getting notification
+        * @param aCall the line to monitor
+        */
+        static CSPEtelConferenceCapsMonitor* NewL( 
+                CSPConferenceCall& aOwner,
+                RMobileConferenceCall& aCall );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelConferenceCapsMonitor( );
+
+        /**
+        * Start monitoring call capss
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        /**
+        * C++ default constructor
+        * @param aOwner the observer for status change (incoming call)
+        * @param aCall the line associated with the call
+        */
+        CSPEtelConferenceCapsMonitor( CSPConferenceCall& aOwner,
+                            RMobileConferenceCall& aCall );
+                                          
+        /**
+        * Constructs the monitor in the second phase.
+        */
+        void ConstructL();
+
+        
+    private: // data
+        /**
+        * Forwards capss.
+        */
+        CSPConferenceCall& iOwner;
+       
+        /**
+        * Conference call that is being observed.
+        */
+        RMobileConferenceCall& iCall;
+        
+        /**
+        * Caps received.
+        */ 
+        TUint32 iCaps;
+        
+        /**
+        * Pointer for recovering from a situation where CCE releases call 
+        * during observer-call sequence.
+        */
+        TBool* iDestrPtr;
+
+        
+    };
+
+#endif // CSPETELCONFERENCECAPSMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelconferenceeventmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelConferenceEventMonitor
+*
+*/
+
+
+#ifndef CSPETELCONFERENCEEVENTMONITOR_H
+#define CSPETELCONFERENCEEVENTMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+
+class CSPCall;
+class CSPConferenceCall;
+
+
+/**
+* Monitors single ETel RMobileConferenceCall for conference call events.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPEtelConferenceEventMonitor: public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aOwner the observer for getting notification
+        * @param aPhone the line to monitor
+        */
+        static CSPEtelConferenceEventMonitor* NewL( 
+                CSPConferenceCall& aOwner,
+                RMobileConferenceCall& aPhone );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelConferenceEventMonitor( );
+
+        /**
+        * Start monitoring call events
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        /**
+        * C++ default constructor
+        * @param aOwner the observer for status change (incoming call)
+        * @param aPhone the line associated with the call
+        */
+        CSPEtelConferenceEventMonitor( CSPConferenceCall& aOwner,
+                            RMobileConferenceCall& aPhone );
+                                          
+        /**
+        * Constructs the monitor in the second phase.
+        */
+        void ConstructL();
+
+        
+    private: // data
+        /**
+        * Forwards events.
+        */
+        CSPConferenceCall& iOwner;
+       
+        /**
+        * Phone that is being observed for incoming call.
+        */
+        RMobileConferenceCall& iCall;
+        
+        /**
+        * Event received.
+        */ 
+        RMobileConferenceCall::TMobileConferenceEvent iEvent;
+        
+        /**
+        * The call name related to the event.
+        */
+        TName iCallName;
+        
+        /**
+        * Pointer for recovering from a situation where CCE releases call 
+        * during observer-call sequence.
+        */
+        TBool* iDestrPtr;
+        
+    };
+
+#endif // CSPETELCONFERENCEEVENTMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelconferencestatusmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelConferenceStatusMonitor
+*
+*/
+
+
+#ifndef CSPETELCONFERENCECALLSTATUSMONITOR_H
+#define CSPETELCONFERENCECALLSTATUSMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+
+class MCSPConferenceStatusObserver; 
+
+/**
+* Monitors single ETel RMobileConferenceCall for conference call statuss.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+NONSHARABLE_CLASS(CSPEtelConferenceStatusMonitor): public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aObserver the observer for getting notification
+        * @param aPhone the line to monitor
+        */
+        static CSPEtelConferenceStatusMonitor* NewL( 
+                MCSPConferenceStatusObserver& aObserver,
+                RMobileConferenceCall& aPhone );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelConferenceStatusMonitor( );
+
+        /**
+        * Start monitoring call statuss
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change (incoming call)
+        * @param aPhone the line associated with the call
+        */
+        CSPEtelConferenceStatusMonitor( MCSPConferenceStatusObserver& aObserver,
+                            RMobileConferenceCall& aPhone );
+                                          
+        /**
+        * Constructs the monitor in the second phase.
+        */
+        void ConstructL();
+
+        
+    private: // data
+        /**
+        * Owner.
+        */
+        MCSPConferenceStatusObserver& iOwner;
+       
+        /**
+        * Phone that is being observed for incoming call.
+        */
+        RMobileConferenceCall& iCall;
+        
+        /**
+        * Status received.
+        */ 
+        RMobileConferenceCall::TMobileConferenceStatus iConferenceStatus;
+                
+        /**
+        * Pointer for recovering from a situation where CCE releases call 
+        * during observer-call sequence.
+        */
+        TBool* iDestrPtr;
+        
+    };
+
+#endif // CSPETELCONFERENCECALLSTATUSMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspeteldtmfmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelDtmfMonitor
+*
+*/
+
+
+#ifndef CSPETELDTMFMONITOR_H
+#define CSPETELDTMFMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
+
+
+class CSPCall;
+class CSPDTMFProvider;
+
+
+
+/**
+* Monitors ETel for DTMF events.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPEtelDtmfMonitor: public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aObserver the observer for getting notification
+        * @param aMmCustom Custom API handle
+        */
+        static CSPEtelDtmfMonitor* NewL( 
+                CSPDTMFProvider& aObserver,
+                RMmCustomAPI& aMmCustom );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelDtmfMonitor( );
+
+        /**
+        * Start monitoring call events
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change (incoming call)
+        * @param aMmCustom Custom API handle
+        */
+        CSPEtelDtmfMonitor( CSPDTMFProvider& aObserver,
+                            RMmCustomAPI& aMmCustom );
+                                          
+    private: // data
+        /**
+        * Forwards events.
+        */
+        CSPDTMFProvider& iObserver;
+       
+        /**
+        * Event data. Updated when event occurs.
+        */
+        RMmCustomAPI::TDtmfInfo      iEventData;
+        
+        /**
+        * Custom API reference.
+        */
+        RMmCustomAPI& iMmCustom;
+        
+    };
+    
+#endif // CSPETELDTMFMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspeteldtmfstopmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelDtmfStopMonitor
+*
+*/
+
+
+#ifndef CSPETELDTMFSTOPMONITOR_H
+#define CSPETELDTMFSTOPMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+
+class CSPCall;
+class CSPDTMFProvider;
+
+
+/**
+* Monitors single ETel RMobilePhone for DTMF events.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPEtelDtmfStopMonitor: public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aObserver the observer for getting notification
+        * @param aPhone the line to monitor
+        */
+        static CSPEtelDtmfStopMonitor* NewL( 
+                CSPDTMFProvider& aObserver,
+                RMobilePhone& aPhone );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelDtmfStopMonitor( );
+
+        /**
+        * Start monitoring call events
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change (incoming call)
+        * @param aPhone the line associated with the call
+        */
+        CSPEtelDtmfStopMonitor( CSPDTMFProvider& aObserver,
+                            RMobilePhone& aPhone );
+                                          
+        
+    private: // data
+        /**
+        * Forwards events.
+        */
+        CSPDTMFProvider& iObserver;
+       
+        /**
+        * Phone that is being observed for incoming call.
+        */
+        RMobilePhone& iPhone;
+        
+        /**
+        * Event received.
+        */ 
+        RMobilePhone::TMobilePhoneDTMFEvent iEventData;
+        
+    };
+    
+#endif // CSPETELDTMFSTOPMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelincomingcallmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelIncomingCallMonitor
+*
+*/
+
+
+#ifndef CSPETELINCOMINGCALLMONITOR_H
+#define CSPETELINCOMINGCALLMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+#include "mcspincomingcallobserver.h"
+#include "rcsplinecontainer.h"
+
+class CSPCall;
+class MCCPCallObserver;
+
+
+
+/**
+* Monitors single ETel RMobileLine for incoming calls.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPEtelIncomingCallMonitor: public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aObserver the observer for getting notification
+        * @param aLine the line to monitor
+        * @param aLineId line identifier
+        */
+        static CSPEtelIncomingCallMonitor* NewL( 
+                MCSPIncomingCallObserver& aObserver, 
+                RMobileLine& aLine,
+                RCSPLineContainer::TCSPLineId aLineId );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelIncomingCallMonitor( );
+
+        /**
+        * Start monitoring call events
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change (incoming call)
+        * @param aLine the line associated with the call
+        * @param aLineId line identifier
+        */
+        CSPEtelIncomingCallMonitor( MCSPIncomingCallObserver& aObserver,
+                                  RMobileLine& aLine,
+                                  RCSPLineContainer::TCSPLineId aLineId );
+        
+    private: // data
+        /**
+        * Forwards the incoming call information.
+        */
+        MCSPIncomingCallObserver& iIncomingCallObserver;
+
+        /**
+        * Incoming call name received from ETel.
+        */ 
+        TName iCallName;
+        
+        /**
+        * Line that is being observed for incoming call.
+        */
+        RMobileLine& iLine;
+        
+        /**
+        * Line identifier / type.
+        */
+        RCSPLineContainer::TCSPLineId iLineId;
+    };
+    
+#endif // CSPETELINCOMINGCALLMONITOR_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetellinestatusmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelLineStatusMonitor
+*
+*/
+
+
+#ifndef CSPETELLINESTATUSMONITOR_H_
+#define CSPETELLINESTATUSMONITOR_H_
+
+#include <e32base.h>
+#include <etelmm.h>
+#include "rcsplinecontainer.h"
+
+class MCSPLineStatusObserver;
+
+/**
+* Monitors single ETel RMobileLine for calls.
+*
+*  This monitor is applied only for listening line status changes 
+*
+*  @lib csplugin.dll
+*  @since S60 5.0
+*/
+NONSHARABLE_CLASS(CSPEtelLineStatusMonitor): public CActive
+    {
+    
+    public: //Constructors and descructor    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aObserver the observer for getting notification
+        * @param aLine the line to monitor
+        * @param aLineId line identifier
+        */
+        static CSPEtelLineStatusMonitor* NewL( 
+                MCSPLineStatusObserver& aObserver,
+                RMobileLine& aLine,
+                RCSPLineContainer::TCSPLineId aLineId );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelLineStatusMonitor( );
+
+        /**
+        * Start monitoring call events
+        * @since S60 5.0
+        */
+        void StartMonitoring();
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 5.0 
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 5.0 
+        */
+        void DoCancel();
+
+    private:
+        
+        /**
+        * C++ default constructor
+        * @param aObserver the observer for status change
+        * @param aLine the line associated with the call
+        * @param aLineId line identifier
+        */
+        CSPEtelLineStatusMonitor( MCSPLineStatusObserver& aObserver, 
+                                 RMobileLine& aLine,
+                                 RCSPLineContainer::TCSPLineId aLineId );
+                                                  
+    private: // data
+
+        /**
+        * Line status from ETel.
+        */         
+        RMobileCall::TMobileCallStatus iLineStatus; 
+        
+        /**
+        * Line that is being observed for status changes.
+        */
+        RMobileLine& iLine;
+        
+        /**
+        * Line identifier / type.
+        */
+        RCSPLineContainer::TCSPLineId iLineId;
+        
+        /**
+        * Line status notifications observer.
+        */
+        MCSPLineStatusObserver& iObserver;
+        
+    };
+
+#endif /*CSPETELLINESTATUSMONITOR_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspetelvideocallcapsmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CSPEtelCallCapsMonitor
+*
+*/
+
+
+#ifndef CSPETELDATACALLCAPSMONITOR_H
+#define CSPETELDATACALLCAPSMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+
+class CSPVideoCall;
+
+
+/**
+* Monitors single ETel RMobileCall for call capss.
+*
+*  This monitor is applied only for listening incoming calls, i.e.
+*  line capabilites are not monitored.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPEtelVideoCallCapsMonitor: public CActive
+    {
+    
+    public: //Constructors and descructor
+    
+    
+        /**
+        * Two-phased constructing for the monitor.
+        *
+        * @param aOwner the observer for getting notification
+        * @param aCall the line to monitor
+        */
+        static CSPEtelVideoCallCapsMonitor* NewL( 
+                CSPVideoCall& aOwner,
+                RMobileCall& aCall );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPEtelVideoCallCapsMonitor( );
+
+        /**
+        * Start monitoring call capss
+        * @since S60 3.2
+        */
+        void StartMonitoring();
+        
+        /**
+        * Getter for fetching mobile data call caps.
+        */
+        TInt GetMobileDataCallCaps( TDes8& aCaps ) const;
+        
+        /**
+        * Gets protocol caps.
+        * @return protocol caps 
+        */ 
+        TUint GetProtocolCaps();
+    
+        /**
+        * Updates protocol caps for call
+        * @since S60 5.0
+        */ 
+        void UpdateProtocolCaps(); 
+    
+    protected: // From CActive
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+               
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+
+    private:
+        /**
+        * C++ default constructor
+        * @param aOwner the observer for status change (incoming call)
+        * @param aCall the line associated with the call
+        */
+        CSPEtelVideoCallCapsMonitor( CSPVideoCall& aOwner,
+                            RMobileCall& aCall );
+                                          
+        /**
+        * Constructs the monitor in the second phase.
+        */
+        void ConstructL();
+
+        
+    private: // data
+        /**
+        * Forwards capss.
+        */
+        CSPVideoCall& iOwner;
+       
+        /**
+        * Call that is being observed.
+        */
+        RMobileCall& iCall;
+        
+        /**
+        * Call capabilities.
+        */
+        RMobileCall::TMobileCallDataCapsV1 iDataCallCaps;
+        RMobileCall::TMobileCallDataCapsV1Pckg iDataCallCapsPckg;
+              
+    };
+    
+#endif // CSPETELDATACALLCAPSMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspforwardprovider.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header of CSPForwardProvider which provides methods and
+*                functionality to handle call forwarding
+*
+*/
+
+
+#ifndef CSPFORWARDPROVIDER_H
+#define CSPFORWARDPROVIDER_H
+
+#include <e32base.h>
+#include <mccpforwardprovider.h>
+#include <mccpforwardobserver.h>
+
+/**
+* Call forward methods.
+* MCCPCallObserver is used for errors, statuses, notifications etc
+*
+*  @since S60 3.2
+*/
+class CSPForwardProvider : public CBase,
+                           public MCCPForwardProvider
+    {
+    
+    public:
+        /**
+        * Two phased constructing of the forward provider instance.
+        * @return the Forward provider instance
+        */
+        static CSPForwardProvider* NewL();
+
+        /** 
+        * Destructs the forward provider.
+        * @since S60 3.2
+        */
+        virtual ~CSPForwardProvider();
+        
+        /**
+        * Updates the call event for observers.
+        * @param aEvent the event to be notified
+        */
+        void NotifyForwardEventOccurred( 
+                        MCCPForwardObserver::TCCPForwardEvent aEvent );
+        
+// from base class MCCPForwardProvider
+        
+        /**
+        * Returns pointer to array containing addresses to forward the call to.
+        * Index zero contains the first address. If there are no addresses available
+        * returns an empty array.
+        * @return Reference to array containing addresses
+        * @leave KErrNotReady call is not in forwarding state
+        * @leave KErrNotSupported if call is not mobile originated
+        * @leave system error code 
+        * @pre Call state is MCCPCallObserver::ECCPStateForwarding and call type is MO
+        * @pre Call MCCPForwardObserver::ECCPMultipleChoices event is received
+        */
+        virtual const CDesC8Array& GetForwardAddressChoicesL();
+    
+        /**
+        * Forward call to address at given index.
+        * @param aIndex Index of address where the call is to be forwarded. Address is 
+        * found in the array received from GetForwardAddressChoicesL. Index starts from zero.
+        * @leave KErrArgument Index is not in array
+        * @leave KErrNotReady Call is not in forwarding state
+        * @leave KErrNotSupported If call is not mobile originated
+        * @pre Call state is MCCPCallObserver::ECCPStateForwarding and call type is MO
+        * @pre Call MCCPForwardObserver::ECCPMultipleChoices event is received
+        */
+        virtual void ForwardToAddressL( const TInt aIndex );
+        
+        /**
+        * Add an observer for forward related events.
+        * Currently CCE will set only one observer.
+        * @since S60 v3.2
+        * @param aObserver Observer
+        * @leave system error if observer adding fails
+        */
+        virtual void AddObserverL( const MCCPForwardObserver& aObserver );
+    
+        /**
+        * Remove an observer.
+        * @since S60 v3.2
+        * @param aObserver Observer
+        * @return KErrNone if removed succesfully. 
+        * @return KErrNotFound if observer was not found.
+        */
+        virtual TInt RemoveObserver( const MCCPForwardObserver& aObserver );
+
+    private:
+        
+        /**
+        * Constructs the provider
+        *
+        */
+        CSPForwardProvider( );
+
+        /**
+        * Constructing 2nd phase.
+        */
+        void ConstructL();
+        
+    private: // data
+
+        /**
+        * DTMF event observer.
+        */
+        RPointerArray<MCCPForwardObserver> iObservers;
+        
+        CDesC8Array* iEmptyArray;
+            
+
+};
+
+#endif CSPFORWARDPROVIDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/csplogger.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,220 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Provides macros for logging
+*
+*/
+
+
+
+#ifndef __CSPLOGGER_H__
+#define __CSPLOGGER_H__
+
+//  INCLUDES
+#include <e32def.h>
+
+/* 
+-----------------------------------------------------------------------------
+
+    USER LOG SELECTION
+
+-----------------------------------------------------------------------------
+*/
+
+inline TUint CSPLOGMASK()
+    {
+    return 0x8fffffff;          // This is default mask value.    
+    }                           // User can change mask value to get different king of logging.
+
+#ifndef _DEBUG
+
+/***************************
+* Logging method variants:
+* 0 = No logging
+* 1 = Flogger
+* 2 = RDebug
+***************************/ 
+
+#define CSP_LOGGING_METHOD      0   // UREL BUILD
+
+#else
+
+#ifdef __WINS__
+#define CSP_LOGGING_METHOD      2   // UDEB BUILD, WINS
+#else
+#define CSP_LOGGING_METHOD      2   // UDEB BUILD, HW
+#endif // __WINS__
+
+#endif // _DEBUG
+
+
+// Next is for backward compatibility
+#if CSP_LOGGING_METHOD > 0
+#define CSP_LOGGING_ENABLED     
+#define TF_LOGGING_ENABLED
+#endif
+
+
+/* 
+-----------------------------------------------------------------------------
+
+    LOGGING OPTIONS
+
+-----------------------------------------------------------------------------
+*/
+
+#define CSPOBJECT  0x00000001   // Construction and destruction
+
+#define CSPERROR   0x00000002   // Error that can be handled. Describe reason for error situation.
+#define CSPPANIC   0x00000004   // Critical error: Panic.
+
+
+#define CSPREQIN   0x00000040   // Public interface methods
+#define CSPREQOUT  0x00000080   // Set outgoing request
+#define CSPREQEND  0x00000100   // Complete request
+
+#define CSPINT     0x00000200   // Internal activity
+
+#define CSPMSTATE  0x00000400   // Component state changes
+
+#define CSPGENERAL 0x00000800   // For deprecated TFLOGxxx-macros and for temporary usage
+
+
+/* 
+-----------------------------------------------------------------------------
+
+    LOG SETTINGS
+
+-----------------------------------------------------------------------------
+*/
+
+#if CSP_LOGGING_METHOD == 1      // Flogger
+
+#include <flogger.h>
+_LIT(KTfLogFolder,"CSP");
+_LIT(KTfLogFile,"CSPLOG.TXT");
+
+#elif CSP_LOGGING_METHOD == 2    // RDebug
+
+#include <e32svr.h>
+
+#endif
+
+
+/*
+-----------------------------------------------------------------------------
+
+    LOGGING MACROs
+
+    USE THESE MACROS IN YOUR CODE !
+
+-----------------------------------------------------------------------------
+*/
+#define MESSAGE(A)                        _L(A)
+
+#if CSP_LOGGING_METHOD == 1      // Flogger
+
+#define CSPLOGTEXT(Type,AAA)            { \
+                                        if((CSPLOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            RFileLogger::Write(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend, AAA); \
+                                            } \
+                                        }
+#define CSPLOGSTRING(Type,AAA)          { \
+                                        if((CSPLOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            _LIT(tempLogDes,AAA); \
+                                            RFileLogger::Write(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend,tempLogDes()); \
+                                            } \
+                                        }
+#define CSPLOGSTRING2(Type,AAA,BBB)     { \
+                                        if((CSPLOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            _LIT(tempLogDes,AAA); \
+                                            RFileLogger::WriteFormat(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend, \
+                                            TRefByValue<const TDesC>(tempLogDes()),BBB); \
+                                            } \
+                                        }
+#define CSPLOGSTRING3(Type,AAA,BBB,CCC) { \
+                                        if((CSPLOGMASK()&(Type))==(Type)) \
+                                            { \
+                                            _LIT(tempLogDes,AAA); \
+                                            RFileLogger::WriteFormat(KTfLogFolder(),KTfLogFile(), \
+                                            EFileLoggingModeAppend, \
+                                            TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); \
+                                            } \
+                                        }
+#define CSPLOGSTRING4(Type,AAA,BBB,CCC,DDD) { \
+                                            if((CSPLOGMASK()&(Type))==(Type)) \
+                                                { \
+                                                _LIT(tempLogDes,AAA); \
+                                                RFileLogger::WriteFormat(KTfLogFolder(), \
+                                                KTfLogFile(),EFileLoggingModeAppend, \
+                                                TRefByValue<const TDesC>(tempLogDes()), \
+                                                BBB,CCC,DDD); \
+                                                } \
+                                            }
+
+#elif CSP_LOGGING_METHOD == 2    // RDebug
+
+#define CSPLOGTEXT(Type,AAA)                { \
+                                            if((CSPLOGMASK()&(Type))==(Type)) RDebug::Print(AAA); \
+                                            }
+#define CSPLOGSTRING(Type,AAA)              { \
+                                            if((CSPLOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA)); \
+                                            }
+#define CSPLOGSTRING2(Type,AAA,BBB)         { \
+                                            if((CSPLOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA),BBB); \
+                                            }
+#define CSPLOGSTRING3(Type,AAA,BBB,CCC)     { \
+                                            if((CSPLOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA),BBB,CCC); \
+                                            }
+#define CSPLOGSTRING4(Type,AAA,BBB,CCC,DDD) { \
+                                            if((CSPLOGMASK()&(Type))== \
+                                            (Type)) RDebug::Print(_L(AAA),BBB,CCC,DDD); \
+                                            }
+
+#else   // CSP_LOGGING_METHOD == 0 or invalid
+
+#define CSPLOGTEXT(Type,AAA)              // Example: TFLOGTEXT(CSPMESOUT, own_desc)
+#define CSPLOGSTRING(Type,AAA)            // Example: TFLOGSTRING(CSPMESIN, "Test")
+#define CSPLOGSTRING2(Type,AAA,BBB)       // Example: TFLOGSTRING(CSPMESINT, "Test %i", aValue)
+#define CSPLOGSTRING3(Type,AAA,BBB,CCC)   // Example: TFLOGSTRING(CSPMESOUT, "Test %i %i", aValue1, aValue2)
+#define CSPLOGSTRING4(Type,AAA,BBB,CCC,DDD)   // Example: TFLOGSTRING(CSPMESOUT, "Test %i %i %i", aValue1, aValue2, aValue3)
+
+#endif  // CSP_LOGGING_METHOD
+
+
+/*
+-----------------------------------------------------------------------------
+
+    DEPRECATED LOGGING MACROs
+
+    DON'T USE THESE MACROS IN YOUR CODE ANYMORE!
+
+-----------------------------------------------------------------------------
+*/
+
+#define TFLOGTEXT(AAA)              CSPLOGTEXT(CSPGENERAL,AAA);
+#define TFLOGSTRING(AAA)            CSPLOGSTRING(CSPGENERAL,AAA);
+#define TFLOGSTRING2(AAA,BBB)       CSPLOGSTRING2(CSPGENERAL,AAA,BBB);
+#define TFLOGSTRING3(AAA,BBB,CCC)   CSPLOGSTRING3(CSPGENERAL,AAA,BBB,CCC);
+#define TFLOGSTRING4(AAA,BBB,CCC,DDD)   CSPLOGSTRING4(CSPGENERAL,AAA,BBB,CCC,DDD);
+
+#endif  // CSPLOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/csppanic.pan	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains panic enumerations
+*
+*/
+
+
+#ifndef     CSPPANIC_PAN
+#define     CSPPANIC_PAN
+
+//  INCLUDES
+#include <e32def.h>
+#include <e32cmn.h>
+
+// CONSTANTS
+
+// CSPlugin panic text
+_LIT( KCSPPanic, "CSPlugin Panic!" );
+
+    enum TCSPPanic
+        {
+        ECSPPanicAccessingDataOnIncompleteRequest = 1,
+        ECSPPanicAllSettingsDataObjectsAlreadyInUse = 2,
+        ECSPPanicBadHandle = 3,
+        ECSPPanicCallDataNull = 4,
+        ECSPPanicCallIndexOutOfRange = 5,
+        ECSPPanicConferenceIndexOutOfRange = 6,
+        ECSPPanicDebugDangerousMove = 7,
+        ECSPPanicIllegalCommand = 8,
+        ECSPPanicIndexOutOfRange = 9,
+        ECSPPanicInvalidCommand = 10,
+        ECSPPanicInvalidHandle = 11,
+        ECSPPanicInvalidMode = 12,
+        ECSPPanicInvalidRequest = 13,
+        ECSPPanicInvalidRequestId = 14,
+        ECSPPanicInvalidState = 15,
+        ECSPPanicLineNotFound = 16,
+        ECSPPanicNoCallInState = 17,
+        ECSPPanicNoCallOrLine = 18,
+        ECSPPanicNoConferenceCall = 19,
+        ECSPPanicNoErrorCodeInSuccessfulRequest = 20,
+        ECSPPanicNoEtel = 21,
+        ECSPPanicNoFreeCalls = 22,
+        ECSPPanicNoObserver = 23,
+        ECSPPanicNoPhoneServer = 24,
+        ECSPPanicNoRepository = 25,
+        ECSPPanicNotCompleted = 26,
+        ECSPPanicNullPointer = 27,
+        ECSPPanicObserverAlreadySet = 28,
+        ECSPPanicRepositoryAlreadyActive = 29,
+        ECSPPanicPropertyAlreadyActive = 30,
+        ECSPPanicSplitWithoutConference = 31,
+        ECSPPanicUIHasBeenLeaved = 32,
+        ECSPPanicVideoLibraryNotFound = 33,
+        ECSPPanicInvalidIncomingCallMonitor = 34,
+        ECSPPanicInvalidCallAddedMonitor = 35,
+        ECSPPanicInvalidCallEventMonitor = 36,
+        ECSPPanicExternalDataIdOutOfRange = 37,
+        ECSPPanicCallIsAlreadyAddedToConference = 38,
+        ECSPPanicInvalidParameter = 39,
+        ECSPPanicDataConnectionInitError = 40,
+        ECSPPanicTimerAlreadyActive = 41,
+        
+        ECSPPanicMaximum = 100
+        };
+
+// MACROS
+// None.
+
+// DATA TYPES
+// None.
+
+// FUNCTION PROTOTYPES
+// None.
+
+// FORWARD DECLARATIONS
+// None.
+
+// CLASS DECLARATION
+// None.
+
+GLREF_C void Panic( TCSPPanic aPanic );
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/csppubsublistener.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class CCSPPubSubListener
+*
+*/
+
+
+#ifndef CSPPUBSUBLISTENER_H
+#define CSPPUBSUBLISTENER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class MCSPPubSubObserver;
+
+// CLASS DECLARATION
+
+/**
+*  RProperty poller.
+*
+*  @lib videoteleng.lib
+*  @since Series 60 2.8
+*/
+NONSHARABLE_CLASS( CSPPubSubListener ) : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        * @param aUid the Uid to use
+        * @param aKey item's key
+        * @param aObserver callback interface for notification
+        * @return instance of CSPPubSubListener
+        */
+        static CSPPubSubListener* NewL( const TUid aUid, const TInt aKey, 
+            MCSPPubSubObserver* aObserver );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSPPubSubListener();
+        
+    public: // New functions.
+
+        /**
+        * Gets integer value from P & S.
+        * @param aVal a value in return
+        * @return error code
+        */       
+        TInt Get( TInt& aVal );
+
+        /**
+        * Gets 8 bit string value from P&S.
+        * @param aVal a value in return
+        * @return error code
+        */
+        TInt Get( TDes8& aVal );
+        
+        /**
+        * Gets 16 bit descriptor value from P&S.
+        * @param aVal a value in return
+        * @return error code
+        */
+        TInt Get( TDes16& aVal );
+
+    private: // New functions.
+
+        /**
+        * Starts the listening (RunL).
+        */
+        void StartListening();
+
+    private: // From CActive.
+
+        /** @see CActive::RunL */
+        virtual void RunL();
+
+        /** @see CActive::Cancel */
+        virtual void DoCancel();
+
+        /** @see CActive::RunError */
+        virtual TInt RunError( TInt aError );
+
+    private:
+
+        /**
+        * Constructor of the listener.
+        * @param aUid the Uid to use
+        * @param aKey item's key
+        * @param aObserver callback interface for notification
+        */
+        CSPPubSubListener( const TUid aUid,  TInt aKey, 
+            MCSPPubSubObserver* aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+    
+    private:    // Data
+    
+        /** UID of the monitored item. */
+        TUid        iUid;
+        
+        /** ID of the monitored item. */
+        TInt        iId;
+        
+        /** Property to subscribe to. */
+        RProperty   iProperty;
+        
+        /** Observer for PS notifications. */
+        MCSPPubSubObserver* iObserver;
+    };
+
+#endif // CVTENGPUBSUBSGSETTINGS_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspremotealertingtonelistener.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Listens remote alerting tone status changes
+*
+*/
+
+
+#ifndef CSPREMOTEALERTINGTONELISTENER_H
+#define CSPREMOTEALERTINGTONELISTENER_H
+
+#include <e32base.h>
+#include <rmmcustomapi.h>
+
+class MCSPRemoteAlertingToneObserver;
+
+/**
+ *  Listens remote alerting tone changes.
+ *
+ *  @lib CSPlugin.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CSPRemoteAlertingToneListener ) : public CActive
+    {
+public:
+    
+    /**
+     * Two-phased constructor.
+     * @param aCustomAPI Connected custom API instance.
+     * @param aObserver Observer of the remote alerting tone chnages.
+     */
+    static CSPRemoteAlertingToneListener* NewL( 
+        RMmCustomAPI& aCustomAPI,
+        MCSPRemoteAlertingToneObserver& aObserver );
+    
+
+    /**
+    * Destructor.
+    */
+    virtual ~CSPRemoteAlertingToneListener();
+
+    /**
+     * Starts listening remote alerting tone changes. Observer is notified
+     * when change occurs. Listening stops when Cancel is called or listening
+     * instance is deleted.
+     *
+     * @since S60 v5.0
+     */
+    void StartListening();
+
+protected:
+
+// from base class CActive
+
+    void DoCancel();
+    
+    void RunL();
+    
+private:
+    
+    CSPRemoteAlertingToneListener( 
+        RMmCustomAPI& aCustomAPI,
+        MCSPRemoteAlertingToneObserver& aObserver );
+
+private: // data
+
+    /** 
+     * For listening changes in remote alerting tone status.
+     * Not own.
+     */
+    RMmCustomAPI& iCustomAPI;
+    
+    /**  
+     * Status of the remote alerting tone.
+     */
+    RMmCustomAPI::TRemoteAlertingToneStatus iRATStatus;
+    
+    /**
+     * Change observer.
+     */
+    MCSPRemoteAlertingToneObserver& iObserver;
+
+    };
+
+#endif // CSPREMOTEALERTINGTONELISTENER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/csprovider.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,601 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main class for CS Call Plug-in
+*
+*/
+
+
+
+#ifndef CSPROVIDER_H
+#define CSPROVIDER_H
+
+#include <e32base.h>
+#include <cconvergedcallprovider.h>
+#include <mccpcsobserver.h>
+#include <mccpdtmfprovider.h>
+#include <mccpcscall.h>
+#include <mccecall.h>
+
+#include "mcspincomingcallobserver.h"
+#include "mcspsecuritysettingobserver.h"
+#include "mcspcommoninfo.h"
+#include "mcsppubsubobserver.h"
+#include "mcspremotealertingtoneobserver.h"
+#include "mcspconferencestatusobserver.h"
+
+
+// FORWARD DECLARATIONS
+class CSPEtelIncomingCallMonitor;
+class CSPDTMFProvider;
+class CSPServiceSettingsHandler;
+class CSPEtelCallAddedMonitor;
+class CSPConferenceCall;
+class CSPCallArray;
+class CSPAudioHandler;
+class CSPEtelCallWaitingRequester;
+class CSPSupplementaryServicesMonitor;
+class MCCPSsObserver;
+class CSPCipheringStatusMonitor;
+class CSPSsSettingsHandler;
+class CSPCallAddedHandler;
+class CSPPubSubListener;
+class CSPCallCommandHandler;
+class CSPRemoteAlertingToneListener;
+class CSPEtelConferenceStatusMonitor; 
+
+/**
+* Main class for using CS Call Plug-in. Implements the CCP API.
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSProvider : public CConvergedCallProvider,
+                   public MCSPIncomingCallObserver,
+                   public MCSPCommonInfo,
+                   public MCSPSecuritySettingObserver,
+                   public MCSPPubSubObserver,
+                   public MCSPRemoteAlertingToneObserver, 
+                   public MCSPConferenceStatusObserver
+{
+    public:
+    
+        /**
+        * Two-phased constructor.
+        * @return new instance of the class
+        */    
+        static CSProvider* NewL();
+        
+        /**
+        * C++ default destructor
+        */        
+        virtual ~CSProvider();
+        
+        /**
+        * Notification of SS event.
+        * @param aSsTypeAndMode SS type and SS mode
+        * @param aSsInfo SS info
+        */ 
+        void NotifySsEvent( RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode,
+                            RMmCustomAPI::TSsInfo& aSsInfo );
+
+
+// from base class CConvergedCallProvider    
+
+        /**
+        * Initializes plug-in. All required parameters must be passed
+        * with this function in order to use services.
+        * Simplifies pluging construct removing need to pass parameters 
+        * to ECom interface
+        * @since S60 3.2
+        * @param aAppUID Application UID of Telephony application
+        * @param aObserver general observer
+        * @param aSsObserver observer for events related to supplementary 
+        *        services.
+        */
+        void InitializeL( const MCCPObserver& aObserver,
+                          const MCCPSsObserver& aSsObserver );
+
+        /**
+        * Creates a new call and checks secure status from profile.
+        * @since S60 3.2
+        * @param aServiceId service id
+        * @param aRemoteParty Recipients address/number
+        * @param aObserver Observer
+        * @return MCCPMoCall
+        */
+        MCCPCall* NewCallL( const CCCPCallParameters& aCallParameters,
+                            const TDesC& aRemoteParty, 
+                            const MCCPCallObserver& aObserver );
+
+
+        /**
+        * From CConvergedCallProvider
+        * Releases all bindings to call and deletes it. 
+        * This will be called by CCE to free all the resources reserved for the call.
+        * After this call CCE will not access the call object anymore and observer 
+        * for the class must not be used in plug-in.
+        * This operation must always succeed. If plug-in decides to pre-allocate the 
+        * call object it can choose to do so, but plug-in has to make sure call is 
+        * returned to the state it was before calling CConvergedCallProvider::NewCallL.
+        * @param aCalltoRemove Call to remove.
+        * @return KErrNone or KErrNotFound if removed call is not found.
+        * @pre None, can always be called.
+        * @post Plug-in must quarantee all resources for the call will be cleaned up. 
+        * and plug-in must not call observer after this call!
+        * @since S60 3.2
+        */
+        virtual TInt ReleaseCall( MCCPCall& aCalltoRemove );
+        
+        /**
+        * From CConvergedCallProvider
+        * Creates a new Emergency call and add user-agent header.
+        * @since S60 3.2
+        * @param aServiceId service id
+        * @param aAddress address of emergency call
+        * @param aObserver Observer
+        * @return MCCPEmergencyCall
+        */
+        MCCPEmergencyCall* NewEmergencyCallL( 
+                                          const TUint32 aServiceId,
+                                          const TDesC& aAddress,
+                                          const MCCPCallObserver& aObserver );
+
+        /**
+        * From CConvergedCallProvider.
+        * Releases all bindings to call and deletes it. 
+        * This must be called to free all the resources reserved for the call.
+        * After this call CCE must not be access the call object anymore and observer 
+        * for the class must not be used in plug-in.
+        * This operation mustways succeed. If plug-in decides to pre-allocate the 
+        * call object it can choose to do so, but client has to be sure call is 
+        * cleared from the plug-in and all resuorces are returned to the state before calling 
+        * CConvergedCallProvider::NewEmergencyCallL.
+        * @param aCalltoRemove Call to remove.
+        * @return KErrNone or KErrNotFound if removed call is not found.
+        * @pre None, can always be called.
+        * @post Plug-in must quarantee all resources for the call will be cleaned up. Call must not 
+        * be referenced anymore from CCE and plug-in must not call observer after this call!
+        * @since S60 3.2
+        */
+        TInt ReleaseEmergencyCall( MCCPEmergencyCall& aCalltoRemove );
+        
+        /**
+        * From CConvergedCallProvider
+        * Creates a new conference call.
+        * @since S60 3.2
+        * @param aServiceId service id
+        * @param aObserver Observer
+        * @return MCCPConferenceCall
+        */
+        MCCPConferenceCall* NewConferenceL( const TUint32 aServiceId, 
+                                  const MCCPConferenceCallObserver& aObserver );
+
+        /**
+        * From CConvergedCallProvider
+        * Releases all bindings to conference call. CCE will call this after receiving 
+        * MCCPConferenceCallObserver::ECCPConferenceIdle from plug-in or when it itself 
+        * wants to release the call. In normal sequence called from CCE after HangUp is completed.
+        * @param aCalltoRemove Call to remove.
+        * @return KErrNone or KErrNotFound if removed call is not found.
+        * @pre None, can always be called.
+        * @post Plug-in must quarantee all resources for the call will be cleaned up. Call must not 
+        * be referenced anymore from CCE and plug-in must not call observer after this call!
+        * @since S60 3.2
+        */
+        TInt ReleaseConferenceCall( MCCPConferenceCall& aCalltoRemove );
+
+        /**
+        * Returns Uid of plug-in which is on use.
+        * @since S60 3.2
+        * @return Uid of plug-in
+        */   
+        const TUid& Uid() const;
+
+        /**
+        * Get Plug-In capabilities
+        * @since S60 3.2
+        * @return caps
+        */
+        TUint32 Caps( ) const;
+
+        /**
+        * Get DTMF provider
+        * @since S60 3.2
+        * @return Pointer to MCCPDTMFProvider if succesfull,
+        *         NULL if not available
+        */
+        MCCPDTMFProvider* DTMFProviderL( const MCCPDTMFObserver& aObserver );
+
+        /**
+        * Get extension provider
+        * @since S60 3.2
+        * @return Pointer to MCCPExtensionProvider if succesfull,
+        *         NULL if not available
+        */
+        MCCPExtensionProvider* ExtensionProviderL( 
+                            const MCCPExtensionObserver& aObserver );
+                            
+        /**
+        * This method gets the lifetime of the MS. The lifetime information 
+        * includes the manufacturing date of the MS and the total amount of airtime use, 
+        * from the manufacturing date until the call to this method. Calling this method 
+        * does not reset any data. This is used only CS, other plug-ins may ignore this method.
+        * @since S60 3.2
+        * @param aLifeTimeInfo Life time information
+        * @return none 
+        */
+        TBool GetLifeTime( TDes8& aLifeTimeInfo );
+       
+        /**
+        * This method gets serial number from MS. The CSInfo includes
+        * the serial number.
+        * @since S60 5.0
+        * @param aCSInfo CS specific information from MS.
+        * @return Get succeeded or not.
+        */
+        TBool GetCSInfo( CSInfo& aCSInfo );
+
+// from base class MCSPIncomingCallObserver
+
+        /**
+        * From MCSPIncomingCallObserver.
+        * Informs incoming call.
+        * 
+        * @since S60 3.2
+        * @param aLine the line that corresponds to the call
+        * @param aCallName the name of call
+        * @param aLineId line identifier for the call
+        */    
+        void IncomingCallArrived( RMobileLine& aLine, TName aCallName,
+                                  RCSPLineContainer::TCSPLineId aLineId );
+        
+// from base class MCSPCommonInfo
+
+        /**
+        * From MCSPCommonInfo
+        * Makes the request. Note that ERequestTypeDial is made with a 
+        * separate MakeDialRequest function.
+        *
+        * @since S60 3.2
+        * @param aRequest type of request
+        * @return ETrue if active, EFalse if not
+        */
+        void GetCallWaitingL( const CCCECallParameters& iParams,
+                              TBool& aCallWaitingStatus );
+                              
+        /**
+        * From MCSPCommonInfo
+        * Diagnostic error fetching.
+        * @param aCallName name of call related to error
+        * @return diagnostic error code
+        */
+        TInt GetDiagnosticError( TName& aCallName );
+
+        /**
+        * From MCSPCommonInfo
+        *
+        * Network security status
+        * 
+        * @since Series60_4.0
+        * @return true if security enabled
+        */
+        TBool NetworkSecurityStatus() const;
+
+        /**
+        * From MCSPCommonInfo         
+        * Secure specified status. 
+        * @since Series60_5.0
+        * @return true if secure specified
+        */
+        TBool SecureSpecified() const;
+        
+        /**
+        * From MCSPCommonInfo
+        * Remote alerting tone status.
+        * @return tone status for remote alerting tone playing
+        */
+        RMmCustomAPI::TRemoteAlertingToneStatus GetRemoteAlertingToneStatus();
+        
+        /**
+         * From MCSPCommonInfo
+         * Initializes with current settings.
+         * @param aParams call params 
+         */
+        void InitializeCallParameters( RMobileCall::TMobileCallParamsV7& aParams );
+
+        /**
+         * From MCSPCommonInfo
+         * Initializes with current data call settings.
+         * @param aParams call params 
+         */
+        void InitializeDataCallParameters( RMobileCall::TMobileHscsdCallParamsV1& aParams );
+        
+        /**
+        * From MCPSCommonInfo
+        * @param aCall client call to be indicated
+        */
+        void IndicateClientCall( MCCPCSCall* aCall );
+        
+        /**
+        * Indicates incoming call for CCE.
+        * @param aCall incoming call
+        */
+        TInt IndicateIncomingCall( MCCPCSCall* aCall );
+        
+        /**
+        * Notify data port name about a loaned data port.
+        * @param aDataPortName port name
+        */
+        void NotifyDataPortName( TName& aDataPortName );
+
+        /**
+        * Indicates active hangup command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateActiveHangup( MCCPCallCommandHandling& aCall );
+        
+        /**
+        * Indicates hangup command complete.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateHangupComplete( MCCPCallCommandHandling& aCall );
+        
+        /**
+        * Indicates active hangup command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateDialRequest( MCCPCallCommandHandling& aCall );
+        
+        /**
+        * Indicates active hangup command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        TInt IndicateAnswerRequest( MCCPCallCommandHandling& aCall );
+        
+        /**
+        * Don't report termination error
+        * @since Series60_5.0
+        * @return system wide error code
+        */
+        TInt DontReportTerminationError();
+        
+// From base class MCSPSecuritySettingObserver
+
+        /**
+        * From MCSPSecuritySettingObserver
+        * Notifies about changed security status.
+        * @param aValue 
+        */
+        void SecuritySettingChanged( TInt aValue );
+        
+// From base class MCSPPubSubObserver
+
+        /**
+        * Handler for changed event.
+        * @param aUid uid of setting 
+        * @param aKey id of setting
+        * @param aStatus status of completed AO operation
+        */
+        void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
+            const TRequestStatus& aStatus );
+        
+// From base class MCSPRemoteAlertingToneObserver
+        
+        /**
+         * From MCSPRemoteAlertingToneObserver
+         * @see MCSPRemoteAlertingToneObserver
+         */
+        void RemoteAlertingToneStatusChanged(
+            RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus );
+
+// From base class MCSPConferenceStatusObserver
+        
+        /**
+        * From MCSPConferenceStatusObserver.
+        * Notifies event to observers.
+        * @param aStatus new status of the conference call
+        */        
+        void NotifyStateChange( 
+            MCSPConferenceStatusObserver::TCSPConferenceState aStatus );
+                        
+    private:
+    
+        /**
+        * C++ default constructor
+        */
+        CSProvider();
+        
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Creates connections to ETel.
+        */
+        void CreateEtelConnectionsL();
+        
+        /**
+        * Handles diverting and barring notifications.
+        * @param aAddr address
+        * @param aSsTypeAndMode ss type and mode struct
+        */
+        void HandleDivertOrBarring(TDesC& addr, 
+                         RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode);
+        
+        /**
+        * Handles SIM status
+        */
+        void HandleSIMStatusL();
+        
+    // data
+    private:
+        
+        /**
+        * Implementation UID
+        */
+        TUid iImplementationUid;
+        
+        /**
+        * ETel connection
+        */
+        RTelServer iServer;
+        
+        /**
+        * Mobile phone handle.
+        */
+        RMobilePhone iMobilePhone;
+
+        /**
+        * Mobile conference call handle.
+        */
+        RMobileConferenceCall iMobileConferenceCall;
+        
+        /**
+        * Observer for provider level functionality.
+        * Not own.
+        */        
+        MCCPCSObserver* iCCPObserver;
+
+        /**
+        * Observer for SS events.
+        * Not own.
+        */
+        MCCPSsObserver* iSsObserver;
+        
+        /**
+        * DTMF provider.
+        * Own.
+        */
+        CSPDTMFProvider* iDTMFProvider;
+        
+        /**
+        * Monitors line for incoming calls.
+        * Own.
+        */        
+        CSPEtelIncomingCallMonitor* iIncomingVoiceCallMonitor;
+        
+        /**
+        * Monitors line for incoming data/video calls.
+        * Own.
+        */        
+        CSPEtelIncomingCallMonitor* iIncomingDataCallMonitor;
+        
+        /**
+        * Monitors line for incoming calls from aux line
+        * Own.
+        */        
+        CSPEtelIncomingCallMonitor* iIncomingAuxCallMonitor;
+        
+        /**
+        * Call array.
+        * Own.
+        */
+        CSPCallArray* iCallArray;
+                
+        /**
+        * Custom API handle for custom functionality.
+        */        
+        RMmCustomAPI iMmCustom;
+        
+        /**
+        * Line container.
+        */
+        RCSPLineContainer iLineContainer;
+        
+        /**
+        * Service settings handler for reading 
+        * service id and name information.
+        * Own.
+        */
+        CSPServiceSettingsHandler* iServiceHandler;
+        
+        /**
+        * Initialisation status.
+        */
+        TBool iInitialized;
+                
+        /**
+        * Call added monitor.
+        * Own.
+        */
+        CSPCallAddedHandler* iCallAddedHandler;
+        
+        /**
+        * Service ID.
+        */
+        TUint32 iServiceId;
+        
+        /**
+        * Dev sound handler.
+        * Own.
+        */
+        CSPAudioHandler* iAudioHandler;
+        
+        /**
+        * Call waiting requester.
+        * Own.
+        */
+        CSPEtelCallWaitingRequester* iCwRequester;
+        
+        /**
+        * Supplementary service related event monitor.
+        * Own.
+        */ 
+        CSPSupplementaryServicesMonitor* iSsMonitor;
+        
+        /**
+         * Ciphering (network security level On/Off) setting monitor.
+         */
+        CSPCipheringStatusMonitor* iCipheringStatusMonitor;
+        
+        /**
+         * SS Settings handler for reading ALS line and ALS supported status.
+         */
+        CSPSsSettingsHandler* iSsSettingsHandler;
+        
+        /**
+        * Sim status listener.
+        * Own.
+        */ 
+        CSPPubSubListener* iSimStatusListener;
+        
+        /**
+        * CallCommandHandler.
+        * Own.
+        */ 
+        CSPCallCommandHandler* iCallCommandHandler;
+        
+        /** 
+         * Remote Alerting Tone listener.
+         */
+        CSPRemoteAlertingToneListener* iRemoteAlertingToneListener;
+        
+        /** 
+         * Monitor for conference status changes.
+         * Own.
+         */
+        CSPEtelConferenceStatusMonitor* iConferenceStatusMonitor;
+
+        /** 
+         * Keep track of conference existence.
+         */
+        CSPConferenceCall* iConferenceCall; 
+};
+
+#endif // CSPROVIDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspservicesettingshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header of CSPServiceSettingsHandler
+*
+*/
+
+
+#ifndef CSPSERVICESETTINGSHANDLER_H
+#define CSPSERVICESETTINGSHANDLER_H
+
+#include <e32base.h>
+
+#include "rcsplinecontainer.h"
+
+/**
+* Makes asynchronic request to ETel interface according to given request type.
+* Provides canceling via CActive::Cancel().
+* 
+*/
+class CSPServiceSettingsHandler: public CBase   
+    {
+    public:
+    
+        /**
+        * Two phased constructing of the DTMF provider instance.
+        * @return the instance to service settings handler
+        */
+        static CSPServiceSettingsHandler* NewL( );
+        
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPServiceSettingsHandler( );
+        
+        /**
+        * Find service ID by name.
+        * @since S60 3.2
+        * @param aName the name of service
+        * @param aServiceId service ID
+        */
+        void FindByNameL( const TDesC& aName, TUint32& aServiceId );        
+                             
+        /**
+        * Find CS service ID.
+        * @param aServiceId the service id as output
+        * @return error code if read was not succesfull
+        */
+        TInt ReadCSServiceId( TUint32& aServiceId );
+
+        
+        
+    private:
+        /**
+        * Constructs the requester.
+        *
+        */
+        CSPServiceSettingsHandler(  );
+        
+        /**
+        * Constructing the provider in the second phase.
+        */
+        void ConstructL();
+    
+    private: // data
+    
+        
+        
+    };
+    
+#endif // CSPSERVICESETTINGSHANDLER
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspsssettingshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the class 
+*                CSPSsSettingsHandler.
+*
+*/
+
+
+
+#ifndef CSPSSSETTINGSHANDLER_H
+#define CSPSSSETTINGSHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <msssettingsobserver.h>
+
+
+// FORWARD DECLARATIONS
+class MCCPSsObserver;
+
+// CLASS DECLARATION
+
+/**
+*  CSPSsSettingsHandler observer SSSettings changes
+*
+*  @lib phoneenginegsm
+*  @since Series_60 4.0
+*/
+class CSPSsSettingsHandler : public CBase,
+                           public MSSSettingsObserver
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static CSPSsSettingsHandler* NewL( const MCCPSsObserver& aObserver );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSPSsSettingsHandler( );
+
+    public: // New functions
+        
+        /**
+        * GetALSLineL
+        * @param aALSLine, Als line information to be updated
+        */
+        void GetALSLineL( RMobilePhone::TMobilePhoneALSLine& aALSLine );
+
+        /**
+        * SetALSLineL
+        * @param aALSLine, Als line information to set
+        */
+        void SetALSLineL( RMobilePhone::TMobilePhoneALSLine& aALSLine );
+        
+        /**
+        * GetClirL
+        * @param aClir, Clir information to be updated
+        */
+        void GetClirL( RMobileCall::TMobileCallIdRestriction& aClir );
+        
+        /**
+        * GetCugL
+        * @param aCugIndex, CUG index
+        */
+        void GetCugL( TInt& aCugIndex );
+        
+        /**
+         * GetDefaultCugL
+         * Get CUG default value.
+         */
+        void GetDefaultCugL(TInt& aDefCug );
+        
+        /**
+         * IsValueValidCugIndex
+         * Is CUG index in allowed range. 
+         */
+        TBool IsValueValidCugIndex( const TInt& aValue ) const;
+
+    public: // Functions from MSSSettingsObserver
+
+        /*
+        * Observer functoin 
+        * @param aSetting Current setting
+        * @param aNewValue New value for the setting
+        */
+        virtual void PhoneSettingChanged( 
+            TSSSettingsSetting aSetting, 
+            TInt aNewValue );
+
+    private:
+
+        /**
+        * Constructor.
+        */
+        CSPSsSettingsHandler( const MCCPSsObserver& aObserver );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+        
+        /**
+        * Call register Als notify after idle callback
+        */                 
+        void RegisterAfterIdle();               
+
+        /**
+        * CIdle CallBack method
+        */  
+        static TInt CIdleCallBack( TAny* aAny );
+
+        /**
+        * Register to notify ALS line changed
+        */  
+        void Register();
+
+    private: // Data
+
+        /**
+         * MCCPSsObserver is used to send message to the CCE/phone.
+         */
+        MCCPSsObserver& iObserver;
+        //Pointer to instance of Settings
+        RSSSettings iSSSettings;
+        // Idle object to register ALS notify.
+        CIdle* iRegisterAlsNofify;
+
+    };
+
+#endif      // CSPSSSETTINGSHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspsupplementaryservicesmonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the
+*                CSPSupplementaryServicesMonitor object.
+*
+*/
+
+
+#ifndef CSPSUPPLEMENTARYSERVICESMONITOR_H
+#define CSPSUPPLEMENTARYSERVICESMONITOR_H
+
+
+//INCLUDES
+#include <e32base.h>
+#include <rmmcustomapi.h>
+
+
+// FORWARD DECLARATIONS
+class CSProvider;
+
+// CLASS DECLARATION
+
+/**
+* Monitors Supplementary Services
+*
+* @lib CallHandling.lib
+* @since Series60_4.0
+*/
+class CSPSupplementaryServicesMonitor: public CActive
+    {
+    public:    //Constructors and descructor
+
+        /**
+        * C++ default constructor.
+        */
+        CSPSupplementaryServicesMonitor( 
+            CSProvider& aOwner, 
+            RMmCustomAPI& aCustomAPI );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CSPSupplementaryServicesMonitor();
+
+    public: //New functions
+        
+        /**
+        * Starts monitoring new calls
+        * @since Series60_4.0
+        * @param None. 
+        * @return None. 
+        */
+        void StartMonitoring();
+
+    protected: // From CActive
+        
+        /**
+        * Cancels asyncronous request(s).
+        * @since Series60_4.0
+        * @param None.    
+        * @return None.
+        */
+        void DoCancel();
+
+        /**
+        * Informs object that asyncronous request is ready.
+        * @since Series60_4.0
+        * @param None. 
+        * @return None.
+        */
+        void RunL();
+      
+    private:
+        
+        /** Owner of this object */
+        CSProvider& iOwner;
+        /** Subsession to custom api */
+        RMmCustomAPI& iCustomAPI;
+        /** Suplementary Services Type And Mode */
+        RMmCustomAPI::TSsTypeAndMode iSsTypeAndMode;
+        /** Suplementary Services info */
+        RMmCustomAPI::TSsInfo iSsInfo;
+    };
+
+#endif // CSPSUPPLEMENTARYSERVICESMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/csptimer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Timer service
+*
+*/
+
+
+#ifndef CSPTIMER_H
+#define CSPTIMER_H
+
+#include <e32base.h>
+
+class MCSPTimerObserver;
+
+/**
+ *  Timer service.
+ *
+ *  @lib PhoneEngine.lib
+ *  @since S60 v3.1
+ */
+NONSHARABLE_CLASS( CSPTimer ) : protected CTimer
+    {
+public:
+
+    static CSPTimer* NewL();
+
+    static CSPTimer* NewLC();
+
+    virtual ~CSPTimer();
+
+    /**
+     * Request for notify after aTimeout.
+     * After timeout has passed observer is called. Panics
+     * if there is notify already ongoing ie IsNotifyOngoing
+     * returns ETrue.
+     *
+    *
+     * @param aTimeout Time out in microseconds. 
+     * @param aTimerObserver Observer for notify.
+     */
+    virtual void NotifyAfter( TInt aTimeout, 
+        MCSPTimerObserver& aTimerObserver );
+    
+    /**
+     * Cancels the outstanding notify request. After
+     * this call notify is no longer ongoing ie IsNotifyOngoing
+     * return EFalse.
+     *
+    *
+     */
+    virtual void CancelNotify();
+    
+    /**
+     * Determines if there is notify ongoing.
+     *
+    *
+     * @return ETrue - notify is ongoing, EFalse - notify is not ongoing.
+     */
+    virtual TBool IsNotifyOngoing();
+    
+protected:    
+    
+// from base class CActive
+
+    /**
+     * From CActive
+     * Called when timer timeout is up.
+     *
+    *
+     */
+    void RunL();
+    
+    CSPTimer();
+
+    void ConstructL();
+
+protected: // data
+
+    /**
+     * Observer for notify service.
+     * Not own.
+     */
+    MCSPTimerObserver* iObserver;
+
+    };
+
+#endif // CSPTIMER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/csptransferprovider.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,200 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header of CSPTransferProvider which provides methods and
+*                functionality to handle call transfering
+*
+*/
+
+
+#ifndef CSPTRANSFERPROVIDER_H
+#define CSPTRANSFERPROVIDER_H
+
+#include <e32base.h>
+#include <mccptransferprovider.h>
+#include <mccptransferobserver.h>
+
+class RMobileCall;
+class MCSPCallErrorObserver;
+class MCSPCommonInfo;
+
+/**
+* Call transfer methods.
+* MCCPCallObserver is used for errors, statuses, notifications etc
+*
+*  @since S60 3.2
+*/
+class CSPTransferProvider : public CActive,
+                            public MCCPTransferProvider
+    {
+    
+    public:
+        /**
+        * Two phased constructing of the transfer provider instance.
+        * @param aCall mobile call handle
+        * @return the Transfer provider instance
+        */
+        static CSPTransferProvider* NewL( RMobileCall& aCall, 
+                MCSPCallErrorObserver& aErrorObserver,
+                MCSPCommonInfo& aCommonInfo );        
+
+        /** 
+        * Destructs the transfer provider.
+        * @since S60 3.2
+        */
+        virtual ~CSPTransferProvider();
+        
+    public:
+
+    // from base class MCCPTransferProvider
+        /**
+        * Attended transfer to given call recipient.
+        * There exist a call between A-B and A-C. A wants to transfer the call
+        * to B-C. A itself will not be inline in case the transfer is made 
+        * succesfully.In above case C will be the aTransferTargetCall. B is 
+        * the recipient of the current call between A-B - called on A's call
+        * object transfer provider. The A-B call is on hold (optional).
+        *
+        * @param aTransferTargetCall Target receiver of the transferred call. 
+        *                            In this case there exist a call.
+        * @return In case of an immediate error returns system error code, 
+        *         if request has been started returns KErrNone.
+        * Actual request result indication comes via observer class
+        */
+        TInt AttendedTransfer( MCCPCall& aTransferTargetCall );
+
+        /**
+        * Attended transfer to given address. There does not need to be 
+        * a current call between the given transfer target.
+        * @param aTransferTarget Transfer target address
+        * @return In case of an immediate error returns system error code,
+        *         if request has been started returns KErrNone.
+        * Actual request result indication comes via observer class
+        */
+        TInt AttendedTransfer( const TDesC& aTransferTarget );
+
+        /**
+        * Unattended transfer. Call is requested to be transferred to given
+        * address. After ECCPRemoteTransferring event current call will be
+        * disconnected and no transfer status is checked from the operation. 
+        * @param aTransferTarget Address of the target
+        * @return In case of an immediate error returns system error code, 
+        *         if request has been started returns KErrNone.
+        * Actual request result indication comes via observer class
+        */
+        TInt UnattendedTransfer( const TDesC& aTransferTarget );
+
+        /**
+        * Accept incoming call transfer request from the call remote party.
+        * @param aAccept ETrue - accept transfer, 
+        *                EFalse do not accept transfer request.
+        * @return In case of an immediate error returns system error code, 
+        *         if request has been started returns KErrNone.
+        * Actual request result indication comes via observer class
+        */
+        TInt AcceptTransfer( const TBool aAccept );
+          
+        /**
+        * When the other end of the call has requested call transfer to
+        * third party it is notified to 
+        * CCPCallCall::EventOccurred(ECCPRemoteTransferring).
+        * The new recipient of the call can be fetched via this method.
+        * @return New recipient for the call after transfer
+        */
+        const TDesC& TransferTarget() const;
+        
+        /**
+        * Add an observer for transfer related events.
+        * Plug-in dependent feature if duplicates or more than one observers 
+        * are allowed or not. Currently CCE will set only one observer.
+        * @since S60 v3.2
+        * @param aObserver Observer
+        * @leave system error if observer adding fails
+        */
+        void AddObserverL( const MCCPTransferObserver& aObserver );
+
+        /**
+        * Remove an observer.
+        * @since S60 v3.2
+        * @param aObserver Observer
+        * @return KErrNone if removed succesfully
+        *         KErrNotFound if observer was not found.
+        *         Any other system error depending on the error.
+        */
+        TInt RemoveObserver( const MCCPTransferObserver& aObserver );
+        
+        /**
+        * A transfer event has occurred concerning a specific call.
+        * @since S60 3.2
+        * @param aEvent Occurred event.
+        */
+        void TransferEventOccurred( 
+            const MCCPTransferObserver::TCCPTransferEvent aEvent );
+
+    // from base class CActive
+    protected:
+            /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+            
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();  
+
+    private:
+        /**
+        * Constructs the provider
+        *
+        * @param aCall handle mobile call
+        */
+        CSPTransferProvider( RMobileCall& aCall, 
+                             MCSPCallErrorObserver& aErrorObserver,
+                             MCSPCommonInfo& aCommonInfo );
+
+        /**
+        * Constructing 2nd phase.
+        */
+        void ConstructL();
+        
+    private: // data
+
+        /**
+        * DTMF event observer.
+        */
+        RPointerArray<MCCPTransferObserver> iObservers;
+            
+        /**
+        * Etel call object
+        */
+        RMobileCall& iCall;
+        
+        /**
+        * Error observer;
+        */
+        MCSPCallErrorObserver& iErrorObserver;
+        
+        /**
+        * Common information for calls.
+        */
+        MCSPCommonInfo& iCommonInfo;
+
+
+};
+
+#endif CSPTRANSFERPROVIDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspuuimessagesender.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sends UUI message.
+*
+*/
+
+
+#ifndef CSPUUIMESSAGESENDER_H
+#define CSPUUIMESSAGESENDER_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+/**
+ *  Sends user to user information messages.
+ *
+ *  @lib PhoneEngine.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CSPUUIMessageSender ) : public CActive
+    {
+
+public:
+
+    static CSPUUIMessageSender* NewL(
+        RMobileCall& aCall );
+
+    virtual ~CSPUUIMessageSender();
+
+    /**
+     * Sends user to user information.
+     *
+     * @since S60 v3.2
+     * @param aMessage UUI message to be sent.
+     */
+    void SendUUIMessage( const TDesC& aMessage );
+     
+// from base class CActive
+
+protected:
+
+    /**
+     * From CActive.
+     *
+     * Cancels active request.
+     * @since S60 v3.2
+     */
+    void DoCancel();
+    
+    /**
+     * From CActive.
+     *
+     * Callback to indicate completion
+     * of request.
+     * @since S60 v3.2
+     */
+    void RunL();
+
+private:
+
+    CSPUUIMessageSender(
+        RMobileCall& aCall );
+
+    void ConstructL();
+
+private: // data
+    
+    /**
+     * Call, which the UUI is sent to.
+     * Not own.
+     */
+    RMobileCall& iCall;
+    
+    /**
+     * Request.
+     */
+    RMobileCall::TMobileCallUUSRequestV1 iUUSRequest;
+    
+    /**
+     * Request package.
+     */
+    RMobileCall::TMobileCallUUSRequestV1Pckg iUUSRequestPckg;
+    };
+
+#endif // CSPUUIMESSAGESENDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspuuimonitor.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitor UUI messages.
+*
+*/
+
+
+#ifndef CSPUUIMONITOR_H
+#define CSPUUIMONITOR_H
+
+#include <e32base.h>
+#include <etelmm.h>
+
+class MCSPUUSMessageObserver;
+
+/**
+ *  Monitors UUI messages.
+ *
+ *  @lib PhoneEngine.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CSPUUIMonitor ) : public CActive
+    {
+public:
+
+    static CSPUUIMonitor* NewL(RMobileCall& aCall,  
+        MCSPUUSMessageObserver& aUUIHandler );
+
+    virtual ~CSPUUIMonitor();
+
+    /**
+     * Starts monitoring the UUI messages
+     *
+     * @since S60 v3.2
+     */
+    void StartMonitor();
+    
+protected:
+
+// from base class CActive
+
+    /**
+     * From CActive
+     * Cancels the outstanding request
+     *
+     * @since S60 v3.2
+     */
+    void DoCancel();
+    
+    /**
+     * From CActive
+     * Handles request completion
+     *
+     * @since S60 v3.2
+     */
+    void RunL();
+
+private:
+
+    CSPUUIMonitor(RMobileCall& aCall,  
+        MCSPUUSMessageObserver& aUUIHandler );
+
+    void ConstructL();
+
+private: // data
+    
+    /**
+     * Etel call.
+     * Not own.
+     */
+    RMobileCall& iCall;
+    
+    /**
+     * UUI data.
+     */
+    RMobileCall::TMobileCallUUI iUUI;
+    
+   
+    /**
+     * UUI message observer;
+     */
+    MCSPUUSMessageObserver& iObserver;
+
+    };
+
+#endif // CSPUUIMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspvideocall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements CSPVideoCall for CS Call Plug-in
+*
+*/
+
+
+
+#ifndef CSPVIDEOCALL_H
+#define CSPVIDEOCALL_H
+
+#include <mccpcscall.h>
+#include <mccpcallobserver.h>
+#include <etel.h>
+#include <etelmm.h>
+#include <cccecallparameters.h>
+
+#include "cspcall.h"
+#include "cspconsts.h"
+#include "mcspcallobserver.h"
+#include "mcspcallerrorobserver.h"
+#include "cspvideocallconnectionhandler.h"
+
+
+class MCCPObserver;
+class RMobileCall;
+class CSPEtelCallStatusMonitor;
+class CSPEtelCallEventMonitor;
+class CSPEtelVideoCallCapsMonitor;
+class CSPEtelCallWaitingRequester;
+
+/**
+* Call class for CS Call Plug-in. Implements the API defined by CCP in classes
+* MCCPCall and MCCPCSCall
+*
+*  @lib csplugin.dll
+*  @since S60 v3.2
+*/
+class CSPVideoCall : public CSPCall
+    {
+    
+    public:
+        /*
+        * Creates a new CSPVideoCall object.
+        * @since S60 3.2
+        * @param aName dialled number (MT) or call name (MO)
+        * @param aLine line for opening the call
+        * @param aMobileOriginated direction of call        
+        * @param aParams call parameters 
+        * @param aCommonInfo common information for call,
+        * @return pointer to created call object
+        */
+        static CSPVideoCall* NewL( const TDesC& aName,
+                              RMobileLine& aLine,
+                              TBool aMobileOriginated,
+                              const CCCECallParameters& aParams,
+                              MCSPCommonInfo& aCommonInfo );       
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPVideoCall( );
+
+        /**
+        * Informs about ready data connection.
+        * @aPortName name of data port
+        */
+        void ConnectionReady( TName aDataPortName );
+        
+        /**
+        * Error occurred when establishing connection.
+        * @param aErr error value
+        */
+        void ConnectionEstablishingFailed(TInt aErr);
+        
+        /**
+        * Notification about data call caps change.
+        * @param aCaps new caps
+        */
+        void DataCallCapsChanged( RMobileCall::TMobileCallDataCapsV1& aCaps );
+        
+        /**
+        * Selects call type video or voice depending of available procotol 
+        * capabilities
+        * @return Call type video or voice  
+        */
+        CCPCall::TCallType SelectCallTypeFromProtocolCaps();          
+        
+// from base class CSPCall
+
+        /**
+        * From CSPCall
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        virtual void NotifyCallStateChanged( MCCPCallObserver::TCCPCallState aState );
+
+        /**
+        * From CSPCall
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state of the call
+        */
+        virtual void NotifyCallStateChangedWithInband( MCCPCallObserver::TCCPCallState aState );
+        
+        /**
+        * From MCCPCSCall
+        * Starts dialing to recipient without FDN check.
+        * @param aCallParams Call parameters used by the TSY (TCallParamsPckg)
+        * @return system wide error code
+        */
+        TInt DialNoFdnCheck( const TDesC8& aCallParams );
+
+        /**
+        * From CSPCall
+        * Switch in the alternating call mode of an alternating call
+        * @since S60 3.2
+        */
+        TInt SwitchAlternatingCall();
+        
+        /**
+        * From MCCPCSCall
+        * Gets the calls data call capabilities
+        * @since S60 3.2
+        * @param aCaps TMobileCallDataCapsV1
+        * @return KErrNone if the function member was successful, 
+        *        KErrNotSupported if call doesn't support circuit switched data
+        *        KErrNotFound if this call is not a data call
+        */
+        virtual TInt GetMobileDataCallCaps( TDes8& aCaps ) const;
+
+        /**
+        * From MCCPCall
+        * Get call's secure status.
+        * @since S60 3.2
+        * @return TBool ETrue if security is enabled, else EFalse.
+        */
+        TBool IsSecured() const;
+          
+    protected: 
+        
+        /*
+        * C++ default constructor
+        * @param aLine open line ready for use
+        * @param aMobileOriginated true if MO, false if MT
+        * @param aName call name (MT) or recipient (MO)
+        * @param aCommonInfo reference to common info interface
+        */
+        CSPVideoCall( RMobileLine& aLine,  
+                 TBool aMobileOriginated,
+                 const TDesC& aName,
+                 MCSPCommonInfo& aCommonInfo );
+
+        /*
+        * Constructing 2nd phase.
+        * @since S60 3.2
+        */
+        void ConstructL( const CCCECallParameters& aParams );
+
+    private:    
+
+        /** 
+        * Sets default call params.
+        */
+        void SetDefaultCallParameters();
+        
+        /** 
+        * Sets default video call params
+        */
+        void SetVideoCallParameters();
+        
+        /**
+        * Branches dial requests according 
+        * to FDN check flag.
+        * @aFdnCheck ETrue if FDN is checked
+        */
+        TInt DialFdnCond( TBool aFdnCheck );
+  
+    private:
+
+        /**
+        * Data call caps monitor
+        * Own.
+        */
+        CSPEtelVideoCallCapsMonitor* iVideoCallCapsMonitor;
+
+        /**
+        * Call parameters. 
+        */
+        RMobileCall::TMobileHscsdCallParamsV1 iDataCallParams;
+
+        /**
+        * Call parameters package.  
+        */
+        RMobileCall::TMobileHscsdCallParamsV1Pckg iDataCallParamsPckg;
+      
+        /**
+        * Air Interface User Rate
+        */
+        RMobileCall::TMobileCallAiur iAirInterfaceUserRate;
+        
+        /**
+        * Current received time slots
+        */
+        TInt iCurrentTimeSlots;
+                
+        /**
+        * Connection functionality
+        * Own.
+        */
+        CSPVideoCallConnectionHandler* iConnectionHandler;
+
+        /**
+        * Next call state 
+        */
+        MCCPCallObserver::TCCPCallState iNextCallState;       
+        
+    };
+
+
+#endif // CSPVIDEOCALL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspvideocallconnectionhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Delivers asynchronous requests to ETel
+*
+*/
+
+
+#ifndef CSPVIDEOCALLCONNECTIONHANDLER_H
+#define CSPVIDEOCALLCONNECTIONHANDLER_H
+
+
+#include <e32base.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
+#include <es_sock.h>
+#include <es_enum.h>
+
+class CSPVideoCall;
+
+/**
+* Handles data call connection specific requests.
+* Provides canceling via CActive::Cancel().
+* 
+*/
+class CSPVideoCallConnectionHandler : public CActive
+    {
+        
+    public:
+        
+        /**
+        * Constructs the requester via two phase.
+        *
+        * @param aObserver the observer for request errors
+        * @param aCall ETel RMobileCall reference that is the object
+        * of the request.
+        */
+        static CSPVideoCallConnectionHandler* NewL( CSPVideoCall& aObserver, 
+                                           RMobileCall& aCall );
+        
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPVideoCallConnectionHandler( );
+
+        /**
+        * Initializes connection including data port loaning.
+        * @since S60 3.2
+        * @return KErrNone if successful, else error code
+        */
+        TInt InitializeConnection(  );
+        
+        /**
+        * Releases connection including data port loaning.
+        * @since S60 3.2
+        * @return KErrNone if successful, else error code
+        */        
+        TInt ReleaseConnection( );
+
+        /**
+        * Connection initialized.
+        * @since S60 3.2
+        * @return connection initialized status
+        */
+        TBool ConnectionInitialized(  );
+     
+    protected: // From CActive
+        
+        /**
+        * From CActive
+        * RunL
+        * @since S60 3.2
+        */
+        void RunL();
+        
+        /**
+        * From CActive
+        * Cancels the monitor
+        * @since S60 3.2
+        */
+        void DoCancel();
+        
+    private:
+    
+        /**
+        * Constructs the connection handler.
+        *
+        * @param aObserver the observer for request errors
+        * @param aCall ETel RMobileCall reference that is the object
+        * of the request.
+        */
+        CSPVideoCallConnectionHandler( CSPVideoCall& aObserver, 
+                              RMobileCall& aCall );
+        
+        /**
+        * Constructing in the second phase.
+        */
+        void ConstructL();
+
+        /**
+        * Create socket connection.  
+        */
+        TInt CreateSocketConnection();
+
+        /**
+        * Loan data port. 
+        * Initiates asynchronous request to loan dataport. 
+        */
+        TInt LoanDataPort();
+        
+        /**
+        * Close socket connection.  
+        */
+        void CloseConnection();
+               
+        
+    private: // data
+        /**
+        * Observer for request errors.
+        */
+        CSPVideoCall& iObserver;        
+       
+        /**
+        * ETel call which this monitors
+        */
+        RMobileCall& iCall;        
+        
+        /**
+        * Comm port info.
+        */
+        RCall::TCommPort iCommPort;
+        
+        /**
+        * Connection reference
+        */
+        RConnection iConnection;
+        
+        /**
+        * Tells if socket connection has been initialized
+        */
+        TBool iConnectionInitialized;
+        
+        /**
+        * Socket Server handle.
+        */
+        RSocketServ iSocketServer;
+        
+    };
+    
+#endif // CSPVIDEOCALLCONNECTIONHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/cspvoicecall.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,184 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements CSPVoiceCall for CS Call Plug-in
+*
+*/
+
+
+#ifndef CSPVOICECALL_H
+#define CSPVOICECALL_H
+
+
+#include <mccpemergencycall.h> // For MCCPEmergencyCall
+
+#include "cspcall.h" // For CSPCall
+
+
+class MCCPForwardProvider;
+class MCCPObserver;
+class RMobileCall;
+class CSPEtelCallStatusMonitor;
+class CSPEtelCallEventMonitor;
+class CSPEtelCallWaitingRequester;
+
+/**
+* Call class for CS Call Plug-in. Implements the API defined by CCP in classes
+* MCCPCall and MCCPCSCall
+*
+*  @lib csplugin.dll
+*/
+class CSPVoiceCall : public CSPCall,
+                     public MCCPEmergencyCall
+    {
+    
+    public:
+        /*
+        * Creates a new CSPVoiceCall object for MO or MT call.
+        * @param aName dialled number (MO) or call name (MT)
+        * @param aLine line for opening the call
+        * @param aMobileOriginated direction of call
+        * @param aParams call parameters
+        * @param aCommonInfo common info interface  
+        * @param aIsEmergency is emergency call
+        * @return pointer to created call object
+        */
+        static CSPVoiceCall* NewL( const TDesC& aName,
+                              RMobileLine& aLine,
+                              TBool aMobileOriginated,
+                              const CCCECallParameters& aParams,
+                              MCSPCommonInfo& aCommonInfo,
+                              TBool aIsEmergency );
+
+        /**
+        * C++ default destructor
+        */
+        virtual ~CSPVoiceCall();
+        
+        /**
+        * Goes one-to-one from conference.
+        * @return system wide error code        
+        */
+        TInt GoOneToOne();
+
+// from base class CSPCall        
+        
+        /**
+        * From MCCPCSCall
+        * Switch in the alternating call mode of an alternating call
+        * @return system wide error code
+        */
+        TInt SwitchAlternatingCall();
+        
+        /**
+        * From MCCPCall
+        * Answer call.
+        * @return system wide error code
+        */
+        TInt Answer();
+        
+        /**
+        * Ends an ongoing call.
+        * @return KErrNone If request was started succesfully.
+        * @return KErrAlreadyExists If call is already in idle state.
+        */
+        TInt HangUp();
+    
+        /**
+        * From MCCPCall
+        * Cancels the ongoing dial request
+        * @return system wide error code
+        */
+        TInt Cancel();
+        
+// from base class MCCPEmergencyCall
+        
+         /**
+        * Dials an emergency call.
+        * @param aRecipient Emergency call address suggested to be used.
+        * Can be given also in CConvergedCallProvider::NewEmergencyCallL.
+        * Plug-in will use given address and/or its own known one. 
+        * Preferred address usage order:
+        * 1) Plug-in own emergency address
+        * 2) Address given in Dial
+        * 3) Address given in CConvergedCallProvider::NewEmergencyCallL.
+        * @return KErrNone if request was started succesfully. 
+        * @return KErrNotReady If call is not in idle state.
+        * @return KErrNotSupported Emergency call is not supported.
+        */
+        TInt Dial( const TDesC& aEmergencyNumber);
+
+    protected:
+        
+        /*
+        * Voice call constructor.
+        * @param aLine open line ready for use
+        * @param aServiceId service ID
+        * @param aCallType type of call (voice/video/data/fax)
+        * @param aLineType primary/aux line type
+        * @param aMobileOriginated direction of call
+        * @param aName remote party or call name depending on direction
+        * @param aExtMoCall true in case of externally created MO call
+        * @param aIsEmergency is emergency call flag
+        * @param aBearer bearer capabilities for SAT
+        * @param aSubAddress sub adrress for SAT
+        * @param aOrigin call origin (i.e. SAT or Phone)
+        */
+        CSPVoiceCall( RMobileLine& aLine,  
+                 TBool aMobileOriginated,
+                 const TDesC& aName,
+                 MCSPCommonInfo& aCommonInfo,
+                 TBool aIsEmergency );
+                 
+        /*
+        * Constructing 2nd phase.
+        */
+        void ConstructL( const CCCECallParameters& aParams );
+
+        /** 
+        * Set default call parameters to be used in dial.
+        */
+        void SetDefaultCallParameters();
+
+        /**
+        * From CSPCall. 
+        * Starts dialing to recipient.
+        * Bypasses FDN check according to aFdnCheck.
+        * @param aFdnCheck True if FDN checking is used
+        * @return system wide error code
+        */
+        TInt DialFdnCond( TBool aFdnCheck );
+ 
+    protected: // Data
+        
+        /**
+        * Call parametrs.
+        */
+        RMobileCall::TMobileCallParamsV7 iCallParams;
+      
+        /**
+        * Package of call paremeters.
+        */
+        RMobileCall::TMobileCallParamsV7Pckg iCallParamsPckg;
+      
+        /**
+        * Stores the emergency number.
+        */
+        RMobileENStore::TEmergencyNumber iEmergencyNumber;
+        
+        friend class UT_CSPVoiceCall;
+        
+    };
+
+
+#endif // CSPVOICECALL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspaudiostreamobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer interface for getting information on audio streams.
+*
+*/
+
+
+#ifndef MCSPAUDIOSTREAMOBSERVER_H
+#define MCSPAUDIOSTREAMOBSERVER_H
+
+/**
+ *  Observer interface for getting information of audio streams.
+ *
+ */
+NONSHARABLE_CLASS( MCSPAudioStreamObserver )
+    {
+
+public:
+
+    /**
+     * Indication that audio streams has been started. 
+     *
+     */
+    virtual void AudioStreamsStarted() = 0;
+    
+    /**
+     * Indication that audio streams will be closed.
+     *
+     * Client can do operations affected to streams from this method,
+     * but after this method the streams will be closed.
+     *
+     */
+    virtual void AudioStreamsGoingToStop() = 0;
+
+    };
+
+
+#endif // MCSPAUDIOSTREAMOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspcalladdedobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPCallAddedObserver class
+*
+*/
+
+
+
+#ifndef MCSPCALLADDEDOBSERVER_H
+#define MCSPCALLADDEDOBSERVER_H
+
+//INCLUDES
+#include <etelmm.h>
+
+#include "rcsplinecontainer.h"
+
+// CLASS DECLARATION
+
+/**
+*  Virtual interface for monitoring incoming call.
+*
+*  @since S60 3.2
+*/
+class MCSPCallAddedObserver
+    {
+    public:
+
+        /**
+        * Informs about added call.
+        * @since S60 3.2
+        * @param aLine the line that corresponds to the call
+        * @param aCallName the name of the call
+        */    
+        virtual void CallAdded( RMobileLine& aLine, 
+                                TName aCallName,
+                                RCSPLineContainer::TCSPLineId aLineId ) = 0;
+
+
+    };
+
+#endif // MINCOMINGCALLOBSERVER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspcallcommandhandling.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class mcspcallcommandhandling
+*
+*/
+
+
+
+#ifndef MCSPCALLCOMMANDHANDLING_H
+#define MCSPCALLCOMMANDHANDLING_H
+
+//  INCLUDES
+#include <e32std.h>
+
+class CSPCall;
+
+// CLASS DECLARATION
+
+
+/**
+*  Observer interface for call command handling
+*
+*/
+class MCCPCallCommandHandling
+    {
+    public:  // New functions
+
+        /**
+        * Perform answer command.
+        * @return system wide error code
+        */
+        virtual TInt PerformAnswerRequest() = 0;
+        
+        /**
+        * Perform dial command.
+        * @return system wide error code
+        */
+        virtual TInt PerformDialRequest() = 0;
+
+    };
+
+#endif // MCSPCALLCOMMANDHANDLING_H 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspcallerrorobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPCallErrorObserver class for 
+*                observing errors related to call requests, e.g. dialling.
+*
+*/
+
+
+
+#ifndef MCSPCALLERROROBSERVER_H
+#define MCSPCALLERROROBSERVER_H
+
+//INCLUDES
+#include <ccpdefs.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Interface for monitoring incoming call.
+*
+*  @since S60 3.2
+*/
+class MCSPCallErrorObserver
+    {
+    public:
+        
+        /**
+        * Informs about failed dial.
+        * @param aErrorCode
+        */
+        virtual void DialRequestFailed( TInt aErrorCode ) = 0;
+
+        /**
+        * Informs about failed emergency dial.
+        * @param aErrorCode
+        */
+        virtual void EmergencyDialRequestFailed( TInt aErrorCode ) = 0;
+        
+        /**
+        * Informs about erroneous request.
+        * @since S60 3.2
+        * @param aError request related to the error.
+        */    
+        virtual void NotifyErrorOccurred( TCCPError aErr ) = 0;
+
+
+
+    };
+
+#endif // MINCOMINGCALLOBSERVER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspcallinformation.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPCallInformation class
+*
+*/
+
+
+
+#ifndef MCSPCALLINFORMATION_H
+#define MCSPCALLINFORMATION_H
+
+//INCLUDES
+#include <etelmm.h>
+
+// FORWARD DECLARATIONS
+class CSPCall;
+
+// CLASS DECLARATION
+
+/**
+*  Interface for browsing calls.
+*
+*/
+class MCSPCallInformation
+    {
+    public:
+
+        /**
+        * Finds call based on the name.
+        * @param aCallName call name (etel)
+        * @return call object or NULL if not found.
+        */
+        virtual CSPCall* FindCall( const TName& aCallName ) = 0;
+
+    };
+
+#endif // MINCOMINGCALLOBSERVER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspcallobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPCallObserver class for 
+*                observing errors related to call requests, e.g. dialling.
+*
+*/
+
+
+
+#ifndef MCSPCALLOBSERVER_H
+#define MCSPCALLOBSERVER_H
+
+//INCLUDES
+#include <etelmm.h>
+
+#include <mccpcallobserver.h>
+#include <mccptransferobserver.h>
+#include <mccpforwardobserver.h>
+#include <mccpconferencecallobserver.h>
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Interface for monitoring incoming call.
+*
+*  @since S60 3.2
+*/
+class MCSPCallObserver
+    {
+    public:
+
+        /**
+        * Informs about occurred event.
+        * @since S60 3.2
+        * @param aEvent occurred event
+        */    
+        virtual void NotifyCallEventOccurred( 
+                        MCCPCallObserver::TCCPCallEvent aEvent ) = 0;
+
+        /**
+        * Updates the state change and forwards the state for observer.
+        * @param aState new state (ETel) of the call 
+        */
+        virtual void NotifyCallStateChangedETel( 
+            RMobileCall::TMobileCallStatus aState ) = 0;
+
+        /**
+        * Informs about changed state that includes inband tones.
+        * @since S60 3.2
+        * @param aState the new state 
+        */    
+        virtual void NotifyCallStateChangedWithInband( 
+                        MCCPCallObserver::TCCPCallState aState ) = 0;
+
+        /**
+        * Informs about occurred transfer related event.
+        * @since S60 3.2
+        * @param aEvent occurred transfer event
+        */    
+        virtual void NotifyTransferCallEventOccurred( 
+                        const MCCPTransferObserver::TCCPTransferEvent aEvent ) = 0;
+
+                        
+        /**
+        * Updates the call event for observers.
+        * @param aEvent the event to be notified
+        */
+        virtual void NotifyForwardEventOccurred( 
+                        MCCPForwardObserver::TCCPForwardEvent aEvent ) = 0;
+                        
+                        
+        /**
+        * Updates changed call capability information.
+        * @param aCapsFlags new caps flags
+        */
+        virtual void CallCapsChanged( const TUint32 aCapsFlags ) = 0;
+        
+        /**
+        * Notify that remote party info has changed.
+        * @param aRemoteParty new remote party information
+        * 
+        */
+        virtual void NotifyRemotePartyInfoChanged( 
+            const TDesC& aRemoteParty) = 0;
+
+        
+    };
+
+#endif // MINCOMINGCALLOBSERVER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspcenrepobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class MCSPCenRepObserver
+*
+*/
+
+
+
+#ifndef MCSPCENREPOBSERVER_H
+#define MCSPCENREPOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Observer interface for indicating P&S changes
+*
+*/
+class MCSPCenRepObserver
+    {
+    public:  // New functions
+
+        /**
+        * Handler for changed event.
+        * @param aUid uid of setting 
+        * @param aKey the changed key
+        * @param aVal value
+        */
+        virtual void HandleNotifyCenRepL( const TUid aUid, 
+                                          const TUint32 aKey, 
+                                          TInt aVal) = 0;
+    };
+
+#endif      // MCSPCENREPOBSERVER_H   
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspcommoninfo.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class MCSPCommonInfo
+*
+*/
+
+
+
+#ifndef MCSPCOMMONINFO_H
+#define MCSPCOMMONINFO_H
+
+//  INCLUDES
+#include <e32std.h>
+#include <etelmm.h> // for ciphering status
+#include <rmmcustomapi.h>
+#include <mccpcall.h> // For CCCPCallParameters
+#include <mccecall.h>
+
+
+class CSPCall;
+class MCCPCallCommandHandling;
+class MCCPCSCall;
+
+// CLASS DECLARATION
+
+
+/**
+*  Observer interface for indicating P&S changes
+*
+*/
+class MCSPCommonInfo
+    {
+    public:  // New functions
+
+        /**
+        * Makes the request. Note that ERequestTypeDial is made with a 
+        * separate MakeDialRequest function.
+        *
+        * @param aRequest type of request
+        * @return ETrue if active, EFalse if not
+        */
+        virtual void GetCallWaitingL( const CCCECallParameters& iParams,
+                              TBool& aCallWaitingStatus ) = 0;
+                              
+        /**
+        * Diagnostic error fetching.
+        * @param aCallName name of call
+        * @return diagnostic error code
+        */
+        virtual TInt GetDiagnosticError( TName& aCallName ) = 0;
+       
+
+        /**
+        * Network security status.
+        * @since Series60_4.0
+        * @return true if calls use secured connection
+        */
+        virtual TBool NetworkSecurityStatus() const = 0;
+        
+        
+        /**
+        * Remote alerting tone playing status. 
+        * @return tone status (tone type/not played)
+        */
+        virtual RMmCustomAPI::TRemoteAlertingToneStatus GetRemoteAlertingToneStatus() = 0;
+        
+        /**
+         * Initializes with current settings.
+         * @param aParams call params 
+         */
+        virtual void InitializeCallParameters( RMobileCall::TMobileCallParamsV7& aParams ) = 0;
+
+        /**
+         * Initializes with current settings.
+         * @param aParams call params 
+         */
+        virtual void InitializeDataCallParameters( 
+                RMobileCall::TMobileHscsdCallParamsV1& aParams ) = 0;
+        
+        /**
+        * Indicates that client call has been created.
+        * @param aCall client call pointer
+        */
+        virtual void IndicateClientCall( MCCPCSCall* aCall ) = 0;
+        
+        /**
+        * Indicates incoming call.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        virtual TInt IndicateIncomingCall( MCCPCSCall* aCall ) = 0;
+        
+        /**
+        * Notify data port name of a loaned data port.
+        * @param aDataPort
+        */
+        virtual void NotifyDataPortName( TName& aDataPortName ) = 0;
+        
+        /**
+        * Indicates active hangup command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        virtual TInt IndicateActiveHangup( MCCPCallCommandHandling& aCall ) = 0;
+        
+        /**
+        * Indicates hangup command complete.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        virtual TInt IndicateHangupComplete( MCCPCallCommandHandling& aCall ) = 0;
+        
+        /**
+        * Indicates dial command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        virtual TInt IndicateDialRequest( MCCPCallCommandHandling& aCall ) = 0;
+        
+        /**
+        * Indicates answer command.
+        * @param aCall MT call
+        * @return system wide error code
+        */
+        virtual TInt IndicateAnswerRequest( MCCPCallCommandHandling& aCall ) = 0;
+
+        /**
+        * Secure specified status.
+        * @since Series60_5.0
+        * @return ETrue if specified 
+        */
+        virtual TBool SecureSpecified() const = 0;
+        
+        /**
+        * Don't report termination error
+        * @since Series60_5.0
+        * @return system wide error code
+        */
+        virtual TInt DontReportTerminationError() = 0;
+        
+    };
+
+#endif      // MCSPCOMMONINFO_H   
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspconferencestatusobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPConferenceStatusObserver class
+*
+*/
+
+
+
+#ifndef MCSPCONFERENCESTATUSOBSERVER_H
+#define MCSPCONFERENCESTATUSOBSERVER_H
+
+
+// CLASS DECLARATION
+
+/**
+*  Virtual interface for monitoring conference status.
+*
+*  @since S60 5.0 
+*/
+NONSHARABLE_CLASS(MCSPConferenceStatusObserver)
+    {
+    public:
+
+        /* Security setting event value */  
+        enum TCSPConferenceState
+            {
+            /** The conference call is in the idle state. */
+            ECSPConferenceIdle,
+            /** The conference call is in the active, connected state. */
+            ECSPConferenceActive,
+            /** The conference call is in the held, connected state. */
+            ECSPConferenceHold,
+            };
+        
+        /**
+        * Informs conference call state change.
+        * @since S60 5.0 
+        */    
+        virtual void NotifyStateChange(
+                MCSPConferenceStatusObserver::TCSPConferenceState aStatus ) = 0;
+
+    };
+
+#endif // MCSPCONFERENCESTATUSOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspdevsoundobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer for audio stream start up.
+*
+*/
+
+
+#ifndef MCSPDEVSOUNDOBSERVER_H
+#define MCSPDEVSOUNDOBSERVER_H
+
+/**
+ *  Observer interface for knowing when audio streams have been
+ *  successfully ramped up.
+ *
+ */
+class MCSPDevSoundObserver
+    {
+
+public:
+
+    /**
+     * Notification that Mic has been activated successfully
+     *     
+     */
+    virtual void MicActivatedSuccessfully() = 0;
+    
+    /**
+     * Notification that speaker has been activated successfully
+     *
+     */   
+    virtual void SpeakerActivatedSuccessfully() = 0;
+    
+    /**
+     * Notification that Mic initialisation failed.
+     *
+     */
+    virtual void MicActivationFailed() = 0;
+    
+    /**
+     * Notification that Speaker activation failed.
+     *
+     */
+    virtual void SpeakerActivationFailed() = 0;
+
+    };
+
+
+#endif // MCSPDEVSOUNDOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspincomingcallobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPIncomingCallObserver class
+*
+*/
+
+
+
+#ifndef MCSPINCOMINGCALLOBSERVER_H
+#define MCSPINCOMINGCALLOBSERVER_H
+
+//INCLUDES
+#include <etelmm.h>
+
+#include "rcsplinecontainer.h"
+
+// CLASS DECLARATION
+
+/**
+*  Virtual interface for monitoring incoming call.
+*
+*  @since S60 3.2
+*/
+class MCSPIncomingCallObserver
+    {
+    public:
+
+        /**
+        * Informs incoming call.
+        * @since S60 3.2
+        * @param aLine the line that corresponds to the call
+        * @param aCallName the name of the call
+        */    
+        virtual void IncomingCallArrived( RMobileLine& aLine, 
+                                  TName aCallName,
+                                  RCSPLineContainer::TCSPLineId aLineId ) = 0;
+
+
+    };
+
+#endif // MINCOMINGCALLOBSERVER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcsplinestatusobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPLineStatusObserver class
+*
+*/
+
+
+
+#ifndef MCSPLINESTATUSOBSERVER_H
+#define MCSPLINESTATUSOBSERVER_H
+
+//INCLUDES
+#include <etelmm.h>
+#include "rcsplinecontainer.h"
+
+// CLASS DECLARATION
+
+/**
+*  Virtual interface for monitoring line status changes.
+*
+*  @since S60 5.0
+*/
+NONSHARABLE_CLASS(MCSPLineStatusObserver)
+    {
+    public:
+
+        /**
+        * Informs about line status changes.
+        * @since S60 5.0
+        * @param aLine the line that is monitored for events
+        * @param aLineId the line id 
+        * @param aCallStatus the line status
+        */    
+        virtual void LineStatusChanged( RMobileLine& aLine,
+                RCSPLineContainer::TCSPLineId aLineId, 
+                RMobileCall::TMobileCallStatus& aCallStatus ) = 0;
+
+    };
+
+#endif // MCSPLINESTATUSOBSERVER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcsppubsubobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Declarations for class MCSPPubSubObserver
+*
+*/
+
+
+
+#ifndef MCSPPUBSUBOBSERVER_H
+#define MCSPPUBSUBOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Observer interface for indicating P&S changes
+*
+*/
+class MCSPPubSubObserver
+    {
+    public:  // New functions
+
+        /**
+        * Handler for changed event.
+        * @param aUid uid of setting 
+        * @param aKey id of setting
+        * @param aStatus status of completed AO operation
+        */
+        virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
+            const TRequestStatus& aStatus ) = 0;
+    };
+
+#endif      // MCSPPUBSUBOBSERVER_H   
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspremotealertingtoneobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer for remote alerting tone change.
+*
+*/
+
+
+#ifndef MCSPREMOTEALERTINGTONEOBSERVER_H
+#define MCSPREMOTEALERTINGTONEOBSERVER_H
+
+#include <e32std.h>
+#include <rmmcustomapi.h>
+
+/**
+ *  Observer for remote alerting tone status changes.
+ *
+ *  @lib CSPlugin
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( MCSPRemoteAlertingToneObserver )
+    {
+
+public:
+
+    /**
+     * Notification of remote alerting tone status change.
+     *
+     * @since S60 v5.0
+     * @param aNewStatus New remote alerting tone status. 
+     */
+    virtual void RemoteAlertingToneStatusChanged( 
+        RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus ) = 0;
+
+    };
+
+
+#endif // MCSPREMOTEALERTINGTONEOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspsecuritysettingobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Interface for observing security setting.
+*
+*/
+
+
+
+#ifndef MCSPSECURITYSETTINGOBSERVER_H_
+#define MCSPSECURITYSETTINGOBSERVER_H_
+
+/**
+*  Virtual interface for monitoring call ownership.
+*
+*  @since S60 3.2
+*/
+class MCSPSecuritySettingObserver
+    {
+    public:  
+
+        /* Security setting event value */  
+        enum TCSPSecuritySettingEvent
+            {
+            ESecureCall,
+            ENotSecureCall,    
+            ESecureNotSpecified
+            };
+
+    public:  
+
+        /**
+        * SecuritySettingChanged.
+        * @param aValue
+        * @since S60 3.2
+        */
+        virtual void SecuritySettingChanged( TInt aValue ) = 0;
+
+    };
+
+#endif /*MCSPSECURITYSETTINGOBSERVER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcsptimerobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Observer interface for getting notifes from CSPTimer
+*
+*/
+
+
+#ifndef MCSPTIMEROBSERVER_H
+#define MCSPTIMEROBSERVER_H
+
+/**
+ *  Observer for CSPTimer events.
+ *
+ */
+class MCSPTimerObserver
+    {
+
+public:
+
+    /**
+     * Timer request has completed.
+     *
+     * @since S60 v3.1
+     */
+    virtual void TimerEvent() = 0;
+
+    };
+
+
+#endif // MCSPTIMEROBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/mcspuusmessageobserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MCSPUUSMessageObserver class
+*
+*/
+
+
+
+#ifndef MCSPUUSMESSAGEOBSERVER_H
+#define MCSPUUSMESSAGEOBSERVER_H
+
+//INCLUDES
+  
+// CLASS DECLARATION
+
+/**
+*  Observer interface for indicating User to User Signalling
+*
+*  @since S60 3.2
+*/
+class MCSPUUSMessageObserver
+    {
+    public:
+
+        /**
+        * Informs UUS message
+        * @since S60 3.2
+        * @param aMessage
+        */    
+        virtual void UUSMessageReceived( TDesC& aMessage ) = 0;
+    };
+
+#endif // MCSPUUSMESSAGEOBSERVER_H
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/rcsplinecontainer.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Encapsulates all of the lines required by the CS Plugin.
+*
+*/
+
+
+#ifndef RCSPLINECONTAINER_H
+#define RCSPLINECONTAINER_H
+
+// INCLUDES
+
+#include    <etelmm.h>         // ETel
+#include    <mccpcscall.h>
+#include    <mccecall.h>
+
+//  CLASS DEFINITIONS 
+
+/**
+*  Encapsulates all of the lines required by the phone
+*  engine.
+*
+*  @lib phoneengine.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS(RCSPLineContainer)
+    {
+    public:
+    
+    enum TCSPLineId {
+        ECSPLineSpeech = 0,
+        ECSPLineAuxSpeech,
+        ECSPLineData,
+        ECSPLineFax
+    };
+    
+    public: // Constructors
+
+        // Default c++ constructor
+        RCSPLineContainer();
+
+    public: // new functions
+        /**
+        * Open voice, aux, data and fax lines. 
+        * @since 3.2
+        * @param aPhone open lines on this phone
+        * @return Returns an error only if the primary 
+        *         line cannot be opened, otherwise KErrNone.
+        */
+        TInt Open( RMobilePhone& aPhone,
+                   TUint32 aServiceId );
+
+
+        /**
+        * @since 3.2
+        * Close the lines. Frees all resources owned by
+        * this container.
+        */
+        void Close();
+
+        /**
+        * Access a specific line
+        * @since 1.2
+        * @param aLine The type of line to return
+        * @returns The line specified
+        */
+        RMobileLine& LineByType( TCSPLineId aLine );
+
+        /**
+        * Returns whether the specified line is open
+        * @since 3.2
+        * @param aLine line to check
+        * @return ETrue if specified line is open.
+        */
+        TBool LineIsOpen( TCSPLineId aLine );
+        
+        /**
+        * Resolve call information.
+        * @param aLineId line id (input)
+        * @param aServiceId service id (output)
+        * @param aCallType call type (output)
+        * @param aLineType line type (output)
+        */
+        TInt ResolveCallInfo( RCSPLineContainer::TCSPLineId aLineId, 
+                              TUint32& aServiceId,
+                              CCPCall::TCallType& aCallType,
+                              CCCECallParameters::TCCELineType& aLineType ) const;
+
+        /**
+        * Resolves line id based on call parameters.
+        * @param aCallParameters
+        * @return line id
+        */
+        RCSPLineContainer::TCSPLineId ResolveLineIdL( 
+                    const CCCECallParameters& aCallParameters ) const;
+
+
+    private:
+
+        // Prohibit copy constructor if not deriving from CBase.
+        RCSPLineContainer( RCSPLineContainer& );
+        // Prohibit assigment operator if not deriving from CBase.
+        RCSPLineContainer& operator=( const RCSPLineContainer& );
+
+    private:
+        RMobileLine iPrimaryLine;
+        RMobileLine iAls2Line;
+        RMobileLine iDataLine;
+        RMobileLine iFaxLine;
+        
+        TUint32 iServiceId;
+    };
+
+#endif // RCSPLINECONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/tcspskypeidparser.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parses Skype id from UUI message.
+*
+*/
+
+
+#ifndef TCSPSKYPEIDPARSER_H
+#define TCSPSKYPEIDPARSER_H
+
+#include <e32std.h>
+
+/**
+ *  Skype id parser.
+ *
+ *  @lib phoneengine.lib
+ *  @since S60 v3.2
+ */
+class TCSPSkypeIdParser 
+    {
+public:
+
+    TCSPSkypeIdParser();
+    
+    /**
+     * Creates right size buffer to be used with parse method.
+     * 
+     * @since S60 v3.2
+     * @return Buffer. Ownership given to caller.
+     */
+    static HBufC* CreateSkypeIdBufferL();
+    
+
+    /**
+     * Parses Skype if from UUI message.
+     *
+     * @since S60 v3.2
+     * @param aUUIMessage Message.
+     * @param aSkypeId Parser skype id is appended here.
+     * @return Error code. KErrNotSupported if data is not understood by
+     * parser.
+     */
+    TInt Parse( const TDesC& aUUIMessage, TDes& aSkypeId );
+    
+
+private: // data
+
+    };
+
+#endif // CSPSKYPEIDPARSER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/inc/tmshandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,154 @@
+/*
+ * 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: Starts and stops audio streams.
+ *
+ */
+
+#ifndef TMSHandler_H
+#define TMSHandler_H
+
+#include <e32base.h>
+#include "mcsptimerobserver.h"
+#include <tms.h>
+#include <tmsstreamobsrvr.h>
+
+namespace TMS {
+//FORWARD DECLARATIONS
+class TMSFactory;
+class TMSCall;
+class TMSStream;
+class TMSSource;
+class TMSSink;
+} //namespace TMS
+
+using namespace TMS;
+
+//FORWARD DECLARATIONS
+class CSPTimer;
+
+/**
+ *  Starts and stops TMS audio streams.
+ *  If the activation fails then there is a retry timer which
+ *  will try the activation later.
+ */
+NONSHARABLE_CLASS(TmsHandler) : public CBase,
+                                public MCSPTimerObserver,
+                                public TMSStreamObserver
+    {
+public:
+
+    /**
+     * Two-phased constructing.
+     */
+    static TmsHandler* NewL();
+
+    /**
+     * Two-phased constructing.
+     */
+    static TmsHandler* NewLC();
+
+    /**
+     * C++ default destructor.
+     */
+    virtual ~TmsHandler();
+
+    /**
+     * Starts audio streams ie inits mic and speaker.
+     */
+    void StartStreams();
+
+    /**
+     * Stops audio streams ie shuts down mic and speaker.
+     */
+    void StopStreams();
+
+    /**
+     * From MCSPTimerObserver.
+     * Notify from CSPTimer that timeout passed.
+     */
+    void TimerEvent();
+
+protected:
+    // Functions from base classes
+
+    // From TMSStreamObserver
+    void TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event);
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TmsHandler();
+
+    void ConstructL();
+
+    static TInt TimerCallBack(TAny* aThisPtr);
+
+    void AudioStreamsStarted();
+
+    void StartTimer();
+
+    void StartMicAndSpeaker();
+
+    TBool IsMicAndSpeakerStarted();
+
+    gint CreateTMSCallControl();
+    gint CreateFactory();
+    gint CreateCall();
+
+    gint CreateUplink();
+    gint CreateDownlink();
+    gint OpenUplink();
+    gint OpenDownlink();
+
+    gint CreateModemSource();
+    gint AddModemSourceToStream();
+    gint CreateModemSink();
+    gint AddModemSinkToStream();
+    gint CreateMicSource();
+    gint AddMicSourceToStream();
+    gint CreateSpeakerSink();
+    gint AddSpeakerSinkToStream();
+
+private:
+    // data
+
+    /**
+     * Timer for retrying the activation of streams (mic & speaker) if
+     * there was a failure in activation.
+     * Own.
+     */
+    CSPTimer* iTimer;
+
+    /**
+     * Timeout value used with timer. Timeout value doubles every retry to
+     * activate the streams.
+     */
+    TInt iTimeout;
+
+    TMSFactory* iFactory;
+    TMSCall* iTmsCall;
+    TMSCallType iCallType;
+    TMSStream* iTmsDnlink;
+    TMSStream* iTmsUplink;
+    TMSSource* iTmsMicSource;
+    TMSSource* iTmsModemSource;
+    TMSSink* iTmsSpeakerSink;
+    TMSSink* iTmsModemSink;
+    TBool iUplinkStarted;
+    TBool iDnlinkStarted;
+    };
+
+#endif // TMSHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/rom/csplugin.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Image description file for project ?myapp
+*
+*/
+
+
+#ifndef CSPLUGIN_IBY
+#define CSPLUGIN_IBY
+
+ECOM_PLUGIN( csplugin.dll, 102828E3.rsc )
+data=ZSYSTEM\install\csplugin_stub.sis    System\Install\csplugin_stub.sis
+
+#endif // CSPLUGIN_IBY
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspaudiohandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2007-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:  Implements the class CSPAudioHandler
+ *
+ */
+
+#include "cspaudiohandler.h"
+#include "tmshandler.h"
+#include "csplogger.h"
+
+// ---------------------------------------------------------------------------
+// CSPAudioHandler::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPAudioHandler* CSPAudioHandler::NewL()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPAudioHandler::NewL()" );
+    CSPAudioHandler* self = new (ELeave) CSPAudioHandler();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPAudioHandler::~CSPAudioHandler()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPAudioHandler::~CSPAudioHandler()" );
+    delete iTmsHandler;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPAudioHandler::Start
+// ---------------------------------------------------------------------------
+//
+void CSPAudioHandler::Start()
+    {
+    iCallCount++;
+    CSPLOGSTRING2(CSPINT, "CSPAudioHandler::Start callcount: %d", iCallCount);
+
+    if (iTmsHandler && iCallCount == 1)
+        {
+        iTmsHandler->StartStreams();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSPAudioHandler::Stop
+// ---------------------------------------------------------------------------
+//
+void CSPAudioHandler::Stop()
+    {
+    CSPLOGSTRING2(CSPINT, "CSPAudioHandler::Stop callcount: %d", iCallCount);
+    if (iTmsHandler && iCallCount == 1)
+        {
+        iTmsHandler->StopStreams();
+        iCallCount--;
+        }
+    else if (iCallCount > 1)
+        {
+        iCallCount--;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPAudioHandler::CSPAudioHandler()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPAudioHandler::CSPAudioHandler()");
+    iCallCount = 0; // Active calls count
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CSPAudioHandler::ConstructL()
+    {
+    if (!iTmsHandler)
+        {
+        iTmsHandler = TmsHandler::NewL();
+        }
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspcall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1909 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements class CSPCall which provides call functionality
+*
+*/
+
+
+#include <etelmm.h>
+#include <etel.h>
+#include <centralrepository.h>
+#include <settingsinternalcrkeys.h>
+#include <ccpdefs.h>
+#include <gsmerror.h>
+#include <etelsat.h>
+#include <cccpcallparameters.h>
+
+#include "cspcall.h"
+#include "cspetelcallrequester.h"
+#include "cspetelcalleventmonitor.h"
+#include "cspcallinfomonitor.h"
+#include "cspetelcallstatusmonitor.h"
+#include "cspetelcallcapsmonitor.h"
+#include "csptransferprovider.h"
+#include "cspforwardprovider.h"
+#include "csplogger.h"
+#include "csppanic.pan"
+#include "cspconsts.h"
+#include "cspaudiohandler.h"
+#include "mcspcommoninfo.h"
+#include "mcspsecuritysettingobserver.h"
+#include "tcspskypeidparser.h"
+#include "cspuuimonitor.h"
+#include "cspuuimessagesender.h"
+
+const TInt KTimesToSplitValue = 16;
+
+
+// ---------------------------------------------------------------------------
+// CSPCall::~CSPCall
+// ---------------------------------------------------------------------------
+//
+CSPCall::~CSPCall()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall <");
+
+    delete iParams;
+    iCommonInfo.IndicateHangupComplete( *this );
+    
+    if ( iAudioHandler 
+         && iAudioStatus == ECSPCallAudioStatusActive )
+        {
+        iAudioStatus = ECSPCallAudioStatusInactive;
+        iAudioHandler->Stop();
+        }
+    
+    delete iUserToUserInformation;    
+    delete iRequester;    
+    delete iCallEventMonitor;
+    delete iCallStatusMonitor;
+    delete iCallCapsMonitor; 
+    delete iCallInfoMonitor;
+    delete iForwardProvider;
+    delete iTransferProvider;
+    delete iUUIMonitor;
+    delete iUUIMessageSender;
+    delete iSkypeId;
+
+    iObservers.Close();        
+    if ( iCall.SubSessionHandle() )
+        {
+        iCall.Close();
+        }
+    
+    CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::SetAudioHandler
+// ---------------------------------------------------------------------------
+//
+void CSPCall::SetAudioHandler( CSPAudioHandler* aHandler )
+    {
+    CSPLOGSTRING2(CSPINT, "CSPCall::SetAudioHandler handler: %x", aHandler);
+    iAudioHandler = aHandler;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::SecuritySettingChanged
+// ---------------------------------------------------------------------------
+//
+void CSPCall::SecuritySettingChanged( TInt aValue )
+    {
+    switch ( aValue )
+        {
+        case MCSPSecuritySettingObserver::ESecureCall:         
+            {
+            CSPLOGSTRING(CSPINT, 
+                    "CSPCall::SecuritySettingChanged Sending 'secure call' event");
+            NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureCall );
+            break; 
+            }            
+        case MCSPSecuritySettingObserver::ENotSecureCall:                     
+            {
+            CSPLOGSTRING(CSPINT, 
+                    "CSPCall::SecuritySettingChanged Sending 'not secure call' event");
+            NotifyCallEventOccurred( MCCPCallObserver::ECCPNotSecureCall );
+            break;  
+            }
+        case MCSPSecuritySettingObserver::ESecureNotSpecified:                     
+            {
+            CSPLOGSTRING(CSPINT, 
+                    "CSPCall::SecuritySettingChanged Sending SecureNotSpecified");
+            NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureNotSpecified );
+            break;  
+            }
+
+        default: 
+            {
+            CSPLOGSTRING(CSPERROR, "CSPCall::SecuritySettingChanged, \
+                unknown event");            
+            break;  
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::RemoteAlertingToneStatusChanged
+// Sends EarlyMediaStarted event to observer if network has started to 
+// play remote alerting tone. There is only one known use case: Network
+// starts playing alerting tone during connecting state. 
+//
+// This RemoteAlertingToneStatusChanged is called for every call, 
+// so it is calls responsibility to determine if the 
+// observer should be notified.
+// ---------------------------------------------------------------------------
+//
+void CSPCall::RemoteAlertingToneStatusChanged(
+    RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus )
+    {
+    CSPLOGSTRING2(CSPINT, 
+        "CSPCall::RemoteAlertingToneStatusChanged new status: %d", aNewStatus );
+    
+    if ( aNewStatus == RMmCustomAPI::EUiStopTone ||
+         aNewStatus == RMmCustomAPI::EUiNoTone ) // NW tells us to stop playing 
+        {
+        // Connecting is only state where network starts playing the tone.
+        if ( iCallState == MCCPCallObserver::ECCPStateConnecting )
+            {
+            NotifyCallEventOccurred( 
+                MCCPCallObserver::ECCCSPEarlyMediaStarted );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyCallStateChangedETel
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyCallStateChangedETel( RMobileCall::TMobileCallStatus aState ) 
+    {
+    CSPLOGSTRING3(CSPINT, 
+                  "CSPCall::NotifyCallStateChangedETel < state: %d this: %x", 
+                  aState, this );
+    switch ( aState )
+        {
+        /*
+        Cannot receive any mapping call statuses from ETel to following
+        optional states:
+        
+        ECCPStateForwarding   MO call is being forwarded at receiver end
+        ECCPStateQueued       Call is queued locally.
+        
+        The commented observer calls are for CS specific call states.
+        */
+        
+        // Indicates that the call is idle or unknown.
+        case RMobileCall::EStatusIdle:
+        case RMobileCall::EStatusUnknown:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Idle");
+
+            // If audio still active
+            if ( iAudioStatus == ECSPCallAudioStatusActive 
+                 && iAudioHandler
+                 && iParams->CallType() == CCPCall::ECallTypeCSVoice )
+                {
+                iAudioStatus = ECSPCallAudioStatusInactive;
+                iAudioHandler->Stop();
+                }
+                
+            // Notify error in case not going through disconnecting
+            if ( iCallState != MCCPCallObserver::ECCPStateDisconnecting 
+                     && !iTerminationErrorNotified )
+                {
+                CheckAndNotifyTerminationError();
+                }
+            
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateIdle );
+            iCommonInfo.IndicateHangupComplete( *this );
+            break;
+            }
+        // The call is dialling.
+        case RMobileCall::EStatusDialling:
+            CSPLOGSTRING(CSPINT, "CSPCall callstate Dialling");
+            {
+            if ( iAudioHandler && iParams->CallType() == CCPCall:: ECallTypeCSVoice )
+                {
+                iAudioStatus = ECSPCallAudioStatusActive;
+                iAudioHandler->Start();
+                }
+                
+            iDontReportTerm = EFalse;
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateDialling );
+            break;
+            }            
+        //Indicates that the MT call is ringing but not answered yet by 
+        // the local user
+        case RMobileCall::EStatusRinging:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Ringing");
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateRinging );
+            break;
+            }
+        // Indicates that the local user has answered the MT call but
+        // the network has not acknowledged the call connection yet. 
+        case RMobileCall::EStatusAnswering:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Answering");
+
+            if ( !iMobileOriginated
+                && iAudioHandler 
+                && iAudioStatus == ECSPCallAudioStatusInactive
+                && iParams->CallType() == CCPCall::ECallTypeCSVoice )
+                {
+                iAudioStatus = ECSPCallAudioStatusActive;
+                iAudioHandler->Start();
+                }
+
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateAnswering );
+            break;
+            }
+        // MO Call: the network notifies to the MS that the remote party
+        // is now ringing. 
+        case RMobileCall::EStatusConnecting:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETelConnecting");
+            RMmCustomAPI::TRemoteAlertingToneStatus tone = 
+                iCommonInfo.GetRemoteAlertingToneStatus();
+            if ( tone == RMmCustomAPI::EUiNoTone ||
+                 tone == RMmCustomAPI::EUiStopTone )
+                {
+                NotifyCallStateChangedWithInband( MCCPCallObserver::ECCPStateConnecting );
+                }
+            else
+                {
+                NotifyCallStateChanged( MCCPCallObserver::ECCPStateConnecting );
+                }
+            break;
+            }
+        // Indicates that call is connected and active.
+        case RMobileCall::EStatusConnected:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Connected");
+
+            iDontReportTerm = ETrue;
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateConnected );
+            break;
+            }
+        // Indicates that call is disconnecting. (Same as RCall::HangingUp)
+        case RMobileCall::EStatusDisconnecting:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Disconnecting");
+
+            if ( !iTerminationErrorNotified )
+                {
+                CheckAndNotifyTerminationError();
+                }
+            
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateDisconnecting );                
+            break;
+            }
+        // Indicates that the call is disconnecting with inband data
+        // (to enable the network to send an audio tone), signifying
+        // that the call is not to be released until user terminates call
+        case RMobileCall::EStatusDisconnectingWithInband:
+            {
+            CSPLOGSTRING(CSPINT, 
+                "CSPCall::NotifyCallStateChangedETel DisconnectingWithInband");
+
+            if ( !iTerminationErrorNotified )
+                {
+                CheckAndNotifyTerminationError();
+                }
+            
+            NotifyCallStateChangedWithInband( 
+                                MCCPCallObserver::ECCPStateDisconnecting );
+            break;
+            }
+        // Indicates that the call is connected but on hold.  
+        case RMobileCall::EStatusHold:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Hold");
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateHold );
+            break;
+            }
+        case RMobileCall::EStatusTransferring:
+            {
+            CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Transferring");
+            NotifyCallStateChanged( MCCPCallObserver::ECCPStateTransferring );
+            break;
+            }
+            
+        // Indicates that call is undergoing temporary channel loss
+        // and it may or may not be reconnected.  
+        case RMobileCall::EStatusReconnectPending: // fall through 
+        //Indicates that the call is the non-active half of an alternating
+        // call. This call is waiting for its active half or the remote
+        // end to switch alternating call mode.
+        case RMobileCall::EStatusWaitingAlternatingCallSwitch: // fall through
+        case RMobileCall::EStatusTransferAlerting:
+            {
+            CSPLOGSTRING2(CSPINT, 
+                    "CSPCall::NotifyCallStateChangedETel no special handling for state %d",
+                    aState);            
+            break;
+            }
+
+        default:
+            {
+            CSPLOGSTRING(CSPERROR, 
+                    "CSPCall::NotifyCallStateChangedETel callstate UNKNOWN");
+            break;
+            }
+        }
+    CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyCallStateChangedETel >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyCallEventOccurred
+// Notifies observers about call events
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyCallEventOccurred( 
+    MCCPCallObserver::TCCPCallEvent aEvent )
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCall::NotifyCallEventOccurred < event: %d", aEvent);
+    
+    TInt obsCount = iObservers.Count();
+    for ( TInt i = 0; i < obsCount; i++ )
+        {
+        CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred obs=%d",i);
+        MCCPCallObserver *obs = iObservers[i];
+        if ( obs )
+            {
+            obs->CallEventOccurred( aEvent, this );
+            }
+            
+        CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred ok obs=%d",i);
+        }
+        
+    CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred > event: %d", aEvent);
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyTransferCallEventOccurred
+// Forward notification of transfer event to it's provider
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyTransferCallEventOccurred( 
+    MCCPTransferObserver::TCCPTransferEvent aEvent ) 
+    {
+    CSPLOGSTRING2(CSPINT, "CSPCall::NotifyTransferCallEventOccurred %d", aEvent);
+    // forward the method call to CSPTransferProvider object
+    iTransferProvider->TransferEventOccurred( aEvent );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyForwardEventOccurred
+// Notifies observers about call events
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyForwardEventOccurred( 
+    MCCPForwardObserver::TCCPForwardEvent aEvent )
+    {
+    CSPLOGSTRING2(CSPINT, "CSPCall::NotifyForwardEventOccurred %d", aEvent);
+    iForwardProvider->NotifyForwardEventOccurred( aEvent );    
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::CallName
+// Get call name
+// ---------------------------------------------------------------------------
+//
+void CSPCall::CallName( TName& aCallName )
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::CallName");
+    aCallName.Zero();
+    aCallName.Append( iCallName );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::DialRequestFailed
+// Handles situations when dial fails
+// ---------------------------------------------------------------------------
+//
+void CSPCall::DialRequestFailed( TInt aErrorCode )
+    {
+    CSPLOGSTRING(CSPERROR, "CSPCall::DialRequestFailed");
+    iDialCompletionCode = aErrorCode;
+    
+    // If state has not changed 
+    // ( e.g. in case of dial could not be initiated by network problem)
+    if ( iCallStatusMonitor->State() == 
+                   RMobileCall::RMobileCall::EStatusUnknown )
+        {
+        NotifyErrorOccurred( iRequester->MapError( aErrorCode ) );              
+        
+        // Force release since otherwise call remains unreleased
+        CSPLOGSTRING(CSPERROR, "CSPCall::DialRequestFailed() Force Idle");
+        NotifyCallStateChanged( MCCPCallObserver::ECCPStateIdle );
+        }
+    
+    // If dial request has completed after notifying disconnecting state
+    else if ( iCallState == MCCPCallObserver::ECCPStateDisconnecting
+             && !iTerminationErrorNotified )
+        {
+        CheckAndNotifyTerminationError();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::EmergencyDialRequestFailed
+// Handles situations when emergency dial fails
+// ---------------------------------------------------------------------------
+//
+void CSPCall::EmergencyDialRequestFailed( TInt /*aErrorCode*/ )
+    {
+    CSPLOGSTRING(CSPERROR, "CSPCall::EmergencyDialRequestFailed");
+    
+    // Always same error code for CCE
+    NotifyErrorOccurred( ECCPEmergencyFailed );
+    
+    // Mark that exit code will not be used
+    iTerminationErrorNotified = ETrue;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyErrorOccurred
+// Notifies observers about errors
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyErrorOccurred( TCCPError aError )
+    {
+    CSPLOGSTRING2(CSPERROR, "CSPCall::NotifyErrorOccurred err %d", aError );
+
+    TInt obsCount = iObservers.Count();
+    for ( TInt i = 0; i < obsCount; i++ )
+        {
+        MCCPCallObserver *obs = iObservers[i];
+        if ( obs )
+            {
+            obs->ErrorOccurred( aError, this );
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPCall::CallCapsChanged
+// Notifies observers about new capabilities.
+// ---------------------------------------------------------------------------
+//
+void CSPCall::CallCapsChanged( const TUint32 aCapsFlags )
+    {
+    CSPLOGSTRING2(CSPERROR, "CSPCall::CallCapsChanged %b", aCapsFlags );
+    iCapsFlags = aCapsFlags;
+    TInt obsCount = iObservers.Count();
+    for ( TInt i = 0; i < obsCount; i++ )
+        {
+        MCCPCallObserver *obs = iObservers[i];
+        if ( obs )
+            {
+            obs->CallCapsChanged( aCapsFlags, this );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPCall::GetMobileCallInfo
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::GetMobileCallInfo( TDes8& aCallInfo ) const
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::GetMobileCallInfo");
+    return iCall.GetMobileCallInfo( aCallInfo );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPCall::GetMobileDataCallCaps
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::GetMobileDataCallCaps( TDes8& /*aCaps*/ ) const
+    {
+    CSPLOGSTRING(CSPERROR, 
+            "CSPCall::GetMobileDataCallCaps ERROR, Not supported");
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Dial
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Dial()
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPCall::Dial" );
+    // Parameters not given, must create empty descriptor.
+    TBuf8<1> params;
+    return Dial(params);
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::RemoteParty
+// ---------------------------------------------------------------------------
+//
+const TDesC& CSPCall::RemoteParty() const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::RemoteParty");
+    return iRemotePartyNumber;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::RemotePartyName
+// ---------------------------------------------------------------------------
+//
+const TDesC& CSPCall::RemotePartyName()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::RemotePartyName");
+    return iRemotePartyName;
+    }
+  
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::DialledParty
+// ---------------------------------------------------------------------------
+//  
+const TDesC& CSPCall::DialledParty() const 
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::DialledParty %S", &iRemotePartyNumber);
+    return iRemotePartyNumber;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Answer
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Answer()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::Answer <");
+    TInt ret( KErrNone );
+    
+    if ( iCallState == MCCPCallObserver::ECCPStateRinging 
+         || iCallState == MCCPCallObserver::ECCPStateQueued )
+        {    
+        if( iMobileOriginated )
+            {
+            ret = KErrGeneral;
+            }
+        else if( iCallState != MCCPCallObserver::ECCPStateRinging && 
+            iCallState != MCCPCallObserver::ECCPStateQueued )
+            {
+            ret = KErrAccessDenied;
+            }
+        else
+            {
+            ret = iCommonInfo.IndicateAnswerRequest( *this );
+            }
+        }
+    else
+        {
+        // Not correct state for answer
+        ret = KErrNotReady;
+        }
+    
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Answer > ret %d", ret);
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCallCommandHandling
+// CSPCall::PerformAnswerRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::PerformAnswerRequest()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::PerformAnswerRequest");
+    
+    TInt ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeAnswer );
+    CSPLOGSTRING3(CSPINT, 
+            "CSPCall::Answer request performed, call state %d ret: %d", iCallState, ret);
+
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Reject
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Reject()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::Reject <");
+    TInt ret;
+    if ( iCallState == MCCPCallObserver::ECCPStateRinging
+         || iCallState == MCCPCallObserver::ECCPStateQueued
+         || iCallState == MCCPCallObserver::ECCPStateAnswering )
+        {        
+        CSPLOGSTRING( CSPREQIN, "CSPCall::Reject 2" );
+        ret = HangUp();
+        }
+    else
+        {
+        ret = KErrNotReady;
+        }
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Reject > ret: %d", ret );
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Queue
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Queue()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::Queue");
+    TBool callWaitingState;
+    iDontReportTerm = ETrue;
+    
+    TRAPD( res, iCommonInfo.GetCallWaitingL( *iParams, callWaitingState ) );
+    if( res == KErrNone )
+        {
+        if ( callWaitingState )
+            {
+            CSPLOGSTRING(CSPREQIN, "CSPCall::Queue Call Waiting On");
+            iCallState = MCCPCallObserver::ECCPStateQueued;
+            
+            // Notify Queued state
+            TInt obsCount = iObservers.Count ( );
+            for (TInt i = 0; i < obsCount; i++ )
+                {
+                MCCPCallObserver *obs = iObservers[i];
+                if ( obs )
+                    {
+                    obs->CallStateChanged ( iCallState, this );
+                    }
+                }
+            CSPLOGSTRING(CSPOBJECT, "CSPCall::Queue ok");
+
+            return KErrNone;
+            }
+        else
+            {
+            CSPLOGSTRING(CSPREQIN, "CSPCall::Queue Call Waiting Off");
+            }
+        }
+    else
+        {
+        CSPLOGSTRING2(CSPERROR, 
+                      "CSPCall::Queue Error %d with CR. Call Waiting Off", 
+                      res);
+        }
+    
+    return KErrNotSupported;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Ringing
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Ringing()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::Ringing");
+    iDontReportTerm = ETrue;
+    
+    // Ringing state is accepted because MT-call goes to ringing
+    // state in the beginning based on ETel state maching.
+    if ( iCallState == MCCPCallObserver::ECCPStateIdle ||
+         iCallState == MCCPCallObserver::ECCPStateRinging ) 
+        {
+        NotifyRingingState();
+        return KErrNone;
+        }
+    else if ( iCallState == MCCPCallObserver::ECCPStateAnswering )
+        {
+        // Do nothing if already in Answering state (autoanswer).   
+        return KErrNone; 
+        }
+        
+    return KErrNotReady;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::HangUp
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::HangUp()
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::HangUp this: %x", this);
+    TInt ret( KErrNone );
+    
+    CSPEtelCallRequester::TRequestType req = iRequester->Request();
+    if ( req == CSPEtelCallRequester::ERequestTypeDial || 
+         ( req == CSPEtelCallRequester::ERequestTypeDialEmergency ) )
+        {
+        CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 1: Cancel ongoing dial");
+        ret = iRequester->DialCancel();
+        CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp Canceled");
+        }
+    else if ( req == CSPEtelCallRequester::ERequestTypeHangup )
+        {
+        CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 2");
+        ret = KErrAlreadyExists;
+        }
+    else if ( req == CSPEtelCallRequester::ERequestTypeNone 
+              && iCallState != MCCPCallObserver::ECCPStateIdle )
+        {
+        CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 3");
+        ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeHangup );
+        iCommonInfo.IndicateActiveHangup( *this );
+        }
+    else if ( req == CSPEtelCallRequester::ERequestTypeNone )
+        {
+        CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 4");
+        ret = KErrAlreadyExists;
+        }
+    else
+        {
+        CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 5");
+        // Request pending, must be canceled
+        iRequester->Cancel();
+        ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeHangup );
+        iCommonInfo.IndicateActiveHangup( *this );
+        }
+        
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Cancel
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Cancel()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::Cancel");
+    return HangUp();
+    }
+        
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Hold
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Hold()
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Hold this: %x", this);
+    TInt ret;
+        
+    if ( iCallState == MCCPCallObserver::ECCPStateConnected )
+        {
+        CSPLOGSTRING(CSPREQOUT, "CSPCall::Hold make request");
+
+        // Set call on hold
+        ret = iRequester->MakeRequest( 
+                    CSPEtelCallRequester::ERequestTypeHold );
+        if ( ret != KErrNone )
+            {
+            CSPLOGSTRING2(CSPERROR, 
+                "CSPCall::Hold ERROR: %d", ret);
+            }
+        }
+    else if ( iCallState == MCCPCallObserver::ECCPStateHold )
+        {
+        CSPLOGSTRING(CSPERROR, "CSPCall::Hold : already held");
+        ret = KErrAlreadyExists;
+        }
+    else
+        {
+        CSPLOGSTRING(CSPERROR, "CSPCall::Hold not allowed");
+        ret = KErrNotReady;
+        }
+
+    return ret;
+    } 
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Resume
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Resume()
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Resume this: %x", this);
+    TInt ret;
+        
+    if ( iCallState == MCCPCallObserver::ECCPStateHold )
+        {
+        CSPLOGSTRING(CSPREQOUT, "CSPCall::Resume request");
+        
+        ret = iRequester->MakeRequest( 
+            CSPEtelCallRequester::ERequestTypeResume );
+        if ( KErrNone != ret )
+            {
+            CSPLOGSTRING2(CSPERROR, "CSPCall::Resume ERROR %d", ret);
+            }
+        }
+    else if ( iCallState == MCCPCallObserver::ECCPStateConnected )
+        {
+        CSPLOGSTRING(CSPERROR, "CSPCall::Resume already connected" );
+        ret = KErrAlreadyExists;
+        }
+    else
+        {
+        CSPLOGSTRING(CSPERROR, "CSPCall::Resume not held state" );
+        ret = KErrNotReady;
+        }
+    
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Swap
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Swap()
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Swap this: %x", this);
+    TInt ret;
+    if ( iCallState == MCCPCallObserver::ECCPStateConnected
+         || iCallState == MCCPCallObserver::ECCPStateHold )
+        {    
+        ret = iRequester->MakeRequest( CSPEtelCallRequester::ERequestTypeSwap );
+        if ( ret )
+            {
+            CSPLOGSTRING2( CSPERROR, "CSPCall::Swap Error %d", ret );
+            }
+        }
+    else
+        {
+        ret = KErrNotReady;
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::IsMobileOriginated
+// ---------------------------------------------------------------------------
+//
+TBool CSPCall::IsMobileOriginated() const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::IsMobileOriginated");
+    return iMobileOriginated;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::State
+// ---------------------------------------------------------------------------
+//
+MCCPCallObserver::TCCPCallState CSPCall::State() const
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::State %d", iCallState);
+    return iCallState;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Uid
+// ---------------------------------------------------------------------------
+//
+TUid CSPCall::Uid() const
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Uid %d", KCSPImplementationUid);
+    return KCSPImplementationUid;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Caps
+// ---------------------------------------------------------------------------
+//
+MCCPCallObserver::TCCPCallControlCaps CSPCall::Caps( ) const
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Caps %b", iCapsFlags );
+    return (MCCPCallObserver::TCCPCallControlCaps) iCapsFlags;
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::SetParameters
+// ---------------------------------------------------------------------------
+//
+void CSPCall::SetParameters( const CCCPCallParameters& /*aNewParams*/ )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCall::SetParameters ERROR Can't set params");
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Parameters
+// ---------------------------------------------------------------------------
+//
+const CCCPCallParameters& CSPCall::Parameters() const
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::Parameters");
+    return *iParams;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::TransferProvider
+// ---------------------------------------------------------------------------
+//
+MCCPTransferProvider* CSPCall::TransferProviderL(const MCCPTransferObserver& 
+                                                            aObserver )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::TransferProvider");
+    iTransferProvider->AddObserverL( aObserver );
+    return iTransferProvider;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::ForwardProvider
+// ---------------------------------------------------------------------------
+//
+MCCPForwardProvider* CSPCall::ForwardProviderL( 
+        const MCCPForwardObserver& aObserver )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::ForwardProvider");
+    iForwardProvider->AddObserverL( aObserver );
+    return iForwardProvider;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::AddObserverL
+// ---------------------------------------------------------------------------
+//
+void CSPCall::AddObserverL( const MCCPCallObserver& aObserver )
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::AddObserverL %x", &aObserver);
+    if ( iObservers.Find( &aObserver ) == KErrNotFound )
+        {
+        iObservers.AppendL( &aObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// Removes observer.
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::RemoveObserver( const MCCPCallObserver& aObserver )
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::RemoveObserver %x", &aObserver);
+    
+    TInt found = iObservers.Find( &aObserver );
+    if ( found != KErrNotFound )
+        {
+        iObservers.Remove( found );
+        return KErrNone;
+        }
+        
+    return found;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::IsCallForwarded
+// ---------------------------------------------------------------------------
+//
+TBool CSPCall::IsCallForwarded( ) const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::IsCallForwarded <");
+    TBool ret( EFalse );
+    TInt err( KErrNone );
+    RMobileCall::TMobileCallInfoV3 callInfo;
+    RMobileCall::TMobileCallInfoV3Pckg pck( callInfo );
+    err = iCall.GetMobileCallInfo( pck );
+    if (err == KErrNone )
+        {
+        ret = callInfo.iForwarded;
+        }
+    
+    CSPLOGSTRING2(CSPREQIN, 
+            "CSPCall::IsCallForwarded > forwarder: %d", ret );
+    
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::IsSecured
+// ---------------------------------------------------------------------------
+//
+TBool CSPCall::IsSecured( ) const
+    {    
+    CSPLOGSTRING(CSPREQIN, "CSPCall::IsSecured");
+    return iCommonInfo.NetworkSecurityStatus();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::SecureSpecified
+// ---------------------------------------------------------------------------
+//
+TBool CSPCall::SecureSpecified( ) const
+    {    
+    CSPLOGSTRING(CSPREQIN, "CSPCall::SecureSpecified");
+    return iCommonInfo.SecureSpecified();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::Tone
+// ---------------------------------------------------------------------------
+//
+TCCPTone CSPCall::Tone() const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::Tone <");
+    TCCPTone tone( ECCPNoSoundSequence );
+
+    if ( iCallState == MCCPCallObserver::ECCPStateConnecting )
+        {
+        RMmCustomAPI::TRemoteAlertingToneStatus ts = iCommonInfo.GetRemoteAlertingToneStatus();
+        
+        if (ts == RMmCustomAPI::EUiRbtTone )
+            {
+            tone = ECCPRemoteAlerting;
+            }
+        else if ( ts == RMmCustomAPI::EUiStopTone )
+            {
+            tone = ECCPNoSoundSequence;
+            }
+        else            
+            {
+            // No tone
+            tone = ECCPNoSoundSequence;
+            }
+        }
+    else
+        {
+        // Handle disconnecting tones      
+        TInt callDisconnectingError = ExitCodeError();
+        CSPLOGSTRING2(CSPINT, "CSPCall::Tone exit code err: %d", callDisconnectingError);
+
+        switch( callDisconnectingError )
+            {
+            case KErrNone:
+                // GSM: DIAL TONE (optional) - not used in Nokia phones 
+                CSPLOGSTRING(CSPERROR, "CSPCall::Tone: No sound");
+                break;
+            case KErrGsmCCUserBusy:
+                // GSM: SUBSCRIBER BUSY
+                tone = ECCPToneUserBusy;
+                CSPLOGSTRING(CSPINT, "CSPCall::Tone: Subscriber Busy");
+                break;
+                // Fall through
+            case KErrGsmCCNumberChanged:
+            case KErrGsmCCResponseToStatusEnquiry:
+            case KErrGsmCCNormalUnspecified:
+                // GSM: NONE, Nokia phones: radio path not available
+                tone = ECCPToneRadioPathNotAvailable;
+                CSPLOGSTRING(CSPINT, "CSPCall::Tone: RadioPathNotAvailable");
+                break;      
+            case KErrGsmCCNoChannelAvailable:
+            case KErrGsmCCTemporaryFailure:
+            case KErrGsmCCSwitchingEquipmentCongestion:
+            case KErrGsmCCRequestedChannelNotAvailable:
+            case KErrGsmCCQualityOfServiceNotAvailable:
+            case KErrGsmCCBearerCapabilityNotCurrentlyAvailable:
+                // GSM: CONGESTION
+                tone = ECCPToneCongestion;
+                CSPLOGSTRING(CSPINT, "CSPCall::Tone: Congestion");
+                break;
+            case KErrGsmCCUnassignedNumber:
+            case KErrGsmCCNoRouteToDestination:
+            case KErrGsmCCChannelUnacceptable:
+            case KErrGsmCCOperatorDeterminedBarring:
+            case KErrGsmCCUserNotResponding:
+            case KErrGsmCCUserAlertingNoAnswer:
+            case KErrGsmCCCallRejected:
+            case KErrGsmCCNonSelectedUserClearing:
+            case KErrGsmCCDestinationOutOfOrder:
+            case KErrGsmCCInvalidNumberFormat:
+            case KErrGsmCCFacilityRejected:
+            case KErrGsmCCNetworkOutOfOrder:
+            case KErrGsmCCAccessInformationDiscarded:
+            case KErrGsmCCResourceNotAvailable:
+            case KErrGsmCCRequestedFacilityNotSubscribed:
+            case KErrGsmCCIncomingCallsBarredInCug:
+            case KErrGsmCCBearerCapabilityNotAuthorised:
+            case KErrGsmCCServiceNotAvailable:
+            case KErrGsmCCBearerServiceNotImplemented:
+            case KErrGsmCCChannelTypeNotImplemented:
+            case KErrGsmCCAcmGreaterThanAcmMax:
+            case KErrGsmCCRequestedFacilityNotImplemented:
+            case KErrGsmCCOnlyRestrictedDigitalInformationBCAvailable:
+            case KErrGsmCCServiceNotImplemented:
+            case KErrGsmCCInvalidCallReferenceValue:
+            case KErrGsmCCChannelDoesNotExist:
+            case KErrGsmCCSuspendedCallExistsButCallIdentityDoesNotWork:
+            case KErrGsmCCCallIdentityInUse:
+            case KErrGsmCCNoCallSuspended:
+            case KErrGsmCCRequestedCallIdentityAlreadyCleared:
+            case KErrGsmCCUserNotInCug:
+            case KErrGsmCCIncompatibleDestination:
+            case KErrGsmCCInvalidTransitNetworkSelection:
+            case KErrGsmCCIncompatibleSegmentedMessage:
+            case KErrGsmCCSemanticallyIncorrectMessage:
+            case KErrGsmCCInvalidMandatoryInformation:
+            case KErrGsmCCNonExistentMessageType:
+            case KErrGsmCCIncompatibleMessageInProtocolState:
+            case KErrGsmCCNonExistentInformationElement:
+            case KErrGsmCCConditionalIEError:
+            case KErrGsmCCIncompatibleMessageInCallState:
+            case KErrGsmCCRecoveryOnTimerExpiry:
+            case KErrGsmCCUnspecifiedProtocolError:
+            case KErrGsmCCUnspecifiedInterworkingError:
+                // GSM: SPECIAL INFORMATION
+                tone = ECCPToneSpecialInformation;
+                CSPLOGSTRING(CSPINT, "CSPCall::Tone: Special Information");
+                break;
+            default:
+                CSPLOGSTRING(CSPERROR, "CSPCall::Tone: ERROR not found");
+                break;
+            }
+         }
+    
+    CSPLOGSTRING2(CSPREQIN, "CSPCall::Tone > tone: %d", tone);
+    return tone;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPCall::NoFdnCheck
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NoFDNCheck( )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::NoFDNCheck");
+    iFdnCheck = EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPCall::LogDialedNumber
+// ---------------------------------------------------------------------------
+//
+TBool CSPCall::LogDialedNumber() const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::LogDialedNumber true");
+    return ETrue;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPCall::Dial
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::Dial( const TDesC8& /*aCallParams*/ )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::Dial");
+    return iCommonInfo.IndicateDialRequest( *this );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCallCommandHandling
+// CSPCall::PerformDialRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::PerformDialRequest()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::PerformDialRequest");
+    iDialCompletionCode = KErrNone;
+    iTerminationErrorNotified = EFalse;
+    
+    // Send the User to User Information.
+    if( iUserToUserInformation->Length() )
+        {
+        iUUIMessageSender->SendUUIMessage( *iUserToUserInformation );
+        }
+    
+    return DialFdnCond( iFdnCheck );
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPCall::CSPCall
+// ---------------------------------------------------------------------------
+//
+CSPCall::CSPCall( RMobileLine& aLine, 
+                  TBool aMobileOriginated,
+                  const TDesC& aName,
+                  MCSPCommonInfo& aCommonInfo,
+                  TBool aIsEmergencyCall ) : 
+                    iLine( aLine ),
+                    iMobileOriginated( aMobileOriginated ),
+                    iName( aName ), 
+                    iCommonInfo( aCommonInfo ),
+                    iTerminationErrorNotified( EFalse ),
+                    iIsEmergencyCall( aIsEmergencyCall),
+                    iFdnCheck(ETrue),
+                    iAudioStatus( ECSPCallAudioStatusInactive ) 
+                    
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCall::CSPCall");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::ConstructL
+// Constructing CSPCall in 2nd phase
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::ConstructL( const CCCECallParameters& aParams )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL <");
+
+    // Create cloned copy of call parameters 
+    iParams = static_cast<CCCECallParameters*>( aParams.CloneL() );
+    
+    // Open call handle  
+    OpenCallHandleL(); 
+
+    // Update call info 
+    UpdateCallInfo(); 
+    
+    // Update call state from ETel 
+    UpdateCallState(); 
+    
+    // Create call handlers for call related requests 
+    // and for monitoring call related events 
+    CreateCallHandlersL(); 
+        
+    CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::OpenCallHandleL
+// Open call handle, calls either OpenNewCallL or OpenExistingCallL depending 
+// of the call direction and if the call is a client call       
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::OpenCallHandleL()
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL <");
+    
+    if ( iMobileOriginated )
+        {
+        // There is no existing call on line, open new call 
+        OpenNewCall();
+        }
+    else
+        {
+        // Mobile terminated call on line, open existing call 
+        OpenExistingCallL( iName ); 
+        }
+
+    CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::UpdateCallInfoL
+// Update call info including remote party name and number data  
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::UpdateCallInfo()
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfo <");
+    RMobileCall::TMobileCallInfoV7 callInfo;
+    RMobileCall::TMobileCallInfoV7Pckg pck( callInfo );
+    TInt err = iCall.GetMobileCallInfo( pck );
+    
+    UpdateCallInfoImpl( callInfo );
+
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfo >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::UpdateCallInfoImpl
+// Implementation for UpdateCallInfo().
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::UpdateCallInfoImpl( RMobileCall::TMobileCallInfoV7 aCallInfo )
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl <");
+
+    if ( iMobileOriginated )
+        {
+        // Call wasn't added by ETel monitor, update info accordingly
+        UpdateCallNameNumberInfo( aCallInfo, EFalse ); 
+        }
+    else
+        {
+        // Call was added by ETel monitor, update info accordingly
+        UpdateCallNameNumberInfo( aCallInfo, ETrue );
+        }
+    
+
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::UpdateCallOrigin
+// Set call origin to CCCECallParameters.
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::UpdateCallOrigin( RMobileCall::TMobileCallInfoV7 aCallInfo )
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin <");
+
+    if ( RMobileCall::EOriginatorSIM == aCallInfo.iCallParamOrigin )
+        {
+        iParams->SetOrigin(CCCECallParameters::ECCECallOriginSAT);
+        iParams->SetAlphaId(aCallInfo.iAlphaId);
+        }
+
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin >");
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CSPCall::UpdateCallStateL
+//   
+// ---------------------------------------------------------------------------
+//    
+int CSPCall::UpdateCallState()
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallState <");
+    TInt err( KErrNone ); 
+    
+    // Update call state from ETel
+    RMobileCall::TMobileCallStatus etelState;
+    err = iCall.GetMobileCallStatus( etelState );
+    if ( KErrNone == err )
+        {
+        iCallState = CCPStateFromETelState( etelState );
+        }
+    CSPLOGSTRING2(CSPINT, "CSPCall::UpdateCallState > res %d", err);
+    
+    return err; 
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::CreateCallHandlersL
+// Create call handlers for call related requests and call monitoring  
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::CreateCallHandlersL()
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL <");
+
+    iRequester = CSPEtelCallRequester::NewL( *this, iCall );
+
+    iCallEventMonitor = CSPEtelCallEventMonitor::NewL( *this, iCall );
+    iCallEventMonitor->StartMonitoring();
+    iCallStatusMonitor = CSPEtelCallStatusMonitor::NewL( *this, iCall );
+    iCallStatusMonitor->StartMonitoring();
+    
+    iCallCapsMonitor = CSPEtelCallCapsMonitor::NewL( *this, iCall );
+    iCallCapsMonitor->StartMonitoring();
+    iCapsFlags = iCallCapsMonitor->FetchCallControlCapsL();
+    
+    iCallInfoMonitor = CSPCallInfoMonitor::NewL( *this, iCall );
+    iCallInfoMonitor->StartMonitoring();
+    
+    // Start UUI monitor and create message sender 
+    iSkypeId = TCSPSkypeIdParser::CreateSkypeIdBufferL();
+    iUUIMonitor = CSPUUIMonitor::NewL( iCall,*this );
+    iUUIMonitor->StartMonitor();
+    iUUIMessageSender = CSPUUIMessageSender::NewL( iCall );
+    iUserToUserInformation = iParams->UUSId().AllocL();
+    
+    // Transfer provider
+    iTransferProvider = CSPTransferProvider::NewL( iCall, *this, iCommonInfo );
+
+    // Forward provider
+    iForwardProvider = CSPForwardProvider::NewL();
+    
+    CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyRingingState
+// Gets to ringing state
+// ---------------------------------------------------------------------------
+//     
+void CSPCall::NotifyRingingState( )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRingingState");
+    iCallState = MCCPCallObserver::ECCPStateRinging;
+
+    TInt obsCount = iObservers.Count ( );
+    for (TInt i = 0; i < obsCount; i++ )
+        {
+        MCCPCallObserver *obs = iObservers[i];
+        if ( obs )
+            {
+            obs->CallStateChanged ( iCallState, this );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::CCPStateFromETelState
+// Simple mapping between state enumerations.
+// ---------------------------------------------------------------------------
+//     
+MCCPCallObserver::TCCPCallState CSPCall::CCPStateFromETelState( 
+    RMobileCall::TMobileCallStatus aEtelState ) 
+    {
+    MCCPCallObserver::TCCPCallState ret = MCCPCallObserver::ECCPStateIdle;
+    switch ( aEtelState )
+        {
+        case RMobileCall::EStatusUnknown:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+                "CSPCall::State > RMobileCall::Unknown" );
+            ret = MCCPCallObserver::ECCPStateIdle;
+            break;
+            }
+        case RMobileCall::EStatusIdle:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+                "CSPCall::State > RMobileCall::EStatusIdle" );
+            ret = MCCPCallObserver::ECCPStateIdle;
+            break;
+            }
+        case RMobileCall::EStatusRinging:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+                "CSPCall::State > RMobileCall::EStatusRinging" );
+            ret = MCCPCallObserver::ECCPStateRinging;
+            break;
+            }
+        // Map the following to connecting status
+        case RMobileCall::EStatusDialling:                
+            {
+            CSPLOGSTRING( CSPREQIN, "CSPCall::State > \
+                RMobileCall::EStatusDialling" );
+            ret = MCCPCallObserver::ECCPStateDialling;
+            break;
+            }
+        case RMobileCall::EStatusConnecting:
+            {
+            CSPLOGSTRING( CSPREQIN, "CSPCall::State > \
+                RMobileCall::Connecting" );
+            ret = MCCPCallObserver::ECCPStateConnecting;
+            break;
+            }
+        case RMobileCall::EStatusAnswering:
+            {
+            CSPLOGSTRING( CSPREQIN, "CSPCall::State > \
+                RMobileCall::Answering" );
+            ret = MCCPCallObserver::ECCPStateAnswering;
+            break;                
+            }
+        // Call is connected and active.
+        case RMobileCall::EStatusConnected:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+            "CSPCall::State > RMobileCall::EStatusConnected" );
+            ret = MCCPCallObserver::ECCPStateConnected;
+            break;
+            }
+        case RMobileCall::EStatusDisconnectingWithInband:
+        case RMobileCall::EStatusDisconnecting:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+                 "CSPCall::State > RMobileCall::EStatusDisconnecting/Inband?");
+            ret = MCCPCallObserver::ECCPStateDisconnecting;
+            break;
+            }
+        case RMobileCall::EStatusReconnectPending:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+            "CSPCall::State > RMobileCall::EStatusHangingUp" );
+            ret = MCCPCallObserver::ECCPStateDisconnecting;
+            break;
+            }
+        case RMobileCall::EStatusHold:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+            "CSPCall::State > RMobileCall::EStatusHold" );
+            ret = MCCPCallObserver::ECCPStateHold;
+            break;
+            }
+        case RMobileCall::EStatusWaitingAlternatingCallSwitch: 
+            {
+            // This state is not used in real life.
+            CSPLOGSTRING( CSPREQIN, 
+            "CSPCall::State > RMobileCall::EStatusWaitingAlternatingCallSwitch" );
+            ret = MCCPCallObserver::ECCPStateConnected;
+            break;
+            }
+        case RMobileCall::EStatusTransferring: 
+            {
+            CSPLOGSTRING( CSPREQIN, 
+            "CSPCall::State > RMobileCall::EStatusHold" );
+            ret = MCCPCallObserver::ECCPStateTransferring;
+            break;
+            }
+        case RMobileCall::EStatusTransferAlerting: 
+            {
+            CSPLOGSTRING( CSPREQIN, 
+            "CSPCall::State > RMobileCall::EStatusHold" );
+            ret = MCCPCallObserver::ECCPStateTransferring;
+            break;
+            }            
+        default:
+            {
+            CSPLOGSTRING( CSPREQIN, 
+                "CSPCall::CCPStateFromETelState unhandled state ");
+            }
+        }
+
+    CSPLOGSTRING3(CSPINT, 
+        "CSPCall::CCPStateFromETelState ETel: %d CCP: %d", aEtelState, ret);
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyCallStateChanged
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyCallStateChanged( MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING3(CSPINT, 
+            "CSPCall::NotifyCallStateChanged < state: %d this: %x", 
+            aState, this );
+                           
+    iCallState = aState;    
+    TBool notifyObservers( ETrue ); 
+
+    if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState )
+        {
+        CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState);        
+        notifyObservers = EFalse; 
+        }
+    
+    if ( notifyObservers )
+        {
+        TInt obsCount = iObservers.Count();
+        for ( TInt i = 0; i < obsCount; i++ )
+            {
+            MCCPCallObserver *obs = iObservers[i];
+            if ( obs )
+                {            
+                obs->CallStateChanged( aState, this );
+                }
+            }
+        }
+        
+    CSPLOGSTRING3(CSPINT, 
+            "CSPCall::NotifyCallStateChanged > state: %d this: %x", 
+            aState, this );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyCallStateChangedWithInband
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyCallStateChangedWithInband( 
+        MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING3(CSPINT, 
+        "CSPCall::NotifyCallStateChangedWithInBand < state: %d this: %x", 
+        aState, this );
+    
+    iCallState = aState;
+   
+    if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState )
+        {
+        CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState);
+        }
+    else
+        {        
+        TInt obsCount = iObservers.Count();
+        for ( TInt i = 0; i < obsCount; i++ )
+            {            
+            MCCPCallObserver *obs = iObservers[i];
+            if ( obs )
+                {
+                obs->CallStateChangedWithInband( aState, this );
+                }
+            }
+        }
+    CSPLOGSTRING3(CSPINT, 
+            "CSPCall::NotifyCallStateChangedWithInband > state: %d this: %x", 
+            aState, this);
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::ReadRepositoryL
+// Reads the given information from Central Repository.
+// ---------------------------------------------------------------------------
+//
+void CSPCall::ReadRepositoryL( TUid aUid, TUint aKey, TInt& aVal)
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::ReadRepositoryL");
+    
+    CRepository* cr = CRepository::NewL( aUid );
+    TInt err = cr->Get( aKey, aVal );
+    delete cr;
+    User::LeaveIfError( err );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::CheckAndNotifyTerminationError
+// Reads error code from ETel.
+// ---------------------------------------------------------------------------
+//
+void CSPCall::CheckAndNotifyTerminationError()
+    {
+    CSPLOGSTRING2(CSPINT, 
+        "CSPCall::CheckAndNotifyTerminationError dial completion code: %d", 
+        iDialCompletionCode);
+    
+    // Emergency error handling is separated into CSPEtelCallRequester
+    if ( !iIsEmergencyCall )
+        {
+        TInt termErr = ExitCodeError();
+        CSPLOGSTRING2(CSPINT, 
+                "CSPCall::CheckAndNotifyTerminationError exit code error: %d", 
+                termErr);
+        
+        if ( termErr == KErrNone )
+            {
+            // Handle KErrGsmCCUnassignedNumber correctly
+            // because the value is not stored in exit code.
+            termErr = iDialCompletionCode;
+            CSPLOGSTRING(CSPINT, 
+                    "CSPCall::CheckAndNotifyTerminationError use dial completion code");
+            }
+            
+        if ( termErr == KErrGsmRRPreEmptiveRelease )
+            {
+            // Error KErrGsmRRPreEmptiveRelease occurs when there is active call 
+            // and user make emergency call, can be ignored.
+            CSPLOGSTRING3( 
+                CSPERROR, 
+                "CSPCall::CheckAndNotifyTerminationError preemptive release, ignore: %d",
+                termErr,
+                this );
+            }
+        else if ( iDontReportTerm 
+                && (  termErr == KErrGsmCCNormalUnspecified 
+                   || termErr == KErrGsmCCCallRejected ) )
+            {
+            // Not an error, since this happens on normal 
+            // call termination situation after connected call.
+            CSPLOGSTRING3(CSPERROR, 
+                    "CSPCall::CheckAndNotifyTerminationError DISCARD this: %x err: %d", 
+                    this, 
+                    termErr);    
+            }        
+        else if ( termErr )
+            {
+            TCCPError ccpErr(ECCPErrorNone);
+
+            // Only a couple of error codes can have diagnostic information. 
+            // aDiagnostic ought to be undefined in other situatios,
+            // but at least in this way we can really guarantee it.
+            if ( termErr == KErrGsmCCFacilityRejected ||
+                 termErr == KErrGsmCCRequestedFacilityNotSubscribed ||
+                 termErr == KErrGsmCCIncomingCallsBarredInCug ||
+                 termErr == KErrGsmCCRequestedFacilityNotImplemented ||
+                 termErr == KErrGsmCCUserNotInCug )
+                {
+                TName name;
+                CallName( name );        
+                TInt diagErr = iCommonInfo.GetDiagnosticError( name );
+                ccpErr = iRequester->MapError( diagErr );
+    
+                // Finally use exit code if diagnostic did not contain
+                // any useful information.
+                if ( ccpErr == ECCPRequestFailure )
+                    {
+                    ccpErr = iRequester->MapError( termErr );
+                    }
+                }
+            else
+                {
+                ccpErr = iRequester->MapError( termErr );
+                }
+            
+            NotifyErrorOccurred( ccpErr );
+            iTerminationErrorNotified = ETrue;
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::ExitCodeError
+// Reads error code from ETel call info's iExitCode.
+// ---------------------------------------------------------------------------
+//
+TInt CSPCall::ExitCodeError() const
+    {
+    CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError < this: %x", 
+                    this );
+    TInt callError;
+    RMobileCall::TMobileCallInfoV3 callInfo;
+    RMobileCall::TMobileCallInfoV3Pckg pck( callInfo );
+    TInt getErr = iCall.GetMobileCallInfo( pck );
+    // Is there value in higher 16 bits
+    if ( KErrNone == getErr && (callInfo.iExitCode & 0xFFFF0000) ) 
+        {
+        CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError callInfo.iExitCode %d", 
+            callInfo.iExitCode );
+        callError = ( callInfo.iExitCode >> KTimesToSplitValue ); 
+        
+        if ( callError > KErrEtelGsmBase ) 
+            // Not in valid exteded range
+            {
+            // Ignore invalid extented code
+            if ( ( callInfo.iExitCode & 0x0000FFFF ) == KErrNone ) 
+                // core error is zero
+                {
+                callError = KErrNone;
+                }
+            else
+                {
+                callError = ( ( callInfo.iExitCode & 0x0000FFFF ) 
+                    | 0xFFFF0000 ); 
+                }
+            }
+        }
+    // Higher and lower 16 bits are zero
+    else if ( !( callInfo.iExitCode & 0xFFFFFFFF ) ) 
+        {
+        callError = KErrNone;
+        }
+    else 
+        {
+        // No extended error, expand value to full range
+        callError = ( callInfo.iExitCode | 0xFFFF0000 );
+        }
+        
+    CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError > err: %d", callError);
+        
+    return callError;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::UUSMessageReceived
+// ---------------------------------------------------------------------------
+//
+ void CSPCall::UUSMessageReceived( TDesC& aMessage )
+    {      
+    CSPLOGSTRING(CSPREQIN, "CSPCall::UUSMessageReceived");
+    TCSPSkypeIdParser parser;
+           
+    TPtr ptr = iSkypeId->Des();
+    ptr.Zero();
+    const TInt error( parser.Parse( aMessage, ptr ) );
+    
+    if ( !error ) 
+        {
+        iRemotePartyName = ptr;
+        NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange );            
+        }
+    CSPLOGSTRING2(CSPINT, "CSPCall::UUSMessageReceived  err: %d",  error );        
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyRemotePartyInfoChanged
+// ---------------------------------------------------------------------------
+//
+void CSPCall::NotifyRemotePartyInfoChanged(const TDesC& aRemoteParty) 
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRemotePartyInfoChanged");
+    iRemotePartyName = aRemoteParty;
+    NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::DontReportTerminationError
+// ---------------------------------------------------------------------------
+//
+void CSPCall::DontReportTerminationError() 
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPCall::DontReportTerminationError");
+    iDontReportTerm = ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::UpdateCallNameNumberInfo
+// Update call info including remote party name and number data  
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::UpdateCallNameNumberInfo(
+        RMobileCall::TMobileCallInfoV3& aCallInfo, 
+        TBool aCallAddedByMonitor )
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo <");
+
+    iCallName.Zero();
+    iRemotePartyNumber.Zero();
+    iRemotePartyName.Zero();
+    
+    if ( aCallAddedByMonitor )        
+        {
+        CSPLOGSTRING(CSPINT, 
+                "CSPCall::UpdateCallNameNumberInfo call added by monitor");
+
+        // If call was created by ETel line status or incoming call monitor
+        // the call name is already known, only remote party info is fetched from 
+        // call info 
+        iCallName.Append( iName );
+        iRemotePartyName.Append( aCallInfo.iRemoteParty.iCallingName );
+        iRemotePartyNumber.Append( aCallInfo.iRemoteParty.iRemoteNumber.iTelNumber );
+        }
+    else 
+        {
+        CSPLOGSTRING(CSPINT, 
+                "CSPCall::UpdateCallNameNumberInfo call added by plugin owner");
+        
+        // The call was not created by monitor and the remote number is already known, 
+        // fetch only call name from call info  
+        iCallName.Append( aCallInfo.iCallName );
+        iRemotePartyNumber.Append( iName ); 
+        }
+    
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCall::UpdateCallNameNumberInfo iCallName: %S", &iCallName );
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCall::UpdateCallNameNumberInfo iRemotePartyNumber: %S", &iRemotePartyNumber );
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCall::UpdateCallNameNumberInfo iRemotePartyName: %S", &iRemotePartyName );
+
+    CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::OpenNewCall
+// Open new call 
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::OpenNewCall()
+    {
+    CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall <");
+
+    // Open new call 
+    __ASSERT_ALWAYS( iCall.OpenNewCall( iLine ) == KErrNone, 
+            Panic( ECSPPanicNoEtel ) );
+
+    CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::OpenExistingCallL
+// Open existing call  
+// ---------------------------------------------------------------------------
+//    
+void CSPCall::OpenExistingCallL( const TDesC& aName )
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCall::OpenExistingCallL < aName: %S", &aName);
+    
+    // Open existing call with given name from current line 
+    TInt err = iCall.OpenExistingCall( iLine, aName ); 
+    
+    if ( KErrNone != err  )
+        {
+        CSPLOGSTRING2(CSPERROR,
+            "CSPCall::OpenCallHandleL OpenExistingCall error: %d, leaving", err);    
+        User::Leave( err );
+        }
+
+    CSPLOGSTRING(CSPINT, "CSPCall::OpenExistingCallL >");
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspcalladdedhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPCallAddedHandler
+*
+*/
+
+
+#include "cspcalladdedhandler.h"
+
+#include <etelmm.h>
+#include <mccpcsobserver.h>
+
+#include "cspcallarray.h"
+#include "cspetellinestatusmonitor.h"
+#include "mcsplinestatusobserver.h"
+#include "rcsplinecontainer.h"
+#include "csplogger.h"
+#include "cspclientvoicecall.h"
+#include "cspclientvideocall.h"
+#include "rcsplinecontainer.h"
+#include "mcspcommoninfo.h"
+#include "cspconsts.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPCallAddedHandler::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPCallAddedHandler* CSPCallAddedHandler::NewL( 
+                                   const MCCPCSObserver& aObserver,
+                                   RCSPLineContainer& aLineContainer,
+                                   CSPCallArray& aCallArray,
+                                   MCSPCommonInfo& aCommonInfo,
+                                   CSPAudioHandler& aAudioHandler )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCallAddedHandler::NewL()" );
+    CSPCallAddedHandler* self = new ( ELeave ) CSPCallAddedHandler( 
+                                        aObserver, aLineContainer,
+                                        aCallArray, aCommonInfo, 
+                                        aAudioHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPCallAddedHandler::~CSPCallAddedHandler( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCallAddedHandler::~CSPCallAddedHandler" );
+    delete iAuxLineMonitor;
+    delete iVoiceLineMonitor;
+    delete iDataLineMonitor;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallAddedHandler::CallAdded
+// ---------------------------------------------------------------------------
+//
+void CSPCallAddedHandler::CallAdded( RMobileLine& aLine, 
+                        TName aCallName,
+                        RCSPLineContainer::TCSPLineId aLineId )
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCallAddedHandler::CallAdded line: %d", aLineId);
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCallAddedHandler::CallAdded call name: %S", &aCallName);
+    
+    // Find call by name
+    if ( !iCallArray.FindCall( aCallName ) )
+        {        
+        TInt err( KErrNone );
+        
+        // Resolve call type
+        TUint32 serviceId( 0 );
+        CCPCall::TCallType callType;
+        CCCECallParameters::TCCELineType lineType;
+
+        iLineContainer.ResolveCallInfo( aLineId, serviceId, callType, lineType );
+        
+        CSPCall* call = NULL;
+        CCCECallParameters* callParameters = NULL;
+        
+        TRAP_IGNORE( callParameters = CCCECallParameters::NewL() );
+        if ( callParameters )
+            {
+            callParameters->SetServiceId(serviceId);
+            callParameters->SetCallType(callType);
+            callParameters->SetLineType(lineType);
+
+            CSPLOGSTRING2(CSPINT, 
+                    "CSPCallAddedHandler::CallAdded call type: %d", callType );
+            
+            if ( callType == CCPCall::ECallTypeCSVoice )
+                {
+                TRAP( err, call = CSPClientVoiceCall::NewL( aCallName, 
+                                                    aLine, *callParameters, 
+                                                    iCommonInfo ));
+                }                
+            else if ( callType == CCPCall::ECallTypeVideo )
+                {
+                CSPLOGSTRING(CSPINT, 
+                        "CSPCallAddedHandler::CallAdded creating video call");
+                TRAP( err, call = CSPClientVideoCall::NewL( aCallName, 
+                                                    aLine, *callParameters, 
+                                                    iCommonInfo ));
+                }
+
+            delete callParameters;
+            callParameters = NULL; 
+            }
+        
+        CSPLOGSTRING2(CSPINT, 
+           "CSPCallAddedHandler::CallAdded Client call creation res %d", err );
+        
+        if ( call )
+            {
+            // Set audio handler for DevSound
+            call->SetAudioHandler( &iAudioHandler );
+            
+            MCCPCallObserver::TCCPCallState callState = call->State(); 
+            CSPLOGSTRING2(CSPINT, 
+                    "CSPCallAddedHandler::CallAdded call state: %d", callState );
+            
+            if ( callState == MCCPCallObserver::ECCPStateDialling )
+               {                   
+               CSPLOGSTRING(CSPINT, 
+                       "CSPCallAddedHandler::CallAdded add Dialling call" );
+               
+               iCallArray.Add( call );
+               
+               CSPLOGSTRING(CSPINT, 
+                       "CSPCallAddedHandler::CallAdded notifying dialling state" );
+               
+               call->NotifyCallStateChangedETel( RMobileCall::EStatusDialling ); 
+               }
+            else if ( callState == MCCPCallObserver::ECCPStateConnecting || 
+                      callState == MCCPCallObserver::ECCPStateConnected )
+               {
+               CSPLOGSTRING(CSPINT, 
+                       "CSPCallAddedHandler::CallAdded add Connecting/Connected call" );
+               iCallArray.Add( call );                              
+               iCommonInfo.IndicateClientCall( call );
+               }
+            else 
+                {
+                CSPLOGSTRING(CSPERROR, 
+                        "CSPCallAddedHandler::CallAdded ignore call" );
+                delete call;
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallAddedHandler::LineStatusChanged
+// ---------------------------------------------------------------------------
+//
+void CSPCallAddedHandler::LineStatusChanged( RMobileLine& aLine, 
+                                             RCSPLineContainer::TCSPLineId aLineId,
+                                             RMobileCall::TMobileCallStatus& aLineStatus )
+    {    
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCallAddedHandler::LineStatusChanged line: %d", aLineId );
+    CSPLOGSTRING2(CSPINT, 
+            "CSPCallAddedHandler::LineStatusChanged line status: %d", 
+            aLineStatus );
+    
+    if ( aLineStatus == RMobileCall::EStatusDialling )
+        {
+        TInt err(KErrNone);
+        RLine::TLineInfo lineInfo;
+        err = aLine.GetInfo( lineInfo );
+        TName callName; 
+        
+        if ( err == KErrNone )
+            {
+            callName = lineInfo.iNameOfLastCallAdded;
+            CallAdded( aLine, callName, aLineId); 
+            }
+        else 
+            {
+            CSPLOGSTRING2(CSPERROR, 
+                    "CSPCallAddedHandler::LineStatusChanged get info err:%d", 
+                    err);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPCallAddedHandler::CSPCallAddedHandler(
+            const MCCPCSObserver& aObserver,
+            RCSPLineContainer& aLineContainer,
+            CSPCallArray& aCallArray,
+            MCSPCommonInfo& aCommonInfo,
+            CSPAudioHandler& aAudioHandler ) :
+            iLineContainer( aLineContainer ),
+            iObserver( aObserver ),            
+            iCallArray( aCallArray ),
+            iCommonInfo( aCommonInfo ),
+            iAudioHandler( aAudioHandler )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCallAddedHandler::CSPCallAddedHandler");
+    }
+    
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CSPCallAddedHandler::ConstructL()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCallAddedHandler::ConstructL <");
+    
+    if ( iLineContainer.LineIsOpen( RCSPLineContainer::ECSPLineSpeech ) )
+        {
+        RMobileLine& line = iLineContainer.LineByType( 
+                                RCSPLineContainer::ECSPLineSpeech );
+        iVoiceLineMonitor = CSPEtelLineStatusMonitor::NewL( *this, line, 
+                                            RCSPLineContainer::ECSPLineSpeech );
+        iVoiceLineMonitor->StartMonitoring();
+        }
+    // This is for videocalls
+    if ( iLineContainer.LineIsOpen( RCSPLineContainer::ECSPLineData ) )
+        {
+        RMobileLine& line = iLineContainer.LineByType( 
+                                RCSPLineContainer::ECSPLineData );
+
+        iDataLineMonitor = CSPEtelLineStatusMonitor::NewL( *this, line, 
+                                                    RCSPLineContainer::ECSPLineData );
+        iDataLineMonitor->StartMonitoring();
+        }
+
+    if ( iLineContainer.LineIsOpen( RCSPLineContainer::ECSPLineAuxSpeech ) )
+        {
+        RMobileLine& line = iLineContainer.LineByType( 
+                                RCSPLineContainer::ECSPLineAuxSpeech );
+        iAuxLineMonitor = CSPEtelLineStatusMonitor::NewL( *this, line, 
+                                            RCSPLineContainer::ECSPLineAuxSpeech );
+        iAuxLineMonitor->StartMonitoring();
+        }
+    
+    CSPLOGSTRING(CSPOBJECT, "CSPCallAddedHandler::ConstructL >");
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspcallarray.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPCallArray
+*
+*/
+
+
+#include <etelmm.h>
+
+#include "cspcallarray.h"
+#include "csplogger.h"
+#include "cspcall.h"
+#include "cspconsts.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPCallArray::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPCallArray* CSPCallArray::NewL( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPCallArray::NewL()" );
+    CSPCallArray* self = new ( ELeave ) CSPCallArray(  );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the array including remaining calls.
+// ---------------------------------------------------------------------------
+//
+CSPCallArray::~CSPCallArray( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPCallArray::~CSPCallArray()" );
+    TInt callCount = iCallArray.Count();
+    CSPLOGSTRING2(CSPOBJECT, "CSPCallArray::~CSPCallArray() calls %d", callCount);
+    
+    for (TInt callIndex = 0; callIndex < callCount; callIndex++)
+        {
+        CSPCall* call = iCallArray[ callIndex ];
+        delete call;
+        }
+        
+    iCallArray.Reset();
+    iCallArray.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// From MCSPCallInformation
+// Iterates through call objects finding the call matching the given name.
+// ---------------------------------------------------------------------------
+//    
+CSPCall* CSPCallArray::FindCall( const TName& aCallName )
+    {
+    CSPLOGSTRING(CSPINT, "CSPCallArray::FindCall()");
+    
+    TInt callCount = iCallArray.Count();
+    for (TInt callIndex = 0; callIndex < callCount; callIndex++)
+        {
+
+        CSPCall* call = iCallArray[ callIndex ];        
+        if ( call )
+            {
+            TName currentCallName;
+            call->CallName( currentCallName );
+            if ( currentCallName.Compare( aCallName ) == 0 )
+                {
+                CSPLOGSTRING(CSPINT, "CSPCallArray::FindCall() OK");
+                return call;
+                }
+            }
+        }
+
+    CSPLOGSTRING(CSPINT, "CSPCallArray::FindCall() NOT FOUND");    
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallArray::Add
+// ---------------------------------------------------------------------------
+//    
+TInt CSPCallArray::Add(CSPCall* aCall ) 
+    { 
+    CSPLOGSTRING(CSPINT, "CSPCallArray::Add()");
+    return iCallArray.Append( aCall ); 
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallArray::Remove
+// ---------------------------------------------------------------------------
+//    
+TInt CSPCallArray::Remove(CSPCall* aCall ) 
+    {
+    CSPLOGSTRING(CSPINT, "CSPCallArray::Remove()");
+    TInt index = iCallArray.Find( aCall );
+    if ( index != KErrNotFound )
+        {
+        iCallArray.Remove( index );
+        return KErrNone;
+        }
+    CSPLOGSTRING(CSPINT, "CSPCallArray::Remove() NOT FOUND");
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallArray::GetCallCount
+// ---------------------------------------------------------------------------
+//    
+TInt CSPCallArray::GetCallCount( )
+    {
+    return iCallArray.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallArray::Get
+// ---------------------------------------------------------------------------
+//    
+CSPCall* CSPCallArray::Get( TInt aIndex )
+    {
+    return iCallArray[aIndex];
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPCallArray::CSPCallArray()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPCallArray::CSPCallArray()" );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspcallcommandhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPCallCommandHandler
+*
+*/
+
+
+#include "cspcallcommandhandler.h"
+#include "mcspcallcommandhandling.h"
+#include "csplogger.h"
+
+// ---------------------------------------------------------------------------
+// CSPCallCommandHandler::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPCallCommandHandler* CSPCallCommandHandler::NewL()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPCallCommandHandler::NewL()" );
+    CSPCallCommandHandler* self = new ( ELeave ) CSPCallCommandHandler();
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the array including remaining calls.
+// ---------------------------------------------------------------------------
+//
+CSPCallCommandHandler::~CSPCallCommandHandler()
+    {
+    iActiveHangupArray.Reset();
+    iActiveHangupArray.Close();
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPCallCommandHandler::~CSPCallCommandHandler");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallCommandHandler::IndicateActiveHangup
+// ---------------------------------------------------------------------------
+//
+TInt CSPCallCommandHandler::IndicateActiveHangup( MCCPCallCommandHandling& aCall )
+    {
+    TInt err = iActiveHangupArray.Find( &aCall );
+    if ( err == KErrNotFound )
+        {
+        err = iActiveHangupArray.Append( &aCall );
+        CSPLOGSTRING2( 
+            CSPINT, 
+            "CSPCallCommandHandler::IndicateActiveHangup append error: %d", 
+            err );
+        }
+    else
+        {
+        CSPLOGSTRING( 
+            CSPINT, 
+            "CSPCallCommandHandler::IndicateActiveHangup call already added");
+        }
+    CSPLOGSTRING2( 
+        CSPINT, 
+        "CSPCallCommandHandler::IndicateActiveHangup active hangup count: %d", 
+        iActiveHangupArray.Count());
+        
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallCommandHandler::CSPCallCommandHandler::IndicateHangupComplete
+// ---------------------------------------------------------------------------
+//  
+TInt CSPCallCommandHandler::IndicateHangupComplete( MCCPCallCommandHandling& aCall )
+    {
+    TInt index = iActiveHangupArray.Find( &aCall );
+    if ( index != KErrNotFound )
+        {
+        iActiveHangupArray.Remove( index );
+        CSPLOGSTRING(CSPINT, 
+            "CSPCallCommandHandler::IndicateHangupComplete remove");
+        }
+
+    if( !iActiveHangupArray.Count() && iPendingCall )
+        {
+        if( iPendingCommand == ECSPAnswerCall )
+            {
+            CSPLOGSTRING(CSPINT, 
+                "CSPCallCommandHandler::IndicateHangupComplete perform answer request");
+            iPendingCall->PerformAnswerRequest();
+            iPendingCommand = ECSPNone;
+            iPendingCall = NULL;
+            }
+        else if( iPendingCommand == ECSPDialCall )
+            {
+            CSPLOGSTRING(CSPINT, 
+                "CSPCallCommandHandler::IndicateHangupComplete perform dial request");
+            iPendingCall->PerformDialRequest();
+            iPendingCommand = ECSPNone;
+            iPendingCall = NULL;
+            }
+        }
+        
+    CSPLOGSTRING2(CSPINT, 
+        "CSPCallCommandHandler::IndicateHangupComplete active hangup count: %d", 
+        iActiveHangupArray.Count());
+        
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPCallCommandHandler::IndicateDialRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPCallCommandHandler::IndicateDialRequest( MCCPCallCommandHandling& aCall )
+            
+    {
+    CSPLOGSTRING(CSPINT, 
+        "CSPCallCommandHandler::IndicateDialRequest");
+    TInt ret( KErrNone );
+    
+    if( !iActiveHangupArray.Count() )
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPCallCommandHandler::IndicateDialRequest dial");
+        aCall.PerformDialRequest();
+        }
+    else if( !iPendingCall && iPendingCommand == ECSPNone )
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPCallCommandHandler::IndicateDialRequest delay dialing");
+        iPendingCall = &aCall;
+        iPendingCommand = ECSPDialCall;
+        }
+    else
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPCallCommandHandler::IndicateDialRequest ERROR already exists");
+        ret = KErrAlreadyExists;
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCallCommandHandler::IndicateAnswerRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPCallCommandHandler::IndicateAnswerRequest( MCCPCallCommandHandling& aCall )
+            
+    {
+    CSPLOGSTRING(CSPINT, "CSPCallCommandHandler::IndicateAnswerRequest" );
+        
+    TInt ret( KErrNone );
+    
+    if( !iActiveHangupArray.Count() )
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPCallCommandHandler::IndicateAnswerRequest answer");
+        aCall.PerformAnswerRequest();
+        }
+    else if( !iPendingCall && iPendingCommand == ECSPNone )
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPCallCommandHandler::IndicateAnswerRequest delay answering");
+        iPendingCall = &aCall;
+        iPendingCommand = ECSPAnswerCall;
+        }
+    else
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPCallCommandHandler::IndicateAnswerRequest ERROR already exists");
+        ret = KErrAlreadyExists;
+        }
+        
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPCallCommandHandler::CSPCallCommandHandler()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPCallCommandHandler::CSPCallCommandHandler");
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspcallinfomonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitors changes in remote party info.
+*  Interface   : 
+*
+*/
+
+
+
+//  INCLUDE FILES
+
+#include    "cspcallinfomonitor.h"       
+#include    "mcspcallobserver.h"
+#include    "csppanic.pan"
+#include    "csplogger.h" //Debug
+
+
+// ============================ MEMBER FUNCTIONS =============================
+
+//----------------------------------------------------------------------------
+//  CSPCallInfoMonitor::NewL()
+//
+//  1st phase constructor
+//----------------------------------------------------------------------------
+//
+CSPCallInfoMonitor* CSPCallInfoMonitor::NewL
+    ( MCSPCallObserver& aObserver,
+      RMobileCall& aCall  )   
+    {
+    CSPCallInfoMonitor* self = new (ELeave) CSPCallInfoMonitor( aObserver,
+                                                                aCall ); 
+    return self;
+    }
+
+//----------------------------------------------------------------------------
+//  CSPCallInfoMonitor::~CSPCallInfoMonitor()
+//
+//  d'tor.
+//----------------------------------------------------------------------------
+//
+CSPCallInfoMonitor::~CSPCallInfoMonitor()
+    {    
+    Cancel();
+    CSPLOGSTRING( CSPINT, "CSP: CSPCallInfoMonitor::~CSPCallInfoMonitor" );
+    }
+
+//----------------------------------------------------------------------------
+//  CSPCallInfoMonitor::StartMonitor()
+//
+//  Starts monitoring.
+//----------------------------------------------------------------------------
+//
+void CSPCallInfoMonitor::StartMonitoring()
+    {    
+    // error ignored (starting notification doesn't leave)
+    if (!IsActive()) 
+        {
+        iCall.NotifyRemotePartyInfoChange( 
+            iStatus,  
+            iRemotePartyInfoPckg ); 
+        SetActive();             
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPCallInfoMonitor::StartMonitoring: Already active" );
+        
+        }
+    }
+
+//----------------------------------------------------------------------------
+//  CSPCallInfoMonitor::RunL()
+//
+//  Handling of the status changes.
+//----------------------------------------------------------------------------
+//
+void CSPCallInfoMonitor::RunL()
+    {
+    CSPLOGSTRING2( CSPINT, 
+        "CSP: CSPCallInfoMonitor::RunL iStatus: %d", iStatus.Int() );
+
+    RMobileCall::TMobileCallRemoteIdentityStatus idStatus = 
+        iRemotePartyInfo.iRemoteIdStatus;
+    CSPLOGSTRING2( CSPINT, 
+        "CSP: CSPCallInfoMonitor::RunL id status: %d", idStatus );
+
+    switch ( iStatus.Int() )
+        {
+        case KErrNone:
+            {                
+            if ( idStatus == RMobileCall::ERemoteIdentityAvailable) 
+                {
+                iObserver.NotifyRemotePartyInfoChanged(
+                    iRemotePartyInfo.iCallingName);
+                }
+            else
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                "CSP: CSPCallInfoMonitor::RunL DISCARD: %d", idStatus );
+                }            
+            break;
+            }
+        default:
+            CSPLOGSTRING( CSPERROR, 
+                "CSP: CSPCallInfoMonitor::RunL error" );
+            break;
+        }
+        
+    if ( KErrNotSupported != iStatus.Int() )
+        {        
+        StartMonitoring();
+        }
+    }
+
+//----------------------------------------------------------------------------
+//  CSPCallInfoMonitor::DoCancel()
+//
+//  Implementation of cancel.
+//----------------------------------------------------------------------------
+//
+void CSPCallInfoMonitor::DoCancel()
+    {
+    CSPLOGSTRING( CSPINT, "CSP: CSPCallInfoMonitor::DoCancel" );
+    
+    iCall.CancelAsyncRequest( EMobileCallNotifyRemotePartyInfoChange );
+    }
+
+//----------------------------------------------------------------------------
+//  CSPCallInfoMonitor::CSPCallInfoMonitor()
+//
+//  constructor.
+//----------------------------------------------------------------------------
+//
+CSPCallInfoMonitor::CSPCallInfoMonitor( MCSPCallObserver &aObserver, 
+                                        RMobileCall& aCall ) : 
+        CActive( EPriorityStandard ),
+        iObserver( aObserver ),
+        iCall( aCall ),
+        iRemotePartyInfoPckg( iRemotePartyInfo )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspcipheringstatusmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class 
+*                CSPCipheringStatusMonitor.
+*
+*/
+
+
+//  INCLUDE FILES
+#include <rmmcustomapi.h>
+#include "cspcipheringstatusmonitor.h"
+#include "csplogger.h"
+#include "mcspsecuritysettingobserver.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CSPCipheringStatusMonitor::CSPCipheringStatusMonitor( 
+        RMmCustomAPI& aMmCustom, MCSPSecuritySettingObserver& aObs )
+          : CActive( EPriorityStandard ),            
+            iMmCustom( aMmCustom ),
+            iObserver( aObs ),
+            iIsInitialised( EFalse ),
+            iCallsSecured( EFalse ), 
+            iSecureSpecified( ETrue )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// Destructor
+CSPCipheringStatusMonitor::~CSPCipheringStatusMonitor()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCipheringStatusMonitor::NewL
+// ---------------------------------------------------------------------------
+//
+CSPCipheringStatusMonitor* CSPCipheringStatusMonitor::NewL(
+     RMmCustomAPI& aMmCustom, MCSPSecuritySettingObserver& aObs ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPCipheringStatusMonitor::NewL()" );
+    CSPCipheringStatusMonitor* self = new ( ELeave ) CSPCipheringStatusMonitor( 
+                                        aMmCustom, aObs );
+    return self;    
+    }
+
+// -----------------------------------------------------------------------------
+// CSPCipheringStatusMonitor::StartMonitoring
+// Starts ciphering status monitoring
+// -----------------------------------------------------------------------------
+//
+void CSPCipheringStatusMonitor::StartMonitoring()
+    {    
+    if ( !IsActive() )
+        {
+        if ( !iIsInitialised )
+            {
+            // Monitor not initialized, get the initial ciphering status
+            iMmCustom.GetCipheringInfo( iStatus, iCipheringInfo );
+            }
+        else
+            {
+            // Monitor already initialized, monitor changes
+            iMmCustom.NotifyCipheringInfoChange( iStatus, iCipheringInfo ); 
+            }
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSP: CSPCipheringStatusMonitor::StartMonitoring: \
+             not done, already active");
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSPCipheringStatusMonitor::DoCancel
+// Cancels active object requests
+// Method calls CancelAsyncRequest from the CustomaEtel object
+// -----------------------------------------------------------------------------
+//
+void CSPCipheringStatusMonitor::DoCancel()
+    {
+    CSPLOGSTRING( CSPINT, "CSP: CSPCipheringStatusMonitor::DoCancel" );
+    
+    if ( IsActive() )
+        {
+        if( iIsInitialised )
+            {
+            iMmCustom.CancelAsyncRequest( ECustomNotifyCipheringInfoChangeIPC );
+            }
+        else
+            {
+            iMmCustom.CancelAsyncRequest( ECustomGetCipheringInfoIPC );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CPESupplementaryServicesMonitor::RunL
+// Method gets notification from etel that asyncronous request is completed.
+// Method sends possible messages to the owner object and
+// Method makes a new issue request to the CustomEtel.
+// -----------------------------------------------------------------------------
+//
+void CSPCipheringStatusMonitor::RunL()
+    {
+    CSPLOGSTRING2(CSPINT,
+        "CSP: CSPCipheringStatusMonitor::RunL: iStatus: %d", iStatus.Int() );
+
+    if ( iStatus == KErrNone )
+        {
+        TBool secureSpecifiedChanged = iSecureSpecified != iCipheringInfo.iIndStatus; 
+        
+        // Notify only on secure specified status changes 
+        if ( secureSpecifiedChanged )        
+            {
+            // Is set when secure indicator showing is allowed.
+            iSecureSpecified = iCipheringInfo.iIndStatus; 
+            
+            if ( !iSecureSpecified )
+                {                
+                iObserver.SecuritySettingChanged( 
+                        MCSPSecuritySettingObserver::ESecureNotSpecified ); 
+                }
+            }
+        
+        TBool callsSecuredChanged = ( iCallsSecured != iCipheringInfo.iCiphStatus ); 
+        
+        // Notify secure status changes only when secure has been specified
+        if ( iSecureSpecified && callsSecuredChanged )
+            {
+            iCallsSecured = iCipheringInfo.iCiphStatus;
+            
+            if ( iCallsSecured )
+                {
+                iObserver.SecuritySettingChanged( MCSPSecuritySettingObserver::ESecureCall ); 
+                }
+            else 
+                {                
+                iObserver.SecuritySettingChanged( MCSPSecuritySettingObserver::ENotSecureCall ); 
+                }
+            }
+        
+        iIsInitialised = ETrue; 
+        StartMonitoring();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPCipheringStatusMonitor::RunL: Ciphering Off  MONITOR OFF" );                
+        }
+          
+    if ( iStatus == KErrNotFound && !iIsInitialised )
+        {
+        // Network was not ready while fetching ciphering info
+        iIsInitialised = ETrue;
+        StartMonitoring();
+        CSPLOGSTRING( CSPINT, 
+            "CALL: CSPCipheringStatusMonitor::RunL: StartMonitoring()" );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSPCipheringStatusMonitor::NetworkSecurityStatus
+// Network security status.
+// -----------------------------------------------------------------------------
+//
+TBool CSPCipheringStatusMonitor::NetworkSecurityStatus() const
+    {
+    return iCallsSecured;
+    }
+
+// -----------------------------------------------------------------------------
+// CSPCipheringStatusMonitor::SecureSpecified
+// Secure specified status.
+// -----------------------------------------------------------------------------
+//
+TBool CSPCipheringStatusMonitor::SecureSpecified() const
+    {
+    return iSecureSpecified;
+    }
+
+// End of File 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspclientvideocall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,201 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements class CSPClientVideoCall which provides client video call 
+*               functionality
+*
+*/
+
+
+#include <etelmm.h>
+#include <etel.h>
+#include <mccpcallobserver.h>
+#include <rmmcustomapi.h>
+
+#include "cspclientvideocall.h"
+#include "csplogger.h"
+#include "csppanic.pan"
+#include "cspconsts.h"
+#include "mcspcommoninfo.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::NewL Two phased construction.
+// ---------------------------------------------------------------------------
+//
+CSPClientVideoCall* CSPClientVideoCall::NewL( const TDesC& aName, 
+                          RMobileLine& aLine,  
+                          const CCCECallParameters& aParams,
+                          MCSPCommonInfo& aCommonInfo )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NewL <<");
+    
+    CSPClientVideoCall* self = new (ELeave) CSPClientVideoCall( aLine, 
+                                            aName, aCommonInfo );
+    CleanupStack::PushL( self );    
+    self->ConstructL( aParams );
+    CleanupStack::Pop( self );
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NewL >>");
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::~CSPClientVideoCall
+// ---------------------------------------------------------------------------
+//
+CSPClientVideoCall::~CSPClientVideoCall()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::~CSPClientVideoCall");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::NotifyCallStateChanged
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPClientVideoCall::NotifyCallStateChanged(
+            MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSPClientVideoCall::NotifyCallStateChanged state: %d", 
+            aState);
+    
+    // Client call type is not valid before Dialling state
+    if ( aState == MCCPCallObserver::ECCPStateDialling )
+        {
+        CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NotifyCallStateChanged\
+             updating call type");
+        
+        CCPCall::TCallType callType = SelectCallTypeFromProtocolCaps(); 
+        iParams->SetCallType( callType );
+        
+        // Indicate client call to observer in Dialling state
+        IndicateClientCall();     
+        }
+
+    CSPVideoCall::NotifyCallStateChanged( aState );  
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::NotifyCallStateChangedWithInband
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPClientVideoCall::NotifyCallStateChangedWithInband(
+            MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING2(CSPINT, 
+        "CSPClientVideoCall::NotifyCallStateChangedWithInband %d", aState);
+    
+    // Client call type info is not available before Dialling phase
+    if ( aState == MCCPCallObserver::ECCPStateDialling )
+        {
+        CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NotifyCallStateChanged\
+             updating call type");
+        
+        CCPCall::TCallType callType = SelectCallTypeFromProtocolCaps(); 
+        iParams->SetCallType( callType );
+
+        // Indicate client call to observer in Dialling state
+        IndicateClientCall(); 
+        }
+    
+    CSPVideoCall::NotifyCallStateChangedWithInband( aState );  
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::CSPClientVideoCall
+// ---------------------------------------------------------------------------
+//
+CSPClientVideoCall::CSPClientVideoCall( RMobileLine& aLine,
+                  const TDesC& aName,
+                  MCSPCommonInfo& aCommonInfo ) : 
+                     CSPVideoCall( aLine, ETrue, aName, 
+                                   aCommonInfo )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::CSPClientVideoCall");
+    // Set client call flag(s)
+    iClientCallIndicated = EFalse; 
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::ConstructL
+// Constructing CSPClientVideoCall for MT call.
+// ---------------------------------------------------------------------------
+//    
+void CSPClientVideoCall::ConstructL( const CCCECallParameters& aParams )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::ConstructL <");
+    CSPVideoCall::ConstructL( aParams );
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::ConstructL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::IndicateClientCall
+// Indicate dialling if needed 
+// ---------------------------------------------------------------------------
+//  
+void CSPClientVideoCall::IndicateClientCall()
+    {
+    // Can be done only once for each call and possible duplicate 
+    // notifies are blocked 
+    if ( !iClientCallIndicated )
+        {
+        iClientCallIndicated = ETrue;
+
+        CSPLOGSTRING(CSPINT, 
+            "CSPClientVideoCall::IndicateClientCall IndicateClientCall")
+        
+        iCommonInfo.IndicateClientCall( this );
+        
+        CSPLOGSTRING(CSPINT, 
+            "CSPClientVideoCall::IndicateClientCall IndicateClientCall completed")                
+        }    
+    else 
+        {
+        CSPLOGSTRING(CSPERROR, 
+            "CSPClientVideoCall::IndicateClientCall already indicated")
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::OpenCallHandleL
+// ---------------------------------------------------------------------------
+//    
+void CSPClientVideoCall::OpenCallHandleL()
+    {
+    CSPLOGSTRING(CSPINT, "CSPClientVideoCall::OpenCallHandleL <");
+
+    // Client call, open existing call handle 
+    OpenExistingCallL( iName ); 
+    
+    CSPLOGSTRING(CSPINT, "CSPClientVideoCall::OpenCallHandleL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVideoCall::UpdateCallInfoImpl
+// Update call info including remote party name and number data  
+// ---------------------------------------------------------------------------
+//    
+void CSPClientVideoCall::UpdateCallInfoImpl( RMobileCall::TMobileCallInfoV7 aCallInfo )
+    {
+    CSPLOGSTRING(CSPINT, "CSPClientVideoCall::UpdateCallInfoImpl <");
+    
+    // Call was added by ETel monitor, update info accordingly 
+    UpdateCallNameNumberInfo( aCallInfo, ETrue );     
+    UpdateCallOrigin( aCallInfo );
+    
+    CSPLOGSTRING(CSPINT, "CSPClientVideoCall::UpdateCallInfoImpl >");
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspclientvoicecall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements class CSPClientVoiceCall which provides call functionality
+*
+*/
+
+
+#include <etelmm.h>
+#include <etel.h>
+#include <mccpcallobserver.h>
+#include <cccecallparameters.h>
+
+#include "cspclientvoicecall.h"
+#include "csplogger.h"
+#include "csppanic.pan"
+#include "cspconsts.h"
+#include "mcspcommoninfo.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::NewL Two phased construction.
+// ---------------------------------------------------------------------------
+//
+CSPClientVoiceCall* CSPClientVoiceCall::NewL( const TDesC& aName, 
+                          RMobileLine& aLine,  
+                          const CCCECallParameters& aParams,
+                          MCSPCommonInfo& aCommonInfo )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::NewL <");
+    
+    CSPClientVoiceCall* self = new ( ELeave ) CSPClientVoiceCall( aLine,
+                                            aName,
+                                            aCommonInfo );
+    CleanupStack::PushL( self );
+    self->ConstructL( aParams );
+    CleanupStack::Pop( self );
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::NewL >");
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::~CSPClientVoiceCall
+// ---------------------------------------------------------------------------
+//
+CSPClientVoiceCall::~CSPClientVoiceCall()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::~CSPClientVoiceCall");
+    }
+  
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::CSPClientVoiceCall
+// ---------------------------------------------------------------------------
+//
+CSPClientVoiceCall::CSPClientVoiceCall( RMobileLine& aLine,
+                  const TDesC& aName,
+                  MCSPCommonInfo& aCommonInfo ):
+                  CSPVoiceCall( aLine,
+                     ETrue, aName, 
+                     aCommonInfo, EFalse )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::CSPClientVoiceCall");
+    
+    // Set client call flag(s)
+    iClientCallIndicated = EFalse; 
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::ConstructL
+// Constructing CSPClientVoiceCall for MT call.
+// ---------------------------------------------------------------------------
+//    
+void CSPClientVoiceCall::ConstructL( const CCCECallParameters& aParams )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::ConstructL <");
+    CSPVoiceCall::ConstructL( aParams ); 
+    CSPLOGSTRING(CSPOBJECT, "CSPClientVoiceCall::ConstructL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::NotifyCallStateChanged
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPClientVoiceCall::NotifyCallStateChanged(
+            MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSPClientVoiceCall::NotifyCallStateChanged state: %d", 
+            aState);
+    
+    // Client call is indicated during dialling state 
+    if ( aState == MCCPCallObserver::ECCPStateDialling )
+        {
+        IndicateClientCall(); 
+        }
+    
+    CSPVoiceCall::NotifyCallStateChanged( aState );  
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::NotifyCallStateChangedWithInband
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPClientVoiceCall::NotifyCallStateChangedWithInband(
+            MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSPClientVoiceCall::NotifyCallStateChangedWithInband state: %d", 
+            aState);
+
+    // Client call is indicated during dialling state
+    if ( aState == MCCPCallObserver::ECCPStateDialling )
+        {
+        IndicateClientCall(); 
+        }
+
+    CSPVoiceCall::NotifyCallStateChangedWithInband( aState );  
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::IndicateClientCall
+// Indicate dialling if needed 
+// ---------------------------------------------------------------------------
+//  
+void CSPClientVoiceCall::IndicateClientCall()
+    {
+    // Can be done only once for each call and possible duplicate 
+    // notifies are blocked 
+    if ( !iClientCallIndicated )
+        {
+        iClientCallIndicated = ETrue;
+
+        CSPLOGSTRING(CSPINT, 
+            "CSPClientVoiceCall::IndicateClientCall indicate client call")
+        
+        iCommonInfo.IndicateClientCall( this );
+        
+        CSPLOGSTRING(CSPINT, 
+            "CSPClientVoiceCall::IndicateClientCall IndicateClientCall completed")                
+        }
+    else 
+        {
+        CSPLOGSTRING(CSPERROR, 
+            "CSPClientVoiceCall::IndicateClientCall already indicated")
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::OpenCallHandleL
+// ---------------------------------------------------------------------------
+//    
+void CSPClientVoiceCall::OpenCallHandleL()
+    {
+    CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::OpenCallHandleL <");
+
+    // Client call, open existing call handle 
+    OpenExistingCallL( iName ); 
+    
+    CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::OpenCallHandleL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPClientVoiceCall::UpdateCallInfoImpl
+// Update call info including remote party name and number data  
+// ---------------------------------------------------------------------------
+//    
+void CSPClientVoiceCall::UpdateCallInfoImpl( RMobileCall::TMobileCallInfoV7 aCallInfo )
+    {
+    CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::UpdateCallInfoImpl <");    
+
+    // Call was added by ETel monitor, update info accordingly 
+    UpdateCallNameNumberInfo( aCallInfo, ETrue );     
+    UpdateCallOrigin( aCallInfo );
+    
+    CSPLOGSTRING(CSPINT, "CSPClientVoiceCall::UpdateCallInfoImpl >");
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspconferencecall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,623 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements class CSPConferenceCall which provides call functionality
+*
+*/
+
+
+
+#include <etelmm.h>
+#include <etel.h>
+#include <mccpcall.h>
+
+#include "cspconferencecall.h"
+#include "cspvoicecall.h"
+#include "cspetelconferencecallrequester.h"
+#include "cspetelconferenceeventmonitor.h"
+#include "cspetelconferencestatusmonitor.h"
+#include "cspetelconferencecapsmonitor.h"
+#include "mcspcallinformation.h"
+#include "csplogger.h"
+#include "csppanic.pan"
+#include "cspconsts.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::NewL
+// ---------------------------------------------------------------------------
+//
+CSPConferenceCall* CSPConferenceCall::NewL( 
+                          RMobilePhone& aPhone, 
+                          MCSPCallInformation& aCallInfo,
+                          TUint32 aServiceId  )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::NewL()");
+    
+    CSPConferenceCall* self = new ( ELeave ) CSPConferenceCall( aPhone,  
+                                            aCallInfo, aServiceId );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::NewL() end");
+    return self;
+    }
+
+// --------------------------------------------------------ß-------------------
+// CSPConferenceCall::~CSPConferenceCall
+// ---------------------------------------------------------------------------
+//
+CSPConferenceCall::~CSPConferenceCall()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::~CSPConferenceCall() start");
+    iObservers.Close();
+
+    delete iCallStatusMonitor;
+    delete iCallEventMonitor;
+    delete iCallCapsMonitor;
+    delete iRequester;
+    iCall.Close();
+
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::~CSPConferenceCall() end");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::NotifyEvent
+// Conference event forwarding.
+// This way Added, Removed and Split events are notified.
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::NotifyEvent(
+             MCCPConferenceCallObserver::TCCPConferenceCallEvent aEvent,
+             TName& aCallName )
+    {
+    CSPLOGSTRING2( CSPINT, "CSPConferenceCall::NotifyEvent < %d", aEvent );
+    
+    CSPCall* call = iCallInfo.FindCall( aCallName );
+    TInt count = iObservers.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {        
+        MCCPConferenceCallObserver *obs = iObservers[i];
+        if ( obs )
+            {        
+            obs->ConferenceCallEventOccurred( aEvent, call );
+            }
+        }
+    CSPLOGSTRING2( CSPINT, "CSPConferenceCall::NotifyEvent > %d", aEvent );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::NotifyEvent
+// Conference event forwarding in case of Terminated, Built or Swapped events.
+// These events are not call specific.
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::NotifyEvent(
+             MCCPConferenceCallObserver::TCCPConferenceCallEvent aEvent )
+    {
+    CSPLOGSTRING2( CSPINT, "CSPConferenceCall::NotifyEvent < %d", aEvent );
+    
+    TInt count = iObservers.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        MCCPConferenceCallObserver *obs = iObservers[i];
+        if ( obs )
+            {        
+            obs->ConferenceCallEventOccurred( aEvent, NULL );
+            }
+        }
+    
+    CSPLOGSTRING2( CSPINT, "CSPConferenceCall::NotifyEvent > %d", aEvent );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::NotifyStateChanged
+// Conference state change forwarding
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::NotifyStateChange( 
+        MCSPConferenceStatusObserver::TCSPConferenceState aStatus )
+    {
+    CSPLOGSTRING3( CSPINT, "CSPConferenceCall::NotifyStateChange %d this: %x", aStatus,
+                            this );
+    iCallState = static_cast<MCCPConferenceCallObserver::TCCPConferenceCallState>(aStatus);
+    if ( aStatus == MCSPConferenceStatusObserver::ECSPConferenceIdle )
+        {
+        iCallCountForAddCall = 0;
+        }
+    else
+        {
+        if ( iCallCountForAddCall == 1 )
+            {
+            iCallCountForAddCall++;
+            }
+        }
+    
+    TInt count = iObservers.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        MCCPConferenceCallObserver *obs = iObservers[i];
+        if ( obs )
+            {
+            obs->ConferenceCallStateChanged( 
+                    static_cast<MCCPConferenceCallObserver::TCCPConferenceCallState>(aStatus) );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::ConferenceCapsChanged
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::ConferenceCapsChanged( TUint32 aCaps )
+    {
+    CSPLOGSTRING2( CSPINT, "CSPConferenceCall::ConferenceCapsChanged %b", aCaps );
+    
+    TInt count = iObservers.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        MCCPConferenceCallObserver *obs = iObservers[i];
+        if ( obs )
+            {          
+            obs->ConferenceCallCapsChanged( 
+                 (MCCPConferenceCallObserver::TCCPConferenceCallCaps) aCaps );
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::NotifyConferenceError
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::NotifyConferenceError( TCCPConferenceCallError aErr )
+    {
+    CSPLOGSTRING2( CSPERROR, "CSPConferenceCall::NotifyConferenceError < %d", aErr );
+    
+    TInt count = iObservers.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        MCCPConferenceCallObserver *obs = iObservers[i];
+        if ( obs )
+            {
+            obs->ErrorOccurred( aErr );
+            }
+        }
+        
+    CSPLOGSTRING2( CSPERROR, "CSPConferenceCall::NotifyConferenceError > %d", aErr );
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPConferenceCall
+// CSPConferenceCall::AddCall
+// ---------------------------------------------------------------------------
+//    
+void CSPConferenceCall::AddCallL( MCCPCall* aCall )
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::AddCallL " );
+    
+    TInt err(KErrNone);
+    
+    if ( aCall )
+        {       
+        iCallCountForAddCall++;
+        CSPLOGSTRING2( CSPINT, "CSPConferenceCall::AddCallL calls added %d", 
+                                iCallCountForAddCall );
+        
+        if ( iCallCountForAddCall < 2 )
+            {
+            CSPLOGSTRING2( CSPINT, 
+                "CSPConferenceCall::AddCallL DO NOTHING SINCE CALL COUNT IS %d", iCallCountForAddCall );
+            }
+        else if ( iCallCountForAddCall == 2 )
+            {
+            err = iRequester->MakeRequest( 
+                CSPEtelConferenceCallRequester::
+                    EConferenceRequestTypeCreateConference );
+            }
+        else if ( iCallCountForAddCall > 2 )
+            {
+            CSPLOGSTRING( CSPINT, "CSPConferenceCall::AddCall cast call");
+            CSPCall* cspCall = static_cast< CSPCall* > ( aCall );
+            
+            iAddedCallName.Zero();
+            cspCall->CallName( iAddedCallName );
+            CSPLOGSTRING2( CSPINT, "CSPConferenceCall::AddCall n=%S", &iAddedCallName );
+            err = iRequester->MakeAddCallRequest( iAddedCallName );
+            CSPLOGSTRING2( CSPINT, 
+                "CSPConferenceCall::AddCallL result %d", err);
+            }
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSPConferenceCall::AddCallL Invalid argument, call NULL" );
+
+        err = KErrArgument;
+        }
+    
+    CSPLOGSTRING2( CSPINT, "CSPConferenceCall::AddCallL returning %d", err);
+
+    User::LeaveIfError( err );        
+    
+    CSPLOGSTRING( CSPINT, "CSPConferenceCall::AddCallL OK" );
+    }    
+    
+// ---------------------------------------------------------------------------
+// From class MCCPConferenceCall
+// CSPConferenceCall::RemoveCallL
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::RemoveCallL( MCCPCall* aCall )
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::RemoveCallL " );
+    if ( aCall )
+        {
+        User::LeaveIfError( aCall->HangUp() );
+        CSPLOGSTRING( CSPINT, "CSPConferenceCall::RemoveCallL Hangup request sent" );
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, "CSPConferenceCall::RemoveCallL Invalid argument" );
+        User::Leave( KErrArgument );
+        }
+        
+    CSPLOGSTRING( CSPREQOUT, "CSPConferenceCall::RemoveCallL end" );
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPConferenceCall
+// CSPConferenceCall::CallCount
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::CallCount( ) const
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::CallCount" );
+    TInt callCount(0);
+    TInt err = iCall.EnumerateCalls( callCount );
+    CSPLOGSTRING( CSPREQOUT, "CSPConferenceCall::CallCount end" );
+    return callCount;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPConferenceCall
+// CSPConferenceCall::GoOneToOneL
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::GoOneToOneL( MCCPCall& aCall )
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::GoOneToOneL " );
+    
+    if ( aCall.Parameters().CallType() == CCPCall::ECallTypeCSVoice )
+        {
+        CSPVoiceCall& voiceCall = static_cast< CSPVoiceCall& > ( aCall );
+        TInt err = voiceCall.GoOneToOne();
+        CSPLOGSTRING2( CSPREQIN, "CSPConferenceCall::GoOneToOneL Request %d", 
+                       err );
+        User::LeaveIfError( err );
+        }
+    else
+        {
+        CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::GoOneToOneL ERROR NOT VOICE CALL" );
+        User::Leave( KErrNotSupported );
+        }
+    CSPLOGSTRING( CSPREQOUT, "CSPConferenceCall::GoOneToOneL end" );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPConferenceCall
+// CSPConferenceCall::ServiceId
+// ---------------------------------------------------------------------------
+//
+TUint32 CSPConferenceCall::ServiceId() const
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::ServiceId " );
+    return iServiceId;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPConferenceCall::HangUp
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::HangUp()
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::HangUp " );
+    TInt err(KErrNone);
+    
+    err = iRequester->MakeRequest( 
+        CSPEtelConferenceCallRequester::EConferenceRequestTypeHangup );
+    if ( err )
+        {
+        CSPLOGSTRING2( CSPERROR, "CSPConferenceCall::HangUp error %d", err );
+        }
+    
+    return err;
+    }
+   
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPConferenceCall::Hold
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::Hold()
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::Hold call" );
+    
+    TInt err( KErrNone );
+    
+    if ( iCallState == MCCPConferenceCallObserver::ECCPConferenceActive )
+        {
+        CSPLOGSTRING( CSPREQOUT, "CSPConferenceCall::Hold > RMobileConferenceCall::Hold" );
+        
+        err = iRequester->MakeRequest( 
+                    CSPEtelConferenceCallRequester::EConferenceRequestTypeHold );
+        if ( err != KErrNone )
+            {
+            CSPLOGSTRING2( CSPERROR, "CSPConferenceCall::Hold error: %d", 
+                           err );
+            }
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, 
+                      "CSPConferenceCall::Hold : invalid state %d",
+                      iCallState );
+        err = KErrNotReady;
+        }
+
+
+    return err;
+    } 
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPConferenceCall::Resume
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::Resume()
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::Resume " );
+
+    TInt err( KErrNone );
+    
+    if ( iCallState == MCCPConferenceCallObserver::ECCPConferenceHold )
+        {
+        CSPLOGSTRING( CSPREQOUT, "CSPConferenceCall::Resume " );
+        err = iRequester->MakeRequest( 
+            CSPEtelConferenceCallRequester::EConferenceRequestTypeResume );
+        if ( KErrNone != err )
+            {
+            CSPLOGSTRING2( CSPERROR, "CSPConferenceCall::Resume Error %d",
+                          err );
+            }
+            
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, 
+                       "CSPConferenceCall::Resume : invalid state %d",
+                       iCallState );
+        err = KErrNotReady;
+        }
+
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPConferenceCall::Swap
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::Swap()
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::Swap " );
+    TInt err(KErrNone);
+    
+    if ( iCallState == MCCPConferenceCallObserver::ECCPConferenceActive 
+         || iCallState == MCCPConferenceCallObserver::ECCPConferenceHold )
+        {
+        err = iRequester->MakeRequest( 
+                    CSPEtelConferenceCallRequester::EConferenceRequestTypeSwap );
+        if ( err != KErrNone )
+            {
+            CSPLOGSTRING2( CSPERROR, "CSPConferenceCall::Swap Request error: %d", err );
+            }
+        }
+    else
+        {            
+        err = KErrNotReady;
+        CSPLOGSTRING2( CSPERROR, 
+                   "CSPConferenceCall::Swap Invalid state %d",
+                   iCallState );
+        }
+
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPConferenceCall
+// CSPConferenceCall::CurrentCallsToConferenceL
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::CurrentCallsToConferenceL()
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::CurrentCallsToConferenceL " );
+    iRequester->MakeRequest(
+     CSPEtelConferenceCallRequester::EConferenceRequestTypeCreateConference );
+    CSPLOGSTRING( CSPREQOUT, "CSPConferenceCall::CurrentCallsToConferenceL end" );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPConferenceCall
+// CSPConferenceCall::GetCallArray
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::GetCallArray( RPointerArray<MCCPCall>& aCallArray ) 
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::GetCallArray" );
+    // Reset array in case
+    aCallArray.Reset();
+    TInt err( KErrNone );  
+    
+    RMobileCall::TMobileCallInfoV3 callInfo; 
+    RMobileCall::TMobileCallInfoV3Pckg callInfoPck( callInfo );
+    
+    TInt callCount = CallCount(); 
+    CSPCall* call; 
+    
+    // Resolve call objects that are part of the conference
+    for ( int i = 0; i < callCount; i++ )
+        {
+        err = iCall.GetMobileCallInfo( i, callInfoPck );
+        
+        if ( KErrNone == err )
+            {
+            // Find call by call name 
+            call = iCallInfo.FindCall( callInfo.iCallName); 
+            if ( call ) 
+                {
+                err = aCallArray.Append( call );
+                }
+            else
+                {
+                err = KErrNotFound; 
+                }            
+            }
+        CSPLOGSTRING2( CSPERROR, "CSPConferenceCall::GetCallArray err: %d", err );
+        }
+        
+    CSPLOGSTRING( CSPREQOUT, "CSPConferenceCall::GetCallArray end"); 
+    return err; 
+    }
+
+// ---------------------------------------------------------------------------
+// Adds observer.
+// ---------------------------------------------------------------------------
+//
+void CSPConferenceCall::AddObserverL( const MCCPConferenceCallObserver& aObserver )
+    {
+    if ( iObservers.Find( &aObserver ) == KErrNotFound )
+        {
+        iObservers.Append( &aObserver );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Removes given observer.
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::RemoveObserver( const MCCPConferenceCallObserver& aObserver )
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPConferenceCall::RemoveObserver " );
+    TInt found = iObservers.Find( &aObserver );
+    if ( found != KErrNotFound )
+        {
+        iObservers.Remove( found );
+        return KErrNone;
+        }
+        
+    return found;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::GetConferenceCallState
+// ---------------------------------------------------------------------------
+//
+TInt CSPConferenceCall::GetConferenceCallState( 
+        MCCPConferenceCallObserver::TCCPConferenceCallState& aState ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::GetConferenceCallState()");
+    RMobileConferenceCall::TMobileConferenceStatus status;
+    TInt err = iCall.GetConferenceStatus( status );
+        
+    switch( status )
+        {
+        case RMobileConferenceCall::EConferenceIdle:
+            {
+            aState = MCCPConferenceCallObserver::ECCPConferenceIdle;
+            break;
+            }
+        case RMobileConferenceCall::EConferenceActive:
+            {
+            aState = MCCPConferenceCallObserver::ECCPConferenceActive;
+            break;
+            }
+        case RMobileConferenceCall::EConferenceHold:
+            {
+            aState = MCCPConferenceCallObserver::ECCPConferenceHold;
+            break;
+            }
+        default:
+            break;
+        }
+        
+    return err; 
+    }
+
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::CSPConferenceCall
+// ---------------------------------------------------------------------------
+//
+CSPConferenceCall::CSPConferenceCall( RMobilePhone& aPhone, 
+                         MCSPCallInformation& aCallInfo,
+                         TUint32 aServiceId  ) : 
+                     iPhone( aPhone ),
+                     iRequester( NULL ),
+                     iCallInfo( aCallInfo ),
+                     iServiceId( aServiceId )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::CSPConferenceCall()");
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPConferenceCall::ConstructL
+// Constructing CSPConferenceCall for MT call.
+// ---------------------------------------------------------------------------
+//    
+void CSPConferenceCall::ConstructL( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::ConstructL() start");
+    User::LeaveIfError( iCall.Open(iPhone) ); 
+
+    iCall.EnumerateCalls( iCallCountForAddCall );
+    CSPLOGSTRING2(CSPERROR, "CSPConferenceCall::Initialize() Call count : %d",
+                    iCallCountForAddCall );
+    
+    MCCPConferenceCallObserver::TCCPConferenceCallState conferenceState; 
+    TInt err = GetConferenceCallState( conferenceState );
+    
+    if ( KErrNone == err )
+        {
+        iCallState = conferenceState; 
+        CSPLOGSTRING2(CSPINT, "CSPConferenceCall::Initialize() State : %d", iCallState );
+        }
+    else 
+        {
+        iCallState = MCCPConferenceCallObserver::ECCPConferenceIdle;
+        CSPLOGSTRING2(CSPERROR, 
+                "CSPConferenceCall::Initialize() state fetching error %d", err );
+        }
+
+    // Start Etel monitors
+    iCallEventMonitor = CSPEtelConferenceEventMonitor::NewL( *this, iCall );
+    iCallEventMonitor->StartMonitoring();
+    iCallStatusMonitor = CSPEtelConferenceStatusMonitor::NewL( *this, iCall );
+    iCallStatusMonitor->StartMonitoring();
+    iCallCapsMonitor = CSPEtelConferenceCapsMonitor::NewL( *this, iCall );
+    iCallCapsMonitor->StartMonitoring();
+        
+    iRequester = CSPEtelConferenceCallRequester::NewL( *this, iCall );
+    CSPLOGSTRING(CSPOBJECT, "CSPConferenceCall::ConstructL() end");
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspdtmfprovider.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,261 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class CSPDTMFProvider
+*
+*/
+
+
+#include <etelmm.h>
+#include <mccpdtmfprovider.h>
+#include <mccpdtmfobserver.h>
+#include <rmmcustomapi.h>
+
+#include "cspdtmfprovider.h"
+#include "csplogger.h"
+#include "cspeteldtmfmonitor.h"
+#include "cspeteldtmfstopmonitor.h"
+
+CSPDTMFProvider* CSPDTMFProvider::NewL( RMobilePhone& aPhone,
+                                        RMmCustomAPI& aMmCustom )
+    {
+    CSPDTMFProvider* self = new ( ELeave ) CSPDTMFProvider( aPhone,
+                                                            aMmCustom );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPDTMFProvider::~CSPDTMFProvider( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPDTMFProvider::~CSPDTMFProvider()" );
+    Cancel();
+    iObservers.Close();
+    delete iMonitor;
+    delete iStopMonitor;
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies observers about a DTMF event
+// ---------------------------------------------------------------------------
+//
+void CSPDTMFProvider::NotifyDTMFEvent( const MCCPDTMFObserver::TCCPDtmfEvent aEvent,
+                      const TInt aError,
+                      const TChar aTone )
+    {
+    CSPLOGSTRING2(CSPINT, "CSPDTMFProvider::NotifyDTMFEvent %d", aEvent );
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        MCCPDTMFObserver *obs = iObservers[i];
+        if ( obs )
+            {        
+            iObservers[i]->HandleDTMFEvent( aEvent, aError, aTone );
+            }
+        }    
+    }
+
+    
+// ---------------------------------------------------------------------------
+// Cancel DTMF string sending
+// ---------------------------------------------------------------------------
+//
+TInt CSPDTMFProvider::CancelDtmfStringSending()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPDTMFProvider::CancelDtmfStringSending" );
+    if ( IsActive() )
+        {
+        Cancel();
+        }
+    else
+        {
+        return KErrAlreadyExists; // Is not active
+        }
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Starts DTMF string sending
+// ---------------------------------------------------------------------------
+//
+TInt CSPDTMFProvider::StartDtmfTone( const TChar aTone )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPDTMFProvider::StartDtmfTone" );
+    TInt ret(KErrAlreadyExists);
+    if (!IsActive())
+        {
+        ret = iPhone.StartDTMFTone( aTone );
+        }    
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// Stop DTMF tone
+// ---------------------------------------------------------------------------
+//
+TInt CSPDTMFProvider::StopDtmfTone()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPDTMFProvider::StopDtmfTone" );
+    TInt ret(KErrAlreadyExists);
+    if (!IsActive())
+        {
+        ret = iPhone.StopDTMFTone();
+        }
+    return ret;    
+    }
+
+// ---------------------------------------------------------------------------
+// Send DTMF string
+// ---------------------------------------------------------------------------
+//
+TInt CSPDTMFProvider::SendDtmfToneString( const TDesC& aString )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPDTMFProvider::SendDtmfToneString" );
+    TInt ret = KErrInUse;
+    
+    if ( !IsActive() )
+        {            
+        iPhone.SendDTMFTones( iStatus, aString );
+        SetActive();
+        ret = KErrNone;
+        }
+
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// Continue DTMF string sending
+// ---------------------------------------------------------------------------
+//
+TInt CSPDTMFProvider::ContinueDtmfStringSending( const TBool aContinue )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPDTMFProvider::ContinueDtmfStringSending" );
+    return iPhone.ContinueDTMFStringSending( aContinue );
+    }
+    
+// ---------------------------------------------------------------------------
+// Adds observer.
+// ---------------------------------------------------------------------------
+//
+void CSPDTMFProvider::AddObserverL( const MCCPDTMFObserver& aObserver )
+    {
+    if ( iObservers.Find( &aObserver ) == KErrNotFound )
+        {
+        iObservers.Append( &aObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Removes given observer.
+// ---------------------------------------------------------------------------
+//
+TInt CSPDTMFProvider::RemoveObserver( const MCCPDTMFObserver& aObserver )
+    {
+    TInt ret = KErrNotFound;
+    
+    TInt found = iObservers.Find( &aObserver );
+    if ( found != KErrNotFound )
+        {
+        iObservers.Remove( found );
+        ret = KErrNone;
+        }
+
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive.
+// Handles request completion.
+// ---------------------------------------------------------------------------
+//
+void CSPDTMFProvider::RunL()
+    {
+    CSPLOGSTRING2( CSPREQIN, 
+        "CSPDTMFProvider::RunL: status: %d", iStatus.Int() );
+    
+    if ( iStatus == KErrNone )
+        {
+        MCCPDTMFObserver::TCCPDtmfEvent event = 
+            MCCPDTMFObserver::ECCPDtmfStringSendingCompleted;
+        NotifyDTMFEvent( event, KErrNone, NULL );
+        }
+    else
+        {
+        TInt error = iStatus.Int();
+        if ( error != KErrCancel )
+            {
+            MCCPDTMFObserver::TCCPDtmfEvent event = 
+                MCCPDTMFObserver::ECCPDtmfStringSendingCompleted;
+            NotifyDTMFEvent( event, error, NULL );
+            }
+        else
+            {
+            // Cancel is not notified
+            CSPLOGSTRING( CSPREQEND, "CSPDTMFProvider::RunL Cancel." );
+            }
+        }
+                
+    CSPLOGSTRING( CSPREQEND, "CSPDTMFProvider::RunL End of RunL." );
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPDTMFProvider::DoCancel()
+    {
+    if ( iStatus == KRequestPending )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPDTMFProvider::DoCancel Canceling pending request.." );
+        iPhone.CancelAsyncRequest( EMobilePhoneSendDTMFTones );
+        }
+    }
+            
+// ---------------------------------------------------------------------------
+// Constructs the requester.
+// ---------------------------------------------------------------------------
+//
+CSPDTMFProvider::CSPDTMFProvider( RMobilePhone& aPhone, 
+                                  RMmCustomAPI& aMmCustom ):
+                    CActive( EPriorityStandard ),
+                    iPhone( aPhone ),
+                    iMmCustom( aMmCustom )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPDTMFProvider::CSPDTMFProvider()" );
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the requester in the second phase.
+// ---------------------------------------------------------------------------
+//
+void CSPDTMFProvider::ConstructL( ) 
+    {
+    if ( !iPhone.SubSessionHandle() || !iMmCustom.SubSessionHandle() )
+        {
+        User::Leave( KErrArgument );
+        }
+    iMonitor = CSPEtelDtmfMonitor::NewL( *this, iMmCustom );
+    iMonitor->StartMonitoring();
+    iStopMonitor = CSPEtelDtmfStopMonitor::NewL( *this, iPhone );
+    iStopMonitor->StartMonitoring();
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelcallcapsmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSPEtelCallCapsMonitor which
+*                monitors call status changes from ETel and notifies observer
+*                according to call status change.
+*
+*/
+
+
+#include "cspetelcallcapsmonitor.h"
+
+#include <mccpcallobserver.h>
+
+#include "mcspcallobserver.h"
+#include "csplogger.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor in two phase.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallCapsMonitor* CSPEtelCallCapsMonitor::NewL( 
+                                                    MCSPCallObserver& aObserver,
+                                                    RMobileCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallCapsMonitor::NewL()" );
+    CSPEtelCallCapsMonitor* self = 
+                        new ( ELeave ) CSPEtelCallCapsMonitor( 
+                                                            aObserver, aCall );
+    return self;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallCapsMonitor::~CSPEtelCallCapsMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallCapsMonitor::~CSPEtelCallCapsMonitor()" );
+    Cancel();
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallCapsMonitor::~CSPEtelCallCapsMonitor() ok" );
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallCapsMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+          "CSPEtelCallCapsMonitor::StartMonitoring()" );
+
+    
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CSPEtelCallCapsMonitor::StartMonitoring: Request \
+                    RMobilePhone::NotifyCapsChange" );
+        iCall.NotifyMobileCallCapsChange( iStatus, iCapsPckg );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSPEtelCallCapsMonitor::StartMonitoring: Already active" );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// From CActive
+// Handles call status notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallCapsMonitor::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPEtelCallCapsMonitor::RunL: status: %d", iStatus.Int() );
+    
+    if ( iStatus == KErrNone )
+        {
+        TUint32 capsFlags = iCaps.iCallControlCaps;
+        
+        iObserver.CallCapsChanged( capsFlags );
+        StartMonitoring();
+        }
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallCapsMonitor::DoCancel()
+    {
+    iCall.CancelAsyncRequest( EMobileCallNotifyMobileCallCapsChange );
+    }
+
+
+
+    
+// ---------------------------------------------------------------------------
+// Constructs the monitor..
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallCapsMonitor::CSPEtelCallCapsMonitor( MCSPCallObserver& aObserver,
+                                                    RMobileCall& aCall ) : 
+                                   CActive( EPriorityStandard ),
+                                   iObserver( aObserver ),
+                                   iCall ( aCall ),
+                                   iCapsPckg( iCaps )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallCapsMonitor::CSPEtelCallCapsMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+    
+
+TUint32 CSPEtelCallCapsMonitor::FetchCallControlCapsL()
+    {
+    TInt err = iCall.GetMobileCallCaps( iCapsPckg );
+    User::LeaveIfError( err );
+    return iCaps.iCallControlCaps;
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelcalleventmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,291 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSPEtelCallEventMonitor which
+*                monitors call events from ETel and notifies observer
+*                accordingly.
+*
+*/
+
+
+#include <mccptransferobserver.h>
+#include <mccpforwardobserver.h>
+#include <mccpconferencecallobserver.h>
+
+#include "cspetelcalleventmonitor.h"
+#include "csplogger.h"
+#include "cspcall.h"
+
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallEventMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallEventMonitor* CSPEtelCallEventMonitor::NewL( MCSPCallObserver& aObserver,
+                                                        RMobileCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallEventMonitor::NewL()" );
+    CSPEtelCallEventMonitor* self = new ( ELeave ) CSPEtelCallEventMonitor( 
+                                        aObserver, aCall );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallEventMonitor::~CSPEtelCallEventMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallEventMonitor::~CSPEtelCallEventMonitor()" );
+    Cancel();
+    
+    if ( iDestrPtr )
+        {
+        *iDestrPtr = ETrue;
+        iDestrPtr = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallEventMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING( CSPINT, "CSPEtelCallEventMonitor::StartMonitoring" );
+    
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CSP: CSPEtelCallEventMonitor::StartMonitoring: \
+                    Request RMobilePhone::NotifyCallEvent" );
+        iCall.NotifyCallEvent( iStatus, iCallEvent );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelCallEventMonitor::StartMonitoring: Already active" );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Handles event notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallEventMonitor::RunL()
+    {
+    CSPLOGSTRING( CSPINT, "CSPEtelCallEventMonitor::RunL")
+    
+    // Survive from monitor destruction during observing sequence
+    TBool destroyed = EFalse;
+    iDestrPtr = &destroyed;
+    
+    if ( iStatus == KErrNone )
+        {
+        switch ( iCallEvent )
+            {
+            // The call has been terminated by the remote party. 
+            case RMobileCall::ERemoteTerminated:
+                {
+                CSPLOGSTRING( CSPINT, 
+                   "CSP CSPEtelCallEventMonitor::RunL: Remotely terminated" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPRemoteTerminated );
+                break;
+                }
+             // The call has been placed on hold as a result of a local action
+            case RMobileCall::ELocalHold:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Locally held" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPLocalHold );
+                break;
+                }
+                
+            // The call has been resumed as a result of a local action. 
+            case RMobileCall::ELocalResume:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Locally resumed" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPLocalResume );
+                break;
+                }
+            // The call has been deflected to another remote party as a result
+            // of a local action.
+            case RMobileCall::ELocalDeflectCall:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Locally deflected" );
+                iObserver.NotifyTransferCallEventOccurred(  
+                        MCCPTransferObserver::ECCPLocalTransfer );
+                break;
+                }
+            // The call has been transferred to another remote party as a 
+            // result of a local action. 
+            case RMobileCall::ELocalTransfer:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Locally transfered" );
+                iObserver.NotifyTransferCallEventOccurred( 
+                        MCCPTransferObserver::ECCPLocalTransfer );
+                break;
+                }
+            // The call has been placed on hold by the remote connected party
+            case RMobileCall::ERemoteHold:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely held" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPRemoteHold );
+                break;
+                }
+            // The call has been resumed by the remote connected party. 
+            case RMobileCall::ERemoteResume:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely resumed" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPRemoteResume );
+                break;
+                }
+            // The call has been joined by the remote connected party to other
+            // call(s) to create/add to a conference call. 
+            case RMobileCall::ERemoteConferenceCreate:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely created \
+                             conference" );
+                
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPRemoteConferenceCreate );
+                        
+                break;
+                }
+            case RMobileCall::ERemoteTransferring:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely created \
+                     conference" );
+                iObserver.NotifyTransferCallEventOccurred( 
+                        MCCPTransferObserver::ECCPRemoteTransferring );
+                break;
+                }
+            case RMobileCall::ERemoteTransferAlerting:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely created \
+                     conference" );
+                iObserver.NotifyTransferCallEventOccurred( 
+                            MCCPTransferObserver::ECCPRemoteTransferAlerting );
+                break;
+                }
+            // The outgoing call has been barred by the remote party
+            case RMobileCall::ERemoteBarred:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely barred" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPRemoteBarred );
+                break;
+                }
+
+            // The call is being forwarded by the remote party. 
+            case RMobileCall::ERemoteForwarding:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely forwarded" );
+                iObserver.NotifyForwardEventOccurred( 
+                        MCCPForwardObserver::ECCPRemoteForwarding );
+                break;
+                }
+
+            // The call is waiting at the remote end. 
+            case RMobileCall::ERemoteWaiting:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Remotely waiting" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPRemoteWaiting );
+                break;
+                }
+
+            // The outgoing call has been barred by the local party. 
+            case RMobileCall::ELocalBarred:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Locally barred" );
+                iObserver.NotifyCallEventOccurred( 
+                        MCCPCallObserver::ECCPLocalBarred );
+                break;
+                }
+
+            default:
+                {
+                CSPLOGSTRING2( CSPINT, 
+                    "CSP CSPEtelCallEventMonitor::RunL: Unspecified/protocol \
+                     specific call event: %d", iCallEvent );
+                break;
+                }
+            }
+        }
+        
+    if ( !destroyed )
+        {
+        // In case instance has not been deleted, pointer must be cleared.
+        iDestrPtr = NULL;
+        if ( iStatus == KErrNone )
+            {
+            StartMonitoring();
+            }
+        }
+    else
+        {
+        // already destroyed, do not touch members.
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Request canceling.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallEventMonitor::DoCancel()
+    {
+    CSPLOGSTRING( CSPINT, "CSPEtelCallEventMonitor::DoCancel" );
+    iCall.CancelAsyncRequest( EMobileCallNotifyCallEvent );
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallEventMonitor::CSPEtelCallEventMonitor( MCSPCallObserver& aObserver,
+                                                  RMobileCall& aCall ) : 
+                                   CActive( EPriorityStandard ), 
+                                   iObserver( aObserver ),
+                                   iCall ( aCall )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallEventMonitor::CSPEtelCallEventMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelcallrequester.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,929 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class CSPEtelCallRequester
+*
+*/
+
+#include "cspetelcallrequester.h"
+
+#include <exterror.h>
+#include <gsmerror.h>
+#include <etelmmerr.h>
+#include <etelsat.h>
+
+#include "mcspcallerrorobserver.h"
+#include "csplogger.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructs the requester via two phased constructing.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallRequester* CSPEtelCallRequester::NewL(
+            MCSPCallErrorObserver& aObserver,
+            RMobileCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallRequester::NewL()" );
+    CSPEtelCallRequester* self = new ( ELeave ) CSPEtelCallRequester( 
+                                        aObserver, aCall );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallRequester::~CSPEtelCallRequester( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallRequester::~CSPEtelCallRequester()" );
+    CSPLOGSTRING2(CSPINT, "CSPEtelCallRequester:: type: %d", iRequestType );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallRequester::MakeDialRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelCallRequester::MakeDialRequest( 
+            const TDesC8& aCallParams, 
+            TDesC& aRecipient )
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelCallRequester::MakeDialRequest" );
+    iRequestType = ERequestTypeDial;
+
+    if ( !IsActive() )
+        {
+        iCall.Dial( iStatus, aCallParams, aRecipient );
+        SetActive();
+        }
+    else
+        {
+        return KErrInUse;
+        }
+    
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPEtelCallRequester::MakeDialNoFdnCheckRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelCallRequester::MakeDialNoFdnCheckRequest( 
+            const TDesC8& aCallParams, 
+            TDesC& aRecipient )
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelCallRequester::MakeDialNoFdnCheckRequest" );
+    iRequestType = ERequestTypeDial;
+
+    if ( !IsActive() )
+        {
+        iCall.DialNoFdnCheck( iStatus, aCallParams, aRecipient );
+        SetActive();
+        }
+    else
+        {
+        return KErrInUse;
+        }
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallRequester::MakeAnswerRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelCallRequester::MakeAnswerRequest(
+            const TDesC8& aCallParams )
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelCallRequester::MakeAnswerRequest" );
+    if ( !IsActive() )
+        {
+        iRequestType = ERequestTypeAnswer;
+        iCall.AnswerIncomingCall( iStatus, aCallParams );
+        SetActive();
+        }
+    else
+        {
+        return KErrInUse;
+        }
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallRequester::MakeDialEmergencyRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelCallRequester::MakeDialEmergencyRequest( 
+                            const RMobileENStore::TEmergencyNumber& aRecipient )
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelCallRequester::MakeDialEmergencyRequest" );
+    Cancel();
+
+    iRequestType = ERequestTypeDialEmergency;
+    iCall.DialEmergencyCall( iStatus, aRecipient );
+    SetActive();
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallRequester::MakeRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelCallRequester::MakeRequest( TRequestType aRequest )
+    {
+    TInt result = KErrUnknown;
+
+    if ( !IsActive() )
+        {
+        if ( aRequest != ERequestTypeDial 
+             && aRequest != ERequestTypeDialEmergency )
+            {
+            iRequestType = aRequest;
+            }
+        CSPLOGSTRING2( CSPREQOUT, 
+            "CSP: CSPEtelCallRequester::MakeRequest %d", iRequestType );
+        switch ( aRequest )
+            {
+            case ERequestTypeDial:
+                {
+                // Requested through MakeDialRequest as a special case because
+                // of the parameters.
+                result = KErrNotSupported;
+                break;
+                }
+            case ERequestTypeDialEmergency:
+                {
+                // Requested through MakeDialEmergencyRequest as a special case because
+                // of the parameters.
+                result = KErrNotSupported;
+                break;
+                }
+            case ERequestTypeAnswer:
+                {
+                iCall.AnswerIncomingCall( iStatus );
+                result = KErrNone;
+                SetActive();
+                break;
+                }                
+            case ERequestTypeHangup:
+                {
+                iCall.HangUp( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case ERequestTypeHold:
+                {
+                iCall.Hold( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case ERequestTypeResume:
+                {
+                iCall.Resume( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case ERequestTypeGoOneToOne:
+                {
+                iCall.GoOneToOne( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case ERequestTypeSwap:
+                {
+                iCall.Swap( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+                
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                    "CSP: CSPEtelCallRequester::MakeRequest: Unspecified \
+                                        request type: %d", iRequestType );
+                result = KErrArgument;
+                }
+            }        
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelCallRequester::MakeRequest: Already active" );
+        result = KErrInUse;
+        }
+        
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallRequester::CancelRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelCallRequester::CancelRequest( TRequestType aRequest )
+    {
+    TInt result(KErrNone);
+    if ( iRequestType == aRequest )
+        {
+        Cancel();
+        }
+    else
+        {
+        CSPLOGSTRING3( CSPERROR, "CSPEtelCallRequester::CancelRequest: No such active, current is %d, param=%d", iRequestType, aRequest );
+        result = KErrNotReady;
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CSPEtelCallRequester::RunL
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallRequester::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, "CSPEtelCallRequester::RunL: status: %d", iStatus.Int() );
+    
+    TRequestType endedRequest = iRequestType;
+    iRequestType = ERequestTypeNone;
+    if ( iStatus == KErrNone )
+        {
+        
+        switch ( endedRequest )
+            {            
+            case ERequestTypeDial:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Dial request OK" );
+                break;
+                }
+            case ERequestTypeAnswer:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Answer request OK" );
+                break;
+                }
+            case ERequestTypeHangup:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Hangup request OK" );
+                break;
+                }
+            case ERequestTypeHold:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Hold request OK" );
+                break;
+                }
+            case ERequestTypeResume:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Resume request OK" );
+                break;
+                }
+            case ERequestTypeGoOneToOne:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: GoOneToOne request OK" );
+                break;
+                }
+            case ERequestTypeSwap:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Swap request OK" );
+                break;
+                }
+            case ERequestTypeDialEmergency:
+                {
+                CSPLOGSTRING( CSPINT,
+                "CSP CSPEtelCallRequester::RunL: DialEmergency request OK" );
+                break;
+                }
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                    "CSP CSPEtelCallRequester::RunL: Unspecified request \
+                                                type: %d", iRequestType );
+                break;
+                }
+            }
+        }
+    else
+        {
+        // Error situations
+        TInt err = iStatus.Int();
+        CSPLOGSTRING2( CSPERROR, "CSP CSPEtelCallRequester::RunL: request \
+                                completed with error: %d", err );
+
+        switch ( endedRequest )
+            {
+            case ERequestTypeDial:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Dial request" );
+                if ( err != KErrCancel )
+                    {
+                    iObserver.DialRequestFailed( err );
+                    return; // In case of Idle state has caused
+                    // immediate destruction of this object.
+                    }
+                break;
+                }
+            case ERequestTypeAnswer:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Answer request" );
+                iObserver.NotifyErrorOccurred( ECCPRequestFailure );
+                break;
+                }
+            case ERequestTypeHangup:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Hangup request" );
+                iObserver.NotifyErrorOccurred( ECCPRequestFailure );
+                break;
+                }
+            case ERequestTypeHold:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Hold request" );
+                iObserver.NotifyErrorOccurred( ECCPLocalHoldFail );
+
+                break;
+                }
+            case ERequestTypeResume:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Resume request" );
+                iObserver.NotifyErrorOccurred( ECCPLocalResumeFail );
+                break;
+                }
+            case ERequestTypeGoOneToOne:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: GoOneToOne request" );
+                iObserver.NotifyErrorOccurred( ECCPRequestFailure );
+                break;
+                }
+            case ERequestTypeSwap:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelCallRequester::RunL: Swap request" );
+                iObserver.NotifyErrorOccurred( ECCPRequestFailure );
+                break;
+                }
+            case ERequestTypeDialEmergency:
+                {
+                CSPLOGSTRING2( CSPINT,
+                    "CSP CSPEtelCallRequester: RunL: DialEmergency error: %d",
+                     err );
+                
+                if ( err != KErrCancel )
+                    {
+                    iObserver.EmergencyDialRequestFailed(err);
+                    }
+                
+                break;
+                }
+                
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                    "CSP CSPEtelCallRequester::RunL: Unspecified request \
+                                                type: %d", iRequestType );
+                break;
+                }
+            }
+        
+        }    
+    }
+
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CSPEtelCallRequester::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallRequester::DoCancel()
+    {
+    CSPLOGSTRING( CSPREQOUT, "CSP: CSPEtelCallRequester::DoCancel" );
+    TRequestType cancelRequest = iRequestType;
+    iRequestType = ERequestTypeNone;
+    
+    if ( IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, "CSP: CSPEtelCallRequester::DoCancel IsActive" );
+        switch ( cancelRequest )
+            {
+            case ERequestTypeDial:
+                {
+                CSPLOGSTRING( CSPREQOUT, "CSPEtelCallRequester::DoCancel DialCancel" );
+                iCall.DialCancel();
+                CSPLOGSTRING( CSPREQOUT, "CSPEtelCallRequester::DoCancel DialCancel OK" );
+                break;
+                }
+            case ERequestTypeAnswer:
+                {
+                iCall.AnswerIncomingCallCancel();
+                break;
+                }
+            case ERequestTypeHangup:
+                {
+                iCall.HangUpCancel();
+                break;
+                }
+            case ERequestTypeHold:
+                {
+                iCall.CancelAsyncRequest( EMobileCallHold );
+                break;
+                }
+            case ERequestTypeResume:
+                {
+                iCall.CancelAsyncRequest( EMobileCallResume );
+                break;
+                }
+            case ERequestTypeGoOneToOne:
+                {
+                iCall.CancelAsyncRequest( EMobileCallGoOneToOne );
+                break;
+                }
+            case ERequestTypeSwap:
+                {
+                iCall.CancelAsyncRequest( EMobileCallSwap );
+                break;
+                }
+            case ERequestTypeDialEmergency:
+                {
+                iCall.CancelAsyncRequest( EMobileCallDialEmergencyCall );
+                break;
+                }
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, "CSP CSPEtelCallRequester::DoCancel: \
+                                Unspecified request type: %d", iRequestType );
+                }
+            }
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelCallRequester::DoCancel: Not active" );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the requester.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallRequester::CSPEtelCallRequester(
+            MCSPCallErrorObserver& aObserver,
+            RMobileCall& aCall ) : 
+                CActive( EPriorityStandard ), 
+                iObserver( aObserver ), 
+                iCall ( aCall ),
+                iRequestType( ERequestTypeNone )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallRequester::CSPEtelCallRequester()" );
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Error value mapping.
+// ---------------------------------------------------------------------------
+//
+TCCPError CSPEtelCallRequester::MapError( TInt aErrorCode )
+    {
+    TCCPError ret = ECCPRequestFailure;
+    CSPLOGSTRING2( CSPINT, "CSPEtelCallRequester::MapError %d", aErrorCode);
+       
+    switch ( aErrorCode )
+        {
+        case KErrGsmCCUnassignedNumber:
+            {
+            ret = ECCPErrorNotReached;
+            break;
+            }        
+        case KErrGsmCCUserBusy:
+            {
+            ret = ECCPErrorBusy;
+            break;
+            }
+        case KErrMMEtelCallForbidden:
+        case KErrGsmCallInProgress:
+        case KErrGsmNumberBarred:
+        case KErrGsmNotAllowed:
+        case KErrEtelCallNotActive:
+        case KErrEtelCallAlreadyActive:
+            {
+            ret = ECCPErrorNotAllowed;
+            break;
+            }        
+        case KErrGsmCCNumberChanged:
+            {
+            ret = ECCPErrorMovedPermanently;
+            break;
+            }        
+        case KErrGsmCCInvalidNumberFormat:
+            {
+            ret = ECCPErrorInvalidURI;
+            break;
+            }        
+        case KErrGsmCCNormalUnspecified:
+            {
+            ret = ECCPErrorNoAnswerForVideo;
+            break;
+            }
+        case KErrGsmCCTemporaryFailure:
+        case KErrGsmCCSwitchingEquipmentCongestion:
+        case KErrGsmCCRequestedChannelNotAvailable:
+            {
+            ret = ECCPErrorNetworkBusy;
+            break;
+            }     
+        case KErrGsmCCNetworkOutOfOrder:
+            {
+            ret = ECCPErrorNetworkOutOfOrder;
+            break;
+            }     
+        case KErrGsmCCRequestedFacilityNotSubscribed:
+            {
+            ret = ECCPErrorCCRequestedFacilityNotSubscribed;
+            break;
+            } 
+        case KErrGsmCCInvalidCallReferenceValue:
+            {
+            ret = ECCPErrorInvalidCallReferenceValue;
+            break;
+            } 
+        case KErrGsmCCUserNotInCug:
+            {
+            ret = ECCPErrorUserNotInCug;
+            break;
+            }
+        case KErrGsmCCIncompatibleDestination:
+            {
+            // Affects to phone redial handling
+            ret = ECCPErrorBadRequest;
+            break;
+            }
+        case KErrGsmCCInvalidTransitNetworkSelection:
+            {
+            ret = ECCPErrorCCInvalidTransitNetworkSelection;
+            break;
+            }
+        case KErrGsmCCSemanticallyIncorrectMessage:
+        case KErrGsmCCConditionalIEError:
+        case KErrGsmCCUnspecifiedProtocolError:
+        case KErrEtelNoCarrier:
+            {
+            ret = ECCPErrorConnectionError;
+            break;
+            }
+        case KErrGsmCallServerFail:
+        case KErrGsm0707NotFound:
+        case KErrGsmCallRejected:
+            {
+            ret = ECCPErrorRejected;
+            break;
+            }
+        case KErrGeneral:
+            {
+            ret = ECCPErrorGeneral;
+            break;
+            }
+        case KErrNotSupported:
+            {
+            ret = ECCPErrorNotSupported;
+            break;
+            }
+        case KErrNoMemory:
+            {
+            ret = ECCPErrorNoMemory;
+            break;
+            }
+        case KErrInUse:
+            {
+            ret = ECCPErrorAlreadyInUse;
+            break;
+            }
+        case KErrNotReady:
+            {
+            ret = ECCPErrorNotReady;
+            break;
+            }
+        case KErrGsmNoService:
+            {
+            ret = ECCPErrorNoService;
+            break;
+            }
+        case KErrGsmOfflineOpNotAllowed:
+            {
+            ret = ECCPErrorNotAllowedInOfflineMode;
+            break;
+            }
+        case KErrDiagnosticInfoBarredWithCUG:
+            {
+            ret = ECCPErrorCUGOutgoingCallsBarred;
+            break;
+            }
+        case KErrDiagnosticInfoBarredNoCUG:
+            {
+            ret = ECCPErrorCUGNotSelected;
+            break;
+            }
+        case KErrDiagnosticInfoBarredUnknownCUG:
+            {
+            ret = ECCPErrorCUGIndexUnknown;
+            break;
+            }
+        case KErrDiagnosticInfoBarredIncompatibleCUG:
+            {
+            ret = ECCPErrorCUGIndexIncompatible;
+            break;
+            }
+        case KErrDiagnosticInfoBarredFailureCUG:
+            {
+            ret = ECCPErrorCUGCallsFailure;
+            break;
+            }
+        case KErrDiagnosticInfoBarredClirNotSubscribed:
+            {
+            ret = ECCPErrorCLIRNotSubscribed;
+            break;
+            }
+        case KErrDiagnosticInfoBarredCCBSPossible:
+            {
+            ret = ECCPErrorCCBSPossible;
+            break;
+            }            
+        case KErrDiagnosticInfoBarredCCBSNotPossible:
+            {
+            ret = ECCPErrorCCBSNotPossible;
+            break;
+            }            
+        case KErrGsmCCRequestedFacilityNotImplemented:
+            {
+            ret = ECCPErrorServiceSettingError;
+            break;
+            }
+        case KErrGsm0707SimNotInserted:
+        case KErrGsm0707SIMPuk1Required:
+        case KErrGsm0707SimPin1Required:
+        case KErrGsm0707SimPin2Required:
+        case KErrGsm0707SimFailure:
+        case KErrGsm0707PhoneToSimLockRequired:
+        case KErrGsm0707SimWrong:
+            {
+            ret = ECCPErrorAuthenticationFailed;
+            break;
+            }            
+        case KErrGsmInvalidFdn:
+            {
+            ret = ECCPErrorInvalidFDN;
+            break;
+            }
+        case KErrArgument:
+            {
+            ret = ECCPErrorInvalidPhoneNumber;
+            break;
+            }
+        case KErrGsmCCOperatorDeterminedBarring:
+            {
+            ret = ECCPErrorNumberBarred;
+            break;
+            }
+        case KErrGsmCCChannelUnacceptable:
+            {
+            ret = ECCPErrorUnacceptableChannel;
+            break;
+            }
+        case KErrGsmCCAccessInformationDiscarded:
+            {
+            ret = ECCPErrorAccessInformationDiscarded;
+            break;
+            }
+        case KErrGsmCCQualityOfServiceNotAvailable:
+            {
+            ret = ECCPErrorQualityOfServiceNotAvailable;
+            break;
+            }
+        case KErrAccessDenied:
+            {
+            ret = ECCPErrorAccessDenied;
+            break;
+            }
+        case KErrGsmCCNoRouteToDestination:
+            {
+            ret = ECCPErrorCCNoRouteToDestination;
+            break;
+            }
+        case KErrGsmCCDestinationOutOfOrder:
+            {
+            ret = ECCPErrorCCDestinationOutOfOrder;
+            break;
+            }
+        case KErrGsmCCResourceNotAvailable:
+            {
+            ret = ECCPErrorCCResourceNotAvailable;
+            break;
+            }
+        case KErrGsmCCIncompatibleMessageInCallState:
+            {
+            ret = ECCPErrorCCIncompatibleMessageInCallState;
+            break;
+            }
+        case KErrGsmCCNormalCallClearing:
+            {
+            ret = ECCPErrorCCNormalCallClearing;
+            break;
+            }
+        case KErrGsmCCUserNotResponding:
+            {
+            ret = ECCPErrorCCUserNotResponding;
+            break;
+            }
+        case KErrGsmCCUserAlertingNoAnswer:
+            {
+            ret = ECCPErrorCCUserAlertingNoAnswer;
+            break;
+            }
+        case KErrGsmCCCallRejected:
+            {
+            ret = ECCPErrorCCCallRejected;
+            break;
+            }
+        case KErrGsmCCPreemption:
+            {
+            ret = ECCPErrorCCPreemption;
+            break;
+            }
+        case KErrGsmCCFacilityRejected:
+            {
+            ret = ECCPErrorCCFacilityRejected;
+            break;
+            }
+        case KErrGsmCCResponseToStatusEnquiry:
+            {
+            ret = ECCPErrorCCResponseToStatusEnquiry;
+            break;
+            }
+        case KErrGsmCCInvalidMandatoryInformation:
+            {
+            ret = ECCPErrorCCInvalidMandatoryInformation;
+            break;
+            }
+        case KErrGsmCCNonExistentMessageType:
+            {
+            ret = ECCPErrorCCNonExistentMessageType;
+            break;
+            }
+        case KErrGsmCCIncompatibleMessageInProtocolState:
+            {
+            ret = ECCPErrorCCIncompatibleMessageInProtocolState;
+            break;
+            }
+        case KErrGsmCCNonExistentInformationElement:
+            {
+            ret = ECCPErrorCCNonExistentInformationElement;
+            break;
+            }
+        case KErrGsmCCRecoveryOnTimerExpiry:
+            {
+            ret = ECCPErrorCCRecoveryOnTimerExpiry;
+            break;
+            }
+        case KErrGsmCCNoChannelAvailable:
+            {
+            ret = ECCPErrorCCNoChannelAvailable;
+            break;
+            }
+        case KErrGsmCCIncomingCallsBarredInCug:
+            {
+            ret = ECCPErrorCCIncomingCallsBarredInCug;
+            break;
+            }
+        case KErrGsmCCBearerCapabilityNotAuthorised:
+            {
+            ret = ECCPErrorCCBearerCapabilityNotAuthorised;
+            break;
+            }
+        case KErrGsmCCBearerCapabilityNotCurrentlyAvailable:
+            {
+            ret = ECCPErrorCCBearerCapabilityNotCurrentlyAvailable;
+            break;
+            }
+        case KErrGsmCCServiceNotAvailable:
+            {
+            ret = ECCPErrorCCServiceNotAvailable;
+            break;
+            }
+        case KErrGsmCCBearerServiceNotImplemented:
+            {
+            ret = ECCPErrorCCBearerServiceNotImplemented;
+            break;
+            }
+        case KErrGsmCCOnlyRestrictedDigitalInformationBCAvailable:
+            {
+            ret = ECCPErrorCCOnlyRestrictedDigitalInformationBCAvailable;
+            break;
+            }
+        case KErrGsmCCServiceNotImplemented:
+            {
+            ret = ECCPErrorCCOnlyRestrictedDigitalInformationBCAvailable;
+            break;
+            }
+        case KErrGsmCCUnspecifiedInterworkingError:
+            {
+            ret = ECCPErrorCCUnspecifiedInterworkingError;
+            break;
+            }
+        case KErrGsmNoNumber:
+            {
+            ret = ECCPErrorInvalidPhoneNumberCancelRedial;
+            break;
+            }
+        case KErrNotFound:
+            {
+            ret = ECCPErrorNotFound;
+            break;
+            }
+        case KErrTimedOut:
+            {
+            ret = ECCPErrorTimedOut;
+            break;
+            }
+        case KErrGsmReleaseByUser:
+            {
+            ret = ECCPErrorReleaseByUserForCancelRedial;
+            break;
+            }
+        case KErrSatControl:
+            {
+            ret = ECCPErrorSatControl;
+            break;
+            }
+        default:
+            {
+            // Use the predefined.
+            break;
+            }
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the active request.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallRequester::TRequestType CSPEtelCallRequester::Request()
+    {
+    if ( IsActive() )
+        {
+        return iRequestType;
+        }
+    
+    return ERequestTypeNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// Canceling emergency or normal call dial request.
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelCallRequester::DialCancel() 
+    {
+    TInt ret = KErrNotReady;
+    if ( iRequestType == ERequestTypeDialEmergency 
+          || ( iRequestType == ERequestTypeDial ) )
+        {
+        ret = CancelRequest( iRequestType );
+        }
+    else
+        {
+        CSPLOGSTRING2(CSPINT, 
+          "CSPEtelCallRequester::DialCancel invalid irequest for dialcancel %d",
+          iRequestType);
+        }
+    
+    return ret;
+    }
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelcallstatusmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSPEtelCallStatusMonitor which
+*                monitors call status changes from ETel and notifies observer
+*                according to call status change.
+*
+*/
+
+
+#include <mccpcallobserver.h>
+
+#include "cspetelcallstatusmonitor.h"
+#include "mcspcallobserver.h"
+#include "csplogger.h"
+
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallEventMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallStatusMonitor* CSPEtelCallStatusMonitor::NewL( MCSPCallObserver& aObserver,
+                                                        RMobileCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallEventMonitor::NewL()" );
+    CSPEtelCallStatusMonitor* self = new ( ELeave ) CSPEtelCallStatusMonitor( 
+                                        aObserver, aCall );
+    return self;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallStatusMonitor::~CSPEtelCallStatusMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallStatusMonitor::~CSPEtelCallStatusMonitor()" );
+    Cancel();
+       
+    if ( iDestrPtr )
+        {
+        *iDestrPtr = ETrue;
+        iDestrPtr = NULL;
+        }
+        
+    }
+
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallStatusMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelCallStatusMonitor::StartMonitoring()" );
+    if ( !IsActive() && iCall.SubSessionHandle() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CSP: CSPEtelCallStatusMonitor::StartMonitoring: Request \
+                    RMobilePhone::NotifyMobileCallStatusChange" );
+        iCall.NotifyMobileCallStatusChange( iStatus, iCallStatus );
+        CSPLOGSTRING( CSPREQOUT, "CSPEtelCallStatusMonitor:: Notify OK" );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelCallStatusMonitor::StartMonitoring: Already active" );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// ---------------------------------------------------------------------------
+//    
+RMobileCall::TMobileCallStatus CSPEtelCallStatusMonitor::State()
+    {
+    return iCallStatus;
+    }
+    
+// ---------------------------------------------------------------------------
+// From CActive
+// Handles call status notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallStatusMonitor::RunL()
+    {
+    CSPLOGSTRING( CSPINT, "CSPEtelCallStatusMonitor::RunL")   
+    
+    // Survive from monitor destruction during observing sequence
+    TBool destroyed = EFalse;
+    iDestrPtr = &destroyed;
+     
+    if ( iStatus == KErrNone )
+        {
+        iObserver.NotifyCallStateChangedETel( iCallStatus );
+        }
+    
+    if ( !destroyed )
+        {        
+        // In case instance has not been deleted, pointer must be cleared.
+        iDestrPtr = NULL;
+        if ( iStatus == KErrNone )
+            {
+            StartMonitoring();
+            }
+        }
+    else
+        {
+        // already destroyed, do not touch members.
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallStatusMonitor::DoCancel()
+    {
+    CSPLOGSTRING( CSPINT, "CSPEtelCallStatusMonitor::DoCancel" );
+    iCall.CancelAsyncRequest( EMobileCallNotifyMobileCallStatusChange );
+    }
+
+
+
+    
+// ---------------------------------------------------------------------------
+// Constructs the monitor..
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallStatusMonitor::CSPEtelCallStatusMonitor( MCSPCallObserver& aObserver,
+                                                    RMobileCall& aCall ) : 
+                                   CActive( EPriorityStandard ),
+                                   iObserver( aObserver ),
+                                   iCall ( aCall )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallStatusMonitor::CSPEtelCallStatusMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+    
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelcallwaitingrequester.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class CSPEtelCallWaitingRequester
+*
+*/
+
+
+
+#include "cspetelcallwaitingrequester.h"
+
+#include <mmretrieve.h>
+#include <etelmm.h>
+
+#include "csplogger.h"
+#include "cspconsts.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructs the requester via two phased constructing.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallWaitingRequester* CSPEtelCallWaitingRequester::NewL(
+            RMobilePhone& aPhone ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallWaitingRequester::NewL()" );
+    CSPEtelCallWaitingRequester* self = 
+        new ( ELeave ) CSPEtelCallWaitingRequester( aPhone );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );    
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallWaitingRequester::~CSPEtelCallWaitingRequester( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallWaitingRequester::~CSPEtelCallWaitingRequester()" );
+    Cancel();
+    delete iList;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallWaitingRequester::GetCallWaitingL
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallWaitingRequester::GetCallWaitingL( const CCCECallParameters& 
+                                                      aParams,
+                                                   TBool& aCallWaitingStatus )
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelCallWaitingRequester::GetCallWaitingL()" );
+    
+    if ( iMode == ECwRequesterInactive )
+        {
+        iMode = ECwRequesterGetStarted;
+        iList->Start( iStatus );
+        SetActive();
+        iWait.Start();
+        
+        if ( iStatus == -5252 )
+            {
+            aCallWaitingStatus = ETrue; 
+            }
+        else
+            {
+            // Get the list of call waiting entries
+            CMobilePhoneCWList* cwList = iList->RetrieveListL();
+            CleanupStack::PushL(cwList);
+            
+            TInt count = cwList->Enumerate();
+            RMobilePhone::TMobilePhoneCWInfoEntryV1 cwInfo;        
+            
+            aCallWaitingStatus = EFalse; // Default false
+            CSPLOGSTRING(CSPINT, "CSPEtelCallWaitingRequester::GetCallWaitingL() iterate" );
+            for( TInt i=0; i < count ; i++ )
+               {
+               cwInfo = cwList->GetEntryL( i );
+     
+                if ( cwInfo.iStatus == RMobilePhone::ECallWaitingStatusActive )
+                    {
+                    if ( cwInfo.iServiceGroup == RMobilePhone::EAuxVoiceService )
+                        {
+                        iAuxLineCwStatus = ETrue;
+                        }
+                    else
+                        {
+                        iPrimaryLineCwStatus = ETrue;
+                        }
+                    }
+               }       
+            
+            GetCallWaitingStatusByLineType( aParams, aCallWaitingStatus );
+            
+            CSPLOGSTRING2(CSPINT, 
+                "CSPEtelCallWaitingRequester::GetCallWaitingL() res:%d", 
+                        aCallWaitingStatus );
+            CleanupStack::PopAndDestroy( cwList );
+            
+            // Initial value has been read from network, 
+            // now we must keep the setting value up to date.
+            StartMonitoring();
+            }           
+        }
+
+    else if ( iMode == ECwRequesterMonitoring )
+        {
+        CSPLOGSTRING(CSPINT, "CSPEtelCallWaitingRequester::GetCallWaitingL() use cached value" );
+        GetCallWaitingStatusByLineType( aParams, aCallWaitingStatus );
+        }       
+    else if ( iMode == ECwRequesterGetStarted )
+        {
+        CSPLOGSTRING(CSPINT, "CSPEtelCallWaitingRequester::GetCallWaitingL() KErrInUse" );
+        User::Leave( KErrInUse );
+        }       
+    }
+    
+// ---------------------------------------------------------------------------
+// From CActive
+// CSPEtelCallWaitingRequester::RunL
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallWaitingRequester::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, "CSPEtelCallWaitingRequester::RunL: status: %d", 
+                              iStatus.Int() );
+    if ( iWait.IsStarted() )
+        {
+        iWait.AsyncStop();
+        }
+    else if ( KErrNone == iStatus.Int() )
+        {
+        RMobilePhone::TMobilePhoneCWInfoEntryV1 cwInfo = iDesCwStatus();
+        switch (cwInfo.iStatus)
+            {
+            case RMobilePhone::ECallWaitingStatusActive:
+                if ( cwInfo.iServiceGroup == RMobilePhone::EAuxVoiceService )
+                    {
+                    iAuxLineCwStatus = ETrue;
+                    }
+                else
+                    {
+                    iPrimaryLineCwStatus = ETrue;
+                    }
+                break;
+            case RMobilePhone::ECallWaitingStatusNotActive:
+                if ( cwInfo.iServiceGroup == RMobilePhone::EAuxVoiceService )
+                    {
+                    iAuxLineCwStatus = EFalse;
+                    }
+                else
+                    {
+                    iPrimaryLineCwStatus = EFalse;
+                    }   
+                break;
+            default:
+                break;
+            }            
+        
+        CSPLOGSTRING3(CSPINT, 
+                        "CSPEtelCallWaitingRequester::RunL: service:%d new cw status:%d", 
+                        cwInfo.iServiceGroup, cwInfo.iStatus );
+        
+        StartMonitoring();
+        }
+    else
+        {
+        iMode = ECwRequesterInactive;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CSPEtelCallWaitingRequester::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallWaitingRequester::DoCancel()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallWaitingRequester::DoCancel()" );
+    if ( iMode == ECwRequesterGetStarted )
+        {
+        iList->Cancel();
+        iMode = ECwRequesterInactive;
+        }
+    else if ( iMode == ECwRequesterMonitoring )
+        {
+        iPhone.CancelAsyncRequest( EMobilePhoneNotifyCallWaitingStatusChange );
+        iMode = ECwRequesterInactive;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the requester.
+// ---------------------------------------------------------------------------
+//
+CSPEtelCallWaitingRequester::CSPEtelCallWaitingRequester(RMobilePhone& aPhone): 
+    CActive( EPriorityStandard ),
+    iPhone( aPhone )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallWaitingRequester::CSPEtelCallWaitingRequester()" );
+    CActiveScheduler::Add( this );
+    iPrimaryLineCwStatus = EFalse;
+    iAuxLineCwStatus = EFalse;
+    iMode = ECwRequesterInactive;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallWaitingRequester::ConstructL
+// ---------------------------------------------------------------------------
+//    
+void CSPEtelCallWaitingRequester::ConstructL()
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelCallWaitingRequester::ConstructL()" );
+    iList = CRetrieveMobilePhoneCWList::NewL(iPhone);
+    }
+
+// ---------------------------------------------------------------------------
+// Start listening call waiting status change notifications. 
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallWaitingRequester::StartMonitoring()
+    {
+    iPhone.NotifyCallWaitingStatusChange( iStatus, iDesCwStatus );
+    SetActive();
+    iMode = ECwRequesterMonitoring;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the call waiting status from call waiting status list by linetype.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelCallWaitingRequester::GetCallWaitingStatusByLineType( const CCCECallParameters& 
+                                                                    aParams,
+                                                                  TBool& aCallWaitingStatus )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelCallWaitingRequester:GetCallWaitingStatusByLineType" );
+    
+    if ( aParams.LineType() == CCCECallParameters::ECCELineTypePrimary )
+        {
+        aCallWaitingStatus = iPrimaryLineCwStatus;
+        }
+    else
+        {
+        aCallWaitingStatus = iAuxLineCwStatus;
+        }
+    CSPLOGSTRING3(CSPINT, 
+                "CSPEtelCallWaitingRequester::GetCallWaitingStatusByLineType: line:%d res:%d", 
+                        aParams.LineType(), aCallWaitingStatus );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelconferencecallrequester.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,375 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class 
+*                CSPEtelConferenceCallRequester.
+*
+*/
+
+
+#include <etelmm.h>
+#include <mccpconferencecallobserver.h>
+
+#include "cspetelconferencecallrequester.h"
+#include "csplogger.h"
+#include "cspconferencecall.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructs the requester via two phased constructing.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceCallRequester* CSPEtelConferenceCallRequester::NewL(
+            CSPConferenceCall& aOwner,
+            RMobileConferenceCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelConferenceCallRequester::NewL()" );
+    CSPEtelConferenceCallRequester* self = new ( ELeave ) CSPEtelConferenceCallRequester( 
+                                        aOwner, aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceCallRequester::~CSPEtelConferenceCallRequester( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelConferenceCallRequester::~CSPEtelConferenceCallRequester()" );
+    CSPLOGSTRING2(CSPINT, "CSPEtelConferenceCallRequester:: type: %d", iRequestType );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelConferenceCallRequester::MakeAddCallRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelConferenceCallRequester::MakeAddCallRequest( const TName& aCallName )
+    {
+    if ( !IsActive() )
+        {
+        iRequestType = EConferenceRequestTypeAddCall;
+        iCall.AddCall( iStatus, aCallName );
+        SetActive();
+        }
+    else
+        {
+        return KErrInUse;
+        }
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelConferenceCallRequester::MakeRequest
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelConferenceCallRequester::MakeRequest( 
+                                        TConferenceRequestType aRequest )
+    {
+    TInt result = KErrUnknown;
+
+    if ( !IsActive() )
+        {
+        if ( aRequest != EConferenceRequestTypeAddCall )
+            {
+            iRequestType = aRequest;
+            }
+            
+        CSPLOGSTRING2( CSPREQOUT, 
+            "CSP: CSPEtelConferenceCallRequester::MakeRequest %d", iRequestType );
+        switch ( aRequest )
+            {
+            case EConferenceRequestTypeAddCall:
+                {
+                // Requested through EConferenceRequestTypeAddCall as a special case because
+                // of the parameters.
+                result = KErrNotSupported;
+                break;
+                }
+            case EConferenceRequestTypeHangup:
+                {
+                iCall.HangUp( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case EConferenceRequestTypeHold:
+                {
+                iCall.Swap( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case EConferenceRequestTypeResume:
+                {
+                iCall.Swap( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case EConferenceRequestTypeCreateConference:
+                {
+                iCall.CreateConference( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            case EConferenceRequestTypeSwap:
+                {
+                iCall.Swap( iStatus );
+                SetActive();
+                result = KErrNone;
+                break;
+                }
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                    "CSP: CSPEtelConferenceCallRequester::MakeRequest: Unspecified \
+                                        request type: %d", iRequestType );
+                result = KErrArgument;
+                }
+            }
+        
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelConferenceCallRequester::MakeRequest: Already active" );
+        
+        if ( aRequest == EConferenceRequestTypeHangup )
+            {
+            // First cancel ongoing request.
+            Cancel();
+
+            iCall.HangUp( iStatus );
+            SetActive();
+            result = KErrNone;            
+            }
+        else
+            {
+            result = KErrInUse;
+            }
+        }
+        
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelConferenceCallRequester::RunL
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceCallRequester::RunL()
+    {
+    // from CActive
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSP: CSPEtelConferenceCallRequester::RunL: status: %d", iStatus.Int() );
+    
+    if ( iStatus == KErrNone )
+        {
+        switch ( iRequestType )
+            {
+            case EConferenceRequestTypeAddCall:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Add call request OK" );
+                break;
+                }
+            case EConferenceRequestTypeHangup:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Hangup request OK" );
+                break;
+                }
+            case EConferenceRequestTypeHold:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Hold request OK" );
+                break;
+                }
+            case EConferenceRequestTypeResume:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Resume request OK" );
+                break;
+                }
+            case EConferenceRequestTypeCreateConference:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Conference create request OK" );
+                break;
+                }
+            case EConferenceRequestTypeSwap:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Conference swap request OK" );
+                break;
+                }
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Unspecified request \
+                                                type: %d", iRequestType );
+                break;
+                }
+            }
+        }
+    else
+        {
+        // Error situations 
+        
+        CSPLOGSTRING2( CSPERROR, "CSP CSPEtelConferenceCallRequester::RunL: request \
+                                completed with error: %d", iStatus.Int() );
+        switch ( iRequestType )
+            {
+            case EConferenceRequestTypeAddCall:
+                {
+                CSPLOGSTRING( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Add call request" );
+                iOwner.NotifyConferenceError( 
+                           ECCPConferenceErrorAddCall );
+                break;
+                }
+            case EConferenceRequestTypeHangup:
+                {
+                CSPLOGSTRING( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Hangup request" );
+                iOwner.NotifyConferenceError( 
+                           ECCPConferenceErrorHangUp );
+                break;
+                }
+            case EConferenceRequestTypeHold:
+                {
+                CSPLOGSTRING( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Hold request" );
+                iOwner.NotifyConferenceError( 
+                           ECCPConferenceErrorHold );
+                break;
+                }
+            case EConferenceRequestTypeResume:
+                {
+                CSPLOGSTRING( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Resume request err" );
+                iOwner.NotifyConferenceError( 
+                           ECCPConferenceErrorResume );
+                break;
+                }
+            case EConferenceRequestTypeCreateConference:
+                {
+                CSPLOGSTRING( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Conference create request" );
+                iOwner.NotifyConferenceError( 
+                           ECCPConferenceErrorAddCall );
+                break;
+                }
+            case EConferenceRequestTypeSwap:
+                {
+                CSPLOGSTRING( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Conference swap request" );
+                iOwner.NotifyConferenceError( 
+                           ECCPConferenceErrorSwap );
+
+                break;
+                }
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                    "CSP CSPEtelConferenceCallRequester::RunL: Unspecified request \
+                                                type: %d", iRequestType );
+                break;
+                }
+            }
+        
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelConferenceCallRequester::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceCallRequester::DoCancel()
+    {
+    if ( IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, "CSP: CSPEtelConferenceCallRequester::DoCancel" );
+        switch ( iRequestType )
+            {
+            case EConferenceRequestTypeAddCall:
+                {
+                iCall.CancelAsyncRequest( EMobileConferenceCallAddCall );
+                break;
+                }
+            case EConferenceRequestTypeHangup:
+                {
+                iCall.CancelAsyncRequest( EMobileConferenceCallHangUp );
+                break;
+                }
+            case EConferenceRequestTypeHold:
+            case EConferenceRequestTypeResume:
+                {
+                iCall.CancelAsyncRequest( EMobileConferenceCallSwap );
+                break;
+                }
+            case EConferenceRequestTypeCreateConference:
+                {
+                iCall.CancelAsyncRequest( EMobileConferenceCallCreateConference );
+                break;
+                }
+            case EConferenceRequestTypeSwap:
+                {
+                iCall.CancelAsyncRequest( EMobileConferenceCallSwap );
+                break;
+                }
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, "CSP CSPEtelConferenceCallRequester::DoCancel: \
+                                Unspecified request type: %d", iRequestType );
+                }
+            }
+        
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelConferenceCallRequester::DoCancel: Already active" );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the requester.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceCallRequester::CSPEtelConferenceCallRequester(
+            CSPConferenceCall& aOwner,
+            RMobileConferenceCall& aCall ) : 
+                CActive( EPriorityStandard ), 
+                iOwner( aOwner ), 
+                iCall ( aCall )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelConferenceCallRequester::CSPEtelConferenceCallRequester()" );
+    CActiveScheduler::Add( this );
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructing in the second phase.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceCallRequester::ConstructL()
+    {
+    }
+    
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelconferencecapsmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSPEtelConferenceCapsMonitor which
+*                monitors call status changes from ETel and notifies observer
+*                according to call status change.
+*
+*/
+
+
+#include "cspetelconferencecapsmonitor.h"
+
+#include "cspconferencecall.h"
+#include "csplogger.h"
+
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelConferenceCapsMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceCapsMonitor* CSPEtelConferenceCapsMonitor::NewL( 
+                                                    CSPConferenceCall& aOwner,
+                                                    RMobileConferenceCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceCapsMonitor::NewL()" );
+    CSPEtelConferenceCapsMonitor* self = 
+                        new ( ELeave ) CSPEtelConferenceCapsMonitor( 
+                                                            aOwner, aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceCapsMonitor::~CSPEtelConferenceCapsMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceCapsMonitor::~CSPEtelConferenceCapsMonitor()" );
+        
+    if ( iDestrPtr )
+        {
+        *iDestrPtr = ETrue;
+        iDestrPtr = NULL;
+        }
+        
+    Cancel();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceCapsMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+          "CSPEtelConferenceCapsMonitor::StartMonitoring()" );
+
+    
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CSP: CSPEtelConferenceCapsMonitor::StartMonitoring: Request \
+                    RMobilePhone::NotifyCapsChange" );
+        iCall.NotifyCapsChange( iStatus, iCaps );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelConferenceCapsMonitor::StartMonitoring: Already active" );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// From CActive
+// Handles call status notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceCapsMonitor::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPEtelConferenceCapsMonitor::RunL: status: %d", iStatus.Int() );
+    
+    // Survive from monitor destruction during observing sequence
+    TBool destroyed = EFalse;
+    iDestrPtr = &destroyed;
+
+    
+    if ( iStatus == KErrNone )
+        {
+        // Test caps and notify about the iOwner 
+        iOwner.ConferenceCapsChanged( iCaps );
+
+        }
+    
+    if ( !destroyed )
+        {
+        // In case instance has not been deleted, it is important to clear
+        // iPtr pointer.
+        iDestrPtr = NULL;
+        
+        // ok to modify member variables.
+        if ( iStatus == KErrNone )
+            {
+            StartMonitoring();
+            }
+        }
+    else
+        {
+        // already destroyed, do not touch members.
+        }
+
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceCapsMonitor::DoCancel()
+    {
+    iCall.CancelAsyncRequest( EMobileConferenceCallNotifyCapsChange );
+    }
+
+
+
+    
+// ---------------------------------------------------------------------------
+// Constructs the monitor..
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceCapsMonitor::CSPEtelConferenceCapsMonitor( CSPConferenceCall& aOwner,
+                                                    RMobileConferenceCall& aCall ) : 
+                                   CActive( EPriorityStandard ),
+                                   iOwner( aOwner ),
+                                   iCall ( aCall )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceCapsMonitor::CSPEtelConferenceCapsMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+    
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceCapsMonitor::ConstructL()
+    {
+    // Implementation not required.
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelconferenceeventmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSPEtelConferenceEventMonitor which
+*                monitors call events from ETel and notifies observer
+*                accordingly.
+*
+*/
+
+
+#include "cspetelconferenceeventmonitor.h"
+
+#include <mccpconferencecallobserver.h>
+
+#include "csplogger.h"
+#include "cspconferencecall.h"
+
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelConferenceEventMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceEventMonitor* CSPEtelConferenceEventMonitor::NewL( 
+                                                    CSPConferenceCall& aOwner,
+                                                    RMobileConferenceCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceEventMonitor::NewL()" );
+    CSPEtelConferenceEventMonitor* self = 
+                    new ( ELeave ) CSPEtelConferenceEventMonitor( 
+                                        aOwner, aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceEventMonitor::~CSPEtelConferenceEventMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceEventMonitor::~CSPEtelConferenceEventMonitor()" );
+    Cancel();
+    
+    if ( iDestrPtr )
+        {
+        *iDestrPtr = ETrue;
+        iDestrPtr = NULL;
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceEventMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+          "CSPEtelConferenceEventMonitor::StartMonitoring()" );
+
+    
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CSP: CSPEtelConferenceEventMonitor::StartMonitoring: \
+                    Request RMobilePhone::NotifyEvent" );
+        
+        iCall.NotifyConferenceEvent( iStatus, iEvent, iCallName );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelConferenceEventMonitor::StartMonitoring: Already active" );
+        }
+    }
+    
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Handles event notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceEventMonitor::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPEtelConferenceEventMonitor::RunL: status: %d", iStatus.Int() );
+    
+    // Survive from monitor destruction during observing sequence
+    TBool destroyed = EFalse;
+    iDestrPtr = &destroyed;
+
+    
+    if ( iStatus == KErrNone )
+        {
+        CSPLOGSTRING2( CSPINT, 
+           "CSP CSPEtelConferenceEventMonitor::RunL  Event related callname = %S", 
+            &iCallName );
+
+        switch ( iEvent )
+            {
+            case RMobileConferenceCall::EConferenceCallAdded:
+                {
+                CSPLOGSTRING( CSPINT, 
+                   "CSP CSPEtelConferenceEventMonitor::RunL: ECCPConferenceCallAdded" );
+                iOwner.NotifyEvent( 
+                    MCCPConferenceCallObserver::ECCPConferenceCallAdded, 
+                    iCallName );
+                    
+                break;
+                }
+             // The call has been placed on hold as a result of a local action
+            case RMobileConferenceCall::EConferenceCallRemoved:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceEventMonitor::RunL: ECCPConferenceCallRemoved" );
+                iOwner.NotifyEvent( 
+                    MCCPConferenceCallObserver::ECCPConferenceCallRemoved,
+                    iCallName );
+                break;
+                }
+                
+            // The call has been resumed as a result of a local action. 
+            case RMobileConferenceCall::EConferenceBuilt:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceEventMonitor::RunL: ECCPConferenceBuilt" );
+                iOwner.NotifyEvent( 
+                        MCCPConferenceCallObserver::ECCPConferenceBuilt );
+                break;
+                }
+            
+            case RMobileConferenceCall::EConferenceTerminated:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceEventMonitor::RunL: ECCPConferenceTerminated" );
+                iOwner.NotifyEvent( 
+                        MCCPConferenceCallObserver::ECCPConferenceTerminated );
+                break;
+                }
+            
+            case RMobileConferenceCall::EConferenceSwapped:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceEventMonitor::RunL: ECCPConferenceSwapped" );
+                iOwner.NotifyEvent( 
+                        MCCPConferenceCallObserver::ECCPConferenceSwapped );
+                break;
+                }
+            
+            case RMobileConferenceCall::EConferenceSplit:
+                {
+                CSPLOGSTRING( CSPINT, 
+                    "CSP CSPEtelConferenceEventMonitor::RunL: ECCPConferenceSplit" );
+                iOwner.NotifyEvent( 
+                        MCCPConferenceCallObserver::ECCPConferenceSplit,
+                        iCallName );
+                break;
+                }
+
+            default:
+                {
+                CSPLOGSTRING2( CSPERROR, 
+                    "CSP CSPEtelConferenceEventMonitor::RunL: ERROR Unspecified \
+                     call event: %d", iEvent );
+                break;
+                }
+                
+            }
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, 
+            "CSP CSPEtelConferenceEventMonitor::RunL err %d", iStatus.Int() );
+        }
+        
+    if ( !destroyed )
+        {
+        // In case instance has not been deleted, it is important to clear
+        // iPtr pointer.
+        iDestrPtr = NULL;
+        
+        // ok to modify member variables.
+        if ( iStatus == KErrNone )
+            {
+            StartMonitoring();
+            }
+        }
+    else
+        {
+        // already destroyed, do not touch members.
+        }
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Request canceling.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceEventMonitor::DoCancel()
+    {
+    iCall.CancelAsyncRequest( EMobileConferenceCallNotifyConferenceEvent );
+    }
+
+    
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceEventMonitor::CSPEtelConferenceEventMonitor( CSPConferenceCall& aOwner,
+                                                  RMobileConferenceCall& aCall ) : 
+                                   CActive( EPriorityStandard ), 
+                                   iOwner( aOwner ),
+                                   iCall ( aCall )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceEventMonitor::CSPEtelConferenceEventMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceEventMonitor::ConstructL()
+    {
+    // Implementation not required.
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelconferencestatusmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSPEtelConferenceStatusMonitor which
+*                monitors call status changes from ETel and notifies observer
+*                according to call status change.
+*
+*/
+
+
+#include "cspetelconferencestatusmonitor.h"
+
+#include <mccpconferencecallobserver.h>
+
+#include "csplogger.h"
+#include "cspconferencecall.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelConferenceStatusMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceStatusMonitor* CSPEtelConferenceStatusMonitor::NewL( 
+                                                    MCSPConferenceStatusObserver& aOwner,
+                                                    RMobileConferenceCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelConferenceStatusMonitor::NewL()" );
+    CSPEtelConferenceStatusMonitor* self = 
+                        new ( ELeave ) CSPEtelConferenceStatusMonitor( 
+                                                            aOwner, aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceStatusMonitor::~CSPEtelConferenceStatusMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceStatusMonitor::~CSPEtelConferenceStatusMonitor()" );
+    Cancel();
+        
+    if ( iDestrPtr )
+        {
+        *iDestrPtr = ETrue;
+        iDestrPtr = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceStatusMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+          "CSPEtelConferenceStatusMonitor::StartMonitoring()" );
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CSP: CSPEtelConferenceStatusMonitor::StartMonitoring: Request \
+                    RMobilePhone::NotifyMobileStatusChange" );
+        iCall.NotifyConferenceStatusChange( iStatus, iConferenceStatus );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelConferenceStatusMonitor::StartMonitoring: Already active" );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// From CActive
+// Handles call status notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceStatusMonitor::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPEtelConferenceStatusMonitor::RunL: status: %d", iStatus.Int() );
+    
+    // Survive from monitor destruction during observing sequence
+    TBool destroyed = EFalse;
+    iDestrPtr = &destroyed;
+    
+    if ( iStatus == KErrNone )
+        {
+        switch ( iConferenceStatus )
+            {
+
+            case RMobileConferenceCall::EConferenceIdle:
+                {
+                CSPLOGSTRING( CSPINT, "CSPETelConferenceStatusMonitor IDLE");
+                iOwner.NotifyStateChange( 
+                    MCSPConferenceStatusObserver::ECSPConferenceIdle );
+                break;
+                }
+
+            case RMobileConferenceCall::EConferenceActive:
+                {
+                CSPLOGSTRING( CSPINT, "CSPETelConferenceStatusMonitor ACTIVE");
+                iOwner.NotifyStateChange( 
+                    MCSPConferenceStatusObserver::ECSPConferenceActive );
+                break;
+                }
+            case RMobileConferenceCall::EConferenceHold:
+                {
+                CSPLOGSTRING( CSPINT, "CSPETelConferenceStatusMonitor HOLD");
+
+                iOwner.NotifyStateChange( 
+                    MCSPConferenceStatusObserver::ECSPConferenceHold );
+
+                break;
+                }
+
+            default:
+                {
+                CSPLOGSTRING2( CSPINT, 
+                   "CSP CSPEtelConferenceStatusMonitor::RunL: Unspecified/protocol \
+                             specific call status: %d", iConferenceStatus );
+                break;
+                }
+            }
+            
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, 
+            "CSP CSPEtelConferenceStatusMonitor::RunL err %d", iStatus.Int() );
+        }
+        
+    if ( !destroyed )
+        {
+        // In case instance has not been deleted, it is important to clear
+        // iPtr pointer.
+        iDestrPtr = NULL;
+        
+        // ok to modify member variables.
+        if ( iStatus == KErrNone )
+            {
+            StartMonitoring();
+            }
+        }
+    else
+        {
+        // Already destroyed, do not touch members.
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceStatusMonitor::DoCancel()
+    {
+    iCall.CancelAsyncRequest( 
+                          EMobileConferenceCallNotifyConferenceStatusChange );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor..
+// ---------------------------------------------------------------------------
+//
+CSPEtelConferenceStatusMonitor::CSPEtelConferenceStatusMonitor( 
+                                   MCSPConferenceStatusObserver& aOwner,
+                                   RMobileConferenceCall& aCall ) : 
+                                   CActive( EPriorityStandard ),
+                                   iOwner( aOwner ),
+                                   iCall ( aCall )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelConferenceStatusMonitor::CSPEtelConferenceStatusMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+    
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelConferenceStatusMonitor::ConstructL()
+    {
+    // Implementation not required.
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspeteldtmfmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPEtelDtmfMonitor
+*
+*/
+
+
+
+#include <mccpdtmfobserver.h>
+#include <rmmcustomapi.h>
+#include <gsmerror.h>
+
+#include "cspeteldtmfmonitor.h"
+#include "csplogger.h"
+#include "cspdtmfprovider.h"
+#include "cspconsts.h"
+#include "cspdtmfprovider.h"
+
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelDtmfMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelDtmfMonitor* CSPEtelDtmfMonitor::NewL( 
+                                        CSPDTMFProvider& aObserver, 
+                                        RMmCustomAPI& aMmCustom ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelDtmfMonitor::NewL()" );
+    CSPEtelDtmfMonitor* self = new ( ELeave ) CSPEtelDtmfMonitor( 
+                                        aObserver, aMmCustom );
+    return self;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelDtmfMonitor::~CSPEtelDtmfMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelDtmfMonitor::~CSPEtelDtmfMonitor()" );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitor.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelDtmfMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPINT, 
+        "CSPEtelDtmfMonitor::StartMonitoring()" );
+
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSP: CSPEtelDtmfMonitor::StartMonitoring: Request \
+                    iMmCustom.NotifyDTMFEvent( iStatus, iEventData )" );
+        iMmCustom.NotifyDtmfEvent( iStatus, iEventData );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelDtmfMonitor::StartMonitoring: Already active" );
+        }
+    }
+// ---------------------------------------------------------------------------
+// From CActive.
+// Handles line status change notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelDtmfMonitor::RunL()
+    {
+    TInt err = iStatus.Int();
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPEtelDtmfMonitor::RunL: status: %d", err );
+    
+    if ( err == KErrNone )
+        {
+        MCCPDTMFObserver::TCCPDtmfEvent event;
+        if ( iEventData.iEvent == RMmCustomAPI::EDtmfStart 
+             && iEventData.iType == RMmCustomAPI::EDtmfManual )
+            {
+            event = MCCPDTMFObserver::ECCPDtmfManualStart;
+            }
+        else if ( iEventData.iEvent == RMmCustomAPI::EDtmfStart 
+             && iEventData.iType == RMmCustomAPI::EDtmfSequence )
+            {
+            event = MCCPDTMFObserver::ECCPDtmfSequenceStart;
+            }
+        else if ( iEventData.iEvent == RMmCustomAPI::EDtmfStop 
+             && iEventData.iType == RMmCustomAPI::EDtmfManual )
+            {
+            event = MCCPDTMFObserver::ECCPDtmfManualStop;
+            }
+        else if ( iEventData.iEvent == RMmCustomAPI::EDtmfStop 
+             && iEventData.iType == RMmCustomAPI::EDtmfSequence )
+            {
+            event = MCCPDTMFObserver::ECCPDtmfSequenceStop;
+            }
+        else if ( iEventData.iEvent == RMmCustomAPI::EDtmfAbort 
+             && iEventData.iType == RMmCustomAPI::EDtmfManual )
+            {
+            event = MCCPDTMFObserver::ECCPDtmfManualAbort;
+            }
+        else if ( iEventData.iEvent == RMmCustomAPI::EDtmfAbort 
+             && iEventData.iType == RMmCustomAPI::EDtmfSequence )
+            {
+            event = MCCPDTMFObserver::ECCPDtmfSequenceAbort;
+            }
+        else
+            {
+            // Unknown event
+            CSPLOGSTRING3( CSPERROR, 
+                "CSPEtelDtmfMonitor::RunL: Unknown event = %¨d, type = %d", 
+                    iEventData.iEvent, iEventData.iType );
+            
+            // Refresh and return (no observer notfiying).
+            StartMonitoring();
+            return;
+            }
+        
+        iObserver.NotifyDTMFEvent( event, err, iEventData.iTone );
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, "CSPEtelDtmfMonitor::RunL: Error \
+                    from DTMF: %d", err );
+        }
+    
+    // Continue if not in offline mode
+    if ( err != KErrGsmOfflineOpNotAllowed && err != KErrCancel 
+         && err != KErrNotSupported )
+        {
+        StartMonitoring();
+        }
+    CSPLOGSTRING( CSPREQEND, "CSPEtelDtmfMonitor::RunL End of RunL." );
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelDtmfMonitor::DoCancel()
+    {
+    if ( iStatus == KRequestPending )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPEtelDtmfMonitor::DoCancel Canceling pending request.." );
+        iMmCustom.CancelAsyncRequest( ECustomNotifyDtmfEventIPC ); 
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPEtelDtmfMonitor::CSPEtelDtmfMonitor(
+            CSPDTMFProvider& aObserver, 
+            RMmCustomAPI& aMmCustom ) : 
+                CActive( EPriorityStandard ),             
+                iObserver( aObserver ),
+                iMmCustom( aMmCustom )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelDtmfMonitor::CSPEtelDtmfMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+    
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspeteldtmfstopmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPEtelDtmfStopMonitor
+*
+*/
+
+
+
+#include <mccpdtmfobserver.h>
+#include <gsmerror.h>
+
+#include "cspeteldtmfstopmonitor.h"
+#include "csplogger.h"
+#include "cspdtmfprovider.h"
+#include "cspconsts.h"
+#include "cspdtmfprovider.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelDtmfStopMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelDtmfStopMonitor* CSPEtelDtmfStopMonitor::NewL( 
+                                        CSPDTMFProvider& aObserver, 
+                                        RMobilePhone& aPhone ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelDtmfStopMonitor::NewL()" );
+    CSPEtelDtmfStopMonitor* self = new ( ELeave ) CSPEtelDtmfStopMonitor( 
+                                        aObserver, aPhone );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelDtmfStopMonitor::~CSPEtelDtmfStopMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelDtmfStopMonitor::~CSPEtelDtmfStopMonitor()" );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitor.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelDtmfStopMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelDtmfStopMonitor::StartMonitoring()" );
+
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSP: CSPEtelDtmfStopMonitor::StartMonitoring: Request \
+                    iPhone.NotifyStopInDTMFString( iStatus, iEventData )" );
+        iPhone.NotifyStopInDTMFString( iStatus );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelDtmfStopMonitor::StartMonitoring: Already active" );
+        }
+    }
+// ---------------------------------------------------------------------------
+// From CActive.
+// Handles line status change notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelDtmfStopMonitor::RunL()
+    {
+    TInt err = iStatus.Int();
+    CSPLOGSTRING2( CSPINT, 
+        "CSPEtelDtmfStopMonitor::RunL: status: %d", err );
+    
+    if ( err != KErrCancel &&  err != KErrServerTerminated )
+        {
+        
+        TChar tone = NULL;
+        MCCPDTMFObserver::TCCPDtmfEvent event = 
+                MCCPDTMFObserver::ECCPDtmfStopInDtmfString;
+        iObserver.NotifyDTMFEvent( event, err, tone );
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, "CSPEtelDtmfStopMonitor::RunL: Error \
+                    from RMobilePhone: %d", iStatus.Int() );
+        }
+    
+    
+    // Continue if not in offline mode
+    if ( err != KErrGsmOfflineOpNotAllowed && err != KErrCancel
+        && err != KErrNotSupported )
+        {
+        StartMonitoring();
+        }
+    CSPLOGSTRING( CSPREQEND, "CSPEtelDtmfStopMonitor::RunL End of RunL." );
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelDtmfStopMonitor::DoCancel()
+    {
+    if ( iStatus == KRequestPending )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPEtelDtmfStopMonitor::DoCancel Canceling pending request.." );
+        iPhone.CancelAsyncRequest( EMobilePhoneNotifyStopInDTMFString );
+
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPEtelDtmfStopMonitor::CSPEtelDtmfStopMonitor(
+            CSPDTMFProvider& aObserver, 
+            RMobilePhone& aPhone ) : 
+            CActive( EPriorityStandard ),             
+            iObserver( aObserver ),
+            iPhone( aPhone )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelDtmfStopMonitor::CSPEtelDtmfStopMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelincomingcallmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPEtelIncomingCallMonitor
+*
+*/
+
+
+#include "cspetelincomingcallmonitor.h"
+#include "csplogger.h"
+#include "cspcall.h"
+#include "cspconsts.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelIncomingCallMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelIncomingCallMonitor* CSPEtelIncomingCallMonitor::NewL( 
+                                        MCSPIncomingCallObserver& aObserver, 
+                                        RMobileLine& aLine,
+                                       RCSPLineContainer::TCSPLineId aLineId )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelIncomingCallMonitor::NewL <");
+    CSPEtelIncomingCallMonitor* self = new ( ELeave ) CSPEtelIncomingCallMonitor( 
+                                        aObserver, aLine, aLineId );
+    CSPLOGSTRING(CSPOBJECT, "CSPEtelIncomingCallMonitor::NewL >");
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelIncomingCallMonitor::~CSPEtelIncomingCallMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelIncomingCallMonitor::~CSPEtelIncomingCallMonitor" );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitor.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelIncomingCallMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelIncomingCallMonitor::StartMonitoring");
+
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPEtelIncomingCallMonitor::StartMonitoring NotifyIncomingCall");
+        iCallName.Zero();
+        iLine.NotifyIncomingCall( iStatus, iCallName );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSPEtelIncomingCallMonitor::StartMonitoring Error already active");
+        }
+    }
+// ---------------------------------------------------------------------------
+// From CActive.
+// Handles line status change notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelIncomingCallMonitor::RunL()
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelIncomingCallMonitor::RunL <")
+    
+    if ( iStatus == KErrNone )
+        {
+        iIncomingCallObserver.IncomingCallArrived( iLine, iCallName,
+                                                       iLineId );
+        // Continue monitoring
+        StartMonitoring();        
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, "CSPEtelIncomingCallMonitor::RunL: Error \
+                    from RMobileLine: %d", iStatus.Int() );
+        }
+    
+    CSPLOGSTRING(CSPREQEND, "CSPEtelIncomingCallMonitor::RunL >");
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelIncomingCallMonitor::DoCancel()
+    {
+    CSPLOGSTRING( CSPINT, "CSPEtelIncomingCallMonitor::DoCancel" );
+
+    if ( iStatus == KRequestPending )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPEtelIncomingCallMonitor::DoCancel Canceling pending request.." );
+        iLine.NotifyIncomingCallCancel();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPEtelIncomingCallMonitor::CSPEtelIncomingCallMonitor(
+            MCSPIncomingCallObserver& aObserver, 
+            RMobileLine& aLine,
+            RCSPLineContainer::TCSPLineId aLineId ) : 
+            CActive( EPriorityStandard + 2 ),
+            iIncomingCallObserver( aObserver ), 
+            iLine( aLine ),
+            iLineId( aLineId )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelIncomingCallMonitor::CSPEtelIncomingCallMonitor" );
+    CActiveScheduler::Add( this );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetellinestatusmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPEtelLineStatusMonitor
+*
+*/
+
+
+
+#include <etelmm.h>
+
+#include "cspetellinestatusmonitor.h"
+#include "mcsplinestatusobserver.h"
+#include "csplogger.h"
+#include "cspconsts.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallAddedMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelLineStatusMonitor* CSPEtelLineStatusMonitor::NewL( 
+                                        MCSPLineStatusObserver& aObserver,
+                                        RMobileLine& aLine,
+                                       RCSPLineContainer::TCSPLineId aLineId )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelLineStatusMonitor::NewL()" );
+    CSPEtelLineStatusMonitor* self = new ( ELeave ) CSPEtelLineStatusMonitor( 
+                                        aObserver, aLine, aLineId );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelLineStatusMonitor::~CSPEtelLineStatusMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelLineStatusMonitor::~CSPEtelLineStatusMonitor()" );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitor.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelLineStatusMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPINT, "CSPEtelLineStatusMonitor::StartMonitoring()" );
+
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSP: CSPEtelLineStatusMonitor::StartMonitoring: Request \
+                    iLine.NotifyStatusChange( iStatus, iLineStatus )" );
+
+        iLine.NotifyMobileLineStatusChange( iStatus, iLineStatus );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSP: CSPEtelLineStatusMonitor::StartMonitoring: Already active" );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive.
+// Handles line status change notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelLineStatusMonitor::RunL()
+    {
+    CSPLOGSTRING2( CSPINT, "CSPEtelLineStatusMonitor::RunL: %d", iStatus.Int() );
+    
+    if ( iStatus == KErrNone )
+        {
+        CSPLOGSTRING( CSPINT, "CSPEtelLineStatusMonitor::RunL status changed")
+        iObserver.LineStatusChanged( iLine, iLineId, iLineStatus );
+        
+        StartMonitoring();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelLineStatusMonitor::DoCancel()
+    {
+    CSPLOGSTRING( CSPINT, "CSPEtelLineStatusMonitor::DoCancel" );
+
+    if ( iStatus == KRequestPending )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPEtelLineStatusMonitor::DoCancel Canceling pending request" );
+        iLine.CancelAsyncRequest( EMobileLineNotifyMobileLineStatusChange );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+CSPEtelLineStatusMonitor::CSPEtelLineStatusMonitor(
+        MCSPLineStatusObserver& aObserver,
+            RMobileLine& aLine,
+            RCSPLineContainer::TCSPLineId aLineId ) :
+            CActive( EPriorityStandard ), 
+            iLine( aLine ),
+            iLineId( aLineId ),
+            iObserver( aObserver )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelLineStatusMonitor::CSPEtelLineStatusMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+    
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspetelvideocallcapsmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of class CSPEtelVideoCallCapsMonitor which
+*                monitors call status changes from ETel and notifies observer
+*                according to call status change.
+*
+*/
+
+
+#include <mccpcallobserver.h>
+
+#include "cspetelvideocallcapsmonitor.h"
+#include "cspvideocall.h"
+#include "csplogger.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPEtelCallEventMonitor::NewL.
+// ---------------------------------------------------------------------------
+//
+CSPEtelVideoCallCapsMonitor* CSPEtelVideoCallCapsMonitor::NewL( 
+                                                    CSPVideoCall& aOwner,
+                                                    RMobileCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelCallEventMonitor::NewL()" );
+    CSPEtelVideoCallCapsMonitor* self = 
+                        new ( ELeave ) CSPEtelVideoCallCapsMonitor( 
+                                                            aOwner, aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+CSPEtelVideoCallCapsMonitor::~CSPEtelVideoCallCapsMonitor( )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelVideoCallCapsMonitor::CSPEtelVideoCallCapsMonitor()" );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts the monitoring.
+// NOTE: This function reads the initial value of data call caps in the 
+// beginning so that client can use GetMobileDataCallCaps to get up to date
+// caps information.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelVideoCallCapsMonitor::StartMonitoring()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+          "CSPEtelVideoCallCapsMonitor::StartMonitoring()" );
+
+    iCall.GetMobileDataCallCaps( iDataCallCapsPckg );
+    
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CSP: CSPEtelVideoCallCapsMonitor::StartMonitoring: Request \
+                    RMobilePhone::NotifyCapsChange" );
+        iCall.NotifyMobileDataCallCapsChange( iStatus, iDataCallCapsPckg );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+         "CSP: CSPEtelVideoCallCapsMonitor::StartMonitoring: Already active" );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPEtelVideoCallCapsMonitor::GetMobileDataCallCaps
+// ---------------------------------------------------------------------------
+//
+TInt CSPEtelVideoCallCapsMonitor::GetMobileDataCallCaps( TDes8& aCaps ) const
+    {
+    CSPLOGSTRING( CSPREQIN, "CSPEtelVideoCallCapsMonitor::GetMobileDataCallCaps" );
+    // get data call caps from Etel
+    aCaps = iDataCallCapsPckg;
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelVideoCallCapsMonitor::GetProtocolCaps
+// ---------------------------------------------------------------------------
+//
+TUint CSPEtelVideoCallCapsMonitor::GetProtocolCaps()
+    {
+    iDataCallCaps = iDataCallCapsPckg();
+    return iDataCallCaps.iProtocolCaps;
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Handles call status notifying.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelVideoCallCapsMonitor::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPEtelVideoCallCapsMonitor::RunL: status: %d", iStatus.Int() );
+    
+    if ( iStatus == KErrNone )
+        {
+        iDataCallCaps = iDataCallCapsPckg();
+        
+        iOwner.DataCallCapsChanged( iDataCallCaps );
+        
+        iCall.NotifyMobileDataCallCapsChange( iStatus, iDataCallCapsPckg );
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// Canceling functionality.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelVideoCallCapsMonitor::DoCancel()
+    {
+    iCall.CancelAsyncRequest( EMobileCallNotifyMobileDataCallCapsChange );
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructs the monitor..
+// ---------------------------------------------------------------------------
+//
+CSPEtelVideoCallCapsMonitor::CSPEtelVideoCallCapsMonitor( CSPVideoCall& aOwner,
+                                                    RMobileCall& aCall ) : 
+                                   CActive( EPriorityStandard ),
+                                   iOwner( aOwner ),
+                                   iCall ( aCall ),
+                                   iDataCallCapsPckg( iDataCallCaps )
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelVideoCallCapsMonitor::CSPEtelCallCapsMonitor()" );
+    CActiveScheduler::Add( this );
+    }
+    
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void CSPEtelVideoCallCapsMonitor::ConstructL()
+    {
+    // Implementation not required.    
+    }
+
+// ---------------------------------------------------------------------------
+// CSPEtelVideoCallCapsMonitor::UpdateProtocolCaps
+// ---------------------------------------------------------------------------
+//
+void CSPEtelVideoCallCapsMonitor::UpdateProtocolCaps()
+    {
+    CSPLOGSTRING(CSPOBJECT, 
+        "CSPEtelVideoCallCapsMonitor::UpdateProtocolCaps()" );
+
+    iCall.GetMobileDataCallCaps( iDataCallCapsPckg );            
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspforwardprovider.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class CSPForwardProvider
+*
+*/
+
+
+#include <mccpforwardprovider.h>
+#include <mccpforwardobserver.h>
+#include <etelmm.h>
+#include <badesca.h>    // CDesC8ArrayFlat
+
+#include "cspforwardprovider.h"
+#include "csplogger.h"
+
+
+// ---------------------------------------------------------------------------
+// Two phased construction
+// ---------------------------------------------------------------------------
+//
+CSPForwardProvider* CSPForwardProvider::NewL ( )
+    {
+    CSPForwardProvider* self = new ( ELeave ) CSPForwardProvider( );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;    
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPForwardProvider::~CSPForwardProvider()
+    {
+    delete iEmptyArray;
+    iObservers.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPCall::NotifyForwardEventOccurred
+// Notifies observers about call events
+// ---------------------------------------------------------------------------
+//
+void CSPForwardProvider::NotifyForwardEventOccurred( 
+    MCCPForwardObserver::TCCPForwardEvent aEvent )
+    {
+    CSPLOGSTRING2( CSPREQOUT, 
+        "CSPForwardProvider::ForwardEventOccurred: event: %d", aEvent );
+
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        MCCPForwardObserver *obs = iObservers[i];
+        if ( obs )
+            {                
+            obs->ForwardEventOccurred( aEvent );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Forward address choice array.
+// ---------------------------------------------------------------------------
+//  
+const CDesC8Array& CSPForwardProvider::GetForwardAddressChoicesL()
+    {
+    return *iEmptyArray;
+    }
+
+// ---------------------------------------------------------------------------
+// Forward to address. 
+// Not supported. 
+// ---------------------------------------------------------------------------
+//  
+void CSPForwardProvider::ForwardToAddressL( const TInt /*aIndex*/ )
+    {
+    User::Leave( KErrNotSupported );
+    return;
+    }
+        
+// ---------------------------------------------------------------------------
+// Adds observer to array
+// ---------------------------------------------------------------------------
+//
+void CSPForwardProvider::AddObserverL( const MCCPForwardObserver& aObserver )
+    {
+    if ( iObservers.Find( &aObserver ) == KErrNotFound )
+        {
+        iObservers.Append( &aObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Removes observer from array
+// ---------------------------------------------------------------------------
+//
+TInt CSPForwardProvider::RemoveObserver( const MCCPForwardObserver& aObserver )
+    {
+    TInt found = iObservers.Find( &aObserver );
+    if ( found != KErrNotFound )
+        {
+        iObservers.Remove( found );
+        return KErrNone;
+        }
+    return found;
+    }
+
+// ---------------------------------------------------------------------------
+// Default C++ constructor
+// ---------------------------------------------------------------------------
+//
+CSPForwardProvider::CSPForwardProvider( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPForwardProvider::CSPForwardProvider()" );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructing 2nd phase
+// ---------------------------------------------------------------------------
+//
+void CSPForwardProvider::ConstructL()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPForwardProvider::ConstructL()" );
+    iEmptyArray = new (ELeave) CDesC8ArrayFlat( 1 );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/csppanic.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This module contains the implementation of panic function for
+*                for CS-plugin.
+*
+*/
+
+
+// INCLUDE FILES
+#include "csppanic.pan"
+#include "e32std.h"
+
+// EXTERNAL DATA STRUCTURES
+// None.
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None.
+
+// CONSTANTS
+// None.
+
+// MACROS
+// None.
+
+// LOCAL CONSTANTS AND MACROS
+// None.
+
+// MODULE DATA STRUCTURES
+// None.
+
+// LOCAL FUNCTION PROTOTYPES
+// None.
+
+// ==================== LOCAL FUNCTIONS ====================
+
+// -----------------------------------------------------------------------------
+// Panic
+// Creates PhoneEngine panic.
+// Returns: None.
+// -----------------------------------------------------------------------------
+//
+GLDEF_C void Panic( TCSPPanic aPanic )
+    {
+    User::Panic( KCSPPanic, aPanic );
+    }
+
+// ===================== MEMBER FUNCTIONS ==================
+// None.
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+// None.
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CSP Ecom proxyfile        
+*
+*/
+
+
+
+#include <e32base.h>
+#include <implementationproxy.h>
+
+#include "csprovider.h"
+#include "csplogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// TImplementationProxy::ImplementationTable
+// ---------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x102828E5, CSProvider::NewL )
+    };
+
+// ---------------------------------------------------------------------------
+// TImplementationProxy::ImplementationGroupProxy
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+                                                        TInt& aTableCount )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPPROXY - A");
+    aTableCount = 
+        sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    CSPLOGSTRING(CSPOBJECT, "CSPPROXY - B");
+    return ImplementationTable;
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/csppubsublistener.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the class CSPPubSubListener
+*
+*/
+
+
+#include "csppubsublistener.h"
+#include "mcsppubsubobserver.h"
+#include "csplogger.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::CSPPubSubListener
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSPPubSubListener::CSPPubSubListener(
+    const TUid aUid, const TInt aKey, MCSPPubSubObserver* aObserver ) :
+        CActive( CActive::EPriorityStandard ),
+        iUid( aUid ), iId( aKey ), iObserver( aObserver )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::~CSPPubSubListener
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CSPPubSubListener::~CSPPubSubListener()
+    {
+    CSPLOGSTRING( CSPINT, "CSPPubSubListener::~CSPPubSubListener" )
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::RunL
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void CSPPubSubListener::RunL()
+    {
+    CSPLOGSTRING( CSPINT, "CSPPubSubListener::RunL" )
+    const TRequestStatus status( iStatus );
+    StartListening();
+    iObserver->HandleNotifyPSL( iUid, iId, status );
+    CSPLOGSTRING( CSPINT, "CSPPubSubListener::RunL end" )
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::DoCancel
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void CSPPubSubListener::DoCancel()
+    {
+    CSPLOGSTRING( CSPINT, "CSPPubSubListener::DoCancel")
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::RunError
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+TInt CSPPubSubListener::RunError( TInt /*aError*/ )
+    {
+    CSPLOGSTRING( CSPINT, "CSPPubSubListener::RunError" )
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::NewL
+// -----------------------------------------------------------------------------
+//
+CSPPubSubListener* CSPPubSubListener::NewL( const TUid aUid, 
+    const TInt aKey, MCSPPubSubObserver* aObserver )
+    {
+    CSPLOGSTRING( CSPINT, "CSPPubSubListener::NewL" )
+    CSPPubSubListener* self = new( ELeave ) 
+        CSPPubSubListener( aUid, aKey, aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::StartListening
+// -----------------------------------------------------------------------------
+//
+void CSPPubSubListener::StartListening() 
+    {
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CSPPubSubListener::ConstructL()
+    {
+    if ( iObserver )
+        {
+        CActiveScheduler::Add( this );
+        }
+        
+    User::LeaveIfError ( iProperty.Attach( iUid, iId, EOwnerThread ) );
+
+    if ( iObserver )
+        {
+        StartListening();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::Get
+// Read integer value.
+// -----------------------------------------------------------------------------
+//
+TInt CSPPubSubListener::Get( TInt& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::Get
+// Read binary value.
+// -----------------------------------------------------------------------------
+//
+TInt CSPPubSubListener::Get( TDes8& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+  
+// -----------------------------------------------------------------------------
+// CSPPubSubListener::Get
+// Read string value.
+// -----------------------------------------------------------------------------
+//      
+TInt CSPPubSubListener::Get( TDes16& aVal )
+    {
+    return iProperty.Get( iUid, iId, aVal );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspremotealertingtonelistener.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Listens remote alerting tone status changes
+*
+*/
+
+
+#include "cspremotealertingtonelistener.h"
+#include "mcspremotealertingtoneobserver.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Default constructor
+// ---------------------------------------------------------------------------
+//
+CSPRemoteAlertingToneListener::CSPRemoteAlertingToneListener(
+    RMmCustomAPI& aCustomAPI,
+    MCSPRemoteAlertingToneObserver& aObserver ) : 
+    CActive( CActive::EPriorityStandard ),
+    iCustomAPI( aCustomAPI ),
+    iObserver( aObserver )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CSPRemoteAlertingToneListener* CSPRemoteAlertingToneListener::NewL( 
+    RMmCustomAPI& aCustomAPI,
+    MCSPRemoteAlertingToneObserver& aObserver )
+    {
+    CSPRemoteAlertingToneListener* self = 
+        new( ELeave ) CSPRemoteAlertingToneListener( 
+            aCustomAPI, aObserver );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CSPRemoteAlertingToneListener::~CSPRemoteAlertingToneListener()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts listening the remote alerting tone changes, if not already started
+// ---------------------------------------------------------------------------
+//
+void CSPRemoteAlertingToneListener::StartListening()
+    {
+    if ( !IsActive() )
+        {
+        iCustomAPI.NotifyRemoteAlertingToneStatusChange( iStatus, iRATStatus );
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive.
+// Cancels the oustanding request.
+// ---------------------------------------------------------------------------
+//
+void CSPRemoteAlertingToneListener::DoCancel()
+    {
+    iCustomAPI.CancelAsyncRequest(
+        ECustomNotifyRemoteAlertingToneStatusChangeIPC );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive.
+// Starts listening next change and notifies the observer if no errors 
+// in request completion.
+// ---------------------------------------------------------------------------
+//
+void CSPRemoteAlertingToneListener::RunL()
+    {
+    const TInt error( iStatus.Int() );
+    if ( error != KErrNotSupported )
+        {
+        StartListening();
+        }
+    if ( error == KErrNone )
+        {
+        iObserver.RemoteAlertingToneStatusChanged( iRATStatus );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/csprovider.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1273 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main class of CS Call Plug-in
+*
+*/
+
+
+// EXTERNAL INCLUDES
+#include <e32base.h>
+#include <mccpconferencecallobserver.h>
+#include <mmtsy_names.h>
+#include <mccpssobserver.h>
+#include <rmmcustomapi.h>
+#include <startupdomainpskeys.h>
+#include <mccecall.h>
+
+// USER INCLUDES
+#include "csprovider.h"
+#include "cspvoicecall.h"
+#include "cspvideocall.h"
+#include "cspetelincomingcallmonitor.h"
+#include "cspetelconferencestatusmonitor.h"
+#include "cspdtmfprovider.h"
+#include "cspconferencecall.h"
+#include "cspcallarray.h"
+#include "cspservicesettingshandler.h"
+#include "cspaudiohandler.h"
+#include "cspetelcallwaitingrequester.h"
+#include "cspsupplementaryservicesmonitor.h"
+#include "cspcipheringstatusmonitor.h"
+#include "cspsssettingshandler.h"
+#include "cspcalladdedhandler.h"
+#include "csppubsublistener.h"
+#include "cspcallcommandhandler.h"
+#include "cspremotealertingtonelistener.h"
+#include "csppanic.pan"
+#include "csplogger.h"
+#include "cspconsts.h"
+
+const TInt KCSServiceId = 1; 
+
+// ---------------------------------------------------------------------------
+// CSProvider::CSProvider
+// ---------------------------------------------------------------------------
+//
+CSProvider::CSProvider(): iImplementationUid( KCSPImplementationUid )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::CSProvider");
+    iInitialized = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::~CSProvider
+// ---------------------------------------------------------------------------
+//
+CSProvider::~CSProvider()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider <");
+    delete iCallArray;
+    
+    if ( iInitialized )
+        {
+        delete iConferenceStatusMonitor; 
+        delete iCallCommandHandler;
+        delete iRemoteAlertingToneListener;
+        delete iSimStatusListener;
+        delete iSsSettingsHandler;
+        delete iAudioHandler;        
+        delete iSsMonitor;
+        delete iCwRequester;
+        delete iServiceHandler;
+        delete iIncomingVoiceCallMonitor;
+        delete iIncomingDataCallMonitor;
+        delete iIncomingAuxCallMonitor;
+        delete iCallAddedHandler;
+        delete iCipheringStatusMonitor;
+        delete iDTMFProvider;
+
+        CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider close lines");
+        iLineContainer.Close();
+        CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider close customapi");
+        iMmCustom.Close();
+        CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider close conference call");
+        iMobileConferenceCall.Close();
+        CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider close phone");
+        iMobilePhone.Close();
+        CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider unload phone");
+        iServer.UnloadPhoneModule( KMmTsyModuleName );
+        CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider close server session");
+        iServer.Close();
+        }
+
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::~CSProvider >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CSProvider::ConstructL()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::ConstructL <");
+    iCallArray = CSPCallArray::NewL();
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::ConstructL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::NewL
+// ---------------------------------------------------------------------------
+//
+CSProvider* CSProvider::NewL()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::NewL() <");
+    CSProvider* self = new ( ELeave ) CSProvider();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::NewL() >");
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::NotifySsEvent
+// ---------------------------------------------------------------------------
+//
+void CSProvider::NotifySsEvent( 
+                    RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode,
+                    RMmCustomAPI::TSsInfo& aSsInfo )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::NotifySsEvent <");
+    TBuf<10> addr;
+    
+    switch( aSsTypeAndMode.iSsType )
+        {
+        case RMmCustomAPI::ESsAllSs:
+            {
+            CSPLOGSTRING(CSPINT, "CSProvider::NotifySsEvent ESsAllSs");
+            if( iSsSettingsHandler )
+                {
+                TInt cugIndex( aSsInfo.iCugIndex );
+                                
+                if ( iSsSettingsHandler->IsValueValidCugIndex( cugIndex ) ) 
+                    {
+                    CSPLOGSTRING(CSPINT, "CSProvider::NotifySsEvent CallCugEventOccurred");
+                    iSsObserver->CallCugEventOccurred(  
+                            MCCPSsObserver::ECCPSsShowIncCallGroupIndex );
+                    }  
+                else 
+                    {
+                    CSPLOGSTRING2(CSPERROR, 
+                            "CSProvider::NotifySsEvent err invalid cug index %d", cugIndex );
+                    }
+                }
+            break; 
+            }
+        
+        case RMmCustomAPI::ESsRegPassword:
+        case RMmCustomAPI::ESsClip:
+        case RMmCustomAPI::ESsClir:
+        case RMmCustomAPI::ESsCnap:
+        case RMmCustomAPI::ESsColp:
+        case RMmCustomAPI::ESsColr:
+            {
+            CSPLOGSTRING(CSPINT, "CSProvider::NotifySsEvent Discarding");
+            break; 
+            }
+
+        case RMmCustomAPI::ESsCallWaiting:
+            {
+            CSPLOGSTRING(CSPINT, "CSProvider::NotifySsEvent ESsCallWaiting");
+            iSsObserver->CallForwardEventOccurred( 
+                                MCCPSsObserver::ESsCallWaiting,
+                                addr );
+            break; 
+            }        
+            
+        case RMmCustomAPI::ESsAllForwardings:
+        case RMmCustomAPI::ESsForwUncond:
+        case RMmCustomAPI::ESsForwBusy:
+        case RMmCustomAPI::ESsForwNoReply:
+        case RMmCustomAPI::ESsForwNoReach:
+        case RMmCustomAPI::ESsAllCondForwardings:
+            {
+            switch( aSsInfo.iForwMode )
+                {
+                case RMmCustomAPI::ESsIncCallIsForw:
+                    iSsObserver->CallForwardEventOccurred( 
+                                        MCCPSsObserver::ECCPSsIncCallIsForw,
+                                        addr );
+                    break;
+                case RMmCustomAPI::ESsIncCallForwToC:
+                    iSsObserver->CallForwardEventOccurred( 
+                                        MCCPSsObserver::ECCPSsIncCallForwToC,
+                                        addr );
+                    break;
+                case RMmCustomAPI::ESsOutCallForwToC:
+                    iSsObserver->CallForwardEventOccurred( 
+                                        MCCPSsObserver::ECCPSsOutCallForwToC,
+                                        addr );
+                    break;
+                default:
+                    {
+                    HandleDivertOrBarring( addr, aSsTypeAndMode );
+                    break; 
+                    }
+                }
+            break;
+            }
+
+        case RMmCustomAPI::ESsAllBarrings:  
+        case RMmCustomAPI::ESsBarrAllOut:
+        case RMmCustomAPI::ESsBarrOutInter:
+        case RMmCustomAPI::ESsBarrOutInterExcHome:
+        case RMmCustomAPI::ESsOutgoingBarrServ:
+            {            
+            iSsObserver->BarringEventOccurred( 
+                                    MCCPSsObserver::ECCPSsOutgoingCallBarred );
+            break;
+            }
+
+        case RMmCustomAPI::ESsBarrAllIn:
+        case RMmCustomAPI::ESsBarrAllInRoam:
+        case RMmCustomAPI::ESsIncomingBarrServ:
+            {            
+            iSsObserver->BarringEventOccurred( 
+                                    MCCPSsObserver::ECCPSsIncomingCallBarred );
+            break;
+            }
+
+        default:
+            {
+            CSPLOGSTRING(CSPINT, "CSProvider::NotifySsEvent Unknown SS");
+            break; 
+            }
+        }
+        
+    CSPLOGSTRING(CSPINT, "CSProvider::NotifySsEvent >");    
+    }
+
+// From CConvergedCallProvider
+// ---------------------------------------------------------------------------
+// CSProvider::InitializeL
+// ---------------------------------------------------------------------------
+//
+void CSProvider::InitializeL( const MCCPObserver& aObserver,
+                              const MCCPSsObserver& aSsObserver )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::InitializeL <");
+    if ( iInitialized )
+        {
+        CSPLOGSTRING(CSPOBJECT, 
+                "CSProvider::InitializeL() Error already initialized");
+        User::Leave( KErrAlreadyExists );
+        }
+    iInitialized = ETrue;
+    
+    CreateEtelConnectionsL();
+    
+    iServiceHandler = CSPServiceSettingsHandler::NewL();
+
+    TInt readErr = iServiceHandler->ReadCSServiceId( iServiceId );
+    if ( readErr )
+        {
+        CSPLOGSTRING(CSPERROR, "CSProvider::InitializeL()\
+                ERROR COULD NOT READ SERVICE ID FOR CS-PLUGIN ");
+        CSPLOGSTRING(CSPERROR, "CSProvider::InitializeL() \
+                Please ensure that SPSettings is initialized corretly! ");
+        iServiceId = KCSServiceId; 
+        }
+    
+    // Save CCP observer as pointer-type member 
+    const MCCPCSObserver& obs = static_cast<const MCCPCSObserver&>(aObserver);
+    iCCPObserver = const_cast<MCCPCSObserver*>(&obs);
+    
+    // Save CCP SS observer as pointer-type member 
+    const MCCPSsObserver& ssObs = static_cast<const MCCPSsObserver&>(aSsObserver);
+    iSsObserver = const_cast<MCCPSsObserver*>(&ssObs);
+    
+    RPhone::TLineInfo lineInfo;
+    __ASSERT_ALWAYS( iMobilePhone.GetLineInfo( 0, lineInfo )
+        == KErrNone, Panic( ECSPPanicNoEtel ) );
+    
+    // Open Lines. At least voice line must be opened.
+    __ASSERT_ALWAYS( iLineContainer.Open( iMobilePhone, iServiceId ) == KErrNone,
+        Panic( ECSPPanicNoEtel ) );
+
+    RMobileLine& voiceLine = iLineContainer.LineByType( 
+                                RCSPLineContainer::ECSPLineSpeech );
+    
+    // Create and start incoming voice call monitor for primary line
+    iIncomingVoiceCallMonitor = CSPEtelIncomingCallMonitor::NewL( *this, 
+                                      voiceLine,
+                                      RCSPLineContainer::ECSPLineSpeech );
+    iIncomingVoiceCallMonitor->StartMonitoring();
+
+    // Create and start incoming data call monitor for data line    
+    RMobileLine& dataLine = iLineContainer.LineByType( RCSPLineContainer::ECSPLineData );
+    iIncomingDataCallMonitor = CSPEtelIncomingCallMonitor::NewL( *this, dataLine,
+                                      RCSPLineContainer::ECSPLineData );
+    iIncomingDataCallMonitor->StartMonitoring();
+    
+    // Create and start incoming call monitor for auxilary line    
+    RMobileLine& auxLine = iLineContainer.LineByType( RCSPLineContainer::ECSPLineAuxSpeech );
+    iIncomingAuxCallMonitor = CSPEtelIncomingCallMonitor::NewL( *this, auxLine,
+                                      RCSPLineContainer::ECSPLineAuxSpeech );
+    iIncomingAuxCallMonitor->StartMonitoring();
+
+    iCwRequester = CSPEtelCallWaitingRequester::NewL( iMobilePhone );
+    
+    // Start conference call monitor for monitoring external conference creation  
+    iConferenceStatusMonitor = CSPEtelConferenceStatusMonitor::NewL( *this, 
+                                    iMobileConferenceCall );
+    iConferenceStatusMonitor->StartMonitoring();
+
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::InitializeL create DTMF provider");
+    iDTMFProvider = CSPDTMFProvider::NewL( iMobilePhone, iMmCustom );
+    
+    // Create and start ciphering status monitor    
+    iCipheringStatusMonitor = CSPCipheringStatusMonitor::NewL( iMmCustom, *this );
+    iCipheringStatusMonitor->StartMonitoring();
+
+    // Create audio handler
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::InitializeL create audio handler");
+    iAudioHandler = CSPAudioHandler::NewL();
+    
+    // Create call added handler for listening ext call creation
+    iCallAddedHandler = CSPCallAddedHandler::NewL( 
+        obs, 
+        iLineContainer, 
+        *iCallArray,
+        *this,
+        *iAudioHandler );
+    
+    iSimStatusListener = CSPPubSubListener::NewL( 
+        KPSUidStartup, 
+        KPSSimStatus, 
+        this );
+    
+    HandleSIMStatusL();
+    
+    iRemoteAlertingToneListener = 
+        CSPRemoteAlertingToneListener::NewL( iMmCustom, *this );
+    iRemoteAlertingToneListener->StartListening();
+
+    iCallCommandHandler = CSPCallCommandHandler::NewL();
+    
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::InitializeL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::NewCallL creates MO call.
+// ---------------------------------------------------------------------------
+//
+MCCPCall* CSProvider::NewCallL( const CCCPCallParameters& aCallParameters,
+                                const TDesC& aRemoteParty, 
+                                const MCCPCallObserver& aObserver )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSProvider::NewCallL <");
+    
+    const CCCECallParameters& parameters = 
+        reinterpret_cast<const CCCECallParameters&> (aCallParameters);
+    
+    TUint32 serviceId = aCallParameters.ServiceId();
+
+    if ( serviceId != iServiceId )
+        {
+        CSPLOGSTRING(CSPERROR, "CSProvider::NewCallL ERROR, service id not acceptable!");
+        User::Leave( ECCPErrorInvalidPhoneNumber );
+        }
+    
+    RCSPLineContainer::TCSPLineId lineId = 
+        iLineContainer.ResolveLineIdL( parameters );
+
+    RMobileLine& line = iLineContainer.LineByType( lineId );
+    
+    CSPCall* call = NULL;
+    
+    if ( RCSPLineContainer::ECSPLineSpeech == lineId ||
+         RCSPLineContainer::ECSPLineAuxSpeech == lineId )
+        {
+        call = CSPVoiceCall::NewL( const_cast<TDesC16&>(aRemoteParty), 
+                            line, 
+                            ETrue,
+                            parameters,
+                            *this,
+                            EFalse );
+        CleanupStack::PushL( call );
+        }
+        
+    // Create CSPDataCall object for data/video call
+    else if ( RCSPLineContainer::ECSPLineData == lineId )
+        {
+        call = CSPVideoCall::NewL( 
+                            const_cast<TDesC16&>(aRemoteParty),
+                            line, ETrue, parameters,
+                            *this );
+        CleanupStack::PushL( call );
+        }
+    else if ( RCSPLineContainer::ECSPLineFax == lineId )
+        {
+        CSPLOGSTRING(CSPERROR, 
+            "CSProvider::NewCallL ERROR FAX is unsupported call type");
+        User::Leave( KErrNotSupported );
+        }
+    
+    if ( aRemoteParty.Length() == 0 )
+        {
+        CSPLOGSTRING(CSPERROR, "CSProvider::NewCallL ERROR: aRemoteParty.Length ==0");
+         
+        User::Leave( ECCPErrorInvalidPhoneNumber );
+        }
+    
+    call->AddObserverL( aObserver );        
+    TInt err = iCallArray->Add( call );
+    User::LeaveIfError( err );
+
+    call->SetAudioHandler( iAudioHandler );
+    
+    CleanupStack::Pop( call );
+    
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::NewCallL >");
+    return call;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::ReleaseCall
+// ---------------------------------------------------------------------------
+//
+TInt CSProvider::ReleaseCall( MCCPCall& aCall )
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSProvider::ReleaseCall %d", &aCall);
+    CSPCall* call = static_cast<CSPCall*>(&aCall);
+    TInt err = iCallArray->Remove( call );
+    if ( err == KErrNone )
+        {
+        delete call;
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::NewEmergencyCallL
+// ---------------------------------------------------------------------------
+//
+MCCPEmergencyCall* CSProvider::NewEmergencyCallL( const TUint32 aServiceId,
+                                                  const TDesC& aAddress,
+                                           const MCCPCallObserver& aObserver )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::NewEmergencyCallL <");
+
+    RMobileLine& voiceLine = iLineContainer.LineByType( 
+                                    RCSPLineContainer::ECSPLineSpeech );
+    TBuf8<KCCEBearerMaxSize> emptyBearer;
+    TBuf<KCCESubAddressMaxSize> emptySubAddress;
+    
+    CCCECallParameters* tmpParams = CCCECallParameters::NewL();
+    CleanupStack::PushL( tmpParams );
+    tmpParams->SetServiceId(aServiceId);
+    CSPVoiceCall* call = CSPVoiceCall::NewL( aAddress,
+                                             voiceLine,
+                                             ETrue,
+                                             *tmpParams,
+                                             *this,
+                                             ETrue);
+        
+    CleanupStack::PopAndDestroy( tmpParams );
+    CleanupStack::PushL( call );
+    
+    call->AddObserverL( aObserver );
+    TInt err = iCallArray->Add( call );
+    User::LeaveIfError( err );
+
+    call->SetAudioHandler( iAudioHandler );
+    
+    CleanupStack::Pop( call );    
+    
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::NewEmergencyCallL >");
+    return call;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::ReleaseEmergencyCall
+// ---------------------------------------------------------------------------
+//
+TInt CSProvider::ReleaseEmergencyCall( MCCPEmergencyCall& aCall )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::ReleaseEmergencyCall");    
+    CSPVoiceCall* call = static_cast<CSPVoiceCall*>(&aCall);
+    iCallArray->Remove( call );
+    delete call;
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSProvider::NewConferenceL
+// ---------------------------------------------------------------------------
+//
+MCCPConferenceCall* CSProvider::NewConferenceL( 
+                        const TUint32 /*aServiceId*/,
+                        const MCCPConferenceCallObserver& aObserver )
+    {   
+    CSPLOGSTRING(CSPREQIN, "CSProvider::NewConferenceL <");
+    if ( !iConferenceCall )
+        {
+        iConferenceCall = CSPConferenceCall::NewL( 
+                                    iMobilePhone, *iCallArray, iServiceId );    
+        iConferenceCall->AddObserverL( aObserver );
+        }
+    else 
+        {
+        CSPLOGSTRING(CSPERROR, "CSProvider::NewConferenceL()\
+                Error conference already exists");
+        User::Leave( KErrAlreadyExists ); 
+        }
+    CSPLOGSTRING(CSPREQOUT, "CSProvider::NewConferenceL >");
+    return iConferenceCall;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::ReleaseConferenceCall
+// ---------------------------------------------------------------------------
+//
+TInt CSProvider::ReleaseConferenceCall( MCCPConferenceCall& aCall )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSProvider::ReleaseConferenceCall");
+    TInt ret( KErrNone ); 
+    if ( &aCall == iConferenceCall )
+        {
+        delete iConferenceCall;
+        iConferenceCall = NULL;
+        }
+    else
+        {
+        CSPLOGSTRING(CSPERROR, 
+                "CSProvider::ReleaseConferenceCall Error call not found");
+        ret = KErrNotFound; 
+        }
+    return ret;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSProvider::Uid
+// ---------------------------------------------------------------------------
+//
+const TUid& CSProvider::Uid() const
+    {
+    CSPLOGSTRING2(CSPREQIN, "CSProvider::Uid uid: %d", iImplementationUid);
+    return iImplementationUid;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::Caps
+// ---------------------------------------------------------------------------
+//
+TUint32 CSProvider::Caps( ) const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSProvider::Caps");
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::DTMFProvider
+// ---------------------------------------------------------------------------
+//
+MCCPDTMFProvider* CSProvider::DTMFProviderL( 
+            const MCCPDTMFObserver& aObserver )
+    {
+    CSPLOGSTRING2(CSPREQIN, 
+            "CSProvider::DTMFProvider observer: %x", &aObserver);
+    iDTMFProvider->AddObserverL( aObserver );
+    CSPLOGSTRING(CSPREQIN, "CSProvider::DTMFProvider observer added");
+    return iDTMFProvider;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::ExtensionProvider
+// ---------------------------------------------------------------------------
+//
+MCCPExtensionProvider* CSProvider::ExtensionProviderL( 
+                            const MCCPExtensionObserver& /*aObserver*/)
+    {
+    CSPLOGSTRING(CSPREQIN, "CSProvider::ExtensionProvider");
+    return NULL;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSProvider::GetLifeTime
+// ---------------------------------------------------------------------------
+//
+TBool CSProvider::GetLifeTime( TDes8& aLifeTimeInfo )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSProvider::GetLifeTime");
+    TInt err = iMmCustom.GetLifeTime( aLifeTimeInfo );    
+    if ( err ) 
+        {
+        return EFalse;
+        }
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::GetCSInfo
+// ---------------------------------------------------------------------------
+//
+TBool CSProvider::GetCSInfo( CSInfo& aCSInfo )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSProvider::GetCSInfo");
+    if ( iInitialized )
+        {
+        RMobilePhone::TMobilePhoneIdentityV1 imei;
+        TRequestStatus reqStatus( KErrNone );
+        
+        CSPLOGSTRING(CSPREQOUT, 
+                "CSProvider::GetCSInfo request get phone id");
+        iMobilePhone.GetPhoneId( reqStatus, imei );
+        User::WaitForRequest( reqStatus );
+        CSPLOGSTRING(CSPREQOUT, 
+                "CSProvider::GetCSInfo completed get phone id");
+        
+        if ( reqStatus.Int() != KErrNone )
+             {
+             imei.iSerialNumber.Zero();
+             } 
+             
+        aCSInfo.iSerialNumber =  imei.iSerialNumber; 
+        return reqStatus.Int() == KErrNone;
+        }
+        
+    return iInitialized;
+    }
+        
+// ---------------------------------------------------------------------------
+// From MCSPIncomingCallObserver
+// CSProvider::IncomingCallArrived
+// ---------------------------------------------------------------------------
+//
+void CSProvider::IncomingCallArrived( RMobileLine& aLine, TName aCallName,
+                                      RCSPLineContainer::TCSPLineId aLineId )
+    {
+    RMobileLine::TLineInfo lineInfo;
+    aLine.GetInfo( lineInfo );
+    CSPLOGSTRING2(CSPINT, "CSProvider::IncomingCallArrived < line id   %d", aLineId );
+    CSPLOGSTRING2(CSPINT, "CSProvider::IncomingCallArrived call name %S", &aCallName );
+
+    CSPLOGSTRING2(CSPINT, "CSProvider::IncomingCallArrived answ %S", &lineInfo.iNameOfCallForAnswering );
+    CSPLOGSTRING2(CSPINT, "CSProvider::IncomingCallArrived last %S", &lineInfo.iNameOfLastCallAdded );
+    CSPLOGSTRING2(CSPINT, "CSProvider::IncomingCallArrived status %d", lineInfo.iStatus );
+    CSPLOGSTRING2(CSPINT, "CSProvider::IncomingCallArrived hook %d", lineInfo.iHookStatus );
+    
+    // Find call by name.
+    // In case CallAddedHandler has opened it and added to array, 
+    // it should not be re-opened.    
+    if ( !iCallArray->FindCall( aCallName ) )
+        {
+        TInt err(KErrUnknown);
+        TUint32 serviceId( 0 );
+        CCPCall::TCallType callType;
+        CCCECallParameters::TCCELineType lineType;
+        err = iLineContainer.ResolveCallInfo( aLineId, serviceId, callType, lineType );
+        
+        if ( !err )
+            {
+            CSPCall* call = NULL;
+            TBuf8<KCCEBearerMaxSize> emptyBearer;
+            TBuf<KCCESubAddressMaxSize> emptySubAddress;
+            CCCECallParameters* callParameters = NULL; 
+            TRAP_IGNORE( callParameters = CCCECallParameters::NewL() );
+            if ( callParameters )
+                {
+                callParameters->SetServiceId(serviceId);
+                callParameters->SetCallType(callType);
+                callParameters->SetLineType(lineType);
+                callParameters->SetOrigin(CCCECallParameters::ECCECallOriginPhone);
+            
+                if ( callType == CCPCall::ECallTypeCSVoice )
+                    {
+                    TRAP( err, call = CSPVoiceCall::NewL( aCallName, 
+                                                    aLine, 
+                                                    EFalse, 
+                                                    *callParameters,
+                                                    *this, 
+                                                    EFalse ) );
+                    }
+                else if ( callType == CCPCall::ECallTypeVideo )
+                    {
+                    TRAP( err, call = CSPVideoCall::NewL( aCallName,
+                                                    aLine, 
+                                                    EFalse, 
+                                                    *callParameters,
+                                                    *this ) );
+                    }
+                else
+                     {
+                    CSPLOGSTRING2(CSPERROR, 
+                       "CSProvider::IncomingCallArrived() unknown call type %d", err );
+                    err = KErrUnknown;
+                    }
+                
+                delete callParameters;
+                }
+            
+            if ( call && err == KErrNone )
+                {                
+                TInt appendError = iCallArray->Add( call );
+                CSPLOGSTRING2(CSPERROR, 
+                      "CSProvider::IncomingCallArrived Appending call res %d", 
+                        appendError);
+                
+                // Set audio handler for DevSound.
+                call->SetAudioHandler( iAudioHandler );
+
+                // Indicate incoming call for observer. 
+                TInt err = IndicateIncomingCall( call );
+                
+                if ( KErrNone == err && 
+                     call->State() == MCCPCallObserver::ECCPStateAnswering )
+                    {
+                    // If call has proceeded already to Answering state (autoanswer) 
+                    // a change notification needs to be sent. 
+                    call->NotifyCallStateChangedETel( RMobileCall::EStatusAnswering );
+                    }
+                
+                if ( err ) 
+                    {
+                    iCallArray->Remove( call );
+                    delete call;
+                    }
+
+                CSPLOGSTRING( CSPINT, "CSProvider::IncomingCallArrived Inform CCE OK" );
+                }
+            else if ( call && err != KErrNone )
+                {
+                // Delete call, call array removal not needed.   
+                delete call; 
+                }
+            else
+                {
+                CSPLOGSTRING2(CSPERROR, 
+                  "CSProvider::IncomingCallArrived Call could not be created %d", err);                
+                }            
+            }
+        else
+            {
+            CSPLOGSTRING2(CSPERROR, "CSProvider::IncomingCallArrived ERROR Resolve call info err=%d", 
+                                   err);
+            }
+        }
+    CSPLOGSTRING(CSPINT, "CSProvider::IncomingCallArrived >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::GetCallWaitingL
+// ---------------------------------------------------------------------------
+//
+void CSProvider::GetCallWaitingL( const CCCECallParameters& aParams,
+                                  TBool& aCallWaitingStatus )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::GetCallWaitingL <");
+    
+    // If there are already connected or held call: call waiting must be 
+    // already ON.    
+    TInt callCount = iCallArray->GetCallCount();
+    TInt activeCallCount = 0;
+    for (TInt i = 0; i < callCount; i++)
+        {
+        switch (iCallArray->Get(i)->State())
+            {
+            case MCCPCallObserver::ECCPStateConnected:
+                {
+                activeCallCount++;
+                break;
+                }
+            case MCCPCallObserver::ECCPStateHold:
+                {
+                activeCallCount++;
+                break;
+                }
+            case MCCPCallObserver::ECCPStateAnswering:
+                {
+                activeCallCount++;
+                break;
+                }
+            }
+        }
+    if ( activeCallCount > 0 )
+        {
+        // CW status must be ON, so it is not reasonable to ask it from network 
+        aCallWaitingStatus = ETrue;
+        }
+    else 
+        {
+        iCwRequester->GetCallWaitingL( aParams, aCallWaitingStatus );
+        }
+    
+    CSPLOGSTRING(CSPINT, "CSProvider::GetCallWaitingL >");
+    }
+    
+// ---------------------------------------------------------------------------
+// CSProvider::GetDiagnosticError
+// ---------------------------------------------------------------------------
+//
+TInt CSProvider::GetDiagnosticError( TName& aCallName )
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSProvider::GetDiagnosticError call name %S", &aCallName );
+    return iMmCustom.GetDiagnosticInfo( aCallName );
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::NetworkSecurityStatus
+// ---------------------------------------------------------------------------
+//
+TBool CSProvider::NetworkSecurityStatus() const
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::NetworkSecurityStatus");
+    return iCipheringStatusMonitor->NetworkSecurityStatus();
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::SecureSpecified
+// ---------------------------------------------------------------------------
+//
+TBool CSProvider::SecureSpecified() const
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::SecureSpecified");
+    return iCipheringStatusMonitor->SecureSpecified();
+    }
+
+// ---------------------------------------------------------------------------
+// Remote alerting tone playing status. Error situation is handled as no tone.
+// ---------------------------------------------------------------------------
+//
+RMmCustomAPI::TRemoteAlertingToneStatus CSProvider::GetRemoteAlertingToneStatus()
+    {
+    RMmCustomAPI::TRemoteAlertingToneStatus status;
+    TInt err = iMmCustom.GetRemoteAlertingToneStatus( status );
+    if ( err )
+        {
+        status = RMmCustomAPI::EUiNoTone;
+        }
+    CSPLOGSTRING2(CSPINT, 
+        "CSProvider::GetRemoteAlertingToneStatus status: %d", status );
+    return status;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::SecuritySettingChanged
+// ---------------------------------------------------------------------------
+//
+void CSProvider::SecuritySettingChanged( TInt aValue )
+    {
+    CSPLOGSTRING2(CSPINT, 
+        "CSProvider::SecuritySettingChanged value: %d", aValue);
+    
+    TInt callCount = iCallArray->GetCallCount();
+    for (TInt i = 0; i < callCount; i++)
+        {
+        iCallArray->Get(i)->SecuritySettingChanged( aValue );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::CreateEtelConnectionsL
+// ---------------------------------------------------------------------------
+//
+void CSProvider::CreateEtelConnectionsL()
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::CreateEtelConnectionsL <");
+    
+    TInt errorCode( KErrNone );
+    TInt phoneCount( 0 );
+    RTelServer::TPhoneInfo phoneInfo;    
+
+    //This method connects the client to the ETel Server. 
+    //It must be used before any of other functions during a telephony session.
+    __ASSERT_ALWAYS( iServer.Connect( KNbrOfMessageSlots ) 
+        == KErrNone, Panic( ECSPPanicNoEtel ) );
+
+    //This method loads an ETel TSY module. mmtsy
+    errorCode = iServer.LoadPhoneModule( KMmTsyModuleName );
+    __ASSERT_ALWAYS( 
+        errorCode == KErrNone || errorCode == KErrAlreadyExists, 
+        Panic( ECSPPanicNoEtel ) );
+    
+    errorCode = iServer.SetExtendedErrorGranularity( 
+        RTelServer::EErrorExtended );
+    __ASSERT_ALWAYS( errorCode == KErrNone, Panic( ECSPPanicNoEtel ) );
+    
+    errorCode = iServer.SetPriorityClientV2();
+    CSPLOGSTRING2(CSPINT, "CSProvider:: Priority client: %d", errorCode );
+    if( KErrAlreadyExists == errorCode )
+        {
+        CSPLOGSTRING(CSPOBJECT, "CSProvider::CreateEtelConnectionsL() Already initialized");
+        User::Leave( KErrAlreadyExists );
+        }
+    //This method retrieves the total number of phones supported by all 
+    //the currently loaded ETel (TSY) modules.
+    errorCode = iServer.EnumeratePhones( phoneCount );
+    __ASSERT_ALWAYS( errorCode == KErrNone, Panic( ECSPPanicNoEtel ) );
+
+    //This method retrieves information associated with the specified phone
+    while ( phoneCount-- ) 
+        { 
+        errorCode = iServer.GetPhoneInfo( phoneCount, phoneInfo ); 
+        __ASSERT_ALWAYS( errorCode == KErrNone, Panic( ECSPPanicNoEtel ) );
+
+        if ( phoneInfo.iName == KMmTsyPhoneName )
+            {
+            phoneCount = 0;
+            }
+        } 
+ 
+    //This method opens a phone subsession by name, 
+    //and starts the modem initialisation process.
+    errorCode = iMobilePhone.Open( iServer, phoneInfo.iName );
+    __ASSERT_ALWAYS( errorCode == KErrNone, Panic( ECSPPanicNoEtel ) );
+    
+    iMobilePhone.SetEmergencyClient(RPhone::EEmergencyCSVoiceCallRequest);
+    
+    errorCode = iMobileConferenceCall.Open( iMobilePhone ); 
+    __ASSERT_ALWAYS( errorCode == KErrNone, Panic( ECSPPanicNoEtel ) );
+    
+    errorCode = iMmCustom.Open( iMobilePhone );
+    __ASSERT_ALWAYS( errorCode == KErrNone, Panic( ECSPPanicNoEtel ) );
+    
+    iSsMonitor = new (ELeave) 
+            CSPSupplementaryServicesMonitor( *this, iMmCustom );
+    iSsMonitor->StartMonitoring();
+    
+    CSPLOGSTRING(CSPINT, "CSProvider::CreateEtelConnectionsL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::HandleDivertOrBarring
+// Helper method.
+// ---------------------------------------------------------------------------
+//
+void CSProvider::HandleDivertOrBarring(TDesC& addr, RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode)
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::HandleDivertOrBarring <");
+    switch ( aSsTypeAndMode.iSsType )
+        {
+        // MO unconditional diverts
+        case RMmCustomAPI::ESsAllForwardings:
+        case RMmCustomAPI::ESsForwUncond:
+            {
+            if( aSsTypeAndMode.iSsMode == RMmCustomAPI::ESsModeActive )
+                {                
+                iSsObserver->CallForwardEventOccurred( 
+                            MCCPSsObserver::ECCPSsForwardUnconditionalModeActive,
+                            addr );
+                 }
+             else
+                {
+                iSsObserver->CallForwardEventOccurred( 
+                            MCCPSsObserver::ECCPSsForwardUnconditionalModeNotActive,
+                            addr );                                
+                }
+            break;
+            }
+        
+        // MO conditional diverts
+        case RMmCustomAPI::ESsForwBusy:
+        case RMmCustomAPI::ESsForwNoReply:
+        case RMmCustomAPI::ESsForwNoReach:
+        case RMmCustomAPI::ESsAllCondForwardings:
+            {
+            if( aSsTypeAndMode.iSsMode == RMmCustomAPI::ESsModeActive )
+                {
+                iSsObserver->CallForwardEventOccurred( 
+                            MCCPSsObserver::ECCPSsForwardConditionallyModeActive,
+                            addr );
+                }
+             else
+                {
+                iSsObserver->CallForwardEventOccurred( 
+                            MCCPSsObserver::ECCPSsForwardConditionallyModeNotActive,
+                            addr );
+                }
+             break;
+             }
+        default:
+            {
+            // No handling needed
+            }    
+        }
+    CSPLOGSTRING(CSPINT, "CSProvider::HandleDivertOrBarring >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::InitializeCallParameters
+// Initialises call parameters from SSSettings
+// ---------------------------------------------------------------------------
+//
+void CSProvider::InitializeCallParameters( RMobileCall::TMobileCallParamsV7& aParams )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::InitializeCallParameters <");
+    TInt defaultCug(0);
+    TInt cug(0);
+    
+    if( iSsSettingsHandler )
+        {
+        TRAP_IGNORE(iSsSettingsHandler->GetClirL( aParams.iIdRestrict ));
+        TRAP_IGNORE(iSsSettingsHandler->GetDefaultCugL( defaultCug ));
+        TRAP_IGNORE(iSsSettingsHandler->GetCugL( cug ));
+        }
+    
+    // This is always set to false thus allowing calls outside groups.
+    aParams.iCug.iSuppressOA = EFalse;    
+  
+    if ( cug >= 0 && cug != defaultCug ) // set group
+        {
+        // Invoke cug.
+        aParams.iCug.iCugIndex = cug; 
+        aParams.iCug.iExplicitInvoke = ETrue;
+        aParams.iCug.iSuppressPrefCug = ETrue;
+        }
+    else if ( cug == -1 ) // -1 supress
+        {
+        aParams.iCug.iCugIndex = defaultCug; 
+        aParams.iCug.iExplicitInvoke = ETrue;
+        aParams.iCug.iSuppressPrefCug = ETrue;
+        }
+    else    // default cug
+        {
+        aParams.iCug.iCugIndex = defaultCug; 
+        aParams.iCug.iExplicitInvoke = EFalse;
+        aParams.iCug.iSuppressPrefCug = EFalse;
+        }
+    CSPLOGSTRING(CSPINT, "CSProvider::InitializeCallParameters >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::InitializeDataCallParameters
+// Initialises call parameters from SSSettings
+// ---------------------------------------------------------------------------
+//
+void CSProvider::InitializeDataCallParameters( RMobileCall::TMobileHscsdCallParamsV1& aParams )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::InitializeDataCallParameters <");
+    TInt defaultCug(0);
+    TInt cug(0);
+    
+    if( iSsSettingsHandler )
+        {
+        TRAP_IGNORE(iSsSettingsHandler->GetClirL( aParams.iIdRestrict ));
+        TRAP_IGNORE(iSsSettingsHandler->GetDefaultCugL( defaultCug ));
+        TRAP_IGNORE(iSsSettingsHandler->GetCugL( cug ));
+        }
+        
+    // This is always set to false thus allowing calls outside groups.
+    aParams.iCug.iSuppressOA = EFalse;
+  
+    if ( cug >= 0 && cug != defaultCug ) // set group
+        {
+        // Invoke cug.
+        aParams.iCug.iCugIndex = cug; 
+        aParams.iCug.iExplicitInvoke = ETrue;
+        aParams.iCug.iSuppressPrefCug = ETrue;
+        }
+    else if ( cug == -1 ) // -1 supress
+        {
+        aParams.iCug.iCugIndex = defaultCug; 
+        aParams.iCug.iExplicitInvoke = ETrue;
+        aParams.iCug.iSuppressPrefCug = ETrue;
+        }
+    else    // default cug
+        {
+        aParams.iCug.iCugIndex = defaultCug; 
+        aParams.iCug.iExplicitInvoke = EFalse;
+        aParams.iCug.iSuppressPrefCug = EFalse;
+        }
+    
+    CSPLOGSTRING(CSPINT, "CSProvider::InitializeDataCallParameters >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::IndicateClientCall
+// This fucntion delivers call pointer to be managed by CCE.
+// ---------------------------------------------------------------------------
+//
+void CSProvider::IndicateClientCall( MCCPCSCall* aCall )
+    {
+    CSPLOGSTRING2(CSPINT, "CSProvider::IndicateClientCall call: %x", aCall); 
+    iCCPObserver->MoCallCreated( *aCall );
+    CSPLOGSTRING(CSPINT, "CSProvider::IndicateClientCall Inform CCE OK"); 
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::IndicateIncomingCall
+// This fucntion delivers call pointer to be managed by CCE.
+// ---------------------------------------------------------------------------
+//    
+TInt CSProvider::IndicateIncomingCall( MCCPCSCall* aCall )
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSProvider::IncomingCallArrived call: %x, inform CCE", aCall);
+    iCCPObserver->IncomingCall( aCall );
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSProvider::NotifyDataPortName
+// ---------------------------------------------------------------------------
+//      
+void CSProvider::NotifyDataPortName( TName& aDataPortName )
+    {
+    CSPLOGSTRING2(CSPINT, 
+            "CSProvider::NotifyDataPortName name: %S", &aDataPortName);
+    iCCPObserver->DataPortName( aDataPortName );
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::HandleNotifyPSL
+// From MCSPPubSubObserver.
+// ---------------------------------------------------------------------------
+//  
+void CSProvider::HandleNotifyPSL( const TUid /*aUid*/, const TInt& /*aKey*/, 
+            const TRequestStatus& /*aStatus*/ )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::HandleNotifyPSL");
+    HandleSIMStatusL();
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::RemoteAlertingToneStatusChanged
+// From MCSPRemoteAlertingToneObserver.
+// Notify all calls about the change. Call is responsible for 
+// notifying observer if the status change was for the call.
+// ---------------------------------------------------------------------------
+// 
+void CSProvider::RemoteAlertingToneStatusChanged(
+    RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::RemoteAlertingToneStatusChanged");
+    for ( TInt i = 0; i < iCallArray->GetCallCount(); i++ )
+        {
+        CSPCall* call = iCallArray->Get( i );
+        if ( call )
+            {
+            call->RemoteAlertingToneStatusChanged( aNewStatus );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::HandleSIMStatusL
+// ---------------------------------------------------------------------------
+//  
+void CSProvider::HandleSIMStatusL()
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::HandleSIMStatusL");
+    if ( !iSsSettingsHandler && iSimStatusListener )
+        {
+        TInt simState( ESimNotReady );
+        TInt err = iSimStatusListener->Get( simState );
+        if ( err == KErrNone && simState == ESimUsable )
+            {
+            iSsSettingsHandler = CSPSsSettingsHandler::NewL( *iSsObserver );
+            }
+        else
+            {
+            CSPLOGSTRING2( CSPERROR, "CSProvider::HandleSIMStatusL, err: %d", err );
+            }    
+        }
+    
+    if ( iSsSettingsHandler && iSimStatusListener )
+        {
+        delete iSimStatusListener;
+        iSimStatusListener = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::IndicateActiveHangup
+// ---------------------------------------------------------------------------
+//  
+TInt CSProvider::IndicateActiveHangup( MCCPCallCommandHandling& aCall )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::IndicateActiveHangup");
+    return iCallCommandHandler->IndicateActiveHangup( aCall );
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::IndicateHangupComplete
+// ---------------------------------------------------------------------------
+//  
+TInt CSProvider::IndicateHangupComplete( MCCPCallCommandHandling& aCall )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::IndicateHangupComplete");
+    return iCallCommandHandler->IndicateHangupComplete( aCall );
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::IndicateDialRequest
+// ---------------------------------------------------------------------------
+//  
+TInt CSProvider::IndicateDialRequest( MCCPCallCommandHandling& aCall )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::IndicateDialRequest");
+    return iCallCommandHandler->IndicateDialRequest( aCall );
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::IndicateAnswerRequest
+// ---------------------------------------------------------------------------
+//  
+TInt CSProvider::IndicateAnswerRequest( MCCPCallCommandHandling& aCall )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::IndicateAnswerRequest");
+    return iCallCommandHandler->IndicateAnswerRequest( aCall );
+    }
+    
+// ---------------------------------------------------------------------------
+// CSProvider::DontReportTerminationError
+// ---------------------------------------------------------------------------
+//  
+TInt CSProvider::DontReportTerminationError()
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::DontReportTerminationError");
+   
+    TInt callCount = iCallArray->GetCallCount();
+    for ( TInt i = 0; i < callCount; i++ )
+        {
+        if ( iCallArray->Get(i)->State() == MCCPCallObserver::ECCPStateConnecting )
+            {
+            iCallArray->Get(i)->DontReportTerminationError();
+            return KErrNone;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// CSProvider::NotifyStateChange
+// ---------------------------------------------------------------------------
+//
+void CSProvider::NotifyStateChange( 
+            MCSPConferenceStatusObserver::TCSPConferenceState aStatus )
+    {
+    CSPLOGSTRING(CSPINT, "CSProvider::NotifyStateChange");
+    
+    if ( !iConferenceCall && 
+         aStatus == MCSPConferenceStatusObserver::ECSPConferenceActive )
+        {
+        TRAPD( err, iConferenceCall = CSPConferenceCall::NewL( 
+                                        iMobilePhone, *iCallArray, iServiceId ) );    
+        if ( KErrNone == err )
+            {
+            CSPLOGSTRING( CSPINT, "CSProvider::NotifyStateChange ext conference created" );
+            iCCPObserver->ConferenceCallCreated( *iConferenceCall );
+            }
+        else 
+            {
+            CSPLOGSTRING2(CSPERROR, "CSProvider::NotifyStateChange \
+                    ext conference creation error %d", err);
+            }
+        }
+   }
+    
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspservicesettingshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class CSPServiceSettingsHandler
+*
+*/
+
+
+// CLASS HEADER
+#include "cspservicesettingshandler.h"
+
+// EXTERNAL INCLUDES
+#include    <spsettings.h>
+#include    <spentry.h>
+
+// INTERNAL INCLUDES
+#include "csplogger.h"
+
+
+_LIT(KLineNameVoice, "CS");
+
+
+
+CSPServiceSettingsHandler* CSPServiceSettingsHandler::NewL( )
+    {
+    CSPServiceSettingsHandler* self 
+            = new ( ELeave ) CSPServiceSettingsHandler( );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPServiceSettingsHandler::~CSPServiceSettingsHandler( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPServiceSettingsHandler::~CSPServiceSettingsHandler()" );
+    }
+
+// ---------------------------------------------------------------------------
+// Finds service ID by name.
+// ---------------------------------------------------------------------------
+//
+void CSPServiceSettingsHandler::FindByNameL( const TDesC& aName, 
+                                            TUint32& aServiceId )
+    {
+    CSPLOGSTRING(CSPINT, "CSPServiceSettingsHandler::FindByNameL()" );
+    CSPLOGSTRING2(CSPINT, "CSPServiceSettingsHandler::FindByNameL() Name=%S", &aName );
+    CSPSettings* settingsApi = CSPSettings::NewLC();
+    RIdArray idArray;
+    CleanupClosePushL( idArray );
+    TInt err = settingsApi->FindServiceIdsL( idArray );
+    
+    TBool found = EFalse;
+    if ( KErrNone == err )
+        {
+        TInt idCount = idArray.Count();
+        if( idCount > 0 )
+            {   
+            
+            for ( TInt i = 0; !found  && i < idCount; i++ )
+                {
+                CSPEntry* entry = CSPEntry::NewLC();
+                TInt ferr = settingsApi->FindEntryL( idArray[i], *entry );            
+                
+                if( ferr == KErrNone 
+                    && aName.Compare( entry->GetServiceName() ) == 0 )
+                    {
+                    aServiceId = idArray[i];
+                    found = ETrue;
+                    }
+                CleanupStack::PopAndDestroy( entry );
+                }            
+            }
+        else
+            {
+            err = KErrNotFound;
+            }
+        }
+    
+    if ( !found )
+        {
+        err = KErrNotFound;
+        }
+    
+    CleanupStack::PopAndDestroy( &idArray );
+    CleanupStack::PopAndDestroy( settingsApi );
+    CSPLOGSTRING3(CSPINT, "CSProvider::FindByNameL() err = %d serv_id = %u", 
+                            err, aServiceId );
+    User::LeaveIfError( err );
+    }
+    
+
+    
+TInt CSPServiceSettingsHandler::ReadCSServiceId( TUint32& aServiceId )
+    {
+    TRAPD( err, FindByNameL( KLineNameVoice, aServiceId ) );
+
+    if ( err )
+        {        
+        CSPLOGSTRING2(CSPINT, 
+            "CSPServiceSettingsHandler::FindByNameL() leave %d", 
+            err );
+        }    
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the requester.
+// ---------------------------------------------------------------------------
+//
+CSPServiceSettingsHandler::CSPServiceSettingsHandler( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPServiceSettingsHandler::CSPServiceSettingsHandler()" );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the requester in the second phase.
+// ---------------------------------------------------------------------------
+//
+void CSPServiceSettingsHandler::ConstructL( ) 
+    {
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspsssettingshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,321 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  implementation of CSPSsSettingsHandler class.
+*
+*/
+
+
+// INCLUDES
+#include "cspsssettingshandler.h"
+#include "csplogger.h"
+#include "csppanic.pan"
+
+#include <etelmm.h>
+#include <mccpssobserver.h>
+
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::CSPSsSettingsHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSPSsSettingsHandler::CSPSsSettingsHandler( const MCCPSsObserver& aObs ) : 
+        iObserver( const_cast<MCCPSsObserver&>(aObs) )
+    {
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::CSPSsSettingsHandler" );
+    } 
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::ConstructL()
+    {
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::ConstructL <" );
+    User::LeaveIfError( iSSSettings.Open() );
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::ConstructL Reg " );
+    TInt errorCode = iSSSettings.Register( ESSSettingsAls, *this );
+    CSPLOGSTRING2( CSPINT, 
+            "CSPSsSettingsHandler::ConstructL > iSSSettings.Register, errorCode: %d",
+            errorCode );
+    if ( errorCode == KErrNotSupported )
+        {
+        CSPLOGSTRING( CSPINT, "CSPSsSettingsHandler::ConstructL, ALS not supported" );
+        }
+    else if ( errorCode == KErrNotReady )
+        {
+        // Try again after idle
+        iRegisterAlsNofify = CIdle::NewL( CActive::EPriorityHigh );
+        RegisterAfterIdle();
+        }    
+      
+    RMobilePhone::TMobilePhoneALSLine alsLine;
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::ConstructL GetALS" );
+    GetALSLineL( alsLine );
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::ConstructL Notify " );
+    iObserver.NotifyCurrentActiveALSLine( (TInt) alsLine );
+       
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::ConstructL >" );
+    } 
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSPSsSettingsHandler* CSPSsSettingsHandler::NewL( const MCCPSsObserver& aObs )
+    {
+    CSPSsSettingsHandler* self = new ( ELeave ) CSPSsSettingsHandler( aObs );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::NewL" );
+    return self;
+    } 
+
+// Destructor
+CSPSsSettingsHandler::~CSPSsSettingsHandler()
+    {
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::~CSPSsSettingsHandler <" );
+    iSSSettings.Close();
+    CSPLOGSTRING( CSPOBJECT, "CSPSsSettingsHandler::~CSPSsSettingsHandler >" );
+    if ( iRegisterAlsNofify )
+        {
+        delete iRegisterAlsNofify;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::GetALSLineL
+// Sends synchronous request to get the ALS line and returns handle to access 
+// the status.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::GetALSLineL(
+        RMobilePhone::TMobilePhoneALSLine& aALSLine )
+    {
+    TInt value;
+    User::LeaveIfError( iSSSettings.Get( ESSSettingsAls, value ) );
+
+    TSSSettingsAlsValue alsValue = 
+        static_cast< TSSSettingsAlsValue > ( value );
+
+    switch( alsValue )
+        {
+        case ESSSettingsAlsNotSupported:
+            aALSLine = RMobilePhone::EAlternateLineNotAvailable;
+            break;
+        case ESSSettingsAlsPrimary: 
+            aALSLine = RMobilePhone::EAlternateLinePrimary;       
+            break;
+        case ESSSettingsAlsAlternate:
+            aALSLine = RMobilePhone::EAlternateLineAuxiliary;
+            break;
+        default:
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::SetALSLineL
+// Sends synchronous request to set the ALS line and returns handle to access 
+// the status.
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::SetALSLineL(
+        RMobilePhone::TMobilePhoneALSLine& aALSLine )
+    {
+    TSSSettingsAlsValue alsValue = 
+        static_cast<TSSSettingsAlsValue> ( aALSLine );
+        
+    switch( aALSLine )
+        {
+        case RMobilePhone::EAlternateLineUnknown:
+        case RMobilePhone::EAlternateLineNotAvailable:
+            alsValue = ESSSettingsAlsNotSupported;
+            break;
+        case RMobilePhone::EAlternateLinePrimary: 
+            alsValue = ESSSettingsAlsPrimary;       
+            break;
+        case RMobilePhone::EAlternateLineAuxiliary:
+            alsValue = ESSSettingsAlsAlternate;
+            break;
+        default:
+            CSPLOGSTRING( CSPINT,
+                "CSPSsSettingsHandler::SetALSLineL: Not valid value" );
+            __ASSERT_DEBUG( EFalse, Panic( ECSPPanicInvalidRequest ) );
+            break;
+        }
+    User::LeaveIfError( iSSSettings.Set( ESSSettingsAls, alsValue ) );
+    } 
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::GetClirL
+// Sends synchronous request to get the CLIR value and returns handle to access 
+// the status.
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::GetClirL(
+        RMobileCall::TMobileCallIdRestriction& aClir )
+    {
+    TInt value;
+    User::LeaveIfError( iSSSettings.Get( ESSSettingsClir, value ) );
+
+    TSSSettingsClirValue clir = 
+        static_cast<TSSSettingsClirValue> ( value );
+    CSPLOGSTRING2( CSPERROR,
+        "CSPSsSettingsHandler::GetClirL, clir: %d", clir );
+        
+    switch( clir )
+        {
+        case ESSSettingsClirNetworkDefault:
+            aClir = RMobileCall::EIdRestrictDefault;
+            break;
+        case ESSSettingsClirExplicitInvoke: 
+            aClir = RMobileCall::EDontSendMyId;
+            break;
+        case ESSSettingsClirExplicitSuppress:
+            aClir = RMobileCall::ESendMyId; 
+            break;
+        default:
+            CSPLOGSTRING2( CSPERROR,
+                "CSPSsSettingsHandler::GetClirL, NOT VALID aClir: %d", aClir );
+            __ASSERT_DEBUG( EFalse, Panic( ECSPPanicInvalidRequest ) );
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::GetCugL
+// Sends synchronous request to get the CUG index and returns handle to access 
+// the status.
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::GetCugL( TInt& aCugIndex )
+    {
+    CSPLOGSTRING2( CSPINT,
+        "CSPSsSettingsHandler::GetCugL, aCugIndex: %d", aCugIndex );
+    User::LeaveIfError( iSSSettings.Get( ESSSettingsCug, aCugIndex ) );
+    }
+    
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::GetDefaultCugL
+// Sends synchronous request to get the default CUG index 
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::GetDefaultCugL( TInt& aDefCug )
+    {
+    User::LeaveIfError( iSSSettings.Get( ESSSettingsDefaultCug, aDefCug ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::IsValueValidCugIndex
+// Sends synchronous request to check the CUG index 
+// -----------------------------------------------------------------------------
+//
+TBool CSPSsSettingsHandler::IsValueValidCugIndex( const TInt& aValue ) const
+    {
+    return iSSSettings.IsValueValidCugIndex( aValue );
+    }
+
+// ---------------------------------------------------------
+// CSPSsSettingsHandler::PhoneSettingChanged
+// ---------------------------------------------------------
+//
+void CSPSsSettingsHandler::PhoneSettingChanged( 
+        TSSSettingsSetting aSetting, 
+        TInt aNewValue )
+    {
+    CSPLOGSTRING2( CSPINT,
+        "CSPSsSettingsHandler::PhoneSettingChanged, aNewValue : %d",
+        aNewValue );
+    if ( aSetting == ESSSettingsAls )
+        {
+        TSSSettingsAlsValue alsValue = 
+            static_cast< TSSSettingsAlsValue > ( aNewValue );
+    
+        RMobilePhone::TMobilePhoneALSLine 
+            alsLine( RMobilePhone::EAlternateLineUnknown );
+
+        switch( alsValue )
+            {
+            case ESSSettingsAlsNotSupported:
+                alsLine = RMobilePhone::EAlternateLineNotAvailable;
+                break;
+            case ESSSettingsAlsPrimary: 
+                alsLine = RMobilePhone::EAlternateLinePrimary;       
+                break;
+            case ESSSettingsAlsAlternate:
+                alsLine = RMobilePhone::EAlternateLineAuxiliary;
+                break;
+            default:
+                break;
+            }
+        
+        iObserver.NotifyCurrentActiveALSLine( (TInt) alsLine );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSsSettingsHandler::RegisterAfterIdle
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::RegisterAfterIdle()
+    {
+    CSPLOGSTRING( CSPINT, "CSPSsSettingsHandler::RegisterAfterIdle" );
+    if ( !iRegisterAlsNofify->IsActive() )
+        {
+        CSPLOGSTRING( CSPINT, "CSPSsSettingsHandler::RegisterAfterIdle > iRegisterAlsNofify->Star" );
+        iRegisterAlsNofify->Start( 
+            TCallBack( CIdleCallBack, this ) );
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSProvider::CIdleCallBack
+// -----------------------------------------------------------------------------
+//
+TInt CSPSsSettingsHandler::CIdleCallBack( TAny* aAny )
+    {
+    CSPLOGSTRING( CSPINT, "CSPSsSettingsHandler::CIdleCallBack" );
+    static_cast< CSPSsSettingsHandler* >( aAny )->Register();
+
+    return KErrNone;    
+    }   
+
+// -----------------------------------------------------------------------------
+// CSProvider::Register
+// -----------------------------------------------------------------------------
+//
+void CSPSsSettingsHandler::Register()
+    {
+    CSPLOGSTRING( CSPINT, "CSPSsSettingsHandler::Register" );
+    TInt errorCode( KErrNotReady );
+    
+    errorCode = iSSSettings.Register( ESSSettingsAls, *this );
+    CSPLOGSTRING2( CSPINT, 
+        "CSPSsSettingsHandler::Register > iSSSettings.Register, errorCode: %d",
+        errorCode );
+
+    if ( errorCode == KErrNotReady )
+        {
+        // Try again
+        RegisterAfterIdle();
+        }
+    }  
+
+//  End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspsupplementaryservicesmonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the implementation of CSPSupplementaryServicesMonitor class 
+*                member functions.
+*
+*/
+
+
+
+#include "cspsupplementaryservicesmonitor.h"
+#include "csprovider.h"
+#include "csplogger.h"
+
+
+// -----------------------------------------------------------------------------
+// CSPSupplementaryServicesMonitor::CSPSupplementaryServicesMonitor
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSPSupplementaryServicesMonitor::CSPSupplementaryServicesMonitor
+        ( 
+        CSProvider& aOwner,     
+        RMmCustomAPI& aCustomAPI        
+        ) : CActive( EPriorityStandard ),
+            iOwner( aOwner ),           
+            iCustomAPI( aCustomAPI )
+    {
+    CSPLOGSTRING( CSPOBJECT, 
+        "CSPSupplementaryServicesMonitor::CSPSupplementaryServicesMonitor: complete" );
+    CActiveScheduler::Add( this );
+    }
+
+// Destructor
+CSPSupplementaryServicesMonitor::~CSPSupplementaryServicesMonitor()
+    {
+    Cancel();
+    CSPLOGSTRING( CSPOBJECT,
+        "CALL CSPSupplementaryServicesMonitor::~CSPSupplementaryServicesMonitor: Complete." );
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSupplementaryServicesMonitor::StartMonitoring
+// Starts supplementary services monitoring
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CSPSupplementaryServicesMonitor::StartMonitoring()
+    {
+    if ( !IsActive() )
+        {
+        CSPLOGSTRING( CSPREQOUT, 
+            "CALL CSPSupplementaryServicesMonitor::StartMonitoring: RMMCustomAPI::NotifySsNetworkEvent() called" );
+        iCustomAPI.NotifySsNetworkEvent( iStatus, iSsTypeAndMode, iSsInfo );
+        SetActive();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CALL CSPSupplementaryServicesMonitor::StartMonitoring: Already active" );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSupplementaryServicesMonitor::DoCancel
+// Cancels active object requests
+// Method calls CancelAsyncRequest from the CustomaEtel object
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CSPSupplementaryServicesMonitor::DoCancel()
+    {
+    iCustomAPI.CancelAsyncRequest( ECustomNotifySsNetworkEventIPC );
+    CSPLOGSTRING( CSPINT, 
+        "CALL CSPSupplementaryServicesMonitor::DoCancel: \
+        RMMCustomAPI::CancelAsyncRequest( ECustomNotifySsRequestCompleteIPC ) called" );
+    }
+
+// -----------------------------------------------------------------------------
+// CSPSupplementaryServicesMonitor::RunL
+// CMethod gets notification from etel that asyncronous request is completed.
+// -----------------------------------------------------------------------------
+//
+void CSPSupplementaryServicesMonitor::RunL()
+    {
+    CSPLOGSTRING( CSPINT, "CSPSupplementaryServicesMonitor::RunL" );
+    if ( iStatus == KErrNone )
+       {
+       CSPLOGSTRING2( CSPINT, 
+           "CSPSupplementaryServicesMonitor::RunL: iSsTypeAndMode.iSsType: %d",
+           iSsTypeAndMode.iSsType );
+        
+       iOwner.NotifySsEvent( iSsTypeAndMode, iSsInfo );
+       StartMonitoring();
+       }
+    }
+
+// End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/csptimer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Timer service
+*
+*/
+
+#include "csptimer.h"
+#include "mcsptimerobserver.h"
+#include "csppanic.pan"
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CSPTimer* CSPTimer::NewL()
+    {
+    CSPTimer* self = CSPTimer::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CSPTimer* CSPTimer::NewLC()
+    {
+    CSPTimer* self = new( ELeave ) CSPTimer;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CSPTimer::~CSPTimer()
+    {
+    Cancel(); 
+    }
+
+// ---------------------------------------------------------------------------
+// Starts notify request
+// ---------------------------------------------------------------------------
+//
+void CSPTimer::NotifyAfter( TInt aTimeout, 
+        MCSPTimerObserver& aTimerObserver )
+    {
+    __ASSERT_ALWAYS( !IsNotifyOngoing(), Panic( ECSPPanicTimerAlreadyActive ) );
+    After( aTimeout );
+    iObserver = &aTimerObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// Cancels the outstancing request.
+// ---------------------------------------------------------------------------
+//
+void CSPTimer::CancelNotify()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Determines if there is active request outstanding.
+// ---------------------------------------------------------------------------
+//
+TBool CSPTimer::IsNotifyOngoing()
+    {
+    return IsActive();
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// Notifies the observer about request.
+// ---------------------------------------------------------------------------
+//
+void CSPTimer::RunL()
+    {
+    if( iObserver ) 
+        {
+        iObserver->TimerEvent();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CSPTimer::CSPTimer() : 
+    CTimer( CActive::EPriorityStandard )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CSPTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/csptransferprovider.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,281 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class CSPTransferProvider
+*
+*/
+
+
+#include <mccptransferprovider.h>
+#include <mccptransferobserver.h>
+#include <etelmm.h>
+#include <exterror.h>
+#include <mccpcall.h>
+
+#include "csptransferprovider.h"
+#include "csplogger.h"
+#include "mcspcallerrorobserver.h"
+#include "mcspcommoninfo.h"
+
+
+// ---------------------------------------------------------------------------
+// Two phased construction
+// ---------------------------------------------------------------------------
+//
+CSPTransferProvider* CSPTransferProvider::NewL ( 
+    RMobileCall& aCall, 
+    MCSPCallErrorObserver& aErrorObserver,
+    MCSPCommonInfo& aCommonInfo )
+    {
+    CSPTransferProvider* self = 
+        new ( ELeave ) CSPTransferProvider( aCall, aErrorObserver, aCommonInfo );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPTransferProvider::~CSPTransferProvider()
+    {
+    Cancel();
+    iObservers.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Transfers the call. CCE maps CS Transfer() to this method.
+// (UnattendedTransfer and others are VoIP features)
+// ---------------------------------------------------------------------------
+//  
+TInt CSPTransferProvider::AttendedTransfer( MCCPCall& aTransferTargetCall )
+    {
+    TInt err ( KErrNone );
+    
+    if ( !IsActive() )
+        {    
+        if ( iCall.SubSessionHandle() != 0 )
+            {
+            err = KErrNone;
+            // send async request to Etel
+            iCall.Transfer( iStatus );
+            SetActive();
+            if( aTransferTargetCall.State() == MCCPCallObserver::ECCPStateConnecting )
+                {
+                iCommonInfo.DontReportTerminationError();
+                }
+            }
+        else
+            {
+            // transfer not allowed
+            err = KErrNotSupported;
+            }
+         }
+    else
+        {
+        err = KErrInUse;
+        }
+    CSPLOGSTRING2( CSPREQOUT, 
+         "CSPTransferProvider::AttendedTransfer: err: %d", err );
+    // return error value
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Transfers the call. CCE maps CS Transfer() to this method.
+// (UnattendedTransfer and others are VoIP features)
+// ---------------------------------------------------------------------------
+//  
+TInt CSPTransferProvider::AttendedTransfer( const TDesC& /*aTransferTarget*/ )
+    {
+    TInt err ( KErrNone );
+    
+    if ( !IsActive() )
+        {    
+        if ( iCall.SubSessionHandle() != 0 )
+            {
+            err = KErrNone;
+            // send async request to Etel
+            iCall.Transfer( iStatus );
+            SetActive();
+            }
+        else
+            {
+            // transfer not allowed
+            err = KErrNotSupported;
+            }
+         }
+    else
+        {
+        err = KErrInUse;
+        }
+    CSPLOGSTRING2( CSPREQOUT, 
+         "CSPTransferProvider::AttendedTransfer: err: %d", err );
+    // return error value
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Not supported by CS Plug-in. This is a VoIP feature
+// ---------------------------------------------------------------------------
+//  
+TInt CSPTransferProvider::UnattendedTransfer( const TDesC& /*aTransferTarget*/ )
+    {
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------------------------
+// Not supported by CS Plug-in. This is a VoIP feature
+// ---------------------------------------------------------------------------
+//  
+TInt CSPTransferProvider::AcceptTransfer( const TBool /*aAccept*/ )
+    {
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------------------------
+// Not supported by CS Plug-in. This is a VoIP feature
+// ---------------------------------------------------------------------------
+//
+const TDesC& CSPTransferProvider::TransferTarget() const
+    {
+    return KNullDesC;
+    }
+
+// ---------------------------------------------------------------------------
+// Notify observers about an occurred transfer event
+// ---------------------------------------------------------------------------
+//
+void CSPTransferProvider::TransferEventOccurred( 
+                 const MCCPTransferObserver::TCCPTransferEvent aEvent )
+    {
+    CSPLOGSTRING2( CSPREQOUT, 
+        "CSPTransferProvider::TransferEventOccurred: event: %d", aEvent );
+
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        MCCPTransferObserver *obs = iObservers[i];
+        if ( obs )
+            {        
+            iObservers[i]->TransferEventOccurred( aEvent );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Adds observer to array
+// ---------------------------------------------------------------------------
+//
+void CSPTransferProvider::AddObserverL( const MCCPTransferObserver& aObserver )
+    {
+    if ( iObservers.Find( &aObserver ) == KErrNotFound )
+        {
+        iObservers.Append( &aObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Removes observer from array
+// ---------------------------------------------------------------------------
+//
+TInt CSPTransferProvider::RemoveObserver( const MCCPTransferObserver& aObserver )
+    {
+    TInt found = iObservers.Find( &aObserver );
+    if ( found != KErrNotFound )
+        {
+        iObservers.Remove( found );
+        return KErrNone;
+        }
+    return found;
+    }
+
+// ---------------------------------------------------------------------------
+// From CActive.
+// Handles request completion.
+// ---------------------------------------------------------------------------
+//
+void CSPTransferProvider::RunL()
+    {
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPTransferProvider::RunL: status: %d", iStatus.Int() );
+    
+    if ( iStatus == KErrNone )
+        {
+        MCCPTransferObserver::TCCPTransferEvent event = 
+            MCCPTransferObserver::ECCPLocalTransfer;
+        TransferEventOccurred( event );
+        }
+    else
+        {
+        CSPLOGSTRING2( CSPERROR, "CSPTransferProvider::RunL: Error \
+                     %d", iStatus.Int() );
+
+        TInt error = iStatus.Int();
+        if ( error == KErrGsmCCFacilityRejected )
+            {
+            iErrorObserver.NotifyErrorOccurred( ECCPErrorRejected );
+            }
+        else if( error != KErrCancel )
+            {
+            iErrorObserver.NotifyErrorOccurred( ECCPTransferFailed );
+            }
+        }
+    
+    CSPLOGSTRING( CSPREQEND, "CSPTransferProvider::RunL End of RunL." );
+    }
+    
+// ---------------------------------------------------------------------------
+// Cancels the pending async request
+// ---------------------------------------------------------------------------
+//
+void CSPTransferProvider::DoCancel()
+    {
+    if ( iStatus == KRequestPending )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPTransferProvider::DoCancel Canceling pending request.." );
+        // cancel request
+        iCall.CancelAsyncRequest( EMobileCallTransfer );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Default C++ constructor
+// ---------------------------------------------------------------------------
+//
+CSPTransferProvider::CSPTransferProvider( 
+    RMobileCall& aCall, 
+    MCSPCallErrorObserver& aErrorObserver,
+    MCSPCommonInfo& aCommonInfo )
+    : CActive( EPriorityStandard ),
+      iCall (aCall),
+      iErrorObserver( aErrorObserver ),
+      iCommonInfo( aCommonInfo )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPTransferProvider::CSPTransferProvider()" );
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructing 2nd phase
+// ---------------------------------------------------------------------------
+//
+void CSPTransferProvider::ConstructL()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPTransferProvider::ConstructL()" );
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspuuimessagesender.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Sends UUI message.
+*
+*/
+
+
+#include "cspuuimessagesender.h"
+#include "csplogger.h"
+ 
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CSPUUIMessageSender::CSPUUIMessageSender(
+    RMobileCall& aCall ) : 
+    CActive( CActive::EPriorityStandard ),
+    iCall( aCall ),
+    iUUSRequestPckg( iUUSRequest )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMessageSender::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CSPUUIMessageSender* CSPUUIMessageSender::NewL(
+    RMobileCall& aCall )
+    {
+    CSPUUIMessageSender* self = 
+        new( ELeave ) CSPUUIMessageSender( aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CSPUUIMessageSender::~CSPUUIMessageSender()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Sends the UUI message.
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMessageSender::SendUUIMessage( const TDesC& aMessage )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPUUIMessageSender::SendUUIMessage start");
+    Cancel();
+    iUUSRequest.iServiceReq = RMobileCall::KUUS1Implicit;
+    iUUSRequest.iUUI = aMessage;
+    iCall.ActivateUUS( iStatus, iUUSRequestPckg );
+    SetActive();    
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// Cancels the outstanding request.
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMessageSender::DoCancel()
+    {
+    iCall.CancelAsyncRequest( EMobileCallActivateUUS );
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// No need to react the completion. The message is sent or not.
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMessageSender::RunL()
+    {
+    CSPLOGSTRING2(CSPINT, "CSPUUIMessageSender::RunL %d iStatus", iStatus.Int() );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspuuimonitor.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Monitor UUI messages.
+*
+*/
+
+#include "csplogger.h"
+#include "cspuuimonitor.h"
+#include "mcspuusmessageobserver.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CSPUUIMonitor::CSPUUIMonitor(
+    RMobileCall& aCall, 
+    MCSPUUSMessageObserver& aUUIHandler ) 
+    : CActive( CActive::EPriorityStandard ),
+    iCall( aCall ),
+    iObserver( aUUIHandler )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMonitor::ConstructL()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+CSPUUIMonitor* CSPUUIMonitor::NewL(
+    RMobileCall& aCall,
+    MCSPUUSMessageObserver& aUUIHandler )
+    {
+    CSPUUIMonitor* self = 
+        new( ELeave ) CSPUUIMonitor( aCall, aUUIHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CSPUUIMonitor::~CSPUUIMonitor()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts monitoring the UUI messages.
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMonitor::StartMonitor()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPUUIMonitor::StartMonitor");
+    Cancel();
+    iCall.ReceiveUUI( iStatus, iUUI ); 
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// Cancels out standign request
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMonitor::DoCancel()
+    {
+    iCall.CancelAsyncRequest( EMobileCallReceiveUUI ) ;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CActive
+// Notifies observer.
+// ---------------------------------------------------------------------------
+//
+void CSPUUIMonitor::RunL()
+    {
+    CSPLOGSTRING2(CSPINT, "CSPUUIMonitor::RunL %d iStatus", iStatus.Int() );
+    if( iStatus == KErrNone )
+        {
+        iObserver.UUSMessageReceived( iUUI );
+        StartMonitor();
+        }
+    else if( iStatus != KErrNotSupported )
+        {
+        StartMonitor();
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspvideocall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,372 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements class CSPVideoCall which provides video call 
+*                functionality
+*
+*/
+
+
+#include <etelmm.h>
+#include <etel.h>
+#include <mccpcallobserver.h>
+#include <rmmcustomapi.h>
+
+#include "cspvideocall.h"
+#include "cspetelcallrequester.h"
+#include "cspetelcalleventmonitor.h"
+#include "cspetelcallstatusmonitor.h"
+#include "cspetelvideocallcapsmonitor.h"
+#include "csplogger.h"
+#include "csppanic.pan"
+#include "cspconsts.h"
+#include "mcspcommoninfo.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::NewL Two phased construction.
+// ---------------------------------------------------------------------------
+//
+CSPVideoCall* CSPVideoCall::NewL( const TDesC& aName, 
+                          RMobileLine& aLine, TBool aMobileOriginated, 
+                          const CCCECallParameters& aParams,
+                          MCSPCommonInfo& aCommonInfo )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::NewL <");
+    
+    CSPVideoCall* self = new (ELeave) CSPVideoCall( aLine, aMobileOriginated,
+                                            aName, aCommonInfo );
+    CleanupStack::PushL( self );    
+    self->ConstructL(  aParams );
+    CleanupStack::Pop( self );
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::NewL >");
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPVideoCall::~CSPVideoCall
+// ---------------------------------------------------------------------------
+//
+CSPVideoCall::~CSPVideoCall()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::~CSPVideoCall <");
+    // Stop monitoring events    
+    delete iConnectionHandler;
+    delete iVideoCallCapsMonitor;
+
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::~CSPVideoCall >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::NotifyCallStateChanged
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPVideoCall::NotifyCallStateChanged(
+            MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING2(CSPINT, "CSPVideoCall::NotifyCallStateChanged %d", aState);
+
+    TInt errorCode( KErrNone );
+    iNextCallState = aState;
+
+    if ( aState == MCCPCallObserver::ECCPStateConnected &&
+            iParams->CallType() == CCPCall::ECallTypeVideo  &&  
+             !iConnectionHandler->ConnectionInitialized() )
+        {
+        // When connected message is received, call object must first open
+        // the socket connection and loan data port
+        CSPLOGSTRING(CSPINT, 
+            "CSPVideoCall::NotifyCallStateChanged initializing connection");
+        errorCode = iConnectionHandler->InitializeConnection();
+        
+        __ASSERT_ALWAYS( errorCode == KErrNone, 
+                         Panic( ECSPPanicDataConnectionInitError ) );
+        }
+    else if ( aState == MCCPCallObserver::ECCPStateIdle && 
+            iParams->CallType() == CCPCall::ECallTypeVideo )
+        {
+        // When idle message is received one can close the 
+        // socket connections.
+        CSPLOGSTRING(CSPINT,
+            "CSPVideoCall::NotifyCallStateChanged releasing connection");
+        iConnectionHandler->ReleaseConnection();
+        }
+    
+    // Connected notify is not sent for video call before connection has    
+    // been initialized.  
+    if ( aState == MCCPCallObserver::ECCPStateConnected &&
+         iParams->CallType() == CCPCall::ECallTypeVideo &&    
+         !iConnectionHandler->ConnectionInitialized() ) 
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPVideoCall::NotifyCallStateChanged connection not initialized");
+        }
+    else 
+        {
+        CSPLOGSTRING(CSPINT, 
+            "CSPVideoCall::NotifyCallStateChanged notifying state change");
+        CSPCall::NotifyCallStateChanged( aState );
+        }
+
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPVideoCall::NotifyCallStateChangedWithInband
+// Notifies observers about state changes
+// ---------------------------------------------------------------------------
+//
+void CSPVideoCall::NotifyCallStateChangedWithInband(
+            MCCPCallObserver::TCCPCallState aState ) 
+    {
+    CSPLOGSTRING2(CSPINT, 
+        "CSPVideoCall::NotifyCallStateChangedWithInband %d", aState);
+    iNextCallState = aState;
+
+    CSPCall::NotifyCallStateChangedWithInband( aState );        
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::ConnectionReady
+// ---------------------------------------------------------------------------
+//
+void CSPVideoCall::ConnectionReady( TName aDataPortName )
+    {
+    CSPLOGSTRING3(CSPINT, "CSPVideoCall::ConnectionReady \
+        state = %d, next state: %d", iCallState, iNextCallState);
+        
+    // If still connecting 
+    if ( iNextCallState == MCCPCallObserver::ECCPStateConnected )
+        {
+        NotifyCallEventOccurred(  MCCPCallObserver::ECCPCSDataPortLoaned );        
+        NotifyCallStateChanged( iNextCallState );
+        iCommonInfo.NotifyDataPortName( aDataPortName );
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::ConnectionEstablishingFailed
+// ---------------------------------------------------------------------------
+//    
+void CSPVideoCall::ConnectionEstablishingFailed(TInt /*aErr*/)
+    {
+    CSPLOGSTRING(CSPERROR, "CSPVideoCall::ConnectionEstablishingFailed");
+    CSPCall::NotifyErrorOccurred( ECCPErrorVideoCallSetupFailed );
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::VideoCallCapsChanged
+// Receives data call caps changed notification from Etel data call caps monitor 
+// ---------------------------------------------------------------------------
+//       
+void CSPVideoCall::DataCallCapsChanged( RMobileCall::TMobileCallDataCapsV1& aCaps )
+    {
+    CSPLOGSTRING(CSPINT, "CSPVideoCall::DataCallCapsChanged");
+    if ( aCaps.iProtocolCaps == RMobileCall::KCapsIsdnMultimedia )
+        {
+        CSPLOGSTRING(CSPINT, "CSPVideoCall::DataCallCapsChanged type=video");
+        iParams->SetCallType( CCPCall::ECallTypeVideo );
+        }
+    else
+        { 
+        CSPLOGSTRING(CSPINT, "CSPVideoCall::DataCallCapsChanged type=voice");
+        iParams->SetCallType( CCPCall::ECallTypeCSVoice  );
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Branches dial requests according to the flag.
+// ---------------------------------------------------------------------------
+//
+TInt CSPVideoCall::DialFdnCond( TBool aFdnCheck )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVideoCall::DialFdnCond <");
+    TInt err(KErrNone);
+
+    SetDefaultCallParameters();
+    
+    // Update internal call params
+    iCommonInfo.InitializeDataCallParameters( iDataCallParams );
+
+    // Set the call state to dialling    
+    if ( iCall.SubSessionHandle() )
+        {        
+        CSPLOGSTRING(CSPINT, "CSPVideoCall::DialFdnCond make request");
+        if ( aFdnCheck )
+            {
+            err = iRequester->MakeDialRequest( 
+                                iDataCallParamsPckg, iRemotePartyNumber );
+            }
+        else
+            {
+            err = iRequester->MakeDialNoFdnCheckRequest( 
+                                iDataCallParamsPckg, iRemotePartyNumber );
+            }
+
+        if ( err != KErrNone )
+            {
+            CSPLOGSTRING2(CSPERROR, 
+                "CSPVideoCall::DialFdnCond ERROR with Dial request: %d", err );
+            }
+        } 
+    else
+        {
+        CSPLOGSTRING2(CSPERROR, "CSPVideoCall::DialFdnCond() ERROR with iCall session: %d", &iCall );
+        err = KErrGeneral;
+        }
+    
+    CSPLOGSTRING(CSPINT, "CSPVideoCall::DialFdnCond() >");
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPVideoCall::SwitchAlternatingCall
+// ---------------------------------------------------------------------------
+//
+TInt CSPVideoCall::SwitchAlternatingCall()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVideoCall::GetMobileCallInfo");
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPVideoCall::GetMobileDataCallCaps
+// ---------------------------------------------------------------------------
+//
+TInt CSPVideoCall::GetMobileDataCallCaps( TDes8& aCaps ) const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVideoCall::GetMobileDataCallCaps");
+    return iVideoCallCapsMonitor->GetMobileDataCallCaps( aCaps );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPVideoCall::IsSecured
+// ---------------------------------------------------------------------------
+//
+TBool CSPVideoCall::IsSecured() const
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVideoCall::IsSecured");
+    return CSPCall::IsSecured();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::CSPVideoCall
+// ---------------------------------------------------------------------------
+//
+CSPVideoCall::CSPVideoCall( RMobileLine& aLine, 
+                  TBool aMobileOriginated,
+                  const TDesC& aName,
+                  MCSPCommonInfo& aCommonInfo ) : 
+                     CSPCall( aLine, aMobileOriginated, aName,
+                              aCommonInfo, EFalse ),
+                     iDataCallParams(),
+                     iDataCallParamsPckg (iDataCallParams)
+                     
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::CSPVideoCall");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::ConstructL
+// Constructing CSPVideoCall for MT call.
+// ---------------------------------------------------------------------------
+//    
+void CSPVideoCall::ConstructL( const CCCECallParameters& aParams )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::ConstructL <");
+
+    CSPCall::ConstructL( aParams );
+    
+    iConnectionHandler = CSPVideoCallConnectionHandler::NewL( *this, iCall );    
+    iVideoCallCapsMonitor = CSPEtelVideoCallCapsMonitor::NewL( *this, iCall );
+    iVideoCallCapsMonitor->StartMonitoring();
+    
+    // Update call type info only for MT call. 
+    if ( !iMobileOriginated ) 
+        {
+        CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::ConstructL() selecting call type for MT call");
+        CCPCall::TCallType callType = SelectCallTypeFromProtocolCaps(); 
+        iParams->SetCallType( callType );
+        }    
+        
+    // Filter out illegal requests    
+     if ( !CCPCall::ECallTypeVideo == iParams->CallType() )
+        {
+        CSPLOGSTRING(CSPERROR, "CSPVideoCall::ConstructL() error invalid call type");
+        User::Leave( KErrArgument );
+        }
+
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCall::ConstructL >");
+    }
+
+// -----------------------------------------------------------------------------
+// Set default call parameters.
+// -----------------------------------------------------------------------------
+//
+void CSPVideoCall::SetDefaultCallParameters() 
+    {
+    // Set common call default parameters
+    iDataCallParams.iSpeakerControl = RMobileCall::EMonitorSpeakerControlAlwaysOn;
+    iDataCallParams.iSpeakerVolume = RMobileCall::EMonitorSpeakerVolumeMedium;
+    iDataCallParams.iInterval = KCSPDefaultInterval;
+    iDataCallParams.iWaitForDialTone = RMobileCall::EDialToneNoWait;
+    iDataCallParams.iIdRestrict = RMobileCall::EIdRestrictDefault;
+    iDataCallParams.iAutoRedial = KCSPDefaultAutoRedial;  
+    // Set video call parameters
+    iDataCallParams.iService                = RMobileCall::EServiceDataCircuitSync;
+    iDataCallParams.iSpeed                  = RMobileCall::ESpeed64000;
+    iDataCallParams.iProtocol               = RMobileCall::EProtocolIsdnMultimedia;
+    iDataCallParams.iQoS                    = RMobileCall::EQoSTransparent;
+    iDataCallParams.iRLPVersion             = RMobileCall::ERLPNotRequested; 
+    iDataCallParams.iModemToMSWindowSize    = 0x00; 
+    iDataCallParams.iMSToModemWindowSize    = 0x00; 
+    iDataCallParams.iAckTimer               = 0x00; 
+    iDataCallParams.iRetransmissionAttempts = 0x00; 
+    iDataCallParams.iResequencingPeriod     = 0x00; 
+    iDataCallParams.iV42bisReq              = RMobileCall::EV42bisNeitherDirection; 
+    iDataCallParams.iV42bisCodewordsNum     = 0x00; 
+    iDataCallParams.iV42bisMaxStringLength  = 0x00; 
+    iDataCallParams.iUseEdge                = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCall::SelectCallTypeFromProtocolCaps
+// ---------------------------------------------------------------------------
+//
+CCPCall::TCallType CSPVideoCall::SelectCallTypeFromProtocolCaps() 
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVideoCall::SelectCallTypeFromProtocolCaps <");
+
+    iVideoCallCapsMonitor->UpdateProtocolCaps();
+    TUint protocolCaps = iVideoCallCapsMonitor->GetProtocolCaps();    
+    CCPCall::TCallType callType;
+    
+    if ( protocolCaps == RMobileCall::KCapsIsdnMultimedia )
+        {
+        callType = CCPCall::ECallTypeVideo;
+        }
+    else 
+        {
+        callType = CCPCall::ECallTypeCSVoice;
+        }
+    CSPLOGSTRING2(CSPINT, "CSPVideoCall::SelectCallTypeFromProtocolCaps >\
+         call type: %d", callType );
+
+    return callType; 
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspvideocallconnectionhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,236 @@
+/*
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Contains the implementation of class CSPDataCallConnectionHandler
+*
+*/
+
+
+#include <etelmm.h>
+#include <mccpcallobserver.h>
+#include <e32property.h>
+
+#include "cspvideocallconnectionhandler.h"
+#include "cspvideocall.h"
+#include "csplogger.h"
+#include "cspconsts.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructs the connection handler via two phased constructing.
+// ---------------------------------------------------------------------------
+//
+CSPVideoCallConnectionHandler* CSPVideoCallConnectionHandler::NewL(
+            CSPVideoCall& aObserver,
+            RMobileCall& aCall ) 
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPDataCallConnectionHandler::NewL()" );
+    CSPVideoCallConnectionHandler* self = new (ELeave) CSPVideoCallConnectionHandler( 
+                                        aObserver, aCall );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor of the object.
+// ---------------------------------------------------------------------------
+//
+CSPVideoCallConnectionHandler::~CSPVideoCallConnectionHandler( )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCallConnectionHandler::~CSPDataCallConnectionHandler()" );
+    ReleaseConnection();
+    Cancel();
+    CloseConnection();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCallConnectionHandler::InitializeConnection
+// ---------------------------------------------------------------------------
+//
+TInt CSPVideoCallConnectionHandler::InitializeConnection( )
+    {    
+    TInt err = CreateSocketConnection();
+    if ( !err )
+        {        
+        err = LoanDataPort();
+        }    
+    
+    CSPLOGSTRING2(CSPOBJECT, 
+        "CSPVideoCallConnectionHandler::InitializeConnection err=%i", err );
+        
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPVideoCallConnectionHandler::ReleaseConnection
+// ---------------------------------------------------------------------------
+//
+TInt CSPVideoCallConnectionHandler::ReleaseConnection( )
+    {    
+    CloseConnection();
+    TInt err = iCall.RecoverDataPort();
+    CSPLOGSTRING2(CSPOBJECT, 
+        "CSPVideoCallConnectionHandler::ReleaseConnection err=%i", err );
+    iConnectionInitialized = EFalse;
+
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPVideoCallConnectionHandler::InitializeConnection
+// ---------------------------------------------------------------------------
+//
+TBool CSPVideoCallConnectionHandler::ConnectionInitialized( )
+    {
+    return iConnectionInitialized;
+    }
+
+// -----------------------------------------------------------------------------
+// Creates socket connection.
+// Enumerates connections and save Access Point Name of CSD connection.
+// -----------------------------------------------------------------------------
+//
+TInt CSPVideoCallConnectionHandler::CreateSocketConnection()
+    {
+    CSPLOGSTRING( CSPINT, "CSPVideoCallConnectionHandler::CreateSocketConnection() start");
+    // Socket server connection to get Access Point Name
+    TInt errorCode = iSocketServer.Connect();
+    CSPLOGSTRING2( CSPREQOUT,
+      "CSPVideoCallConnectionHandler::CreateSocketConnection: RSocketServ::Connect, error code: %d",
+       errorCode );
+      
+    if ( KErrNone == errorCode )
+        {
+        errorCode = iConnection.Open( iSocketServer );
+        CSPLOGSTRING2( CSPREQOUT,
+         "CSPVideoCallConnectionHandler::CreateSocketConnection: RConnection::Open, errorcode: %d",
+           errorCode );
+        if ( errorCode )
+            {
+            iSocketServer.Close();
+            }
+        }
+    return errorCode;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCallConnectionHandler::LoanDataPort
+// ---------------------------------------------------------------------------
+//
+TInt CSPVideoCallConnectionHandler::LoanDataPort( )
+    {
+    CSPLOGSTRING(CSPINT, "CSPVideoCallConnectionHandler::LoanDataPort");
+    TInt ret( KErrNone ); 
+    if ( !IsActive() )
+        {
+        SetActive();
+        iCall.LoanDataPort( iStatus, iCommPort );    
+        }
+    else
+        {
+        ret = KErrInUse;
+        CSPLOGSTRING2(CSPERROR, 
+            "CSPVideoCallConnectionHandler::LoanDataPort Error!: %d", 
+            ret);
+        }
+    
+    return ret; 
+    }
+
+// -----------------------------------------------------------------------------
+// Close Socket Server connection, when the call is on Idle state.
+// -----------------------------------------------------------------------------
+//
+void CSPVideoCallConnectionHandler::CloseConnection()
+    {
+    CSPLOGSTRING( CSPINT, "CSPVideoCallConnectionHandler::CloseConnection" );
+    iConnection.Close();
+    iSocketServer.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCallConnectionHandler::RunL
+// ---------------------------------------------------------------------------
+//
+void CSPVideoCallConnectionHandler::RunL()
+    {
+    // from CActive
+    CSPLOGSTRING2( CSPREQEND, 
+        "CSPVideoCallConnectionHandler::RunL: status: %d", iStatus.Int() );
+    
+    if ( iStatus == KErrNone )
+        {
+        CSPLOGSTRING( CSPINT, 
+            "CSPVideoCallConnectionHandler::RunL: LoanDataPort request OK" );
+        iConnectionInitialized = ETrue;
+        iObserver.ConnectionReady( iCommPort.iPort );        
+        }
+    else
+        {
+        // Error situations         
+        TInt err = iStatus.Int();
+        CSPLOGSTRING2( CSPERROR, "CSPVideoCallConnectionHandler::RunL: request \
+                                completed with error: %d", err );
+
+        iObserver.ConnectionEstablishingFailed( err );        
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVideoCallConnectionHandler::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CSPVideoCallConnectionHandler::DoCancel()
+    {
+    CSPLOGSTRING( CSPREQOUT, "CSPVideoCallConnectionHandler::DoCancel" );
+    if ( IsActive() )
+        {
+        iCall.LoanDataPortCancel();
+        }
+    else
+        {
+        CSPLOGSTRING( CSPERROR, 
+            "CSPVideoCallConnectionHandler::DoCancel: Already active" );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the requester.
+// ---------------------------------------------------------------------------
+//
+CSPVideoCallConnectionHandler::CSPVideoCallConnectionHandler(
+            CSPVideoCall& aObserver,
+            RMobileCall& aCall ) : 
+                CActive( EPriorityStandard ), 
+                iObserver( aObserver ), 
+                iCall( aCall ), 
+                iConnectionInitialized( EFalse )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVideoCallConnectionHandler::CSPVideoCallConnectionHandler" );
+    CActiveScheduler::Add( this );
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructing in the second phase.
+// ---------------------------------------------------------------------------
+//
+void CSPVideoCallConnectionHandler::ConstructL()
+    {
+    // Empty implementation 
+    }
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/cspvoicecall.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements class CSPVoiceCall which provides call functionality
+*
+*/
+
+
+#include <etelmm.h>
+#include <etel.h>
+#include <mccpcallobserver.h>
+#include <cccecallparameters.h>
+
+#include "cspvoicecall.h"
+#include "cspetelcallrequester.h"
+#include "cspetelcalleventmonitor.h"
+#include "cspetelcallstatusmonitor.h"
+#include "csplogger.h"
+#include "csppanic.pan"
+#include "cspconsts.h"
+#include "mcspcommoninfo.h"
+
+
+// ---------------------------------------------------------------------------
+// CSPVoiceCall::NewL Two phased construction.
+// ---------------------------------------------------------------------------
+//
+CSPVoiceCall* CSPVoiceCall::NewL( const TDesC& aName, 
+                          RMobileLine& aLine, TBool aMobileOriginated, 
+                          const CCCECallParameters& aParams,
+                          MCSPCommonInfo& aCommonInfo,
+                          TBool aIsEmergency )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVoiceCall::NewL <");
+    
+    CSPVoiceCall* self = new ( ELeave ) CSPVoiceCall( aLine, 
+                                            aMobileOriginated,
+                                            aName,
+                                            aCommonInfo,
+                                            aIsEmergency );
+    CleanupStack::PushL( self );
+    self->ConstructL( aParams );
+    CleanupStack::Pop( self );
+    CSPLOGSTRING(CSPOBJECT, "CSPVoiceCall::NewL >");
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// CSPVoiceCall::~CSPVoiceCall
+// ---------------------------------------------------------------------------
+//
+CSPVoiceCall::~CSPVoiceCall()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVoiceCall::~CSPVoiceCall");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVoiceCall::GoOneToOneL
+// Goes one to one from conference.
+// ---------------------------------------------------------------------------
+//
+TInt CSPVoiceCall::GoOneToOne( )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVoiceCall::GoOneToOne");
+    return iRequester->MakeRequest( 
+        CSPEtelCallRequester::ERequestTypeGoOneToOne );
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPVoiceCall::Dial
+// ---------------------------------------------------------------------------
+//
+TInt CSPVoiceCall::DialFdnCond( TBool aFdnCond )
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVoiceCall::DialFdnCond <");
+
+    if ( !iMobileOriginated )
+        {
+        CSPLOGSTRING(CSPINT, 
+                "CSPVoiceCall::DialFdnCond MT CALL, Dial not supported");
+        return KErrNotSupported;
+        }
+
+    CSPLOGSTRING(CSPINT, "CSPVoiceCall::DialFdnCond making request");
+
+    SetDefaultCallParameters();
+    iCommonInfo.InitializeCallParameters( iCallParams );
+    iCallParams.iSubAddress = iParams->SubAddress();
+    iCallParams.iBearerCap1 = iParams->Bearer();
+    
+    if ( CCCECallParameters::ECCECallOriginSAT == iParams->Origin() )
+        {
+        iCallParams.iCallParamOrigin = RMobileCall::EOriginatorSIM;
+        }
+
+    TInt err(KErrNone);
+    if ( aFdnCond )
+        {
+        err = iRequester->MakeDialRequest( iCallParamsPckg, iRemotePartyNumber );
+        }
+    else
+        {
+        err = iRequester->MakeDialNoFdnCheckRequest( 
+                        iCallParamsPckg, iRemotePartyNumber );
+        }
+    CSPLOGSTRING2(CSPINT, "CSPVoiceCall::DialFdnCond > res: %d", err );
+    return err;    
+    }
+
+// ---------------------------------------------------------------------------
+// Make the DialEmergencyCall request to ETel ( impl. of MCCPEmergencyCall )
+// ---------------------------------------------------------------------------
+//
+TInt CSPVoiceCall::Dial( const TDesC& aEmergencyNumber )
+    {    
+    CSPLOGSTRING2(CSPREQIN, "CSPVoiceCall::Dial EMERGENCY %S", &aEmergencyNumber);
+    iDialCompletionCode = KErrNone;
+    iTerminationErrorNotified = EFalse;
+    iIsEmergencyCall = ETrue;
+    iEmergencyNumber.Zero(); 
+    TInt emergencyNumberLength = aEmergencyNumber.Length(); 
+    
+    if ( emergencyNumberLength > 0 && 
+        emergencyNumberLength <= RMobileENStore::KEmergencyNumberSize )
+        {
+        iEmergencyNumber.Append( aEmergencyNumber );
+        }
+    else if ( emergencyNumberLength > RMobileENStore::KEmergencyNumberSize )
+        {                
+        CSPLOGSTRING(CSPERROR, "CSPVoiceCall::Dial invalid argument" );
+        return KErrArgument; 
+        }
+    
+    CSPLOGSTRING2(CSPREQIN, "CSPVoiceCall::Dial using %S", &iEmergencyNumber);
+    
+    TInt err( iRequester->MakeDialEmergencyRequest( iEmergencyNumber ) );
+
+    CSPLOGSTRING2(CSPINT, "CSPVoiceCall::Dial res %d", err );
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPVoiceCall::Answer
+// ---------------------------------------------------------------------------
+//
+TInt CSPVoiceCall::Answer()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVoiceCall::Answer");    
+    return CSPCall::Answer();
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPCall::HangUp
+// ---------------------------------------------------------------------------
+//
+TInt CSPVoiceCall::HangUp()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVoiceCall::HangUp");    
+    return CSPCall::HangUp();   
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCall
+// CSPVoiceCall::Cancel
+// ---------------------------------------------------------------------------
+//
+TInt CSPVoiceCall::Cancel()
+    {
+    CSPLOGSTRING(CSPREQIN, "CSPVoiceCall::Cancel");    
+    return CSPCall::Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCCPCSCall
+// CSPVoiceCall::SwitchAlternatingCall
+// ---------------------------------------------------------------------------
+//
+TInt CSPVoiceCall::SwitchAlternatingCall()
+    {
+    CSPLOGSTRING(CSPERROR, "CSPVoiceCall::SwitchAlternatingCall not supported!");
+    return KErrNotSupported;
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVoiceCall::CSPVoiceCall
+// ---------------------------------------------------------------------------
+//
+CSPVoiceCall::CSPVoiceCall( RMobileLine& aLine, 
+                  TBool aMobileOriginated,
+                  const TDesC& aName,
+                  MCSPCommonInfo& aCommonInfo,
+                  TBool aIsEmergency ):CSPCall( aLine,
+                     aMobileOriginated, aName, 
+                     aCommonInfo, aIsEmergency ),
+                     iCallParams(),
+                     iCallParamsPckg (iCallParams)
+                     
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVoiceCall::CSPVoiceCall");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVoiceCall::ConstructL
+// Constructing CSPVoiceCall for MT call.
+// ---------------------------------------------------------------------------
+//    
+void CSPVoiceCall::ConstructL( const CCCECallParameters& aParams )
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVoiceCall::ConstructL <");
+    CSPCall::ConstructL( aParams );
+    CSPLOGSTRING(CSPOBJECT, "CSPVoiceCall::ConstructL >");
+    }
+
+// ---------------------------------------------------------------------------
+// CSPVoiceCall::SetDefaultCallParameters
+// ---------------------------------------------------------------------------
+//
+void CSPVoiceCall::SetDefaultCallParameters()
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSPVoiceCall::SetDefaultCallParameters");
+    
+    //Set defaults
+    iCallParams.iSpeakerControl = RMobileCall::EMonitorSpeakerControlAlwaysOn;
+    iCallParams.iSpeakerVolume = RMobileCall::EMonitorSpeakerVolumeMedium;
+    iCallParams.iInterval = KCSPDefaultInterval;
+    iCallParams.iWaitForDialTone = RMobileCall::EDialToneNoWait;
+    iCallParams.iIdRestrict = RMobileCall::EIdRestrictDefault;
+    iCallParams.iAutoRedial = KCSPDefaultAutoRedial;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/rcsplinecontainer.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for ETel line subsessions.
+*
+*/
+
+
+
+//  INCLUDES
+#include    <rmmcustomapi.h>
+#include    <mmtsy_names.h>  // tsy and phone names
+#include    <cccpcallparameters.h>
+#include    <cccecallparameters.h>
+
+#include    "rcsplinecontainer.h"
+#include    "csppanic.pan"
+#include    "csplogger.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// Default c++ constructor
+RCSPLineContainer::RCSPLineContainer()
+    {
+    }
+
+// ---------------------------------------------------------
+// RCSPLineContainer::Open
+//
+// ---------------------------------------------------------
+//
+TInt RCSPLineContainer::Open( RMobilePhone& aPhone, TUint32 aServiceId )
+    {
+    CSPLOGSTRING( CSPINT, "RCSPLineContainer::Open" );
+    iServiceId = aServiceId;
+    
+    TInt error = iPrimaryLine.Open( aPhone, KMmTsyVoice1LineName);
+    if (error != KErrNone)
+        {
+        CSPLOGSTRING2( CSPINT, "RCSPLineContainer::Open voice ERROR %d", error );
+        return error;
+        }
+
+    // Ignore errors on the rest of the lines - they are non-essential
+    error = iAls2Line.Open( aPhone, KMmTsyVoice2LineName );
+    if ( error )
+        {
+        CSPLOGSTRING2( CSPINT, "RCSPLineContainer::Open voice2 ERROR %d", error );
+        }
+        
+    error = iDataLine.Open( aPhone, KMmTsyDataLineName );
+    if ( error )
+        {
+        CSPLOGSTRING2( CSPINT, "RCSPLineContainer::Open data ERROR %d", error );
+        }
+        
+    error = iFaxLine.Open( aPhone, KMmTsyFaxLineName );
+    if ( error )
+        {
+        CSPLOGSTRING2( CSPINT, "RCSPLineContainer::Open fax ERROR %d", error );
+        }
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// RCSPLineContainer::Close
+//
+// ---------------------------------------------------------
+//
+void RCSPLineContainer::Close()
+    {
+    CSPLOGSTRING( CSPINT, "RCSPLineContainer::Close" );
+    iPrimaryLine.Close();
+    iAls2Line.Close();
+    iDataLine.Close(); 
+    iFaxLine.Close(); 
+    }
+
+// ---------------------------------------------------------
+// RCSPLineContainer::LineByType
+//
+// ---------------------------------------------------------
+//
+RMobileLine& RCSPLineContainer::LineByType( TCSPLineId aLine )
+    {
+    CSPLOGSTRING2( CSPINT, "RCSPLineContainer::LineByType %d", aLine );    
+    switch(aLine)
+        {
+        case ECSPLineSpeech:
+            CSPLOGSTRING2( CSPINT, "RCSPLineContainer::LineByType Speech %d", aLine );
+            return iPrimaryLine;
+        case ECSPLineAuxSpeech:
+            CSPLOGSTRING2( CSPINT, "RCSPLineContainer::LineByType AuxSpeech %d", aLine );
+            return iAls2Line;
+        case ECSPLineData:
+            CSPLOGSTRING2( CSPINT, "RCSPLineContainer::LineByType Data %d", aLine );
+            return iDataLine;
+        case ECSPLineFax:
+            CSPLOGSTRING2( CSPINT, "RCSPLineContainer::LineByType Fax %d", aLine );
+            return iFaxLine;
+        default:
+            CSPLOGSTRING2( CSPINT, "RCSPLineContainer::INVALID LINE ID %d", aLine );
+            Panic( ECSPPanicInvalidParameter );
+            return iPrimaryLine;
+        }
+    }
+
+// ---------------------------------------------------------
+// True if the line matching the line id is open.
+// ---------------------------------------------------------
+// 
+TBool RCSPLineContainer::LineIsOpen( TCSPLineId aType )
+    {
+    CSPLOGSTRING2( CSPINT, "RCSPLineContainer::LineIsOpen %d", aType );
+    RMobileLine& line = LineByType(aType);
+    return (line.SubSessionHandle() != KNullHandle);
+    }
+
+// ---------------------------------------------------------
+// Resolves line id based on service id, call type and line 
+// type.
+// ---------------------------------------------------------
+// 
+RCSPLineContainer::TCSPLineId RCSPLineContainer::ResolveLineIdL( 
+            const CCCECallParameters& aCallParameters ) const
+    {
+    CSPLOGSTRING(CSPOBJECT, "CSProvider::ResolveLineIdL");
+    RCSPLineContainer::TCSPLineId lineId = RCSPLineContainer::ECSPLineSpeech;
+    
+    switch ( aCallParameters.CallType() )
+        {
+        case CCPCall::ECallTypeCSVoice:
+            {
+            if ( aCallParameters.LineType() == CCCECallParameters::ECCELineTypeAux )
+                {
+                lineId = RCSPLineContainer::ECSPLineAuxSpeech;
+                }
+            else if ( aCallParameters.LineType() == CCCECallParameters::ECCELineTypePrimary )
+                {
+                lineId = RCSPLineContainer::ECSPLineSpeech;
+                }
+            else
+                {
+                CSPLOGSTRING(CSPOBJECT, "CSProvider::ResolveLineIdL ERROR: Unknown line type.");
+                User::Leave( KErrNotSupported );
+                }
+            break;
+            }
+        case CCPCall::ECallTypeVideo: // Fall through
+            {
+            lineId = RCSPLineContainer::ECSPLineData;
+            break;
+            }
+  
+        default:
+            {
+            CSPLOGSTRING(CSPOBJECT, "CSProvider::ResolveLineIdL ERROR: Unknown call type");
+            User::Leave( KErrNotSupported );
+            }
+        }
+        
+    return lineId;
+    }
+    
+// ---------------------------------------------------------
+// Resolves call type, service id and line type based on 
+// line id.
+// ---------------------------------------------------------
+// 
+TInt RCSPLineContainer::ResolveCallInfo( RCSPLineContainer::TCSPLineId aLineId, 
+                                  TUint32& aServiceId,
+                                  CCPCall::TCallType& aCallType,
+                                  CCCECallParameters::TCCELineType& aLineType ) const
+                                  
+    {
+    TInt err(KErrNone);
+    aLineType = CCCECallParameters::ECCELineTypePrimary;    
+    aServiceId = iServiceId;
+    
+    if ( aLineId == RCSPLineContainer::ECSPLineSpeech )
+        {
+        aCallType = CCPCall::ECallTypeCSVoice;            
+        }
+    else if ( aLineId == RCSPLineContainer::ECSPLineAuxSpeech )
+        {
+        aCallType = CCPCall::ECallTypeCSVoice;
+        aLineType = CCCECallParameters::ECCELineTypeAux;
+        }
+    else if ( aLineId == RCSPLineContainer::ECSPLineData )
+        {
+        aCallType = CCPCall::ECallTypeVideo;
+        }
+    else
+        {
+        CSPLOGSTRING(CSPOBJECT, "RCSPLineContainer::ResolveCallInfo() ERROR Unknown line id");
+        err = KErrArgument;
+        }
+    CSPLOGSTRING2(CSPINT, "RCSPLineContainer::ResolveCallInfo() aCallType=%d", aCallType );
+    CSPLOGSTRING2(CSPINT, "RCSPLineContainer::ResolveCallInfo() aLineType=%d", aLineType );
+    
+    return err;
+    }
+
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/tcspskypeidparser.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Parses Skype id from UUI message.
+*
+*/
+
+
+#include "tcspskypeidparser.h"
+
+const TInt KMinSkypeIdUUILength = 3;
+const TInt KMaxSkypeIdUUILength = 33;
+const TInt KMaxSkypeIdLength = 32;
+const TInt KStartOf31To32EncodingByte = 26;
+const TInt KUUIMTDicriminator = 0x44;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TCSPSkypeIdParser::TCSPSkypeIdParser() 
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Creates buffer to be used by client with parse method.
+// ---------------------------------------------------------------------------
+//  
+HBufC* TCSPSkypeIdParser::CreateSkypeIdBufferL()
+    {
+    return HBufC::NewL( KMaxSkypeIdLength );
+    }
+    
+// ---------------------------------------------------------------------------
+// Parses skype id.
+// SkypeID format:
+// byte 0: Protocol discriminator: Always 0x00
+// byte 1: User-User Information Discriminator.
+//         For MT call this has to be 0x44
+// Byte 2: First skype id character a.k.a payload. MSB bit is zero.
+// Byte 26-33 May have MSB bit set, which are bits of the last character.
+// The 26 byte's MSB is the last characters MSB bit.
+// ---------------------------------------------------------------------------
+//
+TInt TCSPSkypeIdParser::Parse( 
+    const TDesC& aUUIMessage, 
+    TDes& aSkypeId )
+    {
+    const TInt messageLength( aUUIMessage.Length() );
+    TInt error = KErrNone;
+    
+    const TBool messageSizeOk = (messageLength >= KMinSkypeIdUUILength &&
+                                 messageLength <= KMaxSkypeIdUUILength);
+                                 
+    if( messageSizeOk &&
+       ( aUUIMessage[1] ) == KUUIMTDicriminator ) // address type
+        {
+        
+        TUint lastChar = 0;
+        
+        // skypeId payload starts from the second byte.
+        TInt i = 2;
+        for( ; i < messageLength; i++ )
+            {
+            TUint byte = aUUIMessage[i];
+            if( i >= KStartOf31To32EncodingByte )
+                {
+                // 31 to 32 encoding: last character is build from
+                // 7 last bytes.
+                lastChar = lastChar << 1;
+                lastChar |= (byte>>7)&0x01;
+                }
+            // MSB bit is not part of the character.
+            aSkypeId.Append( byte & 0x7F ); 
+                
+            
+            }
+            
+        // Append the last char only if the aUUIMessage size was the maximum and there
+        // is content in the last char.
+        if( messageLength == KMaxSkypeIdUUILength && lastChar != 0 )
+            {
+            aSkypeId.Append(lastChar);
+            }
+
+        }
+    else
+        {
+        error = KErrNotSupported;
+        }
+        
+    return error;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/csplugin/src/tmshandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,508 @@
+/*
+ * 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:  Starts and stops audio streams.
+ *
+ */
+
+#include <tmsfactory.h>
+#include <tmscall.h>
+#include <tmsstream.h>
+#include "tmshandler.h"
+#include "csplogger.h"
+#include "csptimer.h"
+#include "csppanic.pan"
+
+/**
+ * Timeout initial value.
+ */
+const TInt KTimeoutInitial = 200000; // 0.2s
+
+/**
+ * Double the timeout for every retry.
+ */
+const TInt KTimeoutMultiplier = 2;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+TmsHandler* TmsHandler::NewL()
+    {
+    TmsHandler* self = TmsHandler::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Static constructor
+// ---------------------------------------------------------------------------
+//
+TmsHandler* TmsHandler::NewLC()
+    {
+    TmsHandler* self = new (ELeave) TmsHandler();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+TmsHandler::~TmsHandler()
+    {
+    if (iTimer)
+        {
+        iTimer->CancelNotify();
+        delete iTimer;
+        }
+    if (iTmsUplink && iTmsCall)
+        {
+        // CloseUplink();
+        iTmsCall->DeleteStream(iTmsUplink);
+        }
+    if (iTmsDnlink && iTmsCall)
+        {
+        // CloseDownlink();
+        iTmsCall->DeleteStream(iTmsDnlink);
+        }
+    if (iFactory && iTmsCall)
+        {
+        iFactory->DeleteCall(iTmsCall);
+        }
+    if (iFactory && iTmsMicSource)
+        {
+        iFactory->DeleteSource(iTmsMicSource);
+        }
+    if (iFactory && iTmsModemSource)
+        {
+        iFactory->DeleteSource(iTmsModemSource);
+        }
+    if (iFactory && iTmsSpeakerSink)
+        {
+        iFactory->DeleteSink(iTmsSpeakerSink);
+        }
+    if (iFactory && iTmsModemSink)
+        {
+        iFactory->DeleteSink(iTmsModemSink);
+        }
+
+    delete iFactory;
+
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCSPAudioStream
+// Activates mic and speaker.
+// ---------------------------------------------------------------------------
+//
+void TmsHandler::StartStreams()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::StartStreams");
+
+    StartMicAndSpeaker();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCSPAudioStream
+// Deactivates mic and speaker if the streams are active or they are
+// activating.
+// ---------------------------------------------------------------------------
+//
+void TmsHandler::StopStreams()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::StopStreams");
+    gint status(TMS_RESULT_SUCCESS);
+    if (iTimer && IsMicAndSpeakerStarted())
+        {
+        CSPLOGSTRING(CSPINT, "TmsHandler::StopStreams Stopping");
+        iTimer->CancelNotify();
+        iTimeout = KTimeoutInitial;
+        status = iTmsUplink->Stop();
+        iUplinkStarted = FALSE;
+        status |= iTmsDnlink->Stop();
+        iDnlinkStarted = FALSE;
+
+        if (status != TMS_RESULT_SUCCESS)
+            {
+            status = TMS_RESULT_GENERAL_ERROR;
+            }
+        }
+    CSPLOGSTRING2(CSPINT, "TmsHandler::StopStreams status %d", status);
+    }
+
+// ---------------------------------------------------------------------------
+// From class MCSPTimerObserver
+// Notify from CSPTimer that timeout passed. Try to start mic and
+// speaker again.
+// ---------------------------------------------------------------------------
+//
+void TmsHandler::TimerEvent()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler.TimerEvent" );
+    iTimeout *= KTimeoutMultiplier;
+    StartMicAndSpeaker();
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TmsHandler::TmsHandler() :
+    iTimeout(KTimeoutInitial)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void TmsHandler::ConstructL()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::ConstructL");
+    iTimer = CSPTimer::NewL();
+
+    if (CreateTMSCallControl())
+        {
+        User::LeaveIfError(TMS_RESULT_UNINITIALIZED_OBJECT);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// TmsHandler::CreateTMSCallControl()
+// ---------------------------------------------------------------------------
+//
+gint TmsHandler::CreateTMSCallControl()
+    {
+    TMSVer* v = NULL;
+    TInt status;
+    status = TMSFactory::CreateFactory(iFactory, *v);
+
+    __ASSERT_ALWAYS(iFactory, Panic( ECSPPanicBadHandle));
+
+    status = iFactory->CreateCall(TMS_CALL_CS, iTmsCall, 0);
+
+    status |= CreateUplink();
+    status |= CreateDownlink();
+    status |= CreateMicSource();
+    status |= AddMicSourceToStream();
+    status |= CreateModemSink();
+    status |= AddModemSinkToStream();
+    status |= CreateModemSource();
+    status |= AddModemSourceToStream();
+    status |= CreateSpeakerSink();
+    status |= AddSpeakerSinkToStream();
+    status |= OpenDownlink();
+
+    return status;
+    }
+
+// ---------------------------------------------------------------------------
+// Resets timer
+// ---------------------------------------------------------------------------
+//
+void TmsHandler::AudioStreamsStarted()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::AudioStreamsStarted" );
+    iTimeout = KTimeoutInitial;
+    iTimer->CancelNotify();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts timer
+// ---------------------------------------------------------------------------
+//
+void TmsHandler::StartTimer()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::StartTimer" );
+    iTimer->NotifyAfter(iTimeout, *this);
+    }
+
+// ---------------------------------------------------------------------------
+// Starts mic and speaker
+// ---------------------------------------------------------------------------
+//
+void TmsHandler::StartMicAndSpeaker()
+    {
+    // if speaker and mic is active then activation does not cause any actions.
+    gint status(TMS_RESULT_SUCCESS);
+
+    if (iTmsUplink)
+        {
+        status = iTmsUplink->Start();
+        }
+    CSPLOGSTRING2( CSPINT, "TmsHandler::StartMicAndSpeaker status %d", status );
+    }
+
+// ---------------------------------------------------------------------------
+// Indicated if mic and speaker are started or starting up.
+// ---------------------------------------------------------------------------
+//
+TBool TmsHandler::IsMicAndSpeakerStarted()
+    {
+    return (iUplinkStarted || iDnlinkStarted);
+    }
+
+// ----------------------------------------------------------------------------
+// CreateUplink
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::CreateUplink()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::CreateUplink");
+    gint status(TMS_RESULT_SUCCESS);
+    if (iTmsCall)
+        {
+        status = iTmsCall->CreateStream(TMS_STREAM_UPLINK, iTmsUplink);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// CreateDownlink
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::CreateDownlink()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::CreateDownlink");
+    gint status(TMS_RESULT_SUCCESS);
+
+    if (iTmsCall)
+        {
+        status = iTmsCall->CreateStream(TMS_STREAM_DOWNLINK, iTmsDnlink);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// OpenUplink
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::OpenUplink()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::OpenUplink");
+    gint status = TMS_RESULT_SUCCESS;
+
+    if (iTmsUplink)
+        {
+        status = iTmsUplink->AddObserver(*this, NULL);
+        if (status == TMS_RESULT_SUCCESS)
+            {
+            status = iTmsUplink->Init();
+            }
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// OpenDownlink
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::OpenDownlink()
+    {
+    CSPLOGSTRING(CSPINT, "TmsHandler::OpenDownlink");
+    gint status = TMS_RESULT_SUCCESS;
+
+    if (iTmsDnlink)
+        {
+        status = iTmsDnlink->AddObserver(*this, NULL);
+        if (status == TMS_RESULT_SUCCESS)
+            {
+            status = iTmsDnlink->Init();
+            }
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// CreateModemSource
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::CreateModemSource()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+
+    if (iFactory && !iTmsModemSource)
+        {
+        status = iFactory->CreateSource(TMS_SOURCE_MODEM, iTmsModemSource);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// AddModemSourceToStream
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::AddModemSourceToStream()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    if (iTmsDnlink && iTmsModemSource)
+        {
+        status = iTmsDnlink->AddSource(iTmsModemSource);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// CreateModemSink
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::CreateModemSink()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+
+    if (iFactory && !iTmsModemSink)
+        {
+        status = iFactory->CreateSink(TMS_SINK_MODEM, iTmsModemSink);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// AddModemSinkToStream
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::AddModemSinkToStream()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    if (iTmsUplink && iTmsModemSink)
+        {
+        status = iTmsUplink->AddSink(iTmsModemSink);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// CreateMicSource
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::CreateMicSource()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+
+    if (iFactory && !iTmsMicSource)
+        {
+        status = iFactory->CreateSource(TMS_SOURCE_MIC, iTmsMicSource);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// AddMicSourceToStream
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::AddMicSourceToStream()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    if (iTmsUplink && iTmsMicSource)
+        {
+        status = iTmsUplink->AddSource(iTmsMicSource);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// CreateSpeakerSink
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::CreateSpeakerSink()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+
+    if (iFactory && !iTmsSpeakerSink)
+        {
+        status = iFactory->CreateSink(TMS_SINK_SPEAKER, iTmsSpeakerSink);
+        }
+    return status;
+    }
+
+// ----------------------------------------------------------------------------
+// AddSpeakerSinkToStream
+// ----------------------------------------------------------------------------
+//
+gint TmsHandler::AddSpeakerSinkToStream()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    if (iTmsDnlink && iTmsSpeakerSink)
+        {
+        status = iTmsDnlink->AddSink(iTmsSpeakerSink);
+        }
+    return status;
+    }
+
+// TMS CALLBACKS
+
+// ----------------------------------------------------------------------------
+// TmsHandler::TMSStreamEvent
+// ----------------------------------------------------------------------------
+//
+void TmsHandler::TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event)
+    {
+    CSPLOGSTRING2(CSPINT, "TmsHandler::TMSStreamEvent status %d", event.reason);
+
+    TMSStreamType strmType = const_cast<TMSStream&>(stream).GetStreamType();
+
+    if (strmType == TMS_STREAM_UPLINK &&
+            event.type == TMS_EVENT_STREAM_STATE_CHANGED)
+        {
+        switch (event.curr_state)
+            {
+            case TMS_STREAM_INITIALIZED:
+                //notify stream ready state
+                break;
+            case TMS_STREAM_UNINITIALIZED:
+                //notify initialization error
+                break;
+            case TMS_STREAM_PAUSED:
+                break;
+            case TMS_STREAM_STARTED:
+                iUplinkStarted = TRUE;
+                iTmsDnlink->Start();
+                break;
+            default:
+                break;
+            }
+        }
+    else if (strmType == TMS_STREAM_DOWNLINK &&
+            event.type == TMS_EVENT_STREAM_STATE_CHANGED)
+        {
+        switch (event.curr_state)
+            {
+            case TMS_STREAM_INITIALIZED:
+                {
+                if ((iTmsCall->GetCallType() == TMS_CALL_CS)
+                        && (!iUplinkStarted))
+                    {
+                    OpenUplink();
+                    }
+                //notify stream ready state
+                }
+                break;
+            case TMS_STREAM_UNINITIALIZED:
+                //notify initialization error
+                break;
+            case TMS_STREAM_PAUSED:
+                break;
+            case TMS_STREAM_STARTED:
+                iDnlinkStarted = TRUE;
+                break;
+            default:
+                break;
+            }
+        }
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phone plugins subsystem bld file
+*
+*/
+
+#include "../csplugin/group/bld.inf"
+
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pri	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+HEADERS += ./inc/*.h
+
+SOURCES += ./src/*.cpp
+
+defineTest(exportResources) {
+    symbian {
+        for(subdirs, 1) {
+            entries = $$files($$subdirs)
+            for(entry, entries) : BLD_INF_RULES.prj_exports += "./$$entry z:/$$replace(2, ^/,)/$$basename(entry)"
+        }
+        export ( BLD_INF_RULES.prj_exports)
+    }
+}
+
+symbian: plugin { # copy qtstub and manifest
+
+    pluginstub.sources = $${TARGET}.dll
+    pluginstub.path = $$PLUGIN_SUBDIR
+
+    DEPLOYMENT += pluginstub
+
+    qtplugins.path = $$PLUGIN_SUBDIR
+    qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+
+    message(Remove "contains(MOBILITY, serviceframework)" after the QtSF refactorig is done!)
+        
+    !contains(MOBILITY, serviceframework):qtplugins.sources += resource/$${TARGET}.manifest
+    contains(MOBILITY, serviceframework):BLD_INF_RULES.prj_exports += "resource/$${TARGET}.s60xml z:$$qtplugins.path/$${TARGET}.xml"
+    
+    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin z:$$qtplugins.path/$$basename(qtplugin)"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetplugin.pro	Fri Jun 04 10:19:18 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:
+TEMPLATE = lib
+CONFIG += plugin \
+    hb \
+    mobility
+MOBILITY = serviceframework
+win32:PLUGIN_SUBDIR = /hsresources/import/widgetregistry/20022F44
+symbian:PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/20022F44
+LIBS += -lhswidgetmodel
+DEPENDPATH += ./inc \
+    ./src
+INCLUDEPATH += ./inc \
+    ../../inc
+symbian: { 
+    LIBS += -lxqservice \
+        -lxqtelephonyservice \
+        -lxqsettingsmanager \
+        -llogsengine
+    TARGET.UID3 = 0x20022F44
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL \
+        -TCB
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    
+    BLD_INF_RULES.prj_exports +=  \
+     "$${LITERAL_HASH}include <platform_paths.hrh>" \
+     "./rom/hsdialerwidgetplugin.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(hsdialerwidgetplugin.iby)"
+}
+OUTPUT_DIR = $$PWD/bin
+SOURCE_DIR = $$PWD/inc
+OBJECTS_DIR = $$OUTPUT_DIR/tmp/$$TARGET
+DESTDIR = $$OUTPUT_DIR
+MOC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/moc
+RCC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/rcc
+UI_DIR = $$OUTPUT_DIR/tmp/$$TARGET/ui
+LIBS += -L$$DESTDIR
+DEPENDPATH += . \
+    $$SOURCE_DIR
+INCLUDEPATH += . \
+    $$SOURCE_DIR
+INCLUDEPATH += $$MOC_DIR
+plugin:!isEmpty(PLUGIN_SUBDIR):DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR
+include(hsdialerwidgetplugin.pri)
+exportResources(./resource/*.manifest, $$PLUGIN_SUBDIR)
+exportResources(./resource/*.svg, $$PLUGIN_SUBDIR)
+exportResources(./resource/*.png, $$PLUGIN_SUBDIR)
+RESOURCES += hsdialerwidgetpluging.qrc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/hsdialerwidgetpluging.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,8 @@
+<RCC>
+    <qresource prefix="/icons">
+        <file>resource/qtg_fr_shortcut_badge_bg_r.png</file>
+        <file>resource/qtg_fr_shortcut_badge_bg_c.png</file>
+        <file>resource/qtg_fr_shortcut_badge_bg_l.png</file>
+        <file>resource/qtg_graf_hs_dialer.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/inc/hsdialerwidget.h	Fri Jun 04 10:19:18 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 HSDIALERWIDGET_H
+#define HSDIALERWIDGET_H
+
+#include <HbWidget>
+#ifdef Q_OS_SYMBIAN
+#include <xqsettingsmanager.h>
+#else
+class XQSettingsManager;
+class XQSettingsKey;
+#endif
+
+#ifndef HOMESCREEN_TEST
+    #define HOMESCREEN_TEST_CLASS(aClassName)
+    #define HOMESCREEN_TEST_FRIEND_CLASS(aClassName)
+#else
+    #define HOMESCREEN_TEST_CLASS(aClassName) class aClassName;
+    #define HOMESCREEN_TEST_FRIEND_CLASS(aClassName) friend class aClassName;
+#endif //HOMESCREEN_TEST
+
+HOMESCREEN_TEST_CLASS(TestDialerWidgetPlugin)
+
+class XQCallInfo;
+class HbFrameItem;
+class HsDialerWidget : public HbWidget
+{
+    Q_OBJECT
+
+public:
+    HsDialerWidget(QGraphicsItem* parent = 0, Qt::WindowFlags flags = 0);
+    ~HsDialerWidget();
+    
+    void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
+
+private:
+    void setItemPositions();
+    
+public slots:
+    void startDialer();
+    void updateMissedCallBadge(const XQSettingsKey &key, const QVariant &value);
+
+    void onShow();
+    void onHide();
+
+protected:
+    void mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event) }
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    
+
+
+private:
+    XQCallInfo *mXQCallInfo;
+    HbFrameItem *m_shortcutBadge;
+    HbFrameItem *m_backgroud;
+    XQSettingsManager * m_setManager;
+    int m_missedCalls;
+    HOMESCREEN_TEST_FRIEND_CLASS(TestDialerWidgetPlugin)
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/inc/hsdialerwidgetplugin.h	Fri Jun 04 10:19:18 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:  Homescreen widget plugin
+*
+*/
+
+
+#ifndef HSDIALERWIDGETPLUGIN_H
+#define HSDIALERWIDGETPLUGIN_H
+
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+
+
+/**
+ * @ingroup group_hsdialerwidgetplugin
+ * @brief Homescreen dialer widget plugin.
+ *
+ * This library includes homescreen dialer widget implemented by homescreen scrum team.
+ * This plugin provides widgets that are described in the  hsdialerwidgetplugin.xml plugin
+ * xml file. 
+ *
+ * @since S60 ?S60_version.
+ */
+class HsDialerWidgetPlugin : public QObject, public QServicePluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+    QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+                            QServiceContext *context,
+                            QAbstractSecuritySession *session);
+
+};
+
+#endif //HSDIALERWIDGETPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/resource/hsdialerwidgetplugin.manifest	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widgetprovider>
+    <widget library="hsdialerwidgetplugin"
+            uri="hsdialerwidgetplugin"
+            title="Dialer"
+            iconuri="qtg_graf_hs_dialer.svg"
+            description="The dialer is used to make phone calls."/>
+</widgetprovider>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/resource/hsdialerwidgetplugin.s60xml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>hsdialerwidgetplugin</name>
+    <filepath>hsdialerwidgetplugin</filepath>
+    <description>Dialer widget</description>
+    <interface>
+        <name>com.nokia.symbian.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description>The dialer widget displays dialing menu</description>
+        <capabilities></capabilities>
+        <customproperty key="iconuri">qtg_graf_hs_dialer.svg</customproperty>
+        <customproperty key="title">Dialer</customproperty>
+    </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/resource/hsdialerwidgetplugin.xml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>hsdialerwidgetplugin</name>
+    <filepath>hsdialerwidgetplugin</filepath>
+    <description>Dialer widget</description>
+    <interface>
+        <name>com.nokia.symbian.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description>The dialer widget displays dialing menu</description>
+        <capabilities></capabilities>
+        <customproperty key="iconuri">qtg_graf_hs_dialer.svg</customproperty>
+        <customproperty key="title">Dialer</customproperty>
+    </interface>
+</service>
Binary file phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_c.png has changed
Binary file phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_l.png has changed
Binary file phoneplugins/hsdialerwidgetplugin/resource/qtg_fr_shortcut_badge_bg_r.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/resource/qtg_graf_hs_dialer.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="81px" version="1.1" viewBox="0 0 81 81" width="81px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<path d="M81,75c0,3.3-2.699,6-6,6H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h69c3.301,0,6,2.7,6,6  V75z" fill="url(#SVGID_1_)" fill-opacity="0.92" stroke-opacity="0.92"/>
+<path d="M75,0.5c3.033,0,5.5,2.467,5.5,5.5v69c0,3.033-2.467,5.5-5.5,5.5H6c-3.033,0-5.5-2.467-5.5-5.5V6  c0-3.033,2.467-5.5,5.5-5.5H75 M75,0H6C2.7,0,0,2.7,0,6v69c0,3.3,2.7,6,6,6h69c3.301,0,6-2.7,6-6V6C81,2.7,78.301,0,75,0L75,0z" fill="#999999"/>
+<g>
+<g>
+<path d="M28.548,20.202c0,1.813-1.471,3.284-3.284,3.284h-7.116c-1.813,0-3.284-1.471-3.284-3.284V16.37    c0-1.814,1.471-3.284,3.284-3.284h7.116c1.813,0,3.284,1.47,3.284,3.284V20.202z" fill="#3C3C3C"/>
+<path d="M47.343,20.202c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.471-3.284-3.284V16.37    c0-1.814,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.47,3.285,3.284V20.202z" fill="#3C3C3C"/>
+<path d="M66.136,20.202c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.813,0-3.283-1.471-3.283-3.284V16.37    c0-1.814,1.471-3.284,3.283-3.284h7.115c1.814,0,3.285,1.47,3.285,3.284V20.202z" fill="#3C3C3C"/>
+<path d="M28.548,35.255c0,1.813-1.471,3.284-3.284,3.284h-7.116c-1.813,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.471-3.284,3.284-3.284h7.116c1.813,0,3.284,1.469,3.284,3.284V35.255z" fill="#3C3C3C"/>
+<path d="M47.343,35.255c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V35.255z" fill="#3C3C3C"/>
+<path d="M66.136,35.255c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.813,0-3.283-1.471-3.283-3.284v-3.831    c0-1.815,1.471-3.284,3.283-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V35.255z" fill="#3C3C3C"/>
+<path d="M28.548,50.034c0,1.813-1.471,3.284-3.284,3.284h-7.116c-1.813,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.471-3.284,3.284-3.284h7.116c1.813,0,3.284,1.469,3.284,3.284V50.034z" fill="#3C3C3C"/>
+<path d="M47.343,50.034c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V50.034z" fill="#3C3C3C"/>
+<path d="M47.343,64.63c0,1.815-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.469-3.284-3.284v-3.831    c0-1.813,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.471,3.285,3.284V64.63z" fill="#3C3C3C"/>
+<path d="M66.136,50.034c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.813,0-3.283-1.471-3.283-3.284v-3.831    c0-1.815,1.471-3.284,3.283-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V50.034z" fill="#3C3C3C"/>
+</g>
+</g>
+<rect fill="none" height="81" width="81"/>
+<defs>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="40.5005" x2="40.5005" y1="81.3467" y2="41.859">
+<stop offset="0" style="stop-color:#F2F2F2"/>
+<stop offset="1" style="stop-color:#FFFFFF"/>
+</linearGradient>
+</defs>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/resource/qtg_graf_hs_dialer_pressed.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="81px" version="1.1" viewBox="0 0 81 81" width="81px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<path d="M81,75c0,3.3-2.699,6-6,6H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h69c3.301,0,6,2.7,6,6V75z" fill="url(#SVGID_1_)"/>
+<path d="M75,0.5c3.033,0,5.5,2.467,5.5,5.5v69c0,3.033-2.467,5.5-5.5,5.5H6  c-3.033,0-5.5-2.467-5.5-5.5V6c0-3.033,2.467-5.5,5.5-5.5H75 M75,0H6C2.7,0,0,2.7,0,6v69c0,3.3,2.7,6,6,6h69c3.301,0,6-2.7,6-6V6  C81,2.7,78.301,0,75,0L75,0z" display="none" fill="#999999"/>
+<g>
+<g>
+<path d="M28.548,20.202c0,1.813-1.471,3.284-3.284,3.284h-7.116c-1.813,0-3.284-1.471-3.284-3.284V16.37    c0-1.814,1.471-3.284,3.284-3.284h7.116c1.813,0,3.284,1.47,3.284,3.284V20.202z" fill="#FFFFFF"/>
+<path d="M47.343,20.202c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.471-3.284-3.284V16.37    c0-1.814,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.47,3.285,3.284V20.202z" fill="#FFFFFF"/>
+<path d="M66.136,20.202c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.813,0-3.283-1.471-3.283-3.284V16.37    c0-1.814,1.471-3.284,3.283-3.284h7.115c1.814,0,3.285,1.47,3.285,3.284V20.202z" fill="#FFFFFF"/>
+<path d="M28.548,35.255c0,1.813-1.471,3.284-3.284,3.284h-7.116c-1.813,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.471-3.284,3.284-3.284h7.116c1.813,0,3.284,1.469,3.284,3.284V35.255z" fill="#FFFFFF"/>
+<path d="M47.343,35.255c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V35.255z" fill="#FFFFFF"/>
+<path d="M66.136,35.255c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.813,0-3.283-1.471-3.283-3.284v-3.831    c0-1.815,1.471-3.284,3.283-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V35.255z" fill="#FFFFFF"/>
+<path d="M28.548,50.034c0,1.813-1.471,3.284-3.284,3.284h-7.116c-1.813,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.471-3.284,3.284-3.284h7.116c1.813,0,3.284,1.469,3.284,3.284V50.034z" fill="#FFFFFF"/>
+<path d="M47.343,50.034c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.471-3.284-3.284v-3.831    c0-1.815,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V50.034z" fill="#FFFFFF"/>
+<path d="M47.343,64.63c0,1.815-1.471,3.284-3.285,3.284h-7.115c-1.815,0-3.284-1.469-3.284-3.284v-3.831    c0-1.813,1.469-3.284,3.284-3.284h7.115c1.814,0,3.285,1.471,3.285,3.284V64.63z" fill="#FFFFFF"/>
+<path d="M66.136,50.034c0,1.813-1.471,3.284-3.285,3.284h-7.115c-1.813,0-3.283-1.471-3.283-3.284v-3.831    c0-1.815,1.471-3.284,3.283-3.284h7.115c1.814,0,3.285,1.469,3.285,3.284V50.034z" fill="#FFFFFF"/>
+</g>
+</g>
+<rect fill="none" height="81" width="81"/>
+<defs>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="40.4995" x2="40.4995" y1="79.9482" y2="102.8848">
+<stop offset="0" style="stop-color:#8CE0FF"/>
+<stop offset="0.2432" style="stop-color:#83DEFD"/>
+<stop offset="0.6383" style="stop-color:#6BD8F7"/>
+<stop offset="1" style="stop-color:#4FD1F0"/>
+</linearGradient>
+</defs>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/rom/hsdialerwidgetplugin.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* 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 __HSDIALERWIDETPLUGIN_IBY__
+#define __HSDIALERWIDETPLUGIN_IBY__
+
+file=ABI_DIR\BUILD_DIR\hsdialerwidgetplugin.dll                                        SHARED_LIB_DIR\hsdialerwidgetplugin.dll
+data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.qtplugin    private\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.qtplugin
+data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.manifest    private\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.manifest
+data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\qtg_graf_hs_dialer.svg           private\20022f35\import\widgetregistry\20022F44\qtg_graf_hs_dialer.svg
+data=ZPRIVATE\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.xml         private\20022f35\import\widgetregistry\20022F44\hsdialerwidgetplugin.xml
+
+#endif //__HSDIALERWIDETPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/src/hsdialerwidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,243 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <QPainter>
+#include <hbframedrawer.h>
+#include <hbframeitem.h>
+#include <hbtextitem.h>
+#include <QLocale>
+#ifdef Q_OS_SYMBIAN
+#include <logsdomaincrkeys.h>
+#include "qtphonelog.h"
+#include <xqservicerequest.h>
+#include <xqcallinfo.h>
+#include <xqpublishandsubscribeutils.h>
+#include <ctsydomainpskeys.h>
+#include <logsservices.h>
+#endif
+
+#include "hsdialerwidget.h"
+
+namespace
+{
+    const char KDialerWidgetIcon[] = ":/icons/resource/qtg_graf_hs_dialer";
+    const char KMissedCallShortcutBadge[] = ":/icons/resource/qtg_fr_shortcut_badge_bg";
+}
+
+/*!
+    \class HsDialerWidget
+
+    \ingroup group_hsdialerwidgetplugin
+    \brief Implementation for the homescreen dialer launcher.
+
+*/
+
+/*!
+    Constructs dialer widget with given \a parent and given window \a flags.
+*/
+HsDialerWidget::HsDialerWidget(QGraphicsItem *parent, Qt::WindowFlags flags)
+  : HbWidget(parent, flags),
+    mXQCallInfo(0)
+{
+#ifdef Q_OS_SYMBIAN
+    m_setManager = new XQSettingsManager(this);
+
+    XQSettingsKey settingsKey( XQSettingsKey::TargetCentralRepository,
+            KCRUidLogs.iUid, KLogsNewMissedCalls );
+
+    bool ok = connect( m_setManager,
+            SIGNAL( valueChanged(const XQSettingsKey & ,const QVariant &)),
+                this, SLOT(updateMissedCallBadge(XQSettingsKey,
+                        QVariant)));
+    ASSERT( ok );
+    ok = false;
+    ok = m_setManager->startMonitoring( settingsKey );
+    ASSERT(ok);
+
+#endif
+
+    HbFrameDrawer *drawer = new HbFrameDrawer(
+            KDialerWidgetIcon, HbFrameDrawer::OnePiece);
+    m_backgroud = new HbFrameItem(drawer, this);
+    m_backgroud->setZValue(1);
+
+    drawer = new HbFrameDrawer(KMissedCallShortcutBadge,
+            HbFrameDrawer::ThreePiecesHorizontal );
+
+    m_shortcutBadge = new HbFrameItem(drawer, this);
+    m_shortcutBadge->setZValue(2);
+    m_shortcutBadge->setVisible(false);
+    m_missedCalls=0;
+    setItemPositions();
+    resize(preferredSize());
+}
+
+/*!
+    Destructor.
+*/
+HsDialerWidget::~HsDialerWidget()
+{
+}
+
+void HsDialerWidget::paint(
+        QPainter *painter,
+        const QStyleOptionGraphicsItem *option,
+        QWidget *widget)
+{
+    Q_UNUSED(option);
+    Q_UNUSED(widget);
+    painter->setPen(QPen( Qt::transparent ) );
+
+    QRectF rect(m_backgroud->boundingRect());
+    painter->drawRect((int)m_backgroud->pos().x(),
+                      (int)m_backgroud->pos().y(),
+                      rect.toRect().width(),
+                      rect.toRect().height());
+
+    if ( m_shortcutBadge->isVisible())
+        {
+        rect = m_shortcutBadge->boundingRect();
+        HbTextItem *text = new HbTextItem( m_shortcutBadge->graphicsItem());
+        
+        QFont badgefont = font();
+#ifdef Q_OS_SYMBIAN
+        badgefont.setPointSize( 4 );
+#else
+        badgefont.setPointSize( 8 );
+#endif
+        text->setFont(badgefont);
+        text->setText(QLocale::system().toString(m_missedCalls));
+        text->setZValue(3);
+        text->setTextColor(Qt::white);
+       
+        text->setX( ( rect.toRect().width() / 2 ) - 2);
+        text->setY( ( rect.toRect().height() / 5 ) - 1);
+
+        painter->drawRect( (int)m_shortcutBadge->pos().x(),
+                           (int)m_shortcutBadge->pos().y(),
+                           rect.toRect().width(),
+                           rect.toRect().height() );
+    }
+}
+
+/*!
+    \fn void HsDialerWidget::startDialer()
+
+    Starts dialer widget via view activation service.
+*/
+void HsDialerWidget::startDialer()
+{
+#ifdef Q_OS_SYMBIAN
+    PHONE_DEBUG("HsDialerWidget::startDialer");
+    
+    if (!mXQCallInfo) {
+        mXQCallInfo = XQCallInfo::create();
+        mXQCallInfo->setParent(this);
+    }
+    
+    QList<CallInfo> calls;
+    mXQCallInfo->getCalls(calls);
+        
+    if( 0 < calls.count() ){
+        PHONE_DEBUG("call ongoing, bring Telephone to foreground");
+        
+        // ToDo: should telephone + dialpad be opened when there is a waiting call?
+        int dialer(1);
+        XQServiceRequest snd("com.nokia.services.telephony.uistarter", "start(int)", false);
+        snd << dialer;
+        QVariant retValue;
+        snd.send(retValue);
+    }
+    else {
+        PHONE_DEBUG("no calls, open Dialer");
+        XQServiceRequest snd("com.nokia.services.logsservices.starter",
+            "start(int,bool)", false);
+        snd << (int)LogsServices::ViewAll;
+        snd << true;
+        int retValue;
+        snd.send(retValue);
+
+        //LogsServices::start(LogsServices::ViewAll, true);
+    }
+#endif
+}
+
+void HsDialerWidget::updateMissedCallBadge(
+        const XQSettingsKey &key, const QVariant &value)
+{
+#ifdef Q_OS_SYMBIAN
+    if ( key.key() == (quint32)KLogsNewMissedCalls ){
+        m_missedCalls = value.toInt();
+        m_shortcutBadge->setVisible(value.toBool());
+        setItemPositions();
+        m_backgroud->update();
+    }
+#else
+   Q_UNUSED(key);
+   Q_UNUSED(value);
+#endif
+}
+
+/*!
+    \fn void HsDialerWidget::onShow()
+
+    Shows the widget
+*/
+void HsDialerWidget::onShow()
+{
+}
+
+/*!
+    \fn void HsDialerWidget::onHide()
+
+    Hides the widget
+*/
+void HsDialerWidget::onHide()
+{
+}
+
+/*!
+    \fn void HsDialerWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
+
+    Dialer widget start is triggered from release \a event.
+    \sa startDialer()
+*/
+void HsDialerWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
+{
+    Q_UNUSED(event);
+    startDialer();
+}
+
+void HsDialerWidget::setItemPositions()
+{
+    HbIcon icon(KDialerWidgetIcon);
+    setPreferredWidth(icon.width());
+    int badgeSize = 20;
+    if ( m_shortcutBadge->isVisible()){
+        m_backgroud->setGeometry(QRectF(QPointF(0,badgeSize / 2 ), 
+                QSizeF(icon.width(),icon.height())));
+        m_shortcutBadge->setGeometry(QRectF(
+                QPointF(m_backgroud->boundingRect().width() - (badgeSize / 2),0 ),
+                QSizeF(badgeSize, badgeSize)));
+        setPreferredHeight(icon.height()+(badgeSize / 2));
+    } else {
+        m_backgroud->setGeometry(QRectF(QPointF(0,0), 
+                QSizeF(icon.width(),icon.height())));
+        setPreferredHeight(icon.height());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/hsdialerwidgetplugin/src/hsdialerwidgetplugin.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* 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:  Homescreen widget plugin
+*
+*/
+
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+#include "hsdialerwidgetplugin.h"
+#include "hsdialerwidget.h"
+#include "qtphonelog.h"
+
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT
+
+QObject *HsDialerWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
+                                             QServiceContext *context,
+                                             QAbstractSecuritySession *session)
+{
+    PHONE_DEBUG("HsDialerWidgetPlugin::createInstance");
+    Q_UNUSED(context);
+    Q_UNUSED(session);
+
+    if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
+        PHONE_DEBUG("creating HsDialerWidget instance");
+        return new HsDialerWidget();
+    } else {
+        return 0;
+    }
+}
+
+Q_EXPORT_PLUGIN2(hsdialerwidgetplugin, HsDialerWidgetPlugin)
+
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetplugin.pro	Fri Jun 04 10:19:18 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: Project file for building Phone components
+#
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+
+SUBDIRS = infowidgetprovider infowidgetproviderinstaller
+
+          
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetlogging.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#ifndef INFOWIDGETLOGGING_H
+#define INFOWIDGETLOGGING_H
+
+#include <QDebug>
+
+
+/*!
+  Define MSG_OUTPUT_RDEBUG 
+  for enabling RDebug prints in development tracing. 
+  Shouldn't be used in release code.
+  */
+#undef MSG_OUTPUT_RDEBUG
+
+
+#ifdef MSG_OUTPUT_RDEBUG
+#ifdef Q_OS_SYMBIAN
+#include <e32debug.h>
+
+static void infoWidgetMsgOutput(QtMsgType type, const char *msg)
+{
+    switch (type) {
+        
+    case QtDebugMsg:
+        RDebug::Printf("InfoWidget Debug: %s\n", msg);
+        break;
+    case QtWarningMsg:
+        RDebug::Printf("InfoWidget Warning: %s\n", msg);
+        break;
+    case QtCriticalMsg:
+        RDebug::Printf("InfoWidget Critical: %s\n", msg);
+        break;
+    case QtFatalMsg:
+        RDebug::Printf("InfoWidget Fatal: %s\n", msg);
+        abort();
+    }
+}
+
+    #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(infoWidgetMsgOutput)
+    #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0)
+#endif //Q_OS_SYMBIAN
+#else 
+    #define INSTALL_TRACE_MSG_HANDLER 
+    #define UNINSTALL_TRACE_MSG_HANDLER 
+#endif //MSG_OUTPUT_RDEBUG
+
+/*!
+  Debug macros
+  */
+#define DPRINT qDebug() << __PRETTY_FUNCTION__
+#define DWARNING qWarning() << __PRETTY_FUNCTION__
+#define DCRITICAL qCritical() << __PRETTY_FUNCTION__
+
+#endif // INFOWIDGETLOGGING
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetprovider.h	Fri Jun 04 10:19:18 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:  
+ *
+ */
+
+#ifndef INFOWIDGETPROVIDER_H
+#define INFOWIDGETPROVIDER_H
+
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+
+class InfoWidgetProvider : public QObject, public QServicePluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+    QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+                            QServiceContext *context,
+                            QAbstractSecuritySession *session);
+
+};
+
+#endif // INFOWIDGETPROVIDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidget.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 INFOWIDGET_H
+#define INFOWIDGET_H
+
+#include <hbwidget.h>
+#include <QGraphicsSceneMouseEvent>
+#include <QList>
+#include <QFlags>
+#include "infowidgetlayoutmanager.h"
+
+class QLabel;
+class QGraphicsLinearLayout;
+class QTranslator; 
+class HbDialog;
+class HbIconItem; 
+class HbMarqueeItem;
+class HbLabel; 
+class HbCheckBox; 
+class HbPushButton;
+class HbFrameDrawer;
+class InfoWidgetEngine; 
+class InfoWidgetPreferences;
+ 
+
+class InfoWidget : public HbWidget
+{
+    Q_OBJECT
+
+public:    
+    InfoWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
+    ~InfoWidget();
+
+public: // From QGraphicsItem.
+    QRectF boundingRect() const;
+    QPainterPath shape() const; 
+    QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const;  
+    QSizePolicy sizePolicy () const;  
+    
+public: // Property definitions
+    Q_PROPERTY(QString homeZoneDisplay READ homeZoneDisplay WRITE setHomeZoneDisplay)
+    Q_PROPERTY(QString mcnDisplay READ mcnDisplay WRITE setMcnDisplay)
+    Q_PROPERTY(QString activeLineDisplay READ activeLineDisplay WRITE setActiveLineDisplay)
+    Q_PROPERTY(QString satDisplay READ satDisplay WRITE setSatDisplay)
+    Q_PROPERTY(QString spnDisplay READ spnDisplay WRITE setSpnDisplay)
+    QString homeZoneDisplay();
+    void setHomeZoneDisplay(QString value);
+    QString mcnDisplay();
+    void setMcnDisplay(QString value);
+    QString activeLineDisplay();
+    void setActiveLineDisplay(QString value);
+    QString satDisplay();
+    void setSatDisplay(QString value);
+    QString spnDisplay();
+    void setSpnDisplay(QString value);
+    
+protected:
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 
+    void mouseMoveEvent(QGraphicsSceneMouseEvent *event); 
+    
+    void updateInfoDisplay();
+    bool readPersistentPreferences();
+    void initializeCheckBoxStates(); 
+    void changeEvent(QEvent *event);
+    bool installTranslator(QString translationFile); 
+    void removeTranslators(); 
+    
+private: 
+    void updateItemsVisibility();
+    void layoutInfoDisplay(); 
+    void layoutSettingsDisplay(); 
+    void initializeInfoDisplayItems(); 
+    void initializeSettingsDisplayItems();
+    void startChanges(); 
+    void endChanges(); 
+
+public slots: 
+    // Slots from HsWidget
+    void onInitialize();
+    void onUninitialize();
+    void onShow();
+    void onHide();
+
+    // Info widget specific slots 
+    void readModel(); 
+    void handleModelError(int operation,int errorCode);  
+    void spnDisplaySettingChanged(int state);
+    void mcnDisplaySettingChanged(int state);
+    void satDisplaySettingChanged(int state);
+    void settingsEditingFinished();
+    void settingsValidationFailed(); 
+    
+signals: 
+    void setPreferences(const QStringList &names);
+
+private:
+    Q_DISABLE_COPY(InfoWidget)
+    
+    // Engine for widget      
+    InfoWidgetEngine *m_engine;
+    
+    // Widget preference store  
+    InfoWidgetPreferences *m_preferences;
+
+    // Layout manager for widget
+    InfoWidgetLayoutManager *m_layoutManager;
+    
+    QGraphicsLinearLayout *m_layout; 
+    QList<QTranslator *> m_translators;
+    QColor m_backGroundColor; 
+    HbFrameDrawer *m_frameDrawer;
+    bool m_layoutChanging;
+    bool m_dragEvent; 
+    bool m_initialized;
+};
+
+
+#endif // INFOWIDGET_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h	Fri Jun 04 10:19:18 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 INFOWIDGETENGINE_H_
+#define INFOWIDGETENGINE_H_
+
+
+#include <QObject>
+#include <QString>
+
+class InfoWidgetNetworkHandler;
+class InfoWidgetSatHandler;
+class InfoWidgetLineHandler;
+
+class InfoWidgetEngine : public QObject 
+    {
+    Q_OBJECT
+    
+public:     
+    
+    enum HandlerEntity {
+        NotDefined = 0, 
+        NetworkHandler, 
+        SatHandler, 
+        LineHandler
+    };
+    
+    class ModelData {    
+    public: 
+        int mcnIndicatorType() const { return m_mcnIndicatorType; }; 
+        void setMcnIndicatorType(const int type){ m_mcnIndicatorType = type; };
+        
+        int homeZoneIndicatorType() const { return m_homeZoneIndicatorType; }; 
+        void setHomeZoneIndicatorType(const int type){ m_homeZoneIndicatorType = type; };
+
+        int activeLine() const { return m_activeLine; }; 
+        void setActiveLine(const int line){ m_activeLine = line; };
+
+        const QString& mcnName() const { return m_mcnName; };
+        void setMcnName(const QString& name){ m_mcnName = name; };
+
+        const QString& serviceProviderName() const { return m_serviceProviderName; };
+        void setServiceProviderName(const QString& name){ m_serviceProviderName = name; };
+        
+        bool serviceProviderNameDisplayRequired() const { 
+            return m_serviceProviderNameDisplayRequired; };
+        void setServiceProviderNameDisplayRequired(bool required){ 
+            m_serviceProviderNameDisplayRequired = required; };
+        
+        const QString& homeZoneTextTag() const { return m_homeZoneTextTag; };
+        void setHomeZoneTextTag(const QString& tag){ m_homeZoneTextTag = tag; };
+
+        const QString& satDisplayText() const { return m_satDisplayText; };
+        void setSatDisplayText(const QString& text){ m_satDisplayText = text; };
+        
+    private: 
+        int m_mcnIndicatorType; 
+        int m_homeZoneIndicatorType;
+        int m_activeLine; 
+        bool m_serviceProviderNameDisplayRequired; 
+        
+        QString m_mcnName;
+        QString m_serviceProviderName;
+        QString m_homeZoneTextTag;
+        QString m_satDisplayText;
+    }; 
+    
+public:
+    InfoWidgetEngine(QObject *parent = 0);
+    ~InfoWidgetEngine();    
+    
+    const InfoWidgetEngine::ModelData &modelData() const;  
+    
+    void logModelData();
+    
+signals:
+    void modelError(int operation, int errorCode);
+    void modelChanged(); 
+    
+public slots: 
+    void updateNetworkDataToModel();
+    void updateSatDataToModel();
+    void updateLineDataToModel();
+
+    void handleNetworkError(int operation, int errorCode); 
+    void handleSatError(int operation, int errorCode); 
+    void handleLineError(int operation, int errorCode);
+    
+    void suspend(); 
+    void resume();
+    
+    void preferenceChanged(int option, int displaySetting);
+    
+private: 
+    ModelData m_modelData;
+    
+    // Own
+    QScopedPointer<InfoWidgetNetworkHandler> m_networkHandler;
+    QScopedPointer<InfoWidgetSatHandler> m_satHandler;
+    }; 
+
+#endif /* INFOWIDGETENGINE_H_ */
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlayoutmanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#ifndef INFOWIDGETLAYOUTMANAGER_H
+#define INFOWIDGETLAYOUTMANAGER_H
+
+#include <QObject>
+#include <QList>
+#include <QSizeF>
+#include <QRectF>
+#include <QMap>
+#include <hbdocumentloader.h>
+
+class QGraphicsLayout; 
+class QGraphicsWidget;
+class HbLabel;
+class HbIconItem;
+class HbPushButton;
+class HbMarqueeItem;
+class HbCheckBox; 
+
+/*!
+ */
+class InfoWidgetDocumentLoader : public HbDocumentLoader
+{
+public:
+    InfoWidgetDocumentLoader();
+    virtual QObject *createObject(const QString& type,
+                                  const QString &name);
+};
+
+class InfoWidgetLayoutManager : public QObject
+{
+    Q_OBJECT
+    
+public: 
+    
+    enum LayoutItemRole {
+        RoleUndefined = 0,
+        // Content widget, the main widget from document 
+        RoleContent,
+        // Marquee items 
+        RoleMcnMarqueeItem,
+        RoleSatMarqueeItem,
+        // Labels 
+        RoleSpnLabel,
+        RoleMcnLabel, 
+        RoleSatTextLabel,
+        // Icons
+        RoleSpnIcon, 
+        RoleMcnIcon, 
+        RoleSatTextIcon, 
+        // Check boxes 
+        RoleSpnCheckBox,
+        RoleMcnCheckBox, 
+        RoleSatTextCheckBox,
+        // Buttons 
+        RoleOkButton,
+        // Layout containers
+        RoleContainer, 
+        RoleSettingsContainer, 
+        // Must be the last enumeration        
+        RoleLastEnum
+        }; 
+    
+    enum DisplayRole {
+        InfoDisplay,
+        SettingsDisplay
+        }; 
+    
+    InfoWidgetLayoutManager(QObject *parent = 0);
+    ~InfoWidgetLayoutManager();
+    
+    void destroyObjects(); 
+    
+    DisplayRole currentDisplayRole(); 
+    QList<LayoutItemRole> currentWidgetRoles(); 
+    
+    int layoutRows() const; 
+    void setLayoutRows(int rows);
+    qreal rowHeight() const; 
+    
+    QGraphicsLayout* layoutInfoDisplay();
+    QGraphicsLayout* layoutSettingsDisplay(); 
+    
+    const QList<InfoWidgetLayoutManager::LayoutItemRole> widgetRoles(
+            DisplayRole displayRole) const; 
+
+    bool loadWidgets(const DisplayRole displayRole, 
+            const QList<LayoutItemRole> &displayWidgets,
+            QMap<LayoutItemRole, QGraphicsWidget *> &widgetMap);
+    bool reloadWidgets(const DisplayRole displayRole);
+    
+    QGraphicsWidget* loadWidget(InfoWidgetDocumentLoader &loader, 
+            DisplayRole displayRole, 
+            LayoutItemRole widgetRole);
+    
+    QGraphicsWidget* getWidget(LayoutItemRole itemRole);
+    QGraphicsWidget* contentWidget();
+    
+    void removeWidget(LayoutItemRole itemRole);
+    void hideWidget(LayoutItemRole itemRole);
+    void hideAll();
+    void showAll();
+    
+    
+private:
+    QMap<LayoutItemRole, QGraphicsWidget *> m_widgets; 
+    QMap<LayoutItemRole, QGraphicsWidget *> m_infoDisplayWidgets; 
+    QMap<LayoutItemRole, QGraphicsWidget *> m_settingsDisplayWidgets; 
+
+    InfoWidgetDocumentLoader *m_documentLoader;
+    DisplayRole m_displayRole; 
+    int m_layoutRows;
+    
+};
+
+
+#endif // INFOWIDGETLAYOUTMANAGER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetlinehandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#ifndef INFOWIDGETLINEHANDLER_H_
+#define INFOWIDGETLINEHANDLER_H_
+
+
+#include <QObject>
+
+class InfoWidgetLineHandler: public QObject 
+    {
+    Q_OBJECT
+    
+public:    
+    InfoWidgetLineHandler(QObject *parent = NULL);
+    ~InfoWidgetLineHandler();    
+
+    void logCurrentInfo(); 
+
+    int activeLine() const; 
+    void setActiveLine(int line);
+    
+signals: 
+    void handleMessage( int message );
+    void handleError( int operation, int errorCode );
+    
+private: 
+    int m_activeLine; 
+    }; 
+
+#endif /* INFOWIDGETLINEHANDLER_H_ */
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetnetworkhandler.h	Fri Jun 04 10:19:18 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 INFOWIDGETNETWORKHANDLER_H_
+#define INFOWIDGETNETWORKHANDLER_H_
+
+
+#include <QObject>
+#include <nwhandlingengine.h>
+
+class CNWSession; 
+
+class InfoWidgetNetworkHandler : public QObject, public MNWMessageObserver 
+    {
+    Q_OBJECT
+    
+public:
+    InfoWidgetNetworkHandler(QObject *parent = NULL);
+    ~InfoWidgetNetworkHandler();    
+
+    QString serviceProviderName() const;
+    bool serviceProviderNameDisplayRequired() const; 
+    QString homeZoneTextTag() const; 
+    int homeZoneIndicatorType() const; 
+    QString mcnName() const; 
+    int mcnIndicatorType() const; 
+    int networkRegistrationStatus() const;  
+    bool isOnline() const;
+    
+    void logCurrentInfo(); 
+
+public: // From MNWMessageObserver
+    void HandleNetworkMessage(const TNWMessages aMessage);
+    void HandleNetworkError(const TNWOperation aOperation, TInt aErrorCode);
+
+public slots: 
+    void suspend(); 
+    void resume();
+    
+    void enableMcn(); 
+    void disableMcn(); 
+    
+protected:     
+    void writeMcnDisplayState(bool enabled);
+    bool readMcnDisplayState(); 
+    
+signals: 
+    void networkDataChanged();
+    void networkError(int operation, int errorCode);
+    
+private:
+    TNWInfo m_nwInfo;
+    QScopedPointer<CNWSession> m_nwSession;
+    }; 
+
+#endif /* INFOWIDGETNETWORKHANDLER_H_ */
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetpreferences.h	Fri Jun 04 10:19:18 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 INFOWIDGETPREFERENCES_H
+#define INFOWIDGETPREFERENCES_H
+
+#include <QObject>
+#include <QStringList>
+#include <QFlags>
+
+// Preference string values
+const char DISPLAY_SETTING_ON[]    = "On";
+const char DISPLAY_SETTING_OFF[]     = "Off";
+
+class InfoWidgetPreferences : public QObject
+{
+    Q_OBJECT
+
+public: 
+    enum DisplaySetting {
+        DisplayOff = 0, 
+        DisplayOn    
+    }; 
+    
+    enum Option {
+        DisplayHomeZone = 0x1,
+        DisplayMcn = 0x2,
+        DisplayActiveLine = 0x4, 
+        DisplaySatText = 0x8,
+        DisplaySpn = 0x10
+    };
+    Q_DECLARE_FLAGS(Options, Option)
+
+public:
+    InfoWidgetPreferences(QObject *parent = NULL);
+    ~InfoWidgetPreferences();
+
+    bool storePreferences();
+    void restorePreferences();
+    QStringList preferenceNames();
+            
+    bool isPreferenceSet(Option preferenceId) const;
+    QString preference(Option preferenceId) const;
+    InfoWidgetPreferences::Options preferences() const;
+    void setPreference(Option preferenceId, const QString &preferenceString);
+     
+    bool validate(); 
+    int visibleItemCount();
+
+signals:
+    void prefChanged(int option,int displaySetting);
+		
+private:
+    Q_DISABLE_COPY(InfoWidgetPreferences)
+
+    InfoWidgetPreferences::Options m_options; 
+    InfoWidgetPreferences::Options m_validatedOptions;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(InfoWidgetPreferences::Options)
+
+#endif // INFOWIDGETPREFERENCES_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandler.h	Fri Jun 04 10:19:18 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 INFOWIDGETSATHANDLER_H_
+#define INFOWIDGETSATHANDLER_H_
+
+#include <QObject>
+#include <rsatservice.h>
+
+
+class InfoWidgetSatHandlerPrivate;
+
+class InfoWidgetSatHandler: public QObject
+    {
+    Q_OBJECT
+    
+public:    
+    InfoWidgetSatHandler(QObject *parent = NULL);
+    ~InfoWidgetSatHandler();    
+    
+    void connect(bool connect);
+        
+    const QString& satDisplayText() const; 
+    void setSatDisplayText(const QString& displayText);
+
+    void logCurrentInfo(); 
+    
+    void handleIdleModeTxtMessage( int idleResult );
+    void handleSatError( int operation, int errorCode );
+
+signals: 
+    void handleMessage( int message );
+    void handleError( int operation, int errorCode );
+
+    
+private: 
+    QString m_displayText;
+    
+    int m_connected;
+    
+    InfoWidgetSatHandlerPrivate *d_ptr;
+    RSatService m_satService;
+    
+    }; 
+
+#endif /* INFOWIDGETSATHANDLER_H_ */
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetsathandlerprivate.h	Fri Jun 04 10:19:18 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:  
+ *
+ */
+ 
+#include <rsatservice.h>
+#include <rsatsession.h>
+#include <QString>
+
+class InfoWidgetSatHandler;
+
+class InfoWidgetSatHandlerPrivate: public CActive
+{
+public:  
+    
+    InfoWidgetSatHandlerPrivate(InfoWidgetSatHandler *iwSatHandler, RSatService& iSatService);
+    ~InfoWidgetSatHandlerPrivate();
+ 
+    void startObserving();
+    
+    int connect();
+    int disconnect();
+
+private: 
+ 
+    void activate();
+    void getIdleModeData();
+    
+    void RunL();
+    void DoCancel();
+       
+private: // Data
+   
+    InfoWidgetSatHandler *q_ptr;
+    RSatService& m_satService;
+    RSatSession m_satSession;
+    RSatService::TSATIdleResult m_idleResult;
+    
+    QString m_idleTxt;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,993 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "infowidget.h"
+
+#include <hbanchorlayout.h>
+#include <hbiconitem.h>
+#include <hbmarqueeitem.h>
+#include <hbfontspec.h>
+#include <hbdialog.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbcheckbox.h>
+#include <hbpushbutton.h>
+#include <hbevent.h>
+#include <hbcolorscheme.h>
+#include <hbmessagebox.h>
+#include <hbframedrawer.h>
+#include <QPainter>
+#include <QPainterPath>
+#include <QBrush>
+#include <QGraphicsLinearLayout>
+#include <QApplication>
+#include <QLocale>
+#include <QTranslator>
+#include "infowidgetlogging.h"
+#include "infowidgetengine.h"
+#include "infowidgetlayoutmanager.h"
+#include "infowidgetpreferences.h"
+
+const int INFOWIDGET_ROUNDING = 15;
+const int INFOWIDGET_DEFAULT_HEIGHT = 100;
+const int INFOWIDGET_DEFAULT_WIDTH = 100;
+const char *TS_FILE_OPERATOR_WIDGET = "operator_widget"; 
+const char *TS_FILE_COMMON = "common";
+const char *BACKGROUND_COLOR_GROUP_ID = "qtc_default_popup_normal"; 
+const char *BACKGROUND_FRAME_NAME = "qtg_fr_hswidget_normal"; 
+
+/*!
+  \class InfoWidget
+  \brief Operator info widget main class. 
+
+   Implements HomeScreen specific slots and 
+   graphical representation of the 
+   Operator Info widget. 
+
+   Derived from HbWidget.
+    
+*/
+
+/*!
+    InfoWidget::InfoWidget() 
+*/
+InfoWidget::InfoWidget(QGraphicsItem* parent, Qt::WindowFlags flags)
+    : HbWidget(parent, flags),
+    m_engine(NULL), 
+    m_preferences(NULL),
+    m_layoutManager(NULL),
+    m_layout(NULL),
+    m_frameDrawer(NULL),
+    m_layoutChanging(false),
+    m_dragEvent(false), 
+    m_initialized(false)
+{
+    INSTALL_TRACE_MSG_HANDLER; 
+    
+    DPRINT << ": IN";
+    
+    // Localization file loading
+    installTranslator(TS_FILE_OPERATOR_WIDGET);
+    installTranslator(TS_FILE_COMMON);
+    
+    m_layoutManager = new InfoWidgetLayoutManager(this);
+    Q_ASSERT(m_layoutManager); 
+    
+    m_engine = new InfoWidgetEngine(this); 
+    Q_ASSERT(m_engine);
+    
+    m_preferences = new InfoWidgetPreferences(this);
+    Q_ASSERT(m_preferences);
+    
+    QObject::connect( m_preferences, SIGNAL(prefChanged(int,int)),
+                    m_engine, SLOT(preferenceChanged(int,int)));
+    
+    // Setup widget main layout 
+    m_layout = new QGraphicsLinearLayout;    
+    m_layout->setSpacing(0); 
+    m_layout->setContentsMargins(0,0,0,0); 
+    setLayout(m_layout);
+
+    // Read color definitions 
+    m_backGroundColor = HbColorScheme::color(
+            BACKGROUND_COLOR_GROUP_ID);
+    if (!m_backGroundColor.isValid()) {
+        m_backGroundColor = Qt::black; 
+    }
+    
+    // Create background frame drawer 
+    m_frameDrawer = new HbFrameDrawer(
+            BACKGROUND_FRAME_NAME, 
+            HbFrameDrawer::NinePieces);
+    Q_ASSERT(m_frameDrawer); 
+    
+    // Set widget initial size
+    resize(INFOWIDGET_DEFAULT_WIDTH,
+           INFOWIDGET_DEFAULT_HEIGHT); 
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::~InfoWidget() 
+*/
+InfoWidget::~InfoWidget()
+{
+    DPRINT << ": IN"; 
+    
+    // Layout manager item cleanup
+    m_layoutManager->destroyObjects(); 
+    
+    if (m_frameDrawer) {
+        delete m_frameDrawer;
+        m_frameDrawer = NULL; 
+    }
+    
+    // Remove and delete language translators 
+    removeTranslators(); 
+    
+    DPRINT << ": OUT"; 
+    UNINSTALL_TRACE_MSG_HANDLER;
+}
+
+/*!
+    InfoWidget::onInitialize()
+    
+    Called by HS framework, saved preference data
+    is available when onInitialize() is called and 
+    meta-object data reading should be done here      
+*/
+void InfoWidget::onInitialize()
+{
+    DPRINT << ": IN";
+    
+    m_initialized = true; 
+    
+    // Initialize preferences from meta-object data
+    if (!readPersistentPreferences()) {
+
+        // Reading failed, initialize default values  
+        m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, 
+                DISPLAY_SETTING_ON);
+        m_preferences->setPreference(InfoWidgetPreferences::DisplayMcn, 
+                DISPLAY_SETTING_ON);
+        m_preferences->setPreference(InfoWidgetPreferences::DisplaySatText, 
+                DISPLAY_SETTING_ON);
+    } 
+    m_preferences->storePreferences(); 
+    
+    // Layout components 
+    layoutInfoDisplay();
+    m_layout->activate(); 
+    
+    // Read initial data from model
+    updateInfoDisplay(); 
+    
+    // Listen for model changes 
+    QObject::connect(m_engine, SIGNAL(modelChanged()), 
+            this, SLOT(readModel())); 
+
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::onUninitialize() 
+*/
+void InfoWidget::onUninitialize()
+{
+    DPRINT;
+    m_initialized = false; 
+    m_engine->suspend(); 
+}
+
+/*!
+    InfoWidget::onShow() 
+*/
+void InfoWidget::onShow()
+{
+    DPRINT;
+    m_engine->resume(); 
+}
+
+/*!
+    InfoWidget::onHide() 
+*/
+void InfoWidget::onHide()
+{
+    DPRINT;
+    m_engine->suspend(); 
+}
+
+/*!
+    InfoWidget::installTranslator() const
+*/
+bool InfoWidget::installTranslator(QString translationFile)
+{
+    DPRINT << ": IN";
+
+    QString lang = QLocale::system().name();
+    QString path = "z:/resource/qt/translations/";
+    bool translatorLoaded(false);  
+    
+    QTranslator* widgetTranslator = new QTranslator;
+    translatorLoaded = widgetTranslator->load(
+            path + translationFile + "_" + lang);
+    if (translatorLoaded) {
+        qApp->installTranslator(widgetTranslator);
+        m_translators.append(widgetTranslator); 
+        DPRINT << ": translator installed: " << translationFile; 
+    } else {
+        delete widgetTranslator; 
+        widgetTranslator = NULL; 
+    }
+    
+    DPRINT << ": OUT";
+    return translatorLoaded;
+}
+
+/*!
+    InfoWidget::removeTranslators() const
+*/
+void InfoWidget::removeTranslators()
+{
+    DPRINT << ": IN";
+
+    foreach (QTranslator *translator, m_translators) {
+        qApp->removeTranslator(translator);
+    }    
+    qDeleteAll(m_translators);
+    m_translators.clear();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::boundingRect() const
+*/
+QRectF InfoWidget::boundingRect() const
+{   
+    return rect();
+}
+
+/*!
+    InfoWidget::shape() const
+    
+    Return Operator widget's shape 
+    according to currect display 
+*/
+QPainterPath InfoWidget::shape() const
+{
+    DPRINT;    
+    
+    QPainterPath path;
+    if (m_layoutManager->currentDisplayRole() == 
+                    InfoWidgetLayoutManager::InfoDisplay) {
+        path.addRoundRect(boundingRect(), 
+                INFOWIDGET_ROUNDING, 
+                INFOWIDGET_ROUNDING);
+    } else {
+        path.addRect(boundingRect()); 
+    }
+    return path;
+}
+
+/*!
+    InfoWidget::sizeHint() 
+*/
+QSizeF InfoWidget::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const   
+{
+    Q_UNUSED(which);
+    Q_UNUSED(constraint); 
+    
+    QSizeF requiredSize(
+            INFOWIDGET_DEFAULT_WIDTH,
+            INFOWIDGET_DEFAULT_HEIGHT);
+    
+    if (m_initialized) { 
+        // Read size hint from docml content
+        if (m_layoutManager->currentDisplayRole() == 
+                    InfoWidgetLayoutManager::InfoDisplay) {
+            if (m_layoutManager->contentWidget()) {
+                requiredSize = m_layoutManager->contentWidget()->minimumSize();
+                // Height according number of rows, if 0 or 1 row use minimum size
+                int rowCount = m_preferences->visibleItemCount();
+                if (1 < rowCount) {
+                        requiredSize.rheight() += (rowCount-1)*
+                                m_layoutManager->rowHeight();
+                }
+            }
+        }
+        else if (m_layoutManager->currentDisplayRole() == 
+                InfoWidgetLayoutManager::SettingsDisplay) {
+            if (m_layoutManager->contentWidget()) {
+                requiredSize= m_layoutManager->contentWidget()->size();
+                }
+        } 
+    } 
+    
+    DPRINT << ": returning size: " << requiredSize;
+    return requiredSize; 
+}
+
+/*!
+    InfoWidget::sizePolicy() 
+*/
+QSizePolicy InfoWidget::sizePolicy () const 
+{
+    DPRINT;
+    return QSizePolicy(
+            QSizePolicy::Fixed, 
+            QSizePolicy::Fixed); 
+}
+
+/*!
+    InfoWidget::updateItemsVisibility() 
+*/
+void InfoWidget::updateItemsVisibility()
+{
+    DPRINT <<": IN"; 
+    int layoutRows = 0; 
+    QList<QGraphicsWidget *> widgetsToHide; 
+    
+    // Update layout according to item visibility settings
+    if (m_preferences->preference(InfoWidgetPreferences::DisplaySpn).compare(
+            DISPLAY_SETTING_ON) == 0) {
+        layoutRows++;
+    } else if (m_layoutManager->currentDisplayRole() != InfoWidgetLayoutManager::SettingsDisplay) {
+        m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSpnLabel); 
+        m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSpnIcon); 
+    }
+
+    if (m_preferences->preference(InfoWidgetPreferences::DisplayMcn).compare(
+            DISPLAY_SETTING_ON) == 0) {
+        layoutRows++;
+    } else if (m_layoutManager->currentDisplayRole() != InfoWidgetLayoutManager::SettingsDisplay) {
+        m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleMcnMarqueeItem); 
+        m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleMcnIcon); 
+    }
+    
+    if (m_preferences->preference(InfoWidgetPreferences::DisplaySatText).compare(
+            DISPLAY_SETTING_ON) == 0) {
+        layoutRows++;
+    } else if (m_layoutManager->currentDisplayRole() != InfoWidgetLayoutManager::SettingsDisplay) {
+        m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSatMarqueeItem); 
+        m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleSatTextIcon); 
+    }
+    
+    DPRINT << ": visible layout rows count: " << layoutRows;
+    m_layoutManager->setLayoutRows(layoutRows);
+}
+
+/*!
+    InfoWidget::layoutInfoDisplay()
+    
+    Layout info display    
+*/
+void InfoWidget::layoutInfoDisplay()
+{  
+    startChanges(); 
+    
+    QGraphicsLayout *infoDisplayLayout = 
+        m_layoutManager->layoutInfoDisplay(); 
+    
+    DPRINT << ": IN";
+    if (infoDisplayLayout) {
+        DPRINT << ": infoDisplayLayout has been returned from layout manager";
+
+        QGraphicsWidget *contentWidget = m_layoutManager->contentWidget();
+        if (contentWidget) {
+            DPRINT << ": contentWidget has been returned from layout manager";
+            
+            // Remove old data from layout. 
+            for (int i=0; i < m_layout->count(); i++) {
+                DPRINT << ": item(" << i << ") removed from layout";
+                m_layout->removeAt(i);
+                } 
+            
+            // Add content widget to main layout 
+            m_layout->addItem(contentWidget);
+        }       
+    }
+    
+    m_layoutManager->showAll(); 
+    updateItemsVisibility(); 
+    m_layout->activate(); 
+
+    endChanges(); 
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::layoutSettingsDisplay()
+    
+    Switch to settings display layout   
+*/
+void InfoWidget::layoutSettingsDisplay()
+{  
+    startChanges(); 
+    
+    QGraphicsLayout *settingDisplayLayout = 
+        m_layoutManager->layoutSettingsDisplay(); 
+    
+    DPRINT << ": IN";
+    if (settingDisplayLayout) {
+        DPRINT << ": settingDisplayLayout has been returned from layout manager";
+
+        QGraphicsWidget *contentWidget = m_layoutManager->contentWidget();
+        if (contentWidget) {
+            DPRINT << ": contentWidget has been returned from layout manager";
+                
+            // Remove old data from layout. 
+            for (int i=0; i < m_layout->count(); i++) {
+                DPRINT << ": item(" << i << ") removed from layout";
+                m_layout->removeAt(i);
+                } 
+            
+            // Add content widget to main layout 
+            m_layout->addItem(contentWidget); 
+        }
+        
+        // Connect settings display widget signals 
+        initializeSettingsDisplayItems(); 
+    }
+     
+    m_layoutManager->showAll(); 
+    endChanges(); 
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::initializeInfoDisplayItems()
+*/
+void InfoWidget::initializeInfoDisplayItems()
+{  
+    DPRINT;
+}
+
+/*!
+    InfoWidget::initializeSettingsDisplayItems()
+    
+    Set up initial check box states, lock check boxes 
+    if needed and connect signals to local slots  
+*/
+void InfoWidget::initializeSettingsDisplayItems()
+{  
+    DPRINT << ": IN";
+    
+    HbPushButton *okButton = qobject_cast<HbPushButton *>(m_layoutManager->getWidget(
+            InfoWidgetLayoutManager::RoleOkButton));
+    if (okButton) {
+        QObject::connect(okButton, SIGNAL(clicked()), 
+                this, SLOT(settingsEditingFinished()), Qt::UniqueConnection); 
+    }
+
+    // Connect display setting check boxes
+    HbCheckBox *spnCheckBox = qobject_cast<HbCheckBox *>(m_layoutManager->getWidget(
+            InfoWidgetLayoutManager::RoleSpnCheckBox));
+    if (spnCheckBox) {
+        spnCheckBox->setChecked(m_preferences->isPreferenceSet(
+                InfoWidgetPreferences::DisplaySpn));
+        
+        QObject::connect(spnCheckBox, SIGNAL(stateChanged(int)), 
+                this, SLOT(spnDisplaySettingChanged(int)), Qt::UniqueConnection); 
+    }
+    
+    HbCheckBox *mcnCheckBox = qobject_cast<HbCheckBox *>(m_layoutManager->getWidget(
+            InfoWidgetLayoutManager::RoleMcnCheckBox));
+    if (mcnCheckBox) {
+        mcnCheckBox->setChecked(m_preferences->isPreferenceSet(
+                InfoWidgetPreferences::DisplayMcn));
+        
+        QObject::connect(mcnCheckBox, SIGNAL(stateChanged(int)), 
+                this, SLOT(mcnDisplaySettingChanged(int)), Qt::UniqueConnection); 
+    }
+    
+    HbCheckBox *satTextCheckBox = qobject_cast<HbCheckBox *>(m_layoutManager->getWidget(
+            InfoWidgetLayoutManager::RoleSatTextCheckBox));
+    if (satTextCheckBox) {
+        satTextCheckBox->setChecked(m_preferences->isPreferenceSet(
+                InfoWidgetPreferences::DisplaySatText));
+        
+        QObject::connect(satTextCheckBox, SIGNAL(stateChanged(int)), 
+                this, SLOT(satDisplaySettingChanged(int)), Qt::UniqueConnection); 
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::updateInfoDisplay() 
+*/
+void InfoWidget::updateInfoDisplay()
+{
+    DPRINT << ": IN"; 
+    
+    if (m_layoutManager->currentDisplayRole() == 
+            InfoWidgetLayoutManager::InfoDisplay )
+        {
+        QString text;
+        InfoWidgetEngine::ModelData modelData = m_engine->modelData(); 
+    
+        HbLabel *spnLabel = qobject_cast<HbLabel *>(m_layoutManager->getWidget(
+                InfoWidgetLayoutManager::RoleSpnLabel));
+        if (spnLabel) {
+            if (m_engine->modelData().serviceProviderNameDisplayRequired()) {
+                text = modelData.serviceProviderName();  
+                spnLabel->setPlainText(text);
+            }
+        }        
+        
+        HbMarqueeItem *mcnMarqueeItem = qobject_cast<HbMarqueeItem *>(m_layoutManager->getWidget(
+                InfoWidgetLayoutManager::RoleMcnMarqueeItem));
+        if (mcnMarqueeItem) {
+            text = modelData.mcnName(); 
+            mcnMarqueeItem->setText(text);
+            
+            // Set marquee animation looping mode to infinite
+            mcnMarqueeItem->setLoopCount(-1); 
+                
+            // Finally, start marquee animation
+            DPRINT << ": mcnMarqueeItem->isAnimating()"; 
+            if (!mcnMarqueeItem->isAnimating()) {
+                DPRINT << ": mcnMarqueeItem->startAnimation()";   
+                mcnMarqueeItem->startAnimation();
+            }
+        }
+    
+        HbMarqueeItem *satMarqueeItem = qobject_cast<HbMarqueeItem *>(m_layoutManager->getWidget(
+                InfoWidgetLayoutManager::RoleSatMarqueeItem));
+        if (satMarqueeItem) {
+            text = modelData.satDisplayText(); 
+    
+            satMarqueeItem->setText(text);
+            
+            // Set marquee animation looping mode to infinite
+            satMarqueeItem->setLoopCount(-1); 
+                        
+            // Finally, start marquee animation
+            DPRINT << ": satMarqueeItem->isAnimating()"; 
+            if (!satMarqueeItem->isAnimating()) {
+                DPRINT << ": mcnMarqueeItem->startAnimation()";   
+                satMarqueeItem->startAnimation();
+            }
+        }
+    }
+}
+
+/*!
+    InfoWidget::readModel() 
+    
+    Read model data. Model's modelChanged - signal is connected to this slot.  
+*/
+void InfoWidget::readModel()
+{
+    DPRINT << ": IN"; 
+
+    if (m_layoutManager->currentDisplayRole() == 
+            InfoWidgetLayoutManager::InfoDisplay) { 
+        updateInfoDisplay(); 
+    }
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::handleModelError() 
+    
+    Model error signal is connected to this slot 
+*/
+void InfoWidget::handleModelError(int operation,int errorCode)
+{
+    Q_UNUSED(operation); 
+    Q_UNUSED(errorCode); 
+    DPRINT;
+}
+
+/*!
+    InfoWidget::paint() 
+*/
+void InfoWidget::paint(QPainter *painter, 
+        const QStyleOptionGraphicsItem *option, 
+        QWidget *widget)
+{
+    Q_UNUSED(option); 
+    Q_UNUSED(widget);
+    DPRINT;
+
+    if (!m_layoutChanging) {
+        painter->save();
+        
+        if (m_layoutManager->currentDisplayRole() == 
+                InfoWidgetLayoutManager::InfoDisplay) { 
+            if (m_frameDrawer) {
+                m_frameDrawer->paint(painter,boundingRect());
+            }
+        } else {            
+            QBrush brush(Qt::black); 
+            QPainterPath path;
+            path.addRoundRect(boundingRect(), 
+                    INFOWIDGET_ROUNDING, 
+                    INFOWIDGET_ROUNDING);
+            painter->fillPath(path, brush);
+        }
+        
+        painter->restore();
+    }
+}
+
+/*!
+    InfoWidget::mousePressEvent() 
+*/
+void InfoWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+    Q_UNUSED(event);
+    
+    // Clear flag 
+    m_dragEvent = false; 
+}
+
+/*!
+    InfoWidget::mouseReleaseEvent() 
+*/
+void InfoWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+    Q_UNUSED(event);
+
+    // If in info display and widget wasn't dragged 
+    // change to settings display
+    if ((!m_dragEvent) && 
+          m_layoutManager->currentDisplayRole() == 
+                  InfoWidgetLayoutManager::InfoDisplay) {
+        DPRINT << ": layout settings display";
+        layoutSettingsDisplay(); 
+    }
+    
+    // Clear flag 
+    m_dragEvent = false; 
+}
+
+/*!
+    InfoWidget::mouseMoveEvent() 
+*/
+void InfoWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+    Q_UNUSED(event);
+    
+    // Mouse is moving 
+    // after mouse press event
+    m_dragEvent = true; 
+}
+
+/*!
+    InfoWidget::spnDisplaySettingChanged() 
+*/
+void InfoWidget::spnDisplaySettingChanged(int state)
+{
+    DPRINT << ": state: " << state;
+    if (state == Qt::Checked){
+        m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, DISPLAY_SETTING_ON);
+    } else {
+        m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, DISPLAY_SETTING_OFF);
+    }
+}
+
+/*!
+    InfoWidget::mcnDisplaySettingChanged() 
+*/
+void InfoWidget::mcnDisplaySettingChanged(int state)
+{
+    DPRINT << ": state: " << state; 
+    if (state == Qt::Checked){
+        m_preferences->setPreference(InfoWidgetPreferences::DisplayMcn, DISPLAY_SETTING_ON);
+    } else {
+        m_preferences->setPreference(InfoWidgetPreferences::DisplayMcn, DISPLAY_SETTING_OFF);
+    }
+}
+
+/*!
+    InfoWidget::satDisplaySettingChanged() 
+*/
+void InfoWidget::satDisplaySettingChanged(int state)
+{
+    DPRINT << ": state: " << state; 
+    if (state == Qt::Checked){
+        m_preferences->setPreference(InfoWidgetPreferences::DisplaySatText, DISPLAY_SETTING_ON);
+    } else {
+        m_preferences->setPreference(InfoWidgetPreferences::DisplaySatText, DISPLAY_SETTING_OFF);
+    }
+}
+
+/*!
+    InfoWidget::mcnDisplay() 
+    
+    Getter function for Meta-object property "mcnDisplay"
+*/
+QString InfoWidget::mcnDisplay()
+{
+    DPRINT; 
+    return m_preferences->preference(InfoWidgetPreferences::DisplayMcn); 
+}
+
+/*!
+    InfoWidget::setMcnDisplay() 
+    
+    Setter function for Meta-object property "mcnDisplay"
+*/
+void InfoWidget::setMcnDisplay(QString value)
+{
+    DPRINT;
+    m_preferences->setPreference(InfoWidgetPreferences::DisplayMcn, value);
+    }
+
+/*!
+    InfoWidget::homeZoneDisplay() 
+    
+    Getter function for Meta-object property "homeZoneDisplay"
+*/
+QString InfoWidget::homeZoneDisplay()
+{
+    DPRINT; 
+    return m_preferences->preference(InfoWidgetPreferences::DisplayHomeZone); 
+}
+
+/*!
+    InfoWidget::setHomeZoneDisplay()
+    
+    Setter function for Meta-object property "homeZoneDisplay" 
+*/
+void InfoWidget::setHomeZoneDisplay(QString value)
+{
+    DPRINT; 
+    m_preferences->setPreference(InfoWidgetPreferences::DisplayHomeZone, value);
+}
+
+/*!
+    InfoWidget::activeLineDisplay() 
+    
+    Getter function for Meta-object property "activeLineDisplay"
+*/
+QString InfoWidget::activeLineDisplay()
+{
+    DPRINT; 
+    return m_preferences->preference(InfoWidgetPreferences::DisplayActiveLine);
+}
+
+/*!
+    InfoWidget::setActiveLineDisplay() 
+    
+    Setter function for Meta-object property "activeLineDisplay"
+*/
+void InfoWidget::setActiveLineDisplay(QString value)
+{
+    DPRINT; 
+    m_preferences->setPreference(InfoWidgetPreferences::DisplayActiveLine, value);
+}
+
+/*!
+    InfoWidget::satDisplay()
+    
+    Getter function for Meta-object property "satDisplay" 
+*/
+QString InfoWidget::satDisplay()
+{
+    DPRINT; 
+    return m_preferences->preference(InfoWidgetPreferences::DisplaySatText);
+}
+
+/*!
+    InfoWidget::setSatDisplay()
+    
+    Setter function for Meta-object property "satDisplay" 
+*/
+void InfoWidget::setSatDisplay(QString value)
+{
+    DPRINT;
+    m_preferences->setPreference(InfoWidgetPreferences::DisplaySatText, value);
+}
+
+/*!
+    InfoWidget::spnDisplay()
+    
+    Getter function for Meta-object property "spnDisplay" 
+*/
+QString InfoWidget::spnDisplay()
+{
+    DPRINT; 
+    return m_preferences->preference(InfoWidgetPreferences::DisplaySpn);
+}
+
+/*!
+    InfoWidget::setSpnDisplay()
+    
+    Setter function for Meta-object property "spnDisplay" 
+*/
+void InfoWidget::setSpnDisplay(QString value)
+{
+    DPRINT;
+    m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, value);
+}
+
+/*!
+    InfoWidget::readPersistentPreferences()
+    
+    Read Meta-object properties and store to preference handler. 
+    Restores preferences from previous session.   
+*/
+bool InfoWidget::readPersistentPreferences()
+{
+    DPRINT << ": IN";
+    bool changed(false); 
+    
+    QString propertyValue;
+    
+    propertyValue = QObject::property("homeZoneDisplay").toString();
+    m_preferences->setPreference(InfoWidgetPreferences::DisplayHomeZone, 
+            propertyValue);
+    
+    propertyValue = QObject::property("mcnDisplay").toString();
+    m_preferences->setPreference(InfoWidgetPreferences::DisplayMcn, 
+            propertyValue);
+    
+    propertyValue = QObject::property("activeLineDisplay").toString();
+    m_preferences->setPreference(InfoWidgetPreferences::DisplayActiveLine, 
+            propertyValue);
+    
+    propertyValue = QObject::property("satDisplay").toString();
+    m_preferences->setPreference(InfoWidgetPreferences::DisplaySatText, 
+            propertyValue);
+
+    propertyValue = QObject::property("spnDisplay").toString();
+    m_preferences->setPreference(InfoWidgetPreferences::DisplaySpn, 
+            propertyValue);
+
+    // Check that at least one item is set visible and  
+    // store preferences if true 
+    if (m_preferences->validate()) {
+        changed = m_preferences->storePreferences(); 
+    } 
+        
+    DPRINT << ": OUT";
+    return changed; 
+}
+
+/*!
+    InfoWidget::initializeCheckBoxStates()
+*/
+void InfoWidget::initializeCheckBoxStates()
+{
+    DPRINT << ": IN";
+
+    HbCheckBox *spnCheckBox = qobject_cast<HbCheckBox *>(m_layoutManager->getWidget(
+            InfoWidgetLayoutManager::RoleSpnCheckBox));
+    if (spnCheckBox) {
+    spnCheckBox->setChecked(m_preferences->isPreferenceSet(
+                InfoWidgetPreferences::DisplaySpn));
+    }
+    
+    HbCheckBox *mcnCheckBox = qobject_cast<HbCheckBox *>(m_layoutManager->getWidget(
+            InfoWidgetLayoutManager::RoleMcnCheckBox));
+    if (mcnCheckBox) {
+        mcnCheckBox->setChecked(m_preferences->isPreferenceSet(
+                InfoWidgetPreferences::DisplayMcn));
+    }
+    
+    HbCheckBox *satTextCheckBox = qobject_cast<HbCheckBox *>(m_layoutManager->getWidget(
+            InfoWidgetLayoutManager::RoleSatTextCheckBox));
+    if (satTextCheckBox) {
+        satTextCheckBox->setChecked(m_preferences->isPreferenceSet(
+                InfoWidgetPreferences::DisplaySatText));
+    }
+        
+    DPRINT << ": OUT"; 
+}
+
+/*!
+    InfoWidget::settingsEditingFinished()
+*/
+void InfoWidget::settingsEditingFinished()
+{
+    DPRINT << ": IN";
+    
+    // Save settings data if validation succeeds 
+    if (m_preferences->validate()) {
+        DPRINT << ": switching to info display";
+        
+        // Store preferences if changed 
+        if (m_preferences->storePreferences()) {
+            // Signal Homescreen FW   
+            emit setPreferences(
+                    m_preferences->preferenceNames());
+            }
+        
+        // ToDo: do only if settings have really changed 
+        m_layoutManager->reloadWidgets(
+                InfoWidgetLayoutManager::InfoDisplay);
+
+        // Switch to info display 
+        layoutInfoDisplay();
+        updateInfoDisplay();
+        
+    } else {
+        DPRINT << ": staying in settings display";    
+        // Display warning note
+        settingsValidationFailed(); 
+        
+        // Restore check box states 
+        initializeCheckBoxStates(); 
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidget::startChanges()
+*/
+void InfoWidget::startChanges()
+{
+    DPRINT;
+    m_layoutChanging = true; 
+}
+
+/*!
+    InfoWidget::endChanges()
+*/
+void InfoWidget::endChanges()
+{
+    DPRINT;
+    m_layoutChanging = false; 
+}
+
+/*!
+   \reimp
+*/
+void InfoWidget::changeEvent(QEvent *event)
+{
+   DPRINT << ": IN";
+   
+   if (event->type() == HbEvent::ThemeChanged) {
+       DPRINT << ": HbEvent::ThemeChanged";
+       m_backGroundColor = HbColorScheme::color(
+               BACKGROUND_COLOR_GROUP_ID);
+       if (!m_backGroundColor.isValid()) {
+           m_backGroundColor = Qt::black; 
+       }
+   }
+   HbWidget::changeEvent(event);
+   
+   DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidget::settingsValidationFailed()
+*/
+void InfoWidget::settingsValidationFailed()
+{
+   DPRINT << ": IN";
+   
+   if (m_layoutManager->currentDisplayRole() == 
+                  InfoWidgetLayoutManager::SettingsDisplay) {
+       HbMessageBox::warning(
+               hbTrId("txt_operatorwidget_info_select_one"));
+   }
+
+   DPRINT << ": OUT";
+}
+
+
+// End of File. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "infowidgetengine.h"
+#include "infowidgetnetworkhandler.h"
+#include "infowidgetsathandler.h"
+#include <networkhandlingproxy.h>
+#include "infowidgetlogging.h"
+#include "infowidgetpreferences.h"
+
+/*!
+  \class InfoWidgetEngine
+  \brief Engine functionality of 
+         Operator info widget
+*/
+
+
+/*!
+   InfoWidgetEngine::InfoWidgetEngine
+ */
+InfoWidgetEngine::InfoWidgetEngine(QObject *parent): 
+    QObject(parent),
+    m_networkHandler(new InfoWidgetNetworkHandler),
+    m_satHandler(new InfoWidgetSatHandler)
+{
+    DPRINT << ": IN";
+    
+    QObject::connect(
+        m_networkHandler.data(), SIGNAL(networkError(int, int)),
+        this, SLOT(handleNetworkError(int, int))); 
+    
+    QObject::connect(
+        m_networkHandler.data(), SIGNAL(networkDataChanged()),
+        this, SLOT(updateNetworkDataToModel()));
+
+    QObject::connect(m_satHandler.data(), 
+            SIGNAL(handleError(int, int)),
+            this, SLOT(handleSatError(int, int))); 
+    
+    QObject::connect(m_satHandler.data(), 
+                SIGNAL(handleMessage(int)),
+                this, SLOT(updateSatDataToModel())); 
+
+    updateNetworkDataToModel();
+    updateSatDataToModel();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidgetEngine::~InfoWidgetEngine
+ */
+InfoWidgetEngine::~InfoWidgetEngine()
+{
+    DPRINT;
+}    
+
+/*!
+   InfoWidgetEngine::logModelData
+   
+   Utility function for logging model data
+ */
+void InfoWidgetEngine::logModelData()
+{
+    DPRINT << ": mcn name: " << m_modelData.mcnName();
+    DPRINT << ": mcn type: " << m_modelData.mcnIndicatorType();
+    DPRINT << ": service provider name: " << 
+            m_modelData.serviceProviderName();
+    DPRINT << ": service provider display required: " << 
+            m_modelData.serviceProviderNameDisplayRequired(); 
+
+    DPRINT << ": homezone text tag: " << 
+            m_modelData.homeZoneTextTag();
+    DPRINT << ": homezone indicator type: " << 
+            m_modelData.homeZoneIndicatorType(); 
+    DPRINT << ": active line: " << 
+            m_modelData.activeLine(); 
+} 
+
+/*!
+   InfoWidgetEngine::modelData
+   
+   Getter for model data. 
+ */
+const InfoWidgetEngine::ModelData& InfoWidgetEngine::modelData() const
+{
+    DPRINT;
+    return m_modelData; 
+}
+
+/*!
+   InfoWidgetEngine::updateNetworkDataToModel
+ */
+void InfoWidgetEngine::updateNetworkDataToModel()
+{
+    DPRINT << ": IN"; 
+    
+    m_networkHandler->logCurrentInfo();
+    
+    if (m_networkHandler->isOnline()) {
+        // Read network handler data to model data
+        m_modelData.setServiceProviderName(
+                m_networkHandler->serviceProviderName());
+        m_modelData.setServiceProviderNameDisplayRequired(
+                m_networkHandler->serviceProviderNameDisplayRequired());
+    
+        m_modelData.setMcnName(m_networkHandler->mcnName()); 
+        m_modelData.setMcnIndicatorType(
+                m_networkHandler->mcnIndicatorType());
+        
+        m_modelData.setHomeZoneIndicatorType(
+            m_networkHandler->homeZoneIndicatorType());
+        m_modelData.setHomeZoneTextTag(
+                m_networkHandler->homeZoneTextTag());
+    } else {
+        // Not registered to network, clear data
+        m_modelData.setServiceProviderName(QString(""));
+        m_modelData.setMcnName(QString(""));
+        m_modelData.setHomeZoneTextTag(QString("")); 
+    }
+        
+    emit modelChanged();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidgetEngine::updateSatDataToModel
+ */
+void InfoWidgetEngine::updateSatDataToModel()
+{
+    DPRINT << ": IN";
+    
+    if (m_satHandler) {
+        // Log current network data 
+        m_satHandler->logCurrentInfo();
+        // Read SAT handler data to model data
+        m_modelData.setSatDisplayText(
+                m_satHandler->satDisplayText());
+        
+        emit modelChanged(); 
+    } 
+     
+    DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidgetEngine::updateLineDataToModel
+ */
+void InfoWidgetEngine::updateLineDataToModel()
+{
+    DPRINT;
+}
+
+/*!
+   InfoWidgetEngine::handleNetworkError
+ */
+void InfoWidgetEngine::handleNetworkError(
+        int operation, int errorCode)
+{
+    DPRINT << ": operation: " << operation << 
+            " error code: " << errorCode; 
+}
+
+/*!
+   InfoWidgetEngine::handleSatError
+ */
+void InfoWidgetEngine::handleSatError(
+        int operation, int errorCode)
+{
+    DPRINT << ": operation: " << operation << 
+            " error code: " << errorCode; 
+}
+
+/*!
+   InfoWidgetEngine::handleLineError
+ */
+void InfoWidgetEngine::handleLineError(
+        int operation, int errorCode)
+{
+    DPRINT << ": operation: " << operation << " error code: " << errorCode; 
+}
+
+/*!
+   InfoWidgetEngine::preferenceChanged
+ */
+void InfoWidgetEngine::preferenceChanged(
+        int option, int displaySetting)
+{
+    DPRINT << "option: " << option << " displaySetting: " << displaySetting;
+    switch(option){
+    case InfoWidgetPreferences::DisplayMcn:
+        if (displaySetting == InfoWidgetPreferences::DisplayOn) {
+            m_networkHandler->enableMcn();
+        } else {
+            m_networkHandler->disableMcn();
+        }   
+        break; 
+    case InfoWidgetPreferences::DisplaySatText:
+        m_satHandler->connect(displaySetting);
+        break;
+    default:
+        break;
+    }
+    DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidgetEngine::suspend
+   
+   Called when widget is deactivated 
+   and widget should suspend all 
+   possible activities 
+ */
+void InfoWidgetEngine::suspend() 
+{
+    DPRINT;
+    m_networkHandler->suspend(); 
+}
+
+/*!
+   InfoWidgetEngine::preferenceChanged
+   
+   Called when widget is activated 
+   and widget can resume activities
+ */
+void InfoWidgetEngine::resume()
+{
+    DPRINT;
+    m_networkHandler->resume(); 
+}
+
+
+// End of File. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetengine_s.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "infowidgetengine.h"
+#include "infowidgetlogging.h"
+
+/*!
+   InfoWidgetEngine::InfoWidgetEngine
+ */
+InfoWidgetEngine::InfoWidgetEngine(QObject *parent): 
+    QObject(parent)
+{
+    DPRINT;
+}
+
+/*!
+   InfoWidgetEngine::~InfoWidgetEngine
+ */
+InfoWidgetEngine::~InfoWidgetEngine()
+{
+    DPRINT;
+}    
+
+/*!
+   InfoWidgetEngine::logModelData
+   
+   Utility function for logging model data
+ */
+void InfoWidgetEngine::logModelData()
+{
+    DPRINT << ": mcn name: " << m_modelData.mcnName(); 
+    DPRINT << ": service provider name: " << m_modelData.serviceProviderName();
+    DPRINT << ": homezone text tag: " << m_modelData.homeZoneTextTag();
+    
+    DPRINT << ": mcn type: " << m_modelData.mcnIndicatorType(); 
+    DPRINT << ": active line: " << m_modelData.activeLine(); 
+    DPRINT << ": homezone indicator type: " << m_modelData.homeZoneIndicatorType(); 
+} 
+
+/*!
+   InfoWidgetEngine::modelData
+   
+   Getter for model data. 
+ */
+const InfoWidgetEngine::ModelData& InfoWidgetEngine::modelData() const
+{
+    DPRINT;
+    return m_modelData; 
+}
+
+/*!
+   InfoWidgetEngine::setModelData
+   
+   Enables setting model initial data to engine.   
+ */
+void InfoWidgetEngine::setModelData(const InfoWidgetEngine::ModelData &data)
+{
+    DPRINT; 
+    m_modelData = data;
+}
+
+/*!
+   InfoWidgetEngine::updateNetworkDataToModel
+ */
+void InfoWidgetEngine::updateNetworkDataToModel()
+{
+    DPRINT;
+}
+
+/*!
+   InfoWidgetEngine::updateSatDataToModel
+ */
+void InfoWidgetEngine::updateSatDataToModel()
+{
+    DPRINT;
+}
+
+/*!
+   InfoWidgetEngine::updateLineDataToModel
+ */
+void InfoWidgetEngine::updateLineDataToModel()
+{
+    DPRINT;
+}
+
+/*!
+   InfoWidgetEngine::handleNetworkError
+ */
+void InfoWidgetEngine::handleNetworkError(int operation, int errorCode)
+{
+    DPRINT << ": operation: " << operation << " error code: " << errorCode; 
+}
+
+/*!
+   InfoWidgetEngine::handleSatError
+ */
+void InfoWidgetEngine::handleSatError(int operation, int errorCode)
+{
+    DPRINT << ": operation: " << operation << " error code: " << errorCode; 
+}
+
+/*!
+   InfoWidgetEngine::handleLineError
+ */
+void InfoWidgetEngine::handleLineError(int operation, int errorCode)
+{
+    DPRINT << ": operation: " << operation << " error code: " << errorCode; 
+}
+
+// End of File. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlayoutmanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,564 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "infowidgetlayoutmanager.h"
+#include <QtGlobal>
+#include <QObject>
+#include <QGraphicsWidget>
+#include <hbdocumentloader.h>
+#include <hblabel.h>
+#include <hbmarqueeitem.h>
+#include <hbiconitem.h> 
+#include <hbpushbutton.h>
+#include "infowidgetlogging.h"
+
+
+const char INFOWIDGET_DOCML_FILE[] = ":/resource/infowidget.docml";
+
+// Docml widget name mappings 
+const char LAYOUT_PREFIX_INFO_DISPLAY[] = "id:";
+const char LAYOUT_PREFIX_SETTINGS_DISPLAY[] = "sd:";
+const char LAYOUT_NAME_CONTENT[] = "content";
+const char LAYOUT_NAME_MCNMARQUEEITEM[] = "mcnMarqueeItem";
+const char LAYOUT_NAME_SPNLABEL[] = "spnLabel";
+const char LAYOUT_NAME_SATMARQUEEITEM[] = "satMarqueeItem";
+const char LAYOUT_NAME_SPNICON[] = "spnIcon";
+const char LAYOUT_NAME_MCNICON[] = "mcnIcon";
+const char LAYOUT_NAME_SATTEXTICON[] = "satTextIcon";
+const char LAYOUT_NAME_SPNCHECKBOX[] = "spnCheckBox";
+const char LAYOUT_NAME_MCNCHECKBOX[] = "mcnCheckBox";
+const char LAYOUT_NAME_SATTEXTCHECKBOX[] = "satTextCheckBox";
+const char LAYOUT_NAME_OKBUTTON[] = "okButton";
+const char LAYOUT_NAME_CONTAINER[] = "container";
+const char LAYOUT_NAME_SETTINGSCONTAINER[] = "settingsContainer";
+
+
+/*!
+  \class InfoWidgetDocumentLoader
+  \brief Custom document loader for Operator info widget  
+
+   Derived from HbDocumentLoader.
+    
+*/
+
+/*!
+  InfoWidgetDocumentLoader::InfoWidgetDocumentLoader()
+ */
+InfoWidgetDocumentLoader::InfoWidgetDocumentLoader()
+{
+}
+
+/*!
+  InfoWidgetDocumentLoader::createObject()
+ */
+QObject *InfoWidgetDocumentLoader::createObject(
+    const QString &type,
+    const QString &name)
+{
+    DPRINT << ": IN";
+    
+    DPRINT << ": type: "<< type;
+    DPRINT << ": name: "<< name;
+    
+    if ( type == HbMarqueeItem::staticMetaObject.className() ) {
+        DPRINT << ": HbMarqueeItem";
+        QObject *object = new HbMarqueeItem;
+        object->setObjectName(name);
+        DPRINT << ": HbMarqueeitem found, OUT";
+        return object;
+    }
+    
+    DPRINT << ": OUT";
+    return HbDocumentLoader::createObject(type, name);
+}
+
+
+/*!
+  \class InfoWidgetLayoutManager
+  \brief Layout manager class for Operator info widget.   
+
+   Handles layout document loading and accessing the loaded 
+   widgets.   
+    
+*/
+
+/*!
+   InfoWidgetLayoutManager::InfoWidgetLayoutManager()
+*/
+InfoWidgetLayoutManager::InfoWidgetLayoutManager(QObject *parent) 
+: QObject(parent), 
+  m_documentLoader(NULL), 
+  m_displayRole(InfoDisplay),
+  m_layoutRows(0)
+{
+    DPRINT << ": IN"; 
+    
+    // Fill supported layout item roles for info display
+    QList<LayoutItemRole> displayWidgetRoles = widgetRoles(InfoDisplay);
+    
+    // Try to load all widgets in list by widget role 
+    bool loadResult = loadWidgets(InfoDisplay, 
+            displayWidgetRoles,
+            m_infoDisplayWidgets); 
+    DPRINT << ": info display widget load result: " << loadResult;
+  
+    // Fill supported layout item roles for settings display
+    displayWidgetRoles = widgetRoles(SettingsDisplay);
+  
+    // Try to load all widgets in list by widget role 
+    loadResult = loadWidgets(SettingsDisplay, 
+            displayWidgetRoles,
+            m_settingsDisplayWidgets); 
+    DPRINT << ": settings display widget load result: " << loadResult;
+
+    DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidgetLayoutManager::~InfoWidgetLayoutManager()
+*/
+InfoWidgetLayoutManager::~InfoWidgetLayoutManager()
+{
+    DPRINT << ": IN";
+    
+    if (m_documentLoader) { 
+        delete m_documentLoader;
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidgetLayoutManager::destroyObjects()
+   
+   Call on destruction for freeing  
+   loaded objects. Parent items are deleted 
+   causing deletion of corresponding object tree 
+*/
+void InfoWidgetLayoutManager::destroyObjects()
+{
+    DPRINT << ": IN";
+    
+    // Destroy parent items 
+    QGraphicsWidget *contentInfoDisplay =  
+            m_infoDisplayWidgets.value(RoleContent); 
+    if (contentInfoDisplay) {
+        delete contentInfoDisplay;
+        m_infoDisplayWidgets.clear(); 
+    }
+    
+    QGraphicsWidget *contentSettingsDisplay=  
+            m_settingsDisplayWidgets.value(RoleContent); 
+    if (contentSettingsDisplay) {
+        delete contentSettingsDisplay;
+        m_settingsDisplayWidgets.clear(); 
+    }
+
+    DPRINT << ": OUT";    
+}
+
+
+/*!
+   InfoWidgetLayoutManager::currentDisplayRole()
+*/
+InfoWidgetLayoutManager::DisplayRole InfoWidgetLayoutManager::currentDisplayRole() 
+{
+    DPRINT; 
+    return m_displayRole;
+} 
+
+/*!
+   InfoWidgetLayoutManager::currentWidgetRoles()
+*/
+QList<InfoWidgetLayoutManager::LayoutItemRole> InfoWidgetLayoutManager::currentWidgetRoles() 
+{
+    DPRINT; 
+    return m_widgets.keys(); 
+} 
+
+/*!
+   InfoWidgetLayoutManager::layoutRows()
+*/
+int InfoWidgetLayoutManager::layoutRows() const 
+{
+    DPRINT; 
+    return m_layoutRows;
+} 
+
+/*!
+   InfoWidgetLayoutManager::setLayoutRows()
+*/
+void InfoWidgetLayoutManager::setLayoutRows(int rows) 
+{
+    DPRINT; 
+    m_layoutRows = rows; 
+} 
+
+/*!
+   InfoWidgetLayoutManager::rowHeight()
+*/
+qreal InfoWidgetLayoutManager::rowHeight() const
+{
+    DPRINT; 
+    HbStyle style; 
+    qreal rowHeight;
+
+    bool ok = style.parameter("hb-param-graphic-size-primary-small", 
+            rowHeight);
+    if (!ok) {
+        DPRINT << ": ERROR! Paremeters reading failed!! Using default";
+        rowHeight = 26.8;
+    }
+    
+    DPRINT << ": rowHeight: " << rowHeight;
+    return rowHeight; 
+}
+
+/*!
+   InfoWidgetLayoutManager::contentWidget()
+*/
+QGraphicsWidget* InfoWidgetLayoutManager::contentWidget()
+{
+    DPRINT; 
+    return getWidget(RoleContent); 
+}
+
+/*!
+   InfoWidgetLayoutManager::getWidget();
+*/
+QGraphicsWidget* InfoWidgetLayoutManager::getWidget(LayoutItemRole itemRole)
+{
+    DPRINT << ": item role: " << itemRole;
+    
+    QGraphicsWidget *widget = m_widgets.value(itemRole); 
+    if (widget) {
+        DPRINT << ": widget: " << widget;
+    }
+    
+    return widget; 
+}
+
+/*!
+   InfoWidgetLayoutManager::removeWidget();
+*/
+void InfoWidgetLayoutManager::removeWidget(LayoutItemRole itemRole)
+{
+    DPRINT << ": item role: " << itemRole;
+    
+    QGraphicsWidget *widget = m_widgets.value(itemRole); 
+    if (widget) {
+        DPRINT << ": removing widget: " << widget;        
+        m_widgets.remove(itemRole);
+        delete widget;
+    }
+}
+
+/*!
+   InfoWidgetLayoutManager::hideWidget();
+*/
+void InfoWidgetLayoutManager::hideWidget(LayoutItemRole itemRole)
+{
+    DPRINT << ": item role: " << itemRole;
+    
+    QGraphicsWidget *widget = m_widgets.value(itemRole); 
+    if (widget) {
+        DPRINT << ": hiding widget: " << widget;
+        widget->hide();
+    }
+}
+
+/*!
+   InfoWidgetLayoutManager::hideAll();
+*/
+void InfoWidgetLayoutManager::hideAll()
+{
+    DPRINT << ": IN";
+    
+    QMapIterator<LayoutItemRole, QGraphicsWidget *> iterator(m_widgets);
+    while (iterator.hasNext()) {
+        iterator.next();
+        QGraphicsWidget *widget = iterator.value(); 
+        if (widget) {
+            widget->hide();
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+   InfoWidgetLayoutManager::showAll();
+*/
+void InfoWidgetLayoutManager::showAll()
+{
+    DPRINT << ": IN";
+    
+    QMapIterator<LayoutItemRole, QGraphicsWidget *> iterator(m_widgets);
+    while (iterator.hasNext()) {
+        iterator.next();
+        QGraphicsWidget *widget = iterator.value(); 
+        if (widget) {
+            widget->show(); 
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidgetLayoutManager::layoutInfoDisplay()
+*/
+QGraphicsLayout* InfoWidgetLayoutManager::layoutInfoDisplay()
+{   
+    DPRINT << ": IN";
+
+    hideAll(); 
+
+    m_displayRole = InfoDisplay;
+    m_widgets = m_infoDisplayWidgets; 
+           
+    QGraphicsLayout *activeLayout(NULL); 
+    DPRINT << ": getting content item and using its layout for activeLayout";
+    QGraphicsWidget *content = getWidget(RoleContent); 
+    if (content) {
+        DPRINT << ": content found, getting layout";
+        activeLayout = content->layout(); 
+    }
+
+    DPRINT  << ": OUT";
+    return activeLayout; 
+}
+
+/*!
+    InfoWidgetLayoutManager::layoutSettingsDisplay()
+*/
+QGraphicsLayout* InfoWidgetLayoutManager::layoutSettingsDisplay()
+{   
+    DPRINT << ": IN";
+    
+    hideAll(); 
+    
+    m_displayRole = SettingsDisplay;
+    m_widgets = m_settingsDisplayWidgets; 
+    
+    QGraphicsLayout *activeLayout(NULL); 
+    DPRINT << ": getting content item and using its layout for activeLayout";
+    QGraphicsWidget *content = getWidget(RoleContent); 
+    if (content) {
+        DPRINT << ": content found, getting layout";
+        activeLayout = content->layout(); 
+    }
+
+    DPRINT  << ": OUT";
+    return activeLayout; 
+}
+
+/*!
+    InfoWidgetLayoutManager::loadWidgets()
+*/
+bool InfoWidgetLayoutManager::loadWidgets(const DisplayRole displayRole, 
+        const QList<LayoutItemRole> &displayWidgets,
+        QMap<LayoutItemRole, QGraphicsWidget *> &widgetMap)
+{
+    DPRINT << ": IN";
+    bool loadResult(false); 
+
+    // Cleanup previously loaded content in case of any data  
+    widgetMap.clear(); 
+    
+    if (!m_documentLoader) {
+        m_documentLoader = new InfoWidgetDocumentLoader;
+    }    
+    Q_ASSERT(m_documentLoader); 
+    
+    bool loaded = false;
+    m_documentLoader->load(INFOWIDGET_DOCML_FILE, &loaded);
+    
+    Q_ASSERT_X(loaded, 
+            "InfoWidgetLayoutManager", 
+            "Invalid docml file");    
+    
+    DPRINT << ": document " << INFOWIDGET_DOCML_FILE << " loaded successfully"; 
+    
+    QGraphicsWidget *widget(NULL);
+    LayoutItemRole currentWidgetRole;
+    
+    foreach (currentWidgetRole, displayWidgets) {
+        DPRINT << ": iterating displayWidgets, current role: " << static_cast<int>(currentWidgetRole);
+    
+        widget = loadWidget(*m_documentLoader, displayRole, currentWidgetRole);
+        if (widget) {
+            DPRINT << ": widget found, inserting to widget map";
+            widgetMap.insert(currentWidgetRole, widget);
+            widget = NULL;
+        } else {
+            DCRITICAL << ": ERROR, widget not found!";
+        }
+    }
+    
+    if (widgetMap.count() == displayWidgets.count()) {
+        DPRINT << ": all widgets loaded";
+        loadResult = true;
+    } else {
+        DCRITICAL << ": error, all widgets were not loaded";
+    }        
+    
+    DPRINT << ": OUT";
+    return loadResult; 
+}
+
+/*!
+    InfoWidgetLayoutManager::reloadWidgets()
+*/
+bool InfoWidgetLayoutManager::reloadWidgets(const DisplayRole displayRole)
+{
+    QList<LayoutItemRole> displayWidgetRoles = widgetRoles(displayRole); 
+    bool loadResult(false); 
+    
+    switch (displayRole) {
+        case InfoDisplay:
+            loadResult = loadWidgets(displayRole, 
+                        displayWidgetRoles,
+                        m_infoDisplayWidgets); 
+            break; 
+        case SettingsDisplay: // Fall through 
+        default: 
+            break; 
+    }
+    return loadResult; 
+}
+
+/*!
+    InfoWidgetLayoutManager::loadWidget()
+    
+    Initialize loader with corresponding document file before calling this single widget loader utility   
+*/
+QGraphicsWidget* InfoWidgetLayoutManager::loadWidget(InfoWidgetDocumentLoader &loader, 
+        DisplayRole displayRole, 
+        LayoutItemRole widgetRole)
+{
+    DPRINT << ": IN";
+     
+    QString widgetPrefix; 
+    if (displayRole == InfoDisplay) {
+        widgetPrefix = LAYOUT_PREFIX_INFO_DISPLAY;
+    } else if (displayRole == SettingsDisplay) {
+        widgetPrefix = LAYOUT_PREFIX_SETTINGS_DISPLAY;
+    }
+        
+    QGraphicsWidget *widget(NULL);
+    QString widgetName = widgetPrefix;
+    
+    switch (widgetRole) 
+        {
+        case RoleContent: 
+            widgetName.append(LAYOUT_NAME_CONTENT);
+        break;     
+        case RoleMcnMarqueeItem: 
+            widgetName.append(LAYOUT_NAME_MCNMARQUEEITEM);
+        break; 
+        case RoleSpnLabel: 
+            widgetName.append(LAYOUT_NAME_SPNLABEL);
+        break;
+        case RoleSatMarqueeItem: 
+            widgetName.append(LAYOUT_NAME_SATMARQUEEITEM);
+        break; 
+        case RoleSpnIcon: 
+            widgetName.append(LAYOUT_NAME_SPNICON);
+        break; 
+        case RoleMcnIcon: 
+            widgetName.append(LAYOUT_NAME_MCNICON);
+        break; 
+        case RoleSatTextIcon: 
+            widgetName.append(LAYOUT_NAME_SATTEXTICON);
+        break;
+        case RoleSpnCheckBox: 
+            widgetName.append(LAYOUT_NAME_SPNCHECKBOX);
+        break; 
+        case RoleMcnCheckBox: 
+            widgetName.append(LAYOUT_NAME_MCNCHECKBOX);
+        break; 
+        case RoleSatTextCheckBox: 
+            widgetName.append(LAYOUT_NAME_SATTEXTCHECKBOX);
+        break; 
+        case RoleOkButton: 
+            widgetName.append(LAYOUT_NAME_OKBUTTON);
+        break; 
+        case RoleContainer: 
+            widgetName.append(LAYOUT_NAME_CONTAINER);
+        break; 
+        case RoleSettingsContainer: 
+            widgetName.append(LAYOUT_NAME_SETTINGSCONTAINER);
+        break; 
+
+        case RoleUndefined: // Fall through 
+        default: 
+            break; 
+        }
+    
+    widget = qobject_cast<QGraphicsWidget *>(loader.findWidget(widgetName));
+    if (!widget) {
+        DCRITICAL << ": ERROR, widget " << widgetName << " not found!";
+    }
+           
+    DPRINT << ": OUT";
+    return widget; 
+}
+
+/*!
+    InfoWidgetLayoutManager::widgetRoles()
+    
+    Returns supported widget roles for specific display
+*/
+const QList<InfoWidgetLayoutManager::LayoutItemRole> InfoWidgetLayoutManager::widgetRoles(
+        DisplayRole displayRole) const
+{
+    DPRINT << ": IN";
+    
+    QList<LayoutItemRole> widgetRoles; 
+    
+    // Fill supported layout item roles for specific display
+    switch (displayRole) {
+        case SettingsDisplay: 
+            widgetRoles.append(RoleContent); 
+            widgetRoles.append(RoleSpnCheckBox);
+            widgetRoles.append(RoleMcnCheckBox);
+            widgetRoles.append(RoleSatTextCheckBox);
+            widgetRoles.append(RoleOkButton);
+            widgetRoles.append(RoleSettingsContainer); 
+            break;
+        case InfoDisplay: 
+            widgetRoles.append(RoleContent);
+            widgetRoles.append(RoleSpnIcon);
+            widgetRoles.append(RoleSpnLabel);
+            widgetRoles.append(RoleMcnIcon);
+            widgetRoles.append(RoleMcnMarqueeItem);
+            widgetRoles.append(RoleSatTextIcon);
+            widgetRoles.append(RoleSatMarqueeItem);
+            break;
+        default: 
+            break; 
+    }
+    
+    DPRINT << ": widgetRoles.count() : " << widgetRoles.count();
+    DPRINT << ": OUT";
+    return widgetRoles; 
+}    
+    
+// End of File. 
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetlinehandler.cpp	Fri Jun 04 10:19:18 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:
+ *
+ */
+
+
+#include "infowidgetlinehandler.h"
+#include "infowidgetlogging.h"
+
+
+/*! 
+ */
+InfoWidgetLineHandler::InfoWidgetLineHandler(QObject *parent):
+    QObject(parent), 
+    m_activeLine(1)
+{
+    DPRINT; 
+}
+
+/*!
+ */
+InfoWidgetLineHandler::~InfoWidgetLineHandler()
+{
+    DPRINT; 
+}    
+
+/*!
+ */
+void InfoWidgetLineHandler::logCurrentInfo()
+{
+    DPRINT; 
+} 
+
+/*!
+ */
+int InfoWidgetLineHandler::activeLine() const
+{
+    DPRINT << ": active line: " << m_activeLine;
+    return m_activeLine; 
+}
+    
+/*!
+ */
+void InfoWidgetLineHandler::setActiveLine(int line)
+{
+    DPRINT << ": active line: " << line; 
+    m_activeLine = line; 
+}
+
+// End of File. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetnetworkhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 <networkhandlingproxy.h>
+#include <cnwsession.h>
+#include <xqsettingsmanager.h>
+#include <xqsettingskey.h>
+#include <settingsinternalcrkeys.h>
+#include "infowidgetnetworkhandler.h"
+#include "infowidgetlogging.h"
+
+
+/*!
+  \class InfoWidgetNetworkHandler
+  \brief Handles network specific functionality of 
+         Operator info widget
+*/
+
+/*!
+    InfoWidgetNetworkHandler::InfoWidgetNetworkHandler()
+*/
+InfoWidgetNetworkHandler::InfoWidgetNetworkHandler(QObject *parent) 
+    : 
+    QObject(parent), 
+    m_nwSession(0)
+{
+    DPRINT << ": IN";
+    
+    // Initialize key
+    // ToDo: need to check if preference is ON initially
+    enableMcn(); 
+    
+    CNWSession *session = 0;
+    QT_TRAP_THROWING(session = CreateL(*this, m_nwInfo));
+    m_nwSession.reset(session);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
+*/
+InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
+{
+    DPRINT;
+
+    // Disable MCN setting, 
+    // no display client
+    disableMcn(); 
+}    
+
+/*!
+    InfoWidgetNetworkHandler::suspend()
+*/
+void InfoWidgetNetworkHandler::suspend()
+{
+    DPRINT;
+    disableMcn(); 
+}
+
+/*!
+    InfoWidgetNetworkHandler::suspend()
+*/
+void InfoWidgetNetworkHandler::resume()
+{
+    DPRINT;
+    enableMcn(); 
+}
+
+/*!
+    InfoWidgetNetworkHandler::serviceProviderName()
+*/
+QString InfoWidgetNetworkHandler::serviceProviderName() const 
+{
+    DPRINT;
+    QString qBuf;
+    qBuf = QString((QChar*)m_nwInfo.iSPName.Ptr(), 
+        m_nwInfo.iSPName.Length());
+    DPRINT << ": serviceProviderName: " << qBuf;
+    
+    return qBuf; 
+}
+
+/*!
+    InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired()
+*/
+bool InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired() const 
+{
+    DPRINT;
+    bool displayRequired(true); 
+    
+    if (m_nwInfo.iServiceProviderNameDisplayReq == 
+            RMobilePhone::KDisplaySPNNotRequired) {
+        displayRequired = false; 
+    } 
+    DPRINT << ": serviceProviderNameDisplayRequired: " <<
+            displayRequired;
+    
+    return displayRequired; 
+}
+
+/*!
+    InfoWidgetNetworkHandler::homeZoneTextTag()
+*/
+QString InfoWidgetNetworkHandler::homeZoneTextTag() const 
+{
+    DPRINT;
+    QString qBuf;
+    qBuf = QString((QChar*)m_nwInfo.iViagTextTag.Ptr(), 
+        m_nwInfo.iViagTextTag.Length());
+    DPRINT << ": homeZoneTextTag: " << qBuf;
+    
+    return qBuf; 
+}
+
+/*!
+    InfoWidgetNetworkHandler::homeZoneIndicatorType()
+*/
+int InfoWidgetNetworkHandler::homeZoneIndicatorType() const 
+{
+    DPRINT;
+    int indicatorType = m_nwInfo.iViagIndicatorType;
+    DPRINT << ": homeZoneIndicatorType: " << indicatorType;
+    
+    return indicatorType; 
+}
+
+/*!
+    InfoWidgetNetworkHandler::enableMcn()
+*/
+void InfoWidgetNetworkHandler::enableMcn() 
+{
+    DPRINT;
+    if (!readMcnDisplayState()) {
+        DPRINT << ": enabling mcn display cenrep";
+        writeMcnDisplayState(true); 
+    }
+}
+
+/*!
+    InfoWidgetNetworkHandler::disableMcn()
+*/
+void InfoWidgetNetworkHandler::disableMcn()
+{
+    DPRINT;
+    if (readMcnDisplayState()) {
+        DPRINT << ": disabling mcn display cenrep";
+        writeMcnDisplayState(false); 
+    }
+}
+
+/*!
+    InfoWidgetNetworkHandler::mcnName()
+*/
+QString InfoWidgetNetworkHandler::mcnName() const 
+{
+    DPRINT;
+    QString qBuf;
+    qBuf = QString((QChar*)m_nwInfo.iMCNName.Ptr(),
+        m_nwInfo.iMCNName.Length());
+    DPRINT << ": mcnName: " << qBuf;
+    
+    return qBuf; 
+}
+
+/*!
+    InfoWidgetNetworkHandler::mcnIndicatorType()
+*/
+int InfoWidgetNetworkHandler::mcnIndicatorType() const 
+{
+    DPRINT;
+    int indicatorType = m_nwInfo.iMCNIndicatorType;
+    DPRINT << ": mcnIndicatorType: " << indicatorType;
+    
+    return indicatorType; 
+}
+
+
+/*!
+    InfoWidgetNetworkHandler::networkRegistrationStatus()
+*/
+int InfoWidgetNetworkHandler::networkRegistrationStatus() const 
+{
+    DPRINT << ": registration status: " <<
+            static_cast<int>(m_nwInfo.iRegistrationStatus);
+    
+    return static_cast<int>(m_nwInfo.iRegistrationStatus); 
+}
+
+/*!
+    InfoWidgetNetworkHandler::isOnline()
+    
+    Check if network registration status is registered and 
+    return status accordingly 
+*/
+bool InfoWidgetNetworkHandler::isOnline() const
+{
+    bool online(false); 
+    
+    switch (networkRegistrationStatus()) {
+        case ENWRegisteredBusy: // Fall through
+        case ENWRegisteredOnHomeNetwork: // Fall through
+        case ENWRegisteredRoaming: 
+            online = true;
+            break; 
+        default: 
+            break; 
+    }
+    
+    DPRINT << ": online: " << online;
+    return online; 
+}
+
+/*!
+    InfoWidgetNetworkHandler::logCurrentInfo()
+*/
+void InfoWidgetNetworkHandler::logCurrentInfo()
+{
+    DPRINT << ": IN"; 
+    
+    QString qBuf; 
+    DPRINT << "iMCNIndicatorType " << m_nwInfo.iMCNIndicatorType;  
+    qBuf = QString((QChar*)m_nwInfo.iMCNName.Ptr(),
+        m_nwInfo.iMCNName.Length());
+    DPRINT << "iMCNName " << qBuf;
+    
+    qBuf = QString((QChar*)m_nwInfo.iSPName.Ptr(),m_nwInfo.iSPName.Length());
+    DPRINT << "iSPName " << qBuf;
+    DPRINT << "iServiceProviderNameDisplayReq " 
+        << m_nwInfo.iServiceProviderNameDisplayReq;
+    
+    DPRINT << "iViagIndicatorType " << m_nwInfo.iViagIndicatorType; 
+    qBuf = QString((QChar*)m_nwInfo.iViagTextTag.Ptr(),
+        m_nwInfo.iViagTextTag.Length());
+    DPRINT << "iViagTextTag " << qBuf;
+    
+    DPRINT << ": OUT";
+} 
+
+/*!
+    InfoWidgetNetworkHandler::HandleNetworkMessage()
+*/
+void InfoWidgetNetworkHandler::HandleNetworkMessage( 
+    const TNWMessages aMessage )
+{   
+    DPRINT << ": message: " << aMessage;
+    
+    bool acceptedMessage = false;
+    switch (aMessage) {
+        case ENWMessageCurrentCellInfoMessage: // Fall through 
+        case ENWMessageServiceProviderNameChange: // Fall through
+        case ENWMessageNetworkRegistrationStatusChange: // Fall through
+            acceptedMessage = true;
+            break;
+        default:
+            // not interesting message, filter out
+            DPRINT << ": message filtered out";
+            acceptedMessage = false;
+    }
+    
+    if (acceptedMessage) {
+        int result = 0;
+        QT_TRYCATCH_ERROR(result, emit networkDataChanged());
+        if (0 != result) {
+            DPRINT << ": Exception occured while emitting signal:" << result;
+        }
+    }
+}
+
+/*!
+    InfoWidgetNetworkHandler::HandleNetworkError()
+*/
+void InfoWidgetNetworkHandler::HandleNetworkError( 
+    const TNWOperation aOperation, 
+    TInt aErrorCode )
+{
+    DPRINT << ": operation: " << aOperation <<  
+        " error code: " << aErrorCode;
+    
+    // Reset invalid data  
+    switch (aOperation) {
+        case MNWMessageObserver::ENWGetServiceProviderName:
+            m_nwInfo.iServiceProviderNameDisplayReq = 
+                    RMobilePhone::KDisplaySPNNotRequired;
+            m_nwInfo.iSPName.Zero();
+        break;
+        default: 
+            break; 
+    }
+    
+    // Emit error signal 
+    int result = 0;
+    QT_TRYCATCH_ERROR(result, emit networkError( 
+        static_cast<int>(aOperation), static_cast<int>(aErrorCode)));
+    if (0 != result) {
+        DPRINT << ": Exception occured while emitting signal:" << result;
+    }
+}
+
+/*!
+    InfoWidgetNetworkHandler::writeMcnDisplayState()
+    
+    Handler for cenrep key writing   
+*/
+void InfoWidgetNetworkHandler::writeMcnDisplayState(bool enabled)
+{
+    DPRINT << ": IN";
+    
+    XQSettingsManager *settingsManager = new XQSettingsManager(0); 
+    XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, 
+        KCRUidNetworkSettings.iUid, KSettingsMcnDisplay);
+    int value; 
+    if (enabled) {
+        value = 1; 
+    } else {
+        value = 0; 
+    }
+    bool result = settingsManager->writeItemValue(settingsKey, value );
+    delete settingsManager;
+    
+    DPRINT << ": OUT"; 
+}
+
+/*!
+    InfoWidgetNetworkHandler::readMcnDisplayState()
+*/
+bool InfoWidgetNetworkHandler::readMcnDisplayState()
+{
+    DPRINT << ": IN";
+    bool mcnDisplayKeyOn(false); 
+    
+    XQSettingsManager *settingsManager = new XQSettingsManager(0); 
+    XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, 
+        KCRUidNetworkSettings.iUid, KSettingsMcnDisplay); 
+    bool conversionOk(false); 
+    int value = settingsManager->readItemValue(
+            settingsKey,
+            XQSettingsManager::TypeInt).toInt(&conversionOk);
+    
+    if (conversionOk && value == 1) {
+        mcnDisplayKeyOn = true; 
+    }
+    delete settingsManager;
+        
+    DPRINT << ": OUT";
+    return mcnDisplayKeyOn; 
+}
+
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "infowidgetpreferences.h"
+#include "infowidgetlogging.h"
+
+/*!
+  \class InfoWidgetPreferences
+  \brief Preference store for widget  
+         display etc. options   
+*/
+
+
+/*!
+    InfoWidgetPreferences::InfoWidgetPreferences() 
+*/
+InfoWidgetPreferences::InfoWidgetPreferences(QObject *parent): 
+    QObject(parent)
+{
+    DPRINT;
+}
+
+/*!
+    InfoWidgetPreferences::~InfoWidgetPreferences() 
+*/
+InfoWidgetPreferences::~InfoWidgetPreferences()
+{
+    DPRINT;
+}
+
+/*!
+    InfoWidgetPreferences::storePreferences()
+    
+    Store acceptable preference set  
+*/
+bool InfoWidgetPreferences::storePreferences()
+{
+    DPRINT;
+    bool changed(false); 
+    
+    if (validate() && 
+        m_validatedOptions != m_options){
+            DPRINT << ": preferences differ";
+            changed = true; 
+            m_validatedOptions = m_options;
+        }
+    else if (visibleItemCount() <= 0) { 
+        DPRINT << ": invalid options, restoring initial options";
+        restorePreferences();
+    }
+
+    return changed; 
+}
+
+/*!
+    InfoWidgetPreferences::restorePreferences()
+    
+    Restores last acceptable preference set 
+*/
+void InfoWidgetPreferences::restorePreferences()
+{
+    DPRINT;
+    m_options = m_validatedOptions; 
+}
+
+/*!
+    InfoWidgetPreferences::preference() 
+*/
+QString InfoWidgetPreferences::preference(Option preferenceId) const
+{
+    DPRINT << ": preference id: " << static_cast<int>(preferenceId); 
+    
+    QString preferenceString;
+    if (m_options.testFlag(preferenceId)) {
+        preferenceString = DISPLAY_SETTING_ON; 
+    } else {
+        preferenceString = DISPLAY_SETTING_OFF;  
+    } 
+    
+    return preferenceString;
+}
+
+/*!
+    InfoWidgetPreferences::isPreferenceSet()
+*/
+bool InfoWidgetPreferences::isPreferenceSet(Option preferenceId) const
+{
+    DPRINT << ": preference id: " << static_cast<int>(preferenceId); 
+    return m_options.testFlag(preferenceId); 
+}
+
+/*!
+    InfoWidgetPreferences::preferences()
+*/
+InfoWidgetPreferences::Options InfoWidgetPreferences::preferences() const
+{
+    return m_options; 
+}
+
+/*!
+    InfoWidgetPreferences::setPreference() 
+*/
+void InfoWidgetPreferences::setPreference(Option preferenceId, 
+    const QString& preferenceString)
+{
+    DPRINT << ": preference id: " << static_cast<int>(preferenceId);
+    DPRINT << ": preference string: " << preferenceString; 
+    DPRINT << ": initial options: " << m_options;
+    
+    if (preferenceString.compare(DISPLAY_SETTING_ON) == 0) {
+        m_options |= preferenceId; 
+        emit prefChanged(preferenceId,DisplayOn);
+    } else {
+        m_options &= ~preferenceId;
+        emit prefChanged(preferenceId,DisplayOff);
+    }
+    
+    DPRINT << ": modified options: " << m_options;
+}
+
+/*!
+    InfoWidgetPreferences::visibleItemCount() 
+*/
+int InfoWidgetPreferences::visibleItemCount() 
+{
+    DPRINT << ": IN";
+    
+    int visibleItems = 0;
+    if (m_options.testFlag(DisplayHomeZone)){
+        visibleItems++; 
+    }
+    if (m_options.testFlag(DisplayMcn)){
+        visibleItems++; 
+    }
+    if (m_options.testFlag(DisplayActiveLine)){
+        visibleItems++; 
+    }
+    if (m_options.testFlag(DisplaySatText)){
+        visibleItems++; 
+    }
+    if (m_options.testFlag(DisplaySpn)){
+        visibleItems++; 
+    }
+    
+    DPRINT << ": visible item count: " << visibleItems;
+    return visibleItems; 
+}
+
+/*!
+    InfoWidgetPreferences::validate() 
+*/
+bool InfoWidgetPreferences::validate() 
+{
+    return visibleItemCount() > 0; 
+}
+
+/*!
+   InfoWidgetPreferences::preferenceNames()
+   
+   Convenience function for getting all preference names
+*/
+QStringList InfoWidgetPreferences::preferenceNames()
+{
+    QStringList preferenceList; 
+    preferenceList << "spnDisplay" << "homeZoneDisplay" << 
+            "activeLineDisplay" << "satDisplay" << "mcnDisplay";
+    return preferenceList; 
+}
+
+
+// End of File. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetpreferences_s.cpp	Fri Jun 04 10:19:18 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 "infowidgetpreferences.h"
+#include "infowidgetlogging.h"
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+InfoWidgetPreferences::InfoWidgetPreferences(IHsWidgetPreferenceService &preferenceService, 
+    QObject* parent)
+    : QObject(parent)
+{
+    DPRINT << "DUMMY IMPLEMENTATION";
+
+    m_options = InfoWidgetPreferences::DisplayActiveLine|
+            InfoWidgetPreferences::DisplayMcn|
+            InfoWidgetPreferences::DisplaySatText|
+            InfoWidgetPreferences::DisplayHomeZone;
+}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+InfoWidgetPreferences::~InfoWidgetPreferences()
+{
+    DPRINT << "DUMMY IMPLEMENTATION";
+}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void InfoWidgetPreferences::loadPreferences()
+{
+    DPRINT << "DUMMY IMPLEMENTATION";
+}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void InfoWidgetPreferences::storePreferences()
+{
+    DPRINT << "DUMMY IMPLEMENTATION";
+}
+
+
+/*!
+    InfoWidgetPreferences::preference() 
+*/
+QString InfoWidgetPreferences::preference(Option preferenceId)
+{
+    DPRINT << "DUMMY IMPLEMENTATION";
+    DPRINT << ": preference id: " << static_cast<int>(preferenceId); 
+    
+    QString preferenceString;
+    if (m_options.testFlag(preferenceId)) {
+        preferenceString = DISPLAY_SETTING_ON; 
+    } else {
+        preferenceString = DISPLAY_SETTING_OFF;  
+    } 
+    
+    return preferenceString; 
+}
+
+/*!
+    InfoWidgetPreferences::setPreference() 
+*/
+void InfoWidgetPreferences::setPreference(Option preferenceId, 
+        QString preferenceString)
+{
+    DPRINT << "DUMMY IMPLEMENTATION";
+    DPRINT << ": preference id: " << static_cast<int>(preferenceId);
+    DPRINT << ": preference string: " << preferenceString; 
+
+    DPRINT << ": initial options: " << m_options;
+    
+    if (preferenceString.compare(DISPLAY_SETTING_ON) == 0) {
+        m_options |= preferenceId; 
+    } else {
+        m_options &= ~preferenceId; 
+    }
+    
+    DPRINT << ": modified options: " << m_options;
+}
+
+// End of File.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetsathandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "infowidgetsathandler.h"
+#include "infowidgetsathandlerprivate.h"
+#include "infowidgetlogging.h"
+#include <rsatservice.h>
+
+/*!
+  \class InfoWidgetSatHandler
+  \brief Handles SIM Application Toolkit specific functionality of 
+         Operator info widget
+*/
+
+/*!
+ */
+InfoWidgetSatHandler::InfoWidgetSatHandler(QObject *parent):
+    QObject(parent) , m_connected(false)
+{
+    DPRINT << ": IN";
+   
+    d_ptr = new InfoWidgetSatHandlerPrivate(this, m_satService);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+ */
+InfoWidgetSatHandler::~InfoWidgetSatHandler()
+{
+    DPRINT << ": IN";
+    delete d_ptr;
+    DPRINT << ": OUT";
+} 
+
+/*!
+   InfoWidgetSatHandler::connect
+ */
+void InfoWidgetSatHandler::connect(bool connect)
+{
+    DPRINT << ": IN : connected = " << m_connected << " : connect = " << connect;
+    if(connect && !m_connected){
+        DPRINT << "connect and startObserving() ";
+        m_connected = d_ptr->connect();
+        if(m_connected){
+            d_ptr->startObserving();
+        }
+    }else if (!connect && m_connected){
+        DPRINT << "disconnect and stopObserving() ";
+        m_connected = d_ptr->disconnect();
+    }
+    DPRINT << ": OUT : connected = " << m_connected;
+}
+
+/*!
+   InfoWidgetSatHandler::logCurrentInfo
+ */
+void InfoWidgetSatHandler::logCurrentInfo()
+{
+    DPRINT << ": IN"; 
+    DPRINT << "SAT IdleModeText: " << m_displayText;
+    DPRINT << ": OUT";    
+} 
+
+/*!
+   InfoWidgetSatHandler::satDisplayText
+ */
+const QString& InfoWidgetSatHandler::satDisplayText() const
+{
+    DPRINT << ": text: " << m_displayText; 
+    return m_displayText;
+}
+
+/*!
+   InfoWidgetSatHandler::setSatDisplayText
+ */
+void InfoWidgetSatHandler::setSatDisplayText(const QString& displayText)
+{
+    DPRINT << ": display text: " << displayText;
+    m_displayText = displayText;
+}
+
+/*!
+   InfoWidgetSatHandler::handleIdleModeTxtMessage
+ */
+void InfoWidgetSatHandler::handleIdleModeTxtMessage( int idleResult )
+{
+    DPRINT << ": handleIdleModeTxtMessage: " << idleResult;
+    if(m_connected){
+        m_satService.SetIdleModeTextResponse((RSatService::TSATIdleResult)idleResult);
+    }
+    else{
+        //TODO: What's correct response if widget isn't visible? For now it's permanen problem
+        m_satService.SetIdleModeTextResponse( RSatService::ESATIdleCmdBeyondMeCapabilities );
+    }
+ 
+    //Pass the result
+    emit handleMessage(idleResult);
+}
+
+/*!
+   InfoWidgetSatHandler::handleSatError
+ */
+void InfoWidgetSatHandler::handleSatError( int operation, int errorCode )
+{
+    DPRINT << ": satError : operation: " << operation << ": errorCode: "<<errorCode;
+    m_satService.SetIdleModeTextResponse( RSatService::ESATIdleMeUnableToProcessCmd );
+    emit handleError(operation, errorCode);
+}
+
+// End of File. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/src/infowidgetsathandlerprivate.cpp	Fri Jun 04 10:19:18 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:
+ *
+ */
+
+#include <FBS.H>
+
+#include "InfoWidgetSatHandlerPrivate.h"
+#include "InfoWidgetSatHandler.h"
+#include "infowidgetlogging.h"
+
+/*!
+   InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate   
+ */
+InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate(
+        InfoWidgetSatHandler *iwSatHandler, RSatService& satService)
+    : CActive(CActive::EPriorityStandard), 
+	  q_ptr(iwSatHandler),
+      m_satService(satService)
+{
+    DPRINT << ": IN";
+    CActiveScheduler::Add(this);
+    DPRINT << ": OUT";
+}
+/*!
+   InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate           
+*/
+InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate()
+{
+    DPRINT << ": IN";
+    Cancel();
+    DPRINT << ": OUT";
+}
+/*!
+   InfoWidgetSatHandlerPrivate::connect
+ */
+int InfoWidgetSatHandlerPrivate::connect()
+{
+    TInt result( KErrGeneral  );
+    TRAP(result, m_satSession.ConnectL());
+    if (0 != result) {
+        DPRINT << ": Exception occured while connecting SatSession:" << result;
+    }
+    else{
+        TRAP(result, m_satService.OpenL(m_satSession));
+        if (0 != result) {
+            DPRINT << ": Exception occured while opening SatService:" << result;
+        }
+    }
+    return !result;
+}
+/*! 
+   InfoWidgetSatHandlerPrivate::startObserving
+    
+   To get initial content if any and start listening    
+ */
+void InfoWidgetSatHandlerPrivate::startObserving()
+{
+    //not observing yet but
+    getIdleModeData();
+    // in case there were content, there is need to send response to SAT
+    if(!m_idleTxt.isEmpty()){
+        q_ptr->handleIdleModeTxtMessage( m_idleResult );
+    }
+    // Start observing for changes
+    activate();
+}
+/*!
+   InfoWidgetSatHandlerPrivate::disconnect   
+ */
+int InfoWidgetSatHandlerPrivate::disconnect()
+{
+    DPRINT << ": IN";
+    m_idleTxt = "";
+    Cancel();
+    m_satService.NotifySetupIdleModeTextChangeCancel(); 
+    m_satService.Close();
+    m_satSession.Close();
+    
+    DPRINT << ": OUT";
+    return 0;//TODO:Fixme
+}
+/*!
+   InfoWidgetSatHandlerPrivate::getIdleModeData   
+ */
+void InfoWidgetSatHandlerPrivate::getIdleModeData()
+{
+    HBufC* string( NULL );
+    TUint8 recordId( NULL );
+    RSatService::TSatIconQualifier iconQualifier( 
+        RSatService::ESatIconNoIcon );
+    
+    // Get setup idle mode text, icon qualifier and record id.
+    TInt result( KErrNotFound  );
+    TRAP(result, m_satService.GetSetupIdleModeTextL( string, iconQualifier, recordId )); 
+    if (0 != result) {
+        DPRINT << ": Exception occured while GetSetupIdleModeTextL :" << result;
+        m_idleResult = RSatService::ESATIdleMeUnableToProcessCmd;
+    }
+    else{
+        DPRINT << "string->Length() : " << string->Length();
+        if(RSatService::ESatIconSelfExplanatory != iconQualifier){ 
+            m_idleTxt = QString((QChar*)string->Des().Ptr(), string->Length());
+        }else{
+            m_idleTxt = "";
+        }
+        //determine result
+        if(RSatService::ESatIconNoIcon != iconQualifier
+                && !m_idleTxt.isEmpty()){
+            //icon requested but we don't have icon support
+            m_idleResult = RSatService::ESATIdleSuccessRequestedIconNotDisplayed;
+        }else if(RSatService::ESatIconNoIcon == iconQualifier
+                && !m_idleTxt.isEmpty()){
+            m_idleResult = RSatService::ESATIdleSuccess;
+        }else{ //got empty string, could be permanen problem as well?
+            //m_idleResult = RSatService::ESATIdleCmdBeyondMeCapabilities
+            m_idleResult = RSatService::ESATIdleMeUnableToProcessCmd;
+        }
+    }
+    delete string;
+    q_ptr->setSatDisplayText(m_idleTxt);//empty in case of selexplanatory icon
+}
+
+/*!
+   InfoWidgetSatHandlerPrivate::RunL   
+ */
+void InfoWidgetSatHandlerPrivate::RunL()
+{ 
+    DPRINT << ": IN";
+    if ( KErrNone == iStatus.Int() )
+        {   
+        getIdleModeData();
+        q_ptr->handleIdleModeTxtMessage( m_idleResult );
+    } else {
+        q_ptr->handleSatError(1,iStatus.Int());
+    }
+    if ( !IsActive() )
+        {
+        activate();
+        }       
+    DPRINT << ": OUT";
+}
+/*!
+   InfoWidgetSatHandlerPrivate::DoCancel   
+ */
+void InfoWidgetSatHandlerPrivate::DoCancel()
+{
+    DPRINT << ": IN";
+    m_satService.NotifySetupIdleModeTextChangeCancel(); 
+    DPRINT << ": OUT";
+}
+/*!
+   InfoWidgetSatHandlerPrivate::activate   
+ */
+void InfoWidgetSatHandlerPrivate::activate()
+{
+    DPRINT << ": IN";
+    Cancel();   
+    TInt error = m_satService.NotifySetupIdleModeTextChange( iStatus );
+    
+    if ( KErrNone == error )
+        {
+        SetActive();
+        }
+    DPRINT << ": OUT";
+}
+
+
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pri	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+
+HEADERS += ./inc/infowidgetprovider.h \
+           ./inc/infowidgetlogging.h \
+           ./infowidget/inc/infowidget.h \
+           ./infowidget/inc/infowidgetlayoutmanager.h \
+           ./infowidget/inc/infowidgetpreferences.h \
+           ./infowidget/inc/infowidgetengine.h \
+           ./infowidget/inc/infowidgetsathandlerprivate.h
+
+symbian: {
+    HEADERS += ./infowidget/inc/infowidgetnetworkhandler.h \
+               ./infowidget/inc/infowidgetsathandler.h \
+               ./infowidget/inc/infowidgetlinehandler.h
+}
+SOURCES += infowidget/src/infowidgetsathandlerprivate.cpp \
+    ./src/infowidgetprovider.cpp \
+    ./infowidget/src/infowidget.cpp \
+    ./infowidget/src/infowidgetlayoutmanager.cpp \
+    ./infowidget/src/infowidgetengine.cpp
+    
+symbian: {
+    SOURCES += ./infowidget/src/infowidgetpreferences.cpp \
+               ./infowidget/src/infowidgetnetworkhandler.cpp \
+               ./infowidget/src/infowidgetsathandler.cpp \
+               ./infowidget/src/infowidgetlinehandler.cpp 
+} else: { 
+    SOURCES += ./infowidget/src/infowidgetengine_s.cpp \
+               ./infowidget/src/infowidgetpreferences_s.cpp
+}
+
+defineTest(exportResources) {
+    symbian {
+        for(subdirs, 1) {
+            entries = $$files($$subdirs)
+            for(entry, entries) : BLD_INF_RULES.prj_exports += "./$$entry z:/$$replace(2, ^/,)/$$basename(entry)"
+        }
+        export ( BLD_INF_RULES.prj_exports)
+    }
+}
+
+symbian: plugin { # copy qtstub and manifest
+
+    pluginstub.sources = $${TARGET}.dll
+    pluginstub.path = $$PLUGIN_SUBDIR
+
+    DEPLOYMENT += pluginstub
+
+    qtplugins.path = $$PLUGIN_SUBDIR
+    qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+    contains(MOBILITY, serviceframework):BLD_INF_RULES.prj_exports += "resource/$${TARGET}.s60xml z:$$qtplugins.path/$${TARGET}.xml"
+    
+    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin z:$$qtplugins.path/$$basename(qtplugin)"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.pro	Fri Jun 04 10:19:18 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:
+#
+#
+ 
+
+TEMPLATE = lib
+CONFIG += plugin hb svg mobility
+MOBILITY = serviceframework
+
+TRANSLATIONS = operator_widget.ts
+
+MOC_DIR = moc
+RCC_DIR = rcc
+
+symbian: {
+LIBS += -lhswidgetmodel \
+    -lnetworkhandling \
+    -lcbsclient \
+    -lcbsmcnclient \
+    -lxqsettingsmanager \
+    -lsatclient
+}
+   
+INCLUDEPATH += ./inc \
+    ./infowidget/inc 
+    
+symbian: { 
+    load(data_caging_paths)
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    TARGET.UID3 = 0x20029F28
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL \
+        -TCB
+    deploy.path = c:
+    
+    DEPLOYMENT += exportheaders  
+        
+    BLD_INF_RULES.prj_exports +=  \
+     "$${LITERAL_HASH}include <platform_paths.hrh>" \
+     "./rom/infowidgetprovider.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(infowidgetprovider.iby)" \
+	 "./rom/infowidgetprovider_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(infowidgetprovider_resources.iby)" 
+}
+win32: { 
+    INCLUDEPATH += ../../../../homescreensrv/homescreensrv_plat/hswidgetmodel_api
+    include(infowidgetprovider_installs_win32.pri)
+}
+RESOURCES = infowidgetprovider.qrc
+
+symbian: PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/20029F28
+win32: PLUGIN_SUBDIR = /hsresources/import/widgetregistry/20029F28
+OUTPUT_DIR = ./bin
+SOURCE_DIR = ./inc
+OBJECTS_DIR = $$OUTPUT_DIR/tmp/$$TARGET
+DESTDIR = $$OUTPUT_DIR
+MOC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/moc
+RCC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/rcc
+UI_DIR = $$OUTPUT_DIR/tmp/$$TARGET/ui
+LIBS += -L$$DESTDIR
+DEPENDPATH += . $$SOURCE_DIR
+INCLUDEPATH += . $$SOURCE_DIR
+INCLUDEPATH += $$MOC_DIR
+plugin: !isEmpty(PLUGIN_SUBDIR): DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR
+
+include(infowidgetprovider.pri)
+
+exportResources(./resource/*.manifest, $$PLUGIN_SUBDIR)
+exportResources(./resource/*.png, $$PLUGIN_SUBDIR)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RCC>
+    <qresource prefix="/">
+        <file>resource/infowidget.png</file>
+        <file>resource/infowidget.docml</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider_hw.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"infowidgetprovider"},(0x20029F28),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"}
+
+; DEPLOYMENT
+"/epoc32/release/armv5/urel/infowidgetprovider.dll"    - "c:\sys\bin\infowidgetprovider.dll"
+"/epoc32/data/z/private/20022F35/import/widgetregistry/20029F28/infowidgetprovider.qtplugin"  - "c:/private/20022F35/import/widgetregistry/20029F28/infowidgetprovider.qtplugin"
+"/epoc32/data/z/private/20022F35/import/widgetregistry/20029F28/infowidgetprovider.manifest"  - "c:/private/20022F35/import/widgetregistry/20029F28/infowidgetprovider.manifest"
+"/epoc32/data/z/private/20022F35/import/widgetregistry/20029F28/infowidget.png"       - "c:/private/20022F35/import/widgetregistry/20029F28/infowidget.png"
+
+; Manual PKG post-rules from PRO files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidgetprovider_installs_win32.pri	Fri Jun 04 10:19:18 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: 
+#
+
+#
+# Release
+#
+
+r01.path = ../../../bin/release/hsresources/import/widgetregistry/20029F28
+r01.files = ./release/*.dll \
+            ./resource/*.manifest \
+            ./resource/*.png
+
+INSTALLS += r01
+
+#
+# Debug
+#
+
+d01.path = ../../../../bin/debug/hsresources/import/widgetregistry/20029F28
+d01.files = ./debug/*.dll \
+            ./resource/*.manifest \
+            ./resource/*.png
+
+INSTALLS += d01
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.docml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="id:content" type="HbWidget">
+        <widget name="id:container" type="HbWidget">
+            <widget name="id:settingsContainer" type="HbWidget">
+                <widget name="id:spnIcon" type="HbLabel">
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                    <icon iconName="qtg_large_network.svg" name="icon"/>
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
+                </widget>
+                <widget name="id:mcnIcon" type="HbLabel">
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                    <icon iconName="qtg_large_cellinfo.svg" name="icon"/>
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
+                </widget>
+                <widget name="id:satTextIcon" type="HbLabel">
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                    <icon iconName="qtg_large_sat" name="icon"/>
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint height="var(hb-param-graphic-size-primary-small)" type="FIXED" width="var(hb-param-graphic-size-primary-small)"/>
+                </widget>
+                <widget name="id:spnLabel" type="HbLabel">
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint height="var(hb-param-text-height-tiny)" type="FIXED" width="22.8806un"/>
+                    <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+                </widget>
+                <widget name="id:mcnMarqueeItem" type="HbMarqueeItem">
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint type="FIXED" width="22.8806un"/>
+                    <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+                </widget>
+                <widget name="id:satMarqueeItem" type="HbMarqueeItem">
+                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                    <sizehint type="FIXED" width="22.8806un"/>
+                    <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+                </widget>
+                <real name="z" value="0"/>
+                <layout spacing="0px" type="grid">
+                    <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)"/>
+                    <griditem column="0" itemname="id:spnIcon" row="0"/>
+                    <griditem column="1" itemname="id:spnLabel" row="0"/>
+                    <griditem column="0" itemname="id:mcnIcon" row="1"/>
+                    <griditem column="1" itemname="id:mcnMarqueeItem" row="1"/>
+                    <griditem column="0" itemname="id:satTextIcon" row="2"/>
+                    <griditem column="1" itemname="id:satMarqueeItem" row="2"/>
+                </layout>
+            </widget>
+        </widget>
+        <rect height="10un" name="geometry" width="34un" x="14.77612un" y="41.64179un"/>
+        <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+        <sizehint height="9un" type="PREFERRED" width="34un"/>
+        <sizehint height="9un" type="MINIMUM" width="34un"/>
+        <sizehint height="31un" type="MAXIMUM" width="34un"/>
+        <layout type="anchor">
+            <anchoritem dst="id:container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+            <anchoritem dst="id:container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+            <anchoritem dst="id:container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+            <anchoritem dst="id:container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+        </layout>
+    </widget>
+    <widget name="sd:content" type="HbWidget">
+        <widget name="sd:title" type="HbLabel">
+            <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
+            <string locid="txt_operator_widget_title_select_info" name="plainText" value="Select info"/>
+            <fontspec name="fontSpec" role="Title" textheight="var(hb-param-text-height-title)"/>
+        </widget>
+        <widget name="sd:settingsContainer" type="HbWidget">
+            <widget name="sd:spnCheckBox" type="HbCheckBox">
+                <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-small)" type="PREFERRED"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-small)" type="MINIMUM" width="32un"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-medium)" type="MAXIMUM" width="var(hb-param-widget-dialog-width)"/>
+                <string locid="txt_operatorwidget_list_spn" name="text"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+            </widget>
+            <widget name="sd:mcnCheckBox" type="HbCheckBox">
+                <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-small)" type="PREFERRED" width="32un"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-small)" type="MINIMUM" width="32un"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-medium)" type="MAXIMUM" width="var(hb-param-widget-dialog-width)"/>
+                <string locid="txt_operatorwidget_list_cell_information" name="text"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+            </widget>
+            <widget name="sd:satTextCheckBox" type="HbCheckBox">
+                <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-small)" type="PREFERRED"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-small)" type="MINIMUM" width="32un"/>
+                <sizehint height="var(hb-param-touch-area-gene-primary-medium)" type="MAXIMUM" width="var(hb-param-widget-dialog-width)"/>
+                <string locid="txt_operatorwidget_list_sat_idle_mode_text" name="text"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+            </widget>
+            <widget name="sd:separator1" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <icon iconName="qtg_graf_divider_h_thin.svg" name="icon"/>
+                <real name="z" value="1"/>
+                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="0.29851un" type="FIXED"/>
+                <sizehint height="0.29851un" type="MINIMUM"/>
+                <contentsmargins bottom="0un" left="0.29851un" right="0.29851un" top="0un"/>
+            </widget>
+            <widget name="sd:separator2" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <icon iconName="qtg_graf_divider_h_thin.svg" name="icon"/>
+                <real name="z" value="1"/>
+                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="0.29851un" type="FIXED"/>
+                <sizehint height="0.29851un" type="MINIMUM"/>
+                <contentsmargins bottom="0un" left="0.29851un" right="0.29851un" top="0un"/>
+            </widget>
+            <sizehint type="PREFERRED" width="var(hb-param-widget-dialog-width)"/>
+            <sizehint type="MAXIMUM" width="var(hb-param-widget-dialog-width)"/>
+            <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="sd:spnCheckBox" spacing="0.75un"/>
+                <linearitem itemname="sd:separator1" spacing="0.75un"/>
+                <linearitem itemname="sd:mcnCheckBox"/>
+                <linearitem itemname="sd:separator2"/>
+                <linearitem itemname="sd:satTextCheckBox" spacing="0un"/>
+            </layout>
+        </widget>
+        <widget name="sd:okButton" type="HbPushButton">
+            <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+            <sizehint height="var(hb-param-touch-area-gene-primary-large)" type="PREFERRED"/>
+            <contentsmargins bottom="0un" left="0un" right="0un" top="var(hb-param-margin-gene-middle-vertical)"/>
+            <sizehint height="var(hb-param-touch-area-gene-primary-large)" type="MAXIMUM"/>
+            <string locid="txt_common_button_ok" name="text" value="OK"/>
+            <string name="state" value="normal"/>
+        </widget>
+        <sizehint type="PREFERRED" width="var(hb-param-widget-dialog-width)"/>
+        <sizehint type="MINIMUM" width="var(hb-param-widget-dialog-width)"/>
+        <contentsmargins bottom="0un" left="0un" right="0un" top="var(hb-param-margin-gene-top)"/>
+        <sizehint height="35un" type="MAXIMUM" width="var(hb-param-widget-dialog-width)"/>
+        <layout orientation="Vertical" spacing="0un" type="linear">
+            <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+            <linearitem itemname="sd:title"/>
+            <linearitem itemname="sd:settingsContainer"/>
+            <linearitem itemname="sd:okButton" spacing="0un"/>
+        </layout>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
Binary file phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidget.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.manifest	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widgetprovider>
+    <widget library="infowidgetprovider"
+            uri="infowidgetprovider"
+            title="Operator info"
+            description=""/>
+</widgetprovider>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.s60xml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>infowidgetprovider</name>
+    <filepath>infowidgetprovider</filepath>
+    <description>Operator widget</description>
+    <interface>
+        <name>com.nokia.symbian.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description></description>
+        <capabilities></capabilities>
+        <customproperty key="title">Operator</customproperty>
+    </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/infowidgetprovider.xml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>infowidgetprovider</name>
+    <filepath>infowidgetprovider</filepath>
+    <description>Operator widget</description>
+    <interface>
+        <name>com.nokia.symbian.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description></description>
+        <capabilities></capabilities>
+        <customproperty key="title">Operator</customproperty>
+    </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_prop_network_2g.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="0 0 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<polygon fill="#030303" fill-opacity="0.7" points="6.248,15.004 6.248,8.396 1.02,3.418 0.998,0 15,0   15,3.418 9.752,8.396 9.752,15.004 " stroke-opacity="0.7"/>
+<path d="M2.006,1v1.479l5.25,5.502L7.25,14h1.5l0.006-6.02l5.25-5.48V1H2.006z M7.256,5.85L4.053,2.5h3.203  V5.85z M8.756,5.85V2.5h3.303L8.756,5.85z" fill="url(#SVGID_1_)"/>
+<rect fill="none" height="16" width="16"/>
+<defs>
+<linearGradient gradientTransform="matrix(1 0 0 -1 0.1377 14.834)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="7.8682" x2="7.8682" y1="17.3789" y2="-1.5303">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#B2B2B2"/>
+</linearGradient>
+</defs>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_prop_pb_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="0 0 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<rect fill="none" height="16" width="16"/>
+<path d="M9.402,0.102C5.703,2.756,3.136,5.486,0.096,9.423  c-0.053,0.323-0.581,2.854,1.544,5.083c0.422,0.32,1.041,0.957,2.242-0.053c0.42-0.573,1.636-2.156,2-2.666  c0.767-1.167,0.22-1.678-0.597-2.764C5.977,8.334,8.338,5.97,9.027,5.279c0.859,0.607,1.642,1.518,2.734,0.62  c0,0,2.547-1.925,2.775-2.089c1.062-1.219-0.043-2.187,0.025-2.125C12.234-0.574,9.521,0.086,9.402,0.102z" fill="#030303" fill-opacity="0.7" stroke-opacity="0.7"/>
+<path d="M13.271,1.917C12.3,1.238,11.16,0.859,9.811,1.051L9.809,1.053c-3.475,2.65-6.211,5.209-8.75,8.753  L1.057,9.809c-0.208,1.717,0.474,2.99,1.085,3.756c0.362,0.434,0.645,0.558,0.933,0.281l2.021-2.689  c0.139-0.174,0.273-0.401,0-0.674c0,0-0.671-0.674-1.008-1.684L8.8,4.082c1.013,0.335,1.685,1.009,1.685,1.009  c0.272,0.274,0.502,0.139,0.674,0c0,0,2.561-1.896,2.691-2.02C14.176,2.756,14.125,2.533,13.271,1.917z" fill="url(#SVGID_1_)"/>
+<defs>
+<linearGradient gradientTransform="matrix(1 0 0 -1 0.1377 14.834)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="7.3892" x2="7.3892" y1="9.834" y2="-13.1661">
+<stop offset="0" style="stop-color:#3687FF"/>
+<stop offset="1" style="stop-color:#051F7D"/>
+</linearGradient>
+</defs>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_prop_pb_sim.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="16px" version="1.1" viewBox="0 0 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<polygon fill="#030303" fill-opacity="0.7" points="16,14 0,14 0,5.588 3.586,2 16,2 " stroke-opacity="0.7"/>
+<polygon fill="none" points="16,16 0.008,16 0,0 15.992,0 "/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 0.1377 14.834)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="7.8623" x2="7.8623" y1="9.4336" y2="0.2336">
+<stop offset="0" style="stop-color:#B2B2B2"/>
+<stop offset="1" style="stop-color:#666666"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="4,3 1,6.001 1,13 15,13 15,3 "/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 0.1377 14.834)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="9.0293" x2="9.0293" y1="9.1592" y2="0.4069">
+<stop offset="0" style="stop-color:#FFE23D"/>
+<stop offset="0.2239" style="stop-color:#FAD337"/>
+<stop offset="0.6537" style="stop-color:#EFAB26"/>
+<stop offset="1" style="stop-color:#E48717"/>
+</linearGradient>
+<path d="M9.459,9.676h3.791V8.159H9.459V9.676z M12.666,6.001H9.459v1.575h3.791V6.584  C13.25,6.262,12.988,6.001,12.666,6.001z M5.084,6.584v0.992h3.791V6.001H5.667C5.344,6.001,5.084,6.262,5.084,6.584z M5.084,9.676  h3.791V8.159H5.084V9.676z M9.459,11.834h3.207c0.322,0,0.584-0.262,0.584-0.584v-0.991H9.459V11.834z M5.084,11.25  c0,0.322,0.26,0.584,0.582,0.584h3.209v-1.575H5.084V11.25z" fill="url(#SVGID_2_)"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/resource/qgn_stat_zone_home_uni.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="8" version="1.1" viewBox="0 0 12 8" width="12" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<path d="M6.364,0.764L0.648,3.34l0.016,0.008L0.658,3.35h0.001L0.648,4.221l0.974-0.24v3.25c0.849,0.013,1.593,0,2.442,0V5.143  h2.342V7.23c1.601,0,3.124,0,4.62,0V3.994l0.973,0.246V3.367H12L6.364,0.764z"/>
+<rect fill="none" height="8" width="12"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/rom/infowidgetprovider.iby	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef __INFOWIDGETPROVIDER_IBY__
+#define __INFOWIDGETPROVIDER_IBY__
+
+file=ABI_DIR\BUILD_DIR\infowidgetprovider.dll                                               SHARED_LIB_DIR\infowidgetprovider.dll
+data=ZPRIVATE\20022f35\import\widgetregistry\20029F28\infowidgetprovider.qtplugin           private\20022f35\import\widgetregistry\20029F28\infowidgetprovider.qtplugin
+data=ZPRIVATE\20022f35\import\widgetregistry\20029F28\infowidgetprovider.manifest           private\20022f35\import\widgetregistry\20029F28\infowidgetprovider.manifest
+data=ZPRIVATE\20022f35\import\widgetregistry\20029F28\infowidget.png                        private\20022f35\import\widgetregistry\20029F28\infowidget.png
+data=ZPRIVATE\20022f35\import\widgetregistry\20029F28\infowidgetprovider.xml                private\20022f35\import\widgetregistry\20029F28\infowidgetprovider.xml
+
+
+#endif //__INFOWIDGETPROVIDER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/rom/infowidgetprovider_resources.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __INFOWIDGETPROVIDER_RESOURCE_IBY__
+#define __INFOWIDGETPROVIDER_RESOURCE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\operator_widget.qm QT_TRANSLATIONS_DIR\operator_widget.qm 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/src/infowidgetprovider.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+#include "infowidgetprovider.h"
+#include "infowidget.h"
+
+
+/*!
+  \class InfoWidgetProvider
+  
+  \brief Homescreen Widget for providing operator information   
+*/
+QObject *InfoWidgetProvider::createInstance(const QServiceInterfaceDescriptor &descriptor,
+                                             QServiceContext *context,
+                                             QAbstractSecuritySession *session)
+{
+    Q_UNUSED(context);
+    Q_UNUSED(session);
+
+    if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
+        return new InfoWidget();
+    } else {
+        return 0;
+    }
+}
+
+
+Q_EXPORT_PLUGIN2(infowidgetprovider, InfoWidgetProvider)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/common/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_RSatSession.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "RSatSession.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// RSatSession::RSatSession
+// -----------------------------------------------------------------------------
+//
+RSatSession::RSatSession(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatSession::ConnectL
+// -----------------------------------------------------------------------------
+//
+void RSatSession::ConnectL(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatSession::Version
+// -----------------------------------------------------------------------------
+//
+TVersion RSatSession::Version(  ) const
+    {
+    SMC_MOCK_METHOD0( TVersion )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbcolorscheme.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbcolorscheme.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QString::color
+// -----------------------------------------------------------------------------
+//
+QColor HbColorScheme::color( 
+        const QString & colorRole )
+    {
+    SMC_MOCK_METHOD1( QColor, const QString &, colorRole )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbdocumentloader.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbmainwindow.h>
+#include <QString>
+#include <QGraphicsWidget>
+#include <QFile>
+
+#include "hbdocumentloader.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::HbDocumentLoader
+// -----------------------------------------------------------------------------
+//
+HbDocumentLoader::HbDocumentLoader(  )
+    : d_ptr(0)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::HbDocumentLoader
+// -----------------------------------------------------------------------------
+//
+HbDocumentLoader::HbDocumentLoader( 
+        const HbMainWindow * window )
+    : d_ptr(0)    
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::~HbDocumentLoader
+// -----------------------------------------------------------------------------
+//
+HbDocumentLoader::~HbDocumentLoader(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::load
+// -----------------------------------------------------------------------------
+//
+QObjectList HbDocumentLoader::load( 
+        const QString & fileName,
+        const QString & section,
+        bool * ok )
+    {
+    SMC_MOCK_METHOD3( QObjectList, const QString &, fileName, 
+        const QString &, section, 
+        bool *, ok )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::load
+// -----------------------------------------------------------------------------
+//
+QObjectList HbDocumentLoader::load( 
+        QIODevice * device,
+        const QString & section,
+        bool * ok )
+    {
+    SMC_MOCK_METHOD3( QObjectList, QIODevice *, device, 
+        const QString &, section, 
+        bool *, ok )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::load
+// -----------------------------------------------------------------------------
+//
+QObjectList HbDocumentLoader::load( 
+        const QString & fileName,
+        bool * ok )
+    {
+    SMC_MOCK_METHOD2( QObjectList, const QString &, fileName, 
+        bool *, ok )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::load
+// -----------------------------------------------------------------------------
+//
+QObjectList HbDocumentLoader::load( 
+        QIODevice * device,
+        bool * ok )
+    {
+    SMC_MOCK_METHOD2( QObjectList, QIODevice *, device, 
+        bool *, ok )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::findWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbDocumentLoader::findWidget( 
+        const QString & name ) const
+    {
+    SMC_MOCK_METHOD1( QGraphicsWidget *, const QString &, name )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::findObject
+// -----------------------------------------------------------------------------
+//
+QObject * HbDocumentLoader::findObject( 
+        const QString & name ) const
+    {
+    SMC_MOCK_METHOD1( QObject *, const QString &, name )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::setObjectTree
+// -----------------------------------------------------------------------------
+//
+bool HbDocumentLoader::setObjectTree( 
+        QObjectList roots )
+    {
+    SMC_MOCK_METHOD1( bool, QObjectList, roots )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::reset
+// -----------------------------------------------------------------------------
+//
+void HbDocumentLoader::reset(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::version
+// -----------------------------------------------------------------------------
+//
+QString HbDocumentLoader::version(  )
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDocumentLoader::createObject
+// -----------------------------------------------------------------------------
+//
+QObject * HbDocumentLoader::createObject( 
+        const QString & type,
+        const QString & name )
+    {
+    SMC_MOCK_METHOD2( QObject *, const QString &, type, 
+        const QString &, name )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbframedrawer.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <QBitmap>
+#include <QPainter>
+#include <QGraphicsItem>
+#include <smcmockclassincludes.h>
+#include <hbframedrawer.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::HbFrameDrawer
+// -----------------------------------------------------------------------------
+//
+HbFrameDrawer::HbFrameDrawer( 
+        bool cacheFlag )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::HbFrameDrawer
+// -----------------------------------------------------------------------------
+//
+HbFrameDrawer::HbFrameDrawer( 
+        const QString & frameGraphicsName,
+        FrameType type,
+        bool cacheFlag )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::~HbFrameDrawer
+// -----------------------------------------------------------------------------
+//
+HbFrameDrawer::~HbFrameDrawer(  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::isNull
+// -----------------------------------------------------------------------------
+//
+bool HbFrameDrawer::isNull(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::frameGraphicsName
+// -----------------------------------------------------------------------------
+//
+QString HbFrameDrawer::frameGraphicsName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setFrameGraphicsName
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setFrameGraphicsName( 
+        const QString & frameGraphicsName )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, frameGraphicsName )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::frameType
+// -----------------------------------------------------------------------------
+//
+HbFrameDrawer::FrameType HbFrameDrawer::frameType() const
+    {
+    SMC_MOCK_METHOD0( FrameType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setFrameType
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setFrameType( 
+        HbFrameDrawer::FrameType type )
+    {
+    SMC_MOCK_METHOD1( void, FrameType, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::borderWidths
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::borderWidths( 
+        qreal & left,
+        qreal & top,
+        qreal & right,
+        qreal & bottom ) const
+    {
+    SMC_MOCK_METHOD4( void, qreal &, left, 
+        qreal &, top, 
+        qreal &, right, 
+        qreal &, bottom )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setBorderWidths
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setBorderWidths( 
+        const qreal left,
+        const qreal top,
+        const qreal right,
+        const qreal bottom )
+    {
+    SMC_MOCK_METHOD4( void, const qreal, left, 
+        const qreal, top, 
+        const qreal, right, 
+        const qreal, bottom )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setBorderWidths
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setBorderWidths( 
+        const qreal horizontal,
+        const qreal vertical )
+    {
+    SMC_MOCK_METHOD2( void, const qreal, horizontal, 
+        const qreal, vertical )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setBorderWidth
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setBorderWidth( 
+        const qreal width )
+    {
+    SMC_MOCK_METHOD1( void, const qreal, width )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::fillWholeRect
+// -----------------------------------------------------------------------------
+//
+bool HbFrameDrawer::fillWholeRect(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setFillWholeRect
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setFillWholeRect( 
+        bool fill )
+    {
+    SMC_MOCK_METHOD1( void, bool, fill )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::mirroringMode
+// -----------------------------------------------------------------------------
+//
+HbIcon::MirroringMode HbFrameDrawer::mirroringMode(  ) const
+    {
+    SMC_MOCK_METHOD0( HbIcon::MirroringMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setMirroringMode
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setMirroringMode( 
+        HbIcon::MirroringMode mode )
+    {
+    SMC_MOCK_METHOD1( void, HbIcon::MirroringMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::fileNameSuffixList
+// -----------------------------------------------------------------------------
+//
+QStringList HbFrameDrawer::fileNameSuffixList(  ) const
+    {
+    SMC_MOCK_METHOD0( QStringList )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setFileNameSuffixList
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setFileNameSuffixList( 
+        const QStringList & list )
+    {
+    SMC_MOCK_METHOD1( void, const QStringList &, list )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setMask
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setMask( 
+        const QPixmap & mask )
+    {
+    SMC_MOCK_METHOD1( void, const QPixmap &, mask )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setMask
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setMask( 
+        const QBitmap & mask )
+    {
+    SMC_MOCK_METHOD1( void, const QBitmap &, mask )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::mask
+// -----------------------------------------------------------------------------
+//
+QPixmap HbFrameDrawer::mask(  ) const
+    {
+    SMC_MOCK_METHOD0( QPixmap )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::maskBitmap
+// -----------------------------------------------------------------------------
+//
+QBitmap HbFrameDrawer::maskBitmap(  ) const
+    {
+    SMC_MOCK_METHOD0( QBitmap )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::frameSize
+// -----------------------------------------------------------------------------
+//
+QSize HbFrameDrawer::frameSize(  ) const
+    {
+    SMC_MOCK_METHOD0( QSize )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::themeChanged
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::themeChanged(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setLayoutDirection
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setLayoutDirection( 
+        Qt::LayoutDirection direction )
+    {
+    SMC_MOCK_METHOD1( void, Qt::LayoutDirection, direction )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setGraphicsItem
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setGraphicsItem( 
+        QGraphicsItem * item )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::paint
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::paint( 
+        QPainter * painter,
+        const QRectF & rect ) const
+    {
+    SMC_MOCK_METHOD2( void, QPainter *, painter, 
+        const QRectF &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::rect
+// -----------------------------------------------------------------------------
+//
+QRectF HbFrameDrawer::rect(  ) const
+    {
+    SMC_MOCK_METHOD0( QRectF )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbFrameDrawer::setRect
+// -----------------------------------------------------------------------------
+//
+void HbFrameDrawer::setRect( 
+        const QRectF & rect )
+    {
+    SMC_MOCK_METHOD1( void, const QRectF &, rect )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hblabel.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,327 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbstyleoptionlabel.h>
+#include <hblabel.h>
+
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbLabel::Q_PROPERTY
+// -----------------------------------------------------------------------------
+//
+//void HbLabel::Q_PROPERTY( 
+//        QString plainText READ plainText WRITE setPlainText ) Q_PROPERTY ( QString html READ html WRITE setHtml ) Q_PROPERTY ( Qt::Alignment alignment READ alignment WRITE setAlignment ) Q_PROPERTY ( Qt::TextElideMode elideMode READ elideMode WRITE setElideMode ) Q_PROPERTY ( Hb::TextWrapping textWrapping READ textWrapping WRITE setTextWrapping ) Q_PROPERTY ( QColor textColor READ textColor WRITE setTextColor ) Q_PROPERTY ( HbIcon icon READ icon WRITE setIcon ) Q_PROPERTY ( Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode ):HbLabel ( QGraphicsItem * parent )
+//    {
+//    SMC_MOCK_METHOD1( void, QString plainText READ plainText WRITE setPlainText ) Q_PROPERTY ( QString html READ html WRITE setHtml ) Q_PROPERTY ( Qt::Alignment alignment READ alignment WRITE setAlignment ) Q_PROPERTY ( Qt::TextElideMode elideMode READ elideMode WRITE setElideMode ) Q_PROPERTY ( Hb::TextWrapping textWrapping READ textWrapping WRITE setTextWrapping ) Q_PROPERTY ( QColor textColor READ textColor WRITE setTextColor ) Q_PROPERTY ( HbIcon icon READ icon WRITE setIcon ) Q_PROPERTY ( Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode ):HbLabel ( QGraphicsItem *, parent )
+//    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::HbLabel
+// -----------------------------------------------------------------------------
+//
+HbLabel::HbLabel( 
+        const QString & displayText,
+        QGraphicsItem * parent )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// HbLabel::HbLabel
+// -----------------------------------------------------------------------------
+//
+HbLabel::HbLabel(QGraphicsItem *parent)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// HbLabel::~HbLabel
+// -----------------------------------------------------------------------------
+//
+HbLabel::~HbLabel(  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::plainText
+// -----------------------------------------------------------------------------
+//
+QString HbLabel::plainText(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::html
+// -----------------------------------------------------------------------------
+//
+QString HbLabel::html(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setElideMode
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setElideMode( 
+        Qt::TextElideMode elideMode )
+    {
+    SMC_MOCK_METHOD1( void, Qt::TextElideMode, elideMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::elideMode
+// -----------------------------------------------------------------------------
+//
+Qt::TextElideMode HbLabel::elideMode(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::TextElideMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setTextWrapping
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setTextWrapping( 
+        Hb::TextWrapping mode )
+    {
+    SMC_MOCK_METHOD1( void, Hb::TextWrapping, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::textWrapping
+// -----------------------------------------------------------------------------
+//
+Hb::TextWrapping HbLabel::textWrapping(  ) const
+    {
+    SMC_MOCK_METHOD0( Hb::TextWrapping )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setIcon
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setIcon( 
+        const HbIcon & icon )
+    {
+    SMC_MOCK_METHOD1( void, const HbIcon &, icon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::icon
+// -----------------------------------------------------------------------------
+//
+HbIcon HbLabel::icon(  ) const
+    {
+    SMC_MOCK_METHOD0( HbIcon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setAspectRatioMode
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setAspectRatioMode( 
+        Qt::AspectRatioMode mode )
+    {
+    SMC_MOCK_METHOD1( void, Qt::AspectRatioMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::aspectRatioMode
+// -----------------------------------------------------------------------------
+//
+Qt::AspectRatioMode HbLabel::aspectRatioMode(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::AspectRatioMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setAlignment
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setAlignment( 
+        Qt::Alignment alignment )
+    {
+    //SMC_MOCK_METHOD1( void, Qt::Alignment, alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::alignment
+// -----------------------------------------------------------------------------
+//
+Qt::Alignment HbLabel::alignment(  ) const
+    {
+    //SMC_MOCK_METHOD0( Qt::Alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setTextColor
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setTextColor( 
+        const QColor & textColor )
+    {
+    SMC_MOCK_METHOD1( void, const QColor &, textColor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::textColor
+// -----------------------------------------------------------------------------
+//
+QColor HbLabel::textColor(  ) const
+    {
+    SMC_MOCK_METHOD0( QColor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::isEmpty
+// -----------------------------------------------------------------------------
+//
+bool HbLabel::isEmpty(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::primitive
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbLabel::primitive( 
+        HbStyle::Primitive primitive ) const
+    {
+    SMC_MOCK_METHOD1( QGraphicsItem *, HbStyle::Primitive, primitive )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::type
+// -----------------------------------------------------------------------------
+//
+int HbLabel::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setPlainText
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setPlainText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setHtml
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setHtml( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setNumber
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setNumber( 
+        int number )
+    {
+    SMC_MOCK_METHOD1( void, int, number )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setNumber
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setNumber( 
+        qreal number )
+    {
+    SMC_MOCK_METHOD1( void, qreal, number )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::updatePrimitives
+// -----------------------------------------------------------------------------
+//
+void HbLabel::updatePrimitives(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::clear
+// -----------------------------------------------------------------------------
+//
+void HbLabel::clear(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::HbLabel
+// -----------------------------------------------------------------------------
+//
+HbLabel::HbLabel( 
+        HbLabelPrivate & dd,
+        QGraphicsItem * parent )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::initStyleOption
+// -----------------------------------------------------------------------------
+//
+void HbLabel::initStyleOption( 
+        HbStyleOptionLabel * option ) const
+    {
+    SMC_MOCK_METHOD1( void, HbStyleOptionLabel *, option )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbmarqueeitem.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbmarqueeitem.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::HbMarqueeItem
+// -----------------------------------------------------------------------------
+//
+HbMarqueeItem::HbMarqueeItem( 
+        QGraphicsItem * parent )
+    {
+    Q_UNUSED(parent)
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::HbMarqueeItem
+// -----------------------------------------------------------------------------
+//
+HbMarqueeItem::HbMarqueeItem( 
+        const QString & text,
+        QGraphicsItem * parent )
+    {
+    Q_UNUSED(text)
+    Q_UNUSED(parent)
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::~HbMarqueeItem
+// -----------------------------------------------------------------------------
+//
+HbMarqueeItem::~HbMarqueeItem(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::text
+// -----------------------------------------------------------------------------
+//
+QString HbMarqueeItem::text(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::setTextColor
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::setTextColor( 
+        const QColor & color )
+    {
+    SMC_MOCK_METHOD1( void, const QColor &, color )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::textColor
+// -----------------------------------------------------------------------------
+//
+QColor HbMarqueeItem::textColor(  ) const
+    {
+    SMC_MOCK_METHOD0( QColor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::isAnimating
+// -----------------------------------------------------------------------------
+//
+bool HbMarqueeItem::isAnimating(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::loopCount
+// -----------------------------------------------------------------------------
+//
+int HbMarqueeItem::loopCount(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::setLoopCount
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::setLoopCount( 
+        int count )
+    {
+    SMC_MOCK_METHOD1( void, int, count )
+    }
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::setText
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::setText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::startAnimation
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::startAnimation(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::stopAnimation
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::stopAnimation(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::animationStarted
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::animationStarted(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::animationStopped
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::animationStopped(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::sizeHint
+// -----------------------------------------------------------------------------
+//
+QSizeF HbMarqueeItem::sizeHint( 
+        Qt::SizeHint which,
+        const QSizeF & constraint ) const
+    {
+    SMC_MOCK_METHOD2( QSizeF, Qt::SizeHint, which, 
+        const QSizeF &, constraint )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::changeEvent
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::changeEvent( 
+        QEvent * event )
+    {
+    SMC_MOCK_METHOD1( void, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void HbMarqueeItem::resizeEvent( 
+        QGraphicsSceneResizeEvent *  )
+    {
+    //SMC_MOCK_METHOD1( void, QGraphicsSceneResizeEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbMarqueeItem::itemChange( 
+        GraphicsItemChange change,
+        const QVariant & value )
+    {
+    SMC_MOCK_METHOD2( QVariant, GraphicsItemChange, change, 
+        const QVariant &, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbMarqueeItem::HbMarqueeItem
+// -----------------------------------------------------------------------------
+//
+HbMarqueeItem::HbMarqueeItem( 
+        HbMarqueeItemPrivate & dd,
+        QGraphicsItem * parent )
+    {
+    Q_UNUSED(dd)
+    Q_UNUSED(parent)
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyle.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "hbstyle.h"
+
+//needed for TSmcValue<HbStyleParameters &,100>Size()const
+class HbStyleParameters {};
+//needed for TSmcValue<HbWidget *,100>Size()const
+class HbWidget {};
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbStyle::HbStyle
+// -----------------------------------------------------------------------------
+//
+HbStyle::HbStyle( ):d_ptr(NULL)
+       // QObject * parent )
+    {
+   // Q_UNUSED(parent);
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::~HbStyle
+// -----------------------------------------------------------------------------
+//
+HbStyle::~HbStyle(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::createPrimitive
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbStyle::createPrimitive( 
+        HbStyle::Primitive primitive,
+        QGraphicsItem * parent ) const
+    {
+    SMC_MOCK_METHOD2( QGraphicsItem *, HbStyle::Primitive, primitive, 
+        QGraphicsItem *, parent )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::updatePrimitive
+// -----------------------------------------------------------------------------
+//
+void HbStyle::updatePrimitive( 
+        QGraphicsItem * item,
+        HbStyle::Primitive primitive,
+        const QStyleOption * option ) const
+    {
+    SMC_MOCK_METHOD3( void, QGraphicsItem *, item, 
+        HbStyle::Primitive, primitive, 
+        const QStyleOption *, option )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::registerPlugin
+// -----------------------------------------------------------------------------
+//
+int HbStyle::registerPlugin( 
+        const QString & pluginName )
+    {
+    SMC_MOCK_METHOD1( int, const QString &, pluginName )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::unregisterPlugin
+// -----------------------------------------------------------------------------
+//
+void HbStyle::unregisterPlugin( 
+        const QString & pluginName )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, pluginName )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::setItemName
+// -----------------------------------------------------------------------------
+//
+void HbStyle::setItemName( 
+        QGraphicsItem * item,
+        const QString & name )
+    {
+    SMC_MOCK_METHOD2( void, QGraphicsItem *, item, 
+        const QString &, name )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::itemName
+// -----------------------------------------------------------------------------
+//
+QString HbStyle::itemName( 
+        const QGraphicsItem * item )
+    {
+    SMC_MOCK_METHOD1( QString, const QGraphicsItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::parameter
+// -----------------------------------------------------------------------------
+//
+bool HbStyle::parameter( 
+        const QString & parameter,
+        qreal & value,
+        const HbDeviceProfile & profile ) const
+    {
+    SMC_MOCK_METHOD3( bool, const QString &, parameter, 
+        qreal &, value, 
+        const HbDeviceProfile &, profile )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::parameters
+// -----------------------------------------------------------------------------
+//
+void HbStyle::parameters( 
+        HbStyleParameters & parameters,
+        const HbDeviceProfile & profile ) const
+    {
+    SMC_MOCK_METHOD2( void, HbStyleParameters &, parameters, 
+        const HbDeviceProfile &, profile )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::polish
+// -----------------------------------------------------------------------------
+//
+void HbStyle::polish( 
+        HbWidget * widget,
+        HbStyleParameters & params )
+    {
+    SMC_MOCK_METHOD2( void, HbWidget *, widget, 
+        HbStyleParameters &, params )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::updateThemedParams
+// -----------------------------------------------------------------------------
+//
+void HbStyle::updateThemedParams( 
+        HbWidget * widget )
+    {
+    SMC_MOCK_METHOD1( void, HbWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::hasOrientationSpecificStyleRules
+// -----------------------------------------------------------------------------
+//
+bool HbStyle::hasOrientationSpecificStyleRules( 
+        HbWidget * widget )
+    {
+    SMC_MOCK_METHOD1( bool, HbWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyle::HbStyle
+// -----------------------------------------------------------------------------
+//
+HbStyle::HbStyle( 
+        HbStylePrivate & dd,
+        QStyle * parent ):d_ptr(NULL)
+    //:
+    //QObject( /*dd, parent*/ )
+    {
+    Q_UNUSED(dd);
+    Q_UNUSED(parent);
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbstyleoptionlabel.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "hbstyleoptionlabel.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbStyleOptionLabel::HbStyleOptionLabel
+// -----------------------------------------------------------------------------
+//
+HbStyleOptionLabel::HbStyleOptionLabel(  )
+    //:
+    //HbStyleOption( /**/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyleOptionLabel::HbStyleOptionLabel
+// -----------------------------------------------------------------------------
+//
+HbStyleOptionLabel::HbStyleOptionLabel( 
+        const HbStyleOptionLabel & other )
+    //:
+    //HbStyleOption( /*other*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbStyleOptionLabel::~HbStyleOptionLabel
+// -----------------------------------------------------------------------------
+//
+HbStyleOptionLabel::~HbStyleOptionLabel(  )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_hbwidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,485 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbwidget.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbWidget::HbWidget
+// -----------------------------------------------------------------------------
+//
+HbWidget::HbWidget( 
+        QGraphicsItem * ,
+        Qt::WindowFlags  )
+    //:
+    //HbWidgetBase( /*parent, wFlags*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::~HbWidget
+// -----------------------------------------------------------------------------
+//
+HbWidget::~HbWidget(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::event
+// -----------------------------------------------------------------------------
+//
+bool HbWidget::event( 
+        QEvent *  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setStyle
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setStyle( 
+        HbStyle *  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::style
+// -----------------------------------------------------------------------------
+//
+HbStyle * HbWidget::style(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::clearActions
+// -----------------------------------------------------------------------------
+//
+void HbWidget::clearActions(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::pluginBaseId
+// -----------------------------------------------------------------------------
+//
+int HbWidget::pluginBaseId(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::mainWindow
+// -----------------------------------------------------------------------------
+//
+HbMainWindow * HbWidget::mainWindow(  ) const
+    {
+   // SMC_MOCK_METHOD0( HbMainWindow * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::primitive
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbWidget::primitive( 
+        HbStyle::Primitive  ) const
+    {
+  //  SMC_MOCK_METHOD1( QGraphicsItem *, HbStyle::Primitive, primitive )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusOrientation
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusOrientation( 
+        Qt::Orientations ,
+        Qt::Orientations  )
+    {
+   // SMC_MOCK_METHOD2( void, Qt::Orientations, previous, 
+     //   Qt::Orientations, next )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::keyForFocusNextChild
+// -----------------------------------------------------------------------------
+//
+QKeySequence HbWidget::keyForFocusNextChild(  ) const
+    {
+   // SMC_MOCK_METHOD0( QKeySequence )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::keyForFocusPreviousChild
+// -----------------------------------------------------------------------------
+//
+QKeySequence HbWidget::keyForFocusPreviousChild(  ) const
+    {
+  //  SMC_MOCK_METHOD0( QKeySequence )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setKeyFocusMode
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setKeyFocusMode( 
+        const QKeySequence &  )
+    {
+//    SMC_MOCK_METHOD1( void, const QKeySequence &, key )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::keyFocusMode
+// -----------------------------------------------------------------------------
+//
+QKeySequence HbWidget::keyFocusMode(  ) const
+    {
+//    SMC_MOCK_METHOD0( QKeySequence )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::lastFocusedChild
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbWidget::lastFocusedChild(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QGraphicsItem * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusOrder
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusOrder( 
+        QGraphicsItem * ,
+        QGraphicsItem *  )
+    {
+   // SMC_MOCK_METHOD2( void, QGraphicsItem *, first, 
+     //   QGraphicsItem *, second )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusDelegation
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusDelegation( 
+        HbWidget::FocusDelegation  )
+    {
+ //   SMC_MOCK_METHOD1( void, HbWidget::FocusDelegation, focusDelegation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusDelegation
+// -----------------------------------------------------------------------------
+//
+HbWidget::FocusDelegation HbWidget::focusDelegation(  ) const
+    {
+  //  SMC_MOCK_METHOD0( HbWidget::FocusDelegation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusLooping
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusLooping( 
+        bool enable )
+    {
+    SMC_MOCK_METHOD1( void, bool, enable )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::hasFocusLooping
+// -----------------------------------------------------------------------------
+//
+bool HbWidget::hasFocusLooping(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusMode
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusMode( 
+        HbWidget::FocusMode )
+    {
+   // SMC_MOCK_METHOD1( void, HbWidget::, FocusMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusMode
+// -----------------------------------------------------------------------------
+//
+HbWidget::FocusMode HbWidget::focusMode(  ) const
+    {
+  //  SMC_MOCK_METHOD0( HbWidget::FocusMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusHighlight
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusHighlight( 
+        HbStyle::Primitive ,
+        HbWidget::FocusHighlight  )
+    {
+  //  SMC_MOCK_METHOD2( void, HbStyle::Primitive, type, 
+    //    HbWidget::FocusHighlight, focusHighlight )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusHighlight
+// -----------------------------------------------------------------------------
+//
+HbStyle::Primitive HbWidget::focusHighlight( 
+        HbWidget::FocusHighlight  )
+    {
+ //   SMC_MOCK_METHOD1( HbStyle::Primitive, HbWidget::FocusHighlight, focusHighlight )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setBackgroundItem
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setBackgroundItem( 
+        HbStyle::Primitive ,
+        int  )
+    {
+  //  SMC_MOCK_METHOD2( void, HbStyle::Primitive, type, 
+    //    int, zValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setBackgroundItem
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setBackgroundItem( 
+        QGraphicsItem * ,
+        int  )
+    {
+   // SMC_MOCK_METHOD2( void, QGraphicsItem *, item, 
+     //   int, zValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::backgroundItem
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbWidget::backgroundItem(  ) const
+    {
+   // SMC_MOCK_METHOD0( QGraphicsItem * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::overrideFeedback
+// -----------------------------------------------------------------------------
+//
+HbFeedback::InstantEffect HbWidget::overrideFeedback( 
+        Hb::InstantInteraction  ) const
+    {
+  //  SMC_MOCK_METHOD1( HbFeedback::InstantEffect, Hb::InstantInteraction, interaction )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::overrideContinuousFeedback
+// -----------------------------------------------------------------------------
+//
+HbFeedback::ContinuousEffect HbWidget::overrideContinuousFeedback( 
+        Hb::ContinuousInteraction ,
+        int *  ) const
+    {
+  //  SMC_MOCK_METHOD2( HbFeedback::ContinuousEffect, Hb::ContinuousInteraction, interaction, 
+    //    int *, intensity )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::recreatePrimitives
+// -----------------------------------------------------------------------------
+//
+void HbWidget::recreatePrimitives(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::updatePrimitives
+// -----------------------------------------------------------------------------
+//
+void HbWidget::updatePrimitives(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusInEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::focusInEvent( 
+        QFocusEvent *  )
+    {
+ //   SMC_MOCK_METHOD1( void, QFocusEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusOutEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::focusOutEvent( 
+        QFocusEvent *  )
+    {
+  //  SMC_MOCK_METHOD1( void, QFocusEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::resizeEvent( 
+        QGraphicsSceneResizeEvent *  )
+    {
+  //  SMC_MOCK_METHOD1( void, QGraphicsSceneResizeEvent *, event )
+    }
+
+// -----------------------------------------------------------------------------
+// HbWidget::changeEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::changeEvent( 
+        QEvent * event )
+    {
+    SMC_MOCK_METHOD1( void, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbWidget::itemChange( 
+        GraphicsItemChange ,
+        const QVariant &  )
+    {
+ //   SMC_MOCK_METHOD2( QVariant, GraphicsItemChange, change, 
+   //     const QVariant &, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::polishEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::polishEvent(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::polish
+// -----------------------------------------------------------------------------
+//
+void HbWidget::polish( 
+        HbStyleParameters &  )
+    {
+ //   SMC_MOCK_METHOD1( void, HbStyleParameters &, params )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::repolish
+// -----------------------------------------------------------------------------
+//
+void HbWidget::repolish(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setPluginBaseId
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setPluginBaseId( 
+        int baseId )
+    {
+    SMC_MOCK_METHOD1( void, int, baseId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::gestureEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::gestureEvent( 
+        QGestureEvent *  )
+    {
+  //  SMC_MOCK_METHOD1( void, QGestureEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::HbWidget
+// -----------------------------------------------------------------------------
+//
+HbWidget::HbWidget( 
+        HbWidgetPrivate & ,
+        QGraphicsItem * ,
+        Qt::WindowFlags  )
+    //:
+    //HbWidgetBase( /*dd, parent, wFlags*/ )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,431 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbanchorlayout.h>
+#include <hbwidget.h>
+#include <hbiconitem.h>
+#include <hbmarqueeitem.h>
+#include <hbfontspec.h>
+#include <hbdialog.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbcheckbox.h>
+#include <hbpushbutton.h>
+#include <QPainter>
+#include <QPainterPath>
+#include <QBrush>
+#include <QGraphicsLinearLayout>
+#include "infowidget.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// InfoWidget::InfoWidget
+// -----------------------------------------------------------------------------
+//
+InfoWidget::InfoWidget( 
+        QGraphicsItem * parent,
+        Qt::WindowFlags flags )
+    : HbWidget(parent, flags)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::~InfoWidget
+// -----------------------------------------------------------------------------
+//
+InfoWidget::~InfoWidget(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::boundingRect
+// -----------------------------------------------------------------------------
+//
+QRectF InfoWidget::boundingRect(  ) const
+    {
+    SMC_MOCK_METHOD0( QRectF )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::shape
+// -----------------------------------------------------------------------------
+//
+QPainterPath InfoWidget::shape(  ) const
+    {
+    SMC_MOCK_METHOD0( QPainterPath )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::sizeHint
+// -----------------------------------------------------------------------------
+//
+QSizeF InfoWidget::sizeHint( 
+        Qt::SizeHint which,
+        const QSizeF & constraint ) const
+    {
+    SMC_MOCK_METHOD2( QSizeF, Qt::SizeHint, which, 
+        const QSizeF &, constraint )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::sizePolicy
+// -----------------------------------------------------------------------------
+//
+QSizePolicy InfoWidget::sizePolicy(  ) const
+    {
+    SMC_MOCK_METHOD0( QSizePolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::homeZoneDisplay
+// -----------------------------------------------------------------------------
+//
+QString InfoWidget::homeZoneDisplay()
+    {
+    SMC_MOCK_METHOD0( QString );
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::setHomeZoneDisplay
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::setHomeZoneDisplay( 
+        QString value )
+    {
+    SMC_MOCK_METHOD1( void, QString, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::mcnDisplay
+// -----------------------------------------------------------------------------
+//
+QString InfoWidget::mcnDisplay(  )
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::setMcnDisplay
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::setMcnDisplay( 
+        QString value )
+    {
+    SMC_MOCK_METHOD1( void, QString, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::activeLineDisplay
+// -----------------------------------------------------------------------------
+//
+QString InfoWidget::activeLineDisplay(  )
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::setActiveLineDisplay
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::setActiveLineDisplay( 
+        QString value )
+    {
+    SMC_MOCK_METHOD1( void, QString, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::satDisplay
+// -----------------------------------------------------------------------------
+//
+QString InfoWidget::satDisplay(  )
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::setSatDisplay
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::setSatDisplay( 
+        QString value )
+    {
+    SMC_MOCK_METHOD1( void, QString, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::spnDisplay
+// -----------------------------------------------------------------------------
+//
+QString InfoWidget::spnDisplay(  )
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::setSpnDisplay
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::setSpnDisplay( 
+        QString value )
+    {
+    SMC_MOCK_METHOD1( void, QString, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::onInitialize
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::onInitialize(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::onUninitialize
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::onUninitialize(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::onShow
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::onShow(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::onHide
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::onHide(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::readModel
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::readModel(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::handleModelError
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::handleModelError( 
+        int operation,
+        int errorCode )
+    {
+    SMC_MOCK_METHOD2( void, int, operation, 
+        int, errorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::spnDisplaySettingChanged
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::spnDisplaySettingChanged( 
+        int state )
+    {
+    SMC_MOCK_METHOD1( void, int, state )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::mcnDisplaySettingChanged
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::mcnDisplaySettingChanged( 
+        int state )
+    {
+    SMC_MOCK_METHOD1( void, int, state )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::satDisplaySettingChanged
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::satDisplaySettingChanged( 
+        int state )
+    {
+    SMC_MOCK_METHOD1( void, int, state )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::settingsEditingFinished
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::settingsEditingFinished(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::settingsValidationFailed
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::settingsValidationFailed(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::paint
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::paint( 
+        QPainter * painter,
+        const QStyleOptionGraphicsItem * option,
+        QWidget * widget )
+    {
+    SMC_MOCK_METHOD3( void, QPainter *, painter, 
+        const QStyleOptionGraphicsItem *, option, 
+        QWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::mousePressEvent
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::mousePressEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::mouseMoveEvent
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::updateInfoDisplay
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::updateInfoDisplay(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::readPersistentPreferences
+// -----------------------------------------------------------------------------
+//
+bool InfoWidget::readPersistentPreferences(  )
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::initializeCheckBoxStates
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::initializeCheckBoxStates(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::changeEvent
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::changeEvent( 
+        QEvent * event )
+    {
+    SMC_MOCK_METHOD1( void, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::installTranslator
+// -----------------------------------------------------------------------------
+//
+bool InfoWidget::installTranslator( 
+        QString translationFile )
+    {
+    SMC_MOCK_METHOD1( bool, QString, translationFile )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidget::removeTranslators
+// -----------------------------------------------------------------------------
+//
+void InfoWidget::removeTranslators(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetengine.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "infowidgetnetworkhandler.h"
+#include "infowidgetsathandler.h"
+#include "infowidgetengine.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::InfoWidgetEngine
+// -----------------------------------------------------------------------------
+//
+InfoWidgetEngine::InfoWidgetEngine( 
+        QObject * parent )
+    :QObject( parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::~InfoWidgetEngine
+// -----------------------------------------------------------------------------
+//
+InfoWidgetEngine::~InfoWidgetEngine(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::modelData
+// -----------------------------------------------------------------------------
+//
+const InfoWidgetEngine::ModelData & InfoWidgetEngine::modelData(  ) const
+    {
+    SMC_MOCK_METHOD0( const InfoWidgetEngine::ModelData & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::logModelData
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::logModelData(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::updateNetworkDataToModel
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::updateNetworkDataToModel(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::updateSatDataToModel
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::updateSatDataToModel(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::updateLineDataToModel
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::updateLineDataToModel(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::handleNetworkError
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::handleNetworkError( 
+        int operation,
+        int errorCode )
+    {
+    SMC_MOCK_METHOD2( void, int, operation, 
+        int, errorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::handleSatError
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::handleSatError( 
+        int operation,
+        int errorCode )
+    {
+    SMC_MOCK_METHOD2( void, int, operation, 
+        int, errorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::handleLineError
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::handleLineError( 
+        int operation,
+        int errorCode )
+    {
+    SMC_MOCK_METHOD2( void, int, operation, 
+        int, errorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::suspend
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::suspend(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::resume
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::resume(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetEngine::preferenceChanged
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetEngine::preferenceChanged( 
+        int option,
+        int displaySetting )
+    {
+    SMC_MOCK_METHOD2( void, int, option, 
+        int, displaySetting )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetlayoutmanager.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <QObject>
+#include <smcmockclassincludes.h>
+#include "infowidgetlayoutmanager.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::InfoWidgetLayoutManager
+// -----------------------------------------------------------------------------
+//
+InfoWidgetLayoutManager::InfoWidgetLayoutManager( 
+        QObject * parent )
+    :QObject( parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::~InfoWidgetLayoutManager
+// -----------------------------------------------------------------------------
+//
+InfoWidgetLayoutManager::~InfoWidgetLayoutManager(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::destroyObjects
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetLayoutManager::destroyObjects(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::currentDisplayRole
+// -----------------------------------------------------------------------------
+//
+InfoWidgetLayoutManager::DisplayRole InfoWidgetLayoutManager::currentDisplayRole(  )
+    {
+    SMC_MOCK_METHOD0( DisplayRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::currentWidgetRoles
+// -----------------------------------------------------------------------------
+//
+QList <InfoWidgetLayoutManager::LayoutItemRole > 
+        InfoWidgetLayoutManager::currentWidgetRoles(  )
+    {
+    SMC_MOCK_METHOD0( QList <LayoutItemRole > )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::layoutRows
+// -----------------------------------------------------------------------------
+//
+int InfoWidgetLayoutManager::layoutRows(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::setLayoutRows
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetLayoutManager::setLayoutRows( 
+        int rows )
+    {
+    SMC_MOCK_METHOD1( void, int, rows )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::rowHeight
+// -----------------------------------------------------------------------------
+//
+qreal InfoWidgetLayoutManager::rowHeight(  ) const
+    {
+    SMC_MOCK_METHOD0( qreal )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::layoutInfoDisplay
+// -----------------------------------------------------------------------------
+//
+QGraphicsLayout * InfoWidgetLayoutManager::layoutInfoDisplay(  )
+    {
+    SMC_MOCK_METHOD0( QGraphicsLayout * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::layoutSettingsDisplay
+// -----------------------------------------------------------------------------
+//
+QGraphicsLayout * InfoWidgetLayoutManager::layoutSettingsDisplay(  )
+    {
+    SMC_MOCK_METHOD0( QGraphicsLayout * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::widgetRoles
+// -----------------------------------------------------------------------------
+//
+const QList <InfoWidgetLayoutManager::LayoutItemRole > 
+        InfoWidgetLayoutManager::widgetRoles(DisplayRole displayRole ) const
+    {
+    SMC_MOCK_METHOD1( 
+        const QList <InfoWidgetLayoutManager::LayoutItemRole >, 
+        DisplayRole, displayRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::loadWidgets
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetLayoutManager::loadWidgets(
+        const DisplayRole displayRole, 
+        const QList<LayoutItemRole> &displayWidgets,
+        QMap<LayoutItemRole, QGraphicsWidget *> &widgetMap)
+    {
+    typedef QMap <LayoutItemRole, QGraphicsWidget *> & TYPE3;
+    SMC_MOCK_METHOD3( bool, const DisplayRole, displayRole, 
+        const QList<LayoutItemRole> &, displayWidgets, 
+        TYPE3, widgetMap )
+    }
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::reloadWidgets
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetLayoutManager::reloadWidgets( 
+        const DisplayRole displayRole )
+    {
+    SMC_MOCK_METHOD1( bool, const DisplayRole, displayRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::loadWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget* InfoWidgetLayoutManager::loadWidget(
+        InfoWidgetDocumentLoader &loader, 
+        DisplayRole displayRole, 
+        LayoutItemRole widgetRole)
+    {
+    SMC_MOCK_METHOD3( QGraphicsWidget *, InfoWidgetDocumentLoader &, loader, 
+        DisplayRole, displayRole, 
+        LayoutItemRole, widgetRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::getWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * InfoWidgetLayoutManager::getWidget( 
+        LayoutItemRole itemRole )
+    {
+    SMC_MOCK_METHOD1( QGraphicsWidget *, LayoutItemRole, itemRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::contentWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * InfoWidgetLayoutManager::contentWidget(  )
+    {
+    SMC_MOCK_METHOD0( QGraphicsWidget * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::removeWidget
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetLayoutManager::removeWidget( 
+        LayoutItemRole itemRole )
+    {
+    SMC_MOCK_METHOD1( void, LayoutItemRole, itemRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::hideWidget
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetLayoutManager::hideWidget( 
+        LayoutItemRole itemRole )
+    {
+    SMC_MOCK_METHOD1( void, LayoutItemRole, itemRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::hideAll
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetLayoutManager::hideAll(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetLayoutManager::showAll
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetLayoutManager::showAll(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetDocumentLoader::InfoWidgetDocumentLoader
+// -----------------------------------------------------------------------------
+//
+InfoWidgetDocumentLoader::InfoWidgetDocumentLoader(  )
+    //:
+    //HbDocumentLoader( /**/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetDocumentLoader::createObject
+// -----------------------------------------------------------------------------
+//
+QObject * InfoWidgetDocumentLoader::createObject( 
+        const QString & type,
+        const QString & name )
+    {
+    SMC_MOCK_METHOD2( QObject *, const QString &, type, 
+        const QString &, name )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetnetworkhandler.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <networkhandlingproxy.h>
+#include <cnwsession.h>
+#include "infowidgetnetworkhandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::InfoWidgetNetworkHandler
+// -----------------------------------------------------------------------------
+//
+InfoWidgetNetworkHandler::InfoWidgetNetworkHandler( 
+        QObject * parent )
+    : 
+    QObject(parent), 
+    m_nwSession(0)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler
+// -----------------------------------------------------------------------------
+//
+InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::serviceProviderName
+// -----------------------------------------------------------------------------
+//
+QString InfoWidgetNetworkHandler::serviceProviderName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::homeZoneTextTag
+// -----------------------------------------------------------------------------
+//
+QString InfoWidgetNetworkHandler::homeZoneTextTag(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::homeZoneIndicatorType
+// -----------------------------------------------------------------------------
+//
+int InfoWidgetNetworkHandler::homeZoneIndicatorType(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::mcnName
+// -----------------------------------------------------------------------------
+//
+QString InfoWidgetNetworkHandler::mcnName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::mcnIndicatorType
+// -----------------------------------------------------------------------------
+//
+int InfoWidgetNetworkHandler::mcnIndicatorType(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+    
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::networkRegistrationStatus
+// -----------------------------------------------------------------------------
+//
+int InfoWidgetNetworkHandler::networkRegistrationStatus(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::isOnline
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetNetworkHandler::isOnline(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::logCurrentInfo
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::logCurrentInfo(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::HandleNetworkMessage
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::HandleNetworkMessage( 
+        const TNWMessages aMessage )
+    {
+    SMC_MOCK_METHOD1( void, const TNWMessages, aMessage )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::HandleNetworkError
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::HandleNetworkError( 
+        const TNWOperation aOperation,
+        TInt aErrorCode )
+    {
+    SMC_MOCK_METHOD2( void, const TNWOperation, aOperation, 
+        TInt, aErrorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::suspend
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::suspend(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::resume
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::resume(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::enableMcn
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::enableMcn(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::disableMcn
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::disableMcn(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::writeMcnDisplayState
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetNetworkHandler::writeMcnDisplayState( 
+        bool enabled )
+    {
+    SMC_MOCK_METHOD1( void, bool, enabled )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetNetworkHandler::readMcnDisplayState
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetNetworkHandler::readMcnDisplayState(  )
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetpreferences.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "infowidgetpreferences.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::InfoWidgetPreferences
+// -----------------------------------------------------------------------------
+//
+InfoWidgetPreferences::InfoWidgetPreferences( 
+        QObject * parent ):
+    QObject( parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::~InfoWidgetPreferences
+// -----------------------------------------------------------------------------
+//
+InfoWidgetPreferences::~InfoWidgetPreferences(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::loadPreferences
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetPreferences::restorePreferences(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::storePreferences
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetPreferences::storePreferences(  )
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::preference
+// -----------------------------------------------------------------------------
+//
+QString InfoWidgetPreferences::preference( 
+        Option preferenceId ) const
+    {
+    SMC_MOCK_METHOD1( QString, Option, preferenceId )
+    }
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::preferences
+// -----------------------------------------------------------------------------
+//
+InfoWidgetPreferences::Options InfoWidgetPreferences::preferences() const
+    {
+    SMC_MOCK_METHOD0( InfoWidgetPreferences::Options )
+    }
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::setPreference
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetPreferences::setPreference( 
+        Option preferenceId,
+        const QString & preferenceString )
+    {
+    SMC_MOCK_METHOD2( void, Option, preferenceId, 
+        const QString &, preferenceString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::isPreferenceSet
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetPreferences::isPreferenceSet( Option preferenceId ) const
+    {
+    SMC_MOCK_METHOD1( bool, Option, preferenceId)
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::validate
+// -----------------------------------------------------------------------------
+//
+bool InfoWidgetPreferences::validate(  )
+    {
+    SMC_MOCK_METHOD0( bool)
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::visibleItemCount
+// -----------------------------------------------------------------------------
+//
+int InfoWidgetPreferences::visibleItemCount(  )
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetPreferences::preferenceNames
+// -----------------------------------------------------------------------------
+//
+QStringList InfoWidgetPreferences::preferenceNames() 
+    {
+    SMC_MOCK_METHOD0( QStringList )
+    }
+    
+    
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandler.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "infowidgetsathandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::InfoWidgetSatHandler
+// -----------------------------------------------------------------------------
+//
+InfoWidgetSatHandler::InfoWidgetSatHandler( 
+        QObject * parent )
+    {
+    Q_UNUSED(parent);
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::~InfoWidgetSatHandler
+// -----------------------------------------------------------------------------
+//
+InfoWidgetSatHandler::~InfoWidgetSatHandler(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::connect
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandler::connect( 
+        bool connect )
+    {
+    SMC_MOCK_METHOD1( void, bool, connect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::satDisplayText
+// -----------------------------------------------------------------------------
+//
+const QString & InfoWidgetSatHandler::satDisplayText(  ) const
+    {
+    SMC_MOCK_METHOD0( const QString & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::setSatDisplayText
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandler::setSatDisplayText( 
+        const QString & displayText )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, displayText )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::logCurrentInfo
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandler::logCurrentInfo(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::handleIdleModeTxtMessage
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandler::handleIdleModeTxtMessage( 
+        int idleResult )
+    {
+    SMC_MOCK_METHOD1( void, int, idleResult )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandler::handleSatError
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandler::handleSatError( 
+        int operation,
+        int errorCode )
+    {
+    SMC_MOCK_METHOD2( void, int, operation, 
+        int, errorCode )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_infowidgetsathandlerprivate.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "infowidgetsathandlerprivate.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate
+// -----------------------------------------------------------------------------
+//
+InfoWidgetSatHandlerPrivate::InfoWidgetSatHandlerPrivate( 
+        InfoWidgetSatHandler * iwSatHandler,
+        RSatService & iSatService )
+    :CActive( 0 ),
+        m_satService(iSatService)
+    
+    {
+    Q_UNUSED(iwSatHandler)
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate
+// -----------------------------------------------------------------------------
+//
+InfoWidgetSatHandlerPrivate::~InfoWidgetSatHandlerPrivate(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandlerPrivate::startObserving
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandlerPrivate::startObserving(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandlerPrivate::connect
+// -----------------------------------------------------------------------------
+//
+int InfoWidgetSatHandlerPrivate::connect(  )
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandlerPrivate::disconnect
+// -----------------------------------------------------------------------------
+//
+int InfoWidgetSatHandlerPrivate::disconnect(  )
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+    
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandlerPrivate::DoCancel
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandlerPrivate::DoCancel( )
+	 {
+	 SMC_MOCK_METHOD0( void )	
+	 }
+	
+	
+// -----------------------------------------------------------------------------
+// InfoWidgetSatHandlerPrivate::RunL
+// -----------------------------------------------------------------------------
+//
+void InfoWidgetSatHandlerPrivate::RunL( )
+	 {
+	 SMC_MOCK_METHOD0( void )		
+	 }
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_networkhandlingproxy.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the header file of the class NetworkHandlingProxy.
+*
+*/
+
+#include <smcmockclassincludes.h>
+#include <networkhandlingproxy.h>
+#include <nwhandlingengine.h> 
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CNWSession* CreateL( MNWMessageObserver& aMessage, TNWInfo& aTNWInfo )
+    {
+    SMC_MOCK_METHOD2(CNWSession*, 
+        MNWMessageObserver&, aMessage, 
+        TNWInfo&, aTNWInfo);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslayout.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "qgraphicslayout.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::QGraphicsLayout
+// -----------------------------------------------------------------------------
+//
+QGraphicsLayout::QGraphicsLayout( 
+        QGraphicsLayoutItem * parent )
+    //:
+    //QGraphicsLayoutItem( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::~QGraphicsLayout
+// -----------------------------------------------------------------------------
+//
+QGraphicsLayout::~QGraphicsLayout(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::setContentsMargins
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::setContentsMargins( 
+        qreal left,
+        qreal top,
+        qreal right,
+        qreal bottom )
+    {
+    SMC_MOCK_METHOD4( void, qreal, left, 
+        qreal, top, 
+        qreal, right, 
+        qreal, bottom )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::getContentsMargins
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::getContentsMargins( 
+        qreal * left,
+        qreal * top,
+        qreal * right,
+        qreal * bottom ) const
+    {
+    SMC_MOCK_METHOD4( void, qreal *, left, 
+        qreal *, top, 
+        qreal *, right, 
+        qreal *, bottom )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::activate
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::activate(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::isActivated
+// -----------------------------------------------------------------------------
+//
+bool QGraphicsLayout::isActivated(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::invalidate
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::invalidate(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::updateGeometry
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::updateGeometry(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::widgetEvent
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::widgetEvent( 
+        QEvent * e )
+    {
+    SMC_MOCK_METHOD1( void, QEvent *, e )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::count
+// -----------------------------------------------------------------------------
+//
+int QGraphicsLayout::count(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::itemAt
+// -----------------------------------------------------------------------------
+//
+QGraphicsLayoutItem * QGraphicsLayout::itemAt( 
+        int i ) const
+    {
+    SMC_MOCK_METHOD1( QGraphicsLayoutItem *, int, i )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::removeAt
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::removeAt( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( void, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::QGraphicsLayout
+// -----------------------------------------------------------------------------
+//
+QGraphicsLayout::QGraphicsLayout( 
+        QGraphicsLayoutPrivate &,
+        QGraphicsLayoutItem * )
+    //:
+    //QGraphicsLayoutItem( /*&, **/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLayout::addChildLayoutItem
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLayout::addChildLayoutItem( 
+        QGraphicsLayoutItem * layoutItem )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsLayoutItem *, layoutItem )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qgraphicslinearlayout.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,289 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "qgraphicslinearlayout.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::QGraphicsLinearLayout
+// -----------------------------------------------------------------------------
+//
+QGraphicsLinearLayout::QGraphicsLinearLayout( 
+        QGraphicsLayoutItem * parent )
+    //:
+    //QGraphicsLayout( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::QGraphicsLinearLayout
+// -----------------------------------------------------------------------------
+//
+QGraphicsLinearLayout::QGraphicsLinearLayout( 
+        Qt::Orientation orientation,
+        QGraphicsLayoutItem * parent )
+    //:
+    //QGraphicsLayout( /*orientation, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::~QGraphicsLinearLayout
+// -----------------------------------------------------------------------------
+//
+QGraphicsLinearLayout::~QGraphicsLinearLayout(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::setOrientation
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::setOrientation( 
+        Qt::Orientation orientation )
+    {
+    SMC_MOCK_METHOD1( void, Qt::Orientation, orientation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::orientation
+// -----------------------------------------------------------------------------
+//
+Qt::Orientation QGraphicsLinearLayout::orientation(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::Orientation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::insertItem
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::insertItem( 
+        int index,
+        QGraphicsLayoutItem * item )
+    {
+    SMC_MOCK_METHOD2( void, int, index, 
+        QGraphicsLayoutItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::insertStretch
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::insertStretch( 
+        int index,
+        int stretch )
+    {
+    SMC_MOCK_METHOD2( void, int, index, 
+        int, stretch )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::removeItem
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::removeItem( 
+        QGraphicsLayoutItem * item )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsLayoutItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::removeAt
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::removeAt( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( void, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::setSpacing
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::setSpacing( 
+        qreal spacing )
+    {
+    SMC_MOCK_METHOD1( void, qreal, spacing )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::spacing
+// -----------------------------------------------------------------------------
+//
+qreal QGraphicsLinearLayout::spacing(  ) const
+    {
+    SMC_MOCK_METHOD0( qreal )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::setItemSpacing
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::setItemSpacing( 
+        int index,
+        qreal spacing )
+    {
+    SMC_MOCK_METHOD2( void, int, index, 
+        qreal, spacing )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::itemSpacing
+// -----------------------------------------------------------------------------
+//
+qreal QGraphicsLinearLayout::itemSpacing( 
+        int index ) const
+    {
+    SMC_MOCK_METHOD1( qreal, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::setStretchFactor
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::setStretchFactor( 
+        QGraphicsLayoutItem * item,
+        int stretch )
+    {
+    SMC_MOCK_METHOD2( void, QGraphicsLayoutItem *, item, 
+        int, stretch )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::stretchFactor
+// -----------------------------------------------------------------------------
+//
+int QGraphicsLinearLayout::stretchFactor( 
+        QGraphicsLayoutItem * item ) const
+    {
+    SMC_MOCK_METHOD1( int, QGraphicsLayoutItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::setAlignment
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::setAlignment( 
+        QGraphicsLayoutItem * item,
+        Qt::Alignment alignment )
+    {
+//    SMC_MOCK_METHOD2( void, QGraphicsLayoutItem *, item, 
+//        Qt::Alignment, alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::alignment
+// -----------------------------------------------------------------------------
+//
+Qt::Alignment QGraphicsLinearLayout::alignment( 
+        QGraphicsLayoutItem * item ) const
+    {
+    //SMC_MOCK_METHOD1( Qt::Alignment, QGraphicsLayoutItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::setGeometry
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::setGeometry( 
+        const QRectF & rect )
+    {
+    SMC_MOCK_METHOD1( void, const QRectF &, rect )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::count
+// -----------------------------------------------------------------------------
+//
+int QGraphicsLinearLayout::count(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::itemAt
+// -----------------------------------------------------------------------------
+//
+QGraphicsLayoutItem * QGraphicsLinearLayout::itemAt( 
+        int index ) const
+    {
+    SMC_MOCK_METHOD1( QGraphicsLayoutItem *, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::invalidate
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::invalidate(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::sizeHint
+// -----------------------------------------------------------------------------
+//
+QSizeF QGraphicsLinearLayout::sizeHint( 
+        Qt::SizeHint which,
+        const QSizeF & constraint ) const
+    {
+    SMC_MOCK_METHOD2( QSizeF, Qt::SizeHint, which, 
+        const QSizeF &, constraint )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QGraphicsLinearLayout::dump
+// -----------------------------------------------------------------------------
+//
+void QGraphicsLinearLayout::dump( 
+        int indent ) const
+    {
+    SMC_MOCK_METHOD1( void, int, indent )
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qserviceinterfacedescriptor.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <QStringList>
+#include <smcmockclassincludes.h>
+#include "qserviceinterfacedescriptor.h"
+
+QTM_BEGIN_NAMESPACE
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::QServiceInterfaceDescriptor
+// -----------------------------------------------------------------------------
+//
+QServiceInterfaceDescriptor::QServiceInterfaceDescriptor(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::QServiceInterfaceDescriptor
+// -----------------------------------------------------------------------------
+//
+QServiceInterfaceDescriptor::QServiceInterfaceDescriptor( 
+        const QServiceInterfaceDescriptor & other )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::~QServiceInterfaceDescriptor
+// -----------------------------------------------------------------------------
+//
+QServiceInterfaceDescriptor::~QServiceInterfaceDescriptor(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::=
+// -----------------------------------------------------------------------------
+//
+QServiceInterfaceDescriptor & QServiceInterfaceDescriptor::operator=(const QServiceInterfaceDescriptor & other )
+    {
+    SMC_MOCK_METHOD1( QServiceInterfaceDescriptor &, const QServiceInterfaceDescriptor &, other )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::=
+// -----------------------------------------------------------------------------
+//
+bool QServiceInterfaceDescriptor::operator==(const QServiceInterfaceDescriptor& other) const
+    {
+    SMC_MOCK_METHOD1( bool, const QServiceInterfaceDescriptor &, other )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::serviceName
+// -----------------------------------------------------------------------------
+//
+QString QServiceInterfaceDescriptor::serviceName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::interfaceName
+// -----------------------------------------------------------------------------
+//
+QString QServiceInterfaceDescriptor::interfaceName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::majorVersion
+// -----------------------------------------------------------------------------
+//
+int QServiceInterfaceDescriptor::majorVersion(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::minorVersion
+// -----------------------------------------------------------------------------
+//
+int QServiceInterfaceDescriptor::minorVersion(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::isValid
+// -----------------------------------------------------------------------------
+//
+bool QServiceInterfaceDescriptor::isValid(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::scope
+// -----------------------------------------------------------------------------
+//
+QService::Scope QServiceInterfaceDescriptor::scope(  ) const
+    {
+    SMC_MOCK_METHOD0( QService::Scope )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::attribute
+// -----------------------------------------------------------------------------
+//
+QVariant QServiceInterfaceDescriptor::attribute( 
+        QServiceInterfaceDescriptor::Attribute which ) const
+    {
+    SMC_MOCK_METHOD1( QVariant, QServiceInterfaceDescriptor::Attribute, which )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::customAttribute
+// -----------------------------------------------------------------------------
+//
+QString QServiceInterfaceDescriptor::customAttribute( 
+        const QString & which ) const
+    {
+    SMC_MOCK_METHOD1( QString, const QString &, which )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServiceInterfaceDescriptor::customAttributes
+// -----------------------------------------------------------------------------
+//
+QStringList QServiceInterfaceDescriptor::customAttributes(  ) const
+    {
+    SMC_MOCK_METHOD0( QStringList )
+    }
+
+QTM_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_qserviceplugininterface.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <qserviceplugininterface.h>
+
+
+QTM_BEGIN_NAMESPACE
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QServicePluginInterface::QServicePluginInterface
+// -----------------------------------------------------------------------------
+//
+QServicePluginInterface::QServicePluginInterface(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServicePluginInterface::~QServicePluginInterface
+// -----------------------------------------------------------------------------
+//
+QServicePluginInterface::~QServicePluginInterface(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServicePluginInterface::installService
+// -----------------------------------------------------------------------------
+//
+void QServicePluginInterface::installService(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QServicePluginInterface::uninstallService
+// -----------------------------------------------------------------------------
+//
+void QServicePluginInterface::uninstallService(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+QTM_END_NAMESPACE
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_rsatservice.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "rsatservice.h"
+
+class TSatIconInfo{
+    
+};
+
+class RSatSession{
+
+};
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// RSatService::RSatService
+// -----------------------------------------------------------------------------
+//
+RSatService::RSatService(  )
+    //:
+    //RSubSessionBase( /**/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::OpenL
+// -----------------------------------------------------------------------------
+//
+void RSatService::OpenL( 
+        const RSatSession & aSession )
+    {
+    SMC_MOCK_METHOD1( void, const RSatSession &, aSession )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::Close
+// -----------------------------------------------------------------------------
+//
+void RSatService::Close(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::NotifySetupIdleModeTextChange
+// -----------------------------------------------------------------------------
+//
+TInt RSatService::NotifySetupIdleModeTextChange( 
+        TRequestStatus & aStatus )
+    {
+    SMC_MOCK_METHOD1( TInt, TRequestStatus &, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::NotifySetupIdleModeTextChangeCancel
+// -----------------------------------------------------------------------------
+//
+void RSatService::NotifySetupIdleModeTextChangeCancel(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::GetSetupIdleModeTextL
+// -----------------------------------------------------------------------------
+//
+TBool RSatService::GetSetupIdleModeTextL( 
+        HBufC * & aText,
+        TSatIconQualifier & aIconQualifier,
+        TUint8 & aRecordNumber )
+    {
+    aText = HBufC::NewL(15);
+    SMC_MOCK_METHOD3( TBool, 
+            HBufC* , aText,
+            TSatIconQualifier &, aIconQualifier,
+            TUint8 &, aRecordNumber )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::GetIconInfoL
+// -----------------------------------------------------------------------------
+//
+void RSatService::GetIconInfoL( 
+        TUint8 aRecordNumber,
+        RIconEf & aIconEf ) const
+    {
+    SMC_MOCK_METHOD2( void, TUint8, aRecordNumber, 
+        RIconEf &, aIconEf )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::GetIconL
+// -----------------------------------------------------------------------------
+//
+CFbsBitmap * RSatService::GetIconL( 
+        const TSatIconInfo & aIconInfo ) const
+    {
+    SMC_MOCK_METHOD1( CFbsBitmap *, const TSatIconInfo &, aIconInfo )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RSatService::SetIdleModeTextResponse
+// -----------------------------------------------------------------------------
+//
+void RSatService::SetIdleModeTextResponse( 
+        const TSATIdleResult & aResult ) const
+    {
+    SMC_MOCK_METHOD1( void, const TSATIdleResult &, aResult )
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingskey.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include "xqsettingskey.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::XQSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQSettingsKey::XQSettingsKey( 
+        XQSettingsKey::Target target,
+        long int uid,
+        unsigned long int key )
+    {
+    Q_UNUSED(target)
+    Q_UNUSED(uid)
+    Q_UNUSED(key)
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::~XQSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQSettingsKey::~XQSettingsKey(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::target
+// -----------------------------------------------------------------------------
+//
+XQSettingsKey::Target XQSettingsKey::target(  ) const
+    {
+    
+    XQSettingsKey::Target variable = (XQSettingsKey::Target)1;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::uid
+// -----------------------------------------------------------------------------
+//
+long int XQSettingsKey::uid(  ) const
+    {
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::key
+// -----------------------------------------------------------------------------
+//
+unsigned long int XQSettingsKey::key(  ) const
+    {
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQPublishAndSubscribeSettingsKey::XQPublishAndSubscribeSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQPublishAndSubscribeSettingsKey::XQPublishAndSubscribeSettingsKey( 
+        long int categoryUid,
+        unsigned long int key ) : 
+        XQSettingsKey( XQSettingsKey::TargetPublishAndSubscribe, categoryUid, key )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQPublishAndSubscribeSettingsKey::~XQPublishAndSubscribeSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQPublishAndSubscribeSettingsKey::~XQPublishAndSubscribeSettingsKey(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQCentralRepositorySettingsKey::XQCentralRepositorySettingsKey
+// -----------------------------------------------------------------------------
+//
+XQCentralRepositorySettingsKey::XQCentralRepositorySettingsKey( 
+        long int repositoryUid,
+        unsigned long int key ) : 
+        XQSettingsKey( XQSettingsKey::TargetCentralRepository, repositoryUid, key )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQCentralRepositorySettingsKey::~XQCentralRepositorySettingsKey
+// -----------------------------------------------------------------------------
+//
+XQCentralRepositorySettingsKey::~XQCentralRepositorySettingsKey(  )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/mocks/mock_xqsettingsmanager.cpp	Fri Jun 04 10:19:18 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "xqsettingsmanager.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::XQSettingsManager
+// -----------------------------------------------------------------------------
+//
+XQSettingsManager::XQSettingsManager( 
+        QObject * parent )
+    : QObject( parent )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::~XQSettingsManager
+// -----------------------------------------------------------------------------
+//
+XQSettingsManager::~XQSettingsManager(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::readItemValue
+// -----------------------------------------------------------------------------
+//
+QVariant XQSettingsManager::readItemValue( 
+        const XQSettingsKey & key,
+        XQSettingsManager::Type type )
+    {
+    SMC_MOCK_METHOD2( QVariant, XQSettingsKey &, key, XQSettingsManager::Type, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::writeItemValue
+// -----------------------------------------------------------------------------
+//
+bool XQSettingsManager::writeItemValue( 
+        const XQSettingsKey & key,
+        const QVariant & value )
+    {
+    SMC_MOCK_METHOD2( bool, XQSettingsKey &, key, QVariant &, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::startMonitoring
+// -----------------------------------------------------------------------------
+//
+bool XQSettingsManager::startMonitoring( 
+        const XQSettingsKey & key,
+        XQSettingsManager::Type type )
+    {
+    SMC_MOCK_METHOD2( bool, XQSettingsKey &, key, XQSettingsManager::Type, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::stopMonitoring
+// -----------------------------------------------------------------------------
+//
+bool XQSettingsManager::stopMonitoring( 
+        const XQSettingsKey & key )
+    {
+    SMC_MOCK_METHOD1( bool, XQSettingsKey &, key )
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::error
+// -----------------------------------------------------------------------------
+//
+XQSettingsManager::Error XQSettingsManager::error(  ) const
+    {
+    SMC_MOCK_METHOD0( XQSettingsManager::Error )
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+     call %PATH_TO_DLL%\%%a.exe
+     move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/inc/ut_infowidget.h	Fri Jun 04 10:19:18 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 UT_INFOWIDGET_H
+#define UT_INFOWIDGET_H
+
+#include <QtTest/QtTest>
+#include <hblabel.h>
+#include <hbstyleoptionlabel.h>
+#include <mockservice.h>
+#include <QColor>
+#include <QGraphicsWidget>
+#include "infowidgetengine.h"
+
+class InfoWidget;
+
+class UT_InfoWidget : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidget();
+    ~UT_InfoWidget();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    //From QGraphicsItem.
+    void t_boundingRect();
+    void t_shape();
+    void t_sizePolicy();
+    
+    void t_setHomeZoneDisplay(); 
+    void t_setMcnDisplay();
+    void t_setActiveLineDisplay();
+    void t_setSatDisplay();
+
+    void t_paint(); 
+    void t_mousePressEvent();
+    void t_mouseReleaseEvent(); 
+    void t_mouseMoveEvent(); 
+    void t_updateInfoDisplay();
+    void t_readPersistentPreferences();
+
+    void t_onInitialize();
+    void t_onUninitialize(); 
+    void t_onShow(); 
+    void t_onHide();
+    void t_readModel();
+    void t_handleModelError();
+    void t_mcnDisplaySettingChanged();
+    void t_satDisplaySettingChanged();
+    void t_settingsEditingFinished();
+
+    // private implementation tests
+    void t_updateItemsVisibility();
+    void t_layoutInfoDisplay(); 
+    void t_layoutSettingsDisplay(); 
+    void t_initializeInfoDisplayItems();
+    void t_initializeSettingsDisplayItems();
+    void t_startChanges();
+    void t_endChanges();
+    
+    void t_sizeHint();
+    
+    /*
+     * Not work from commmand prompt.
+     */
+    void t_changeEvent();
+    
+    
+
+private:
+    
+    InfoWidget *m_infoWidget;
+    InfoWidgetEngine::ModelData m_modelData;
+    QColor m_qcolor;
+    QGraphicsWidget m_qgraphicswidget;
+
+};
+
+#endif // UT_INFOWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidget.exe -- 
+move \epoc32\winscw\c\data\ut_infowidget.log %PATH_TO_RESULT%\ut_infowidget.log
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/src/ut_infowidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,587 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QString>
+#include <QPainter>
+#include <QEvent>
+#include <HbLabel>
+#include <HbStyleOptionLabel>
+#include <HbMarqueeItem>
+#include <HbPushButton>
+#include <HbCheckBox>
+#include <HbEvent>
+#include <HbColorScheme>
+#include <hbframedrawer.h>
+#include "ut_infowidget.h"
+#include "qtestmains60.h"
+
+#define private friend class UT_InfoWidget;private
+#include "infowidget.h"
+
+// mocked dependencies
+#include "infowidgetpreferences.h"
+
+const QString KPreferenceOn("On"); 
+const QString KPreferenceOff("Off"); 
+const QString KMcnName("tnw1: 3233255435"); 
+
+/*!
+  UT_InfoWidget::UT_InfoWidget
+ */
+UT_InfoWidget::UT_InfoWidget() 
+    : m_infoWidget(0)
+{
+    m_modelData.setActiveLine(1);
+    m_modelData.setHomeZoneIndicatorType(1);
+    m_modelData.setMcnName(KMcnName);
+        
+    SmcDefaultValue<const InfoWidgetEngine::ModelData &>::SetL(m_modelData);
+    SmcDefaultValue<QColor>::SetL(m_qcolor);
+    SmcDefaultValue<QGraphicsWidget*>::SetL(&m_qgraphicswidget);
+}
+
+/*!
+  UT_InfoWidget::~UT_InfoWidget
+ */
+UT_InfoWidget::~UT_InfoWidget()
+{
+    delete m_infoWidget;
+}
+
+/*!
+  UT_InfoWidget::init
+ */
+void UT_InfoWidget::init()
+{
+    initialize();
+    
+    SmcDefaultValue<QString>::SetL("On");
+    SmcDefaultValue<InfoWidgetLayoutManager::DisplayRole>::SetL(
+        InfoWidgetLayoutManager::InfoDisplay);
+    m_infoWidget = new InfoWidget();
+    SmcDefaultValue<QString>::SetL("");
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::cleanup
+ */
+void UT_InfoWidget::cleanup()
+{
+    reset();
+    
+    delete m_infoWidget;
+    m_infoWidget = 0;
+}
+
+/*!
+  UT_InfoWidget::t_boundingRect
+ */
+void UT_InfoWidget::t_boundingRect()
+{
+    m_infoWidget->boundingRect();
+}
+
+/*!
+  UT_InfoWidget::t_shape
+ */
+void UT_InfoWidget::t_shape()
+{
+    m_infoWidget->shape();
+}
+
+
+/*!
+  UT_InfoWidget::t_sizePolicy
+ */
+void UT_InfoWidget::t_sizePolicy()
+{
+    QVERIFY(m_infoWidget->sizePolicy() == 
+        QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+}
+
+/*!
+  UT_InfoWidget::t_setHomeZoneDisplay
+ */
+void UT_InfoWidget::t_setHomeZoneDisplay()
+{
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayHomeZone, KPreferenceOn);
+    
+    m_infoWidget->setHomeZoneDisplay(KPreferenceOn); 
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_setMcnDisplay
+ */
+void UT_InfoWidget::t_setMcnDisplay()
+{
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayMcn, KPreferenceOn);
+    
+    m_infoWidget->setMcnDisplay(KPreferenceOn);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_setActiveLineDisplay
+ */
+void UT_InfoWidget::t_setActiveLineDisplay()
+{
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayActiveLine, KPreferenceOn);
+    
+    m_infoWidget->setActiveLineDisplay(KPreferenceOn);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_setSatDisplay
+ */
+void UT_InfoWidget::t_setSatDisplay()
+{
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplaySatText, KPreferenceOn);
+    
+    m_infoWidget->setSatDisplay(KPreferenceOn);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_paint
+ */
+void UT_InfoWidget::t_paint()
+{
+    QScopedPointer<QPainter> painter(new QPainter());
+    QStyleOptionGraphicsItem *option = NULL;
+    QWidget *widget = NULL;
+    
+    m_infoWidget->paint(painter.data(), option, widget);
+    
+    // layout change ongoing while paint requested
+    m_infoWidget->startChanges();
+    m_infoWidget->paint(painter.data(), option, widget);
+}
+
+/*!
+  UT_InfoWidget::t_mousePressEvent
+ */
+void UT_InfoWidget::t_mousePressEvent()
+{
+    QGraphicsSceneMouseEvent event;
+    m_infoWidget->mousePressEvent(&event);
+}
+
+/*!
+  UT_InfoWidget::t_mouseReleaseEvent
+ */
+void UT_InfoWidget::t_mouseReleaseEvent()
+{
+    QGraphicsSceneMouseEvent event;
+    
+    // widget clicked while showing info display => 
+    // switch to settings display expected
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole)
+        .returns(InfoWidgetLayoutManager::InfoDisplay);
+    EXPECT(InfoWidgetLayoutManager::layoutSettingsDisplay);
+    m_infoWidget->mousePressEvent(&event);
+    m_infoWidget->mouseReleaseEvent(&event);
+    
+    // widget clicked while showing settings display => 
+    // no action expected
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole)
+        .returns(InfoWidgetLayoutManager::SettingsDisplay);
+    EXPECT(InfoWidgetLayoutManager::layoutSettingsDisplay).times(0);
+    m_infoWidget->mousePressEvent(&event);
+    m_infoWidget->mouseReleaseEvent(&event);
+    
+    // release event received after dragging widget => 
+    // no action expected
+    EXPECT(InfoWidgetLayoutManager::layoutSettingsDisplay).times(0);
+    m_infoWidget->mouseMoveEvent(&event);
+    m_infoWidget->mouseReleaseEvent(&event);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_mouseMoveEvent
+ */
+void UT_InfoWidget::t_mouseMoveEvent()
+{
+    
+}
+
+/*!
+  UT_InfoWidget::t_updateInfoDisplay
+ */
+void UT_InfoWidget::t_updateInfoDisplay()
+{
+    HbLabel hbLabel;
+    QGraphicsWidget* pointerHbLabel(&hbLabel);
+
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole)
+        .returns(InfoWidgetLayoutManager::InfoDisplay);
+
+    EXPECT(InfoWidgetLayoutManager::getWidget)
+        .with(InfoWidgetLayoutManager::RoleSpnLabel)
+        .returns(pointerHbLabel);
+    
+    HbMarqueeItem mcnMarqueeItem; 
+    QGraphicsWidget* pointerMcnMarqueeItem(&mcnMarqueeItem);
+    EXPECT(InfoWidgetLayoutManager::getWidget)
+        .with(InfoWidgetLayoutManager::RoleMcnMarqueeItem)
+        .returns(pointerMcnMarqueeItem);
+    EXPECT(HbMarqueeItem::isAnimating).returns(true);
+    EXPECT(InfoWidgetLayoutManager::getWidget)
+        .with(InfoWidgetLayoutManager::RoleSatMarqueeItem)
+        .returns(pointerMcnMarqueeItem);
+    
+    m_infoWidget->updateInfoDisplay();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_readPersistentPreferences
+ */
+void UT_InfoWidget::t_readPersistentPreferences()
+{    
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayHomeZone, QString(""));
+
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayMcn, QString(""));
+    
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayActiveLine, QString(""));
+    
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplaySatText, QString(""));
+
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplaySpn, QString(""));
+    
+    EXPECT(InfoWidgetPreferences::validate);
+
+    m_infoWidget->readPersistentPreferences();
+    
+    QVERIFY(verify());
+    
+    // one visible item initially
+    EXPECT(InfoWidgetPreferences::validate).returns(true);
+    EXPECT(InfoWidgetPreferences::storePreferences);
+    
+    m_infoWidget->readPersistentPreferences();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_onInitialize
+ */
+void UT_InfoWidget::t_onInitialize()
+{    
+    // Test onInitialize sequence where 
+    // meta-object properties have been 
+    // initialized 
+    EXPECT(InfoWidgetPreferences::validate)
+        .returns(true);
+    EXPECT(InfoWidgetPreferences::storePreferences)
+        .returns(true);
+    m_infoWidget->onInitialize();
+    
+    // Test onInitialize sequence where 
+    // meta-object properties are 
+    // uninitialized 
+    EXPECT(InfoWidgetPreferences::validate)
+        .returns(false);
+    m_infoWidget->onInitialize();
+}
+
+/*!
+  UT_InfoWidget::t_onUninitialize
+ */
+void UT_InfoWidget::t_onUninitialize()
+{
+    m_infoWidget->onUninitialize(); 
+}
+
+/*!
+  UT_InfoWidget::t_onShow
+ */
+void UT_InfoWidget::t_onShow()
+{
+    m_infoWidget->onShow(); 
+}
+
+/*!
+  UT_InfoWidget::t_onHide
+ */
+void UT_InfoWidget::t_onHide()
+{
+    m_infoWidget->onHide(); 
+}
+
+/*!
+  UT_InfoWidget::t_readModel
+ */
+void UT_InfoWidget::t_readModel()
+{
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole)
+        .returns(InfoWidgetLayoutManager::InfoDisplay);
+    m_infoWidget->readModel();
+    
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole)
+        .returns(InfoWidgetLayoutManager::SettingsDisplay);
+    m_infoWidget->readModel();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidget::t_handleModelError
+ */
+void UT_InfoWidget::t_handleModelError()
+{
+    int operation(0);
+    int errorCode(0); 
+    m_infoWidget->handleModelError(operation, errorCode); 
+}
+
+/*!
+  UT_InfoWidget::t_mcnDisplaySettingChanged
+ */
+void UT_InfoWidget::t_mcnDisplaySettingChanged()
+{
+    // user enables MCN setting
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayMcn, KPreferenceOn);
+    int setting(Qt::Checked);
+    m_infoWidget->mcnDisplaySettingChanged(setting);
+    
+    // user disables MCN setting
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplayMcn, KPreferenceOff);
+    setting = Qt::Unchecked;
+    m_infoWidget->mcnDisplaySettingChanged(setting);
+    
+    QVERIFY(verify());
+}
+
+void UT_InfoWidget::t_satDisplaySettingChanged()
+{
+    // user enables SAT setting
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplaySatText, KPreferenceOn);
+    int setting(Qt::Checked);
+    m_infoWidget->satDisplaySettingChanged(setting);
+    
+    // user disables SAT setting
+    EXPECT(InfoWidgetPreferences::setPreference)
+        .with(InfoWidgetPreferences::DisplaySatText, KPreferenceOff);
+    setting = Qt::Unchecked;
+    m_infoWidget->satDisplaySettingChanged(setting);
+    
+    QVERIFY(verify());
+}
+
+void UT_InfoWidget::t_settingsEditingFinished()
+{
+    m_infoWidget->settingsEditingFinished(); 
+}
+
+void UT_InfoWidget::t_updateItemsVisibility()
+{
+    // All items visible
+    EXPECT(InfoWidgetPreferences::preference)
+        .with(InfoWidgetPreferences::DisplaySpn)
+        .returns(KPreferenceOn);
+    EXPECT(InfoWidgetPreferences::preference)
+        .with(InfoWidgetPreferences::DisplayMcn)
+        .returns(KPreferenceOn);
+    EXPECT(InfoWidgetPreferences::preference)
+        .with(InfoWidgetPreferences::DisplaySatText)
+        .returns(KPreferenceOn);
+    EXPECT(InfoWidgetLayoutManager::setLayoutRows)
+        .with(3);
+    
+    m_infoWidget->updateItemsVisibility();
+    QVERIFY(verify());
+    
+    // none of items visible
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole)
+        .returns(InfoWidgetLayoutManager::InfoDisplay);
+    
+    EXPECT(InfoWidgetPreferences::preference)
+        .with(InfoWidgetPreferences::DisplaySpn)
+        .returns(KPreferenceOff);
+    EXPECT(InfoWidgetLayoutManager::removeWidget)
+        .with(InfoWidgetLayoutManager::RoleSpnLabel);
+    EXPECT(InfoWidgetLayoutManager::removeWidget)
+        .with(InfoWidgetLayoutManager::RoleSpnIcon);
+
+    EXPECT(InfoWidgetPreferences::preference)
+        .with(InfoWidgetPreferences::DisplayMcn)
+        .returns(KPreferenceOff);
+    EXPECT(InfoWidgetLayoutManager::removeWidget)
+        .with(InfoWidgetLayoutManager::RoleMcnMarqueeItem);
+    EXPECT(InfoWidgetLayoutManager::removeWidget)
+        .with(InfoWidgetLayoutManager::RoleMcnIcon);
+    
+    EXPECT(InfoWidgetPreferences::preference)
+        .with(InfoWidgetPreferences::DisplaySatText)
+        .returns(KPreferenceOff);
+    EXPECT(InfoWidgetLayoutManager::removeWidget)
+        .with(InfoWidgetLayoutManager::RoleSatMarqueeItem);
+    EXPECT(InfoWidgetLayoutManager::removeWidget)
+        .with(InfoWidgetLayoutManager::RoleSatTextIcon);
+    
+    EXPECT(InfoWidgetLayoutManager::setLayoutRows)
+        .with(0);
+    
+    m_infoWidget->updateItemsVisibility();
+    
+    QVERIFY(verify());
+}
+
+void UT_InfoWidget::t_layoutInfoDisplay()
+{
+    EXPECT(InfoWidgetLayoutManager::showAll);
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole)
+        .returns(InfoWidgetLayoutManager::SettingsDisplay);
+    
+    m_infoWidget->layoutInfoDisplay();
+    
+    QVERIFY(verify());
+}
+
+void UT_InfoWidget::t_layoutSettingsDisplay()
+{
+    EXPECT(InfoWidgetLayoutManager::showAll); 
+    
+    m_infoWidget->layoutSettingsDisplay();
+    
+    QVERIFY(verify());
+}
+
+void UT_InfoWidget::t_initializeInfoDisplayItems()
+{
+    m_infoWidget->initializeInfoDisplayItems();
+}
+
+void UT_InfoWidget::t_initializeSettingsDisplayItems()
+{
+    QGraphicsWidget okButton;
+    EXPECT(InfoWidgetLayoutManager::getWidget)
+        .with(InfoWidgetLayoutManager::RoleOkButton)
+        .returns(&okButton);
+    
+    QGraphicsWidget mcnCheckBox;
+    EXPECT(InfoWidgetLayoutManager::getWidget)
+        .with(InfoWidgetLayoutManager::RoleMcnCheckBox)
+        .returns(&mcnCheckBox);
+    
+    QGraphicsWidget satTextCheckBox;
+    EXPECT(InfoWidgetLayoutManager::getWidget)
+        .with(InfoWidgetLayoutManager::RoleSatTextCheckBox)
+        .returns(&satTextCheckBox);
+    
+    m_infoWidget->initializeSettingsDisplayItems();
+    
+    QVERIFY(verify());
+}
+
+void UT_InfoWidget::t_startChanges()
+{
+    m_infoWidget->startChanges();
+}
+
+void UT_InfoWidget::t_endChanges()
+{
+    m_infoWidget->endChanges();
+}
+
+/*!
+  UT_InfoWidget::t_changeEvent
+ */
+void UT_InfoWidget::t_changeEvent()
+{
+    /*
+     * Not work from commmand prompt.
+     */
+    HbEvent event(HbEvent::ThemeChanged);
+    EXPECT(HbColorScheme::color);
+    m_infoWidget->changeEvent(&event);
+    QVERIFY(verify());
+    
+    HbEvent event2(HbEvent::ChildFocusIn);
+    m_infoWidget->changeEvent(&event2);
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidget::t_sizeHint
+ */
+void UT_InfoWidget::t_sizeHint()
+{   
+    const QSizeF KMinimumSize(33.5, 160);
+    const QSizeF KPreferredSize(134, 160);
+    const QSizeF KDefaultSizeInfoDisplay(100, 100);
+    const QSizeF KDefaultSizeSettingsDisplay(230, 220);
+
+    // Test: initial size after construction  
+    Qt::SizeHint sizeHint = Qt::PreferredSize;
+    QSizeF constraint = QSizeF();
+    QVERIFY(KDefaultSizeInfoDisplay == m_infoWidget->sizeHint(
+            sizeHint, constraint));
+    
+    // Test: size after onInitialize is called 
+    // and current display is InfoDisplay 
+    m_infoWidget->onInitialize();
+    
+    EXPECT(InfoWidgetLayoutManager::currentDisplayRole).
+            returns(InfoWidgetLayoutManager::InfoDisplay);
+    QGraphicsWidget *contentWidget = new QGraphicsWidget;
+    contentWidget->setMinimumSize(KMinimumSize); 
+    EXPECT(InfoWidgetLayoutManager::contentWidget).
+            returns(contentWidget);
+    EXPECT(InfoWidgetPreferences::visibleItemCount).
+            returns(1);
+    
+    // No strict verification, approximate values.
+    // Data in docml is in "un" format and strict comparison to pixels won't work  
+    //QVERIFY(abs(KMinimumSize.width()-m_infoWidget->sizeHint(sizeHint, constraint).width()) < 1);
+    //QVERIFY(abs(KMinimumSize.height()-m_infoWidget->sizeHint(sizeHint, constraint).height()) < 1);
+    QVERIFY(KDefaultSizeInfoDisplay != m_infoWidget->sizeHint(sizeHint, constraint));
+    
+    // Test: size after onInitialize is called 
+    // and current display is SettingsDisplay 
+
+    delete contentWidget;
+    contentWidget = NULL;
+    
+    QVERIFY(verify());
+}
+
+QTEST_MAIN_S60(UT_InfoWidget)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/ut_infowidget.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH  += . ../../infowidget/src 
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+DEFINES += QT_NO_DEBUG_STREAM
+
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock 	\
+          -lhswidgetmodel
+}
+
+# test code
+HEADERS += ./inc/ut_infowidget.h
+SOURCES += ./src/ut_infowidget.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidget.h
+SOURCES += ../../infowidget/src/infowidget.cpp
+
+# mocks needed for testing
+HEADERS += ../../infowidget/inc/infowidgetpreferences.h
+SOURCES += ../mocks/mock_infowidgetpreferences.cpp
+HEADERS += ../../infowidget/inc/infowidgetengine.h
+SOURCES += ../mocks/mock_infowidgetengine.cpp
+HEADERS += ../../infowidget/inc/infowidgetlayoutmanager.h
+SOURCES += ../mocks/mock_infowidgetlayoutmanager.cpp
+HEADERS += ../../infowidget/inc/infowidgetnetworkhandler.h
+SOURCES += ../mocks/mock_infowidgetnetworkhandler.cpp
+HEADERS += ../../infowidget/inc/infowidgetsathandler.h
+SOURCES += ../mocks/mock_infowidgetsathandler.cpp
+
+SOURCES += ../mocks/mock_hbcolorscheme.cpp
+SOURCES += ../mocks/mock_hblabel.cpp
+SOURCES += ../mocks/mock_hbstyleoptionlabel.cpp
+SOURCES += ../mocks/mock_hbmarqueeitem.cpp
+SOURCES += ../mocks/mock_hbwidget.cpp
+SOURCES += ../mocks/mock_qgraphicslinearlayout.cpp
+SOURCES += ../mocks/mock_qgraphicslayout.cpp
+SOURCES += ../mocks/mock_hbframedrawer.cpp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/inc/ut_infowidgetengine.h	Fri Jun 04 10:19:18 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 UT_INFOWIDGETENGINE_H
+#define UT_INFOWIDGETENGINE_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class InfoWidgetEngine;
+
+class UT_InfoWidgetEngine : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidgetEngine();
+    ~UT_InfoWidgetEngine();
+    
+private slots:
+
+    void init();
+    void cleanup();
+
+    void t_modelData();
+    void t_updateNetworkDataToModel();
+    void t_updateSatDataToModel();
+    void t_updateLineDataToModel();
+    void t_handleNetworkError();
+    void t_handleSatError(); 
+    void t_handleLineError();
+    
+    void t_logModelData();
+    void t_preferenceChanged();
+    void t_suspend();
+    void t_resume();
+    
+private:
+    
+    InfoWidgetEngine *m_infoWidgetEngine;
+
+};
+
+#endif // UT_INFOWIDGETENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetengine.exe -dtextshell --
+move \epoc32\winscw\c\data\ut_infowidgetengine.log %PATH_TO_RESULT%\ut_infowidgetengine.log
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/src/ut_infowidgetengine.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,279 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_infowidgetengine.h"
+#include "infowidgetengine.h"
+#include "qtestmains60.h"
+#include "infowidgetpreferences.h"
+
+// mocked dependencies of the class under test
+#include "infowidgetnetworkhandler.h"
+#include "infowidgetsathandler.h"
+
+const QString KSpnName("Spn name");    // 
+
+const QString KHomeZoneTextTag("HomeZoneText0");    // max length 13
+const TNWViagIndicatorType 
+    KHomeZoneIndicatorType = ENWViagIndicatorTypeHomeZone;
+
+const QString KMcnName("McnNameMcnNameMcnNam");     // max length 20 
+const TNWMCNIndicatorType 
+    KMcnIndicatorType = ENWMCNIndicatorTypeActive;
+
+/*!
+  UT_InfoWidgetEngine::UT_InfoWidgetEngine
+ */
+UT_InfoWidgetEngine::UT_InfoWidgetEngine() 
+    : 
+    m_infoWidgetEngine(0)
+{
+    
+}
+
+/*!
+  UT_InfoWidgetEngine::~UT_InfoWidgetEngine
+ */
+UT_InfoWidgetEngine::~UT_InfoWidgetEngine()
+{
+    delete m_infoWidgetEngine;
+}
+
+/*!
+  UT_InfoWidgetEngine::init
+ */
+void UT_InfoWidgetEngine::init()
+{
+    initialize();
+    
+    SmcDefaultValue<QString>::SetL("");
+    SmcDefaultValue<const QString & >::SetL("");
+    
+    EXPECT(InfoWidgetNetworkHandler::logCurrentInfo);
+    EXPECT(InfoWidgetNetworkHandler::isOnline)
+        .returns(true);    
+    
+    EXPECT(InfoWidgetNetworkHandler::serviceProviderName)
+        .returns(KSpnName);
+    EXPECT(InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired)
+        .returns(true);
+
+    EXPECT(InfoWidgetNetworkHandler::mcnName).returns(KMcnName);
+    EXPECT(InfoWidgetNetworkHandler::mcnIndicatorType)
+        .returns(KMcnIndicatorType);
+
+    EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType)
+        .returns(KHomeZoneIndicatorType);
+    EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag)
+        .returns(KHomeZoneTextTag);
+    
+    m_infoWidgetEngine = new InfoWidgetEngine();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::cleanup
+ */
+void UT_InfoWidgetEngine::cleanup()
+{
+    reset();
+    
+    delete m_infoWidgetEngine;
+    m_infoWidgetEngine = 0;
+}
+
+/*!
+  UT_InfoWidgetEngine::t_modelData
+ */
+void UT_InfoWidgetEngine::t_modelData()
+{
+    const InfoWidgetEngine::ModelData& data = m_infoWidgetEngine->modelData();
+    QVERIFY(data.serviceProviderName() == KSpnName);
+    QVERIFY(data.serviceProviderNameDisplayRequired() == true);
+    QVERIFY(data.homeZoneTextTag() == KHomeZoneTextTag);
+    QVERIFY(data.homeZoneIndicatorType() == KHomeZoneIndicatorType);
+    QVERIFY(data.mcnName() == KMcnName);
+    QVERIFY(data.mcnIndicatorType() == KMcnIndicatorType);
+}
+
+/*!
+  UT_InfoWidgetEngine::t_updateNetworkDataToModel
+ */
+void UT_InfoWidgetEngine::t_updateNetworkDataToModel()
+{
+    // Test: network status is online
+    EXPECT(InfoWidgetNetworkHandler::logCurrentInfo);
+    EXPECT(InfoWidgetNetworkHandler::isOnline)
+        .returns(true);    
+    
+    EXPECT(InfoWidgetNetworkHandler::serviceProviderName)
+        .returns(KSpnName);
+    EXPECT(InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired)
+        .returns(true);
+
+    EXPECT(InfoWidgetNetworkHandler::mcnName).returns(KMcnName);
+    EXPECT(InfoWidgetNetworkHandler::mcnIndicatorType)
+        .returns(KMcnIndicatorType);
+
+    EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType)
+        .returns(KHomeZoneIndicatorType);
+    EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag)
+        .returns(KHomeZoneTextTag);
+    
+    QSignalSpy spy(m_infoWidgetEngine, SIGNAL(modelChanged()));
+    m_infoWidgetEngine->updateNetworkDataToModel();
+    
+    const int KExpectedNumOfSignalEmissions = 1;
+    QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions);
+    const QList<QVariant> &arguments = spy.takeFirst(); 
+    QCOMPARE(arguments.count(), 0);
+    
+    QVERIFY(verify());
+    
+    // Test: network status is offline
+    EXPECT(InfoWidgetNetworkHandler::logCurrentInfo);
+    EXPECT(InfoWidgetNetworkHandler::isOnline)
+          .returns(false);    
+    EXPECT(InfoWidgetNetworkHandler::serviceProviderName).times(0);
+    EXPECT(InfoWidgetNetworkHandler::serviceProviderNameDisplayRequired).times(0);
+    EXPECT(InfoWidgetNetworkHandler::mcnName).times(0);
+    EXPECT(InfoWidgetNetworkHandler::mcnIndicatorType).times(0);
+    EXPECT(InfoWidgetNetworkHandler::homeZoneIndicatorType).times(0);
+    EXPECT(InfoWidgetNetworkHandler::homeZoneTextTag).times(0);
+      
+    m_infoWidgetEngine->updateNetworkDataToModel();
+    QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions);
+    const QList<QVariant> &arguments2 = spy.takeFirst(); 
+    QCOMPARE(arguments2.count(), 0);
+    
+    QVERIFY(verify());
+    
+    const InfoWidgetEngine::ModelData& data = m_infoWidgetEngine->modelData();
+    QVERIFY(data.serviceProviderName() == QString(""));
+    QVERIFY(data.homeZoneTextTag() == QString(""));
+    QVERIFY(data.mcnName() == QString(""));
+    
+}
+
+/*!
+  UT_InfoWidgetEngine::t_updateSatDataToModel
+ */
+void UT_InfoWidgetEngine::t_updateSatDataToModel()
+{
+    EXPECT(InfoWidgetSatHandler::satDisplayText)
+        .returns(QString(""));
+    
+    m_infoWidgetEngine->updateSatDataToModel();
+}
+
+/*!
+  UT_InfoWidgetEngine::t_updateLineDataToModel
+ */
+void UT_InfoWidgetEngine::t_updateLineDataToModel()
+{
+    m_infoWidgetEngine->updateLineDataToModel();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::t_handleNetworkError
+ */
+void UT_InfoWidgetEngine::t_handleNetworkError()
+{
+    m_infoWidgetEngine->handleNetworkError(0, 0);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::t_handleSatError
+ */
+void UT_InfoWidgetEngine::t_handleSatError()
+{
+    m_infoWidgetEngine->handleSatError(0, 0);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::t_handleLineError
+ */
+void UT_InfoWidgetEngine::t_handleLineError()
+{
+    m_infoWidgetEngine->handleLineError(0, 0);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::t_handleLineError
+ */
+void UT_InfoWidgetEngine::t_logModelData()
+{
+    m_infoWidgetEngine->logModelData();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::t_preferenceChanged
+ */
+void UT_InfoWidgetEngine::t_preferenceChanged()
+{
+    m_infoWidgetEngine->preferenceChanged
+        (InfoWidgetPreferences::DisplayMcn,
+            InfoWidgetPreferences::DisplayOn);
+
+    m_infoWidgetEngine->preferenceChanged
+        (InfoWidgetPreferences::DisplayMcn,
+            InfoWidgetPreferences::DisplayOff);
+
+    m_infoWidgetEngine->preferenceChanged
+        (InfoWidgetPreferences::DisplaySatText,
+            InfoWidgetPreferences::DisplayOn);        
+
+    m_infoWidgetEngine->preferenceChanged
+        (InfoWidgetPreferences::DisplaySatText,
+            InfoWidgetPreferences::DisplayOff);        
+
+    m_infoWidgetEngine->preferenceChanged(-1,
+            InfoWidgetPreferences::DisplayOff);        
+
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::t_suspend
+ */
+void UT_InfoWidgetEngine::t_suspend()
+{
+    m_infoWidgetEngine->suspend();
+        
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetEngine::t_resume
+ */
+void UT_InfoWidgetEngine::t_resume()
+{
+    m_infoWidgetEngine->resume();
+        
+    QVERIFY(verify());
+}
+
+QTEST_MAIN_S60(UT_InfoWidgetEngine)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetengine/ut_infowidgetengine.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH  += . ../../infowidget/src ../../infowidget/inc
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+DEFINES += XQSETTINGSMANAGER_NO_LIBRARY
+DEFINES += QT_NO_DEBUG_STREAM
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock 	\
+          -lcpframework
+}
+    
+# test code
+HEADERS += ./inc/ut_infowidgetengine.h
+SOURCES += ./src/ut_infowidgetengine.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidgetengine.h
+SOURCES += ../../infowidget/src/infowidgetengine.cpp
+
+# mocks needed for testing
+HEADERS += ../../infowidget/inc/infowidgetnetworkhandler.h \
+           ../../infowidget/inc/infowidgetsathandler.h
+HEADERS += /epoc32/include/mw/xqsettingskey.h \
+           /epoc32/include/mw/xqsettingsmanager.h
+
+SOURCES += ../mocks/mock_xqsettingsmanager.cpp \
+           ../mocks/mock_xqsettingskey.cpp     \
+           ../mocks/mock_infowidgetnetworkhandler.cpp \
+           ../mocks/mock_infowidgetsathandler.cpp \
+           ../mocks/mock_rsatservice.cpp 
+           
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/inc/ut_infowidgetlayoutmanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef UT_INFOWIDGETLAYOUTMANAGER_H
+#define UT_INFOWIDGETLAYOUTMANAGER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class InfoWidgetLayoutManager;
+class InfoWidgetDocumentLoader;
+
+class UT_InfoWidgetLayoutManager : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:  
+    UT_InfoWidgetLayoutManager();
+    ~UT_InfoWidgetLayoutManager();
+
+private:     
+    void fillDisplayContainers();
+    void fillCurrentWidgetsContainer();
+    void fillParams(const QString & fileName, bool * ok);
+    
+private slots:
+    void init();
+    void cleanup();
+    
+    void t_currentDisplayRole();
+    void t_currentWidgetRoles();
+    
+    void t_layoutRows(); 
+    void t_setLayoutRows();
+    void t_rowHeight();
+    
+    void t_layoutInfoDisplay();
+    void t_layoutSettingsDisplay();
+    
+    void t_widgetRoles();
+    void t_loadWidgets();
+    void t_loadWidget();
+    void t_getWidget();
+    void t_hideWidget();
+
+    void t_contentWidget();
+    
+    void t_showAll();
+    void t_hideAll();
+        
+    void t_reloadWidgets();
+    
+    void t_removeWidget();
+    
+    void t_destroyObjects();
+    
+    // InfoWidgetDocumentLoader tests 
+    void t_createObject();
+    
+private:    
+    InfoWidgetLayoutManager *m_layoutManager;
+    InfoWidgetDocumentLoader *m_documentLoader;
+    
+    QGraphicsWidget *m_checkBoxPtr; 
+    QGraphicsWidget *m_iconPtr;
+    QGraphicsWidget *m_marqueeItemPtr;
+    QGraphicsWidget *m_labelPtr;
+    QGraphicsWidget *m_graphicsWidgetPtr;
+    
+};
+
+#endif // UT_INFOWIDGETLAYOUTMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetlayoutmanager.exe -dtextshell --
+move \epoc32\winscw\c\data\ut_infowidgetlayoutmanager.log %PATH_TO_RESULT%\ut_infowidgetlayoutmanager.log
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/src/ut_infowidgetlayoutmanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,475 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_infowidgetlayoutmanager.h"
+#include <QGraphicsWidget>
+#include <hbmarqueeitem>
+#include <hbstyle>
+#define private public
+#include "infowidgetlayoutmanager.h"
+#include "qtestmains60.h"
+
+
+
+const int KNumOfSettingsDisplayRoles = 6;
+const int KNumOfInfoDisplayRoles = 7;
+const QString KInfoWidgetDocmlFile = ":/resource/infowidget.docml";
+const QString KMargueeItemClassName = HbMarqueeItem::staticMetaObject.className();
+
+//class HbStyle;
+/*!
+  UT_InfoWidgetLayoutManager::UT_InfoWidgetLayoutManager
+ */
+UT_InfoWidgetLayoutManager::UT_InfoWidgetLayoutManager() 
+    : 
+    m_layoutManager(NULL),
+    m_documentLoader(NULL)
+{
+    m_checkBoxPtr = new QGraphicsWidget;  
+    m_iconPtr = new QGraphicsWidget; 
+    m_marqueeItemPtr = new QGraphicsWidget; 
+    m_labelPtr = new QGraphicsWidget; 
+    m_graphicsWidgetPtr = new QGraphicsWidget;
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::~UT_InfoWidgetLayoutManager
+ */
+UT_InfoWidgetLayoutManager::~UT_InfoWidgetLayoutManager()
+{
+    delete m_layoutManager;
+    delete m_checkBoxPtr;  
+    delete m_iconPtr; 
+    delete m_marqueeItemPtr; 
+    delete m_labelPtr; 
+    delete m_graphicsWidgetPtr; 
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::init
+ */
+void UT_InfoWidgetLayoutManager::init()
+{
+    initialize();
+    
+    QObjectList objectList;
+    EXPECT(HbDocumentLoader::load)
+        .with(KInfoWidgetDocmlFile, false)
+        .returns(&objectList);
+    EXPECT(HbDocumentLoader::load)
+        .with(KInfoWidgetDocmlFile, false)
+        .returns(&objectList);
+    m_layoutManager = new InfoWidgetLayoutManager();
+    
+    m_documentLoader = new InfoWidgetDocumentLoader; 
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::cleanup
+ */
+void UT_InfoWidgetLayoutManager::cleanup()
+{
+    reset();
+    
+    delete m_layoutManager;
+    m_layoutManager = NULL; 
+    
+    delete m_documentLoader; 
+    m_documentLoader = NULL; 
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::fillDisplayContainers
+ */
+void UT_InfoWidgetLayoutManager::fillDisplayContainers()
+{
+    InfoWidgetLayoutManager::LayoutItemRole currentRole; 
+    
+    QList<InfoWidgetLayoutManager::LayoutItemRole> infoDisplayWidgetRoles = 
+            m_layoutManager->widgetRoles(InfoWidgetLayoutManager::InfoDisplay); 
+    foreach (currentRole, infoDisplayWidgetRoles) {
+        m_layoutManager->m_infoDisplayWidgets.insert(currentRole, m_graphicsWidgetPtr);    
+    }
+     
+    QList<InfoWidgetLayoutManager::LayoutItemRole> settingsDisplayWidgetRoles = 
+            m_layoutManager->widgetRoles(InfoWidgetLayoutManager::SettingsDisplay); 
+    foreach (currentRole, settingsDisplayWidgetRoles) {
+        m_layoutManager->m_settingsDisplayWidgets.insert(currentRole, m_graphicsWidgetPtr);    
+    }
+
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::fillParams
+ */
+void UT_InfoWidgetLayoutManager::fillParams(const QString & fileName,
+        bool * ok){
+    Q_UNUSED(fileName)
+    *ok = true;
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::fillCurrentWidgetsContainer
+ */
+void UT_InfoWidgetLayoutManager::fillCurrentWidgetsContainer()
+{
+    InfoWidgetLayoutManager::LayoutItemRole currentRole; 
+    
+    QList<InfoWidgetLayoutManager::LayoutItemRole> infoDisplayWidgetRoles = 
+            m_layoutManager->widgetRoles(InfoWidgetLayoutManager::InfoDisplay); 
+    foreach (currentRole, infoDisplayWidgetRoles) {
+        m_layoutManager->m_widgets.insert(currentRole, m_graphicsWidgetPtr);    
+    }
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_currentDisplayRole
+ */
+void UT_InfoWidgetLayoutManager::t_currentDisplayRole()
+{
+    InfoWidgetLayoutManager::DisplayRole role =
+        m_layoutManager->currentDisplayRole();
+    
+    QVERIFY(InfoWidgetLayoutManager::InfoDisplay == role);
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_currentWidgetRoles
+ */
+void UT_InfoWidgetLayoutManager::t_currentWidgetRoles()
+{
+    // Initial state after layout manager construction 
+    QList<InfoWidgetLayoutManager::LayoutItemRole> roles =
+        m_layoutManager->currentWidgetRoles();
+    QVERIFY(roles.count() == 0);
+    
+    // Fill display container data 
+    fillDisplayContainers();
+    
+    QGraphicsLayout *activeLayout;    
+    activeLayout= m_layoutManager->layoutInfoDisplay(); 
+    QVERIFY(!activeLayout);
+    
+    roles = m_layoutManager->currentWidgetRoles();
+            
+    QVERIFY(roles.count() == KNumOfInfoDisplayRoles);
+    if (roles.count() == KNumOfInfoDisplayRoles) {
+        QVERIFY(0 <= roles.indexOf(
+            InfoWidgetLayoutManager::RoleContent));
+        QVERIFY(0 <= roles.indexOf(
+            InfoWidgetLayoutManager::RoleSpnLabel));
+        QVERIFY(0 <= roles.indexOf(
+            InfoWidgetLayoutManager::RoleMcnMarqueeItem));
+        QVERIFY(0 <= roles.indexOf(
+            InfoWidgetLayoutManager::RoleSatMarqueeItem));
+        QVERIFY(0 <= roles.indexOf(
+            InfoWidgetLayoutManager::RoleSpnIcon));
+        QVERIFY(0 <= roles.indexOf(
+            InfoWidgetLayoutManager::RoleMcnIcon));
+        QVERIFY(0 <= roles.indexOf(
+            InfoWidgetLayoutManager::RoleSatTextIcon));
+    }
+    
+    activeLayout= m_layoutManager->layoutSettingsDisplay(); 
+    QVERIFY(!activeLayout);
+
+    roles = m_layoutManager->currentWidgetRoles();
+    int dVar = roles.count();  
+    QVERIFY(roles.count() == KNumOfSettingsDisplayRoles);
+
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_layoutRows
+ */
+void UT_InfoWidgetLayoutManager::t_layoutRows()
+{
+    int rows = m_layoutManager->layoutRows();
+    QVERIFY(0 == rows);
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_setLayoutRows
+ */
+void UT_InfoWidgetLayoutManager::t_setLayoutRows()
+{
+    const int KLayoutRows = 1;
+    m_layoutManager->setLayoutRows(KLayoutRows);
+    QVERIFY(KLayoutRows == m_layoutManager->layoutRows());
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_setLayoutRows
+ */
+void UT_InfoWidgetLayoutManager::t_rowHeight()
+{
+    bool b = false;
+    EXPECT(HbStyle::parameter).returns(b);
+    m_layoutManager->rowHeight();
+    
+    b = true;
+    EXPECT(HbStyle::parameter).returns(b);
+    m_layoutManager->rowHeight();
+    
+    QVERIFY(verify()); 
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_layoutInfoDisplay
+ */
+void UT_InfoWidgetLayoutManager::t_layoutInfoDisplay()
+{
+    QVERIFY(!m_layoutManager->layoutInfoDisplay());
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_layoutSettingsDisplay
+ */
+void UT_InfoWidgetLayoutManager::t_layoutSettingsDisplay()
+{
+    QVERIFY(!m_layoutManager->layoutSettingsDisplay());
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_widgetRoles
+ */
+void UT_InfoWidgetLayoutManager::t_widgetRoles()
+{
+    const QList<InfoWidgetLayoutManager::LayoutItemRole> settingDisplayRoles =
+        m_layoutManager->widgetRoles(InfoWidgetLayoutManager::SettingsDisplay);
+    
+    QVERIFY(settingDisplayRoles.count() == KNumOfSettingsDisplayRoles);
+    if (settingDisplayRoles.count() == KNumOfSettingsDisplayRoles) {
+        QVERIFY(0 <= settingDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleContent));
+        QVERIFY(0 <= settingDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleSpnCheckBox));
+        QVERIFY(0 <= settingDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleMcnCheckBox));
+        QVERIFY(0 <= settingDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleSatTextCheckBox));
+        QVERIFY(0 <= settingDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleOkButton));
+        QVERIFY(0 <= settingDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleSettingsContainer));
+    }
+    
+    const QList<InfoWidgetLayoutManager::LayoutItemRole> infoDisplayRoles =
+        m_layoutManager->widgetRoles(InfoWidgetLayoutManager::InfoDisplay);
+    QVERIFY(infoDisplayRoles.count() == KNumOfInfoDisplayRoles);
+    if (infoDisplayRoles.count() == KNumOfInfoDisplayRoles) {
+        QVERIFY(0 <= infoDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleContent));
+        QVERIFY(0 <= infoDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleSpnLabel));
+        QVERIFY(0 <= infoDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleMcnMarqueeItem));
+        QVERIFY(0 <= infoDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleSatMarqueeItem));
+        QVERIFY(0 <= infoDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleSpnIcon));
+        QVERIFY(0 <= infoDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleMcnIcon));
+        QVERIFY(0 <= infoDisplayRoles.indexOf(
+            InfoWidgetLayoutManager::RoleSatTextIcon));
+    }
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_loadWidgets
+ */
+void UT_InfoWidgetLayoutManager::t_loadWidgets()
+{
+    QObjectList list = QObjectList();
+    EXPECT(HbDocumentLoader::load)
+        .willOnce(invoke(this, &fillParams)).returns(list);
+    
+    const QList<InfoWidgetLayoutManager::LayoutItemRole> settingDisplayRoles =
+            m_layoutManager->widgetRoles(InfoWidgetLayoutManager::SettingsDisplay);
+    bool loadResult = m_layoutManager->loadWidgets(InfoWidgetLayoutManager::SettingsDisplay, 
+            settingDisplayRoles,
+            m_layoutManager->m_infoDisplayWidgets); 
+    
+    QVERIFY(!loadResult);
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_loadWidget
+ */
+void UT_InfoWidgetLayoutManager::t_loadWidget()
+{
+    QGraphicsWidget *currentWidget; 
+    InfoWidgetLayoutManager::LayoutItemRole currentRole; 
+    
+    QList<InfoWidgetLayoutManager::LayoutItemRole> 
+        infoDisplayWidgetRoles = m_layoutManager->widgetRoles(
+                InfoWidgetLayoutManager::InfoDisplay); 
+    
+    infoDisplayWidgetRoles.append(InfoWidgetLayoutManager::RoleUndefined); 
+    infoDisplayWidgetRoles.append(InfoWidgetLayoutManager::RoleContainer);
+    
+
+    foreach (currentRole, infoDisplayWidgetRoles) {
+        currentWidget = m_layoutManager->loadWidget(*m_documentLoader,
+                InfoWidgetLayoutManager::InfoDisplay,
+                currentRole);
+        QVERIFY(!currentWidget);
+    }
+    
+    QList<InfoWidgetLayoutManager::LayoutItemRole> 
+        settingsDisplayWidgetRoles = m_layoutManager->widgetRoles(
+                InfoWidgetLayoutManager::SettingsDisplay); 
+    
+    foreach (currentRole, settingsDisplayWidgetRoles) {
+        currentWidget = m_layoutManager->loadWidget(*m_documentLoader,
+                InfoWidgetLayoutManager::SettingsDisplay,
+                currentRole);
+        QVERIFY(!currentWidget);
+    }
+    
+    currentWidget = m_layoutManager->loadWidget(*m_documentLoader,
+                (InfoWidgetLayoutManager::DisplayRole)2,
+                        InfoWidgetLayoutManager::RoleLastEnum );
+    
+    QVERIFY(!currentWidget);
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_getWidget
+ */
+void UT_InfoWidgetLayoutManager::t_getWidget()
+{
+    fillCurrentWidgetsContainer();
+    
+    QVERIFY(!m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleUndefined));
+    QVERIFY(m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleContent));
+    QVERIFY(!m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleLastEnum));
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_removeWidget
+ */
+void UT_InfoWidgetLayoutManager::t_removeWidget()
+{
+    fillCurrentWidgetsContainer();
+        
+    m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleUndefined);
+    m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleContent);
+    m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleLastEnum);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_contentWidget
+ */
+void UT_InfoWidgetLayoutManager::t_contentWidget()
+{
+    fillCurrentWidgetsContainer();
+    
+    QVERIFY(m_layoutManager->contentWidget());
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_hideWidget
+ */
+void UT_InfoWidgetLayoutManager::t_hideWidget()
+{
+    fillCurrentWidgetsContainer();
+    
+    m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleUndefined);
+    m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleContent);
+    m_layoutManager->hideWidget(InfoWidgetLayoutManager::RoleLastEnum);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_hideAll
+ */
+void UT_InfoWidgetLayoutManager::t_hideAll()
+{
+    m_layoutManager->hideAll();
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetLayoutManager::t_showAll
+ */
+void UT_InfoWidgetLayoutManager::t_showAll()
+{
+    fillCurrentWidgetsContainer();//times 2 HbDocumentLoader::load
+    m_layoutManager->showAll();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_reloadWidgets
+ */
+void UT_InfoWidgetLayoutManager::t_reloadWidgets()
+{
+    QVERIFY(!m_layoutManager->reloadWidgets(InfoWidgetLayoutManager::SettingsDisplay));
+    QVERIFY(!m_layoutManager->reloadWidgets((InfoWidgetLayoutManager::DisplayRole)101));
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_destroyObjects
+ */
+void UT_InfoWidgetLayoutManager::t_destroyObjects()
+{
+    m_layoutManager->destroyObjects();
+    
+    QGraphicsWidget *widgetInfo = new QGraphicsWidget();
+    QGraphicsWidget *widgetSettings = new QGraphicsWidget(); 
+    m_layoutManager->m_infoDisplayWidgets.insert(InfoWidgetLayoutManager::RoleContent, widgetInfo);
+    m_layoutManager->m_settingsDisplayWidgets.insert(InfoWidgetLayoutManager::RoleContent, widgetSettings);
+    m_layoutManager->destroyObjects();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetLayoutManager::t_createObject
+ */
+void UT_InfoWidgetLayoutManager::t_createObject()
+{
+    QObject *object = m_documentLoader->createObject(QString(), QString());
+    QVERIFY(!object);
+    object = m_documentLoader->createObject(KMargueeItemClassName, QString());
+    QVERIFY(object);
+    delete object;
+    
+    //For destructor coverage
+    delete m_layoutManager->m_documentLoader;
+    m_layoutManager->m_documentLoader = NULL;
+}
+
+QTEST_MAIN_S60(UT_InfoWidgetLayoutManager)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlayoutmanager/ut_infowidgetlayoutmanager.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+# Contributors:
+# Description: Project file for building unit test component
+CONFIG += qtestlib \
+    hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . \
+    ../../infowidget/src \
+    ../../infowidget/inc
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+DEFINES += XQSETTINGSMANAGER_NO_LIBRARY
+DEFINES += QT_NO_DEBUG_STREAM
+QT -= gui
+QT += testlib
+symbian: { 
+    CONFIG += no_icon
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+
+# test code
+HEADERS += ./inc/ut_infowidgetlayoutmanager.h
+SOURCES += ./src/ut_infowidgetlayoutmanager.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidgetlayoutmanager.h
+SOURCES += ../../infowidget/src/infowidgetlayoutmanager.cpp
+
+# mocks needed for testing
+SOURCES += ../mocks/mock_hbdocumentloader.cpp
+SOURCES += ../mocks/mock_hbmarqueeitem.cpp
+SOURCES += ../mocks/mock_hbstyle.cpp
+#SOURCES += ../mocks/mock_hbwidget.cpp
+RESOURCES = ../../infowidgetprovider.qrc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/inc/ut_infowidgetlinehandler.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef UT_INFOWIDGETLINEHANDLER_H
+#define UT_INFOWIDGETLINEHANDLER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class InfoWidgetLineHandler;
+
+class UT_InfoWidgetLineHandler : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidgetLineHandler();
+    ~UT_InfoWidgetLineHandler();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_logCurrentInfo(); 
+    void t_activeLine(); 
+    void t_setActiveLine();
+    
+private:
+    
+    InfoWidgetLineHandler *m_lineHandler;
+
+};
+
+#endif // UT_INFOWIDGETLINEHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetlinehandler.exe -dtextshell --
+move \epoc32\winscw\c\data\ut_infowidgetlinehandler.log %PATH_TO_RESULT%\ut_infowidgetlinehandler.log
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/src/ut_infowidgetlinehandler.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include "ut_infowidgetlinehandler.h"
+#include "infowidgetlinehandler.h"
+#include "qtestmains60.h"
+
+/*!
+  UT_InfoWidgetLineHandler::UT_InfoWidgetLineHandler
+ */
+UT_InfoWidgetLineHandler::UT_InfoWidgetLineHandler() 
+    : 
+    m_lineHandler(0)
+{
+    
+}
+
+
+/*!
+  UT_InfoWidgetLineHandler::~UT_InfoWidgetLineHandler
+ */
+UT_InfoWidgetLineHandler::~UT_InfoWidgetLineHandler()
+{
+    delete m_lineHandler;
+}
+
+/*!
+  UT_InfoWidgetLineHandler::init
+ */
+void UT_InfoWidgetLineHandler::init()
+{
+    initialize();
+    
+    m_lineHandler =  new InfoWidgetLineHandler();
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetLineHandler::cleanup
+ */
+void UT_InfoWidgetLineHandler::cleanup()
+{
+    reset();
+    
+    delete m_lineHandler;
+    m_lineHandler = 0;
+}
+
+/*!
+  UT_InfoWidgetLineHandler::t_logCurrentInfo
+ */
+void UT_InfoWidgetLineHandler::t_logCurrentInfo()
+{
+    m_lineHandler->logCurrentInfo();
+}
+
+
+/*!
+  UT_InfoWidgetLineHandler::t_activeLine
+ */
+void UT_InfoWidgetLineHandler::t_activeLine()
+{
+    int activeLine = m_lineHandler->activeLine();
+}
+
+
+/*!
+  UT_InfoWidgetLineHandler::t_setActiveLine
+ */
+void UT_InfoWidgetLineHandler::t_setActiveLine()
+{
+    const int KActiveLine = 0;
+    m_lineHandler->setActiveLine(KActiveLine);
+}
+
+QTEST_MAIN_S60(UT_InfoWidgetLineHandler)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetlinehandler/ut_infowidgetlinehandler.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH  += . ../../infowidget/src
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock 	\
+          -lcpframework
+}
+    
+# test code
+HEADERS += ./inc/ut_infowidgetlinehandler.h
+SOURCES += ./src/ut_infowidgetlinehandler.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidgetlinehandler.h
+SOURCES += ../../infowidget/src/infowidgetlinehandler.cpp
+
+# mocks needed for testing
+#SOURCES += ../mocks/mock_networkhandlingproxy.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/inc/ut_infowidgetnetworkhandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 UT_INFOWIDGETNETWORKHANDLER_H
+#define UT_INFOWIDGETNETWORKHANDLER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class MNWMessageObserver;
+class InfoWidgetNetworkHandler;
+class TNWInfo;
+
+class UT_InfoWidgetNetworkHandler : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidgetNetworkHandler();
+    ~UT_InfoWidgetNetworkHandler();
+    
+public slots:
+    void generateException();
+    void doLeaveL();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_homeZoneTextTag();
+    void t_homeZoneIndicatorType();
+    void t_mcnName();
+    void t_mcnIndicatorType();
+    void t_isOnline();
+    void t_networkRegistrationStatus();
+    void t_HandleNetworkMessage();
+    void t_HandleNetworkMessageExceptionWhileEmittingSignal();
+    void t_HandleNetworkError();
+    void t_HandleNetworkErrorExceptionWhileEmittingSignal();
+    void t_resume();
+    void t_suspend();
+    void t_serviceProviderName();
+    void t_serviceProviderNameDisplayRequired();
+    void t_logCurrentInfo();
+    void t_createLeave();
+    
+private:
+    
+    void initializeNetworkInfo(
+        MNWMessageObserver& aMessage, 
+        TNWInfo& aTNWInfo);
+    
+private:
+    
+    InfoWidgetNetworkHandler *m_networkHandler;
+
+};
+
+#endif // UT_INFOWIDGETNETWORKHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetnetworkhandler.exe -dtextshell --
+move \epoc32\winscw\c\data\ut_infowidgetnetworkhandler.log %PATH_TO_RESULT%\ut_infowidgetnetworkhandler.log
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/src/ut_infowidgetnetworkhandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,403 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <networkhandlingproxy.h>
+#include <nwhandlingengine.h>
+#include "qtestmains60.h"
+#include <xqsettingskey.h>
+#include <xqsettingsmanager.h>
+#include "ut_infowidgetnetworkhandler.h"
+#define private public
+#include "infowidgetnetworkhandler.h"
+
+#define EXPECT_EXCEPTION(statements)    \
+{                                       \
+    bool exceptionDetected = false;     \
+    try {                               \
+        statements                      \
+    } catch (...) {                     \
+        exceptionDetected = true;       \
+    }                                   \
+    QVERIFY(true == exceptionDetected); \
+}
+
+const QString KHomeZoneTextTag("HomeZoneText0");    // max length 13
+const TNWViagIndicatorType 
+    KHomeZoneIndicatorType = ENWViagIndicatorTypeHomeZone;
+
+const QString KMcnName("McnNameMcnNameMcnNam");     // max length 20 
+const TNWMCNIndicatorType 
+    KMcnIndicatorType = ENWMCNIndicatorTypeActive;
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::UT_InfoWidgetNetworkHandler
+ */
+UT_InfoWidgetNetworkHandler::UT_InfoWidgetNetworkHandler() 
+    : 
+    m_networkHandler(0)
+{
+    
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::~UT_InfoWidgetNetworkHandler
+ */
+UT_InfoWidgetNetworkHandler::~UT_InfoWidgetNetworkHandler()
+{
+    delete m_networkHandler;
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::doLeaveL
+ */
+void UT_InfoWidgetNetworkHandler::doLeaveL()
+{
+    User::Leave(KErrGeneral);
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::generateException
+ */
+void UT_InfoWidgetNetworkHandler::generateException()
+{
+    throw std::bad_alloc();
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::init
+ */
+void UT_InfoWidgetNetworkHandler::init()
+{
+    initialize();
+    
+    SmcDefaultValue<QString>::SetL("");
+    SmcDefaultValue<const QString & >::SetL("");
+    QVariant i(1);
+    EXPECT(XQSettingsManager::readItemValue).returns(i);
+    EXPECT(CreateL).willOnce(invoke(this, &initializeNetworkInfo));
+    m_networkHandler =  new InfoWidgetNetworkHandler();
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::cleanup
+ */
+void UT_InfoWidgetNetworkHandler::cleanup()
+{
+    reset();
+    
+    QVariant i(1);
+    EXPECT(XQSettingsManager::readItemValue).returns(i);  
+    delete m_networkHandler;
+    m_networkHandler = 0;
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_homeZoneTextTag
+ */
+void UT_InfoWidgetNetworkHandler::t_homeZoneTextTag()
+{
+    QVariant i(1);
+    EXPECT(XQSettingsManager::readItemValue).returns(i);
+    
+    QVERIFY(m_networkHandler->homeZoneTextTag() == KHomeZoneTextTag);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_homeZoneIndicatorType
+ */
+void UT_InfoWidgetNetworkHandler::t_homeZoneIndicatorType()
+{
+    QVERIFY(
+        m_networkHandler->homeZoneIndicatorType() == KHomeZoneIndicatorType);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_mcnName
+ */
+void UT_InfoWidgetNetworkHandler::t_mcnName()
+{
+    QVERIFY(m_networkHandler->mcnName() == KMcnName);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_mcnIndicatorType
+ */
+void UT_InfoWidgetNetworkHandler::t_mcnIndicatorType()
+{
+    QVERIFY(m_networkHandler->mcnIndicatorType() == KMcnIndicatorType);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_isOnline
+ */
+void UT_InfoWidgetNetworkHandler::t_isOnline()
+{
+    m_networkHandler->m_nwInfo.iRegistrationStatus = 
+            static_cast<TNWRegistrationStatus>(ENWRegisteredBusy);
+    QVERIFY(m_networkHandler->isOnline() == true);
+    m_networkHandler->m_nwInfo.iRegistrationStatus = 
+            static_cast<TNWRegistrationStatus>(ENWRegisteredOnHomeNetwork);
+    QVERIFY(m_networkHandler->isOnline() == true);
+    m_networkHandler->m_nwInfo.iRegistrationStatus = 
+            static_cast<TNWRegistrationStatus>(ENWRegisteredRoaming);
+    QVERIFY(m_networkHandler->isOnline() == true);
+    
+    m_networkHandler->m_nwInfo.iRegistrationStatus = 
+            static_cast<TNWRegistrationStatus>(ENWRegistrationUnknown);
+    QVERIFY(m_networkHandler->isOnline() == false);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_networkRegistrationStatus
+ */
+void UT_InfoWidgetNetworkHandler::t_networkRegistrationStatus()
+{
+    m_networkHandler->m_nwInfo.iRegistrationStatus = 
+                static_cast<TNWRegistrationStatus>(ENWRegistrationUnknown);
+    QVERIFY(m_networkHandler->networkRegistrationStatus() == 0);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_HandleNetworkMessage
+ */
+void UT_InfoWidgetNetworkHandler::t_HandleNetworkMessage()
+{
+    QSignalSpy spy(m_networkHandler, SIGNAL(networkDataChanged()));
+    
+    // TODO: investigate, which messages indicate cell info change
+// ACCEPTED MESSAGES    
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageCurrentCellInfoMessage);
+    
+// MESSAGES TO BE FILTERED OUT
+// COMMON NETWORK MESSAGES                      0 - 99
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkInfoChange);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkModeChange);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageProgrammableOperatorInfoChange);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkProviderNameChange);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageServiceProviderNameChange);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageProgrammableOperatorInfoUpdating);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkProviderNameUpdating);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageServiceProviderNameUpdating);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageAllowRefresh);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkSelectionSettingChange);
+// GSM SPECIFIC MESSAGES                        100 - 199
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkCellReselection);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkConnectionFailure);
+//    m_networkHandler->HandleNetworkMessage(
+//        MNWMessageObserver::ENWMessageCurrentCellInfoMessage);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageCurrentHomeZoneMessage);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkIndicatorChange);
+// CDMA SPECIFIC MESSAGES                       200 - 299
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageNetworkEmergencyMode); 
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageVoicePrivacyStatusChange);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageStartSystemSearchRequestCompleteOk);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageStartSystemSearchRequestCompleteFail);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteOk);
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageStopProtocolStackRequestCompleteFail);
+    
+    const int KExpectedNumOfSignalEmissions = 3;
+    QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions);
+    
+    const QList<QVariant> &arguments = spy.at(0);
+    QCOMPARE(arguments.count(), 0);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_HandleNetworkMessageExceptionWhileEmittingSignal
+ */
+void UT_InfoWidgetNetworkHandler::t_HandleNetworkMessageExceptionWhileEmittingSignal()
+{
+    QObject::connect(
+        m_networkHandler, SIGNAL(networkDataChanged()),
+        this, SLOT(generateException())); 
+    
+    m_networkHandler->HandleNetworkMessage(
+        MNWMessageObserver::ENWMessageCurrentCellInfoMessage);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_HandleNetworkError
+ */
+Q_DECLARE_METATYPE(MNWMessageObserver::TNWOperation)
+void UT_InfoWidgetNetworkHandler::t_HandleNetworkError()
+{
+    QSignalSpy spy(m_networkHandler, SIGNAL(networkError(int, int)));
+    qRegisterMetaType<MNWMessageObserver::TNWOperation>
+        ("MNWMessageObserver::TNWOperation");
+    
+    const int errorCode = -4;
+    MNWMessageObserver::TNWOperation operation = 
+            MNWMessageObserver::ENWGetServiceProviderName;
+    m_networkHandler->HandleNetworkError(operation, errorCode);
+        
+    operation = MNWMessageObserver::ENWNone;
+    m_networkHandler->HandleNetworkError(operation, errorCode);
+    
+    const int KExpectedNumOfSignalEmissions = 2;
+    QCOMPARE(spy.count(), KExpectedNumOfSignalEmissions);
+    const QList<QVariant> &arguments = spy.at(0);
+    QCOMPARE(arguments.count(), 2);
+    
+    QCOMPARE(
+        qvariant_cast<MNWMessageObserver::TNWOperation>(arguments.at(0)), 
+        operation);
+    QCOMPARE(arguments.at(1).toInt(), errorCode);
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_HandleNetworkErrorExceptionWhileEmittingSignal
+ */
+void UT_InfoWidgetNetworkHandler::t_HandleNetworkErrorExceptionWhileEmittingSignal()
+{
+    QObject::connect(
+        m_networkHandler, SIGNAL(networkError(int, int)),
+        this, SLOT(generateException())); 
+    
+    MNWMessageObserver::TNWOperation operation = MNWMessageObserver::ENWNone;
+    const int errorCode = -4;
+    m_networkHandler->HandleNetworkError(operation, errorCode);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetNetworkHandler::initializeNetworkInfo
+ */
+void UT_InfoWidgetNetworkHandler::initializeNetworkInfo(
+    MNWMessageObserver& /*aObserver*/, TNWInfo& aTNWInfo)
+{
+    aTNWInfo.iViagTextTag.Copy(KHomeZoneTextTag.utf16());
+    aTNWInfo.iViagIndicatorType = KHomeZoneIndicatorType;
+    
+    aTNWInfo.iMCNName.Copy(KMcnName.utf16());
+    aTNWInfo.iMCNIndicatorType = KMcnIndicatorType;
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_suspend
+ */
+void UT_InfoWidgetNetworkHandler::t_suspend()
+{
+    QVariant i(0);
+    EXPECT(XQSettingsManager::readItemValue).returns(i);
+    m_networkHandler->suspend();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_resume
+ */
+void UT_InfoWidgetNetworkHandler::t_resume()
+{
+    QVariant i(0);
+    bool b = true;
+    EXPECT(XQSettingsManager::readItemValue).returns(i);  
+    EXPECT(XQSettingsManager::writeItemValue).returns(b);
+    m_networkHandler->resume();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_serviceProviderName
+ */
+void UT_InfoWidgetNetworkHandler::t_serviceProviderName()
+{
+    QString s = "";
+    QCOMPARE(m_networkHandler->serviceProviderName(), s);
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_serviceProviderNameDisplayRequired
+ */
+void UT_InfoWidgetNetworkHandler::t_serviceProviderNameDisplayRequired()
+{
+    m_networkHandler->m_nwInfo.iServiceProviderNameDisplayReq = 
+                RMobilePhone::KDisplaySPNRequired; 
+    QVERIFY(m_networkHandler->serviceProviderNameDisplayRequired() == true);
+
+    m_networkHandler->m_nwInfo.iServiceProviderNameDisplayReq = 
+            RMobilePhone::KDisplaySPNNotRequired; 
+    QVERIFY(m_networkHandler->serviceProviderNameDisplayRequired() == false);
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_logCurrentInfo
+ */
+void UT_InfoWidgetNetworkHandler::t_logCurrentInfo()
+{
+    m_networkHandler->logCurrentInfo();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetNetworkHandler::t_createLeave
+ */
+void UT_InfoWidgetNetworkHandler::t_createLeave()
+{
+    QVariant i(1);
+    EXPECT(XQSettingsManager::readItemValue).returns(i);
+    EXPECT(CreateL)
+            .willOnce(invokeWithoutArguments(this, &doLeaveL));
+    
+    EXPECT_EXCEPTION(InfoWidgetNetworkHandler * p = new InfoWidgetNetworkHandler(););
+}
+
+QTEST_MAIN_S60(UT_InfoWidgetNetworkHandler)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetnetworkhandler/ut_infowidgetnetworkhandler.pro	Fri Jun 04 10:19:18 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 building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH  += . ../../infowidget/src
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+DEFINES += XQSETTINGSMANAGER_NO_LIBRARY
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock 	\
+          -lcpframework
+}
+    
+# test code
+HEADERS += ./inc/ut_infowidgetnetworkhandler.h
+SOURCES += ./src/ut_infowidgetnetworkhandler.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidgetnetworkhandler.h
+SOURCES += ../../infowidget/src/infowidgetnetworkhandler.cpp
+
+# mocks needed for testing
+SOURCES += ../mocks/mock_networkhandlingproxy.cpp
+
+HEADERS += /epoc32/include/mw/xqsettingskey.h \
+           /epoc32/include/mw/xqsettingsmanager.h
+SOURCES += ../mocks/mock_xqsettingskey.cpp
+SOURCES += ../mocks/mock_xqsettingsmanager.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/inc/ut_infowidgetpreferences.h	Fri Jun 04 10:19:18 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 UT_INFOWIDGETPREFERENCES_H
+#define UT_INFOWIDGETPREFERENCES_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class InfoWidgetPreferences;
+
+class UT_InfoWidgetPreferences : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidgetPreferences();
+    ~UT_InfoWidgetPreferences();
+    
+private slots:
+
+    void init();
+    void cleanup();
+
+    void t_storePreferences();
+    void t_preference();
+    void t_setPreference();
+    void t_visibleItemCount();
+    void t_isPreferenceSet();
+    void t_preferences();
+    void t_preferenceNames();
+    
+private:
+    
+    InfoWidgetPreferences *m_infoWidgetPreferences;
+
+};
+
+#endif // UT_INFOWIDGETPREFERENCES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetpreferences.exe -dtextshell --
+move \epoc32\winscw\c\data\ut_infowidgetpreferences.log %PATH_TO_RESULT%\ut_infowidgetpreferences.log
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/src/ut_infowidgetpreferences.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_infowidgetpreferences.h"
+#define private public
+#include "infowidgetpreferences.h"
+#include "qtestmains60.h"
+
+/*!
+  UT_InfoWidgetPreferences::UT_InfoWidgetPreferences
+ */
+UT_InfoWidgetPreferences::UT_InfoWidgetPreferences() 
+    : 
+    m_infoWidgetPreferences(0)
+{
+    
+}
+
+
+/*!
+  UT_InfoWidgetPreferences::~UT_InfoWidgetPreferences
+ */
+UT_InfoWidgetPreferences::~UT_InfoWidgetPreferences()
+{
+    delete m_infoWidgetPreferences;
+}
+
+
+/*!
+  UT_InfoWidgetPreferences::init
+ */
+void UT_InfoWidgetPreferences::init()
+{
+    initialize();
+    
+    m_infoWidgetPreferences = new InfoWidgetPreferences();
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetPreferences::cleanup
+ */
+void UT_InfoWidgetPreferences::cleanup()
+{
+    reset();
+    
+    delete m_infoWidgetPreferences;
+    m_infoWidgetPreferences = 0;
+}
+
+
+/*!
+  UT_InfoWidgetPreferences::t_storePreferences
+ */
+void UT_InfoWidgetPreferences::t_storePreferences()
+{
+    m_infoWidgetPreferences->storePreferences();
+    
+    m_infoWidgetPreferences->m_options = (InfoWidgetPreferences::Option)1;
+    m_infoWidgetPreferences->m_validatedOptions = (InfoWidgetPreferences::Option)2;
+    m_infoWidgetPreferences->storePreferences();
+            
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetPreferences::t_preference
+ */
+void UT_InfoWidgetPreferences::t_preference()
+{
+    QString preferenceValue = m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplayHomeZone);
+    QVERIFY(DISPLAY_SETTING_OFF == preferenceValue);
+    
+    preferenceValue = m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplayMcn);
+    QVERIFY(DISPLAY_SETTING_OFF == preferenceValue);
+    
+    preferenceValue = m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplayActiveLine);
+    QVERIFY(DISPLAY_SETTING_OFF == preferenceValue);
+    
+    preferenceValue = m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplaySatText);
+    QVERIFY(DISPLAY_SETTING_OFF == preferenceValue);
+}
+
+
+/*!
+  UT_InfoWidgetPreferences::t_setPreference
+ */
+void UT_InfoWidgetPreferences::t_setPreference()
+{
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplayHomeZone, DISPLAY_SETTING_ON);
+    QVERIFY(DISPLAY_SETTING_ON == m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplayHomeZone));
+    
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplayMcn, DISPLAY_SETTING_ON);
+    QVERIFY(DISPLAY_SETTING_ON == m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplayMcn));
+    
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplayActiveLine, DISPLAY_SETTING_ON);
+    QVERIFY(DISPLAY_SETTING_ON == m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplayActiveLine));
+    
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplaySatText, DISPLAY_SETTING_ON);
+    QVERIFY(DISPLAY_SETTING_ON == m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplaySatText));
+    
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplaySatText, DISPLAY_SETTING_OFF);
+    QVERIFY(DISPLAY_SETTING_OFF == m_infoWidgetPreferences->preference(
+        InfoWidgetPreferences::DisplaySatText));
+}
+
+/*!
+  UT_InfoWidgetPreferences::t_visibleItemCount
+ */
+void UT_InfoWidgetPreferences::t_visibleItemCount()
+{
+    int visibleItems = m_infoWidgetPreferences->visibleItemCount();
+    QVERIFY(visibleItems == 0);
+    
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplayHomeZone, DISPLAY_SETTING_ON);
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplayMcn, DISPLAY_SETTING_ON);
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplayActiveLine, DISPLAY_SETTING_ON);
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplaySatText, DISPLAY_SETTING_ON);
+    m_infoWidgetPreferences->setPreference(
+        InfoWidgetPreferences::DisplaySpn, DISPLAY_SETTING_ON);
+    visibleItems = m_infoWidgetPreferences->visibleItemCount();
+    QVERIFY(visibleItems == 5);
+}
+
+/*!
+  UT_InfoWidgetPreferences::t_isPreferenceSet
+ */
+void UT_InfoWidgetPreferences::t_isPreferenceSet()
+{
+    m_infoWidgetPreferences->isPreferenceSet
+        (InfoWidgetPreferences::DisplayHomeZone);
+            
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetPreferences::t_preferences
+ */
+void UT_InfoWidgetPreferences::t_preferences()
+{
+    m_infoWidgetPreferences->preferences();
+                
+    QVERIFY(verify());
+}
+
+/*!
+  UT_InfoWidgetPreferences::t_preferenceNames
+ */
+void UT_InfoWidgetPreferences::t_preferenceNames()
+{
+    m_infoWidgetPreferences->preferenceNames();
+                
+    QVERIFY(verify());
+}
+
+QTEST_MAIN_S60(UT_InfoWidgetPreferences)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetpreferences/ut_infowidgetpreferences.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH  += . ../../infowidget/src ../../infowidget/inc
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+DEFINES += XQSETTINGSMANAGER_NO_LIBRARY
+DEFINES += QT_NO_DEBUG_STREAM
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock 	\
+          -lcpframework
+}
+    
+# test code
+HEADERS += ./inc/ut_infowidgetpreferences.h
+SOURCES += ./src/ut_infowidgetpreferences.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidgetpreferences.h
+SOURCES += ../../infowidget/src/infowidgetpreferences.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/inc/ut_infowidgetprovider.h	Fri Jun 04 10:19:18 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 UT_INFOWIDGETPROVIDER_H
+#define UT_INFOWIDGETPROVIDER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+
+class InfoWidgetProvider;
+
+class UT_InfoWidgetProvider : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidgetProvider();
+    ~UT_InfoWidgetProvider();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    void t_createInstance(); 
+    
+};
+
+#endif // UT_INFOWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,192 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetprovider.exe -dtextshell --
+move \epoc32\winscw\c\data\ut_infowidgetprovider.log %PATH_TO_RESULT%\ut_infowidgetprovider.log
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/src/ut_infowidgetprovider.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include "ut_infowidgetprovider.h"
+#include "infowidgetprovider.h"
+#include "qtestmains60.h"
+
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+#include <QString>
+
+Q_EXTERN_C const char * qt_plugin_query_verification_data();
+Q_EXTERN_C ::QObject *  qt_plugin_instance();
+
+class MyQServiceInterfaceDescriptor : public QServiceInterfaceDescriptor
+{}; 
+
+class MyQServiceContext : public QServiceContext
+{
+public: 
+    virtual void notify( ContextType type, const QVariant& variant){
+    Q_UNUSED(type)
+    Q_UNUSED(variant)
+    };
+}; 
+
+class MyQAbstractSecuritySession : public QAbstractSecuritySession
+{
+public: 
+    virtual bool isAllowed(const QStringList& capabilityList){
+    Q_UNUSED(capabilityList)
+    return true;
+    };
+}; 
+
+QString KValidInfoWidgetInterfaceName("com.nokia.IHomeScreenWidget"); 
+QString KInvalidInfoWidgetInterfaceName("com");
+
+
+/*!
+  UT_InfoWidgetProvider::UT_InfoWidgetProvider
+ */
+UT_InfoWidgetProvider::UT_InfoWidgetProvider() 
+{
+    const char * verificationData = qt_plugin_query_verification_data();
+}
+
+
+/*!
+  UT_InfoWidgetProvider::~UT_InfoWidgetProvider
+ */
+UT_InfoWidgetProvider::~UT_InfoWidgetProvider()
+{
+
+}
+
+
+/*!
+  UT_InfoWidgetProvider::init
+ */
+void UT_InfoWidgetProvider::init()
+{
+    initialize();
+
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetProvider::cleanup
+ */
+void UT_InfoWidgetProvider::cleanup()
+{
+    reset();
+    
+    delete (InfoWidgetProvider*)qt_plugin_instance();
+}
+
+
+void UT_InfoWidgetProvider::t_createInstance()
+    {
+    MyQServiceInterfaceDescriptor myServiceInterfaceDescriptor; 
+    MyQServiceContext myQServiceContext; 
+    MyQAbstractSecuritySession myAbstractSecuritySession; 
+    
+    QObject *instanceValue = NULL;
+    InfoWidgetProvider* p = (InfoWidgetProvider*)qt_plugin_instance();
+    // Test: instance creation with valid interface name
+    expect("QtMobility::QServiceInterfaceDescriptor::interfaceName").returns(KValidInfoWidgetInterfaceName);
+    expect("InfoWidget::InfoWidget"); 
+    instanceValue = p->createInstance(myServiceInterfaceDescriptor,
+                                             &myQServiceContext,
+                                             &myAbstractSecuritySession);
+    Q_ASSERT(instanceValue); 
+    
+    // Test: instance creation with invalid interface name
+    expect("QtMobility::QServiceInterfaceDescriptor::interfaceName").returns(KInvalidInfoWidgetInterfaceName);
+    instanceValue = p->createInstance(myServiceInterfaceDescriptor,
+                                             &myQServiceContext,
+                                             &myAbstractSecuritySession);
+    Q_ASSERT(instanceValue == NULL); 
+
+}
+
+QTEST_MAIN_S60(UT_InfoWidgetProvider)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetprovider/ut_infowidgetprovider.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb mobility
+MOBILITY = serviceframework
+TEMPLATE = app
+TARGET = 
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+DEFINES += QT_NO_DEBUG_STREAM
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock     \
+          -lhswidgetmodel
+}
+
+# test code
+HEADERS += ./inc/ut_infowidgetprovider.h
+SOURCES += ./src/ut_infowidgetprovider.cpp
+
+# code to be tested
+HEADERS += ../../inc/infowidgetprovider.h
+SOURCES += ../../src/infowidgetprovider.cpp
+
+# mocks needed for testing
+HEADERS += ../../infowidget/inc/infowidget.h
+SOURCES += ../mocks/mock_infowidget.cpp
+SOURCES += ../mocks/mock_qserviceplugininterface.cpp
+SOURCES += ../mocks/mock_qserviceinterfacedescriptor.cpp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/inc/ut_infowidgetsathandler.h	Fri Jun 04 10:19:18 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 UT_INFOWIDGETSATHANDLER_H
+#define UT_INFOWIDGETSATHANDLER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class InfoWidgetSatHandler;
+
+class UT_InfoWidgetSatHandler : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidgetSatHandler();
+    ~UT_InfoWidgetSatHandler();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_satDisplayText(); 
+    void t_setSatDisplayText();
+    void t_logCurrentInfo(); 
+    
+    void t_connect();
+    void t_handleIdleModeTxtMessage();
+    void t_handleSatError();
+    
+private:
+    
+    InfoWidgetSatHandler *m_satHandler;
+
+};
+
+#endif // UT_INFOWIDGETSATHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetsathandler.exe -dtextshell --
+
+move \epoc32\winscw\c\data\ut_infowidgetsathandler.log %PATH_TO_RESULT%\ut_infowidgetsathandler.log
+
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/src/ut_infowidgetsathandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_infowidgetsathandler.h"
+#define private public
+#include "infowidgetsathandler.h"
+#include "qtestmains60.h"
+
+/*!
+  UT_InfoWidgetSatHandler::UT_InfoWidgetSatHandler
+ */
+UT_InfoWidgetSatHandler::UT_InfoWidgetSatHandler() 
+    : 
+    m_satHandler(0)
+{
+    
+}
+
+
+/*!
+  UT_InfoWidgetSatHandler::~UT_InfoWidgetSatHandler
+ */
+UT_InfoWidgetSatHandler::~UT_InfoWidgetSatHandler()
+{
+    delete m_satHandler;
+}
+
+/*!
+  UT_InfoWidgetSatHandler::init
+ */
+void UT_InfoWidgetSatHandler::init()
+{
+    initialize();
+    
+    m_satHandler =  new InfoWidgetSatHandler();
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_InfoWidgetSatHandler::cleanup
+ */
+void UT_InfoWidgetSatHandler::cleanup()
+{
+    reset();
+    
+    delete m_satHandler;
+    m_satHandler = 0;
+}
+
+
+/*!
+  UT_InfoWidgetSatHandler::t_satDisplayText
+ */
+void UT_InfoWidgetSatHandler::t_satDisplayText()
+{
+    QString satDisplayText("satDisplayText");
+    m_satHandler->setSatDisplayText(satDisplayText);
+    QVERIFY(satDisplayText == m_satHandler->satDisplayText());
+}
+
+
+/*!
+  UT_InfoWidgetSatHandler::t_setSatDisplayText
+ */
+void UT_InfoWidgetSatHandler::t_setSatDisplayText()
+{
+    QString satDisplayText("satDisplayText");
+    m_satHandler->setSatDisplayText(satDisplayText);
+    
+    QVERIFY(satDisplayText == m_satHandler->satDisplayText());
+}
+
+
+/*!
+  UT_InfoWidgetSatHandler::t_logCurrentInfo
+ */
+void UT_InfoWidgetSatHandler::t_logCurrentInfo()
+{
+    m_satHandler->logCurrentInfo();
+    
+    QVERIFY(verify());
+}
+
+void UT_InfoWidgetSatHandler::t_connect()
+{
+    //}else if (!connect && m_connected){
+    m_satHandler->m_connected = 1;
+    m_satHandler->connect(0);
+    
+        
+    m_satHandler->m_connected = 1;
+    m_satHandler->connect(1);
+    
+    //if(connect && !m_connected){
+    m_satHandler->m_connected = 0;
+    m_satHandler->connect(1);
+    
+    QVERIFY(verify());
+}
+void UT_InfoWidgetSatHandler::t_handleIdleModeTxtMessage()
+{
+    m_satHandler->m_connected = 0;
+    m_satHandler->handleIdleModeTxtMessage(0);
+    m_satHandler->m_connected = 1;
+    m_satHandler->handleIdleModeTxtMessage(0);
+    
+    QVERIFY(verify());
+}
+void UT_InfoWidgetSatHandler::t_handleSatError()
+{
+    m_satHandler->handleSatError(1,1);
+    
+    QVERIFY(verify());
+}
+    
+
+QTEST_MAIN_S60(UT_InfoWidgetSatHandler)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/ut_infowidgetsathandler.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH  += . ../../infowidget/src
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock 	\
+          -lcpframework
+}
+    
+# test code
+HEADERS += ./inc/ut_infowidgetsathandler.h
+SOURCES += ./src/ut_infowidgetsathandler.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidgetsathandler.h
+SOURCES += ../../infowidget/src/infowidgetsathandler.cpp 
+
+# mocks needed for testing
+SOURCES += ../mocks/mock_rsatservice.cpp  \
+           ../mocks/mock_RSatSession.cpp  \
+           ../mocks/mock_infowidgetsathandlerprivate.cpp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/inc/ut_infowidgetsathandlerprivate.h	Fri Jun 04 10:19:18 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 UT_INFOWIDGETSATHANDLERPRIVATE_H
+#define UT_INFOWIDGETSATHANDLERPRIVATE_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+#include <rsatservice.h>
+
+
+class InfoWidgetSatHandlerPrivate;
+class InfoWidgetSatHandler;
+
+class UT_InfoWidgetSatHandlerPrivate : public QObject, public MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_InfoWidgetSatHandlerPrivate();
+    ~UT_InfoWidgetSatHandlerPrivate();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_connect();
+    void t_disconnect();
+    void t_startObserving();
+
+    void t_runL();
+    void t_doCancel();
+    
+private:
+    
+    InfoWidgetSatHandlerPrivate *m_satHandler;
+    InfoWidgetSatHandler* m_iwSatHandler;
+    RSatService m_satService;
+
+};
+
+#endif // UT_INFOWIDGETSATHANDLERPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\infowidget\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set ABLD_CALL= -2comp  sbs.bat -c winscw_udeb --keepgoing
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs -c winscw_udeb clean
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
+) else (
+call %ABLD_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+call %PATH_TO_DLL%\ut_infowidgetsathandlerprivate.exe -dtextshell --
+
+move \epoc32\winscw\c\data\ut_infowidgetsathandlerprivate.log %PATH_TO_RESULT%\ut_infowidgetsathandlerprivate.log
+
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/src/ut_infowidgetsathandlerprivate.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_infowidgetsathandlerprivate.h"
+#define private public
+#include "infowidgetsathandlerprivate.h"
+#include "infowidgetsathandler.h"
+#include "infowidgetlogging.h"
+#include "qtestmains60.h"
+
+void SimulateLeaveL()
+{
+    User::Leave(KErrGeneral);
+}
+
+void FillData( HBufC * aText,
+        RSatService::TSatIconQualifier & aIconQualifier,
+        TUint8 & aRecordNumber)
+{
+    _LIT(KText,"Idle Text");
+    TPtr p(aText->Des());
+    p.Copy(KText);
+    aIconQualifier=RSatService::ESatIconNotSelfExplanatory;
+    aRecordNumber=1;
+}
+
+void FillDataNoIcon( HBufC * aText,
+        RSatService::TSatIconQualifier & aIconQualifier,
+        TUint8 & aRecordNumber)
+{
+    Q_UNUSED(aIconQualifier);
+    Q_UNUSED(aRecordNumber);
+    _LIT(KText,"Idle Text");
+    TPtr p(aText->Des());
+    p.Copy(KText);
+}
+
+void FillDataSelfExplIcon( HBufC * aText,
+        RSatService::TSatIconQualifier & aIconQualifier,
+        TUint8 & aRecordNumber)
+{
+    Q_UNUSED(aText);
+    aIconQualifier=RSatService::ESatIconSelfExplanatory;
+    aRecordNumber=1;
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate ::UT_InfoWidgetSatHandlerPrivate 
+ */
+UT_InfoWidgetSatHandlerPrivate::UT_InfoWidgetSatHandlerPrivate () //:
+{
+    DPRINT << "IN";
+    
+    m_satHandler = 0;
+    m_iwSatHandler = 0;
+    
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate ::~UT_InfoWidgetSatHandlerPrivate 
+ */
+UT_InfoWidgetSatHandlerPrivate::~UT_InfoWidgetSatHandlerPrivate ()
+{
+    DPRINT << "IN";
+    
+    delete m_satHandler;
+    delete m_iwSatHandler;
+    
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate ::init
+ */
+void UT_InfoWidgetSatHandlerPrivate::init()
+{
+    DPRINT << "IN";
+    
+    initialize();
+    m_iwSatHandler = new InfoWidgetSatHandler;
+    m_satHandler =  new InfoWidgetSatHandlerPrivate( m_iwSatHandler, m_satService);
+    
+    QVERIFY(verify());
+
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate ::cleanup
+ */
+void UT_InfoWidgetSatHandlerPrivate::cleanup()
+{
+    DPRINT << "IN";
+    
+    reset();
+    delete m_satHandler;
+    delete m_iwSatHandler;
+
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate::t_connect
+ */
+void UT_InfoWidgetSatHandlerPrivate::t_connect()
+{
+    DPRINT << "IN";
+    
+    expect("RSatSession::ConnectL");
+    expect("RSatService::OpenL");
+    m_satHandler->connect();
+     
+    expect("RSatSession::ConnectL")
+        .willOnce(invokeWithoutArguments(SimulateLeaveL));
+    m_satHandler->connect();
+    
+    expect("RSatService::OpenL")
+        .willOnce(invokeWithoutArguments(SimulateLeaveL));
+    m_satHandler->connect();
+
+    QVERIFY(verify());
+
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate::t_disconnect
+ */
+void UT_InfoWidgetSatHandlerPrivate::t_disconnect()
+{
+    DPRINT << "IN";
+    
+    m_satHandler->disconnect();
+    QVERIFY(verify());
+
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate::t_startObserving
+ */
+void UT_InfoWidgetSatHandlerPrivate::t_startObserving()
+{
+    DPRINT << "IN";
+    
+    int i = KErrGeneral;
+    expect("RSatService::NotifySetupIdleModeTextChange").returns(i);
+    expect("RSatService::GetSetupIdleModeTextL")
+        .willOnce(invoke(FillData));
+    m_satHandler->startObserving();
+    
+    expect("RSatService::NotifySetupIdleModeTextChange").returns(i);
+    expect("RSatService::GetSetupIdleModeTextL")
+        .willOnce(invoke(FillDataNoIcon));
+    m_satHandler->startObserving();
+    
+    expect("RSatService::NotifySetupIdleModeTextChange").returns(i);
+    expect("RSatService::GetSetupIdleModeTextL")
+        .willOnce(invoke(FillDataSelfExplIcon));
+    m_satHandler->startObserving();
+    
+    expect("RSatService::GetSetupIdleModeTextL")
+        .willOnce(invokeWithoutArguments(SimulateLeaveL));
+    m_satHandler->startObserving();
+    
+    QVERIFY(verify());
+
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate::t_runL
+ */
+void UT_InfoWidgetSatHandlerPrivate::t_runL()
+{
+    DPRINT << "IN";
+    
+    int i = 1;
+    expect("RSatService::GetSetupIdleModeTextL")
+          .willOnce(invoke(FillData));
+    expect("RSatService::NotifySetupIdleModeTextChange").returns(i);
+    m_satHandler->RunL();
+    
+    m_satHandler->iStatus = KErrGeneral;
+    expect("RSatService::NotifySetupIdleModeTextChange").returns(i);
+    m_satHandler->RunL();
+        
+    QVERIFY(verify());
+
+    DPRINT << "OUT";
+}
+
+/*!
+  UT_InfoWidgetSatHandlerPrivate::t_doCancel
+ */
+void UT_InfoWidgetSatHandlerPrivate::t_doCancel()
+{    
+    DPRINT << "IN";
+
+    m_satHandler->DoCancel();
+    QVERIFY(verify());
+
+    DPRINT << "OUT";
+}
+
+QTEST_MAIN_S60(UT_InfoWidgetSatHandlerPrivate )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandlerprivate/ut_infowidgetsathandlerprivate.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH  += . ../../infowidget/src
+INCLUDEPATH += .
+INCLUDEPATH += ../common
+INCLUDEPATH += ../../inc/
+INCLUDEPATH += ../../infowidget/inc/
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib 		\
+          -lsymbianmock 	\
+          -lcpframework
+}
+    
+# test code
+HEADERS += ./inc/ut_infowidgetsathandlerprivate.h
+SOURCES += ./src/ut_infowidgetsathandlerprivate.cpp
+
+# code to be tested
+HEADERS += ../../infowidget/inc/infowidgetsathandler.h
+HEADERS += ../../infowidget/inc/infowidgetsathandlerprivate.h 
+
+SOURCES += ../../infowidget/src/infowidgetsathandlerprivate.cpp
+
+# mocks needed for testing
+SOURCES += ../mocks/mock_rsatservice.cpp  \
+           ../mocks/mock_RSatSession.cpp  \
+           ../mocks/mock_infowidgetsathandler.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* 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:  Infowidgetplugin service manager 
+* registration handler
+*
+*/
+
+#include <qservicemanager.h>
+#include <QCoreApplication>
+#include <QFile>
+
+QTM_USE_NAMESPACE
+
+const QString xml = "z:/private/20022F35/import/widgetregistry/20029F28/infowidgetprovider.xml";
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+
+    QServiceManager s;
+
+	if (QFile::exists(xml)) {
+        s.addService(xml);
+	} else {
+		s.removeService("infowidgetprovider");
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetproviderinstaller/infowidgetproviderinstaller.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,34 @@
+#
+# 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: Homescreen Infowidget installer application
+#
+
+TEMPLATE = app
+
+QT = core
+CONFIG += no_icon
+
+CONFIG += mobility
+MOBILITY = serviceframework
+
+SOURCES += infowidgetproviderinstaller.cpp
+
+symbian {    
+    load(data_caging_paths)
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.UID3 = 0x2002EA1E
+    BLD_INF_RULES.prj_exports +=  \
+     "$${LITERAL_HASH}include <platform_paths.hrh>" \
+     "./rom/infowidgetproviderinstaller.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(infowidgetproviderinstaller.iby)" 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/infowidgetplugin/infowidgetproviderinstaller/rom/infowidgetproviderinstaller.iby	Fri Jun 04 10:19:18 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 __INFOWIDGETPROVIDERINSTALLER_IBY__
+#define __INFOWIDGETPROVIDERINSTALLER_IBY__
+
+S60_APP_EXE(infowidgetproviderinstaller)
+
+#endif //__INFOWIDGETPROVIDERINSTALLER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/inc/api_headers.pri	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+PHONEINDICATORPLUGIN_API_HEADERS = \
+    ./inc/phoneindicators.h
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/inc/phoneindicatorinterface.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,54 @@
+/*
+ * 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 PHONEINDICATORINTERFACE_H
+#define PHONEINDICATORINTERFACE_H
+
+#include <QObject>
+#include <QString>
+#include <QVariant>
+#include <hbindicatorinterface.h>
+#include "phoneindicators.h"
+
+class PhoneIndicatorInterface : public HbIndicatorInterface
+{
+public:
+    PhoneIndicatorInterface(const QString &indicatorType,
+                                 int typeIndex,
+                                 Interaction interaction);
+
+    ~PhoneIndicatorInterface();
+
+    bool handleInteraction(InteractionType type);
+    QVariant indicatorData(int role) const;
+
+protected:
+
+    bool handleClientRequest(RequestType type, const QVariant &parameter);
+
+private:
+
+    int m_typeIndex;
+    Interaction m_interaction;
+    QString m_primaryText;
+    QString m_secondaryText;
+    QString m_icon;
+    QString m_icon2;
+    QVariant m_parameter;
+};
+
+#endif // PHONEINDICATORINTERFACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/inc/phoneindicatorplugin.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,46 @@
+/*
+ * 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 PHONEINDICATORPLUGIN_H
+#define PHONEINDICATORPLUGIN_H
+
+#include <hbindicatorplugininterface.h>
+#include <hbindicatorinterface.h>
+
+class PhoneIndicatorPlugin : public QObject, public HbIndicatorPluginInterface
+{
+Q_OBJECT
+Q_INTERFACES(HbIndicatorPluginInterface)
+public:
+    PhoneIndicatorPlugin();
+    ~PhoneIndicatorPlugin();
+
+    QStringList indicatorTypes() const;
+    bool accessAllowed(const QString &indicatorType,
+                       const QVariantMap &securityInfo) const;
+    HbIndicatorInterface* createIndicator(const QString &indicatorType);
+    int error() const;
+private:
+    int typeIndex(const QString &indicatorType) const;
+
+private:
+    Q_DISABLE_COPY(PhoneIndicatorPlugin)
+    int m_error;
+    QStringList m_indicatorTypes;
+};
+
+#endif // PHONEINDICATORPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/inc/phoneindicators.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,62 @@
+/*
+ * 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 PHONEINDICATORS_H
+#define PHONEINDICATORS_H
+
+#include <hbindicatorinterface.h>
+#include <QObject>
+#include <QString>
+
+
+static const char *IndicatorNameTemplate = "PhoneIndicator_%1";
+
+enum Interaction
+{
+    InteractionNone,
+    OpenMissedCallView,
+    SwitchBackToCall,
+    Deactivate
+};
+
+enum PhoneIndicatorTypes
+{
+    PhoneMissedCallIndicator = 0,
+    PhoneActiveCallIndicator
+};
+
+inline QString indicatorName(int indicatorType) {
+    return QString(IndicatorNameTemplate).arg(indicatorType);
+}
+
+struct PhoneIndicatorInfo
+{
+    const char *icon;
+    const char *primaryText;
+    const char *secondaryText;
+    Interaction interaction;
+};
+
+Q_DECLARE_METATYPE(PhoneIndicatorInfo)
+
+static const int PhoneIndicatorCount = 2;
+static const PhoneIndicatorInfo IndicatorInfos[PhoneIndicatorCount] = {
+    {"qtg_mono_info.svg",   "Missed call", "Name/Number", OpenMissedCallView },
+    {"qtg_mono_info.svg",   "Active call", " ", SwitchBackToCall }
+};
+
+#endif // PHONEINDICATORS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pri	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+#
+# 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:
+#
+
+HEADERS += ./inc/*.h
+
+SOURCES += ./src/*.cpp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/phoneindicatorplugin.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+#
+# 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 = lib
+TARGET = phoneindicatorplugin
+CONFIG += plugin hb
+
+DEPENDPATH += ./inc \
+              ./src
+
+INCLUDEPATH += ./inc \
+
+symbian {
+	load(data_caging_paths)
+	include(./inc/api_headers.pri)
+
+    headers.sources = $$PHONEINDICATORPLUGIN_API_HEADERS
+    headers.path = |../../inc
+    for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$headers.path/$$basename(header)"
+    
+    BLD_INF_RULES.prj_exports += \
+    "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "./rom/phoneindicatorplugin.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(phoneindicatorplugin.iby)"
+    
+    LIBS += -lxqservice 
+    
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.UID3 = 0x2002E6B1
+    
+    pluginstub.sources = phoneindicatorplugin.dll
+    pluginstub.path = /resource/plugins/indicators
+    DEPLOYMENT += pluginstub
+
+}else:win32 {
+
+    # Put it to Hb/lib because it is in path
+    DESTDIR = c:/hb/lib
+    DLLDESTDIR = c:/hb/bin
+    INCLUDEPATH += c:/hb/include/hbcore \
+        c:/hb/include/hbwidgets \
+        c:/hb/include/hbtools
+}
+
+OUTPUT_DIR = $$PWD/bin
+SOURCE_DIR = $$PWD/inc
+OBJECTS_DIR = $$OUTPUT_DIR/tmp/$$TARGET
+DESTDIR = $$OUTPUT_DIR
+MOC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/moc
+RCC_DIR = $$OUTPUT_DIR/tmp/$$TARGET/rcc
+UI_DIR = $$OUTPUT_DIR/tmp/$$TARGET/ui
+DEPENDPATH += . $$SOURCE_DIR
+INCLUDEPATH += . $$SOURCE_DIR
+INCLUDEPATH += $$MOC_DIR
+
+include(phoneindicatorplugin.pri)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/rom/phoneindicatorplugin.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* 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 __PHONEINDICATORPLUGIN_IBY__
+#define __PHONEINDICATORPLUGIN_IBY__
+ 
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\UREL\phoneindicatorplugin.dll               SHARED_LIB_DIR\phoneindicatorplugin.dll 
+data=\epoc32\data\z\resource\plugins\indicators\phoneindicatorplugin.qtplugin   \resource\plugins\indicators\phoneindicatorplugin.qtplugin
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/src/phoneindicatorinterface.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,123 @@
+/*
+ * 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 "Phoneindicatorinterface.h"
+#include "phoneindicators.h"
+
+#include <QTime>
+#include <QStringList> 
+#ifdef Q_OS_SYMBIAN
+#include <logsservices.h>
+#include <xqservicerequest.h>
+#include <eikenv.h>
+#include <apgtask.h>
+
+#endif
+
+PhoneIndicatorInterface::PhoneIndicatorInterface(
+                const QString &indicatorType,
+                int typeIndex,
+                Interaction interaction) :
+        HbIndicatorInterface( indicatorType, HbIndicatorInterface::NotificationCategory,
+        (interaction == InteractionNone) ? NoInteraction : InteractionActivated),
+        m_typeIndex(typeIndex),
+        m_interaction(interaction),
+        m_primaryText(IndicatorInfos[typeIndex].primaryText),
+        m_secondaryText(IndicatorInfos[typeIndex].secondaryText),
+        m_icon(IndicatorInfos[typeIndex].icon)
+
+{
+}
+
+PhoneIndicatorInterface::~PhoneIndicatorInterface()
+{
+
+}
+
+bool PhoneIndicatorInterface::handleInteraction(InteractionType type)
+{
+    if (type == InteractionActivated) {
+        switch (m_interaction) {
+            
+        case OpenMissedCallView: {
+#ifdef Q_OS_SYMBIAN
+            XQServiceRequest snd("com.nokia.services.logsservices.starter",
+                                 "start(int,bool)", false);
+            snd << (int)LogsServices::ViewMissed;
+            snd << false;
+            int retValue;
+            snd.send(retValue);
+
+//            LogsServices::start( LogsServices::ViewMissed, false );
+#endif
+            }
+            break;
+        case SwitchBackToCall: {
+#ifdef Q_OS_SYMBIAN
+            RWsSession& wsSession = CEikonEnv::Static()->WsSession();
+            TApaTaskList taskList( wsSession );
+            const TUid KUidPhoneApp = { 0x100058B3 };   // Phone application
+            TApaTask task = taskList.FindApp(KUidPhoneApp);
+            task.BringToForeground();
+#endif
+            }
+            break;
+        case Deactivate:
+            emit deactivate();
+            break;
+        default:
+            return false;
+        }
+        emit dataChanged();
+    }
+    return false;
+}
+
+QVariant PhoneIndicatorInterface::indicatorData(int role) const
+{
+    QVariantMap map = m_parameter.value<QVariantMap>();
+    
+    if (role == PrimaryTextRole) {
+        return map.value( (QVariant(PrimaryTextRole)).toString()).toString();
+    } else if (role == SecondaryTextRole ) {
+        return map.value( (QVariant(SecondaryTextRole)).toString()).toString();
+    } else if (role == MonoDecorationNameRole) {
+        return m_icon;
+    } else if (role == DecorationNameRole) {
+        return map.value( (QVariant(DecorationNameRole)).toString()).toString();
+    }
+    return QVariant();
+}
+
+bool PhoneIndicatorInterface::handleClientRequest(RequestType type, const QVariant &parameter)
+{
+    bool handled(false);
+    switch (type) {
+        
+    case RequestActivate:
+        if (m_parameter != parameter) {
+            m_parameter = parameter;
+            emit dataChanged();
+        }
+        handled =  true;
+        break;
+    default:
+        m_parameter.clear();
+    }
+
+    return handled;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneplugins/phoneindicatorplugin/src/phoneindicatorplugin.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,75 @@
+/*
+ * 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 <QtPlugin>
+#include <QVariant>
+#include <HbInstance>
+
+#include "phoneindicatorplugin.h"
+#include "phoneindicatorinterface.h"
+
+Q_EXPORT_PLUGIN(PhoneIndicatorPlugin)
+PhoneIndicatorPlugin::PhoneIndicatorPlugin(): m_error(0)
+{
+    for (int i = 0; i < PhoneIndicatorCount; ++i) {
+        m_indicatorTypes.append(indicatorName(i));
+    }
+}
+
+PhoneIndicatorPlugin::~PhoneIndicatorPlugin()
+{
+}
+
+QStringList PhoneIndicatorPlugin::indicatorTypes() const
+{
+    return m_indicatorTypes;
+}
+
+bool PhoneIndicatorPlugin::accessAllowed(const QString &indicatorType,
+        const QVariantMap &securityInfo) const
+{
+    Q_UNUSED(indicatorType);
+    Q_UNUSED(securityInfo);
+    return true; // constant for hats =)
+}
+
+int PhoneIndicatorPlugin::typeIndex(const QString &indicatorType) const
+{
+    for (int i = 0; i < m_indicatorTypes.count(); ++i) {
+        if (m_indicatorTypes.at(i) == indicatorType) {
+            return i;
+        }
+    }
+    return -1;
+}
+
+HbIndicatorInterface* PhoneIndicatorPlugin::createIndicator(
+        const QString &indicatorType)
+{
+    HbIndicatorInterface *indicator = 0;
+    int index(typeIndex(indicatorType));
+    if (index >= 0) {
+        indicator = new PhoneIndicatorInterface(
+                indicatorType, index, IndicatorInfos[index].interaction);
+    }
+    return indicator;
+}
+
+int PhoneIndicatorPlugin::error() const
+{
+    return m_error;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/barringplugin.pro	Fri Jun 04 10:19:18 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: 
+#
+
+
+TEMPLATE = lib
+TARGET = cpbarringplugin
+DEPENDPATH += . 
+INCLUDEPATH += . inc
+INCLUDEPATH += ../cptelephonyutils/inc
+CONFIG += hb plugin
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+RCC_DIR = rcc
+
+TRANSLATIONS = telephone_cp.ts
+
+LIBS += -lcpframework \
+        -lpsetwrapper \
+        -lcptelephonyutils
+
+# Input
+HEADERS += inc/cpbarringplugin.h inc/cpbarringplugingroup.h
+SOURCES += src/cpbarringplugin.cpp src/cpbarringplugingroup.cpp
+		   
+
+include(../cpplugincommon.pri)
+
+symbian: {
+    TARGET.UID3 = 0X20029F27
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugin.h	Fri Jun 04 10:19:18 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 CPBARRINGPLUGIN_H
+#define CPBARRINGPLUGIN_H
+
+#include <cpplugininterface.h>
+
+/*!
+    \class CpBarringPlugin 
+    \brief The class CpBarringPlugin implements call barring functionality. 
+ */
+class CpBarringPlugin : public QObject, public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+
+public:
+
+    CpBarringPlugin();
+    
+    ~CpBarringPlugin();
+    
+    /**
+     * From CpPluginInterface
+     * @see CpPluginInterface.
+     */
+    QList<CpSettingFormItemData*> createSettingFormItemData(
+             CpItemDataHelper &itemDataHelper) const;
+};
+
+#endif // CPBARRINGPLUGIN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/inc/cpbarringplugingroup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2009-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 CPBARRINGPLUGINGROUP_H
+#define CPBARRINGPLUGINGROUP_H
+
+#include <QQueue>
+#include <cpsettingformitemdata.h>
+#include <psetcallbarringwrapper.h>
+
+class PSetWrapper;
+class QModelIndex;
+class CpPhoneNotes;
+class QValidator;
+class HbDataFormModel;
+
+    
+/*!
+    \class CpBarringPluginGroup
+    \brief The class CpBarringPluginGroup defines barring items shown on UI. 
+ */
+class CpBarringPluginGroup : public CpSettingFormItemData
+{
+    Q_OBJECT
+    
+public:
+    
+    // Change barring password operation phases
+    enum ChangeBarringPasswordPhase
+    {
+        NonePhase,
+        CurrentPasswordPhase,
+        NewPasswordPhase,
+        VerifyNewPasswordPhase
+    };
+
+    explicit CpBarringPluginGroup(CpItemDataHelper &helper);
+    ~CpBarringPluginGroup();
+
+public slots:
+    
+    void itemShown(const QModelIndex& item);
+    
+private:
+    
+    void setupConnectionsToWrapper();
+    
+    void createBarringItems();
+    CpSettingFormItemData *createBarringItem(
+        const HbDataFormModelItem::DataItemType &itemType,
+        const QString &label,
+        const QString &widgetTextData,
+        const PSetCallBarringWrapper::BarringType &barringType);
+    
+    void processBarringStatusRequestQueue();
+    bool updateDependentBarringProgramStatuses(
+        const CpSettingFormItemData &changedBarringItem);
+    CpSettingFormItemData &barringItemByProgram(
+        const PSetCallBarringWrapper::BarringType &barringProgram);
+    void revertCheckStateOfItem(
+        CpSettingFormItemData *barringItem);
+    void updateCheckStateOfItem(
+        CpSettingFormItemData &barringItem, 
+        const Qt::CheckState &newState);
+    
+private slots:
+
+    void barringStatusRequestCompleted(
+        int result,
+        const QList<unsigned char> & basicServiceGroupIds,
+        PSetCallBarringWrapper::BarringStatus status);
+    
+    void enableBarringRequestCompleted(
+        int result,
+        PSetCallBarringWrapper::BarringType barringType,
+        PSetCallBarringWrapper::BarringStatus barringStatus, 
+        bool plural);
+
+    void disableBarringRequestCompleted(
+        int result,
+        PSetCallBarringWrapper::BarringType barringType,
+        PSetCallBarringWrapper::BarringStatus barringStatus, 
+        bool plural);
+    
+    void barringPasswordChangeRequestCompleted(int result);
+    
+    void changeBarringStateRequested(int checkState);
+    
+    void changeBarringPasswordRequested(bool checked = false);
+    
+    void completeBarringStateChangeRequestHandling(
+            QString barringPassword,
+            bool okPressed);
+    
+    void changeBarringPasswordPhasesHandling(
+            QString barringPassword,
+            bool okPressed);
+    
+private: 
+    
+    CpItemDataHelper &m_helper;
+    QScopedPointer<PSetWrapper> m_pSetWrapper;
+    PSetCallBarringWrapper *m_barringWrapper;
+    CpSettingFormItemData *m_editBarringPasswordItem;
+    QQueue<CpSettingFormItemData *> m_barringRequestQueue;
+    bool m_barringStatusRequestOngoing;
+    int m_activeNoteId;
+    CpPhoneNotes* m_phoneNotes;
+    QValidator *m_barringPasswordValidator;
+    bool m_delayedBarringActivationNote;
+    CpSettingFormItemData* m_clickedBarringItem; // Not own.
+    ChangeBarringPasswordPhase m_changeBarringPasswordPhase;
+    QString m_currentPassword;
+    QString m_newPassword;
+    QString m_newPasswordVerified;
+    QValidator* m_verifyPasswordValidator; // Own.
+    HbDataFormModel* m_model;
+};
+
+#endif // CPBARRINGPLUGINGROUP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugin.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2009-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 <cpsettingformentryitemdataimpl.h>
+#include "cpbarringplugin.h"
+#include "cpbarringplugingroup.h"
+#include "cppluginlogging.h"
+
+/*!
+    Constructor of CpBarringPlugin.
+ */
+CpBarringPlugin::CpBarringPlugin()
+{
+    // Install plugin specific msg handler
+    INSTALL_TRACE_MSG_HANDLER; 
+
+    DPRINT;
+}
+
+/*!
+    Destructor of CpBarringPlugin.
+ */
+CpBarringPlugin::~CpBarringPlugin()
+{
+    DPRINT;
+    
+    // Uninstall plugin specific msg handler
+    UNINSTALL_TRACE_MSG_HANDLER;
+}
+
+/*!
+    CpBarringPlugin::createSettingFormItemData.
+ */
+QList<CpSettingFormItemData*> CpBarringPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+{
+    DPRINT;
+    QList<CpSettingFormItemData*> ret;
+    ret.append(new CpBarringPluginGroup(itemDataHelper));
+    return ret;
+}
+
+Q_EXPORT_PLUGIN2(CpBarringPlugin, CpBarringPlugin);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/src/cpbarringplugingroup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,804 @@
+/*
+ * Copyright (c) 2009-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 <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <HbCheckBox>
+#include <QTimer>
+#include <QValidator>
+#include <cpitemdatahelper.h>
+#include <psetwrapper.h>
+#include <psetcallbarringwrapper.h>
+#include "cpbarringplugingroup.h"
+#include "cpplugincommon.h"
+#include "cpphonenotes.h"
+#include "cppluginlogging.h"
+
+const int KMaxPasswordLength = 4;
+
+Q_DECLARE_METATYPE(PSetCallBarringWrapper::BarringType)
+
+/*!
+  CpBarringPluginGroup::CpBarringPluginGroup.
+ */
+CpBarringPluginGroup::CpBarringPluginGroup(CpItemDataHelper &helper)
+    :
+    CpSettingFormItemData(
+        HbDataFormModelItem::GroupItem, 
+        hbTrId("txt_phone_subhead_call_barring"), 0),
+    m_helper(helper),
+    m_pSetWrapper(0),
+    m_barringWrapper(0),
+    m_editBarringPasswordItem(0),
+    m_barringStatusRequestOngoing(false),
+    m_activeNoteId(0),
+    m_phoneNotes(0),
+    m_barringPasswordValidator(0),
+    m_delayedBarringActivationNote(false),
+    m_clickedBarringItem(NULL),
+    m_changeBarringPasswordPhase(NonePhase),
+    m_verifyPasswordValidator(NULL),
+    m_model(0)
+{
+    DPRINT << ": IN";
+    
+    // Registration needed, because BarringType is used as a custom meta 
+    // information for barring items.
+    qRegisterMetaType<PSetCallBarringWrapper::BarringType>(
+        "PSetCallBarringWrapper::BarringType");
+    
+    m_pSetWrapper.reset(new PSetWrapper(NULL));
+    m_barringWrapper = &m_pSetWrapper->callBarringWrapper(); 
+    setupConnectionsToWrapper();
+    
+    // itemShown signal is used to trigger barring status query process 
+    helper.connectToForm(
+        SIGNAL(itemShown(QModelIndex)), 
+        this, SLOT(itemShown(QModelIndex)));
+    
+    createBarringItems();
+    
+    m_phoneNotes = CpPhoneNotes::instance();
+    
+    QRegExp regExpression("\\d{4}");
+    m_barringPasswordValidator = new QRegExpValidator(regExpression, this);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::~CpBarringPluginGroup.
+ */
+CpBarringPluginGroup::~CpBarringPluginGroup()
+{
+    DPRINT << ": IN";
+    
+    if (m_verifyPasswordValidator) {
+        delete m_verifyPasswordValidator;                    
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::itemShown.
+ */
+void CpBarringPluginGroup::itemShown(const QModelIndex& item)
+{
+    DPRINT << ": IN";
+    
+    CpSettingFormItemData* formItem = 
+        static_cast<CpSettingFormItemData*>(
+            qobject_cast<const HbDataFormModel*>(item.model())->itemFromIndex(item));
+    
+    if (!formItem->property("barringType").isValid()) {
+        // Shown item does not belong to the barring settings group.
+        return;
+        }
+    
+    m_model = const_cast<HbDataFormModel*>(qobject_cast<const HbDataFormModel*>(item.model()));
+        
+    if (formItem == m_editBarringPasswordItem) {
+        return;
+    }
+    
+    if (formItem->isEnabled()) {
+        // Initial status for the barring item is already queried. Do not 
+        // start querying again if user does close/open for the barring group.
+        return;
+    }
+    
+    // start barring status query
+    m_barringRequestQueue.enqueue(formItem);
+    processBarringStatusRequestQueue();
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::setupConnectionsToWrapper.
+ */
+void CpBarringPluginGroup::setupConnectionsToWrapper()
+{
+    DPRINT << ": IN";
+    
+    QObject::connect(
+        m_barringWrapper, 
+        SIGNAL(barringStatusRequestCompleted(
+            int,
+            const QList<unsigned char> &, 
+            PSetCallBarringWrapper::BarringStatus)
+        ),
+        this, 
+        SLOT(barringStatusRequestCompleted(
+            int,
+            const QList<unsigned char> &, 
+            PSetCallBarringWrapper::BarringStatus)
+        )
+    );
+    
+    QObject::connect(
+        m_barringWrapper, 
+        SIGNAL(enableBarringRequestCompleted(
+            int,
+            PSetCallBarringWrapper::BarringType,
+            PSetCallBarringWrapper::BarringStatus,
+            bool)
+        ),
+        this, 
+        SLOT(enableBarringRequestCompleted(
+            int,
+            PSetCallBarringWrapper::BarringType,
+            PSetCallBarringWrapper::BarringStatus,
+            bool)
+        )
+    );
+    
+    QObject::connect(
+        m_barringWrapper, 
+        SIGNAL(disableBarringRequestCompleted(
+            int,
+            PSetCallBarringWrapper::BarringType,
+            PSetCallBarringWrapper::BarringStatus,
+            bool)
+        ),
+        this, 
+        SLOT(disableBarringRequestCompleted(
+            int,
+            PSetCallBarringWrapper::BarringType,
+            PSetCallBarringWrapper::BarringStatus,
+            bool)
+        )
+    );
+    
+    QObject::connect(
+        m_barringWrapper, 
+        SIGNAL(barringPasswordChangeRequestCompleted(int)),
+        this, 
+        SLOT(barringPasswordChangeRequestCompleted(int))
+    );
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::createBarringItems.
+ */
+void CpBarringPluginGroup::createBarringItems()
+{
+    DPRINT << ": IN";
+    
+    createBarringItem(
+        HbDataFormModelItem::CheckBoxItem,
+        QString(""),
+        hbTrId("txt_phone_list_outgoing_calls"),
+        PSetCallBarringWrapper::BarringTypeAllOutgoing);
+    
+    createBarringItem(
+        HbDataFormModelItem::CheckBoxItem,
+        QString(""),
+        hbTrId("txt_phone_list_international_calls"),
+        PSetCallBarringWrapper::BarringTypeOutgoingInternational);
+    
+    createBarringItem(
+        HbDataFormModelItem::CheckBoxItem,
+        QString(""),
+        hbTrId("txt_phone_list_international_calls_except_to_home"),
+        PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry);
+    
+    createBarringItem(
+        HbDataFormModelItem::CheckBoxItem,
+        QString(""),
+        hbTrId("txt_phone_list_incoming_calls"),
+        PSetCallBarringWrapper::BarringTypeAllIncoming);
+    
+    createBarringItem(
+        HbDataFormModelItem::CheckBoxItem,
+        QString(""),
+        hbTrId("txt_phone_list_incoming_call_when_abroad"),
+        PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming);
+    
+    // Dummy BarringTypeAllServices is used to indicate that this item belongs 
+    // to the barring settings group. Information is needed in itemShown().
+    m_editBarringPasswordItem = createBarringItem(
+        HbDataFormModelItem::ToggleValueItem,
+        hbTrId("txt_phone_setlabel_edit_barring_password"),
+        hbTrId("txt_phone_setlabel_edit_barring_password_val_edit"),
+        PSetCallBarringWrapper::BarringTypeAllServices);
+    m_editBarringPasswordItem->setContentWidgetData(
+        QString("additionalText"),
+        hbTrId("txt_phone_setlabel_edit_barring_password_val_edit"));
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::createBarringItem.
+ */
+CpSettingFormItemData *CpBarringPluginGroup::createBarringItem(
+    const HbDataFormModelItem::DataItemType &itemType,
+    const QString &label,
+    const QString &widgetTextData,
+    const PSetCallBarringWrapper::BarringType &barringType)
+{
+    DPRINT << ": IN";
+    
+    QScopedPointer<CpSettingFormItemData> barringItem(
+        new CpSettingFormItemData(itemType, label, this));
+    
+    barringItem->setContentWidgetData("text", QVariant(widgetTextData));
+    barringItem->setEnabled(false);
+    
+    QVariant value;
+    value.setValue(barringType);
+    barringItem->setProperty("barringType", value);
+    
+    appendChild(barringItem.data());
+    DPRINT << ": OUT";
+    return barringItem.take();
+}
+
+
+/*!
+  CpBarringPluginGroup::barringStatusRequestCompleted.
+ */
+void CpBarringPluginGroup::barringStatusRequestCompleted(
+    int result,
+    const QList<unsigned char> &basicServiceGroupIds,
+    PSetCallBarringWrapper::BarringStatus status)
+{
+    DPRINT << ": IN" << ": result:" << result << "status:" << status;
+    Q_UNUSED(result)
+    Q_UNUSED(basicServiceGroupIds)
+    
+    m_barringStatusRequestOngoing = false;
+    
+    if (PSetCallBarringWrapper::BarringErrorNone != result) {
+        // Stop status query process for this time. Statuses are tried to 
+        // query again for uncompleted items when user expands/opens barring 
+        // settings group again.
+        m_phoneNotes->cancelNote(m_activeNoteId);
+        m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result);
+        m_barringRequestQueue.clear();
+        return;
+    }
+    
+    CpSettingFormItemData *itemForCompletedRequest = 
+        m_barringRequestQueue.dequeue();
+    
+    if (!itemForCompletedRequest->isEnabled()) {
+        // After enabling setting item here status query will not be started 
+        // again for the item when user collapses and expands the barring 
+        // settings group again.
+        itemForCompletedRequest->setEnabled(true);
+        // start to observe user initiated state changes
+        m_helper.addConnection(
+            itemForCompletedRequest, SIGNAL(stateChanged(int)),
+            this, SLOT(changeBarringStateRequested(int)));
+    }
+    
+    Qt::CheckState checkState = 
+        (PSetCallBarringWrapper::BarringStatusActive == status) 
+            ? Qt::Checked 
+            : Qt::Unchecked;
+    updateCheckStateOfItem(*itemForCompletedRequest, checkState);
+    
+    if (m_barringRequestQueue.isEmpty()) {
+        m_phoneNotes->cancelNote(m_activeNoteId);
+        if (m_delayedBarringActivationNote) {
+            m_delayedBarringActivationNote = false;
+            m_phoneNotes->showGlobalNote(
+                m_activeNoteId, 
+                hbTrId("txt_phone_info_barring_activated"),
+                HbMessageBox::MessageTypeInformation);
+        }
+        
+        // Password editing is enabled only after all barring statuses are 
+        // queried. Otherwise user may be able to issue two requests 
+        // simultaneously by hiding status query progress note and clicking 
+        // edit password.
+        if (!m_editBarringPasswordItem->isEnabled()) {
+            m_editBarringPasswordItem->setEnabled(true);
+            m_helper.addConnection(
+                m_editBarringPasswordItem, SIGNAL(clicked(bool)),
+                this, SLOT(changeBarringPasswordRequested(bool)));
+        }
+    } else {
+        processBarringStatusRequestQueue();
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::enableBarringRequestCompleted.
+ */
+void CpBarringPluginGroup::enableBarringRequestCompleted(
+    int result,
+    PSetCallBarringWrapper::BarringType barringType,
+    PSetCallBarringWrapper::BarringStatus barringStatus, 
+    bool plural)
+{
+    DPRINT << ": IN: result:" << result << "barringType:" << barringType 
+        << "barringStatus:" << barringStatus << "plural:" << plural;
+    Q_UNUSED(barringType)
+    Q_UNUSED(barringStatus)
+    Q_UNUSED(plural)
+    
+    CpSettingFormItemData *barringItem = m_barringRequestQueue.dequeue();
+    if (PSetCallBarringWrapper::BarringErrorNone == result) {
+        if (updateDependentBarringProgramStatuses(*barringItem)) {
+            // Indicate barring activation completion only when dependent 
+            // barring items are also updated.
+            m_delayedBarringActivationNote = true;
+        } else {
+            m_phoneNotes->cancelNote(m_activeNoteId);
+            m_phoneNotes->showGlobalNote(
+                m_activeNoteId, 
+                hbTrId("txt_phone_info_barring_activated"),
+                HbMessageBox::MessageTypeInformation);
+        }
+    } else {
+        revertCheckStateOfItem(barringItem);
+        
+        m_phoneNotes->cancelNote(m_activeNoteId);
+        m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result);
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::disableBarringRequestCompleted.
+ */
+void CpBarringPluginGroup::disableBarringRequestCompleted(
+    int result,
+    PSetCallBarringWrapper::BarringType barringType,
+    PSetCallBarringWrapper::BarringStatus barringStatus, 
+    bool plural)
+{
+    DPRINT << ": IN: result:" << result << "barringType:" << barringType 
+        << "barringStatus:" << barringStatus << "plural:" << plural;
+    Q_UNUSED(barringType)
+    Q_UNUSED(barringStatus)
+    Q_UNUSED(plural)
+    
+    m_phoneNotes->cancelNote(m_activeNoteId);
+    
+    CpSettingFormItemData *barringItem = m_barringRequestQueue.dequeue();
+    if (PSetCallBarringWrapper::BarringErrorNone == result) {
+        m_phoneNotes->showGlobalNote(
+            m_activeNoteId, 
+            hbTrId("txt_phone_info_barring_deactivated"),
+            HbMessageBox::MessageTypeInformation);
+    } else {
+        revertCheckStateOfItem(barringItem);
+        
+        m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result);
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::barringPasswordChangeRequestCompleted.
+ */
+void CpBarringPluginGroup::barringPasswordChangeRequestCompleted(int result)
+{
+    DPRINT << ": IN: result:" << result;
+    
+    m_phoneNotes->cancelNote(m_activeNoteId);
+    
+    if (PSetCallBarringWrapper::BarringErrorNone == result) {
+        m_phoneNotes->showGlobalNote(
+            m_activeNoteId, 
+            hbTrId("txt_phone_info_password_changed"),
+            HbMessageBox::MessageTypeInformation);
+    } else {
+        m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result);
+    }
+}
+
+
+/*!
+  CpBarringPluginGroup::processBarringStatusRequestQueue.
+ */
+void CpBarringPluginGroup::processBarringStatusRequestQueue()
+{
+    DPRINT << ": IN";
+    
+    if ((m_barringStatusRequestOngoing == false) && 
+        (!m_barringRequestQueue.isEmpty())) {
+        
+        CpSettingFormItemData *item = m_barringRequestQueue.head();
+        PSetCallBarringWrapper::BarringType barringType =
+            qvariant_cast<PSetCallBarringWrapper::BarringType>(
+                item->property("barringType"));
+        m_barringWrapper->barringStatus(ServiceGroupVoice, barringType);
+        
+        m_barringStatusRequestOngoing = true;
+        
+        if (!m_phoneNotes->noteShowing()) {
+            // Launch progress note only once for status update.
+            m_phoneNotes->showGlobalProgressNote(
+                m_activeNoteId, hbTrId("txt_phone_info_requesting"));
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::changeBarringStateRequested.
+ */
+void CpBarringPluginGroup::changeBarringStateRequested(int checkState)
+{
+    DPRINT << ": IN";
+    Q_UNUSED(checkState)
+    // find form item for which user has requested barring status change
+    QObject *signalSender = sender();
+        
+    int numOfChilds = childCount();
+    for (int i = 0; (i < numOfChilds) && (m_clickedBarringItem == NULL); i++) {
+        HbDataFormModelItem* itemCandidate = childAt(i);
+        QModelIndex modelIndex = m_model->indexFromItem(itemCandidate);
+        if (signalSender == m_helper.widgetFromModelIndex(modelIndex)) {
+            m_clickedBarringItem = static_cast<CpSettingFormItemData*>(itemCandidate);
+        }
+    }
+    
+    if (NULL != m_clickedBarringItem) {
+        QString barringPasswordQueryDialogTitle(
+            hbTrId("txt_phone_info_barring_password"));
+        
+        QObject::connect(
+            m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)),
+            this, SLOT(completeBarringStateChangeRequestHandling(QString, bool)));
+        m_phoneNotes->showPasswordQueryDialog(
+            barringPasswordQueryDialogTitle, *m_barringPasswordValidator,
+            KMaxPasswordLength);
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpBarringPluginGroup::completeBarringStateChangeRequestHandling.
+ */
+void CpBarringPluginGroup::completeBarringStateChangeRequestHandling(
+        QString barringPassword,
+        bool okPressed)
+{
+    DPRINT << ": IN";
+    
+	QObject::disconnect(
+        m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)),
+        this, SLOT(completeBarringStateChangeRequestHandling(QString, bool)));
+    if (okPressed) {
+        QVariant checkState = m_clickedBarringItem->contentWidgetData("checkState");
+        if (Qt::Checked == checkState.toInt()) {
+            m_barringWrapper->enableBarring(
+                ServiceGroupVoice,
+                qvariant_cast<PSetCallBarringWrapper::BarringType>(
+                    m_clickedBarringItem->property("barringType")), 
+                barringPassword);
+        } else {
+            m_barringWrapper->disableBarring(
+                ServiceGroupVoice,
+                qvariant_cast<PSetCallBarringWrapper::BarringType>(
+                    m_clickedBarringItem->property("barringType")), 
+                barringPassword);
+        }
+        
+        m_barringRequestQueue.enqueue(m_clickedBarringItem);
+        m_phoneNotes->showGlobalProgressNote(
+            m_activeNoteId, hbTrId("txt_phone_info_requesting"));
+    } else {
+        revertCheckStateOfItem(m_clickedBarringItem);
+    }
+    m_clickedBarringItem = NULL;
+        
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpBarringPluginGroup::changeBarringPasswordRequested.
+ */
+void CpBarringPluginGroup::changeBarringPasswordRequested(bool checked)
+{
+    DPRINT << ": IN";
+    Q_UNUSED(checked)
+    
+    m_changeBarringPasswordPhase = CurrentPasswordPhase;
+    QString currentPasswordQueryDialogTitle(
+        hbTrId("txt_phone_info_current_password"));
+    QObject::connect(
+        m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)),
+        this, SLOT(changeBarringPasswordPhasesHandling(QString, bool)));
+    m_phoneNotes->showPasswordQueryDialog(
+        currentPasswordQueryDialogTitle, 
+        *m_barringPasswordValidator, 
+        KMaxPasswordLength);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpBarringPluginGroup::changeBarringPasswordPhasesHandling.
+ */
+void CpBarringPluginGroup::changeBarringPasswordPhasesHandling(
+        QString barringPassword,
+        bool okPressed)
+{
+    DPRINT << ": IN";
+        
+    if (okPressed) {
+        switch (m_changeBarringPasswordPhase) {
+            case CurrentPasswordPhase: {
+                m_changeBarringPasswordPhase = NewPasswordPhase;
+                m_currentPassword = barringPassword;
+                QString newPasswordQueryDialogTitle(
+                    hbTrId("txt_phone_info_new_password"));
+                m_phoneNotes->showPasswordQueryDialog(
+                    newPasswordQueryDialogTitle, 
+                    *m_barringPasswordValidator,
+                    KMaxPasswordLength);
+                }
+                break; 
+            case NewPasswordPhase: {
+                m_changeBarringPasswordPhase = VerifyNewPasswordPhase;
+                m_newPassword = barringPassword;
+                QString newPasswordVerifyDialogTitle(
+                    hbTrId("txt_phone_info_verify_new_password"));
+                QRegExp regExpression(m_newPassword);
+                if(m_verifyPasswordValidator) {
+                    delete m_verifyPasswordValidator;
+                    m_verifyPasswordValidator = NULL;
+                }
+                m_verifyPasswordValidator = new QRegExpValidator(regExpression, NULL);
+                m_phoneNotes->showPasswordQueryDialog(
+                    newPasswordVerifyDialogTitle, 
+                    *m_verifyPasswordValidator,
+                    KMaxPasswordLength);
+                }
+                break; 
+            case VerifyNewPasswordPhase: {
+                m_changeBarringPasswordPhase = NonePhase;
+                m_newPasswordVerified = barringPassword;
+                m_barringWrapper->changeBarringPassword(
+                    m_currentPassword,
+                    m_newPassword,
+                    m_newPasswordVerified);
+                m_phoneNotes->showGlobalProgressNote(
+                    m_activeNoteId, 
+                    hbTrId("txt_phone_info_requesting"));
+                QObject::disconnect(
+                    m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)),
+                    this, SLOT(changeBarringPasswordPhasesHandling(QString, bool)));
+                }
+                break;
+            default: 
+                DPRINT << "Error: unknown enum value";
+                break; 
+        }
+    }
+    else {
+        QObject::disconnect(
+            m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)),
+            this, SLOT(changeBarringPasswordPhasesHandling(QString, bool)));
+        m_changeBarringPasswordPhase = NonePhase;
+    }
+        
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::updateDependentBarringProgramStatuses.
+  According to the ETSI TS 100 548 v7.0.0 specification only one outgoing 
+  and one incoming barring program can be active at the same time. We must,
+  however, query barring statuses again because some networks do not conform
+  to the standards and allow multiple simultaneous barring programs.
+ */
+bool CpBarringPluginGroup::updateDependentBarringProgramStatuses(
+    const CpSettingFormItemData &changedBarringItem)
+{
+    DPRINT << ": IN";
+    
+    CpSettingFormItemData* barringItem = NULL;
+    PSetCallBarringWrapper::BarringType barringType =
+        qvariant_cast<PSetCallBarringWrapper::BarringType>(
+            changedBarringItem.property("barringType"));
+    QList<CpSettingFormItemData*> itemCandidatesForUpdate;
+    switch (barringType) {
+        case PSetCallBarringWrapper::BarringTypeAllOutgoing:
+        {
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::BarringTypeOutgoingInternational);
+            itemCandidatesForUpdate.append(barringItem);
+            
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::
+                    BarringTypeOutgoingInternationalExceptToHomeCountry);
+            itemCandidatesForUpdate.append(barringItem);
+            break;
+        }
+        case PSetCallBarringWrapper::BarringTypeOutgoingInternational:
+        {
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::BarringTypeAllOutgoing);
+            itemCandidatesForUpdate.append(barringItem);
+
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::
+                    BarringTypeOutgoingInternationalExceptToHomeCountry);
+            itemCandidatesForUpdate.append(barringItem);
+            break;
+        }
+        case PSetCallBarringWrapper::
+            BarringTypeOutgoingInternationalExceptToHomeCountry:
+        {
+            // ETSI TS 100 548 v7.0.0, 1.1.2.2. BOIC barring will be activated 
+            // instead of BOIC-exHC if roamed network does not suport BOIC-exHC
+            // => we must update statuses for all outgoing barring programs. 
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::BarringTypeAllOutgoing);
+            itemCandidatesForUpdate.append(barringItem);
+
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::BarringTypeOutgoingInternational);
+            itemCandidatesForUpdate.append(barringItem);
+            
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::
+                    BarringTypeOutgoingInternationalExceptToHomeCountry);
+            itemCandidatesForUpdate.append(barringItem);
+            break;
+        }
+        case PSetCallBarringWrapper::BarringTypeAllIncoming:
+        {
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming);
+            itemCandidatesForUpdate.append(barringItem);
+            break;
+        }
+        case PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming:
+        {
+            barringItem = &barringItemByProgram(
+                PSetCallBarringWrapper::BarringTypeAllIncoming);
+            itemCandidatesForUpdate.append(barringItem);
+            break;
+        }
+        default:
+            break;
+    }
+    
+    const int numOfItemCandidates = itemCandidatesForUpdate.count();
+    for (int i = 0; i < numOfItemCandidates; i++) {
+        barringItem = itemCandidatesForUpdate[i];
+        Qt::CheckState checkState = static_cast<Qt::CheckState>
+            (barringItem->contentWidgetData("checkState").toInt());
+        if (Qt::Checked == checkState || 
+            PSetCallBarringWrapper::
+                BarringTypeOutgoingInternationalExceptToHomeCountry 
+                    == barringType) {
+            m_barringRequestQueue.enqueue(barringItem);
+        }
+    }
+    
+    processBarringStatusRequestQueue();
+    DPRINT << ": OUT";
+    return (0 < m_barringRequestQueue.count());
+}
+
+
+/*!
+  CpBarringPluginGroup::barringItemByProgram.
+ */
+CpSettingFormItemData &CpBarringPluginGroup::barringItemByProgram(
+    const PSetCallBarringWrapper::BarringType &barringProgram)
+{
+    DPRINT << ": IN";
+    
+    CpSettingFormItemData *item = NULL;
+    int numOfChilds = childCount();
+    for (int childInd = 0; (childInd < numOfChilds) && (!item); childInd++) {
+        CpSettingFormItemData *itemCandidate = 
+            static_cast<CpSettingFormItemData*>(childAt(childInd));
+        PSetCallBarringWrapper::BarringType candidateBarringProgram =
+            qvariant_cast<PSetCallBarringWrapper::BarringType>(
+                itemCandidate->property("barringType"));
+        if (candidateBarringProgram == barringProgram) {
+            item = itemCandidate;
+        }
+    }
+    
+    Q_ASSERT(item);
+    DPRINT << ": OUT";
+    return *item;
+}
+
+
+/*!
+  CpBarringPluginGroup::revertCheckStateOfItem.
+ */
+void CpBarringPluginGroup::revertCheckStateOfItem(
+    CpSettingFormItemData *barringItem)
+{
+    DPRINT << ": IN";
+    
+    Qt::CheckState currentCheckState = static_cast<Qt::CheckState>
+        (barringItem->contentWidgetData("checkState").toInt());
+    Qt::CheckState revertedCheckState = 
+        (currentCheckState == Qt::Checked) ? Qt::Unchecked : Qt::Checked;
+    updateCheckStateOfItem(*barringItem, revertedCheckState);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpBarringPluginGroup::updateCheckStateOfItem.
+ */
+void CpBarringPluginGroup::updateCheckStateOfItem(
+    CpSettingFormItemData &barringItem, const Qt::CheckState &newState)
+{
+    DPRINT << ": IN";
+    
+    m_helper.removeConnection(
+        &barringItem, SIGNAL(stateChanged(int)),
+        this, SLOT(changeBarringStateRequested(int)));
+    
+    barringItem.setContentWidgetData("checkState", QVariant(newState));
+    
+    m_helper.addConnection(
+        &barringItem, SIGNAL(stateChanged(int)),
+        this, SLOT(changeBarringStateRequested(int)));
+    
+    DPRINT << ": OUT";
+}
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs --config winscw_udeb --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+    call %PATH_TO_DLL%\%%a.exe -dtextshell --
+    move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,799 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <HbDataFormModel>
+#include <HbCheckBox>
+#include <psetwrapper.h>
+#include "ut_barringplugingroup.h"
+#include "qtestmains60.h"
+#include "cpitemdatahelper.h"
+#include "cpphonenotes.h"
+#define private friend class UT_CpBarringPluginGroup; private
+#include "cpbarringplugingroup.h"
+
+void setNoteIdentifier(int &noteId, const QString& text)
+{
+    Q_UNUSED(text)
+    
+    noteId = 1;
+}
+
+
+const QString KCurrentPassword = "1234";
+void setCurrentPasswordParams(
+    const QString &title, 
+    const QValidator &validator,
+    int maxPasswordLength,
+    QString &password, 
+    bool &ok)
+{
+    Q_UNUSED(title)
+    Q_UNUSED(validator)
+    Q_UNUSED(maxPasswordLength)
+    
+    password = KCurrentPassword;
+    ok = true;
+}
+
+
+const QString KNewAndVerifiedPassword = "4321";
+void setNewAndVerifiedPasswordParams(
+    const QString &title, 
+    const QValidator &validator,
+    int maxPasswordLength,
+    QString &password, 
+    bool &ok)
+{
+    Q_UNUSED(title)
+    Q_UNUSED(validator)
+    Q_UNUSED(maxPasswordLength)
+    
+    password = KNewAndVerifiedPassword;
+    ok = true;
+}
+
+
+void setPasswordParamsCancel(
+    const QString &title, 
+    const QValidator &validator,
+    int maxPasswordLength,
+    QString &password, 
+    bool &ok)
+{
+    Q_UNUSED(title)
+    Q_UNUSED(validator)
+    Q_UNUSED(maxPasswordLength)
+    Q_UNUSED(password)
+    
+    ok = false;
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::UT_CpBarringPluginGroup
+ */
+UT_CpBarringPluginGroup::UT_CpBarringPluginGroup() 
+    : 
+    m_barringpluginGroup(NULL),
+    m_barringWrapperMock(NULL),
+    m_dataFormModel(NULL)
+{
+
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::~UT_CpBarringPluginGroup
+ */
+UT_CpBarringPluginGroup::~UT_CpBarringPluginGroup()
+{
+    delete m_barringpluginGroup;
+    delete m_barringWrapperMock;
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::init
+ */
+void UT_CpBarringPluginGroup::init()
+{
+    initialize();
+    QT_TRAP_THROWING(SmcDefaultValue<QString>::SetL(QString("")));
+    
+    CPsetContainer &dummyContainer = reinterpret_cast<CPsetContainer &>(*this);
+    m_barringWrapperMock = new PSetCallBarringWrapper(dummyContainer);
+    EXPECT(PSetWrapper::callBarringWrapper).returns(m_barringWrapperMock);
+    
+    CpItemDataHelper itemDataHelper;
+    m_barringpluginGroup = new CpBarringPluginGroup(itemDataHelper);
+    
+    m_dataFormModel = new HbDataFormModel();
+    m_barringpluginGroup->setModel(m_dataFormModel);
+    
+    QVERIFY(verify());
+    
+    connect(
+        this, SIGNAL(simulateCheckStateChange(int)), 
+        m_barringpluginGroup, SLOT(changeBarringStateRequested(int)));
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::cleanup
+ */
+void UT_CpBarringPluginGroup::cleanup()
+{
+    reset();
+    
+    disconnect(
+        this, SIGNAL(simulateCheckStateChange(int)), 
+        m_barringpluginGroup, SLOT(changeBarringStateRequested(int)));
+    
+    delete m_barringpluginGroup;
+    m_barringpluginGroup = NULL;
+    delete m_barringWrapperMock;
+    m_barringWrapperMock = NULL;
+    delete m_dataFormModel;
+    m_dataFormModel = NULL;
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_memleak
+ */
+void UT_CpBarringPluginGroup::t_memleak()
+{
+    
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_itemShownNotBarringItem
+  Tests that itemShown() for other setting group's item is not handled.
+ */
+void UT_CpBarringPluginGroup::t_itemShownNotBarringItem()
+{
+    EXPECT(PSetCallBarringWrapper::barringStatus).times(0);
+    
+    QScopedPointer<CpSettingFormItemData> item(new CpSettingFormItemData(
+        HbDataFormModelItem::CheckBoxItem, hbTrId(""), NULL));
+    m_dataFormModel->appendDataFormItem(item.data(), m_barringpluginGroup);
+    m_barringpluginGroup->itemShown(
+        m_dataFormModel->indexFromItem(item.data()));
+    m_dataFormModel->removeItem(item.take());
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_itemShownBarringStatusRequestOngoing
+  Tests that another progress note is not launched if one is already shown.
+ */
+void UT_CpBarringPluginGroup::t_itemShownBarringStatusRequestOngoing()
+{
+    EXPECT(PSetCallBarringWrapper::barringStatus);
+    EXPECT(CpPhoneNotes::noteShowing).returns(true);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote).times(0);
+    
+    HbDataFormModelItem *item = m_barringpluginGroup->childAt(0);
+    m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item));
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_barringStatusRequestCompletedForUpdateInquiry
+ */
+void UT_CpBarringPluginGroup::t_barringStatusRequestCompletedForUpdateInquiry()
+{
+    // simulate successfull initial status inquiry
+    QList<unsigned char> basicServiceGroupIds;
+    const int errorCode = 0;
+    int numOfChilds = m_barringpluginGroup->childCount();
+    for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) {
+        HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex);
+        m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item));
+        
+        m_barringpluginGroup->barringStatusRequestCompleted(
+            errorCode,
+            basicServiceGroupIds, 
+            PSetCallBarringWrapper::BarringStatusActive);
+    }
+    
+    // simulate barring enable request
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(1);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    emit simulateCheckStateChange(Qt::Checked);
+    
+    // verify that already connected items are not enabled/connected again
+    EXPECT(CpItemDataHelper::removeConnection).times(1);
+    EXPECT(CpItemDataHelper::addConnection).times(1);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        errorCode,
+        basicServiceGroupIds, 
+        PSetCallBarringWrapper::BarringStatusActive);
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_barringStatusRequestCompletedWithAnError
+ */
+void UT_CpBarringPluginGroup::t_barringStatusRequestCompletedWithAnError()
+{
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalErrorNote);
+    EXPECT(CpItemDataHelper::addConnection).times(0);
+    
+    QList<unsigned char> basicServiceGroupIds;
+    const int errorCode = -1;
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        errorCode,
+        basicServiceGroupIds, 
+        PSetCallBarringWrapper::BarringStatusUnavailable);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_getBarringStatuses
+  Tests functions 
+      CpBarringPluginGroup::itemShown, 
+      CpBarringPluginGroup::barringStatusRequestCompleted
+ */
+Q_DECLARE_METATYPE(QModelIndex)
+void UT_CpBarringPluginGroup::t_getBarringStatuses()
+{
+    qRegisterMetaType<QModelIndex>("QModelIndex");
+    
+    EXPECT(PSetCallBarringWrapper::barringStatus)
+        .with(ServiceGroupVoice, 
+            PSetCallBarringWrapper::BarringTypeAllOutgoing);
+    EXPECT(PSetCallBarringWrapper::barringStatus)
+        .with(ServiceGroupVoice, 
+            PSetCallBarringWrapper::BarringTypeOutgoingInternational);
+    EXPECT(PSetCallBarringWrapper::barringStatus)
+        .with(ServiceGroupVoice, 
+            PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry);
+    EXPECT(PSetCallBarringWrapper::barringStatus)
+        .with(ServiceGroupVoice, 
+            PSetCallBarringWrapper::BarringTypeAllIncoming);
+    EXPECT(PSetCallBarringWrapper::barringStatus)
+        .with(ServiceGroupVoice, 
+            PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote)
+        .willOnce(invoke(setNoteIdentifier));
+    EXPECT(CpItemDataHelper::addConnection).times(6);
+    
+    int numOfChilds = m_barringpluginGroup->childCount();
+    for (int childIndex = 0; childIndex < numOfChilds; childIndex++) {
+        HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex);
+        m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item));
+    }
+    
+    connect(
+        m_dataFormModel, 
+        SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
+        this,
+        SLOT(dataChanged(const QModelIndex &, const QModelIndex &)));
+    
+    QSignalSpy spy(
+        m_dataFormModel, 
+        SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+    QList<unsigned char> basicServiceGroupIds;
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusInactive);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusNotProvisioned);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusUnavailable);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusUnknown);
+    QCOMPARE(spy.count(), 11);
+    
+    QVERIFY(verify());
+    
+    // Verify that barring status checking is not started on item show if 
+    // status is already queried.
+    EXPECT(PSetCallBarringWrapper::barringStatus).times(0);
+    HbDataFormModelItem *item = m_barringpluginGroup->childAt(0);
+    item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+    m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item));
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_enableBarringRequestCompleted
+ */
+void UT_CpBarringPluginGroup::t_enableBarringRequestCompleted()
+{
+// request completed succesfully -case
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(1);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    
+    emit simulateCheckStateChange(Qt::Checked);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeAllBarrings,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    
+    QVERIFY(verify());
+    QList<unsigned char> basicServiceGroupIds;
+    
+// request completed with an error -case
+    HbDataFormModelItem *item = m_barringpluginGroup->childAt(0);
+    item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpItemDataHelper::removeConnection);
+    EXPECT(CpItemDataHelper::addConnection);
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalErrorNote);
+    
+    emit simulateCheckStateChange(Qt::Checked);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        -1, 
+        PSetCallBarringWrapper::BarringTypeAllBarrings,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+
+    QVERIFY(verify());
+    
+// request completed successfully and dependent barring setting needs 
+// status inquiry
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    // some other (outgoing) barring is enabled, status inquiery for that
+    // should be done.
+    item = m_barringpluginGroup->childAt(1);
+    item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+    EXPECT(PSetCallBarringWrapper::barringStatus);
+    EXPECT(CpPhoneNotes::cancelNote).times(0);
+    EXPECT(CpPhoneNotes::showGlobalNote).times(0);
+    
+    emit simulateCheckStateChange(Qt::Checked);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeAllBarrings,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    
+    QVERIFY(verify());
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_enableBarringRequestCompletedUnknownBarring
+ */
+void UT_CpBarringPluginGroup::t_enableBarringRequestCompletedUnknownBarring()
+{
+    // something very weird has happened and enable request completes for unknown
+    // barring type.
+    HbDataFormModel *formModel = qobject_cast<HbDataFormModel*>(
+        m_barringpluginGroup->model());
+    HbDataFormModelItem *item = m_barringpluginGroup->childAt(5);
+    QModelIndex modelIndex = formModel->indexFromItem(item);
+    
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    // completion of unknown barring type should not lead to updating
+    EXPECT(PSetCallBarringWrapper::barringStatus).times(0);
+    emit simulateCheckStateChange(Qt::Checked);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeAllBarrings,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_enableBAOCRequestCompletedStatusUpdate
+ */
+void UT_CpBarringPluginGroup::t_enableBAOCRequestCompletedStatusUpdate()
+{
+    int numOfChilds = m_barringpluginGroup->childCount();
+    for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) {
+        HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex);
+        item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+    }
+    
+    QList<unsigned char> basicServiceGroupIds;
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    emit simulateCheckStateChange(Qt::Checked);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, PSetCallBarringWrapper::BarringTypeOutgoingInternational);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeAllOutgoing,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_enableBOICRequestCompletedStatusUpdate
+ */
+void UT_CpBarringPluginGroup::t_enableBOICRequestCompletedStatusUpdate()
+{
+    QModelIndex modelIndex;
+    HbDataFormModel *formModel = qobject_cast<HbDataFormModel*>(
+        m_barringpluginGroup->model());
+    int numOfChilds = m_barringpluginGroup->childCount();
+    for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) {
+        HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex);
+        item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+        if (childIndex == 1) {
+            modelIndex = formModel->indexFromItem(item);
+        }
+    }
+    
+    QList<unsigned char> basicServiceGroupIds;
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    emit simulateCheckStateChange(Qt::Checked);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeAllOutgoing);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeOutgoingInternational,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_enableBOICexHCRequestCompletedStatusUpdate
+ */
+void UT_CpBarringPluginGroup::t_enableBOICexHCRequestCompletedStatusUpdate()
+{
+    QModelIndex modelIndex;
+    HbDataFormModel *formModel = qobject_cast<HbDataFormModel*>(
+        m_barringpluginGroup->model());
+    int numOfChilds = m_barringpluginGroup->childCount();
+    for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) {
+        HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex);
+        item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+        if (childIndex == 2) {
+            modelIndex = formModel->indexFromItem(item);
+        }
+    }
+    
+    QList<unsigned char> basicServiceGroupIds;
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    emit simulateCheckStateChange(Qt::Checked);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeAllOutgoing);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeOutgoingInternational);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_enableBAICRequestCompletedStatusUpdate
+ */
+void UT_CpBarringPluginGroup::t_enableBAICRequestCompletedStatusUpdate()
+{
+    QModelIndex modelIndex;
+    HbDataFormModel *formModel = qobject_cast<HbDataFormModel*>(
+        m_barringpluginGroup->model());
+    int numOfChilds = m_barringpluginGroup->childCount();
+    for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) {
+        HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex);
+        item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+        if (childIndex == 3) {
+            modelIndex = formModel->indexFromItem(item);
+        }
+    }
+    
+    QList<unsigned char> basicServiceGroupIds;
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    emit simulateCheckStateChange(Qt::Checked);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeAllIncoming,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_enableBICRoamRequestCompletedStatusUpdate
+ */
+void UT_CpBarringPluginGroup::t_enableBICRoamRequestCompletedStatusUpdate()
+{
+    QModelIndex modelIndex;
+    HbDataFormModel *formModel = qobject_cast<HbDataFormModel*>(
+        m_barringpluginGroup->model());
+    int numOfChilds = m_barringpluginGroup->childCount();
+    for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) {
+        HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex);
+        item->setContentWidgetData("checkState", QVariant(Qt::Checked));
+        if (childIndex == 4) {
+            modelIndex = formModel->indexFromItem(item);
+        }
+    }
+    
+    QList<unsigned char> basicServiceGroupIds;
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).with(modelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    emit simulateCheckStateChange(Qt::Checked);
+    EXPECT(PSetCallBarringWrapper::barringStatus).with(
+        ServiceGroupVoice, 
+        PSetCallBarringWrapper::BarringTypeAllIncoming);
+    m_barringpluginGroup->enableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    m_barringpluginGroup->barringStatusRequestCompleted(
+        PSetCallBarringWrapper::BarringErrorNone,
+        basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive);
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_disableBarringRequestCompleted
+ */
+void UT_CpBarringPluginGroup::t_disableBarringRequestCompleted()
+{
+// request completed succesfully -case
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this).times(1);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    emit simulateCheckStateChange(Qt::Unchecked);
+    
+    m_barringpluginGroup->disableBarringRequestCompleted(
+        0, 
+        PSetCallBarringWrapper::BarringTypeAllBarrings,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    
+    QVERIFY(verify());
+    
+// request completed with an error -case
+    HbDataFormModelItem *item = m_barringpluginGroup->childAt(0);
+    item->setContentWidgetData("checkState", QVariant(Qt::Unchecked));
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpItemDataHelper::removeConnection);
+    EXPECT(CpItemDataHelper::addConnection);
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalErrorNote);
+    
+    emit simulateCheckStateChange(Qt::Unchecked);
+    m_barringpluginGroup->disableBarringRequestCompleted(
+        -1, 
+        PSetCallBarringWrapper::BarringTypeAllBarrings,
+        PSetCallBarringWrapper::BarringStatusActive,
+        false);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_barringPasswordChangeRequestCompleted
+ */
+void UT_CpBarringPluginGroup::t_barringPasswordChangeRequestCompleted()
+{
+// request completed with no error
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    
+    m_barringpluginGroup->barringPasswordChangeRequestCompleted(0);
+    
+    QVERIFY(verify());
+
+// request completed with an error
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalErrorNote);
+    
+    m_barringpluginGroup->barringPasswordChangeRequestCompleted(-1);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_changeBarringStateRequested
+ */
+void UT_CpBarringPluginGroup::t_changeBarringStateRequested()
+{
+// barring enable request case
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(PSetCallBarringWrapper::enableBarring)
+        .with(ServiceGroupVoice, 
+            PSetCallBarringWrapper::BarringTypeAllOutgoing, KCurrentPassword);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote);
+    
+    emit simulateCheckStateChange(Qt::Checked);
+    
+    QVERIFY(verify());
+    
+// barring disable request case
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(PSetCallBarringWrapper::disableBarring)
+        .with(ServiceGroupVoice, 
+            PSetCallBarringWrapper::BarringTypeAllOutgoing, KCurrentPassword);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote);
+    
+    emit simulateCheckStateChange(Qt::Unchecked);
+    
+    QVERIFY(verify());
+
+// cancel pressed while querying barring password
+    EXPECT(CpItemDataHelper::widgetFromModelIndex).returns(this);
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setPasswordParamsCancel));
+    EXPECT(CpItemDataHelper::removeConnection);
+    EXPECT(CpItemDataHelper::addConnection);
+    EXPECT(PSetCallBarringWrapper::disableBarring).times(0);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote).times(0);
+    
+    emit simulateCheckStateChange(Qt::Unchecked);
+    
+    QVERIFY(verify());
+    
+// barring item not found case
+    EXPECT(PSetCallBarringWrapper::enableBarring).times(0);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote).times(0);
+    
+    emit simulateCheckStateChange(Qt::Checked);
+    
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CpBarringPluginGroup::t_changeBarringPasswordRequested
+ */
+void UT_CpBarringPluginGroup::t_changeBarringPasswordRequested()
+{
+    connect(
+        this, SIGNAL(simulateEditPasswordButtonClicked(bool)), 
+        m_barringpluginGroup, SLOT(changeBarringPasswordRequested(bool)));
+    
+    // cancel from current password query
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setPasswordParamsCancel));
+    emit simulateEditPasswordButtonClicked(false);
+    QVERIFY(verify());
+    
+    // cancel from new password query
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setPasswordParamsCancel));
+    emit simulateEditPasswordButtonClicked(false);
+    QVERIFY(verify());
+    
+    // cancel from verify new password query
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setNewAndVerifiedPasswordParams));
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setPasswordParamsCancel));
+    emit simulateEditPasswordButtonClicked(false);
+    QVERIFY(verify());
+    
+    // all data successfully queried
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setCurrentPasswordParams));
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setNewAndVerifiedPasswordParams));
+    EXPECT(CpPhoneNotes::showPasswordQueryDialog)
+        .willOnce(invoke(setNewAndVerifiedPasswordParams));
+    EXPECT(PSetCallBarringWrapper::changeBarringPassword)
+        .with(KCurrentPassword, KNewAndVerifiedPassword, KNewAndVerifiedPassword);
+    emit simulateEditPasswordButtonClicked(false);
+    QVERIFY(verify());
+}
+
+QTEST_MAIN_S60(UT_CpBarringPluginGroup)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.h	Fri Jun 04 10:19:18 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 UT_BARRINGPLUGINGROUP_H
+#define UT_BARRINGPLUGINGROUP_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpBarringPluginGroup;
+class PSetCallBarringWrapper;
+class HbDataFormModel;
+
+class UT_CpBarringPluginGroup : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    
+    UT_CpBarringPluginGroup();
+    ~UT_CpBarringPluginGroup();
+
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_memleak();
+    void t_itemShownNotBarringItem();
+    void t_itemShownBarringStatusRequestOngoing();
+    void t_barringStatusRequestCompletedForUpdateInquiry();
+    void t_barringStatusRequestCompletedWithAnError();
+    void t_getBarringStatuses();
+    void t_enableBarringRequestCompleted();
+    void t_enableBarringRequestCompletedUnknownBarring();
+    void t_enableBAOCRequestCompletedStatusUpdate();
+    void t_enableBOICRequestCompletedStatusUpdate();
+    void t_enableBOICexHCRequestCompletedStatusUpdate();
+    void t_enableBAICRequestCompletedStatusUpdate();
+    void t_enableBICRoamRequestCompletedStatusUpdate();
+    void t_disableBarringRequestCompleted();
+    void t_barringPasswordChangeRequestCompleted();
+    void t_changeBarringStateRequested();
+    void t_changeBarringPasswordRequested();
+
+signals:
+    void simulateCheckStateChange(int checkState);
+    void simulateEditPasswordButtonClicked(bool checked);
+    
+private:
+    
+    CpBarringPluginGroup *m_barringpluginGroup;
+    PSetCallBarringWrapper *m_barringWrapperMock;
+    
+    /** Now own. Data form model. */
+    HbDataFormModel *m_dataFormModel;
+};
+
+#endif // UT_BARRINGPLUGINGROUP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_barringplugingroup/ut_barringplugingroup.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+
+
+
+
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH += ../../../inc
+INCLUDEPATH += ../../../cptelephonyutils/inc
+DEFINES += BUILD_CPTELEPHONYUTILS BUILD_BARRINGPLUGIN \
+           BUILD_PSETWRAPPER BUILD_SSSETTINGSWRAPPER
+DEFINES += QT_NO_DEBUG_STREAM
+
+QT -= gui
+QT += testlib
+
+symbian: { 
+    CONFIG += no_icon
+    
+    INCLUDEPATH += /epoc32/include/mw/QtTest \
+                   /epoc32/include/platform/mw \
+                   /epoc32/include/mw/qt
+    
+    LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework 
+}
+    
+# test code
+HEADERS += ut_barringplugingroup.h
+SOURCES += ut_barringplugingroup.cpp 
+    
+# code to be tested
+HEADERS += ../../inc/cpbarringplugin.h \
+           ../../inc/cpbarringplugingroup.h \
+           ../../../cptelephonyutils/inc/cpphonenotes.h \
+           ../../../cptelephonyutils/inc/cpplugincommon.h \
+           /epoc32/include/platform/mw/psetwrapper.h \
+           /epoc32/include/platform/mw/psetcliwrapper.h \
+           /epoc32/include/platform/mw/sssettingswrapper.h \
+           /epoc32/include/platform/mw/psetcallwaitingwrapper.h \
+           /epoc32/include/platform/mw/psetcalldivertingwrapper.h \
+           /epoc32/include/platform/mw/psetnetworkwrapper.h \
+           /epoc32/include/platform/mw/psetcallbarringwrapper.h
+
+SOURCES += ../../src/cpbarringplugingroup.cpp
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpbarringplugin.cpp
+SOURCES += ../../../tsrc/mocks/mock_psetcallbarringwrapper.cpp
+SOURCES += ../../../tsrc/mocks/mock_psetwrapper.cpp
+SOURCES += ../../../tsrc/mocks/mock_cpphonenotes.cpp
+SOURCES += ../../../tsrc/mocks/mock_cpplugincommon.cpp
+SOURCES += ../../../tsrc/mocks/mock_cpitemdatahelper.cpp
+SOURCES += ../../../tsrc/mocks/mock_hbcheckbox.cpp
+SOURCES += ../../../tsrc/mocks/mock_qtranslator.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/ut_cpbarringplugin.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_cpbarringplugin.h"
+#include "qtestmains60.h"
+#include <cpsettingformitemdata.h>
+#define private public
+#include "cpbarringplugin.h"
+#include "cpitemdatahelper.h"
+
+Q_EXTERN_C const char * qt_plugin_query_verification_data();
+Q_EXTERN_C ::QObject *  qt_plugin_instance();
+
+/*!
+  UT_CpBarringPlugin::UT_CpBarringPlugin
+ */
+UT_CpBarringPlugin::UT_CpBarringPlugin() 
+    : m_barringplugin(NULL)
+{
+    const char * verificationData = qt_plugin_query_verification_data();
+}
+
+/*!
+  UT_CpBarringPlugin::~UT_CpBarringPlugin
+ */
+UT_CpBarringPlugin::~UT_CpBarringPlugin()
+{
+    delete m_barringplugin;
+}
+
+/*!
+  UT_CpBarringPlugin::init
+ */
+void UT_CpBarringPlugin::init()
+{
+    initialize();
+
+    m_barringplugin = (CpBarringPlugin*)qt_plugin_instance();
+    QVERIFY(m_barringplugin);
+}
+
+
+/*!
+  UT_CpBarringPlugin::t_createSettingFormItemData
+ */
+void UT_CpBarringPlugin::t_createSettingFormItemData()
+{
+    CpItemDataHelper itemDataHelper;
+    CpBarringPlugin* p = (CpBarringPlugin*)qt_plugin_instance();
+    QList<CpSettingFormItemData*> list;
+    list.append(p->createSettingFormItemData(itemDataHelper));
+    qDeleteAll(list);
+}
+
+/*!
+  UT_CpBarringPlugin::cleanup
+ */
+void UT_CpBarringPlugin::cleanup()
+{
+    reset();
+    
+    delete m_barringplugin;
+    m_barringplugin = NULL;
+}
+
+/*!
+  UT_CpBarringPlugin::t_memleak
+ */
+void UT_CpBarringPlugin::t_memleak()
+{
+    
+}
+
+QTEST_MAIN_S60(UT_CpBarringPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/ut_cpbarringplugin.h	Fri Jun 04 10:19:18 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 UT_CPBARRINGPLUGIN_H
+#define UT_CPBARRINGPLUGIN_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpBarringPlugin;
+
+class UT_CpBarringPlugin : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpBarringPlugin();
+    ~UT_CpBarringPlugin();
+    
+private slots:
+
+    void init();
+
+    void t_createSettingFormItemData();
+    
+    void cleanup();
+    
+    void t_memleak();
+private:
+    CpBarringPlugin *m_barringplugin;
+
+};
+
+#endif // UT_CPBARRINGPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/barringplugin/tsrc/ut_cpbarringplugin/ut_cpbarringplugin.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../inc 
+INCLUDEPATH +=../../../cptelephonyutils/inc
+DEFINES += BUILD_BARRINGPLUGIN
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+    INCLUDEPATH += /epoc32/include/mw/QtTest \
+        /epoc32/include/platform/mw \
+        /epoc32/include/mw/qt
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+
+# test code
+HEADERS += ut_cpbarringplugin.h
+SOURCES += ut_cpbarringplugin.cpp
+
+# code to be tested
+HEADERS += ../../inc/cpbarringplugin.h \
+           ../../inc/cpbarringplugingroup.h
+           
+SOURCES += ../../src/cpbarringplugin.cpp
+
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpbarringplugingroup.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/bwins/cptelephonyutilsu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,80 @@
+EXPORTS
+	?metaObject@CpPhoneNotes@@UBEPBUQMetaObject@@XZ @ 1 NONAME ; struct QMetaObject const * CpPhoneNotes::metaObject(void) const
+	?basicServiceGroupName@CpPhoneNotes@@ABE?AVQString@@W4BasicServiceGroups@CpTelephonyUtils@@@Z @ 2 NONAME ; class QString CpPhoneNotes::basicServiceGroupName(enum CpTelephonyUtils::BasicServiceGroups) const
+	?activeNoteAboutToClose@CpPhoneNotes@@AAEXXZ @ 3 NONAME ; void CpPhoneNotes::activeNoteAboutToClose(void)
+	?handleProgressNoteCanceled@CpPhoneNotes@@AAEXXZ @ 4 NONAME ; void CpPhoneNotes::handleProgressNoteCanceled(void)
+	??_ECpPhoneNotes@@UAE@I@Z @ 5 NONAME ; CpPhoneNotes::~CpPhoneNotes(unsigned int)
+	?showGlobalErrorNote@CpPhoneNotes@@QAEXAAHH@Z @ 6 NONAME ; void CpPhoneNotes::showGlobalErrorNote(int &, int)
+	?qt_metacast@CpSettingsWrapper@@UAEPAXPBD@Z @ 7 NONAME ; void * CpSettingsWrapper::qt_metacast(char const *)
+	?getStaticMetaObject@Tools@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & Tools::getStaticMetaObject(void)
+	??1CpSettingsWrapper@@UAE@XZ @ 9 NONAME ; CpSettingsWrapper::~CpSettingsWrapper(void)
+	?qt_metacast@CpPhoneNotes@@UAEPAXPBD@Z @ 10 NONAME ; void * CpPhoneNotes::qt_metacast(char const *)
+	?passwordTextChanged@CpPhoneNotes@@AAEXXZ @ 11 NONAME ; void CpPhoneNotes::passwordTextChanged(void)
+	?tr@CpPhoneNotes@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString CpPhoneNotes::tr(char const *, char const *, int)
+	?instance@CpPhoneNotes@@SAPAV1@XZ @ 13 NONAME ; class CpPhoneNotes * CpPhoneNotes::instance(void)
+	?tr@CpSettingsWrapper@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString CpSettingsWrapper::tr(char const *, char const *, int)
+	??1CpPhoneNotes@@EAE@XZ @ 15 NONAME ; CpPhoneNotes::~CpPhoneNotes(void)
+	?formatPhoneNumber@CpPhoneNotes@@ABE?AVQString@@V2@@Z @ 16 NONAME ; class QString CpPhoneNotes::formatPhoneNumber(class QString) const
+	?showGlobalNote@CpPhoneNotes@@QAEXAAHABVQString@@W4MessageBoxType@HbMessageBox@@@Z @ 17 NONAME ; void CpPhoneNotes::showGlobalNote(int &, class QString const &, enum HbMessageBox::MessageBoxType)
+	?metaObject@Tools@@UBEPBUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const * Tools::metaObject(void) const
+	?readSoftRejectText@CpSettingsWrapper@@QAEXAAVQString@@AA_N@Z @ 19 NONAME ; void CpSettingsWrapper::readSoftRejectText(class QString &, bool &)
+	?getStaticMetaObject@CpSettingsWrapper@@SAABUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const & CpSettingsWrapper::getStaticMetaObject(void)
+	?finishedPasswordQueryDialog@CpPhoneNotes@@QAEXPAVHbAction@@@Z @ 21 NONAME ; void CpPhoneNotes::finishedPasswordQueryDialog(class HbAction *)
+	?metaObject@CpSettingsWrapper@@UBEPBUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const * CpSettingsWrapper::metaObject(void) const
+	?videoSupported@Tools@@SA_NXZ @ 23 NONAME ; bool Tools::videoSupported(void)
+	?showCallDuration@CpSettingsWrapper@@QAE_NXZ @ 24 NONAME ; bool CpSettingsWrapper::showCallDuration(void)
+	?isPhoneOffline@CpSettingsWrapper@@QBE_NXZ @ 25 NONAME ; bool CpSettingsWrapper::isPhoneOffline(void) const
+	?errorCodeTextMapping@Tools@@SA_NHAAVQString@@@Z @ 26 NONAME ; bool Tools::errorCodeTextMapping(int, class QString &)
+	?trUtf8@CpPhoneNotes@@SA?AVQString@@PBD0H@Z @ 27 NONAME ; class QString CpPhoneNotes::trUtf8(char const *, char const *, int)
+	?readCenrepString@CpSettingsWrapper@@ABE?AVQString@@JK@Z @ 28 NONAME ; class QString CpSettingsWrapper::readCenrepString(long, unsigned long) const
+	?writeSoftRejectText@CpSettingsWrapper@@QAEHABVQString@@_N@Z @ 29 NONAME ; int CpSettingsWrapper::writeSoftRejectText(class QString const &, bool)
+	?showBasicServiceList@CpPhoneNotes@@QAEXABVQString@@ABV?$QList@E@@@Z @ 30 NONAME ; void CpPhoneNotes::showBasicServiceList(class QString const &, class QList<unsigned char> const &)
+	?setShowCallDuration@CpSettingsWrapper@@QAEH_N@Z @ 31 NONAME ; int CpSettingsWrapper::setShowCallDuration(bool)
+	?qt_metacall@CpPhoneNotes@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 32 NONAME ; int CpPhoneNotes::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@Tools@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 33 NONAME ; int Tools::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@CpSettingsWrapper@@SA?AVQString@@PBD0@Z @ 34 NONAME ; class QString CpSettingsWrapper::trUtf8(char const *, char const *)
+	?tr@CpPhoneNotes@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString CpPhoneNotes::tr(char const *, char const *)
+	??_ECpSettingsWrapper@@UAE@I@Z @ 36 NONAME ; CpSettingsWrapper::~CpSettingsWrapper(unsigned int)
+	?getStaticMetaObject@CpPhoneNotes@@SAABUQMetaObject@@XZ @ 37 NONAME ; struct QMetaObject const & CpPhoneNotes::getStaticMetaObject(void)
+	?progressNoteCanceled@CpPhoneNotes@@IAEXXZ @ 38 NONAME ; void CpPhoneNotes::progressNoteCanceled(void)
+	?trUtf8@CpSettingsWrapper@@SA?AVQString@@PBD0H@Z @ 39 NONAME ; class QString CpSettingsWrapper::trUtf8(char const *, char const *, int)
+	?staticMetaObject@CpPhoneNotes@@2UQMetaObject@@B @ 40 NONAME ; struct QMetaObject const CpPhoneNotes::staticMetaObject
+	??0CpPhoneNotes@@AAE@XZ @ 41 NONAME ; CpPhoneNotes::CpPhoneNotes(void)
+	?tr@Tools@@SA?AVQString@@PBD0@Z @ 42 NONAME ; class QString Tools::tr(char const *, char const *)
+	?showGlobalProgressNote@CpPhoneNotes@@QAEXAAHABVQString@@@Z @ 43 NONAME ; void CpPhoneNotes::showGlobalProgressNote(int &, class QString const &)
+	?voipSupported@Tools@@SA_NXZ @ 44 NONAME ; bool Tools::voipSupported(void)
+	?qt_metacast@Tools@@UAEPAXPBD@Z @ 45 NONAME ; void * Tools::qt_metacast(char const *)
+	?trUtf8@CpPhoneNotes@@SA?AVQString@@PBD0@Z @ 46 NONAME ; class QString CpPhoneNotes::trUtf8(char const *, char const *)
+	?readCenrepValue@CpSettingsWrapper@@ABE?AVQVariant@@JK@Z @ 47 NONAME ; class QVariant CpSettingsWrapper::readCenrepValue(long, unsigned long) const
+	?trUtf8@Tools@@SA?AVQString@@PBD0H@Z @ 48 NONAME ; class QString Tools::trUtf8(char const *, char const *, int)
+	?tr@Tools@@SA?AVQString@@PBD0H@Z @ 49 NONAME ; class QString Tools::tr(char const *, char const *, int)
+	?qt_metacall@CpSettingsWrapper@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 50 NONAME ; int CpSettingsWrapper::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?noteShowing@CpPhoneNotes@@QAE_NXZ @ 51 NONAME ; bool CpPhoneNotes::noteShowing(void)
+	?showCallDivertDetails@CpPhoneNotes@@QAEXABVPSCallDivertingStatus@@@Z @ 52 NONAME ; void CpPhoneNotes::showCallDivertDetails(class PSCallDivertingStatus const &)
+	?passwordQueryCompleted@CpPhoneNotes@@IAEXVQString@@_N@Z @ 53 NONAME ; void CpPhoneNotes::passwordQueryCompleted(class QString, bool)
+	?numberGroupingSupported@CpSettingsWrapper@@QBE_NXZ @ 54 NONAME ; bool CpSettingsWrapper::numberGroupingSupported(void) const
+	?launchNextNoteIfReady@CpPhoneNotes@@AAEXXZ @ 55 NONAME ; void CpPhoneNotes::launchNextNoteIfReady(void)
+	?tr@CpSettingsWrapper@@SA?AVQString@@PBD0@Z @ 56 NONAME ; class QString CpSettingsWrapper::tr(char const *, char const *)
+	?cancelNote@CpPhoneNotes@@QAEXH@Z @ 57 NONAME ; void CpPhoneNotes::cancelNote(int)
+	?isFeatureCallWaitingDistiquishNotProvisionedEnabled@CpSettingsWrapper@@QAE_NXZ @ 58 NONAME ; bool CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled(void)
+	?showPasswordQueryDialog@CpPhoneNotes@@QAEXABVQString@@ABVQValidator@@H@Z @ 59 NONAME ; void CpPhoneNotes::showPasswordQueryDialog(class QString const &, class QValidator const &, int)
+	?writeCenrepValue@CpSettingsWrapper@@ABEHJKABVQVariant@@@Z @ 60 NONAME ; int CpSettingsWrapper::writeCenrepValue(long, unsigned long, class QVariant const &) const
+	?staticMetaObject@Tools@@2UQMetaObject@@B @ 61 NONAME ; struct QMetaObject const Tools::staticMetaObject
+	?trUtf8@Tools@@SA?AVQString@@PBD0@Z @ 62 NONAME ; class QString Tools::trUtf8(char const *, char const *)
+	?staticMetaObject@CpSettingsWrapper@@2UQMetaObject@@B @ 63 NONAME ; struct QMetaObject const CpSettingsWrapper::staticMetaObject
+	??0CpSettingsWrapper@@QAE@PAVQObject@@@Z @ 64 NONAME ; CpSettingsWrapper::CpSettingsWrapper(class QObject *)
+	?qt_metacast@CpPhoneLocalisation@@UAEPAXPBD@Z @ 65 NONAME ; void * CpPhoneLocalisation::qt_metacast(char const *)
+	?installTranslator@CpPhoneLocalisation@@QAE_NW4TranslationFileId@1@@Z @ 66 NONAME ; bool CpPhoneLocalisation::installTranslator(enum CpPhoneLocalisation::TranslationFileId)
+	?trUtf8@CpPhoneLocalisation@@SA?AVQString@@PBD0H@Z @ 67 NONAME ; class QString CpPhoneLocalisation::trUtf8(char const *, char const *, int)
+	?tr@CpPhoneLocalisation@@SA?AVQString@@PBD0H@Z @ 68 NONAME ; class QString CpPhoneLocalisation::tr(char const *, char const *, int)
+	?qt_metacall@CpPhoneLocalisation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int CpPhoneLocalisation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@CpPhoneLocalisation@@SA?AVQString@@PBD0@Z @ 70 NONAME ; class QString CpPhoneLocalisation::trUtf8(char const *, char const *)
+	?staticMetaObject@CpPhoneLocalisation@@2UQMetaObject@@B @ 71 NONAME ; struct QMetaObject const CpPhoneLocalisation::staticMetaObject
+	??0CpPhoneLocalisation@@QAE@PAVQObject@@@Z @ 72 NONAME ; CpPhoneLocalisation::CpPhoneLocalisation(class QObject *)
+	??_ECpPhoneLocalisation@@UAE@I@Z @ 73 NONAME ; CpPhoneLocalisation::~CpPhoneLocalisation(unsigned int)
+	?metaObject@CpPhoneLocalisation@@UBEPBUQMetaObject@@XZ @ 74 NONAME ; struct QMetaObject const * CpPhoneLocalisation::metaObject(void) const
+	?tr@CpPhoneLocalisation@@SA?AVQString@@PBD0@Z @ 75 NONAME ; class QString CpPhoneLocalisation::tr(char const *, char const *)
+	??1CpPhoneLocalisation@@UAE@XZ @ 76 NONAME ; CpPhoneLocalisation::~CpPhoneLocalisation(void)
+	?getStaticMetaObject@CpPhoneLocalisation@@SAABUQMetaObject@@XZ @ 77 NONAME ; struct QMetaObject const & CpPhoneLocalisation::getStaticMetaObject(void)
+	?removeTranslators@CpPhoneLocalisation@@QAEXXZ @ 78 NONAME ; void CpPhoneLocalisation::removeTranslators(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/callsplugin.pro	Fri Jun 04 10:19:18 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: 
+#
+
+TEMPLATE = lib
+TARGET = cpcallsplugin
+DEPENDPATH += .
+INCLUDEPATH += .
+INCLUDEPATH += ../cptelephonyutils/inc
+
+CONFIG += hb plugin
+
+TRANSLATIONS = telephone_cp.ts
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+RCC_DIR = rcc
+LIBS += -lcpframework \
+        -lpsetwrapper \
+        -lsssettingswrapper \
+        -lcptelephonyutils
+
+# Input
+SOURCES += src/cpcallsplugingroup.cpp \
+    src/cpcallsplugin.cpp
+			
+HEADERS += src/cpcallsplugingroup.h \
+    src/cpcallsplugin.h
+
+include(../cpplugincommon.pri)
+
+symbian: {
+    TARGET.UID3 = 0X20029F26
+    LIBS += -lxqsysinfo \
+        -lxqsettingsmanager
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugin.cpp	Fri Jun 04 10:19:18 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 "cpcallsplugin.h"
+#include "cpcallsplugingroup.h"
+#include "cppluginlogging.h"
+#include <cpsettingformentryitemdataimpl.h>
+#include <QtDebug>
+
+/*!
+    Constructor of CpCallsPlugin.
+ */
+CpCallsPlugin::CpCallsPlugin() : QObject(0)
+{
+    // Install plugin specific msg handler
+    INSTALL_TRACE_MSG_HANDLER;
+    
+    DPRINT;
+}
+
+/*!
+    Destructor of CpCallsPlugin.
+ */
+CpCallsPlugin::~CpCallsPlugin()
+{
+    DPRINT;
+    
+    // Uninstall plugin specific msg handler
+    UNINSTALL_TRACE_MSG_HANDLER;
+}
+
+/*!
+    CpCallsPlugin::createSettingFormItemData.
+ */
+QList<CpSettingFormItemData*> CpCallsPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+{
+    DPRINT;
+    QList<CpSettingFormItemData*> ret;
+    ret.append(new CpCallsPluginGroup(itemDataHelper));
+    return ret;
+}
+
+Q_EXPORT_PLUGIN2(cpcallsplugin, CpCallsPlugin);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugin.h	Fri Jun 04 10:19:18 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 CPCALLSPLUGIN_H
+#define CPCALLSPLUGIN_H
+
+#include <cpplugininterface.h>
+
+
+/*!
+    \class CpCallsPlugin
+    \brief The class CpCallsPlugin implements call settings functionality. 
+ */
+class CpCallsPlugin: public QObject,public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+public:
+    
+    CpCallsPlugin();
+    
+    ~CpCallsPlugin();
+
+    /**
+     * From CpPluginInterface
+     * @see CpPluginInterface.
+     */
+    QList<CpSettingFormItemData*> createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const;
+};
+#endif // CPCALLSPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,535 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "cpcallsplugingroup.h"
+#include "cpplugincommon.h"
+#include "cppluginlogging.h"
+#include "cpphonenotes.h"
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hbdataformviewitem.h>
+#include <hbcheckbox.h>
+#include <QString>
+#include <hblineedit.h>
+#include <hbcombobox.h>
+#include <hbdeviceprogressdialog.h>
+#include <cpitemdatahelper.h>
+#include <sssettingswrapper.h>
+#include <psetwrapper.h>
+#include <psetcliwrapper.h>
+
+
+/*!
+  CpCallsPluginGroup::CpCallsPluginGroup.
+ */
+CpCallsPluginGroup::CpCallsPluginGroup(CpItemDataHelper &helper)
+    :CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId("txt_phone_subhead_call_settings"),0),
+     m_activeNoteId(0),
+     m_helper(helper)
+{
+    DPRINT << ": IN";
+
+    m_cpSettingsWrapper = new CpSettingsWrapper;
+    m_pSetWrapper = new PSetWrapper; 
+    DPRINT << "PSetWrapper created";
+    
+    m_callWaitingWrapper = &m_pSetWrapper->callWaitingWrapper(); 
+    DPRINT << "call waiting wrapper created";
+    QObject::connect(
+        m_callWaitingWrapper, 
+        SIGNAL(handleCallWaitingGetStatus(
+            PSetCallWaitingWrapper::PsCallWaitingStatus, const QList<unsigned char> &)),
+        this, 
+        SLOT(handleCallWaitingGetStatus(
+            PSetCallWaitingWrapper::PsCallWaitingStatus, const QList<unsigned char> &)));
+    QObject::connect(
+        m_callWaitingWrapper, 
+        SIGNAL(handleCallWaitingChanged(PSetCallWaitingWrapper::PsCallWaitingCommand, int)),
+        this, 
+        SLOT(handleCallWaitingChanged(PSetCallWaitingWrapper::PsCallWaitingCommand, int)));
+    QObject::connect(
+        m_callWaitingWrapper, 
+        SIGNAL(handleCallWaitingRequesting( bool, bool )),
+        this, 
+        SLOT(handleCallWaitingRequesting( bool, bool )));
+    QObject::connect(
+        m_callWaitingWrapper, 
+        SIGNAL(handleCallWaitingError( int )),
+        this, 
+        SLOT(handleCallWaitingError( int )));
+
+    m_ssSettingsWrapper = new SsSettingsWrapper; 
+    DPRINT << "SsSettingsWrapper created";
+    
+    CpPhoneNotes *phoneNotes = CpPhoneNotes::instance();
+    QObject::connect(
+        this, 
+        SIGNAL(showGlobalProgressNote(int &, const QString&)),
+        phoneNotes, 
+        SLOT(showGlobalProgressNote(int &, const QString&)));
+    QObject::connect(
+        this, 
+        SIGNAL(showGlobalNote(int &, const QString&, HbMessageBox::MessageBoxType)),
+        phoneNotes, 
+        SLOT(showGlobalNote(int &, const QString&, HbMessageBox::MessageBoxType)));
+    QObject::connect(
+        this, 
+        SIGNAL(showGlobalErrorNote(int &, int)),
+        phoneNotes, 
+        SLOT(showGlobalErrorNote(int &, int)));
+    QObject::connect(
+        this, 
+        SIGNAL(cancelNote(int)),
+        phoneNotes, 
+        SLOT(cancelNote(int)));
+    
+    // Create combobox string <-> setting mappings 
+    insertMappedListItems(); 
+       
+    // Greate settings items
+    createCLIItem();
+    createCallWaitingtem();
+    createSoftRejectItem();
+    createShowCallDurationItem();
+    
+    // Connect setting item signals
+    connectCLIItem();
+    connectCallWaitingItem();
+    connectSoftRejectItem();
+    connectShowCallDurationItem();
+    
+    m_callWaitingDistinguishEnabled = 
+       m_cpSettingsWrapper->isFeatureCallWaitingDistiquishNotProvisionedEnabled();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::~CpCallsPluginGroup.
+ */
+CpCallsPluginGroup::~CpCallsPluginGroup()
+{
+    DPRINT << ": IN";
+    
+    delete m_cpSettingsWrapper;
+    delete m_pSetWrapper;
+    delete m_ssSettingsWrapper;
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::createShowCallDurationItem.
+ */
+void CpCallsPluginGroup::createShowCallDurationItem()
+{
+    DPRINT << ": IN";
+    
+    // Read show call duration value from Cenrep 
+    bool showCallDurationStatus = m_cpSettingsWrapper->showCallDuration();
+    DPRINT << "showCallDurationStatus:" << showCallDurationStatus;
+
+    m_DataItemShowCallDuration =
+        new CpSettingFormItemData(
+            HbDataFormModelItem::ToggleValueItem,
+            hbTrId("txt_phone_formlabel_show_call_duration"),
+            this);
+
+    if (showCallDurationStatus) {
+        m_DataItemShowCallDuration->setContentWidgetData(
+            "text", QVariant(hbTrId("txt_phone_setlabel_val_yes")));
+        m_DataItemShowCallDuration->setContentWidgetData(
+            "additionalText", QVariant(hbTrId("txt_phone_setlabel_val_no")));
+    } else {
+        m_DataItemShowCallDuration->setContentWidgetData(
+            "text", QVariant(hbTrId("txt_phone_setlabel_val_no")));
+        m_DataItemShowCallDuration->setContentWidgetData(
+            "additionalText", QVariant(hbTrId("txt_phone_setlabel_val_yes")));
+    }
+
+    appendChild( m_DataItemShowCallDuration ); 
+    DPRINT << ": OUT";
+}
+    
+/*!
+  CpCallsPluginGroup::createSoftRejectItem.
+ */
+void CpCallsPluginGroup::createSoftRejectItem()
+{
+    DPRINT << ": IN";
+    
+    bool userDefinedTextInUse = false;
+    QString softRejectText;
+    m_cpSettingsWrapper->readSoftRejectText(
+        softRejectText, userDefinedTextInUse);
+    if(!userDefinedTextInUse) {
+        softRejectText =
+            hbTrId("txt_phone_setlabel_soft_reject_val_default_text");
+    }
+    m_DataItemSoftRejectTextEditor = 
+        new CpSettingFormItemData(
+            HbDataFormModelItem::TextItem,
+            hbTrId("txt_phone_setlabel_soft_reject"),
+            this);
+    m_DataItemSoftRejectTextEditor->setContentWidgetData(
+        "text", QVariant(softRejectText));
+    m_DataItemSoftRejectTextEditor->setContentWidgetData(
+        "maxLength", QVariant(160));
+    m_DataItemSoftRejectTextEditor->setContentWidgetData(
+        "maxRows", QVariant(5));
+    m_DataItemSoftRejectTextEditor->setContentWidgetData(
+        "minRows", QVariant(1));
+    appendChild( m_DataItemSoftRejectTextEditor ); 
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::createCLIItem.
+ */
+void CpCallsPluginGroup::createCLIItem()
+{
+    DPRINT << ": IN";
+
+    m_DataItemCLI = 
+        new CpSettingFormItemData(
+            HbDataFormModelItem::ComboBoxItem,
+            hbTrId("txt_phone_setlabel_send_my_caller_id"),
+            this);
+    // CLI combo box items string list 
+    QStringList list;
+    QMapIterator<int, QString> cliSettingMapIterator(m_cliSettingMap);
+    while (cliSettingMapIterator.hasNext()) {
+        cliSettingMapIterator.next();
+        list << cliSettingMapIterator.value(); 
+        };
+    m_DataItemCLI->setContentWidgetData("items", QVariant(list));
+    appendChild(m_DataItemCLI);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::createCallWaitingtem.
+ */
+void CpCallsPluginGroup::createCallWaitingtem()
+{
+    DPRINT << ": IN";
+
+    m_DataItemCallWaiting = 
+        new CpSettingFormItemData(
+            HbDataFormModelItem::ToggleValueItem,
+            hbTrId("txt_phone_setlabel_call_waiting"),
+            this);
+
+    m_DataItemCallWaiting->setContentWidgetData(
+        "text", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_check_status")));
+    m_DataItemCallWaiting->setContentWidgetData(
+        "additionalText", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_check_status")));
+
+    appendChild(m_DataItemCallWaiting);
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::connectShowCallDurationItem.
+ */
+void CpCallsPluginGroup::connectShowCallDurationItem()
+{
+    DPRINT << ": IN";
+    
+    m_helper.addConnection(
+        m_DataItemShowCallDuration, SIGNAL(clicked()),
+        this, SLOT(showCallDurationStateChanged()));
+
+    DPRINT << ": OUT";
+}
+ 
+/*!
+  CpCallsPluginGroup::connectSoftRejectItem.
+ */
+void CpCallsPluginGroup::connectSoftRejectItem()
+{
+    DPRINT << ": IN";
+
+    m_helper.addConnection(
+        m_DataItemSoftRejectTextEditor, SIGNAL(editingFinished()),
+        this, SLOT(softRejectTextChanged()));
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::connectCLIItem.
+ */
+void CpCallsPluginGroup::connectCLIItem()
+{
+    DPRINT << ": IN";
+    
+    m_helper.addConnection(
+        m_DataItemCLI, SIGNAL(currentIndexChanged(int)),
+        this, SLOT(cliCurrentIndexChanged(int)));
+    // Fetch current CLI value 
+    int cliValue(ClirNetworkDefault);
+    int err = m_ssSettingsWrapper->get(Clir, cliValue);
+    if (!err){
+        QVariant indexValue(cliValue);
+        m_DataItemCLI->setContentWidgetData(
+            QString("currentIndex"), indexValue);
+    } else {
+        DPRINT << "Error: " << err;
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::connectCallWaitingItem.
+ */
+void CpCallsPluginGroup::connectCallWaitingItem()
+{
+    DPRINT << ": IN";
+
+    m_helper.addConnection(
+        m_DataItemCallWaiting, SIGNAL(clicked()),
+        this, SLOT(callWaitingCurrentIndexChanged()));
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::showCallDurationStateChanged.
+ */
+void CpCallsPluginGroup::showCallDurationStateChanged()
+{
+    DPRINT << ": IN";
+
+    QVariant text = m_DataItemShowCallDuration->contentWidgetData("text");
+    QString showCallDurationText = text.toString();
+
+    if (showCallDurationText == hbTrId("txt_phone_setlabel_val_yes")) {
+        m_cpSettingsWrapper->setShowCallDuration(true);
+    } else if (showCallDurationText == hbTrId("txt_phone_setlabel_val_no")){
+        m_cpSettingsWrapper->setShowCallDuration(false);
+    } else {
+        DPRINT << "nothing done";
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::softRejectTextChanged.
+ */
+void CpCallsPluginGroup::softRejectTextChanged()
+{
+    DPRINT << ": IN";
+    
+    QVariant text = m_DataItemSoftRejectTextEditor->contentWidgetData("text");
+    QString softRejectText = text.toString();  
+    if (!softRejectText.isEmpty()) {
+        DPRINT << "softRejectText:" << softRejectText;
+        m_cpSettingsWrapper->writeSoftRejectText(softRejectText, true);
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::callWaitingCurrentIndexChanged.
+ */
+void CpCallsPluginGroup::callWaitingCurrentIndexChanged()
+{
+    DPRINT << ": IN";
+
+    QVariant text = m_DataItemCallWaiting->contentWidgetData("text");
+    QString callWaitingText = text.toString();
+
+    if (callWaitingText == hbTrId("txt_phone_setlabel_call_waiting_val_check_status")) {
+        // Clicked first time, user want to check feature status
+        DPRINT << "checking status";
+        m_callWaitingWrapper->getCallWaitingStatus();
+    }
+
+    else if (callWaitingText == hbTrId("txt_phone_setlabel_call_waiting_val_on")) {
+        DPRINT << "activate";
+        // User want to activate call waiting feature
+        m_callWaitingWrapper->setCallWaiting(
+            PSetCallWaitingWrapper::ActivateCallWaiting,
+            AllTeleAndBearer);
+    }
+    else if (callWaitingText == hbTrId("txt_phone_setlabel_call_waiting_val_off")) {
+        DPRINT << "deactivate";
+        // User want to deactivate call waiting feature
+        m_callWaitingWrapper->setCallWaiting(
+            PSetCallWaitingWrapper::DeactivateCallWaiting,
+            AllTeleAndBearer);
+    }
+    else {
+        DPRINT << "nothing done";
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::cliCurrentIndexChanged.
+ */
+void CpCallsPluginGroup::cliCurrentIndexChanged(int index)
+{
+    DPRINT << ": IN";
+
+    if (index >= 0) {
+        QString settingMapString = m_cliSettingMap.value(index);
+        DPRINT << "settingMapString:" << settingMapString;
+        int err = m_ssSettingsWrapper->set(Clir, index);
+        DPRINT << "m_ssSettingsWrapper->set() err: " << err;
+    } else {
+        DPRINT << "Error: negative index!";
+    }
+
+    DPRINT << ": OUT";
+}
+    
+/*!
+  CpCallsPluginGroup::insertMappedListItems.
+ */
+void CpCallsPluginGroup::insertMappedListItems()
+{
+    DPRINT << ": IN";
+
+    m_cliSettingMap.insert(ClirNetworkDefault, hbTrId("txt_phone_setlabel_val_default"));
+    m_cliSettingMap.insert(ClirExplicitSuppress, hbTrId("txt_phone_setlabel_val_yes"));
+    m_cliSettingMap.insert(ClirExplicitInvoke, hbTrId("txt_phone_setlabel_val_no"));
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::handleCallWaitingGetStatus.
+ */
+void CpCallsPluginGroup::handleCallWaitingGetStatus( 
+    PSetCallWaitingWrapper::PsCallWaitingStatus status,
+    const QList<unsigned char> &basicServiceGroupIds)
+{
+    DPRINT << ": IN status: " << status;
+    // This happens only in the very first time when clicked.
+
+    emit cancelNote(m_activeNoteId);
+    
+    bool alsCaseOnly = false;
+    if (1 == basicServiceGroupIds.count() &&
+        AltTele == static_cast<BasicServiceGroups>(basicServiceGroupIds.at(0))) {
+        DPRINT << "Status is only for als";
+        alsCaseOnly = true;
+    }
+
+    if (m_callWaitingDistinguishEnabled &&
+            PSetCallWaitingWrapper::StatusNotProvisioned == status) {
+        DPRINT << ": not provisioned";
+        emit showGlobalNote(m_activeNoteId,
+            hbTrId("txt_phone_info_request_not_completed"), 
+            HbMessageBox::MessageTypeInformation);
+    } else if (PSetCallWaitingWrapper::StatusActive == status && !alsCaseOnly) {
+        DPRINT << ": status active";
+        m_DataItemCallWaiting->setContentWidgetData(
+            "text", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_on")));
+        m_DataItemCallWaiting->setContentWidgetData(
+            "additionalText", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_off")));
+
+    } else {
+        DPRINT << ": status not active";
+        m_DataItemCallWaiting->setContentWidgetData(
+            "text", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_off")));
+        m_DataItemCallWaiting->setContentWidgetData(
+            "additionalText", QVariant(hbTrId("txt_phone_setlabel_call_waiting_val_on")));
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::handleCallWaitingChanged.
+ */
+void CpCallsPluginGroup::handleCallWaitingChanged( 
+    PSetCallWaitingWrapper::PsCallWaitingCommand command,
+    int result )
+{
+    DPRINT << ": IN";
+    emit cancelNote(m_activeNoteId);
+    if (result) {
+        emit showGlobalNote(m_activeNoteId,
+            hbTrId("txt_phone_info_request_not_confirmed"), 
+            HbMessageBox::MessageTypeWarning);
+    } else {
+        switch (command){
+            case PSetCallWaitingWrapper::ActivateCallWaiting:
+                emit showGlobalNote(m_activeNoteId,
+                    hbTrId("txt_phone_info_call_waiting_activated"), 
+                    HbMessageBox::MessageTypeInformation);
+                break;
+            case PSetCallWaitingWrapper::DeactivateCallWaiting:
+                emit showGlobalNote(m_activeNoteId,
+                    hbTrId("txt_phone_info_call_waiting_deactivated"), 
+                    HbMessageBox::MessageTypeInformation);
+                break;
+            default: 
+                emit showGlobalNote(m_activeNoteId,
+                    hbTrId("txt_phone_info_result_unknown"), 
+                    HbMessageBox::MessageTypeInformation);
+                break;
+        }
+    }
+    DPRINT << ": OUT";
+} 
+
+/*!
+  CpCallsPluginGroup::handleCallWaitingRequesting.
+ */
+void CpCallsPluginGroup::handleCallWaitingRequesting(bool ongoing, bool interrupted)
+{
+    DPRINT << ": IN";
+    DPRINT << "ongoing:" << ongoing << ", interrupted:" << interrupted;
+    Q_ASSERT(!(ongoing && interrupted));
+    
+    if (ongoing) {
+        emit showGlobalProgressNote(m_activeNoteId, hbTrId("txt_phone_info_requesting"));
+    }
+    
+    if (interrupted) {
+        emit cancelNote(m_activeNoteId);
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpCallsPluginGroup::handleCallWaitingError.
+ */
+void CpCallsPluginGroup::handleCallWaitingError(int errorCode)
+{
+    DPRINT << ": IN";
+    DPRINT << "errorCode:" << errorCode;
+    
+    emit cancelNote(m_activeNoteId);
+    
+    emit showGlobalErrorNote(m_activeNoteId, errorCode);
+    
+    DPRINT << ": OUT";
+}
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/src/cpcallsplugingroup.h	Fri Jun 04 10:19:18 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 CPCALLSPLUGINGROUP_H
+#define CPCALLSPLUGINGROUP_H
+
+#include <QObject>
+#include <QMap>
+#include <QVariant>
+#include <hbmessagebox.h>
+#include <cpsettingformitemdata.h>
+#include <psetcallwaitingwrapper.h>
+
+class HbDataFormModel;
+class HbDataFormModelItem; 
+class HbLineEdit;
+class PSetWrapper;
+class PSetCliWrapper; 
+class SsSettingsWrapper; 
+class PSetCallWaitingWrapper;
+class CpSettingsWrapper;
+
+class CpCallsPluginGroup: public CpSettingFormItemData
+{
+    Q_OBJECT
+
+public:
+
+    explicit CpCallsPluginGroup(CpItemDataHelper &helper);
+
+    ~CpCallsPluginGroup();
+    
+private:     
+    
+    void createShowCallDurationItem();
+    void createSoftRejectItem();
+    void createCLIItem();
+    void createCallWaitingtem();
+    
+    void connectShowCallDurationItem();
+    void connectSoftRejectItem();
+    void connectCLIItem();
+    void connectCallWaitingItem();
+    
+    void insertMappedListItems(); 
+    
+public slots:
+    
+    void showCallDurationStateChanged();
+    void softRejectTextChanged();
+    void callWaitingCurrentIndexChanged();
+    void cliCurrentIndexChanged(int index);
+    
+    // Call waiting slots
+    void handleCallWaitingGetStatus( 
+        PSetCallWaitingWrapper::PsCallWaitingStatus status,
+        const QList<unsigned char> &basicServiceGroupIds);
+    void handleCallWaitingChanged( 
+        PSetCallWaitingWrapper::PsCallWaitingCommand setting,
+        int aResult );
+    void handleCallWaitingRequesting( bool ongoing, bool interrupted ); 
+    void handleCallWaitingError( int error );
+    
+signals:
+    
+    void showGlobalProgressNote(int &noteId, const QString& text);
+    void showGlobalNote(
+        int &noteId, const QString& text, HbMessageBox::MessageBoxType);
+    void showGlobalErrorNote(int &noteId, int errorCode);
+    void cancelNote(int noteId);
+    
+private:   
+
+    // Setting wrappers 
+    PSetWrapper *m_pSetWrapper; 
+    SsSettingsWrapper *m_ssSettingsWrapper; 
+    CpSettingsWrapper *m_cpSettingsWrapper;
+
+    // Not own
+    PSetCliWrapper* m_cliWrapper;
+    PSetCallWaitingWrapper* m_callWaitingWrapper;
+    
+    // Not owned objects
+    CpSettingFormItemData *m_DataItemShowCallDuration; 
+    CpSettingFormItemData *m_DataItemSoftRejectTextEditor;
+    CpSettingFormItemData *m_DataItemCLI; 
+    CpSettingFormItemData *m_DataItemCallWaiting;
+    
+    // List data mappings 
+    QMap<int, QString> m_cliSettingMap;
+    
+    bool m_callWaitingDistinguishEnabled;
+    int m_activeNoteId;
+    CpItemDataHelper &m_helper;
+};
+#endif // CPCALLSPLUGINGROUP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs --config winscw_udeb --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+    call %PATH_TO_DLL%\%%a.exe -dtextshell --
+    move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/ut_callsplugin.cpp	Fri Jun 04 10:19:18 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 "ut_callsplugin.h"
+#include "qtestmains60.h"
+#include <cpsettingformitemdata.h>
+#define private public
+#include "cpcallsplugin.h"
+#include "cpitemdatahelper.h"
+
+Q_EXTERN_C const char * qt_plugin_query_verification_data();
+Q_EXTERN_C ::QObject *  qt_plugin_instance();
+/*!
+  UT_CpCallsPlugin::UT_CpCallsPlugin
+ */
+UT_CpCallsPlugin::UT_CpCallsPlugin() 
+    : m_callsplugin(NULL)
+{
+    const char * verificationData = qt_plugin_query_verification_data();
+}
+
+/*!
+  UT_CpCallsPlugin::~UT_CpCallsPlugin
+ */
+UT_CpCallsPlugin::~UT_CpCallsPlugin()
+{
+    delete m_callsplugin;
+}
+
+/*!
+  UT_CpCallsPlugin::init
+ */
+void UT_CpCallsPlugin::init()
+{
+    initialize();
+
+    m_callsplugin = (CpCallsPlugin*)qt_plugin_instance();
+}
+
+
+
+void UT_CpCallsPlugin::t_createSettingFormItemData()
+{
+    CpItemDataHelper itemDataHelper;
+    CpCallsPlugin* p = (CpCallsPlugin*)qt_plugin_instance();
+    QList<CpSettingFormItemData*> list;
+    list.append(p->createSettingFormItemData(itemDataHelper));
+    qDeleteAll(list);
+}
+
+
+/*!
+  UT_CpCallsPlugin::cleanup
+ */
+void UT_CpCallsPlugin::cleanup()
+{
+    reset();
+    
+    delete m_callsplugin;
+    m_callsplugin = NULL;
+}
+
+/*!
+  UT_CpCallsPlugin::t_memleak
+ */
+void UT_CpCallsPlugin::t_memleak()
+{
+    
+}
+
+QTEST_MAIN_S60(UT_CpCallsPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/ut_callsplugin.h	Fri Jun 04 10:19:18 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 UT_CALLSPLUGIN_H
+#define UT_CALLSPLUGIN_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpCallsPlugin;
+
+class UT_CpCallsPlugin : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpCallsPlugin();
+    ~UT_CpCallsPlugin();
+    
+private slots:
+
+    void init();
+
+    void t_createSettingFormItemData();
+    
+    void cleanup();
+    
+    void t_memleak();
+private:
+    CpCallsPlugin *m_callsplugin;
+
+};
+
+#endif // UT_CALLSPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugin/ut_callsplugin.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../inc 
+INCLUDEPATH +=../../../cptelephonyutils/inc
+DEFINES += BUILD_CALLSPLUGIN 
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+    INCLUDEPATH += /epoc32/include/mw/QtTest \
+        /epoc32/include/platform/mw \
+        /epoc32/include/mw/qt
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework \
+}
+
+# test code
+HEADERS += ut_callsplugin.h
+SOURCES += ut_callsplugin.cpp
+
+# code to be tested
+HEADERS += ../../src/cpcallsplugin.h \
+           ../../src/cpcallsplugingroup.h \
+           
+SOURCES += ../../src/cpcallsplugin.cpp 
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpcallsplugingroup.cpp \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,285 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_callsplugingroup.h"
+#include "cpcallsplugingroup.h"
+#include "cpitemdatahelper.h"
+#include "qtestmains60.h"
+// mocked dependencies for the class under test
+#include "psetwrapper.h"
+#include "sssettingswrapper.h"
+#include "cpplugincommon.h"
+#include "cpphonenotes.h"
+
+/*!
+  Dummy CPsetContainer class
+ */
+class CPsetContainer
+    {
+public:
+    CPsetContainer(){};
+    ~CPsetContainer(){};
+    };
+
+/*!
+  UT_CpCallsPluginGroup::UT_CpCallsPluginGroup
+ */
+UT_CpCallsPluginGroup::UT_CpCallsPluginGroup() 
+    : m_callspluginGroup(NULL)
+{
+
+}
+
+/*!
+  UT_CpCallsPluginGroup::~UT_CpCallsPluginGroup
+ */
+UT_CpCallsPluginGroup::~UT_CpCallsPluginGroup()
+{
+    delete m_callspluginGroup;
+}
+
+/*!
+  UT_CpCallsPluginGroup::init
+ */
+void UT_CpCallsPluginGroup::init()
+{
+    initialize();
+    
+    CpItemDataHelper itemDataHelper;
+    CPsetContainer cont;
+    PSetCallWaitingWrapper waitingWrapper(cont);
+    
+    EXPECT(PSetWrapper::callWaitingWrapper).returns(&waitingWrapper);
+    
+    static bool b=0;//CenrepKeyValueOff;
+    if (b==0) {
+        b=1;//CenrepKeyValueOn
+    } else {
+        b=0;
+    }
+    EXPECT(CpSettingsWrapper::showCallDuration).returns(b);
+    
+    static int i=0;//No Errors
+    if (i==0) {
+        i=1;//Error
+    } else {
+        i=0;
+    }
+    EXPECT(SsSettingsWrapper::get).returns(i); 
+    
+    EXPECT(CpSettingsWrapper::readSoftRejectText);
+
+    if (qstrcmp(QTest::currentTestFunction(), 
+        "t_handleCallWaitingGetStatusDistinguishEnabled") == 0) {
+        EXPECT(
+            CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled)
+            .returns(true);
+    }
+    
+    m_callspluginGroup = new CpCallsPluginGroup(itemDataHelper);
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_showCallDurationStateChanged
+ */
+void UT_CpCallsPluginGroup::t_showCallDurationStateChanged()
+{
+    int iRet=0;
+    
+    EXPECT(CpSettingsWrapper::setShowCallDuration).returns(iRet);
+    m_callspluginGroup->showCallDurationStateChanged();
+    
+    EXPECT(CpSettingsWrapper::setShowCallDuration).returns(iRet);
+    m_callspluginGroup->showCallDurationStateChanged();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_callWaitingCurrentIndexChanged
+ */
+void UT_CpCallsPluginGroup::t_callWaitingCurrentIndexChanged()
+{
+    QList<unsigned char> basicServiceGroupIds;
+
+    // check status case
+    EXPECT(PSetCallWaitingWrapper::getCallWaitingStatus);
+    m_callspluginGroup->callWaitingCurrentIndexChanged();
+
+    // active case
+    m_callspluginGroup->handleCallWaitingGetStatus(
+        PSetCallWaitingWrapper::StatusActive, basicServiceGroupIds);
+    EXPECT(PSetCallWaitingWrapper::setCallWaiting);
+    m_callspluginGroup->callWaitingCurrentIndexChanged();
+
+    // deactive case
+    m_callspluginGroup->handleCallWaitingGetStatus(
+        PSetCallWaitingWrapper::StatusDisabled, basicServiceGroupIds);
+    EXPECT(PSetCallWaitingWrapper::setCallWaiting);
+    m_callspluginGroup->callWaitingCurrentIndexChanged();
+
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_cliCurrentIndexChanged
+ */
+void UT_CpCallsPluginGroup::t_cliCurrentIndexChanged()
+{
+    EXPECT(SsSettingsWrapper::set);
+    m_callspluginGroup->cliCurrentIndexChanged(1);
+    
+    QVERIFY(verify());
+    reset();
+    
+    //Do nothing, index is out of range
+    EXPECT(PSetCallWaitingWrapper::setCallWaiting).times(0);
+    m_callspluginGroup->cliCurrentIndexChanged(-1);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_handleCallWaitingChanged
+ */
+void UT_CpCallsPluginGroup::t_handleCallWaitingChanged()
+{
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    m_callspluginGroup->handleCallWaitingChanged(
+        PSetCallWaitingWrapper::ActivateCallWaiting , 0);
+    
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    m_callspluginGroup->handleCallWaitingChanged(
+        PSetCallWaitingWrapper::DeactivateCallWaiting, 0);
+    
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    m_callspluginGroup->handleCallWaitingChanged(
+        PSetCallWaitingWrapper::CheckCallWaitingStatus, 0);
+    
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    m_callspluginGroup->handleCallWaitingChanged(
+        PSetCallWaitingWrapper::DeactivateCallWaiting , -1);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_handleCallWaitingRequesting
+ */
+void UT_CpCallsPluginGroup::t_handleCallWaitingRequesting()
+{
+    EXPECT(CpPhoneNotes::cancelNote);
+    m_callspluginGroup->handleCallWaitingRequesting( false, true ); 
+    
+    EXPECT(CpPhoneNotes::showGlobalProgressNote);
+    m_callspluginGroup->handleCallWaitingRequesting( true, false );
+    
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote);
+//    m_callspluginGroup->handleCallWaitingRequesting( true, true );
+
+//    QVERIFY(verify());
+    reset();
+    
+    EXPECT(CpPhoneNotes::cancelNote).times(0);
+    EXPECT(CpPhoneNotes::showGlobalProgressNote).times(0);
+    m_callspluginGroup->handleCallWaitingRequesting( false, false );
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_handleCallWaitingError
+ */
+void UT_CpCallsPluginGroup::t_handleCallWaitingError()
+{
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalErrorNote);
+    m_callspluginGroup->handleCallWaitingError( -1 );
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_softRejectTextChanged
+ */
+void UT_CpCallsPluginGroup::t_softRejectTextChanged()
+{
+    int iRet=0;
+    EXPECT(CpSettingsWrapper::writeSoftRejectText).returns(iRet);
+    m_callspluginGroup->softRejectTextChanged();
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_handleCallWaitingGetStatus
+ */
+void UT_CpCallsPluginGroup::t_handleCallWaitingGetStatus()
+{
+    QList<unsigned char> basicServiceGroupIds;
+    
+    EXPECT(CpPhoneNotes::cancelNote);
+    m_callspluginGroup->handleCallWaitingGetStatus(
+        PSetCallWaitingWrapper::StatusNotProvisioned, basicServiceGroupIds);
+    
+    EXPECT(CpPhoneNotes::cancelNote);
+    m_callspluginGroup->handleCallWaitingGetStatus(
+        PSetCallWaitingWrapper::StatusActive, basicServiceGroupIds);
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_handleCallWaitingGetStatusDistinguishEnabled
+ */
+void UT_CpCallsPluginGroup::t_handleCallWaitingGetStatusDistinguishEnabled()
+{
+    QList<unsigned char> basicServiceGroupIds;
+    
+    EXPECT(CpPhoneNotes::cancelNote);
+    EXPECT(CpPhoneNotes::showGlobalNote);
+    m_callspluginGroup->handleCallWaitingGetStatus(
+        PSetCallWaitingWrapper::StatusNotProvisioned, basicServiceGroupIds);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpCallsPluginGroup::cleanup
+ */
+void UT_CpCallsPluginGroup::cleanup()
+{
+    reset();
+    
+    delete m_callspluginGroup;
+    m_callspluginGroup = NULL;
+}
+
+/*!
+  UT_CpCallsPluginGroup::t_memleak
+ */
+void UT_CpCallsPluginGroup::t_memleak()
+{
+    
+}
+
+QTEST_MAIN_S60(UT_CpCallsPluginGroup)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.h	Fri Jun 04 10:19:18 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 UT_CALLSPLUGINGROUP_H
+#define UT_CALLSPLUGINGROUP_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+
+class CpCallsPluginGroup;
+
+class UT_CpCallsPluginGroup : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpCallsPluginGroup();
+    ~UT_CpCallsPluginGroup();
+    
+private slots:
+
+    void init();
+
+    void t_showCallDurationStateChanged();
+    
+    void t_callWaitingCurrentIndexChanged();
+    
+    void t_cliCurrentIndexChanged();
+    
+    void t_handleCallWaitingChanged();
+    
+    void t_handleCallWaitingRequesting();
+    
+    void t_handleCallWaitingError();
+    
+    void t_softRejectTextChanged();
+    
+    void t_handleCallWaitingGetStatus();
+    
+    void t_handleCallWaitingGetStatusDistinguishEnabled();
+    
+    void cleanup();
+    
+    void t_memleak();
+    
+private:
+    CpCallsPluginGroup *m_callspluginGroup;
+
+};
+
+#endif // UT_CALLSPLUGINGROUP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/callsplugin/tsrc/ut_callsplugingroup/ut_callsplugingroup.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+
+
+
+
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH += ../../../inc
+INCLUDEPATH += ../../../cptelephonyutils/inc
+INCLUDEPATH += /sf/mw/phonesrv/cellular/telephonysettings/xqbindings/psetwrapper/src
+
+
+DEFINES += BUILD_CALLSPLUGIN BUILD_CPTELEPHONYUTILS BUILD_PSETWRAPPER BUILD_SSSETTINGSWRAPPER
+
+QT -= gui
+QT += testlib
+
+symbian: { 
+    CONFIG += no_icon
+    INCLUDEPATH += /epoc32/include/mw/QtTest \
+        /epoc32/include/platform/mw \
+        /epoc32/include/mw/qt
+    LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework 
+        }
+    
+# test code
+HEADERS += ut_callsplugingroup.h
+SOURCES += ut_callsplugingroup.cpp 
+    
+# code to be tested
+HEADERS += ../../src/cpcallsplugin.h \
+           ../../src/cpcallsplugingroup.h \
+           ../../../cptelephonyutils/inc/cpphonenotes.h \
+           ../../../cptelephonyutils/inc/cpplugincommon.h \
+           /epoc32/include/platform/mw/psetwrapper.h \
+           /epoc32/include/platform/mw/psetcliwrapper.h \
+           /epoc32/include/platform/mw/sssettingswrapper.h \
+           /epoc32/include/platform/mw/psetcallwaitingwrapper.h \
+           /epoc32/include/platform/mw/psetcalldivertingwrapper.h \
+           /epoc32/include/platform/mw/psetnetworkwrapper.h             
+
+    
+SOURCES += ../../src/cpcallsplugingroup.cpp
+    
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpcallsplugin.cpp \
+           ../../../tsrc/mocks/mock_cpphonenotes.cpp \
+           ../../../tsrc/mocks/mock_cpplugincommon.cpp \
+           ../../../tsrc/mocks/mock_psetcalldivertingwrapper.cpp \
+           ../../../tsrc/mocks/mock_psetcallwaitingwrapper.cpp \
+           ../../../tsrc/mocks/mock_psetcliwrapper.cpp \
+           ../../../tsrc/mocks/mock_psetnetworkwrapper.cpp \
+           ../../../tsrc/mocks/mock_psetwrapper.cpp \
+           ../../../tsrc/mocks/mock_sssettingswrapper.cpp \
+           ../../../tsrc/mocks/mock_psetcliwrapper_p.cpp \
+           ../../../tsrc/mocks/mock_psetcallwaitingwrapper_p.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pri	Fri Jun 04 10:19:18 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: 
+#
+
+# Input
+HEADERS += src/cellulardatasettings.h \
+           src/cellulardatasettings_s60_p.h \
+           src/cpnetworkplugin.h \
+           src/cpnetworkpluginview.h \
+           src/cpnetworkpluginform.h
+
+SOURCES += src/cellulardatasettings.cpp \
+           src/cellulardatasettings_s60.cpp \
+           src/cpnetworkplugin.cpp \
+           src/cpnetworkpluginview.cpp \
+           src/cpnetworkpluginform.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/cpnetworkplugin.pro	Fri Jun 04 10:19:18 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: 
+#
+
+TEMPLATE = lib
+TARGET = cpnetworkplugin
+CONFIG += hb plugin
+INCLUDEPATH += ../cptelephonyutils/inc 
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+RCC_DIR = rcc
+
+TRANSLATIONS = telephone_cp.ts
+
+LIBS += -lcpframework \
+        -lpsetwrapper \
+        -lcptelephonyutils
+
+symbian*::LIBS += -lcmmanager
+
+include(../cpplugincommon.pri)
+include (cpnetworkplugin.pri)
+
+symbian: { 
+    TARGET.UID3 = 0X20029F24
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,113 @@
+/*
+* 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:
+*/
+
+// System includes
+
+// User includes
+
+#include "cellulardatasettings.h"
+#include "cellulardatasettings_s60_p.h"
+#include "cppluginlogging.h"
+
+/*!
+    \class CellularDataSettings
+    \brief Class for maintaining and updating the Cellular Data Settings.
+
+*/
+
+// External function prototypes
+
+// Local constants
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor.
+*/
+
+CellularDataSettings::CellularDataSettings() :
+    QObject(),
+    d_ptr(new CellularDataSettingsPrivate(this))
+{
+    DPRINT;
+}
+
+/*!
+    Destructor.
+*/
+
+CellularDataSettings::~CellularDataSettings()
+{
+    DPRINT << ": IN";
+    
+    delete d_ptr;
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    Getter for setting "Cellular data usage in home network".
+*/
+
+int CellularDataSettings::dataUseHome()
+{
+    DPRINT;
+    
+    return d_ptr->dataUseHome();
+}
+
+/*!
+    Setter for setting "Cellular data usage in home network".
+*/
+
+void CellularDataSettings::setDataUseHome(int value)
+{
+    DPRINT << ": IN";
+    
+    // The value must be valid
+    Q_ASSERT(value <= DataUsageHomeWlanOnly);
+    d_ptr->setDataUseHome(value);
+    
+    DPRINT << ": OUT";
+}
+    
+/*!
+    Getter for setting "Cellular data usage when roaming".
+*/
+
+int CellularDataSettings::dataUseRoam()
+{
+    DPRINT;
+    
+    return d_ptr->dataUseRoam();
+}
+
+/*!
+    Getter for setting "Cellular data usage when roaming".
+*/
+
+void CellularDataSettings::setDataUseRoam(int value)
+{
+    DPRINT << ": IN";
+    
+    // The value must be valid
+    Q_ASSERT(value <= DataUsageAbroadWlanOnly);
+    d_ptr->setDataUseRoam(value);
+    
+    DPRINT << ": OUT";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,90 @@
+/*
+* 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 CELLULARDATASETTINGS_H
+#define CELLULARDATASETTINGS_H
+
+// System includes
+
+#include <QObject>
+
+// User includes
+
+// Forward declarations
+
+class CellularDataSettingsPrivate;
+
+// External data types
+
+// Constants
+
+// Class declaration
+
+class CellularDataSettings : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    // Data types
+    
+    // Setting values for "Data usage in home network"
+    enum DataUsageHome {
+        DataUsageHomeAutomatic = 0,     // These values must match the indexes in dropdown menu
+        DataUsageHomeConfirm,
+        DataUsageHomeWlanOnly
+    };
+    
+    // Setting values for "Data usage when roaming"
+    enum DataUsageAbroad {
+        DataUsageAbroadAutomatic = 0,   // These values must match the indexes in dropdown menu
+        DataUsageAbroadConfirm,
+        DataUsageAbroadWlanOnly
+    };
+
+    explicit CellularDataSettings();
+    virtual ~CellularDataSettings();
+
+    int dataUseHome();
+    void setDataUseHome(int value);
+    
+    int dataUseRoam();
+    void setDataUseRoam(int value);
+
+signals:
+
+public slots:
+
+protected:
+
+protected slots:
+
+private:
+
+    Q_DISABLE_COPY(CellularDataSettings)
+
+private slots:
+
+private: // data
+
+    // Friend classes
+
+    // Private implementation
+    CellularDataSettingsPrivate *d_ptr;
+};
+
+#endif // CELLULARDATASETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,221 @@
+/*
+* 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:
+*/
+
+// System includes
+
+#include "cmmanager.h"
+
+// User includes
+
+#include "cellulardatasettings.h"
+#include "cellulardatasettings_s60_p.h"
+#include "cppluginlogging.h"
+
+// External function prototypes
+
+// Local constants
+
+// ======== LOCAL FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor.
+*/
+
+CellularDataSettingsPrivate::CellularDataSettingsPrivate(CellularDataSettings *q_pointer) :
+    q_ptr(q_pointer)
+{
+    DPRINT;
+}
+
+/*!
+    Destructor.
+*/
+
+CellularDataSettingsPrivate::~CellularDataSettingsPrivate()
+{
+    DPRINT;
+}
+
+/*!
+    Getter for setting "Cellular data usage in home network".
+*/
+
+int CellularDataSettingsPrivate::dataUseHome()
+{
+    DPRINT << ": IN";
+    
+    int result = 0;
+
+    // Read the setting
+    TCmGenConnSettings settings;
+    readSettings(&settings);
+    
+    // Map the settings read result
+    switch (settings.iCellularDataUsageHome) {
+    case ECmCellularDataUsageAutomatic:
+        result = CellularDataSettings::DataUsageHomeAutomatic;
+        break;
+
+    case ECmCellularDataUsageConfirm:
+        result = CellularDataSettings::DataUsageHomeConfirm;
+        break;
+
+    case ECmCellularDataUsageDisabled:
+        result = CellularDataSettings::DataUsageHomeWlanOnly;
+        break;
+    }
+    
+    DPRINT << ": OUT";
+    
+    return result;
+}
+
+/*!
+    Setter for setting "Cellular data usage in home network".
+*/
+
+void CellularDataSettingsPrivate::setDataUseHome(int value)
+{
+    DPRINT << ": IN";
+    
+    TCmGenConnSettings settings;
+    
+    readSettings(&settings);    
+    switch (value) {
+    case CellularDataSettings::DataUsageHomeAutomatic:
+        settings.iCellularDataUsageHome = ECmCellularDataUsageAutomatic; 
+        break;
+
+    case CellularDataSettings::DataUsageHomeConfirm:
+        settings.iCellularDataUsageHome = ECmCellularDataUsageConfirm;
+        break;
+
+    case CellularDataSettings::DataUsageHomeWlanOnly:
+        settings.iCellularDataUsageHome = ECmCellularDataUsageDisabled;
+        break;
+    }
+    writeSettings(&settings);
+    
+    DPRINT << ": OUT";
+}
+    
+/*!
+    Getter for setting "Cellular data usage when roaming".
+*/
+
+int CellularDataSettingsPrivate::dataUseRoam()
+{
+    DPRINT << ": IN";
+    
+    int result = 0;
+
+    // Read the setting
+    TCmGenConnSettings settings;
+    readSettings(&settings);
+    
+    // Map the settings read result
+    switch (settings.iCellularDataUsageVisitor) {
+    case ECmCellularDataUsageAutomatic:
+        result = CellularDataSettings::DataUsageAbroadAutomatic;
+        break;
+        
+    case ECmCellularDataUsageConfirm:
+        result = CellularDataSettings::DataUsageAbroadConfirm;
+        break;
+        
+    case ECmCellularDataUsageDisabled:
+        result = CellularDataSettings::DataUsageAbroadWlanOnly;
+        break;
+    }
+    
+    DPRINT << ": OUT";
+    
+    return result;
+}
+
+/*!
+    Getter for setting "Cellular data usage when roaming".
+*/
+
+void CellularDataSettingsPrivate::setDataUseRoam(int value)
+{
+    DPRINT << ": IN";
+    
+    TCmGenConnSettings settings;
+    
+    readSettings(&settings);    
+    switch (value) {
+    case CellularDataSettings::DataUsageAbroadAutomatic:
+        settings.iCellularDataUsageVisitor = ECmCellularDataUsageAutomatic; 
+        break;
+
+    case CellularDataSettings::DataUsageAbroadConfirm:
+        settings.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm;
+        break;
+
+    case CellularDataSettings::DataUsageAbroadWlanOnly:
+        settings.iCellularDataUsageVisitor = ECmCellularDataUsageDisabled;
+        break;
+    }
+    writeSettings(&settings);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    Cellular data settings reading from CM Manager.
+*/
+
+void CellularDataSettingsPrivate::readSettings(TCmGenConnSettings *settings)
+{
+    DPRINT << ": IN";
+    
+    QT_TRAP_THROWING(
+        RCmManager CmManager;
+        CmManager.CreateTablesAndOpenL();
+        CleanupClosePushL(CmManager); 
+        CmManager.ReadGenConnSettingsL(*settings);
+        CleanupStack::PopAndDestroy(1));
+    
+    DPRINT << ": Read: iCellularDataUsageHome= " << settings->iCellularDataUsageHome;
+    DPRINT << ": Read: iCellularDataUsageVisitor= " << settings->iCellularDataUsageVisitor;
+    
+    DPRINT << ": OUT";
+    
+}
+
+/*!
+    Cellular data settings writing to CM Manager.
+*/
+
+void CellularDataSettingsPrivate::writeSettings(TCmGenConnSettings *settings)
+{
+    DPRINT << ": IN";
+    
+    DPRINT << ": Write: iCellularDataUsageHome= " << settings->iCellularDataUsageHome;
+    DPRINT << ": Write: iCellularDataUsageVisitor=" << settings->iCellularDataUsageVisitor;
+
+    QT_TRAP_THROWING(
+        RCmManager CmManager;
+        CmManager.CreateTablesAndOpenL();
+        CleanupClosePushL(CmManager); 
+        CmManager.WriteGenConnSettingsL(*settings);
+        CleanupStack::PopAndDestroy(1););
+    
+    DPRINT << ": OUT";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cellulardatasettings_s60_p.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* 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 CELLULARDATASETTINGS_S60_P_H
+#define CELLULARDATASETTINGS_S60_P_H
+
+// System includes
+
+// User includes
+
+// Forward declarations
+
+class CellularDataSettings;
+class TCmGenConnSettings;
+
+// External data types
+
+// Constants
+
+// Class declaration
+
+class CellularDataSettingsPrivate
+{
+
+public:
+
+    // Data types
+    
+    explicit CellularDataSettingsPrivate(CellularDataSettings *q_pointer);
+    virtual ~CellularDataSettingsPrivate();
+
+    int dataUseHome();
+    void setDataUseHome(int value);
+    
+    int dataUseRoam();
+    void setDataUseRoam(int value);
+
+signals:
+
+public slots:
+
+protected:
+
+protected slots:
+
+private:
+
+    Q_DISABLE_COPY(CellularDataSettingsPrivate)
+
+    void readSettings(TCmGenConnSettings *settings);
+    
+    void writeSettings(TCmGenConnSettings *settings);
+
+private slots:
+
+private: // data
+
+    // Friend classes
+
+    // Public implementation pointer
+    CellularDataSettings *q_ptr;
+};
+
+#endif // CELLULARDATASETTINGS_S60_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.cpp	Fri Jun 04 10:19:18 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 <cpsettingformentryitemdataimpl.h>
+#include "cpnetworkplugin.h"
+#include "cpnetworkpluginview.h"
+#include "cppluginlogging.h"
+
+
+/*!
+  CpNetworkPlugin::CpNetworkPlugin
+ */
+CpNetworkPlugin::CpNetworkPlugin() : 
+    QObject(0),
+    m_localisation(0)
+{
+    INSTALL_TRACE_MSG_HANDLER;
+    DPRINT << ": IN";
+    
+    // Set scoped pointer 
+    m_localisation.reset(new CpPhoneLocalisation); 
+    
+    // Install required translations
+    m_localisation->installTranslator(
+            CpPhoneLocalisation::
+            TranslationFileCommon);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPlugin::~CpNetworkPlugin
+ */
+CpNetworkPlugin::~CpNetworkPlugin()
+{
+    DPRINT;
+    UNINSTALL_TRACE_MSG_HANDLER;
+}
+
+
+/*!
+  CpNetworkPlugin::createSettingFormItemData
+ */
+QList<CpSettingFormItemData*> CpNetworkPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+{
+    DPRINT;
+
+    QList<CpSettingFormItemData*> ret;
+    ret.append(new CpSettingFormEntryItemDataImpl<CpNetworkPluginView>(
+            itemDataHelper,
+            hbTrId("txt_cp_dblist_mobile_network"),
+            hbTrId("")));
+    return ret;
+}
+
+
+Q_EXPORT_PLUGIN2(CpNetworkPlugin, CpNetworkPlugin);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkplugin.h	Fri Jun 04 10:19:18 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 CPNETWORKPLUGIN_H
+#define CPNETWORKPLUGIN_H
+
+#include <qobject.h>
+#include <cpplugininterface.h>
+#include "cpphonelocalisation.h"
+
+
+class CpNetworkPlugin : public QObject, public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+    
+public:
+    
+    CpNetworkPlugin();
+    
+    ~CpNetworkPlugin();
+    
+    /**
+     * From CpPluginInterface
+     * @see CpPluginInterface.
+     */
+    QList<CpSettingFormItemData*> createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const;
+
+private:
+    
+    QScopedPointer<CpPhoneLocalisation> m_localisation; 
+};
+
+#endif  // CPNETWORKPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,877 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hbdataformviewitem.h>
+#include <hbdialog.h>
+#include <hbaction.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hblabel.h>
+#include <cpsettingformitemdata.h>
+#include <psetwrapper.h>
+
+#include "cpnetworkpluginform.h"
+#include "cpplugincommon.h"
+#include "cppluginlogging.h"
+#include "cpphonenotes.h"
+#include "cellulardatasettings.h"
+
+/*!
+  CpNetworkPluginForm::CpNetworkPluginForm
+ */
+CpNetworkPluginForm::CpNetworkPluginForm(QGraphicsItem *parent) :
+    HbDataForm(parent),
+    m_activeNoteId(0),
+    m_activeProgressNoteId(0),
+    m_pSetWrapper(NULL),
+    m_cpSettingsWrapper(NULL),
+    mCellularSettings(),
+    m_dialog(NULL)
+{
+    DPRINT << ": IN";
+    
+    setHeading(hbTrId("txt_cp_subhead_mobile_network"));
+    
+    QScopedPointer<PSetWrapper> pSetWrapperGuard(new PSetWrapper);
+    m_psetNetworkWrapper = &pSetWrapperGuard->networkWrapper();
+    mCellularSettings = QSharedPointer<CellularDataSettings>(new CellularDataSettings);
+    connectToNetworkWrapper(*m_psetNetworkWrapper);
+    connectToPhoneNotes(*CpPhoneNotes::instance());
+    
+    QScopedPointer<HbDataFormModel> model(new HbDataFormModel);
+    QScopedPointer<CpSettingsWrapper> cpSettingsWrapperGuard(new CpSettingsWrapper);
+
+    // #1 Read Network mode value from Cenrep
+    model->appendDataFormItem(createNetworkModeItem());
+    // #2 Use phone settings for operator selection
+    model->appendDataFormItem(createOperatorSelectionItem());
+    // Home network cellular data usage
+    model->appendDataFormItem(createHomeDataUsageItem());
+    // Cellular network data usage when roaming
+    model->appendDataFormItem(createRoamDataUsageItem());
+    setModel(model.take());
+    m_pSetWrapper = pSetWrapperGuard.take();
+    m_cpSettingsWrapper = cpSettingsWrapperGuard.take();
+
+    if(!isPhoneOnLine()) {
+        DPRINT << "offline, set dimmed";
+        m_NetworkOperatorSelectionItemData->setEnabled(false);
+    }
+
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::~CpNetworkPluginForm
+ */
+CpNetworkPluginForm::~CpNetworkPluginForm()
+{
+    DPRINT << ": IN";
+    
+    delete m_pSetWrapper;
+    delete m_cpSettingsWrapper;
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::createNetworkModeItem
+  */
+HbDataFormModelItem *CpNetworkPluginForm::createNetworkModeItem()
+{
+    // #1A Read network mode value from Cenrep 
+    DPRINT << ": IN";
+
+    m_NetworkModeOptionsItemData = new CpSettingFormItemData(
+        HbDataFormModelItem::ComboBoxItem, 
+        hbTrId("txt_cp_setlabel_network_mode"), 
+        NULL );
+    QScopedPointer<CpSettingFormItemData> settingFormItemGuard(
+        m_NetworkModeOptionsItemData);
+    
+    mNetworkModeOptions << hbTrId("txt_cp_setlabel_network_mode_val_dual_mode")
+                        << hbTrId("txt_cp_setlabel_network_mode_val_umts")
+                        << hbTrId("txt_cp_setlabel_network_mode_val_gsm");
+    m_NetworkModeOptionsItemData->setContentWidgetData(
+        "items", QVariant(mNetworkModeOptions));
+    
+    QObject::connect(
+        m_psetNetworkWrapper, 
+        SIGNAL(networkAccessModeGot(int)),
+        this, 
+        SLOT(networkAccessModeGot(int)));
+    QObject::connect(
+        m_psetNetworkWrapper, 
+        SIGNAL(availableNetworksGot(QList<PSetNetworkWrapper::NetworkInfo*> &)),
+        this, 
+        SLOT(availableNetworksGot(QList<PSetNetworkWrapper::NetworkInfo*> &)));
+    
+    m_psetNetworkWrapper->getNetworkAccessMode();
+    
+    addConnection(
+        m_NetworkModeOptionsItemData, 
+        SIGNAL(currentIndexChanged(int)),
+        this, 
+        SLOT(networkModeStateChanged(int)));
+    
+    settingFormItemGuard.take();
+    DPRINT << ": OUT";
+    return m_NetworkModeOptionsItemData;
+}
+
+
+/*!
+  CpNetworkPluginForm::createOperatorSelectionItem
+  */
+HbDataFormModelItem *CpNetworkPluginForm::createOperatorSelectionItem()
+{
+    // #2A Use phone settings for operator selection
+    DPRINT << ": IN";
+    
+    m_NetworkOperatorSelectionItemData = new CpSettingFormItemData(
+        HbDataFormModelItem::ToggleValueItem, 
+        hbTrId("txt_cp_setlabel_operator_selection"), 
+        NULL);
+    QScopedPointer<CpSettingFormItemData> settingFormItemGuard(
+        m_NetworkOperatorSelectionItemData);
+    
+    PSetNetworkWrapper::NetworkSelectionMode mode;
+    PSetNetworkWrapper::ErrorCode err = 
+        m_psetNetworkWrapper->getNetworkSelectionMode(mode);
+    if(err == PSetNetworkWrapper::ErrNoError) {
+        switch (mode) {
+            case PSetNetworkWrapper::SelectionModeAutomatic: 
+                m_NetworkOperatorSelectionItemData->setContentWidgetData(
+                    "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic")));
+                break;
+            case PSetNetworkWrapper::SelectionModeManual: 
+                m_NetworkOperatorSelectionItemData->setContentWidgetData(
+                    "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual")));
+                break;
+            default:
+                break;
+        }
+    }
+    
+    addConnection(
+        m_NetworkOperatorSelectionItemData, SIGNAL(clicked(bool) ),
+        this, SLOT(operatorSelectionStateChanged(bool)));
+    
+    settingFormItemGuard.take();
+    DPRINT << ": OUT";
+    return m_NetworkOperatorSelectionItemData;
+}
+
+/*!
+  CpNetworkPluginForm::createHomeDataUsageItem
+  */
+HbDataFormModelItem *CpNetworkPluginForm::createHomeDataUsageItem()
+{
+    DPRINT << ": IN";
+    
+    mCellularUseHomeSelectionItemData = new CpSettingFormItemData(
+        HbDataFormModelItem::ComboBoxItem, 
+        hbTrId("txt_cp_setlabel_data_usage_in_home_network"), 
+        NULL);
+    QScopedPointer<CpSettingFormItemData> settingFormItemGuard(
+        mCellularUseHomeSelectionItemData);
+
+    // Populate the dropdown with selection items
+    mCellularUseHomeOptions
+        << hbTrId("txt_cp_setlabel_data_usage_in_val_automatic")
+        << hbTrId("txt_cp_setlabel_data_usage_in_val_confirm")
+        << hbTrId("txt_cp_setlabel_data_usage_in_val_disabled");
+    mCellularUseHomeSelectionItemData->setContentWidgetData(
+        "items",
+        QVariant(mCellularUseHomeOptions));
+
+    // Set initial selection based on current setting
+    mCellularUseHomeSelectionItemData->setContentWidgetData(
+        "currentIndex",
+        mCellularSettings->dataUseHome());      // NOTE: Indexes must match!
+
+    addConnection(
+        mCellularUseHomeSelectionItemData, 
+        SIGNAL(currentIndexChanged(int)),
+        this, 
+        SLOT(cellularDataUseHomeStateChanged(int)));
+    
+    settingFormItemGuard.take();
+    DPRINT << ": OUT";
+    return mCellularUseHomeSelectionItemData;
+}
+
+/*!
+  CpNetworkPluginForm::cellularDataUseHomeStateChanged
+  */
+void CpNetworkPluginForm::cellularDataUseHomeStateChanged(int index)
+{
+    DPRINT << ": IN : index: " << index;
+
+    mCellularSettings->setDataUseHome(index);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpNetworkPluginForm::createRoamDataUsageItem
+  */
+HbDataFormModelItem *CpNetworkPluginForm::createRoamDataUsageItem()
+{
+    DPRINT << ": IN";
+    
+    mCellularUseRoamSelectionItemData = new CpSettingFormItemData(
+        HbDataFormModelItem::ComboBoxItem, 
+        hbTrId("txt_cp_setlabel_data_usage_when_roaming"), 
+        NULL);
+    QScopedPointer<CpSettingFormItemData> settingFormItemGuard(
+        mCellularUseRoamSelectionItemData);
+
+    // Populate the dropdown with selection items
+    mCellularUseRoamOptions
+        << hbTrId("txt_cp_setlabel_data_usage_when_val_automatic")
+        << hbTrId("txt_cp_setlabel_data_usage_when_val_confirm")
+        << hbTrId("txt_cp_setlabel_data_usage_when_val_disabled");
+    mCellularUseRoamSelectionItemData->setContentWidgetData(
+        "items",
+        QVariant(mCellularUseRoamOptions));
+
+    // Set initial selection based on current setting
+    mCellularUseRoamSelectionItemData->setContentWidgetData(
+        "currentIndex",
+        mCellularSettings->dataUseRoam());      // NOTE: Indexes must match!
+
+    addConnection(
+        mCellularUseRoamSelectionItemData, 
+        SIGNAL(currentIndexChanged(int)),
+        this, 
+        SLOT(cellularDataUseRoamStateChanged(int)));
+    
+    settingFormItemGuard.take();
+    DPRINT << ": OUT";
+    return mCellularUseRoamSelectionItemData;
+}
+
+/*!
+  CpNetworkPluginForm::cellularDataUseRoamStateChanged
+  */
+void CpNetworkPluginForm::cellularDataUseRoamStateChanged(int index)
+{
+    DPRINT << ": IN : index: " << index;
+
+    mCellularSettings->setDataUseRoam(index);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpNetworkPluginForm::networkModeStateChanged
+  */
+void CpNetworkPluginForm::networkModeStateChanged(int index)
+{
+    // #1C network mode changed
+    DPRINT << ": IN : index: " << index;
+    
+    if(isPhoneOnLine()) {
+        if(index == 0) {
+            dualModeSelection();
+        } else if(index == 1) {
+            umtsSelection();
+        } else if(index == 2) {
+            gsmSelection();
+        }
+    } else {
+        // offline mode.
+        emit showGlobalNote(
+            m_activeNoteId, 
+            emit hbTrId("Operation not possible in Off-line mode"), 
+            HbMessageBox::MessageTypeInformation);
+    }
+        
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::operatorSelectionStateChanged
+  */
+void CpNetworkPluginForm::operatorSelectionStateChanged(bool)
+{
+    // #2C operator selection mode changed
+    DPRINT << ": IN ";
+    
+    if (isPhoneOnLine()) {
+        PSetNetworkWrapper::NetworkSelectionMode mode;
+        m_psetNetworkWrapper->getNetworkSelectionMode(mode);
+        switch (mode) {
+            case PSetNetworkWrapper::SelectionModeAutomatic: 
+                manualOperatorSelection();
+                m_NetworkOperatorSelectionItemData->setContentWidgetData(
+                    "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual")));
+                break;
+            case PSetNetworkWrapper::SelectionModeManual: 
+                automaticOperatorSelection();
+                m_NetworkOperatorSelectionItemData->setContentWidgetData(
+                    "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic")));
+                break;
+            default:
+                break;
+            }
+    } else {
+        // offline mode.
+        emit showGlobalNote(
+            m_activeNoteId, 
+            emit hbTrId("Operation not possible in Off-line mode"), 
+            HbMessageBox::MessageTypeInformation);
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::automaticOperatorSelection
+  */
+void CpNetworkPluginForm::automaticOperatorSelection()
+{
+    DPRINT << ": IN";
+    
+    PSetNetworkWrapper::NetworkInfo info;
+    info.m_mode = PSetNetworkWrapper::SelectionModeAutomatic;
+    m_psetNetworkWrapper->selectNetwork(info);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::manualOperatorSelection
+  */
+void CpNetworkPluginForm::manualOperatorSelection()
+{
+    DPRINT << ": IN";
+    
+    m_psetNetworkWrapper->getAvailableNetworks();
+        
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::dualModeSelection
+  */
+void CpNetworkPluginForm::dualModeSelection()
+{
+    DPRINT << ": IN";
+    
+    m_psetNetworkWrapper->setNetworkAccessMode(
+        PSetNetworkWrapper::AccessModeDual);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::umtsSelection
+  */
+void CpNetworkPluginForm::umtsSelection()
+{
+    DPRINT << ": IN";
+    
+    m_psetNetworkWrapper->setNetworkAccessMode(
+        PSetNetworkWrapper::AccessModeUmts);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::gsmSelection
+  */
+void CpNetworkPluginForm::gsmSelection()
+{
+    DPRINT << ": IN";
+    
+    m_psetNetworkWrapper->setNetworkAccessMode(
+        PSetNetworkWrapper::AccessModeGsm);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::networkAccessModeGot
+  */
+void CpNetworkPluginForm::networkAccessModeGot(
+    int mode)
+{
+    DPRINT << ": IN";
+    
+    switch (mode) {
+        case PSetNetworkWrapper::AccessModeDual: 
+            m_NetworkModeOptionsItemData->setContentWidgetData(
+                "currentIndex", 0);
+            break;
+        case PSetNetworkWrapper::AccessModeUmts: 
+            m_NetworkModeOptionsItemData->setContentWidgetData(
+                "currentIndex", 1);
+            break;
+        case PSetNetworkWrapper::AccessModeGsm: 
+            m_NetworkModeOptionsItemData->setContentWidgetData(
+                "currentIndex", 2);
+            break;
+        default:
+            break;
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::availableNetworksGot
+  */
+void CpNetworkPluginForm::availableNetworksGot(
+        QList<PSetNetworkWrapper::NetworkInfo*> &networkInfoList)
+{
+    DPRINT << ": IN";
+    
+    m_networkInfoList = &networkInfoList;
+    showManualSelectiondialog();
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::createDialog
+  */
+HbDialog* CpNetworkPluginForm::createDialog(const QString& heading) const
+{
+    DPRINT << ": IN";
+ 
+    HbDialog *dialog = new HbDialog();
+    dialog->setDismissPolicy(HbDialog::NoDismiss);
+    dialog->setTimeout(HbDialog::NoTimeout);
+    dialog->setHeadingWidget(new HbLabel(heading));
+    
+    DPRINT << ": OUT";
+    return dialog;
+}
+
+
+/*!
+  CpNetworkPluginForm::createDialog
+  */
+void CpNetworkPluginForm::addItemToListWidget(HbListWidget* w,
+        const QString& item, const int& data) const
+{
+    DPRINT << ": IN";
+    Q_ASSERT(w != 0);
+    
+    HbListWidgetItem* o = new HbListWidgetItem();
+    o->setText(item);
+    o->setData(data);
+    w->addItem(o);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::networkReqestFailed
+  */
+void CpNetworkPluginForm::networkReqestFailed(
+        PSetNetworkWrapper::ErrorCode error,
+        PSetNetworkWrapper::RequestType type)
+{
+    DPRINT << ": IN";
+    
+    QString text;
+    switch(error) {
+        case PSetNetworkWrapper::ErrCauseCallActive:
+            text = hbTrId("txt_cp_info_active_calls_must_be_disconnected_befo");
+            break;
+        case PSetNetworkWrapper::ErrNoNetworkService:
+            text = hbTrId("txt_cp_info_no_operators_found");
+            break;
+        case PSetNetworkWrapper::ErrOfflineOpNotAllowed:
+            text = hbTrId("Off-line, not allowed");
+            break;
+        case PSetNetworkWrapper::ErrNoNetworkAccess:
+            text = hbTrId("txt_cp_info_no_access_to_selected_operators_netwo");
+            break;
+        default:
+            break;
+    }
+    emit showGlobalNote(
+        m_activeNoteId, text, HbMessageBox::MessageTypeInformation);
+    
+    // Update UI
+    if(type == PSetNetworkWrapper::RequestSetNetworkMode) {
+       m_psetNetworkWrapper->getNetworkAccessMode();
+       }
+    else if(type == PSetNetworkWrapper::RequestSetNetwork && 
+            error == PSetNetworkWrapper::ErrNoNetworkAccess) {
+        showManualSelectiondialog();
+    }
+    else if(type == PSetNetworkWrapper::RequestSetNetwork ||
+            type == PSetNetworkWrapper::RequestSetNetworkAutomatic ||
+            type == PSetNetworkWrapper::RequestGetNetworkInfo) {
+        restoreUiSelection();
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::userCancel
+  */
+void CpNetworkPluginForm::userCancel()
+{
+    DPRINT << ": IN";
+    
+    m_psetNetworkWrapper->cancelRequest();
+    restoreUiSelection();
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::handleSearchingNetworks
+  */
+void CpNetworkPluginForm::handleSearchingNetworks(
+    PSetNetworkWrapper::RequestType &type)
+{
+    DPRINT << ": IN";
+    
+    if (type != PSetNetworkWrapper::RequestNone) {
+        QObject::connect(
+            CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()),
+            this, SLOT(userCancel()));
+        emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("txt_cp_info_updating"));
+    } else {
+        QObject::disconnect(
+            CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()),
+            this, SLOT(userCancel()));
+        emit cancelNote(m_activeProgressNoteId);
+        m_activeProgressNoteId = 0;
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::handleRequestingSelectedNetwork
+  */
+void CpNetworkPluginForm::handleRequestingSelectedNetwork(bool ongoing)
+{
+    DPRINT << ": IN";
+    
+    if (ongoing) {
+        QObject::connect(
+            CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()),
+            this, SLOT(userCancel()));
+        emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("Requesting"));
+    } else {
+        QObject::disconnect(
+            CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()),
+            this, SLOT(userCancel()));
+        emit cancelNote(m_activeProgressNoteId);
+        m_activeProgressNoteId = 0;
+    }
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::handleNetworkChanged
+  */
+void CpNetworkPluginForm::handleNetworkChanged(
+    PSetNetworkWrapper::NetworkInfo& currentInfo,
+    PSetNetworkWrapper::RegistrationStatus& status)
+{
+    DPRINT << ": IN";
+    
+    QString text;
+    switch (status){
+        case PSetNetworkWrapper::RegisteredOnHomeNetwork:
+            text = hbTrId("Home network selected");
+            break;
+        case PSetNetworkWrapper::RegisteredRoaming: {
+            text = hbTrId("Selected network: ");
+            text.append(networkName(currentInfo));
+        }
+            break; 
+    }
+    
+    emit showGlobalNote(
+        m_activeNoteId, text, HbMessageBox::MessageTypeInformation);
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::showManualSelectiondialog
+  */
+void CpNetworkPluginForm::showManualSelectiondialog()
+{
+    DPRINT << ": IN";
+    
+    QScopedPointer<HbDialog> dialog(
+        createDialog(hbTrId("txt_cp_title_select_operator")));
+    HbListWidget *list = new HbListWidget(dialog.data());
+    //then insert found networks
+    int itemsCount = m_networkInfoList->count();
+    for (int i = 0; i < itemsCount; i++) {
+        PSetNetworkWrapper::NetworkInfo *info = m_networkInfoList->at(i);
+        QString text = networkName(*info);
+        addItemToListWidget(list, text, i);
+        DPRINT << ":  " << info;
+    }
+    // Connect list item activation signal to close the popup
+    connect(
+        list, SIGNAL(activated(HbListWidgetItem*)), 
+        dialog.data(), SLOT(close()));
+    // Sets the "Cancel"-action/button
+    HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"));
+    dialog->addAction(cancelAction);
+    dialog->setContentWidget(list);
+    // Launch popup and handle the response
+    dialog->open(this, SLOT(finishedManualSelectiondialog(HbAction*)));
+    if (m_dialog) {
+        m_dialog->deleteLater();
+        m_dialog = NULL;
+    }
+    m_dialog = dialog.take();
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::finishedManualSelectiondialog.
+ */
+void CpNetworkPluginForm::finishedManualSelectiondialog(HbAction* action)
+{
+    DPRINT << ": IN";
+    
+    if (m_dialog) {
+        QList<QAction *> actionList = m_dialog->actions();
+        bool cancelAction = actionList.contains(action);
+        if (!cancelAction) {
+            // Update the view with selected text
+            QGraphicsWidget *contectWidget = m_dialog->contentWidget();
+            HbListWidget *list(NULL);
+            if (contectWidget) {
+                list = qobject_cast<HbListWidget *>(contectWidget);
+            }
+            if (list) {
+                int seletion = 0;
+                if(list->currentItem()) {
+                    seletion = list->currentItem()->data().toInt();
+                    DPRINT << ": seletion : " << seletion;
+                }
+                PSetNetworkWrapper::NetworkInfo param;
+                param.m_id.m_countryCode = 
+                    m_networkInfoList->at(seletion)->m_id.m_countryCode;
+                param.m_id.m_networkCode = 
+                    m_networkInfoList->at(seletion)->m_id.m_networkCode;
+                param.m_mode = PSetNetworkWrapper::SelectionModeManual;
+                DPRINT << ": m_countryCode : " << param.m_id.m_countryCode;
+                DPRINT << ": m_networkCode : " << param.m_id.m_networkCode;
+                DPRINT << ": m_mode : " << param.m_mode;
+                m_psetNetworkWrapper->selectNetwork(param);
+            }
+        } else {
+            DPRINT << ": Cancel";
+            m_psetNetworkWrapper->cancelRequest();
+            restoreUiSelection();
+        }
+        m_dialog->deleteLater();
+        m_dialog = NULL;
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpNetworkPluginForm::restoreUiSelection
+  */
+void CpNetworkPluginForm::restoreUiSelection()
+{
+    DPRINT << ": IN";
+    
+    removeConnection(
+        m_NetworkOperatorSelectionItemData, SIGNAL(currentIndexChanged(int)),
+        this, SLOT(operatorSelectionStateChanged(int)));
+    PSetNetworkWrapper::NetworkSelectionMode mode;
+    PSetNetworkWrapper::ErrorCode err = 
+        m_psetNetworkWrapper->getNetworkSelectionMode(mode);
+    if(err == PSetNetworkWrapper::ErrNoError) {
+        switch (mode) {
+            case PSetNetworkWrapper::SelectionModeAutomatic: 
+                m_NetworkOperatorSelectionItemData->setContentWidgetData(
+                    "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic")));
+                break;
+            case PSetNetworkWrapper::SelectionModeManual: 
+                m_NetworkOperatorSelectionItemData->setContentWidgetData(
+                    "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual")));
+                break;
+            default:
+                break;
+            }
+    }
+    addConnection(
+        m_NetworkOperatorSelectionItemData, SIGNAL(currentIndexChanged(int)),
+        this, SLOT(operatorSelectionStateChanged(int)));
+    
+    DPRINT << ": OUT";
+}
+
+
+/*!
+  CpNetworkPluginForm::networkName()
+  */
+QString CpNetworkPluginForm::networkName(
+    PSetNetworkWrapper::NetworkInfo &info)
+{
+    DPRINT << ": IN";
+    
+    QString text;
+    if (!info.m_longName.isEmpty())
+        {
+        text.append(info.m_longName);
+        }
+    else if (!info.m_shortName.isEmpty())
+        {
+        text.append(info.m_shortName);
+        }
+    else //network returned only ids
+        {
+        text.append(info.m_id.m_countryCode);
+        text.append(" ");
+        text.append(info.m_id.m_networkCode);
+        }
+    
+    DPRINT << ": OUT : " << text;
+    return text;
+}
+
+
+/*!
+  CpNetworkPluginForm::connectToNetworkWrapper
+ */
+void CpNetworkPluginForm::connectToNetworkWrapper(PSetNetworkWrapper &wrapper)
+{
+    QObject::connect(
+        &wrapper, 
+        SIGNAL(networkReqestFailed(
+            PSetNetworkWrapper::ErrorCode,PSetNetworkWrapper::RequestType)),
+        this, 
+        SLOT(networkReqestFailed(
+            PSetNetworkWrapper::ErrorCode,PSetNetworkWrapper::RequestType)));
+    
+    QObject::connect(
+        &wrapper, 
+        SIGNAL(searchingNetworks(PSetNetworkWrapper::RequestType &)),
+        this, 
+        SLOT(handleSearchingNetworks(PSetNetworkWrapper::RequestType &)));
+    
+    QObject::connect(
+        &wrapper, 
+        SIGNAL(requestingSelectedNetwork(bool)),
+        this, 
+        SLOT(handleRequestingSelectedNetwork(bool)));
+    
+    QObject::connect(
+        &wrapper, 
+        SIGNAL(networkChanged(
+            PSetNetworkWrapper::NetworkInfo&, 
+            PSetNetworkWrapper::RegistrationStatus&)),
+        this, 
+        SLOT(handleNetworkChanged(
+            PSetNetworkWrapper::NetworkInfo&, 
+            PSetNetworkWrapper::RegistrationStatus&)));
+}
+
+
+/*!
+  CpNetworkPluginForm::connectToPhoneNotes
+ */
+void CpNetworkPluginForm::connectToPhoneNotes(CpPhoneNotes &notes)
+{
+    QObject::connect(
+        this, 
+        SIGNAL(showGlobalProgressNote(int &, const QString&)),
+        &notes, 
+        SLOT(showGlobalProgressNote(int &, const QString&)));
+    
+    QObject::connect(
+        this, 
+        SIGNAL(showGlobalNote(
+            int &, const QString&, HbMessageBox::MessageBoxType)),
+        &notes, 
+        SLOT(showGlobalNote(
+            int &, const QString&, HbMessageBox::MessageBoxType)));
+    
+    QObject::connect(
+        this, 
+        SIGNAL(cancelNote(int)),
+        &notes, 
+        SLOT(cancelNote(int)));
+}
+
+/*!
+  CpNetworkPluginForm::isPhoneOnLine
+ */
+bool CpNetworkPluginForm::isPhoneOnLine()
+{
+    DPRINT << ": IN";
+    
+    bool onLine(true);
+    if (m_cpSettingsWrapper->isPhoneOffline()) {
+        onLine = false;
+    }
+    
+    DPRINT << ": OUT : onLine : " << onLine;
+    return onLine;
+}
+
+/*!
+  CpNetworkPluginForm::searchAvailableNetworks
+ */
+void CpNetworkPluginForm::searchAvailableNetworks()
+{
+    DPRINT << ": IN";
+    
+    m_psetNetworkWrapper->cancelRequest();
+    manualOperatorSelection();
+        
+    DPRINT << ": OUT";
+}
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 CPNETWORKPLUGINFORM_H
+#define CPNETWORKPLUGINFORM_H
+
+#include <hbdataform.h>
+#include <QStringList>
+#include <QSharedPointer>
+#include <psetnetworkwrapper.h>
+#include <hbmessagebox.h>
+
+class HbDataFormModelItem;
+class CpSettingsWrapper;
+class PSetWrapper;
+class HbListWidget;
+class PSetNetworkWrapper;
+class CpSettingFormItemData;
+class CpPhoneNotes;
+class CellularDataSettings;
+
+class CpNetworkPluginForm : public HbDataForm
+{
+    Q_OBJECT
+    
+public:
+    
+    explicit CpNetworkPluginForm(QGraphicsItem *parent = 0);
+    
+    virtual ~CpNetworkPluginForm();
+    
+    void searchAvailableNetworks();
+    
+signals:
+    
+    void showGlobalProgressNote(int &noteId, const QString& text);
+    void showGlobalNote(
+        int &noteId, const QString& text, HbMessageBox::MessageBoxType msgBoxType);
+    void cancelNote(int noteId);
+
+public slots: 
+
+    void cellularDataUseHomeStateChanged(int index);
+    void cellularDataUseRoamStateChanged(int index);
+    void networkModeStateChanged(int index);
+    void operatorSelectionStateChanged(bool index);
+    void networkAccessModeGot(int mode);
+    void availableNetworksGot(
+        QList<PSetNetworkWrapper::NetworkInfo*> &m_networkInfoList);
+    void networkReqestFailed(
+        PSetNetworkWrapper::ErrorCode error, 
+        PSetNetworkWrapper::RequestType type);
+    void userCancel();
+    void handleSearchingNetworks(PSetNetworkWrapper::RequestType &type);
+    void handleRequestingSelectedNetwork(bool ongoing);
+    void handleNetworkChanged(
+        PSetNetworkWrapper::NetworkInfo& currentInfo,
+        PSetNetworkWrapper::RegistrationStatus& status);
+    void finishedManualSelectiondialog(HbAction* action);
+
+private:     
+    HbDataFormModelItem *createNetworkModeItem();
+    HbDataFormModelItem *createOperatorSelectionItem();
+    HbDataFormModelItem *createHomeDataUsageItem();
+    HbDataFormModelItem *createRoamDataUsageItem();
+    
+    void automaticOperatorSelection();
+    void manualOperatorSelection();
+    
+    void dualModeSelection();
+    void umtsSelection();
+    void gsmSelection();
+    
+    HbDialog* createDialog(const QString& heading) const;
+    void addItemToListWidget(
+        HbListWidget* w, const QString& item, const int& data) const;
+    
+    void showManualSelectiondialog();
+    void restoreUiSelection();
+    QString networkName(PSetNetworkWrapper::NetworkInfo &info);
+
+    void connectToNetworkWrapper(PSetNetworkWrapper &wrapper);
+    
+    void connectToPhoneNotes(CpPhoneNotes &notes);
+    
+    bool isPhoneOnLine();
+    
+private:
+    
+    QStringList mNetworkModeOptions;
+    QStringList mOperatorSelectionOptions;
+    QStringList mCellularUseHomeOptions;
+    QStringList mCellularUseRoamOptions;
+    int m_activeNoteId;
+    int m_activeProgressNoteId;
+    // Own
+    PSetWrapper *m_pSetWrapper;
+    CpSettingsWrapper *m_cpSettingsWrapper;
+    QSharedPointer<CellularDataSettings> mCellularSettings;
+    HbDialog *m_dialog; 
+    
+    // Not own
+    PSetNetworkWrapper *m_psetNetworkWrapper;
+    CpSettingFormItemData *m_NetworkModeOptionsItemData;
+    CpSettingFormItemData *m_NetworkOperatorSelectionItemData;
+    CpSettingFormItemData *mCellularUseHomeSelectionItemData;
+    CpSettingFormItemData *mCellularUseRoamSelectionItemData;
+    QList<PSetNetworkWrapper::NetworkInfo*> *m_networkInfoList;
+};
+
+#endif  // CPNETWORKPLUGINFORM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+
+#include "cpnetworkpluginview.h"
+#include "cpnetworkpluginform.h"
+#include "cppluginlogging.h"
+
+/*!
+  CpNetworkPluginView::CpNetworkPluginView
+ */
+CpNetworkPluginView::CpNetworkPluginView(QGraphicsItem *parent) :
+    CpBaseSettingView(0, parent),
+    m_networkSettingsForm(0)
+{
+    DPRINT << ": IN";
+    
+    m_networkSettingsForm = new CpNetworkPluginForm();
+    // base class takes ownership of the form
+    this->setWidget(m_networkSettingsForm);
+    
+    DPRINT << ": OUT";
+    }
+
+/*!
+  CpNetworkPluginView::~CpNetworkPluginView
+ */
+CpNetworkPluginView::~CpNetworkPluginView()
+{
+    DPRINT << ": IN";
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpNetworkPluginView::SearchAvailableNetworks
+ */
+void CpNetworkPluginView::SearchAvailableNetworks()
+{
+    DPRINT << ": IN";
+    
+    m_networkSettingsForm->searchAvailableNetworks();
+    
+    DPRINT << ": OUT";
+}
+    
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.h	Fri Jun 04 10:19:18 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 CPNETWORKPLUGINVIEW_H
+#define CPNETWORKPLUGINVIEW_H
+
+#include <cpbasesettingview.h>
+
+class CpNetworkPluginForm;
+
+class CpNetworkPluginView : public CpBaseSettingView
+{
+    Q_OBJECT
+    
+public:
+    
+    explicit CpNetworkPluginView(QGraphicsItem *parent = 0);
+    
+    virtual ~CpNetworkPluginView();
+    
+public slots: 
+
+    void SearchAvailableNetworks();
+
+private:
+    
+    CpNetworkPluginForm* m_networkSettingsForm;
+
+};
+
+#endif  // CPNETWORKPLUGINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs --config winscw_udeb --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+    call %PATH_TO_DLL%\%%a.exe
+    move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_cellulardatasettings.h"
+#include "qtestmains60.h"
+#include "cmmanager.h"
+#define private public
+#include "cellulardatasettings.h"
+
+TCmGenConnSettings g_settings;
+
+void fillSettings(TCmGenConnSettings& aGenConnSettings)
+{
+    aGenConnSettings = g_settings;
+}
+
+/*!
+  UT_CellularDataSettings::UT_CellularDataSettings
+ */
+UT_CellularDataSettings::UT_CellularDataSettings() 
+    : m_cellularDataSettings(NULL)
+{
+
+}
+
+
+/*!
+  UT_CellularDataSettings::~UT_CellularDataSettings
+ */
+UT_CellularDataSettings::~UT_CellularDataSettings()
+{
+    delete m_cellularDataSettings;
+}
+
+
+/*!
+  UT_CellularDataSettings::init
+ */
+void UT_CellularDataSettings::init()
+{
+    initialize();
+    m_cellularDataSettings = new CellularDataSettings;
+}
+
+
+/*!
+  UT_CellularDataSettings::cleanup
+ */
+void UT_CellularDataSettings::cleanup()
+{
+    reset();
+    
+    delete m_cellularDataSettings;
+    m_cellularDataSettings = NULL;
+}
+
+/*!
+  UT_CellularDataSettings::t_memleak
+ */
+void UT_CellularDataSettings::t_memleak()
+{
+    
+}
+
+/*!
+  UT_CellularDataSettings::t_dataUseHome
+ */
+void UT_CellularDataSettings::t_dataUseHome()
+{
+    g_settings.iCellularDataUsageVisitor = TCmCellularDataUsage(-1);
+    g_settings.iCellularDataUsageHome = ECmCellularDataUsageAutomatic;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings));
+    expect("RCmManager::Close");
+    QVERIFY(CellularDataSettings::DataUsageHomeAutomatic == m_cellularDataSettings->dataUseHome());
+    QVERIFY(verify());
+    
+    g_settings.iCellularDataUsageHome = ECmCellularDataUsageConfirm;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings));
+    expect("RCmManager::Close");
+    QVERIFY(CellularDataSettings::DataUsageHomeConfirm == m_cellularDataSettings->dataUseHome());
+    QVERIFY(verify());
+    
+    g_settings.iCellularDataUsageHome = ECmCellularDataUsageDisabled;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings));
+    expect("RCmManager::Close");
+    QVERIFY(CellularDataSettings::DataUsageHomeWlanOnly == m_cellularDataSettings->dataUseHome());
+    QVERIFY(verify());
+}
+
+
+/*!
+  UT_CellularDataSettings::t_setDataUseHome
+ */
+void UT_CellularDataSettings::t_setDataUseHome()
+{
+    TCmGenConnSettings res;
+    res.iCellularDataUsageHome = ECmCellularDataUsageAutomatic;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::WriteGenConnSettingsL").with(res);
+    expect("RCmManager::Close");
+    m_cellularDataSettings->setDataUseHome(CellularDataSettings::DataUsageHomeAutomatic);
+    QVERIFY(verify());
+    
+    res.iCellularDataUsageHome = ECmCellularDataUsageConfirm;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::WriteGenConnSettingsL").with(res);
+    expect("RCmManager::Close");
+    m_cellularDataSettings->setDataUseHome(CellularDataSettings::DataUsageHomeConfirm);
+    QVERIFY(verify());
+    
+    res.iCellularDataUsageHome = ECmCellularDataUsageDisabled;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::WriteGenConnSettingsL").with(res);
+    expect("RCmManager::Close");
+    m_cellularDataSettings->setDataUseHome(CellularDataSettings::DataUsageHomeWlanOnly);
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CellularDataSettings::t_dataUseRoam
+ */
+void UT_CellularDataSettings::t_dataUseRoam()
+{
+    g_settings.iCellularDataUsageHome = TCmCellularDataUsage(-1);
+    g_settings.iCellularDataUsageVisitor = ECmCellularDataUsageAutomatic;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings));
+    expect("RCmManager::Close");
+    QVERIFY(CellularDataSettings::DataUsageAbroadAutomatic == m_cellularDataSettings->dataUseRoam());
+    QVERIFY(verify());
+    
+    g_settings.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings));
+    expect("RCmManager::Close");
+    QVERIFY(CellularDataSettings::DataUsageAbroadConfirm == m_cellularDataSettings->dataUseRoam());
+    QVERIFY(verify());
+    
+    g_settings.iCellularDataUsageVisitor = ECmCellularDataUsageDisabled;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::ReadGenConnSettingsL").willOnce(invoke(fillSettings));
+    expect("RCmManager::Close");
+    QVERIFY(CellularDataSettings::DataUsageAbroadWlanOnly == m_cellularDataSettings->dataUseRoam());
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CellularDataSettings::t_setDataUseRoam
+ */
+void UT_CellularDataSettings::t_setDataUseRoam()
+{
+    TCmGenConnSettings res;
+    res.iCellularDataUsageVisitor = ECmCellularDataUsageAutomatic;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::WriteGenConnSettingsL").with(res);
+    expect("RCmManager::Close");
+    m_cellularDataSettings->setDataUseRoam(CellularDataSettings::DataUsageAbroadAutomatic);
+    QVERIFY(verify());
+    
+    res.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::WriteGenConnSettingsL").with(res);
+    expect("RCmManager::Close");
+    m_cellularDataSettings->setDataUseRoam(CellularDataSettings::DataUsageAbroadConfirm);
+    QVERIFY(verify());
+    
+    res.iCellularDataUsageVisitor = ECmCellularDataUsageDisabled;
+    expect("RCmManager::CreateTablesAndOpenL");
+    expect("RCmManager::WriteGenConnSettingsL").with(res);
+    expect("RCmManager::Close");
+    m_cellularDataSettings->setDataUseRoam(CellularDataSettings::DataUsageAbroadWlanOnly);
+    QVERIFY(verify());
+}
+
+QTEST_MAIN_S60(UT_CellularDataSettings)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef UT_CELLULARDATASETTINGS_H
+#define UT_CELLULARDATASETTINGS_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CellularDataSettings;
+
+class UT_CellularDataSettings : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CellularDataSettings();
+    ~UT_CellularDataSettings();
+    
+private slots:
+
+    void init();
+    
+    void t_memleak();
+    void t_dataUseHome();
+    void t_setDataUseHome();
+    void t_dataUseRoam();
+    void t_setDataUseRoam();
+    void cleanup();
+    
+private:
+    CellularDataSettings *m_cellularDataSettings;
+
+};
+
+#endif // UT_CELLULARDATASETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cellulardatasettings/ut_cellulardatasettings.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../inc 
+INCLUDEPATH +=../../../cptelephonyutils/inc
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+    INCLUDEPATH += /epoc32/include/mw/QtTest \
+        /epoc32/include/platform/mw \
+        /epoc32/include/mw/qt
+  LIBS += -lmocklib \
+        -lsymbianmock
+}
+    
+# test code
+HEADERS += ut_cellulardatasettings.h
+SOURCES += ut_cellulardatasettings.cpp
+
+# code to be tested
+HEADERS += ../../src/cellulardatasettings.h
+
+SOURCES += ../../src/cellulardatasettings.cpp
+SOURCES += ../../src/cellulardatasettings_s60.cpp
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cmmanager.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_cpnetworkplugin.h"
+#include "qtestmains60.h"
+#include <cpsettingformitemdata.h>
+#define private public
+#include "cpnetworkplugin.h"
+#include "cpitemdatahelper.h"
+
+Q_EXTERN_C const char * qt_plugin_query_verification_data();
+Q_EXTERN_C ::QObject *  qt_plugin_instance();
+
+/*!
+  UT_CpNetworkPlugin::UT_CpNetworkPlugin
+ */
+UT_CpNetworkPlugin::UT_CpNetworkPlugin() 
+    : m_networkPlugin(NULL)
+{
+    const char * verificationData = qt_plugin_query_verification_data();
+}
+
+
+/*!
+  UT_CpNetworkPlugin::~UT_CpNetworkPlugin
+ */
+UT_CpNetworkPlugin::~UT_CpNetworkPlugin()
+{
+    delete m_networkPlugin;
+}
+
+
+/*!
+  UT_CpNetworkPlugin::init
+ */
+void UT_CpNetworkPlugin::init()
+{
+    initialize();
+
+    m_networkPlugin = (CpNetworkPlugin*)qt_plugin_instance();
+}
+
+
+/*!
+  UT_CpNetworkPlugin::cleanup
+ */
+void UT_CpNetworkPlugin::cleanup()
+{
+    reset();
+    
+    delete m_networkPlugin;
+    m_networkPlugin = NULL;
+}
+
+
+/*!
+  UT_CpNetworkPlugin::t_createSettingFormItemData
+ */
+void UT_CpNetworkPlugin::t_createSettingFormItemData()
+{
+    CpItemDataHelper itemDataHelper;
+    CpNetworkPlugin* p = (CpNetworkPlugin*)qt_plugin_instance();
+    QList<CpSettingFormItemData*> list;
+    list.append(p->createSettingFormItemData(itemDataHelper));
+    qDeleteAll(list);
+}
+
+
+/*!
+  UT_CpNetworkPlugin::t_memleak
+ */
+void UT_CpNetworkPlugin::t_memleak()
+{
+    
+}
+
+QTEST_MAIN_S60(UT_CpNetworkPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.h	Fri Jun 04 10:19:18 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 UT_CPNETWORKPLUGIN_H
+#define UT_CPNETWORKPLUGIN_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpNetworkPlugin;
+
+class UT_CpNetworkPlugin : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpNetworkPlugin();
+    ~UT_CpNetworkPlugin();
+    
+private slots:
+
+    void init();
+    
+    void t_memleak();
+
+    void t_createSettingFormItemData();
+    
+    void cleanup();
+    
+private:
+    CpNetworkPlugin *m_networkPlugin;
+
+};
+
+#endif // UT_CPNETWORKPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkplugin/ut_cpnetworkplugin.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../inc 
+INCLUDEPATH +=../../../cptelephonyutils/inc
+DEFINES += BUILD_CPTELEPHONYUTILS
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+    INCLUDEPATH += /epoc32/include/mw/QtTest \
+        /epoc32/include/platform/mw \
+        /epoc32/include/mw/qt
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+    
+# test code
+HEADERS += ut_cpnetworkplugin.h
+SOURCES += ut_cpnetworkplugin.cpp
+
+# code to be tested
+HEADERS += ../../src/cpnetworkplugin.h \
+           ../../src/cpnetworkpluginview.h \
+           ../../../cptelephonyutils/inc/cpphonelocalisation.h           
+       
+SOURCES += ../../src/cpnetworkplugin.cpp 
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpnetworkpluginview.cpp
+SOURCES += ../../../tsrc/mocks/mock_cpphonelocalisation.cpp
+SOURCES += ../../../tsrc/mocks/mock_hbicon.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/qtestmains60ui.h	Fri Jun 04 10:19:18 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 QTESTMAINS60
+#define QTESTMAINS60
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+char *new_argv[3];
+HbMainWindow *mainWindow;
+#define QTEST_MAIN_S60UI(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+HbApplication *app = new HbApplication(argc, argv); \
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+QResource::registerResource("../hbcore.rcc"); \
+mainWindow = new HbMainWindow;\
+mainWindow->show(); \
+int ret = QTest::qExec(&tc, 3, new_argv); \
+delete mainWindow; \
+delete app; \
+return ret; \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_cpnetworkpluginform.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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 building unit test component
+#
+
+
+
+
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH += ../../../inc
+INCLUDEPATH += ../../../cptelephonyutils/inc
+DEFINES += BUILD_NETWORKPLUGIN BUILD_PSETWRAPPER BUILD_CPTELEPHONYUTILS
+
+QT -= gui
+QT += testlib
+
+symbian: { 
+    #CONFIG += no_icon
+    INCLUDEPATH += /epoc32/include/mw/QtTest \
+        /epoc32/include/platform/mw \
+        /epoc32/include/mw/qt
+    LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework 
+        }
+    
+# test code
+HEADERS += ut_networkpluginform.h
+SOURCES += ut_networkpluginform.cpp
+    
+# code to be tested
+HEADERS += ../../src/cpnetworkplugin.h \
+           ../../src/cpnetworkpluginform.h \
+           ../../src/cellulardatasettings.h \
+           ../../../cptelephonyutils/inc/cpplugincommon.h \
+           ../../../cptelephonyutils/inc/cpphonenotes.h \
+           ../../../cptelephonyutils/inc/cpphonelocalisation.h \
+           /epoc32/include/platform/mw/psetwrapper.h \
+           /epoc32/include/platform/mw/psetcliwrapper.h \
+           /epoc32/include/platform/mw/psetcallwaitingwrapper.h \
+           /epoc32/include/platform/mw/psetcalldivertingwrapper.h \
+           /epoc32/include/platform/mw/psetnetworkwrapper.h
+
+SOURCES += ../../src/cpnetworkpluginform.cpp 
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpnetworkplugin.cpp \
+           ../../../tsrc/mocks/mock_psetwrapper.cpp \
+           ../../../tsrc/mocks/mock_psetnetworkwrapper.cpp \
+           ../../../tsrc/mocks/mock_cpplugincommon.cpp \
+           ../../../tsrc/mocks/mock_cpphonenotes.cpp \
+           ../../../tsrc/mocks/mock_cpphonelocalisation.cpp \
+           ../../../tsrc/mocks/mock_hbdataform.cpp \
+           ../../../tsrc/mocks/mock_hbabstractitemview.cpp \
+           ../../../tsrc/mocks/mock_hbscrollarea.cpp \
+           ../../../tsrc/mocks/mock_hbdialog.cpp \
+           ../../../tsrc/mocks/mock_hbpopup.cpp \
+           ../../../tsrc/mocks/mock_hbwidget.cpp \
+           ../../../tsrc/mocks/mock_hblabel.cpp \
+           ../../../tsrc/mocks/mock_hblistwidget.cpp \
+           ../../../tsrc/mocks/mock_hblistview.cpp \
+           ../../../tsrc/mocks/mock_hbaction.cpp \
+           ../../../tsrc/mocks/mock_qaction.cpp \
+           ../../../tsrc/mocks/mock_qobject.cpp \
+           ../../../tsrc/mocks/mock_hblistwidgetitem.cpp \
+           ../../../tsrc/mocks/mock_cellulardatasettings.cpp
+           
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_networkpluginform.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,256 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_networkpluginform.h"
+#include "qtestmains60ui.h"
+#define private public
+#include "cpnetworkpluginform.h"
+#include "cpitemdatahelper.h"
+
+class CPsetContainer
+{
+public:
+    CPsetContainer(){};
+    ~CPsetContainer(){};
+};
+
+/*!
+  UT_CpNetworkPluginForm::UT_CpNetworkPluginForm
+ */
+UT_CpNetworkPluginForm::UT_CpNetworkPluginForm() 
+    : m_networkPluginForm(NULL), i(0)
+{
+    SmcDefaultValue<PSetNetworkWrapper::ErrorCode>::SetL(PSetNetworkWrapper::ErrNoError);
+}
+
+/*!
+  UT_CpNetworkPluginForm::~UT_CpNetworkPluginForm
+ */
+UT_CpNetworkPluginForm::~UT_CpNetworkPluginForm()
+{
+
+}
+
+/*!
+  UT_CpNetworkPluginForm::init
+ */
+void UT_CpNetworkPluginForm::init()
+{
+    initialize();
+
+    QVERIFY(!m_networkPluginForm);
+    CPsetContainer tmpPsetContainer;
+    m_networkWrapper = new PSetNetworkWrapper(tmpPsetContainer);
+    expect("PSetWrapper::networkWrapper").returns(m_networkWrapper);
+    if(i) {
+        m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic;
+    } else {
+        m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual;
+    }
+    i++;
+    expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode));
+    m_networkPluginForm = new CpNetworkPluginForm();
+    QVERIFY(m_networkPluginForm);
+}
+
+
+/*!
+  UT_CpNetworkPluginForm::t_networkModeStateChanged
+ */
+void UT_CpNetworkPluginForm::t_networkModeStateChanged()
+{
+    expect("CpSettingsWrapper::isPhoneOffline").returns(false);
+    m_networkPluginForm->networkModeStateChanged(0);
+
+    expect("CpSettingsWrapper::isPhoneOffline").returns(false);
+    m_networkPluginForm->networkModeStateChanged(1);
+
+    expect("CpSettingsWrapper::isPhoneOffline").returns(false);
+    m_networkPluginForm->networkModeStateChanged(2);
+    
+    expect("CpSettingsWrapper::isPhoneOffline").returns(false);
+        m_networkPluginForm->networkModeStateChanged(3);
+    
+    expect("CpSettingsWrapper::isPhoneOffline").returns(true);
+    m_networkPluginForm->networkModeStateChanged(0);
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_operatorSelectionStateChanged
+ */
+void UT_CpNetworkPluginForm::t_operatorSelectionStateChanged()
+{
+    expect("CpSettingsWrapper::isPhoneOffline").returns(false);
+    m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic;
+    expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode));
+    m_networkPluginForm->operatorSelectionStateChanged(true);
+
+    expect("CpSettingsWrapper::isPhoneOffline").returns(false);
+    m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual;
+    expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode));
+    m_networkPluginForm->operatorSelectionStateChanged(true);
+    
+    expect("CpSettingsWrapper::isPhoneOffline").returns(true);
+    m_networkPluginForm->operatorSelectionStateChanged(true);
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_networkAccessModeGot
+ */
+void UT_CpNetworkPluginForm::t_networkAccessModeGot()
+{
+    expect("CpSettingFormItemData::setContentWidgetData");
+    m_networkPluginForm->networkAccessModeGot(0);
+    
+    expect("CpSettingFormItemData::setContentWidgetData");
+    m_networkPluginForm->networkAccessModeGot(1);
+    
+    expect("CpSettingFormItemData::setContentWidgetData");
+    m_networkPluginForm->networkAccessModeGot(2);
+    
+    m_networkPluginForm->networkAccessModeGot(3);
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_availableNetworksGot
+ */
+void UT_CpNetworkPluginForm::t_availableNetworksGot()
+{
+    PSetNetworkWrapper::NetworkInfo temp;
+    QList<PSetNetworkWrapper::NetworkInfo*> networkInfoList;
+    networkInfoList.append(&temp);
+    
+    expect("HbDialog::exec");
+    m_networkPluginForm->availableNetworksGot(networkInfoList);
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_networkReqestFailed
+ */
+void UT_CpNetworkPluginForm::t_networkReqestFailed()
+{
+    PSetNetworkWrapper::ErrorCode error(PSetNetworkWrapper::ErrCauseCallActive);
+    PSetNetworkWrapper::RequestType type(PSetNetworkWrapper::RequestSetNetworkMode);
+    expect("PSetNetworkWrapper::getNetworkAccessMode");
+    m_networkPluginForm->networkReqestFailed(error, type);
+    
+    error = PSetNetworkWrapper::ErrNoNetworkService;
+    type = PSetNetworkWrapper::RequestSetNetwork;
+    expect("PSetNetworkWrapper::getNetworkAccessMode");
+    expect("CpSettingFormItemData::setContentWidgetData");
+    m_networkPluginForm->networkReqestFailed(error, type);
+    
+    error = PSetNetworkWrapper::ErrOfflineOpNotAllowed;
+    type = PSetNetworkWrapper::RequestSetNetwork;
+    expect("PSetNetworkWrapper::getNetworkAccessMode");
+    expect("CpSettingFormItemData::setContentWidgetData");
+    m_networkPluginForm->networkReqestFailed(error, type);
+    
+    PSetNetworkWrapper::NetworkInfo temp;
+    QList<PSetNetworkWrapper::NetworkInfo*> networkInfoList;
+    networkInfoList.append(&temp);
+    m_networkPluginForm->availableNetworksGot(networkInfoList);
+    error = PSetNetworkWrapper::ErrNoNetworkAccess;
+    type = PSetNetworkWrapper::RequestSetNetwork;
+    expect("HbDialog::exec");
+    m_networkPluginForm->networkReqestFailed(error, type);
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_userCancel
+ */
+void UT_CpNetworkPluginForm::t_userCancel()
+{
+    m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual;
+    expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode));
+    m_networkPluginForm->userCancel();
+    
+    m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic;
+    expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode));
+    m_networkPluginForm->userCancel();
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_handleSearchingNetworks
+ */
+void UT_CpNetworkPluginForm::t_handleSearchingNetworks()
+{
+    PSetNetworkWrapper::RequestType type(PSetNetworkWrapper::RequestNone);
+    m_networkPluginForm->handleSearchingNetworks(type);
+    
+    type = PSetNetworkWrapper::RequestEnumerateNetworks;
+    m_networkPluginForm->handleSearchingNetworks(type);
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_handleRequestingSelectedNetwork
+ */
+void UT_CpNetworkPluginForm::t_handleRequestingSelectedNetwork()
+{
+    m_networkPluginForm->handleRequestingSelectedNetwork(true);
+    m_networkPluginForm->handleRequestingSelectedNetwork(false);
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_handleNetworkChanged
+ */
+void UT_CpNetworkPluginForm::t_handleNetworkChanged()
+{
+    PSetNetworkWrapper::NetworkInfo currentInfo;
+    PSetNetworkWrapper::RegistrationStatus status(PSetNetworkWrapper::RegisteredOnHomeNetwork);
+    m_networkPluginForm->handleNetworkChanged(currentInfo, status); 
+
+    status = PSetNetworkWrapper::RegisteredRoaming;
+    currentInfo.m_longName = "test";
+    m_networkPluginForm->handleNetworkChanged(currentInfo, status);
+    
+    status = PSetNetworkWrapper::RegisteredRoaming;
+    currentInfo.m_shortName = "test";
+    m_networkPluginForm->handleNetworkChanged(currentInfo, status);
+}
+    
+/*!
+  UT_CpNetworkPluginForm::cleanup
+ */
+void UT_CpNetworkPluginForm::cleanup()
+{
+    reset();
+    
+    delete m_networkWrapper;
+    m_networkWrapper = NULL;
+    delete m_networkPluginForm;
+    m_networkPluginForm = NULL;
+}
+
+/*!
+  UT_CpNetworkPluginForm::t_memleak
+ */
+void UT_CpNetworkPluginForm::t_memleak()
+{
+    
+}
+
+/*!
+  UT_CpNetworkPluginForm::updateNetworkSelectionMode
+ */
+void UT_CpNetworkPluginForm::updateNetworkSelectionMode(
+    PSetNetworkWrapper::NetworkSelectionMode& mode)
+{
+    mode = m_NetworkSelectionMode;
+}
+
+QTEST_MAIN_S60UI(UT_CpNetworkPluginForm)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginform/ut_networkpluginform.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef UT_NETWORKPLUGINFORM_H
+#define UT_NETWORKPLUGINFORM_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+#include <psetnetworkwrapper.h>
+
+class CpNetworkPluginForm;
+
+class UT_CpNetworkPluginForm : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpNetworkPluginForm();
+    ~UT_CpNetworkPluginForm();
+    
+    void updateNetworkSelectionMode(
+        PSetNetworkWrapper::NetworkSelectionMode& mode);
+    
+private slots:
+
+    void init();
+
+    void t_networkModeStateChanged();
+    void t_operatorSelectionStateChanged();
+    void t_networkAccessModeGot();
+    
+    void t_availableNetworksGot();
+    void t_networkReqestFailed();
+    void t_userCancel();
+    void t_handleSearchingNetworks();
+    void t_handleRequestingSelectedNetwork();
+    void t_handleNetworkChanged();
+
+    void cleanup();
+    
+    void t_memleak();
+private:
+    CpNetworkPluginForm *m_networkPluginForm;
+    PSetNetworkWrapper *m_networkWrapper;
+    PSetNetworkWrapper::NetworkSelectionMode m_NetworkSelectionMode;
+    int i;
+
+};
+
+#endif // UT_NETWORKPLUGINFORM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/qtestmains60ui.h	Fri Jun 04 10:19:18 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 QTESTMAINS60
+#define QTESTMAINS60
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+char *new_argv[3];
+HbMainWindow *mainWindow;
+#define QTEST_MAIN_S60UI(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+HbApplication *app = new HbApplication(argc, argv); \
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+QResource::registerResource("../hbcore.rcc"); \
+mainWindow = new HbMainWindow;\
+mainWindow->show(); \
+int ret = QTest::qExec(&tc, 3, new_argv); \
+delete mainWindow; \
+delete app; \
+return ret; \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_cpnetworkpluginview.h"
+#include "qtestmains60ui.h"
+#define private public
+#include "cpnetworkpluginview.h"
+
+/*!
+  ut_cpnetworkpluginview::ut_cpnetworkpluginview
+ */
+ut_cpnetworkpluginview::ut_cpnetworkpluginview() 
+    : m_cpnetworkpluginview(NULL)
+{
+}
+
+
+/*!
+  ut_cpnetworkpluginview::~ut_cpnetworkpluginview
+ */
+ut_cpnetworkpluginview::~ut_cpnetworkpluginview()
+{
+
+}
+
+
+/*!
+  ut_cpnetworkpluginview::init
+ */
+void ut_cpnetworkpluginview::init()
+{
+    initialize();
+
+    m_cpnetworkpluginview = new CpNetworkPluginView();
+}
+
+
+/*!
+  ut_cpnetworkpluginview::cleanup
+ */
+void ut_cpnetworkpluginview::cleanup()
+{
+    reset();
+    
+    delete m_cpnetworkpluginview;
+    m_cpnetworkpluginview = NULL;
+}
+
+/*!
+  ut_cpnetworkpluginview::t_memleak
+ */
+void ut_cpnetworkpluginview::t_memleak()
+{
+    
+}
+
+QTEST_MAIN_S60UI(ut_cpnetworkpluginview)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef UT_CPNETWORKPLUGIN_H
+#define UT_CPNETWORKPLUGIN_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpNetworkPluginView;
+
+class ut_cpnetworkpluginview : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    ut_cpnetworkpluginview ();
+    ~ut_cpnetworkpluginview ();
+    
+private slots:
+
+    void init();
+    
+    void t_memleak();
+    
+    void cleanup();
+    
+private:
+    CpNetworkPluginView *m_cpnetworkpluginview;
+
+};
+
+#endif // UT_CPNETWORKPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpnetworkplugin/tsrc/ut_cpnetworkpluginview/ut_cpnetworkpluginview.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+INCLUDEPATH += . ../../src/
+INCLUDEPATH += ../../../cptelephonyutils/inc
+
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  #CONFIG += no_icon
+  INCLUDEPATH += /epoc32/include/mw/QtTest \
+        /epoc32/include/platform/mw \
+        /epoc32/include/mw/qt
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+    
+# test code
+HEADERS += ut_cpnetworkpluginview.h
+SOURCES += ut_cpnetworkpluginview.cpp
+
+# code to be tested
+HEADERS += ../../src/cpnetworkpluginview.h 
+SOURCES += ../../src/cpnetworkpluginview.cpp 
+
+# mocks needed for testing
+HEADERS += ../../src/cpnetworkpluginform.h
+SOURCES += ../../../tsrc/mocks/mock_cpnetworkpluginform.cpp
+SOURCES += ../../../tsrc/mocks/mock_cpbasesettingview.cpp
+SOURCES += ../../../tsrc/mocks/mock_hbview.cpp
+   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpphonesettingsplugins.pro	Fri Jun 04 10:19:18 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:
+TEMPLATE = subdirs
+SUBDIRS = cptelephonyutils \
+    telephonyplugin \
+    divertplugin \
+    callsplugin \
+    barringplugin \
+    cpnetworkplugin
+CONFIG += ordered
+symbian: { 
+    load(data_caging_paths)
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    deploy.path = C:
+    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+        "./rom/cpphonesettingsplugins.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cpphonesettingsplugins.iby)" \
+        "./rom/cpphonesettingsplugins_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cpphonesettingsplugins_resources.iby)"
+}
+HEADERS = cptelephonyutils/inc/cpphonelocalisation.h
+SOURCES = cptelephonyutils/src/cpphonelocalisation.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cpplugincommon.pri	Fri Jun 04 10:19:18 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: 
+#
+
+symbian: {
+    load(data_caging_paths)
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    
+    TARGET.EPOCALLOWDLLDATA = 1  
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    
+    exists($$OUT_PWD/data/$${TARGET}.cpcfg) {
+        cpcfg.sources = data/$${TARGET}.cpcfg
+        cpcfg.path = $$QT_PLUGINS_BASE_DIR/controlpanel/config
+    }
+    plugin.sources = $${TARGET}.dll
+    plugin.path = $$QT_PLUGINS_BASE_DIR/controlpanel
+    DEPLOYMENT += plugin cpcfg
+    
+    # For armv5 rom build
+    qtplugin.sources += qmakepluginstubs/$${TARGET}.qtplugin
+    qtplugin.path = $$QT_PLUGINS_BASE_DIR/controlpanel
+
+    for(cpcfg, cpcfg.sources): \
+        BLD_INF_RULES.prj_exports += "./$$cpcfg /$$HW_ZDIR$$RESOURCE_FILES_DIR/qt/plugins/controlpanel/config/$$basename(cpcfg)"
+    for(qtplugin, qtplugin.sources): \
+        BLD_INF_RULES.prj_exports += "./$$qtplugin /$$HW_ZDIR$$RESOURCE_FILES_DIR/qt/plugins/controlpanel/$$basename(qtplugin)" 
+} else: {
+    INCLUDEPATH += ../../../../../mw/phonesrv/phonesrv_plat/phone_settings_api/inc
+    INCLUDEPATH += ../../../../../mw/phonesrv/phonesrv_plat/ss_settings_api/inc
+    INCLUDEPATH += ../../../../../mw/gsprofilesrv/controlpanel/controlpanel_plat/inc
+    INCLUDEPATH += ../../../../../../epoc32/include
+    INCLUDEPATH += ../../../../../../epoc32/include/mw
+    LIBS += -LC:/ControlPanel/debug/bin
+        DESTDIR = C:/ControlPanel/debug/bin
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/cptelephonyutils.pro	Fri Jun 04 10:19:18 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: 
+#
+
+TEMPLATE = lib
+TARGET = cptelephonyutils
+CONFIG += hb
+MOC_DIR = moc
+
+INCLUDEPATH += inc
+SOURCEPATH += src
+
+# Input
+HEADERS += inc/cpplugincommon.h \
+           inc/cpphonenotes.h \
+           inc/cpphonelocalisation.h
+           
+SOURCES += src/cpphonenotes.cpp \
+           src/cpphonelocalisation.cpp 
+           
+symbian: {
+    SOURCES += src/cpplugincommon.cpp 
+    }
+else: {
+    SOURCES += src/cpplugincommon_s.cpp
+    }
+
+TRANSLATIONS = telephone_cp.ts
+
+DEFINES += BUILD_CPTELEPHONYUTILS
+
+symbian: {
+    load(data_caging_paths)
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    
+    LIBS += -lsssettings    \
+            -lphonesettings \
+            -lxqsysinfo \
+            -lxqsettingsmanager
+
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    TARGET.EPOCALLOWDLLDATA = 1 
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.UID3 = 0X20029F1F
+
+    # For sis file
+    dllfile.sources = $${TARGET}.dll
+    dllfile.path = $$SHARED_LIB_DIR
+    DEPLOYMENT += dllfile
+} else: {
+    INCLUDEPATH += ../../../../../mw/phonesrv/phonesrv_plat/phone_settings_api/inc
+    INCLUDEPATH += ../../../../../mw/gsprofilesrv/controlpanel/controlpanel_plat/inc
+    DESTDIR = c:\hb\lib
+    DLLDESTDIR = c:\hb\bin
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonelocalisation.h	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#ifndef CPPHONELOCALISATION_H_
+#define CPPHONELOCALISATION_H_
+
+#include <QObject>
+#include <QList>
+#include "cptelephonyutilsdefs.h"
+
+// Forward declarations 
+class QTranslator; 
+
+class CPTELEPHONYUTILS_EXPORT CpPhoneLocalisation: public QObject
+    {
+    Q_OBJECT
+    
+public: 
+    
+    enum TranslationFileId {
+        TranslationFileCommon, 
+        TranslationFileTelephoneCp
+    }; 
+        
+public:
+    
+    CpPhoneLocalisation(QObject *parent = NULL);
+    ~CpPhoneLocalisation();
+
+    bool installTranslator(TranslationFileId translationFileId);
+    void removeTranslators();
+
+private:     
+    
+    QList<QTranslator *> m_translators;
+    
+    };
+
+
+#endif /* CPPHONELOCALISATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpphonenotes.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 CPPHONENOTES_H
+#define CPPHONENOTES_H
+
+#include <QObject>
+#include <QString>
+#include <QQueue>
+#include <hbmessagebox.h>
+#include <psetcalldivertingwrapper.h>
+#include "cptelephonyutilsdefs.h"
+
+class CpSettingsWrapper;
+class HbInputDialog;
+class QValidator;
+
+using namespace CpTelephonyUtils;
+
+class CPTELEPHONYUTILS_EXPORT CpPhoneNotes: public QObject
+{
+    Q_OBJECT
+    
+public:
+
+    static CpPhoneNotes* instance();
+    
+private: 
+    
+    CpPhoneNotes();
+    
+    ~CpPhoneNotes();
+
+    Q_DISABLE_COPY(CpPhoneNotes)
+    
+signals:
+    
+    /**
+     This signal is emitted when the device progress dialog is cancelled by 
+     user pressing the "cancel" button or by the application itself.
+     @param     noteId      On return contains unique note identifier.
+     */
+    void progressNoteCanceled();
+    
+    /**
+     This signal is emitted when the user coplete password query.
+     @param password            On return contains user given password.
+     @param ok                  True if the user pressed OK, false if the user 
+                                pressed Cancel.
+     */
+    void passwordQueryCompleted(
+        QString password,
+        bool okPressed);
+    
+public slots: // Slots: 
+    
+    /**
+     Shows global progress note. Note showing may be delayed if other note 
+     showing is ongoing. 
+     @param     noteId      On return contains unique note identifier.
+     @param     text        Text to show on a note.
+     */
+    void showGlobalProgressNote(int &noteId, const QString& text);
+    
+    /**
+     Shows global note. Note showing may be delayed if other note 
+     showing is ongoing. 
+     @param     noteId      On return contains unique note identifier.
+     @param     text        Text to show on a note.
+     @param     noteType    Note type.
+     */
+    void showGlobalNote(int &noteId, const QString& text, 
+        HbMessageBox::MessageBoxType noteType);
+    
+    /**
+     Shows global error note. Note showing may be delayed if other note 
+     showing is ongoing. 
+     @param     noteId      On return contains unique note identifier.
+     @param     errorCode   Code specifying error situation. 
+     */
+    void showGlobalErrorNote(int &noteId, int errorCode);
+    
+    /**
+     Shows the basic service list.
+     @param     title                   Heading to be used for the list.
+     @param     basicServiceGroupIds    Basic services to be listed. 
+     */
+    void showBasicServiceList(
+        const QString &title, 
+        const QList<unsigned char> &basicServiceGroupIds);
+    
+    /**
+     Shows detailed call divert information about the selected divert service
+     group.
+     @param     divertStatus    Divert status information.
+     */
+    void showCallDivertDetails(
+        const PSCallDivertingStatus &divertStatus);
+    
+    /**
+     Shows password query dialog with OK & Cancel buttons and returns user
+     given password unless user has canceled query. Only valid password is
+     accepted.
+     @param title               Title for the query dialog.
+     @param validator           Password validator.
+     @param maxPasswordLength   Maximum length for the password.
+     */
+    void showPasswordQueryDialog(
+        const QString &title,
+        const QValidator &validator,
+        int maxPasswordLength);
+    
+    /**
+     Cancels specified note.
+     @param     noteId      Note identifier.
+     */
+    void cancelNote(int noteId);
+    
+    /**
+     Retuns true if note is currently shown.
+     */
+    bool noteShowing();
+    
+    /**
+     Slot for HbDialog finished singal.
+     */
+    void finishedPasswordQueryDialog(HbAction* action);
+    
+private:
+    
+    /**
+     Resolves basic service group name by identifier.
+     @param     basicServiceGroupId     Group identifier.
+     @return    Group name.
+     */
+    QString basicServiceGroupName(BasicServiceGroups basicServiceGroupId) const;
+    
+    /**
+     Formats phone number according to locale specific rules.
+     @param     number          Unformatted phone number.
+     @return    Formatted number.
+     */
+    QString formatPhoneNumber(QString number) const;
+    
+    /**
+     Launches next note in the queue if not busy with showing other 
+     note currently.
+     */
+    void launchNextNoteIfReady();
+
+private slots:
+    
+    /**
+     Handler method for notes' about to close signal.
+     */
+    void activeNoteAboutToClose();
+    
+    /**
+     Handler method for notes' canceled signal.
+     */
+    void handleProgressNoteCanceled();
+    
+    /**
+     Used for dynamic enable/disable of password dialog's OK button according
+     to validity of the currently inputted password.
+     */
+    void passwordTextChanged();
+    
+private: // Data: 
+
+    /**
+      Cenrep settings wrapper.
+     */
+     CpSettingsWrapper *m_cpSettingsWrapper;
+
+    /**
+      Notes waiting to be shown.
+     */
+    QQueue<QObject*> *m_notesQueue;
+    
+    /**
+      Indicates whether note controller is busy with some note showing.
+     */
+    bool m_isNoteShowingOngoing;
+    
+    /**
+      Password query dialog. Own.
+     */
+    HbInputDialog *m_passwordDialog;
+
+    /**
+      Password validator. Not own.
+     */
+    const QValidator *m_passwordValidator;
+};
+#endif // CPPHONENOTES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cpplugincommon.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CPPLUGINCOMMON_H
+#define CPPLUGINCOMMON_H
+
+#include <qvariant.h>
+#include "cptelephonyutilsdefs.h"
+
+class XQSettingsManager;
+
+using namespace CpTelephonyUtils;
+
+/*!
+    \class Tools
+    \brief The static functionality.
+ */
+class CPTELEPHONYUTILS_EXPORT Tools : public QObject
+{
+    Q_OBJECT
+
+public:
+    /*!
+      Is VoIP currently supported
+      */
+    static bool voipSupported();
+
+    /*!
+      Is video currently supported
+      */
+    static bool videoSupported();
+
+    /*!
+      Error code text conversion
+      */
+    static bool errorCodeTextMapping(const int errorcode, QString &errorText);
+
+};
+
+/*!
+    \class SettingsWrapper
+    \brief Wraps central repository and P&S dependency.
+ */
+class CPTELEPHONYUTILS_EXPORT CpSettingsWrapper : public QObject
+{
+    Q_OBJECT
+public:
+    CpSettingsWrapper(QObject *parent = NULL);
+    ~CpSettingsWrapper();
+public:
+    /*!
+      Show call duration setting
+      */
+    bool showCallDuration();
+    int setShowCallDuration(bool value);
+
+    /*!
+      Soft reject text setting
+      */
+    void readSoftRejectText( QString &text, bool &userDefined );
+    int writeSoftRejectText(const QString &text, bool userDefined );
+
+    /*!
+      Number grouping support
+      */
+    bool numberGroupingSupported() const;
+    
+    /*!
+     Call waiting distiquish not provisioned support
+     */
+    bool isFeatureCallWaitingDistiquishNotProvisionedEnabled();
+    
+    /*!
+     Checks if phone is in offline mode or not.
+     Return true if phone is in offline mode.
+     Return false if phone is not in offline mode.
+     */
+    bool isPhoneOffline() const;
+
+private:
+    /*!
+      Read cenrep value. 
+      */
+    QVariant readCenrepValue( const long int uid, const unsigned long int key) const;
+    
+    /*!
+      Read cenrep string. 
+      */
+    QString readCenrepString( const long int uid, const unsigned long int key) const;
+    
+    /*!
+      Write cenrep value or string. 
+      */
+    int writeCenrepValue( const long int uid, const unsigned long int key,
+        const QVariant &settingsKeyValue ) const;
+
+private: // Data
+    // Own
+    XQSettingsManager* m_Settings;
+};
+
+#endif // CPPLUGINCOMMON_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cppluginlogging.h	Fri Jun 04 10:19:18 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 CPPHONESETTINGSPLUGINSLOGGING_H
+#define CPPHONESETTINGSPLUGINSLOGGING_H
+
+#include <QDebug>
+
+
+/*!
+  Define MSG_OUTPUT_RDEBUG 
+  for enabling RDebug prints in development tracing. 
+  Shouldn't be used in release code.
+  */
+#undef MSG_OUTPUT_RDEBUG
+
+
+
+#ifdef MSG_OUTPUT_RDEBUG
+#ifdef Q_OS_SYMBIAN
+#include <e32debug.h>
+
+static void cpPhoneSettingsPluginsMsgOutput(QtMsgType type, const char *msg)
+{
+    switch (type) {
+    
+    case QtDebugMsg:
+        RDebug::Printf("CpPhoneSettingsPlugins Debug: %s\n", msg);
+        break;        
+    case QtWarningMsg:
+        RDebug::Printf("CpPhoneSettingsPlugins Warning: %s\n", msg);
+        break;
+    case QtCriticalMsg:
+        RDebug::Printf("CpPhoneSettingsPlugins Critical: %s\n", msg);
+        break;        
+    case QtFatalMsg:
+        RDebug::Printf("CpPhoneSettingsPlugins Fatal: %s\n", msg);
+        abort();
+        break; 
+    default:
+        break; 
+    }
+}
+
+    #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(cpPhoneSettingsPluginsMsgOutput)
+    #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0)
+#else //Q_OS_SYMBIAN
+    #define INSTALL_TRACE_MSG_HANDLER
+    #define UNINSTALL_TRACE_MSG_HANDLER
+#endif
+#else 
+    #define INSTALL_TRACE_MSG_HANDLER 
+    #define UNINSTALL_TRACE_MSG_HANDLER 
+#endif //MSG_OUTPUT_RDEBUG
+
+/*!
+  Debug macros
+  */
+#define DPRINT qDebug() << __PRETTY_FUNCTION__
+#define DWARNING qWarning() << __PRETTY_FUNCTION__
+
+#endif // CPPHONESETTINGSPLUGINSLOGGING_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/inc/cptelephonyutilsdefs.h	Fri Jun 04 10:19:18 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 CPTELEPHONYUTILSDEFS_H_
+#define CPTELEPHONYUTILSDEFS_H_
+
+
+#ifdef BUILD_CPTELEPHONYUTILS
+#define CPTELEPHONYUTILS_EXPORT Q_DECL_EXPORT
+#else
+#define CPTELEPHONYUTILS_EXPORT Q_DECL_IMPORT
+#endif
+
+namespace CpTelephonyUtils {
+
+/*! Type of a call forwarding request. */
+enum CallDivertType
+    {
+    /*! Not a call forwarding request.                      */
+    NoCallDivert                    = 1,
+    /*! Call forwarding with number information.            */
+    CallDivertWithNumber,
+    /*! Call forwarding with number and timeout information.*/
+    CallDivertWithNumberAndTimeout,
+    };
+
+enum BasicServiceGroups
+{
+    Unknown = -1, //this is not part of GSM standard
+    // Phone settings updates this automatically to ETelephony or to EAltTele,
+    // depending on if ALS is supported, and which line is active.
+    AllTeleAndBearer = 0,
+    AllTele = 10,
+    Telephony = 11,
+    AllDataTele = 12,
+    Fax = 13,
+    Sms = 16,
+    AllDataExSms = 18, //voice broadcast in gsm 02.30 v. 7.1.0
+    AllTeleExcSms = 19,
+
+    AllPlmnTele = 50,
+    PlmnTele1 = 51,
+    PlmnTele2 = 52,
+    PlmnTele3 = 53,
+    PlmnTele4 = 54,
+    PlmnTele5 = 55,
+    PlmnTele6 = 56,
+    PlmnTele7 = 57,
+    PlmnTele8 = 58,
+    PlmnTele9 = 59,
+    PlmnTeleA = 60,
+    PlmnTeleB = 61,
+    PlmnTeleC = 62,
+    PlmnTeleD = 63,
+    PlmnTeleE = 64,
+    PlmnTeleF = 65,
+
+    AllBearer = 20,
+    AllAsync = 21,
+    AllSync = 22,
+    SyncData = 24,
+    AsyncData = 25,
+    PacketData = 26,
+    PadAccess = 27,
+    AllPlmnBearer = 70,
+    PlmnBearerServ1 = 71,
+    PlmnBearerServ2 = 72,
+    PlmnBearerServ3 = 73,
+    PlmnBearerServ4 = 74,
+    PlmnBearerServ5 = 75,
+    PlmnBearerServ6 = 76,
+    PlmnBearerServ7 = 77,
+    PlmnBearerServ8 = 78,
+    PlmnBearerServ9 = 79,
+    PlmnBearerServA = 80,
+    PlmnBearerServB = 81,
+    PlmnBearerServC = 82,
+    PlmnBearerServD = 83,
+    PlmnBearerServE = 84,
+    PlmnBearerServF = 85,
+
+    AltTele = 89
+// no ui note support
+};
+
+} // namespace 
+
+#endif /* CPTELEPHONYUTILSDEFS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonelocalisation.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include "cpphonelocalisation.h"
+#include "cppluginlogging.h"
+#include <QTranslator>
+#include <QLocale>
+#include <QApplication>
+
+
+// Constant definitions 
+const char *TS_FILE_TELEPHONE_CP = "telephone_cp";
+const char *TS_FILE_COMMON = "common"; 
+
+/*!
+    \class CpPhoneLocalisation
+    \brief Localisation utility class for 
+           Telephony control panel plugins. 
+
+    Use installTranslator function for installing 
+    needed translation files. 
+    
+    Takes ownership of the created QTranslator objects
+    and destroys them when CpPhoneLocalisation 
+    object is destructed. 
+*/
+
+
+/*!
+    CpPhoneLocalisation::CpPhoneLocalisation() 
+*/
+CpPhoneLocalisation::CpPhoneLocalisation(QObject *parent)
+ :QObject(parent)
+{
+    DPRINT; 
+}
+
+
+/*!
+    CpPhoneLocalisation::~CpPhoneLocalisation() 
+*/
+CpPhoneLocalisation::~CpPhoneLocalisation()
+{
+    DPRINT << ":IN"; 
+    removeTranslators();
+    DPRINT << ":OUT";
+}
+
+
+/*!
+    CpPhoneLocalisation::installTranslator() 
+*/
+bool CpPhoneLocalisation::installTranslator(
+        TranslationFileId translationFileId)
+{
+    DPRINT << ": IN";
+   
+    QString lang = QLocale::system().name();
+    QString path = "z:/resource/qt/translations/";
+    bool translatorLoaded(false);  
+
+    QString fileName; 
+    switch (translationFileId) {
+        case TranslationFileTelephoneCp: 
+            fileName = TS_FILE_TELEPHONE_CP; 
+            break; 
+        case TranslationFileCommon:
+            fileName = TS_FILE_COMMON; 
+            break;
+        default: 
+            break; 
+    }
+
+    if (!fileName.isEmpty()) {
+        QTranslator* translator = new QTranslator;
+        translatorLoaded = translator->load(
+                path + fileName + "_" + lang);
+        if (translatorLoaded) {
+            m_translators.append(translator); 
+            qApp->installTranslator(translator);
+            DPRINT << ": translator installed: " << fileName; 
+        } else {
+            delete translator; 
+            translator = NULL;
+            DWARNING << ": WARNING! Translator not loaded!";
+        }
+    }
+
+    DPRINT << ": OUT";
+    return translatorLoaded;
+}
+
+
+/*!
+    CpPhoneLocalisation::removeTranslators()
+*/
+void CpPhoneLocalisation::removeTranslators()
+{
+    DPRINT << ": IN";
+
+    foreach (QTranslator *translator, m_translators) {
+        qApp->removeTranslator(translator);
+    }    
+    qDeleteAll(m_translators);
+    m_translators.clear();
+    
+    DPRINT << ": OUT";
+}
+
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpphonenotes.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,551 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "cpphonenotes.h"
+#include "cpplugincommon.h"
+#include "cppluginlogging.h"
+#include <hbdevicemessagebox.h>
+#include <HbDeviceProgressDialog>
+#include <hblistview.h>
+#include <hbdialog.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <QStandardItemModel>
+#include <QItemSelectionModel>
+#include <hbstringutil.h>
+#include <hbextendedlocale.h>
+#include <HbInputDialog>
+#include <HbEditorInterface>
+#include <hbinputdef.h>
+#include <hbinputstandardfilters.h>
+
+/*!
+  CpPhoneNotes::instance.
+ */
+CpPhoneNotes* CpPhoneNotes::instance()
+{
+    DPRINT << ": IN";
+  
+    static CpPhoneNotes theInstance;
+    
+    DPRINT << ", instance address: " << reinterpret_cast<int>(&theInstance);
+    return &theInstance;
+}
+ 
+/*!
+  CpPhoneNotes::CpPhoneNotes.
+ */
+CpPhoneNotes::CpPhoneNotes(): 
+     QObject(NULL), 
+     m_notesQueue(NULL),
+     m_isNoteShowingOngoing(false),
+     m_passwordDialog(NULL),
+     m_passwordValidator(NULL)
+    {
+    DPRINT << ": IN";
+
+    m_notesQueue = new QQueue<QObject*>();
+    m_cpSettingsWrapper = new CpSettingsWrapper;
+    
+    DPRINT << ": OUT";
+    }
+
+/*!
+  CpPhoneNotes::~CpPhoneNotes.
+ */
+CpPhoneNotes::~CpPhoneNotes()
+{
+    DPRINT << ": IN";
+
+    delete m_cpSettingsWrapper;
+    QObject* note(NULL);
+    foreach (note, *m_notesQueue) {
+        delete note;
+    }
+    delete m_notesQueue;
+    if(m_passwordDialog) {
+        delete m_passwordDialog;
+    }
+        
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::showGlobalProgressNote.
+ */
+void CpPhoneNotes::showGlobalProgressNote(
+    int &noteId, const QString& text)
+{
+    DPRINT << ": IN";
+    
+    HbDeviceProgressDialog *note = 
+        new HbDeviceProgressDialog(HbProgressDialog::WaitDialog, this);
+    note->setText(text);
+    QAction *action = new QAction(hbTrId("txt_common_button_hide"), this);
+    //Ownership of action is not transferred. Deleted when note closes.
+    note->setAction(action, HbDeviceProgressDialog::CancelButtonRole );
+    noteId = reinterpret_cast<int>(note);
+    DPRINT << ", NOTEID: " << noteId;
+    QObject::connect(
+        note, SIGNAL(aboutToClose()),
+        this, SLOT(activeNoteAboutToClose()));
+    QObject::connect(
+        note, SIGNAL(cancelled()),
+        this, SLOT(handleProgressNoteCanceled()));
+    m_notesQueue->enqueue(note);    
+    launchNextNoteIfReady();
+    
+    DPRINT << ": OUT";
+}
+    
+/*!
+  CpPhoneNotes::showGlobalNote.
+ */
+void CpPhoneNotes::showGlobalNote(int &noteId, const QString& text, 
+    HbMessageBox::MessageBoxType messageBoxType)
+{
+    DPRINT << ": IN";
+
+    HbDeviceMessageBox *note
+        = new HbDeviceMessageBox(text, messageBoxType, this);
+    if (messageBoxType == HbMessageBox::MessageTypeQuestion ||
+        messageBoxType == HbMessageBox::MessageTypeInformation) {
+        note->setTimeout(HbPopup::ConfirmationNoteTimeout);
+    }
+    else {
+        note->setTimeout(0);
+    }
+    noteId = reinterpret_cast<int>(note);
+    DPRINT << ", NOTEID: " << noteId;
+    
+    QObject::connect(
+        note, SIGNAL(aboutToClose()),
+        this, SLOT(activeNoteAboutToClose()));
+    
+    m_notesQueue->enqueue(note);
+    launchNextNoteIfReady();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::showBasicServiceList.
+ */
+void CpPhoneNotes::showBasicServiceList(
+    const QString &title, 
+    const QList<unsigned char> &basicServiceGroupIds)
+{
+    DPRINT << ": IN";
+    
+    Q_ASSERT(title != "");
+    Q_ASSERT(0 < basicServiceGroupIds.count());
+    
+    QScopedPointer<HbDialog> serviceListPopup(new HbDialog());
+    serviceListPopup->setDismissPolicy(HbDialog::NoDismiss);
+    serviceListPopup->setTimeout(HbPopup::NoTimeout);
+    
+    QScopedPointer<HbLabel> heading(
+        new HbLabel(title, serviceListPopup.data()));
+    heading->setAlignment(Qt::AlignLeft | Qt::AlignTop);
+    serviceListPopup->setHeadingWidget(heading.take());
+    
+    QScopedPointer<HbListView> serviceList(
+        new HbListView(serviceListPopup.data()));
+    QScopedPointer<QStandardItemModel> serviceListModel(
+        new QStandardItemModel(serviceList.data()));
+    for (int i = 0; i < basicServiceGroupIds.count(); i++) {
+        BasicServiceGroups groupId = 
+            static_cast<BasicServiceGroups>(basicServiceGroupIds.at(i));
+        QString groupName = basicServiceGroupName(groupId);
+        QScopedPointer<QStandardItem> listItem(new QStandardItem(groupName));
+        serviceListModel->appendRow(listItem.take());
+    }
+    serviceList->setModel(serviceListModel.take());
+    serviceList->setSelectionMode(HbAbstractItemView::NoSelection);
+    serviceListPopup->setContentWidget(serviceList.take());
+    
+    HbAction *backAction = 
+        new HbAction(hbTrId("txt_common_button_back"), serviceListPopup.data());
+    serviceListPopup->setPrimaryAction(backAction);
+    
+    HbDialog *serviceListPopupDialog = serviceListPopup.take();
+    QObject::connect(
+        serviceListPopupDialog, SIGNAL(finished(HbAction*)), 
+        serviceListPopupDialog, SLOT(deleteLater()));
+    serviceListPopupDialog->show();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::cancelNote.
+ */
+void CpPhoneNotes::cancelNote(int noteId)
+{
+    DPRINT << ": IN";
+    
+    if (!m_notesQueue->isEmpty()) {
+        QObject *note = m_notesQueue->head();
+        if(note == reinterpret_cast<QObject *>(noteId)) {
+            int index = m_notesQueue->indexOf(reinterpret_cast<QObject *>(noteId));
+            Q_ASSERT(-1 < index);
+            QObject *note = m_notesQueue->at(index);
+            DPRINT << ": NOTEID: " << noteId;
+            if (qobject_cast<HbDeviceProgressDialog *>(note)) {
+                static_cast<HbDeviceProgressDialog *>(note)->close();
+            } else if (qobject_cast<HbDeviceMessageBox *>(note)) {
+                static_cast<HbDeviceMessageBox *>(note)->close();
+            } else {
+                DPRINT << ", UNKNOWN NOTE";
+                Q_ASSERT(false);
+            }
+        }
+        else {
+            DPRINT << ": remove from queue, noteId: " << noteId;
+            m_notesQueue->removeOne(reinterpret_cast<QObject *>(noteId));
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::noteShowing.
+ */
+bool CpPhoneNotes::noteShowing()
+{
+    return !m_notesQueue->isEmpty();
+}
+
+/*!
+  CpPhoneNotes::basicServiceGroupName.
+  Resolves basic service group name by group identifier.
+ */
+QString CpPhoneNotes::basicServiceGroupName(BasicServiceGroups basicServiceGroupId) const
+{
+    DPRINT << ": IN";
+    
+    QString string = "";
+    switch (basicServiceGroupId) {
+        case AllTeleAndBearer:
+            string = hbTrId("All services");
+            break;
+        case AllTele:
+            string = hbTrId("Voice, fax and messages");
+            break;
+        case Telephony:
+            string = hbTrId("Voice calls");
+            break;
+        case AllDataTele:
+            string = hbTrId("Fax and messages");
+            break;
+        case Fax:
+            string = hbTrId("Fax");
+            break;
+        case Sms:
+            string = hbTrId("Messages");
+            break;
+        case AllTeleExcSms:
+            string = hbTrId("Voice calls and fax");
+            break;
+        case AllBearer:
+            if (Tools::videoSupported()) {
+                string = hbTrId("Data and video services");
+            } else {
+                string = hbTrId("Data services");
+            }
+            break;
+        case AllAsync:
+            string = hbTrId("Asynchronous services");
+            break;
+        case AllSync:
+            string = hbTrId("Synchronous services");
+            break;
+        case SyncData:
+            string = hbTrId("Synchronous data services");
+            break;
+        case AsyncData:
+            string = hbTrId("Asynchronous data services");
+            break;
+        case PacketData:
+            string = hbTrId("Packet data");
+            break;
+        case PadAccess:
+            string = hbTrId("PAD access");
+            break;
+        case 30:
+            string = hbTrId("Video calls");
+            break;
+        case AltTele:
+            string = hbTrId("Alternate line services");
+            break;
+        default:
+            DPRINT << ", DEFAULT";
+            break;
+    }
+    
+    DPRINT << ": OUT";
+    return string;
+}
+
+/*!
+  CpPhoneNotes::showGlobalErrorNote.
+ */
+void CpPhoneNotes::showGlobalErrorNote(int &noteId, int errorcode)
+{
+    DPRINT << ": IN";
+    
+    QString errorText = "";
+    Tools::errorCodeTextMapping(errorcode, errorText);
+
+    HbDeviceMessageBox *note 
+        = new HbDeviceMessageBox(errorText, HbMessageBox::MessageTypeWarning, this);
+    note->setTimeout(0);
+    noteId = reinterpret_cast<int>(note);
+    DPRINT << ", NOTEID: " << noteId;
+    QObject::connect(
+        note, SIGNAL(aboutToClose()),
+        this, SLOT(activeNoteAboutToClose()));
+    m_notesQueue->enqueue(note);
+    launchNextNoteIfReady();
+    
+    DPRINT << ": OUT";
+} 
+
+/*!
+  CpPhoneNotes::showCallDivertDetails.
+ */
+void CpPhoneNotes::showCallDivertDetails(
+    const PSCallDivertingStatus &divertStatus)
+{
+    DPRINT << ": IN";
+    
+    QScopedPointer<HbMessageBox> divertInfoScopedPointer(
+        new HbMessageBox(HbMessageBox::MessageTypeInformation));
+    divertInfoScopedPointer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+    
+    // TODO: Orbit layout support is insufficient currently and all text
+    // is not shown.
+    QString content = "";
+    content.append(hbTrId("txt_phone_info_number"));
+    content.append(formatPhoneNumber(divertStatus.iNumber));
+    if (0 < divertStatus.iTimeout) {
+        content.append(hbTrId("txt_phone_setlabel_delay"));
+        content.append(QString::number(divertStatus.iTimeout));
+        content.append(hbTrId(" seconds"));
+    }
+    divertInfoScopedPointer->setText(content);
+    HbAction *backAction = new HbAction(
+        hbTrId("txt_common_button_back"), 
+        divertInfoScopedPointer.data());
+    divertInfoScopedPointer->setPrimaryAction(backAction);
+    
+    HbMessageBox *divertInfo = divertInfoScopedPointer.take();
+    QObject::connect(
+            divertInfo, SIGNAL(finished(HbAction*)), 
+            divertInfo, SLOT(deleteLater()));
+    divertInfo->show();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::showPasswordQueryDialog.
+ */
+void CpPhoneNotes::showPasswordQueryDialog(
+    const QString &title, 
+    const QValidator &validator,
+    int maxPasswordLength)
+{
+    DPRINT << ": IN";
+    
+    QScopedPointer<HbInputDialog> passwordDialog(new HbInputDialog());
+    
+    // configure editor so that only digits can be inputted
+    passwordDialog->setPromptText(title);
+    passwordDialog->setEchoMode(HbLineEdit::Password);
+    passwordDialog->setInputMethodHints(Qt::ImhDigitsOnly);
+    HbLineEdit *hbLineEdit = passwordDialog->lineEdit();
+    hbLineEdit->setMaxLength(maxPasswordLength);
+    HbEditorInterface editorInterface(hbLineEdit);
+    
+    editorInterface.setMode(HbInputModeNumeric);
+    editorInterface.setInputConstraints(HbEditorConstraintFixedInputMode);
+    
+    editorInterface.setFilter(HbDigitsOnlyFilter::instance());
+    
+    m_passwordValidator = &validator;
+    passwordDialog->primaryAction()->setEnabled(false);
+    connect(
+        hbLineEdit, SIGNAL(contentsChanged()), 
+        this, SLOT(passwordTextChanged()));
+    
+    passwordDialog->open(this, SLOT(finishedPasswordQueryDialog(HbAction*)));
+	if(m_passwordDialog) {
+		m_passwordDialog->deleteLater();
+		m_passwordDialog = NULL;
+	}
+    m_passwordDialog = passwordDialog.take();
+        
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::finishedPasswordQueryDialog.
+ */
+void CpPhoneNotes::finishedPasswordQueryDialog(HbAction* action)
+{
+    bool ok;
+    QString password;
+    if(m_passwordDialog) {
+        if (action == m_passwordDialog->secondaryAction()) {
+            ok = false;
+        } else {
+            ok = true;
+            password = m_passwordDialog->value().toString();
+        }
+        
+        disconnect(
+            m_passwordDialog->lineEdit(), SIGNAL(contentsChanged()), 
+            this, SLOT(passwordTextChanged()));
+        
+        m_passwordDialog->deleteLater();
+        m_passwordDialog = NULL;
+        m_passwordValidator = NULL;
+        
+        emit passwordQueryCompleted(password, ok);
+    }
+}
+
+/*!
+  CpPhoneNotes::formatPhoneNumber.
+  Formats phone number according to locale specific rules.
+ */
+QString CpPhoneNotes::formatPhoneNumber(QString number) const
+{
+    DPRINT << ": IN";
+    
+    QString formattedNumber = number;
+    
+    if (m_cpSettingsWrapper->numberGroupingSupported() == true) {
+        // TODO: utilize HbNumberGrouping API when available
+    }
+    
+    // TODO: digit conversion e.g. into arabic-indic
+//    HbExtendedLocale locale = HbExtendedLocale::system();
+//    HbStringUtil::convertDigitsTo(formattedNumber, ArabicIndicDigit);
+    
+    DPRINT << ": OUT";
+
+    return formattedNumber;
+}
+
+/*!
+  CpPhoneNotes::launchNextNoteIfReady.
+ */
+void CpPhoneNotes::launchNextNoteIfReady()
+{
+    DPRINT << ": IN";
+    
+    if (m_notesQueue->isEmpty()) {
+        DPRINT << ", QUEUE EMPTY";
+        return;
+    }
+    if (!m_isNoteShowingOngoing) {
+        m_isNoteShowingOngoing = true;
+        // note is left in the queue so that it can be cancelled at request
+        QObject *note = m_notesQueue->head();
+        DPRINT << ", note: " << reinterpret_cast<int>(note);
+        if (qobject_cast<HbDeviceProgressDialog *>(note)) {
+            DPRINT << ", show HbDeviceProgressDialog";
+            static_cast<HbDeviceProgressDialog *>(note)->show();
+        } else if (qobject_cast<HbDeviceMessageBox *>(note)) {
+            DPRINT << ", show HbDeviceMessageBox";    
+            static_cast<HbDeviceMessageBox *>(note)->show();
+        } else {
+            DPRINT << ", UNKNOWN NOTE";
+            Q_ASSERT(false);
+        }
+    } else {
+        DPRINT << ", BUSY";
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::activeNoteAboutToClose.
+ */
+void CpPhoneNotes::activeNoteAboutToClose()
+{
+    DPRINT << ": IN";
+    
+    if (m_isNoteShowingOngoing) {
+        m_isNoteShowingOngoing = false;
+        QObject* note(NULL);
+        if (!m_notesQueue->isEmpty()) {
+            note = m_notesQueue->dequeue();
+        }
+        if(note) {
+            launchNextNoteIfReady();
+            note->disconnect(this);
+            DPRINT << ", delete note: " << reinterpret_cast<int>(note);
+            HbDeviceProgressDialog *pNote = 
+                qobject_cast<HbDeviceProgressDialog *>(note);
+            if(pNote){
+                delete pNote->action();
+            }
+            note->deleteLater();
+        }
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::handleProgressNoteCanceled().
+ */
+void CpPhoneNotes::handleProgressNoteCanceled()
+{
+    DPRINT << ": IN";
+    
+    emit progressNoteCanceled();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpPhoneNotes::passwordTextChanged().
+ */
+void CpPhoneNotes::passwordTextChanged()
+{
+    DPRINT << ": IN";
+    Q_ASSERT(m_passwordDialog && m_passwordValidator);
+    
+    HbLineEdit *hbLineEdit = m_passwordDialog->lineEdit();
+    int position = 0;
+    QString password = hbLineEdit->text();
+    bool isPasswordValid = 
+        (QValidator::Acceptable == m_passwordValidator->validate(
+            password, position));
+    m_passwordDialog->primaryAction()->setEnabled(isPasswordValid);
+    
+    DPRINT << ": OUT";
+}
+
+// End of File.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon.cpp	Fri Jun 04 10:19:18 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:
+ *
+ */
+
+
+#include <etelmm.h>
+#include <xqsysinfo.h>
+#include <xqsettingsmanager.h>
+#include <xqsettingskey.h>
+#include <e32base.h>
+#include <etelmm.h>
+#include <exterror.h>               
+#include <gsmerror.h>
+#include <settingsinternalcrkeys.h>
+#include <LogsDomainCRKeys.h>
+#include <BTSapDomainPSKeys.h>
+#include <NumberGroupingCRKeys.h>
+#include <hbglobal.h>
+#include <CoreApplicationUIsSDKCRKeys.h>
+#include "cptelephonyutilsdefs.h"
+#include "cpplugincommon.h"
+#include "cppluginlogging.h"
+
+const int CenrepKeyValueOff = 0;
+const int CenrepKeyValueOn = 1;
+
+const int SoftRejectTextDefault = 0; 
+const int SoftRejectTextUserDefined = 1; 
+
+/*!
+  Tools::voipSupported
+*/
+bool Tools::voipSupported()
+{
+    return XQSysInfo::isSupported(KFeatureIdCommonVoip);
+}
+
+/*!
+  Tools::videoSupported
+*/
+bool Tools::videoSupported()
+{
+    return XQSysInfo::isSupported(KFeatureIdCsVideoTelephony);
+}
+
+/*!
+  Tools::errorCodeTextMapping.
+ */
+bool Tools::errorCodeTextMapping(const int errorcode, QString &errorText)
+{
+    DPRINT;
+    errorText.clear();
+    bool errorTextFound(true);
+
+    switch(errorcode){
+        case KErrGsmSSSubscriptionViolation:
+            errorText = hbTrId("txt_phone_info_barring_operation_not_successful");
+            break;
+        case KErrGsmSSUnknownSubscriber:
+        case KErrGsmSSAbsentSubscriber:
+        case KErrGsmSSIllegalOperation:
+        case KErrGsmSSIllegalSubscriber:
+        case KErrGsmSSIllegalEquipment:
+        case KErrGsmSSCallBarred:
+        case KErrGsmSSDataMissing:
+            errorText = hbTrId("txt_phone_info_not_allowed");
+            break;
+        case KErrGsmSSIncompatibility:
+            errorText = hbTrId("Services in conflict");
+            break;
+        case KErrGsmSSSystemFailure:
+            errorText = hbTrId("txt_phone_info_result_unknown");
+            break;
+        case KErrGsmSSUnexpectedDataValue:
+        case KErrGsmSSResourcesUnavailable:
+            errorText = hbTrId("txt_phone_info_request_rejected");
+            break;
+        case KErrGsmSSNegativePasswordCheck:
+        case KErrGsmSSPasswordRegistrationFailure:
+            errorText = hbTrId("Password error");
+            break;
+        case KErrGsmSSPasswordAttemptsViolation:
+            errorText = hbTrId("txt_phone_info_barring_password_blocked");
+            break;
+        case KErrGsmSMSNoNetworkService:
+        case KErrGsmNoService:
+            errorText = hbTrId("No network coverage");
+            break;
+        case KErrSsActivationDataLost:
+            errorText = hbTrId("Check network services");
+            break;
+        case KErrGsmOfflineOpNotAllowed:
+            if(XQSysInfo::isSupported(KFeatureIdOfflineMode)){
+                XQSettingsManager *xqsettingsManager = new XQSettingsManager();
+                XQSettingsKey key(XQSettingsKey::TargetPublishAndSubscribe,
+                        KPSUidBluetoothSapConnectionState.iUid,
+                        KBTSapConnectionState);
+                QVariant startupValue = xqsettingsManager->readItemValue(key);
+                int value = startupValue.toInt();
+                delete xqsettingsManager;
+                xqsettingsManager = NULL;
+                if (value == EBTSapConnected){
+                    errorText = hbTrId("Operation not possible in SIM access profile mode");
+                } else {
+                    errorText = hbTrId("Operation not possible in Off-line mode");
+                }
+            } else {
+                errorText = hbTrId("txt_phone_info_request_not_completed");
+            }
+            break;
+        case KErrGsmSSUnknownAlphabet:
+            errorText = hbTrId("txt_phone_info_invalid_phone_number");
+            break;
+        default:
+            errorText = hbTrId("txt_phone_info_request_not_completed");
+            break;
+    }
+
+    return errorTextFound;
+}
+
+CpSettingsWrapper::CpSettingsWrapper(QObject *parent): 
+    QObject(parent)
+{
+    m_Settings = new XQSettingsManager();
+}
+
+CpSettingsWrapper::~CpSettingsWrapper()
+{
+    delete m_Settings;
+}
+
+bool CpSettingsWrapper::showCallDuration()
+{
+    bool showDuration; 
+    if (CenrepKeyValueOn == readCenrepValue(KCRUidLogs.iUid, KLogsShowCallDuration).toInt()) {
+        showDuration = true; 
+    } else {
+        showDuration = false;
+    }
+    
+    DPRINT << "show call duration:" << showDuration;
+    return showDuration;
+}
+
+int CpSettingsWrapper::setShowCallDuration(bool value)
+{
+    int cenrepValue; 
+    DPRINT << "show call duration:" << value;
+
+    if (value) {
+        cenrepValue = CenrepKeyValueOn;
+    } else {
+        cenrepValue = CenrepKeyValueOff; 
+    }
+    return writeCenrepValue(KCRUidLogs.iUid, KLogsShowCallDuration, cenrepValue );
+}
+
+void CpSettingsWrapper::readSoftRejectText(QString &text, bool &userDefined )
+{
+    if (SoftRejectTextDefault ==
+        readCenrepValue(KCRUidTelephonySettings.iUid, KSettingsSoftRejectDefaultInUse ).toInt()) {
+        userDefined = false; 
+    } else {
+        userDefined = true; 
+    }
+        
+    text = readCenrepString(KCRUidTelephonySettings.iUid, KSettingsSoftRejectText);
+    DPRINT << "text:" << text << " ,userDefined:" << userDefined;
+}
+
+int CpSettingsWrapper::writeSoftRejectText(const QString &text, bool userDefined )
+{
+    int err = writeCenrepValue(KCRUidTelephonySettings.iUid, KSettingsSoftRejectText, text);
+    int cenrepValue; 
+    if (userDefined) {
+        cenrepValue = SoftRejectTextUserDefined; 
+    } else {
+        cenrepValue = SoftRejectTextDefault; 
+    }
+    err |= writeCenrepValue(KCRUidTelephonySettings.iUid, KSettingsSoftRejectDefaultInUse, cenrepValue);
+    DPRINT << "text:" << text << " ,userDefined:" << userDefined << " , err:" << err;
+    return err;
+}
+
+ bool CpSettingsWrapper::numberGroupingSupported() const
+ {
+     return readCenrepValue(KCRUidNumberGrouping.iUid, KNumberGrouping).toBool();
+ }
+
+QVariant CpSettingsWrapper::readCenrepValue(
+    const long int uid, const unsigned long int key) const
+{
+    XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key);
+    QVariant ret = m_Settings->readItemValue(settingsKey);
+    DPRINT << "ret: " << ret;
+    return ret;
+}
+
+QString CpSettingsWrapper::readCenrepString(
+    const long int uid, const unsigned long int key) const
+{
+    XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key);
+    QString text = m_Settings->readItemValue(settingsKey, XQSettingsManager::TypeString).toString();
+    DPRINT << "text: " << text;
+    return text;
+}
+
+int CpSettingsWrapper::writeCenrepValue(
+    const long int uid, const unsigned long int key, const QVariant &settingsKeyValue ) const
+{
+    DPRINT << "uid:" << uid << ", key:" << key << ", settingsKeyValue:" << settingsKeyValue;
+    XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, uid, key);
+    int err = m_Settings->writeItemValue(settingsKey, settingsKeyValue );
+    DPRINT << "err: " << err;
+    return err;
+}
+
+bool CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled()
+{
+    bool enabled = readCenrepValue(KCRUidPhoneSettings.iUid, KPSetCallWaiting).toBool();
+    DPRINT << "enabled: " << enabled;
+    return enabled;
+}
+
+bool CpSettingsWrapper::isPhoneOffline() const
+{
+    bool offLinesupport(false);
+    if (XQSysInfo::isSupported(KFeatureIdOfflineMode)) {
+        offLinesupport = !readCenrepValue(
+                KCRUidCoreApplicationUIs.iUid, 
+                KCoreAppUIsNetworkConnectionAllowed).toBool();
+    }
+    return offLinesupport;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon_s.cpp	Fri Jun 04 10:19:18 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 "cpplugincommon.h"
+#include "cppluginlogging.h"
+#include <hbglobal.h>
+
+
+bool Tools::voipSupported()
+{
+    DPRINT << "DUMMY WRAPPER";
+    return true;
+}
+
+bool Tools::videoSupported()
+{
+    DPRINT << "DUMMY WRAPPER";
+    return true;
+}
+
+/*!
+  Tools::convertEtelMobileServiceCode.
+*/
+BasicServiceGroups Tools::convertEtelMobileServiceCode(int serviceCode)
+{
+    DPRINT << "DUMMY WRAPPER: DEFAULT code";
+    return Unknown;
+}
+
+
+/*!
+  Tools::errorCodeTextMapping.
+ */
+bool Tools::errorCodeTextMapping(const int errorcode, QString &errorText)
+{
+    DPRINT << "DUMMY WRAPPER";
+    errorText.clear();
+    bool errorTextFound(true);
+    errorText = hbTrId("Not done");
+    return errorTextFound;
+}
+
+
+CpSettingsWrapper::CpSettingsWrapper(QObject *parent): 
+    QObject(parent)
+{
+    DPRINT << "DUMMY WRAPPER";
+}
+
+CpSettingsWrapper::~CpSettingsWrapper()
+{
+    DPRINT << "DUMMY WRAPPER";
+}
+
+bool CpSettingsWrapper::showCallDuration()
+{
+    DPRINT << "DUMMY WRAPPER";
+    return 0;
+}
+
+int CpSettingsWrapper::setShowCallDuration(bool value)
+{
+    DPRINT << "DUMMY WRAPPER: value:" << value;
+    return 0;
+}
+
+void CpSettingsWrapper::readSoftRejectText(QString &text, bool &userDefined)
+{
+    DPRINT << "DUMMY WRAPPER: text:" << text << " ,userDefined:" << userDefined;
+}
+
+int CpSettingsWrapper::writeSoftRejectText(const QString &text, bool userDefined)
+{
+    DPRINT << "DUMMY WRAPPER: text:" << text << " ,userDefined:" << userDefined;
+    return 0;
+}
+
+bool CpSettingsWrapper::numberGroupingSupported() const
+{
+    DPRINT << "DUMMY WRAPPER";
+    return true;
+}
+
+
+bool CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled()
+{
+    bool enabled = false;
+    DPRINT << "DUMMY WRAPPER: enabled: " << enabled;
+    return enabled;
+}
+
+
+bool CpSettingsWrapper::isPhoneOffline() const
+{
+    bool enabled = false;
+    DPRINT << "DUMMY WRAPPER: enabled: " << enabled;
+    return enabled;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs --config winscw_udeb --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+    call %PATH_TO_DLL%\%%a.exe
+    move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_cpphonelocalisation.h"
+#include "qtestmains60.h"
+#include <smcmockclassincludes.h>
+#define private public
+#include "cpphonelocalisation.h"
+
+void QCoreApplication::installTranslator(QTranslator * messageFile)
+{
+    SMC_MOCK_METHOD1( void, QTranslator *, messageFile)
+}
+
+/*!
+  UT_cpphonelocalisation::UT_cpphonelocalisation
+ */
+UT_cpphonelocalisation::UT_cpphonelocalisation() 
+{
+    
+}
+
+/*!
+  UT_cpphonelocalisation::~UT_cpphonelocalisation
+ */
+UT_cpphonelocalisation::~UT_cpphonelocalisation()
+{
+    
+}
+
+/*!
+  UT_cpphonelocalisation::init
+ */
+void UT_cpphonelocalisation::init()
+{
+    initialize();
+    
+    m_phoneLocalisation.reset(new CpPhoneLocalisation); 
+}
+
+/*!
+  UT_cpphonelocalisation::cleanup
+ */
+void UT_cpphonelocalisation::cleanup()
+{
+    reset();
+    delete m_phoneLocalisation.take(); 
+}
+
+/*!
+  UT_cpphonelocalisation::t_memleak
+ */
+void UT_cpphonelocalisation::t_memleak()
+{
+    
+}
+
+/*!
+  UT_cpphonelocalisation::t_installTranslator
+ */
+void UT_cpphonelocalisation::t_installTranslator()
+{
+    
+    // Test: successfull load  
+    expect("QTranslator::load").
+        returns(true);    
+    expect("QCoreApplication::installTranslator").times(1);
+    
+    m_phoneLocalisation->installTranslator(
+            CpPhoneLocalisation::TranslationFileCommon);
+    QVERIFY(m_phoneLocalisation->m_translators.count() == 1);
+    QVERIFY(verify());
+    
+    // Test: failing load  
+    expect("QTranslator::load").
+        returns(false);
+    expect("QCoreApplication::installTranslator").times(0);
+    m_phoneLocalisation->installTranslator(
+            CpPhoneLocalisation::TranslationFileCommon);
+    QVERIFY(m_phoneLocalisation->m_translators.count() == 1);
+    QVERIFY(verify());
+    
+    // Test: telephone_cp translator load 
+    expect("QTranslator::load").
+        returns(false);
+    expect("QCoreApplication::installTranslator").times(0);
+    m_phoneLocalisation->installTranslator(
+            CpPhoneLocalisation::TranslationFileTelephoneCp);
+    QVERIFY(verify());
+ 
+}
+
+/*!
+  UT_cpphonelocalisation::t_removeTranslators
+ */
+void UT_cpphonelocalisation::t_removeTranslators()
+{
+    expect("QTranslator::load").
+        returns(true);
+    
+    m_phoneLocalisation->installTranslator(
+            CpPhoneLocalisation::TranslationFileCommon); 
+    m_phoneLocalisation->installTranslator(
+            CpPhoneLocalisation::TranslationFileTelephoneCp);
+    
+    m_phoneLocalisation->removeTranslators(); 
+    QVERIFY(m_phoneLocalisation->m_translators.count() == 0);
+    QVERIFY(verify());
+}
+
+
+
+
+QTEST_MAIN_S60(UT_cpphonelocalisation)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.h	Fri Jun 04 10:19:18 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 UT_CPPHONELOCALISATION_H
+#define UT_CPPHONELOCALISATION_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpPhoneLocalisation; 
+
+class UT_cpphonelocalisation : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_cpphonelocalisation();
+    ~UT_cpphonelocalisation();
+    
+private slots:
+    void init();
+    void cleanup();
+    void t_memleak();
+    void t_installTranslator();
+    void t_removeTranslators(); 
+ 
+private: 
+    QScopedPointer<CpPhoneLocalisation> m_phoneLocalisation; 
+    
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonelocalisation/ut_cpphonelocalisation.pro	Fri Jun 04 10:19:18 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: 
+#
+
+CONFIG += qtestlib
+CONFIG += hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += . ../../inc/
+DEFINES += BUILD_CPTELEPHONYUTILS 
+    
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib -lsymbianmock
+}
+
+# test code
+HEADERS += ut_cpphonelocalisation.h
+SOURCES += ut_cpphonelocalisation.cpp
+
+# code to be tested
+HEADERS += ../../inc/cpphonelocalisation.h 
+           
+SOURCES += ../../src/cpphonelocalisation.cpp
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_qtranslator.cpp 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/qtestmains60ui.h	Fri Jun 04 10:19:18 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 QTESTMAINS60
+#define QTESTMAINS60
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+char *new_argv[3];
+HbMainWindow *mainWindow;
+#define QTEST_MAIN_S60UI(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+HbApplication app(argc, argv); \
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+QResource::registerResource("../hbcore.rcc"); \
+mainWindow = new HbMainWindow;\
+mainWindow->show(); \
+int ret = QTest::qExec(&tc, 3, new_argv); \
+delete mainWindow; \
+return ret; \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_cpphonenotes.h"
+#include "qtestmains60ui.h"
+#include <hbmainwindow.h>
+#include <HbDeviceMessageBox.h>
+#include <HbMessageBox.h>
+#define private public
+#include "cpphonenotes.h"
+
+/*!
+  UT_CpPhoneNotes::UT_CpPhoneNotes
+ */
+UT_CpPhoneNotes::UT_CpPhoneNotes() 
+{
+    CpPhoneNotes::instance();
+}
+
+/*!
+  UT_CpPhoneNotes::~UT_CpPhoneNotes
+ */
+UT_CpPhoneNotes::~UT_CpPhoneNotes()
+{
+    //delete m_psui;
+}
+
+/*!
+  UT_CpPhoneNotes::timerEvent
+ */
+void UT_CpPhoneNotes::timerEvent( QTimerEvent* event )
+{
+    QString currentTest(QTest::currentTestFunction());
+    qDebug() << "timerEvent:" << currentTest;
+    
+    if (currentTest == "t_showGlobalErrorNote") {
+        verifyGlobalNote(wantedNoteText);
+    }
+    
+    if (m_noteid1) {
+        CpPhoneNotes::instance()->cancelNote(m_noteid1);
+        m_noteid1 = 0;
+    }
+    if (m_noteid2) {
+        CpPhoneNotes::instance()->cancelNote(m_noteid2);
+        m_noteid2 = 0;
+    }
+    if (m_noteid3) {
+        CpPhoneNotes::instance()->cancelNote(m_noteid3);
+        m_noteid3 = 0;
+    }
+    
+    if (visibleDialog()) {
+        visibleDialog()->close();
+        QTest::qWait(1);
+    }
+	
+}
+
+/*!
+  UT_CpPhoneNotes::visibleDialog
+ */
+HbDialog *UT_CpPhoneNotes::visibleDialog()
+{
+    QList<QGraphicsItem*> items = mainWindow->scene()->items();
+    foreach (QGraphicsItem* item, items) {
+        HbDialog *w = qobject_cast<HbDialog*>(item->parentWidget());
+        if (w && w->isVisible()) {
+            qDebug() << "visibleDialog: " << w->getStaticMetaObject().className() <<
+                    "contentWidget: " << w->contentWidget()->getStaticMetaObject().className();
+            return w;
+        }
+    }
+    
+    return 0;
+}
+
+/*!
+  UT_CpPhoneNotes::verifyGlobalNote
+ */
+void UT_CpPhoneNotes::verifyGlobalNote( const QString& noteText )
+{
+    qDebug() << "verifyGlobalNote:" << noteText;
+    HbDeviceMessageBox *note=0;
+    QObject* o=0;
+    QVERIFY(CpPhoneNotes::instance()->m_notesQueue->count());
+    QVERIFY(o = CpPhoneNotes::instance()->m_notesQueue->at(0));
+    QVERIFY(note = qobject_cast<HbDeviceMessageBox *>(o));
+    QCOMPARE(note->text(), noteText);
+    note->close();
+    QTest::qWait(1);
+}
+
+/*!
+  UT_CpPhoneNotes::init
+ */
+void UT_CpPhoneNotes::init()
+{
+    initialize();
+    timerid = startTimer(3000);
+    m_noteid1 = 0;
+    m_noteid2 = 0;
+    m_noteid3 = 0;
+}
+
+/*!
+  UT_CpPhoneNotes::cleanup
+ */
+void UT_CpPhoneNotes::cleanup()
+{
+    reset();
+    if (timerid) {
+        killTimer(timerid);
+        timerid = 0;
+    }
+}
+
+/*!
+  UT_CpPhoneNotes::t_memleak
+ */
+void UT_CpPhoneNotes::t_memleak()
+{
+    
+}
+
+/*!
+  UT_CpPhoneNotes::t_showProgressNote
+ */
+void UT_CpPhoneNotes::t_showProgressNote()
+{
+    CpPhoneNotes::instance()->showGlobalProgressNote(m_noteid1, "test");
+    CpPhoneNotes::instance()->showGlobalProgressNote(m_noteid2, "test");
+    QTest::qWait(5000);
+}
+
+/*!
+  UT_CpPhoneNotes::t_showGlobalProgressNote
+ */
+void UT_CpPhoneNotes::t_showGlobalProgressNote()
+{
+    CpPhoneNotes::instance()->showGlobalProgressNote(m_noteid1, "test");
+    QTest::qWait(5000);
+}
+
+/*!
+  UT_CpPhoneNotes::t_showGlobalNote
+ */
+void UT_CpPhoneNotes::t_showGlobalNote()
+{
+    CpPhoneNotes::instance()->showGlobalNote(m_noteid1, "MessageTypeQuestion",HbMessageBox::MessageTypeQuestion );
+    CpPhoneNotes::instance()->showGlobalNote(m_noteid2, "MessageTypeInformation",HbMessageBox::MessageTypeInformation);
+    CpPhoneNotes::instance()->showGlobalNote(m_noteid3, "MessageTypeWarning",HbMessageBox::MessageTypeWarning );
+    
+}
+
+/*!
+  UT_CpPhoneNotes::t_showGlobalErrorNote
+ */
+void UT_CpPhoneNotes::t_showGlobalErrorNote()
+{
+    int errorcode = -1;
+    wantedNoteText = "";
+    expect("Tools::errorCodeTextMapping").with(errorcode,wantedNoteText).returns(true);
+    CpPhoneNotes::instance()->showGlobalErrorNote(m_noteid1, errorcode );
+    QVERIFY( verify() );
+
+}
+
+/*!
+  UT_CpPhoneNotes::t_showBasicServiceList
+ */
+void UT_CpPhoneNotes::t_showBasicServiceList()
+{
+    QList<unsigned char> basicServiceGroupIds;
+    basicServiceGroupIds << Telephony;
+    basicServiceGroupIds << AllDataTele;
+    CpPhoneNotes::instance()->
+        showBasicServiceList("Basic Service List", basicServiceGroupIds );
+}
+
+/*!
+  UT_CpPhoneNotes::t_showCallDivertDetails
+ */
+void UT_CpPhoneNotes::t_showCallDivertDetails()
+{
+    expect("CpSettingsWrapper::numberGroupingSupported").returns(QVariant(true));
+    PSCallDivertingStatus status;
+    CpPhoneNotes::instance()->showCallDivertDetails(status);
+    QVERIFY( verify() );
+
+    expect("CpSettingsWrapper::numberGroupingSupported").returns(QVariant(false));
+    status.iTimeout = 30;
+    CpPhoneNotes::instance()->showCallDivertDetails(status);
+    QVERIFY( verify() );
+}
+
+/*!
+  UT_CpPhoneNotes::t_showPasswordQueryDialog
+ */
+void UT_CpPhoneNotes::t_showPasswordQueryDialog()
+{
+    QString queryTitle("Password query title");
+    QString password = "";
+    bool okPressed = false;
+    QRegExp regExpression("\\d{4}");
+    QRegExpValidator validator(regExpression, this);
+    CpPhoneNotes::instance()->showPasswordQueryDialog(
+        queryTitle, validator, 5);
+
+}
+
+
+/*!
+  UT_CpPhoneNotes::t_cancelNote
+ */
+void UT_CpPhoneNotes::t_cancelNote()
+{
+    CpPhoneNotes::instance()->cancelNote(m_noteid1);
+    CpPhoneNotes::instance()->showGlobalProgressNote(m_noteid1, "test");
+    CpPhoneNotes::instance()->noteShowing();
+    CpPhoneNotes::instance()->cancelNote(m_noteid1);
+        
+    QTest::qWait(5000);
+}
+
+QTEST_MAIN_S60UI(UT_CpPhoneNotes)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.h	Fri Jun 04 10:19:18 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 UT_PSUI2NOTECONTROLLER_H
+#define UT_PSUI2NOTECONTROLLER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+#include <etelmm.h>
+#include <psetcalldivertingwrapper.h>
+
+class CpPhoneNotes;
+class HbDialog;
+
+
+class UT_CpPhoneNotes : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpPhoneNotes();
+    ~UT_CpPhoneNotes();
+    
+private: // From QObject
+    void timerEvent( QTimerEvent* event );
+    
+private: // Tools
+    HbDialog *visibleDialog();
+    void verifyGlobalNote( const QString& noteText );
+    void appendAllEtelServices(QList<PSCallDivertingStatus*>& list);
+    void appendService(
+            QList<PSCallDivertingStatus*>& list, 
+            RMobilePhone::TMobileService service);
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_memleak();
+    
+    void t_showProgressNote();
+    void t_showGlobalProgressNote();
+    void t_showGlobalNote();
+    void t_showGlobalErrorNote();
+    void t_showBasicServiceList();
+    void t_showCallDivertDetails();
+    void t_showPasswordQueryDialog();
+    void t_cancelNote();
+
+private:
+    int m_noteid1;
+    int m_noteid2;
+    int m_noteid3;
+    int timerid;
+    QString wantedNoteText;
+
+};
+
+#endif // UT_PSUI2NOTECONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpphonenotes/ut_cpphonenotes.pro	Fri Jun 04 10:19:18 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: 
+#
+
+
+CONFIG += hb qtestlib
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += . ../../inc/
+DEFINES += BUILD_CPTELEPHONYUTILS
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib -lsymbianmock
+}
+
+# test code
+HEADERS += ut_cpphonenotes.h
+SOURCES += ut_cpphonenotes.cpp
+
+# code to be tested
+HEADERS += ../../inc/cpphonenotes.h \
+           ../../inc/cptelephonyutilsdefs.h \
+           ../../inc/cpplugincommon.h
+           
+SOURCES += ../../src/cpphonenotes.cpp #    \
+#           ../../src/cpphonenotes_p.cpp
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpplugincommon.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_cpplugincommon.h"
+#include "qtestmains60.h"
+#include <gsmerror.h>
+#include <exterror.h>
+#include <etelmm.h>
+#include <btsapdomainpskeys.h>
+#define private public
+#include "cpplugincommon.h"
+
+/*!
+  UT_CpPluginCommon::UT_CpPluginCommon
+ */
+UT_CpPluginCommon::UT_CpPluginCommon() 
+    : mWrapper(NULL)
+{
+}
+
+/*!
+  UT_CpPluginCommon::~UT_CpPluginCommon
+ */
+UT_CpPluginCommon::~UT_CpPluginCommon()
+{
+    delete mWrapper;
+}
+
+/*!
+  UT_CpPluginCommon::init
+ */
+void UT_CpPluginCommon::init()
+{
+    initialize();
+
+    mWrapper = new CpSettingsWrapper();
+}
+
+/*!
+  UT_CpPluginCommon::cleanup
+ */
+void UT_CpPluginCommon::cleanup()
+{
+    reset();
+    
+    delete mWrapper;
+    mWrapper = NULL;
+}
+
+/*!
+  UT_CpPluginCommon::t_memleak
+ */
+void UT_CpPluginCommon::t_memleak()
+{
+    
+}
+
+/*!
+  UT_CpPluginCommon::t_memleak
+ */
+void UT_CpPluginCommon::t_showCallDuration()
+{
+    expect("XQSettingsManager::readItemValue").
+        returns(QVariant(23324));
+    
+    mWrapper->showCallDuration();
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpPluginCommon::t_memleak
+ */
+void UT_CpPluginCommon::t_setShowCallDuration()
+{
+    mWrapper->setShowCallDuration(true);
+}
+
+/*!
+  UT_CpPluginCommon::t_memleak
+ */
+void UT_CpPluginCommon::t_readSoftRejectText()
+{
+    QString text="";
+    bool userDefined=true;
+    expect("XQSettingsManager::readItemValue").
+            returns(QVariant(true));
+    
+    expect("XQSettingsManager::readItemValue").
+                returns(QVariant("text"));
+    
+    mWrapper->readSoftRejectText(text, userDefined);
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpPluginCommon::t_memleak
+ */
+void UT_CpPluginCommon::t_writeSoftRejectText()
+{
+    QString text="";
+    bool userDefined=true;
+    mWrapper->writeSoftRejectText(text, userDefined);
+}
+
+/*!
+  UT_CpPluginCommon::t_memleak
+ */
+void UT_CpPluginCommon::t_numberGroupingSupported()
+{
+    expect("XQSettingsManager::readItemValue").
+            returns(QVariant(true));
+    
+    mWrapper->numberGroupingSupported();
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpPluginCommon::t_voipSupported
+ */
+
+void UT_CpPluginCommon::t_voipSupported()
+{
+    expect("XQSysInfo::isSupported").with(
+            KFeatureIdCommonVoip).returns(false);
+    QCOMPARE( Tools::voipSupported(), false );
+    expect("XQSysInfo::isSupported").with(
+            KFeatureIdCommonVoip).returns(true);
+    QCOMPARE( Tools::voipSupported(), true );
+    
+    QVERIFY( verify() );
+}
+
+/*!
+  UT_CpPluginCommon::t_videoSupported
+ */
+void UT_CpPluginCommon::t_videoSupported()
+{
+    expect("XQSysInfo::isSupported").with(
+            KFeatureIdCsVideoTelephony).returns(true);
+    QCOMPARE( Tools::videoSupported(), true );
+    expect("XQSysInfo::isSupported").with(
+            KFeatureIdCsVideoTelephony).returns(false);
+    QCOMPARE( Tools::videoSupported(), false );
+    
+    QVERIFY( verify() );
+}
+
+/*!
+  UT_CpPluginCommon::t_memleak
+ */
+void UT_CpPluginCommon::t_errorCodeTextMapping()
+{
+    QString text = "";
+    Tools::errorCodeTextMapping(KErrGsmSSSubscriptionViolation, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_barring_operation_not_successful"));
+    Tools::errorCodeTextMapping(KErrGsmSSUnknownSubscriber, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_not_allowed"));
+    Tools::errorCodeTextMapping(KErrGsmSSAbsentSubscriber, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_not_allowed"));
+    Tools::errorCodeTextMapping(KErrGsmSSIllegalOperation, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_not_allowed"));
+    Tools::errorCodeTextMapping(KErrGsmSSIllegalSubscriber, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_not_allowed"));
+    Tools::errorCodeTextMapping(KErrGsmSSIllegalEquipment, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_not_allowed"));
+    Tools::errorCodeTextMapping(KErrGsmSSCallBarred, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_not_allowed"));
+    Tools::errorCodeTextMapping(KErrGsmSSDataMissing, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_not_allowed"));
+    Tools::errorCodeTextMapping(KErrGsmSSIncompatibility, text);
+    QCOMPARE( text, QString(
+            "Services in conflict"));
+    Tools::errorCodeTextMapping(KErrGsmSSSystemFailure, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_result_unknown"));
+    Tools::errorCodeTextMapping(KErrGsmSSUnexpectedDataValue, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_request_rejected"));
+    Tools::errorCodeTextMapping(KErrGsmSSResourcesUnavailable, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_request_rejected"));
+    Tools::errorCodeTextMapping(KErrGsmSSNegativePasswordCheck, text);
+    QCOMPARE( text, QString(
+            "Password error"));
+    Tools::errorCodeTextMapping(KErrGsmSSPasswordRegistrationFailure, text);
+    QCOMPARE( text, QString(
+            "Password error"));
+    Tools::errorCodeTextMapping(KErrGsmSSPasswordAttemptsViolation, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_barring_password_blocked"));
+    Tools::errorCodeTextMapping(KErrGsmSMSNoNetworkService, text);
+    QCOMPARE( text, QString(
+            "No network coverage"));
+    Tools::errorCodeTextMapping(KErrGsmNoService, text);
+    QCOMPARE( text, QString(
+            "No network coverage"));
+    Tools::errorCodeTextMapping(KErrSsActivationDataLost, text);
+    QCOMPARE( text, QString(
+            "Check network services"));
+    Tools::errorCodeTextMapping(KErrGsmSSUnknownAlphabet, text);
+    QCOMPARE( text, QString("txt_phone_info_invalid_phone_number"));
+    
+    expect("XQSysInfo::isSupported").returns(false);
+    Tools::errorCodeTextMapping(KErrGsmOfflineOpNotAllowed, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_request_not_completed"));
+    QVERIFY( verify() );
+    
+    expect("XQSysInfo::isSupported").returns(true);
+    expect("XQSettingsManager::readItemValue").returns(QVariant(EBTSapConnected));
+    Tools::errorCodeTextMapping(KErrGsmOfflineOpNotAllowed, text);
+    QCOMPARE( text, QString(
+            "Operation not possible in SIM access profile mode"));
+    QVERIFY( verify() );
+    
+    expect("XQSysInfo::isSupported").returns(true);
+    expect("XQSettingsManager::readItemValue").returns(QVariant(EBTSapNotConnected));
+    Tools::errorCodeTextMapping(KErrGsmOfflineOpNotAllowed, text);
+    QCOMPARE( text, QString(
+            "Operation not possible in Off-line mode"));
+    
+    Tools::errorCodeTextMapping(-1, text);
+    QCOMPARE( text, QString(
+            "txt_phone_info_request_not_completed"));
+    
+    QVERIFY( verify() );
+        
+}
+
+
+QTEST_MAIN_S60(UT_CpPluginCommon)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.h	Fri Jun 04 10:19:18 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 UT_SSSETTINGWRAPPER_H
+#define UT_SSSETTINGWRAPPER_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpSettingsWrapper;
+
+class UT_CpPluginCommon : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpPluginCommon();
+    ~UT_CpPluginCommon();
+    
+private slots:
+
+    void init();
+    void cleanup();
+    
+    void t_memleak();
+    
+    void t_showCallDuration();
+    void t_setShowCallDuration();
+    void t_readSoftRejectText();
+    void t_writeSoftRejectText();
+    void t_numberGroupingSupported();
+    
+    void t_voipSupported();
+    void t_videoSupported();
+    void t_errorCodeTextMapping();
+
+private:
+    CpSettingsWrapper *mWrapper;
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/ut_cpplugincommon/ut_cpplugincommon.pro	Fri Jun 04 10:19:18 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: 
+#
+
+CONFIG += qtestlib
+CONFIG += hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += . ../../inc/
+DEFINES += BUILD_CPTELEPHONYUTILS \
+    XQSETTINGSMANAGER_NO_LIBRARY \
+    XQSYSINFO_NO_LIBRARY
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+  LIBS += -lmocklib -lsymbianmock
+}
+
+# test code
+HEADERS += ut_cpplugincommon.h
+SOURCES += ut_cpplugincommon.cpp
+
+# code to be tested
+HEADERS += ../../inc/cpplugincommon.h \
+           /epoc32/include/mw/xqsettingskey.h \
+           /epoc32/include/mw/xqsettingsmanager.h \
+           /epoc32/include/mw/xqsysinfo.h
+           
+SOURCES += ../../src/cpplugincommon.cpp
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_xqsettingskey.cpp \
+           ../../../tsrc/mocks/mock_xqsettingsmanager.cpp \
+           ../../../tsrc/mocks/mock_xqsysinfo.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/divertplugin.pro	Fri Jun 04 10:19:18 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: 
+#
+
+TEMPLATE = lib
+TARGET = cpdivertplugin
+DEPENDPATH  += .
+INCLUDEPATH += .
+INCLUDEPATH += ../cptelephonyutils/inc
+CONFIG += hb plugin
+
+TRANSLATIONS = telephone_cp.ts
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+RCC_DIR = rcc
+LIBS += -lcpframework \
+        -lpsetwrapper \
+        -lsssettingswrapper \
+        -lcptelephonyutils
+
+# Input
+SOURCES += src/cpdivertplugingroup.cpp \
+    src/cpdivertplugin.cpp \
+    src/cpdivertselectionitem.cpp \
+    src/cpdivertselectioncustomitem.cpp \
+    src/cpdivertitemdata.cpp
+    
+HEADERS += src/cpdivertplugingroup.h \
+    src/cpdivertplugin.h \
+    src/cpdivertselectionitem.h \
+    src/cpdivertselectioncustomitem.h \
+    src/cpdivertitemdata.h
+    
+include(../cpplugincommon.pri)
+
+symbian: {
+    TARGET.UID3 = 0X20029F25
+    LIBS += -lxqsysinfo \
+        -lxqsettingsmanager
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+#include "cpdivertitemdata.h"
+#include "cpdivertselectionitem.h"
+
+
+CpDivertItemData::CpDivertItemData(
+                HbDataFormModelItem::DataItemType type,
+                const QString &label,
+                CpItemDataHelper &helper,
+                const HbDataFormModelItem *parent) :
+                CpSettingFormItemData(
+                        static_cast<HbDataFormModelItem::DataItemType>(type),
+                        label, parent ),
+                m_helper(helper)
+{
+    m_helper.addConnection(
+        this, SIGNAL(clicked()),
+        this, SLOT(thisItemClicked()));
+}
+
+CpDivertItemData::~CpDivertItemData()
+{
+
+}
+
+void CpDivertItemData::thisItemClicked()
+{
+    emit itemClicked(*this);
+}
+
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertitemdata.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+#ifndef DIVERTINGITEMDATA_H_
+#define DIVERTINGITEMDATA_H_
+
+#include <cpsettingformitemdata.h>
+#include <psetwrappertypes.h>
+#include <cpitemdatahelper.h>
+
+class CpDivertItemData : public CpSettingFormItemData
+{
+    Q_OBJECT
+public:
+    CpDivertItemData(
+        HbDataFormModelItem::DataItemType type,
+        const QString &label,
+        CpItemDataHelper &helper,
+        const HbDataFormModelItem *parent = 0);
+    
+    virtual ~CpDivertItemData();
+
+public slots:
+    void thisItemClicked();
+
+signals:
+    void itemClicked(CpDivertItemData &item);
+
+private:
+    CpItemDataHelper &m_helper;
+};
+
+
+#endif /* DIVERTINGITEMDATA_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include <cpsettingformentryitemdataimpl.h>
+#include "cpdivertplugin.h"
+#include "cpdivertplugingroup.h"
+#include "cppluginlogging.h"
+
+/*!
+    Constructor of CpDivertPlugin.
+ */
+CpDivertPlugin::CpDivertPlugin()
+{
+    // Install plugin specific msg handler
+    INSTALL_TRACE_MSG_HANDLER;
+    DPRINT;
+}
+
+/*!
+    Destructor of CpDivertPlugin.
+ */
+CpDivertPlugin::~CpDivertPlugin()
+{
+    DPRINT;
+
+    // Uninstall plugin specific msg handler
+    UNINSTALL_TRACE_MSG_HANDLER;
+}
+
+/*!
+    CpDivertPlugin::createSettingFormItemData.
+ */
+QList<CpSettingFormItemData*> CpDivertPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+{
+    DPRINT;
+    QList<CpSettingFormItemData*> ret;
+    ret.append(new CpDivertPluginGroup(itemDataHelper));
+    return ret;
+}
+
+Q_EXPORT_PLUGIN2(cpdivertplugin, CpDivertPlugin);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugin.h	Fri Jun 04 10:19:18 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 CPDIVERTPLUGIN_H
+#define CPDIVERTPLUGIN_H
+
+#include <cpplugininterface.h>
+
+/*!
+    \class CpDivertPlugin
+    \brief The class CpDivertPlugin implements call divert functionality. 
+ */
+class CpDivertPlugin : public QObject, public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+
+public:
+
+    CpDivertPlugin();    
+    ~CpDivertPlugin();
+    
+    /**
+     * From CpPluginInterface
+     * @see CpPluginInterface.
+     */
+    QList<CpSettingFormItemData*> createSettingFormItemData(
+            CpItemDataHelper &itemDataHelper) const;
+};
+
+#endif // CPDIVERTPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1230 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 <QEventLoop>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblineedit.h>
+#include <hbinputeditorinterface.h>
+#include <hbcombobox.h>
+#include <hbdeviceprogressdialog.h>
+#include <sssettingswrapper.h>
+#include <psetwrapper.h>
+#include <hbaction.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hblabel.h>
+#include <cpitemdatahelper.h>
+#include "cpdivertselectionitem.h"
+#include "cpdivertplugingroup.h"
+#include "cpplugincommon.h"
+#include "cpphonenotes.h"
+#include "cppluginlogging.h"
+#include "cpdivertitemdata.h"
+#include "cpdivertselectioncustomitem.h"
+
+Q_DECLARE_METATYPE(PsCallDivertingCondition)
+Q_DECLARE_METATYPE(PsServiceGroup)
+
+// CONSTANTS 
+const QString KVoiceMail("voiceMail");
+const QString KVideoMail("voiceMail");
+const QString KOtherNumber("otherNumber");
+
+/*!
+  CpDivertPluginGroup::CpDivertPluginGroup.
+ */
+CpDivertPluginGroup::CpDivertPluginGroup(CpItemDataHelper &helper)
+     : CpSettingFormItemData(HbDataFormModelItem::GroupItem, 
+                             hbTrId("txt_phone_subhead_call_divert"),0),
+       m_DataItemVoiceAllCalls(NULL),
+       m_DataItemVoiceIfBusy(NULL),
+       m_DataItemVoiceIfNotAnswered(NULL),
+       m_DataItemVoiceIfOutOfReach(NULL),
+       m_DataItemVoiceIfNotAvailable(NULL),
+       m_DataItemVideoAllCalls(NULL),
+       m_DataItemVideoIfBusy(NULL),
+       m_DataItemVideoIfNotAnswered(NULL),
+       m_DataItemVideoIfOutOfReach(NULL),
+       m_DataItemVideoIfNotAvailable(NULL),
+       m_activeNoteId(0),
+       m_activeProgressNoteId(0),
+       m_divertToVoiceMailBox(false),
+       m_helper(helper),
+       m_divertTimeout(0)
+{
+    DPRINT << ": IN";
+    
+    // Registration needed, because PsCallDivertingCondition and PsServiceGroup
+    // is used as a custom meta information for barring items.
+    qRegisterMetaType<PsCallDivertingCondition>(
+        "PsCallDivertingCondition");
+    
+    qRegisterMetaType<PsServiceGroup>(
+        "PsServiceGroup");
+    
+    m_pSetWrapper = new PSetWrapper; 
+    DPRINT << ": PSetWrapper created";
+    
+    m_ssSettingsWrapper = new SsSettingsWrapper; 
+    DPRINT << ": SsSettingsWrapper created";
+    
+    m_callDivertingWrapper = &m_pSetWrapper->callDivertingWrapper();
+    QObject::connect(
+        m_callDivertingWrapper, 
+        SIGNAL(handleDivertingChanged(const PSCallDivertingCommand&,bool)),
+        this, 
+        SLOT(handleDivertingChanged(const PSCallDivertingCommand&,bool)));
+    QObject::connect(
+        m_callDivertingWrapper, 
+        SIGNAL(handleDivertingStatus(QList<PSCallDivertingStatus*>&, bool)),
+        this, 
+        SLOT(handleDivertingStatus(QList<PSCallDivertingStatus*>&, bool)));
+    QObject::connect(
+        m_callDivertingWrapper, 
+        SIGNAL(handleDivertingError(int)),
+        this, 
+        SLOT(handleDivertingError(int)));
+    
+    QObject::connect(
+        m_callDivertingWrapper, 
+        SIGNAL(requestDone()),
+        this,
+        SLOT(divertRequestProcessed()));
+
+    // Create custom item prototype
+    m_helper.addItemPrototype(new CpDivertSelectionItem());
+    
+    // Listen form item visibility change
+    m_helper.connectToForm(
+            SIGNAL(itemShown(QModelIndex)), this, SLOT(itemShown(QModelIndex)));
+    
+    // Create grouped setting items
+    createVoiceCallItems(this);
+    createVideoCallItems(this);
+    
+    m_eventLoop = new QEventLoop(this); 
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::~CpDivertPluginGroup.
+ */
+CpDivertPluginGroup::~CpDivertPluginGroup()
+{
+    DPRINT << ": IN";
+
+    delete m_pSetWrapper;
+    delete m_ssSettingsWrapper;
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+ CpDivertPluginGroup::createVoiceCallItems.
+ */
+void CpDivertPluginGroup::createVoiceCallItems(CpSettingFormItemData *parent)
+{
+    DPRINT << ": IN";
+    CpSettingFormItemData *page = new CpSettingFormItemData(
+                HbDataFormModelItem::GroupPageItem,
+                hbTrId("txt_phone_setlabel_service_val_voice_divert"));
+    parent->appendChild(page);
+
+    m_DataItemVoiceAllCalls = createDivertItem(
+            DivertConditionUnconditional,
+            ServiceGroupVoice,
+            hbTrId("txt_phone_setlabel_all_calls"),
+            hbTrId("txt_phone_setlabel_all_calls"), false,
+            page);
+
+    m_DataItemVoiceIfBusy = createDivertItem(
+            DivertConditionBusy,
+            ServiceGroupVoice,
+            hbTrId("txt_phone_setlabel_if_busy"),
+            hbTrId("txt_phone_setlabel_if_busy"), false,
+            page);
+
+    m_DataItemVoiceIfNotAnswered = createDivertItem(
+            DivertConditionNoReply,
+            ServiceGroupVoice,
+            hbTrId("txt_phone_setlabel_if_not_answered"),
+            hbTrId("txt_phone_setlabel_if_not_answered"), true,
+            page);
+    m_DataItemVoiceIfNotAnswered->setContentWidgetData(
+            "timeoutText", hbTrId("txt_phone_setlabel_delay"));
+
+    m_DataItemVoiceIfOutOfReach = createDivertItem(
+            DivertConditionNotReachable,
+            ServiceGroupVoice,
+            hbTrId("txt_phone_setlabel_if_out_of_reach"),
+            hbTrId("txt_phone_setlabel_if_out_of_reach"), false,
+            page);
+
+    m_DataItemVoiceIfNotAvailable = createDivertItem(
+            DivertConditionAllConditionalCases,
+            ServiceGroupVoice,
+            hbTrId("txt_phone_setlabel_if_not_available"),
+            hbTrId("txt_phone_setlabel_if_not_available"), true,
+            page);
+
+    DPRINT << ": OUT";
+}
+
+/*!
+ CpDivertPluginGroup::createVideoCallItems
+ */
+void CpDivertPluginGroup::createVideoCallItems(CpSettingFormItemData *parent)
+{
+    DPRINT << ": IN";
+    CpSettingFormItemData *page = new CpSettingFormItemData(
+            HbDataFormModelItem::GroupPageItem,
+            hbTrId("txt_phone_setlabel_service_val_video_divert"));
+    
+    parent->appendChild(page);
+    
+    m_DataItemVideoAllCalls = createDivertItem(
+            DivertConditionUnconditional,
+            ServiceGroupData,
+            hbTrId("txt_phone_setlabel_all_calls"),
+            hbTrId("txt_phone_setlabel_all_calls"), false,
+            page);
+
+    m_DataItemVideoIfBusy = createDivertItem(
+            DivertConditionBusy,
+            ServiceGroupData,
+            hbTrId("txt_phone_setlabel_if_busy"),
+            hbTrId("txt_phone_setlabel_if_busy"), false,
+            page);
+
+    m_DataItemVideoIfNotAnswered = createDivertItem(
+            DivertConditionNoReply,
+            ServiceGroupData,
+            hbTrId("txt_phone_setlabel_if_not_answered"),
+            hbTrId("txt_phone_setlabel_if_not_answered"), true,
+            page);
+    m_DataItemVideoIfNotAnswered->setContentWidgetData(
+            "timeoutText", hbTrId("txt_phone_setlabel_delay"));
+
+    m_DataItemVideoIfOutOfReach = createDivertItem(
+            DivertConditionNotReachable,
+            ServiceGroupData,
+            hbTrId("txt_phone_setlabel_if_out_of_reach"),
+            hbTrId("txt_phone_setlabel_if_out_of_reach"), false,
+            page);
+
+    m_DataItemVideoIfNotAvailable = createDivertItem(
+            DivertConditionAllConditionalCases,
+            ServiceGroupData,
+            hbTrId("txt_phone_setlabel_if_not_available"),
+            hbTrId("txt_phone_setlabel_if_not_available"), true,
+            page);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+ CpDivertPluginGroup::createDivertItem
+ */
+CpDivertItemData *CpDivertPluginGroup::createDivertItem(
+        PsCallDivertingCondition condition,
+        PsServiceGroup serviceGroup,
+        const QString &label,
+        const QString &queryLabel,
+        bool needTimeoutInfo,
+        CpSettingFormItemData *parent)
+{
+    DPRINT << ": IN";
+
+    CpDivertItemData *item = new CpDivertItemData(
+        static_cast<HbDataFormModelItem::DataItemType>
+            (CpDivertSelectionItem::CpDivertSelectionItemId), 
+            label,
+            m_helper,
+            parent);
+    QVariant conditionVar;
+    conditionVar.setValue(condition);
+    item->setProperty("condition", conditionVar);
+    QVariant serviceGroupVar;
+    serviceGroupVar.setValue(serviceGroup);
+    item->setProperty("serviceGroup", serviceGroupVar);
+    item->setProperty("queryLabel", queryLabel);
+    item->setProperty("needTimeoutInfo", needTimeoutInfo);
+    item->setEnabled(false);
+    
+    // Connect signals
+    QObject::connect(
+        item, SIGNAL(itemClicked(CpDivertItemData&)),
+        this, SLOT(changeDivertingStateRequested(CpDivertItemData&)));
+    
+    parent->appendChild(item);
+    DPRINT << ": OUT";
+    return item;
+}
+
+/*!
+  CpDivertPluginGroup::itemShown.
+ */
+void CpDivertPluginGroup::itemShown(const QModelIndex& item)
+{
+    DPRINT << ": IN";
+    DPRINT << "item:" << item;
+    
+    HbDataFormModelItem* modelItem = 
+            qobject_cast<const HbDataFormModel*>(item.model())->itemFromIndex(item);
+    
+    if (!modelItem->contentWidgetData("number").isValid() &&
+        (static_cast<HbDataFormModelItem::DataItemType>
+            (CpDivertSelectionItem::CpDivertSelectionItemId == modelItem->type()))){
+        CpDivertItemData *item = static_cast<CpDivertItemData*>(modelItem); 
+        if(qvariant_cast<PsCallDivertingCondition>(item->property("condition")) !=
+                DivertConditionAllConditionalCases) {
+            addToDivertingRequestQueue(CheckDivertStatus, *item);
+        }
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::addToDivertingRequestQueue.
+ */
+void CpDivertPluginGroup::addToDivertingRequestQueue(
+        DivertRequest request, CpDivertItemData &item)
+{
+    DPRINT << ": IN";
+    CpDivertRequestQueueItem i;
+    i.request = request;
+    i.item = &item;
+    m_divertRequestQueue.enqueue(i);
+
+    if (m_divertRequestQueue.count()==1) {
+       // Process if first item was added, process other later
+        try {
+            processDivertingRequestQueue();
+        } catch(...) {
+            DPRINT << "error!!";
+        }
+    }
+
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::divertRequestProcessed.
+ */
+void CpDivertPluginGroup::divertRequestProcessed()
+{
+    DPRINT << ": IN";
+    // Remove previous request and process next one
+    if (!m_divertRequestQueue.isEmpty()) {
+        m_divertRequestQueue.dequeue();
+        processDivertingRequestQueue();
+    }
+
+    if (m_divertRequestQueue.isEmpty()) {
+        // Queue empty so cancel process note
+        CpPhoneNotes::instance()->cancelNote(m_activeProgressNoteId);
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::changeItemData.
+ */
+void CpDivertPluginGroup::changeItemData(
+        PsServiceGroup serviceGroup,
+        PsCallDivertingCondition condition,
+        PsCallDivertingStatus status,
+        const QString& number, int timeout)
+{
+    DPRINT << ": IN";
+    
+    CpDivertSelectionCustomitem::State itemState = 
+        CpDivertSelectionCustomitem::Disabled;
+    if (status == DivertingStatusActive) {
+        itemState = CpDivertSelectionCustomitem::Enabled;
+    } else if (status == DivertingStatusInactive) {
+        itemState = CpDivertSelectionCustomitem::Deactivated;
+    } else {
+        itemState = CpDivertSelectionCustomitem::Disabled;
+    }
+    
+    switch (condition) {
+    case DivertConditionAllConditionalCases:
+        DPRINT << ": DivertConditionAllConditionalCases";
+        
+        // If not available effects also conditions below
+        changeItemData(serviceGroup, DivertConditionBusy, status, number, timeout);
+        changeItemData(serviceGroup, DivertConditionNoReply, status, number, timeout);
+        changeItemData(serviceGroup, DivertConditionNotReachable, status, number, timeout);
+        // Fall trough
+    case DivertConditionUnconditional:
+    case DivertConditionBusy:
+    case DivertConditionNoReply:
+    case DivertConditionNotReachable:
+        if (serviceGroup & ServiceGroupVoice) {
+            item(ServiceGroupVoice, condition)->setContentWidgetData("number", number);
+            item(ServiceGroupVoice, condition)->setContentWidgetData("timeout", timeout);
+            item(ServiceGroupVoice, condition)->setContentWidgetData("state", itemState);
+            item(ServiceGroupVoice, condition)->setEnabled(true);
+        }
+        
+        if (serviceGroup & ServiceGroupData) {
+            item(ServiceGroupData, condition)->setContentWidgetData("number", number);
+            item(ServiceGroupData, condition)->setContentWidgetData("timeout", timeout);
+            item(ServiceGroupData, condition)->setContentWidgetData("state", itemState);
+            item(ServiceGroupData, condition)->setEnabled(true);
+        }
+        break;
+    case DivertConditionAllCalls:
+    case DivertConditionUnknown:
+    default:
+        break;
+    }
+}
+
+/*!
+  CpDivertPluginGroup::revertItemData.
+ */
+void CpDivertPluginGroup::revertItemData(
+        PsServiceGroup serviceGroup, PsCallDivertingCondition condition)
+{
+    DPRINT << ": IN";
+    if (serviceGroup & ServiceGroupVoice) {
+        item(ServiceGroupVoice, condition)->setContentWidgetData("state",
+            item(ServiceGroupVoice, condition)->contentWidgetData("state"));
+    }
+    
+    if (serviceGroup & ServiceGroupData) {
+        item(ServiceGroupData, condition)->setContentWidgetData("state",
+            item(ServiceGroupData, condition)->contentWidgetData("state"));
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::item.
+ */
+CpSettingFormItemData* CpDivertPluginGroup::item(
+        PsService service, PsCallDivertingCondition condition)
+{
+    CpSettingFormItemData *ret = 0;
+    switch (condition) {
+        case DivertConditionUnconditional:
+            if (service == ServiceGroupVoice) {
+                ret = m_DataItemVoiceAllCalls;
+            } else {
+                ret = m_DataItemVideoAllCalls;
+            }
+            break;
+        case DivertConditionBusy:
+            if (service == ServiceGroupVoice) {
+                ret = m_DataItemVoiceIfBusy;
+            } else {
+                ret = m_DataItemVideoIfBusy;
+            }
+            break;
+        case DivertConditionNoReply:
+            if (service == ServiceGroupVoice) {
+                ret = m_DataItemVoiceIfNotAnswered;
+            } else {
+                ret = m_DataItemVideoIfNotAnswered;
+            }
+            break;
+        case DivertConditionNotReachable:
+            if (service == ServiceGroupVoice) {
+                ret = m_DataItemVoiceIfOutOfReach;
+            } else {
+                ret = m_DataItemVideoIfOutOfReach;
+            }
+            break;
+        case DivertConditionAllConditionalCases:
+            if (service == ServiceGroupVoice) {
+                ret = m_DataItemVoiceIfNotAvailable;
+            } else {
+                ret = m_DataItemVideoIfNotAvailable;
+            }
+            break;
+        case DivertConditionAllCalls:
+        case DivertConditionUnknown:
+        default:
+            break;
+    }
+    Q_CHECK_PTR(ret);
+    return ret;
+}
+
+/*!
+  CpDivertPluginGroup::processDivertingRequestQueue.
+ */
+void CpDivertPluginGroup::processDivertingRequestQueue()
+{
+    DPRINT << ": IN";
+    if (m_divertRequestQueue.isEmpty()) {
+        DPRINT << "queue empty : OUT";
+        return;
+    }
+    CpDivertRequestQueueItem request = m_divertRequestQueue.head();
+    // Command param
+    PSCallDivertingCommand divertCommand;
+    divertCommand.iServiceGroup = qvariant_cast<PsServiceGroup>(
+            request.item->property("serviceGroup"));
+    divertCommand.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            request.item->property("condition"));
+    divertCommand.iStatus = DivertingStatusUnknown;
+    divertCommand.iNumber = "";
+    divertCommand.iNoReplyTimer = 0;
+
+    switch (request.request) {
+        case ActivateDivert: {
+            DPRINT << "activate";
+            divertCommand.iSetting = RegisterDiverting;
+            if (popUpVoiceNumberListQuery(
+                    request.item->property("queryLabel").toString(),
+                    divertCommand.iNumber,
+                    divertCommand.iServiceGroup)) {
+                if (request.item->property("needTimeoutInfo").toBool()) {
+                    if (popUpTimerQuery(divertCommand.iNoReplyTimer)) {
+                        setCallDiverting(divertCommand);
+                    } else {
+                        // Query was cancelled
+                        revertItemData(
+                                divertCommand.iServiceGroup, 
+                                divertCommand.iCondition);
+                        m_divertRequestQueue.clear();
+                    }
+                } else {
+                    setCallDiverting(divertCommand);
+                }
+            } else {
+                // Query was cancelled
+                revertItemData(
+                        divertCommand.iServiceGroup, 
+                        divertCommand.iCondition);
+                m_divertRequestQueue.clear();
+            }
+        }
+            break;
+        case DeactivateDivert: {
+            DPRINT << "deactivate";
+            divertCommand.iSetting = EraseDiverting;
+            setCallDiverting(divertCommand);
+        }
+            break;
+        case CheckDivertStatus: {
+            DPRINT << "check status";
+            m_callDivertingWrapper->getCallDivertingStatus(
+                divertCommand.iServiceGroup,
+                divertCommand.iCondition,
+                bscParam(divertCommand.iServiceGroup) );
+            
+            if (!CpPhoneNotes::instance()->noteShowing()) {
+                CpPhoneNotes::instance()->showGlobalProgressNote(
+                        m_activeProgressNoteId, hbTrId("txt_phone_info_requesting"));
+            }
+        }
+            break;
+        default:
+            DPRINT << "Error: unknown enum value";
+            break;
+    }
+
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::changeDivertingStateRequested.
+ */
+void CpDivertPluginGroup::changeDivertingStateRequested(
+        CpDivertItemData &item)
+{
+    DPRINT << ": IN";
+    
+    DivertRequest event=ActivateDivert;
+    if (CpDivertSelectionCustomitem::Enabled == 
+            item.contentWidgetData("state").toInt()) {
+        event = DeactivateDivert;
+    } else {
+        event = ActivateDivert;
+    }
+    
+    addToDivertingRequestQueue(event, item);
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::handleDivertingChanged.
+ */
+void CpDivertPluginGroup::handleDivertingChanged(
+        const PSCallDivertingCommand& aSetting, 
+        bool aPlural)
+{
+    DPRINT << ": IN";
+    
+    CpPhoneNotes::instance()->cancelNote(m_activeNoteId);
+    DPRINT << "aPlural:" << aPlural;
+    DPRINT << "iCondition:" << aSetting.iCondition;
+    DPRINT << "iNoReplyTimer:" << aSetting.iNoReplyTimer;
+    DPRINT << "iNumber:" << aSetting.iNumber;
+    DPRINT << "iServiceGroup:" << aSetting.iServiceGroup;
+    DPRINT << "iSetting:" << aSetting.iSetting;
+    DPRINT << "iStatus:" << aSetting.iStatus;
+
+    changeItemData(
+        aSetting.iServiceGroup,
+        aSetting.iCondition, aSetting.iStatus,
+        aSetting.iNumber, aSetting.iNoReplyTimer);
+    
+    updateDependentDivertOptions(
+            (DivertConditionUnconditional == aSetting.iCondition) &&
+            (DivertingStatusActive != aSetting.iStatus) );
+    
+    switch(aSetting.iStatus) {
+        case DivertingStatusActive:
+            if (aPlural) {
+                CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId,
+                    hbTrId("txt_phone_info_diverts_activated"), 
+                    HbMessageBox::MessageTypeInformation);
+            } else {
+                CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId,
+                    hbTrId("txt_phone_info_divert_activated"), 
+                    HbMessageBox::MessageTypeInformation);
+            }
+            if (!m_divertToVoiceMailBox) {
+                // Number, except vmbx number, will be added to defaultnumber list
+                m_callDivertingWrapper->setNewDefaultNumber(aSetting.iNumber);
+            }
+            // Diverting calls does not affect Internet calls
+            if (Tools::voipSupported() &&
+                    (aSetting.iServiceGroup & ServiceGroupVoice)) {
+                CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId,
+                    hbTrId("Diverting calls does not affect Internet calls"), 
+                    HbMessageBox::MessageTypeInformation);
+            }
+            break;
+        case DivertingStatusNotRegistered:  
+        case DivertingStatusInactive:
+            if (aPlural) {
+                CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId,
+                    hbTrId("txt_phone_info_diverts_deactivated"), 
+                    HbMessageBox::MessageTypeInformation);
+            } else {
+                CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId,
+                    hbTrId("txt_phone_info_divert_deactivated"), 
+                    HbMessageBox::MessageTypeInformation);
+            }
+            break;
+        case DivertingStatusNotProvisioned:
+        case DivertingStatusUnknown:
+        default:
+            CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId,
+                hbTrId("txt_phone_info_request_not_completed"), 
+                HbMessageBox::MessageTypeInformation);
+    }
+    
+    DPRINT << ": OUT";
+}
+   
+/*!
+  CpDivertPluginGroup::handleDivertingStatus.
+ */
+void CpDivertPluginGroup::handleDivertingStatus(
+        QList<PSCallDivertingStatus*> &divertList, 
+        bool plural)
+{
+    DPRINT << ": IN";
+    DPRINT << "divertList.Size():" << divertList.size();
+    DPRINT << "plural:" << plural;
+
+    foreach(PSCallDivertingStatus* status, divertList) {
+        DPRINT << status->iCondition;
+        DPRINT << status->iNumber;
+        DPRINT << status->iServiceGroup;
+        DPRINT << status->iStatus;
+        DPRINT << status->iTimeout;
+        changeItemData(
+            status->iServiceGroup,
+            status->iCondition, status->iStatus, 
+            status->iNumber, status->iTimeout);
+    
+    }
+    
+    updateDependentDivertOptions();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::handleDivertingError.
+ */
+void CpDivertPluginGroup::handleDivertingError(int aReason)
+{
+    DPRINT << ": IN : aReason:" << aReason;
+    
+    // Update view item for failed request
+    if (m_divertRequestQueue.count()) {
+        revertItemData(
+            qvariant_cast<PsServiceGroup>(
+                    m_divertRequestQueue.head().item->property("serviceGroup")),
+            qvariant_cast<PsCallDivertingCondition>(
+                    m_divertRequestQueue.head().item->property("condition")));
+    }
+    
+    // Clear queue
+    m_divertRequestQueue.clear();
+    
+    // Cancel previous note
+    CpPhoneNotes::instance()->cancelNote(m_activeNoteId);
+    
+    // Show error note
+    CpPhoneNotes::instance()->showGlobalErrorNote(m_activeNoteId, aReason);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::popUpVoiceNumberListQuery.
+ */
+bool CpDivertPluginGroup::popUpVoiceNumberListQuery(
+        const QString& heading, QString& result, PsServiceGroup serviceGroup)
+{
+    DPRINT << ": IN";
+    
+    bool requestOK(false);
+
+    if (!m_eventLoop->isRunning()){
+        m_divertNumber = ""; 
+        m_divertToVoiceMailBox = false;
+        QStringList defNumbers;
+        HbDialog *dialog = createDialog(heading);
+        m_voiceNumberList = new HbListWidget(dialog);
+        if (serviceGroup == ServiceGroupVoice) {
+            addItemToListWidget(
+                    m_voiceNumberList, hbTrId("txt_phone_setlabel_voice_mbx"), KVoiceMail );
+        } else if(serviceGroup == ServiceGroupData) {
+            // TODO: Implement video voicemail
+        }
+    
+        // Add "old" divert number to list
+        m_callDivertingWrapper->getDefaultNumbers(defNumbers);
+        int count(defNumbers.count());
+        for (int i = 0; i < count; i++) {
+            addItemToListWidget(m_voiceNumberList, defNumbers[i], defNumbers[i]);
+        }
+        addItemToListWidget(m_voiceNumberList, hbTrId("txt_phone_list_enter_number_manually"), KOtherNumber );
+        dialog->setContentWidget(m_voiceNumberList);
+        
+        // Connect list item activation signal to close the popup
+        QObject::connect(m_voiceNumberList, 
+                SIGNAL(activated(HbListWidgetItem*)), 
+                dialog, 
+                SLOT(close()), 
+                Qt::UniqueConnection);
+        
+        // Sets the "Cancel"-action/button
+        HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"));
+        dialog->addAction(cancelAction);
+        QObject::connect(cancelAction, 
+                SIGNAL(triggered(bool)), 
+                dialog, 
+                SLOT(close()));
+        
+        dialog->open(this, SLOT(voiceNumberListQueryClosed(HbAction *))); 
+        
+        QPointer<QObject> guard = this;
+        m_eventLoop->exec(); 
+        if (guard.isNull()) {
+            requestOK = false;
+        } else if (!m_divertNumber.isEmpty()) {
+            result = m_divertNumber;
+            requestOK = true;
+        }    
+    }
+    
+    DPRINT << ": OUT : result:" << result;
+    DPRINT << ": OUT : requestOK :" << requestOK;
+    return requestOK;
+}
+
+/*!
+    CpDivertPluginGroup::voiceNumberListQueryClosed()
+*/
+void CpDivertPluginGroup::voiceNumberListQueryClosed(HbAction* action)
+{
+    DPRINT << ": IN";
+    
+    bool exitLoop(true); 
+    
+    // Enter if cancel wasn't selected 
+    if (!action) {  
+        // Update the view with selected text
+        QString data = m_voiceNumberList->currentItem()->data().toString();
+        DPRINT << ": data: " << data; 
+        
+        if (data == KVoiceMail) {
+            m_callDivertingWrapper->getVoiceMailBoxNumber(m_divertNumber);
+            if (!m_divertNumber.isEmpty()) {
+                DPRINT << ": voicemailboxnumber found";
+            }
+            
+            m_eventLoop->quit();
+            
+        } else if (data == KOtherNumber) {
+                // Event loop is terminated by popUpNumberEditorClosed
+                exitLoop = false;
+                
+                DPRINT << ": open popUpNumberEditor";                
+                popUpNumberEditor(hbTrId("txt_phone_info_number"), m_divertNumber);
+        } else {
+            //TODO if matched contact name not work
+            DPRINT << ": else";
+            m_divertNumber = data;
+        }        
+        
+    }
+    
+    if (exitLoop) {
+        DPRINT << ": quit eventloop";
+        m_eventLoop->quit();
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::popUpNumberEditor.
+ */
+void CpDivertPluginGroup::popUpNumberEditor(
+        const QString& heading, QString& result)
+{
+    DPRINT << ": IN";
+
+    Q_UNUSED(result); 
+    
+    HbDialog *dialog = createDialog(heading);
+
+    m_voiceNumberEditor = new HbLineEdit(dialog);
+    m_voiceNumberEditor->setInputMethodHints(Qt::ImhDialableCharactersOnly);    
+    dialog->setContentWidget(m_voiceNumberEditor);
+    
+    HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok"));
+    dialog->addAction(okAction);
+    
+    HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"));
+    dialog->addAction(cancelAction);
+    
+    dialog->open(this, SLOT(popUpNumberEditorClosed(HbAction*)));
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::popUpNumberEditorClosed.
+ */
+void CpDivertPluginGroup::popUpNumberEditorClosed(HbAction* action)
+{
+    DPRINT << ": IN";
+    
+    bool cancelled(true); 
+    if (action) {
+        if (action->text() == hbTrId("txt_common_button_ok")) 
+            {
+            cancelled = false;  
+            DPRINT << ": ok selected";
+            }
+    }
+    
+    if (!cancelled) {
+        m_divertNumber = m_voiceNumberEditor->text();
+            DPRINT << ": m_divertNumber "
+                << m_divertNumber;
+            if (m_divertNumber.isEmpty()) {
+                CpPhoneNotes::instance()->showGlobalNote(m_activeNoteId, 
+                    hbTrId("txt_phone_info_invalid_phone_number"), HbMessageBox::MessageTypeWarning);
+            }
+    }
+    
+    if (m_voiceNumberEditor) {
+        delete m_voiceNumberEditor;
+        m_voiceNumberEditor = NULL; 
+    } 
+    
+    m_eventLoop->quit();
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::setCallDiverting.
+ */
+void CpDivertPluginGroup::setCallDiverting(PSCallDivertingCommand& command)
+{
+    DPRINT << ": IN";
+    DPRINT << "iCondition:" << command.iCondition;
+    DPRINT << "iNoReplyTimer:" << command.iNoReplyTimer;
+    DPRINT << "iNumber:" << command.iNumber;
+    DPRINT << "iServiceGroup:" << command.iServiceGroup;
+    DPRINT << "iSetting:" << command.iSetting;
+    DPRINT << "iStatus:" << command.iStatus;
+    
+    int result = m_callDivertingWrapper->setCallDiverting(
+            command, bscParam(command.iServiceGroup));
+    if (0 == result) {
+        if (!CpPhoneNotes::instance()->noteShowing()) {
+            CpPhoneNotes::instance()->showGlobalProgressNote(
+                    m_activeProgressNoteId, hbTrId("txt_phone_info_requesting"));
+        }
+    } else {
+        handleDivertingError(result);
+    }
+    
+    DPRINT << ": OUT ";
+}
+
+/*!
+  CpDivertPluginGroup::popUpTimerQuery.
+ */
+bool CpDivertPluginGroup::popUpTimerQuery(int &timeout) 
+{
+    DPRINT << ": IN";
+    Q_UNUSED(timeout); 
+    
+    bool requestOK(false);
+    m_divertTimeout = 0; 
+    
+    if (!m_eventLoop->isRunning()) {
+        HbDialog *dialog = createDialog(hbTrId("txt_phone_title_delay"));
+        
+        if (m_popupTimerList) {
+            m_popupTimerList = new HbListWidget(dialog);
+            
+            addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_5_seconds"), 5 );
+            addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_10_seconds"), 10);
+            addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_15_seconds"), 15);
+            addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_20_seconds"), 20);
+            addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_25_seconds"), 25);
+            addItemToListWidget(m_popupTimerList, hbTrId("txt_phone_list_30_seconds"), 30);
+            
+            // Connect list item activation signal to close the popup
+            QObject::connect(
+                    m_popupTimerList, SIGNAL(activated(HbListWidgetItem*)), 
+                    dialog, SLOT(close()), 
+                    Qt::UniqueConnection);
+        }
+        
+        // Sets the "Cancel"-action/button
+        HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"));
+        dialog->addAction(cancelAction);
+        dialog->setContentWidget(m_popupTimerList);
+    
+        dialog->open(this, SLOT(popUpTimerQueryClosed(HbAction *))); 
+        
+        QPointer<QObject> guard = this;
+        m_eventLoop->exec(); 
+        if (guard.isNull()) {
+            requestOK = false;
+        } else if (m_divertTimeout > 0) {
+            requestOK = true;
+        }
+    }
+    
+    DPRINT << ": OUT : requestOK :" << requestOK;
+    return requestOK;
+}
+
+/*!
+  CpDivertPluginGroup::popUpTimerQueryClosed.
+ */
+void CpDivertPluginGroup::popUpTimerQueryClosed(HbAction* action)
+{
+    // If not cancel action selected 
+    if (!action) {
+        // Update the view with selected text
+        if (m_popupTimerList->currentItem()) {
+            m_divertTimeout = 
+                    m_popupTimerList->currentItem()->data().toInt();
+        }
+    }
+    else {
+        DPRINT << ": Cancel";
+    }
+
+    DPRINT << ": quit eventloop";
+    m_eventLoop->quit();
+
+    DPRINT << ": OUT: timeout: " << m_divertTimeout;
+}
+
+
+/*!
+  CpDivertPluginGroup::bscParam.
+ */
+int CpDivertPluginGroup::bscParam(PsServiceGroup serviceGroup)
+{
+    DPRINT << ": IN";
+
+    int bsc = AllTeleAndBearer;
+
+    if (serviceGroup & ServiceGroupVoice) {
+        int alsLine(AlsNotSupported);
+        m_ssSettingsWrapper->get(Als,alsLine);
+        DPRINT << ": alsLine " << alsLine;
+        
+        if ((alsLine == AlsNotSupported) || (alsLine == AlsPrimary)) {
+            // Etelephony only activates voice service nothing else or causes
+            // voice service status request.
+            bsc = Telephony;
+        }
+        else { // ESSSettingsAlsAlternate
+            // EAltTele only activates alternate service nothing else or causes
+            // alternate service status request.
+            bsc = AltTele;
+        }
+    }
+    
+    if (serviceGroup & ServiceGroupData) {
+        bsc = AllBearer;
+    }
+
+
+    
+    DPRINT << ": OUT : bsc :" << bsc;
+    return bsc;
+}
+
+/*!
+  CpDivertPluginGroup::createDialog.
+ */
+HbDialog* CpDivertPluginGroup::createDialog( const QString& heading ) const
+{
+    DPRINT << ": IN";
+ 
+    HbDialog *dialog = new HbDialog();
+    dialog->setDismissPolicy(HbDialog::NoDismiss);
+    dialog->setTimeout(HbDialog::NoTimeout);
+    dialog->setHeadingWidget(new HbLabel(heading));
+    
+    DPRINT << ": OUT";
+    return dialog;
+}
+
+/*!
+  CpDivertPluginGroup::addItemToListWidget.
+ */
+void CpDivertPluginGroup::addItemToListWidget(HbListWidget* w,
+        const QString& item, const QString& data) const
+{
+    DPRINT << ": IN";
+ 
+    HbListWidgetItem* o = new HbListWidgetItem();
+    o->setText(item);
+    o->setData(data);
+    w->addItem(o);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::addItemToListWidget.
+ */
+void CpDivertPluginGroup::addItemToListWidget(HbListWidget* w,
+        const QString& item, const int& data) const
+{
+    DPRINT << ": IN";
+ 
+    HbListWidgetItem* o = new HbListWidgetItem();
+    o->setText(item);
+    o->setData(data);
+    w->addItem(o);
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::updateDependentDivertOptions.
+  Updates statuses of diverts which are dependent from the status of some
+  other divert. Logic for dependent changes are:
+  1. Activation of all calls divert deactivates other diverts/puts them 
+  into quiescent state.
+  2. Deactivation of all calls divert enables diverts in quiescent state.
+  3. Not available option is an abstraction of CFB, CFNry, CFNrc diverts.
+     Enabling/disabling that options changes all the aforementioned diverts 
+     at once.
+*/
+void CpDivertPluginGroup::updateDependentDivertOptions(bool fetchFromNetwork)
+{
+    DPRINT << ": IN";
+    
+    // all calls divert activation deactivates automatically other diverts
+    QVariant itemState = m_DataItemVoiceAllCalls->contentWidgetData("state");
+    if ((itemState.isValid()) && 
+        (itemState.toInt() == CpDivertSelectionCustomitem::Enabled)) {
+        deActivateDependentDivertOption(m_DataItemVoiceIfBusy);
+        deActivateDependentDivertOption(m_DataItemVoiceIfNotAnswered);
+        deActivateDependentDivertOption(m_DataItemVoiceIfOutOfReach);
+    } else {
+        // Must query data for diverts depending on all calls divert, because 
+        // data may have been lost for registered diverts, which were 
+        // automatically deactivated due to the activation of all calls divert.
+        activateDependentDivertOption(m_DataItemVoiceIfBusy, fetchFromNetwork);
+        activateDependentDivertOption(m_DataItemVoiceIfNotAnswered, fetchFromNetwork);
+        activateDependentDivertOption(m_DataItemVoiceIfOutOfReach, fetchFromNetwork);
+    }
+    
+    // all calls divert activation deactivates automatically other diverts
+    itemState = m_DataItemVideoAllCalls->contentWidgetData("state");
+    if ((itemState.isValid()) && 
+        (itemState.toInt() == CpDivertSelectionCustomitem::Enabled)) {
+        deActivateDependentDivertOption(m_DataItemVideoIfBusy);
+        deActivateDependentDivertOption(m_DataItemVideoIfNotAnswered);
+        deActivateDependentDivertOption(m_DataItemVideoIfOutOfReach);
+    } else {
+        // Must query data for diverts depending on all calls divert, because 
+        // data may have been lost for registered diverts, which were 
+        // automatically deactivated due to the activation of all calls divert.
+        activateDependentDivertOption(m_DataItemVideoIfBusy, fetchFromNetwork);
+        activateDependentDivertOption(m_DataItemVideoIfNotAnswered, fetchFromNetwork);
+        activateDependentDivertOption(m_DataItemVideoIfOutOfReach, fetchFromNetwork);
+    }
+    
+    // update not available divert option
+    updateNotAvailableDivertOption();
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+  CpDivertPluginGroup::deActivateDependentDivertOption.
+*/
+void CpDivertPluginGroup::deActivateDependentDivertOption(
+        CpDivertItemData* item) const
+{
+    QVariant itemState = item->contentWidgetData("state");
+    if ((itemState.isValid()) && 
+        (itemState == CpDivertSelectionCustomitem::Enabled)) {
+        item->setContentWidgetData(
+            "state", CpDivertSelectionCustomitem::Deactivated);
+    }
+    item->setEnabled(false);
+}
+
+/*!
+  CpDivertPluginGroup::activateDependentDivertOption.
+*/
+void CpDivertPluginGroup::activateDependentDivertOption(
+        CpDivertItemData* item, bool fetchFromNetwork)
+{
+    if ((CpDivertSelectionCustomitem::Deactivated == 
+            item->contentWidgetData("state").toInt()) &&
+            fetchFromNetwork) {
+        addToDivertingRequestQueue(
+            CheckDivertStatus, *item);
+    }
+    item->setEnabled(true);
+}
+
+/*!
+  CpDivertPluginGroup::updateNotAvailableDivertOption.
+ */
+void CpDivertPluginGroup::updateNotAvailableDivertOption()
+{
+    DPRINT << ": IN";
+    
+    // We must check that both states & numbers match amongst CFB, CRNry and 
+    // CFNrc before concluding that not available divert is enabled, because
+    // some networks may not return divert number for inactive diverts.
+    int cfbState = 
+        m_DataItemVoiceIfBusy->contentWidgetData("state").toInt();
+    int cfnryState = 
+        m_DataItemVoiceIfNotAnswered->contentWidgetData("state").toInt();
+    int cfnrcState = 
+        m_DataItemVoiceIfOutOfReach->contentWidgetData("state").toInt();
+    QVariant cfbNumber = 
+        m_DataItemVoiceIfBusy->contentWidgetData("number");
+    QVariant cfnryNumber = 
+        m_DataItemVoiceIfNotAnswered->contentWidgetData("number");
+    QVariant cfnrcNumber = 
+        m_DataItemVoiceIfOutOfReach->contentWidgetData("number");
+    
+    if ((cfbNumber == cfnryNumber) && (cfbNumber == cfnrcNumber) &&
+        (cfbState == cfnryState) && (cfbState == cfnrcState)) {
+        m_DataItemVoiceIfNotAvailable->setContentWidgetData(
+            "number", m_DataItemVoiceIfBusy->contentWidgetData("number"));
+        m_DataItemVoiceIfNotAvailable->setContentWidgetData(
+            "timeout", m_DataItemVoiceIfNotAnswered->contentWidgetData("timeout"));
+        m_DataItemVoiceIfNotAvailable->setContentWidgetData(
+            "state", m_DataItemVoiceIfBusy->contentWidgetData("state"));
+    } else {
+        m_DataItemVoiceIfNotAvailable->setContentWidgetData("number", "");
+        m_DataItemVoiceIfNotAvailable->setContentWidgetData("timeout", 0);
+        m_DataItemVoiceIfNotAvailable->setContentWidgetData(
+            "state", CpDivertSelectionCustomitem::Disabled);
+
+    }
+    // Item dimming
+    m_DataItemVoiceIfNotAvailable->setEnabled(
+            m_DataItemVoiceIfBusy->isEnabled() &&
+            m_DataItemVoiceIfNotAnswered->isEnabled() &&
+            m_DataItemVoiceIfOutOfReach->isEnabled()); 
+    
+    
+    // We must check that both states & numbers match amongst CFB, CRNry and 
+    // CFNrc before concluding that not available divert is enabled, because
+    // some networks may not return divert number for inactive diverts.
+    cfbState = 
+        m_DataItemVideoIfBusy->contentWidgetData("state").toInt();
+    cfnryState = 
+        m_DataItemVideoIfNotAnswered->contentWidgetData("state").toInt();
+    cfnrcState = 
+        m_DataItemVideoIfOutOfReach->contentWidgetData("state").toInt();
+    cfbNumber = 
+        m_DataItemVideoIfBusy->contentWidgetData("number");
+    cfnryNumber = 
+        m_DataItemVideoIfNotAnswered->contentWidgetData("number");
+    cfnrcNumber = 
+        m_DataItemVideoIfOutOfReach->contentWidgetData("number");
+    
+    if ((cfbNumber == cfnryNumber) && (cfbNumber == cfnrcNumber) &&
+        (cfbState == cfnryState) && (cfbState == cfnrcState)) {
+        m_DataItemVideoIfNotAvailable->setContentWidgetData(
+            "number", m_DataItemVideoIfBusy->contentWidgetData("number"));
+        m_DataItemVideoIfNotAvailable->setContentWidgetData(
+            "timeout", m_DataItemVideoIfNotAnswered->contentWidgetData("timeout"));
+        m_DataItemVideoIfNotAvailable->setContentWidgetData(
+            "state", m_DataItemVideoIfBusy->contentWidgetData("state"));
+    } else {
+        m_DataItemVideoIfNotAvailable->setContentWidgetData("number", "");
+        m_DataItemVideoIfNotAvailable->setContentWidgetData("timeout", 0);
+        m_DataItemVideoIfNotAvailable->setContentWidgetData(
+            "state", CpDivertSelectionCustomitem::Disabled);
+
+    }
+    
+    // Item dimming
+    m_DataItemVideoIfNotAvailable->setEnabled(
+            m_DataItemVideoIfBusy->isEnabled() &&
+            m_DataItemVideoIfNotAnswered->isEnabled() &&
+            m_DataItemVideoIfOutOfReach->isEnabled()); 
+    
+    DPRINT << ": OUT";
+}
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertplugingroup.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 CPDIVERTPLUGINGROUP_H
+#define CPDIVERTPLUGINGROUP_H
+
+#include <QMap>
+#include <QString>
+#include <QQueue>
+#include <hbdevicemessagebox.h>
+#include <cpsettingformitemdata.h>
+#include <psetcalldivertingwrapper.h>
+#include "cptelephonyutilsdefs.h"
+#include "cppluginlogging.h"
+
+
+class HbDataFormViewItem; 
+class PSetWrapper;
+class SsSettingsWrapper;
+class HbComboBox;
+class PSCallDivertingCommand;
+class HbListWidget;
+class CpDivertItemData;
+class QEventLoop; 
+class HbLineEdit; 
+
+using namespace CpTelephonyUtils;
+
+/*!
+    \class CpDivertPluginGroup
+    \brief The class CpDivertPluginGroup defines items shown on UI. 
+ */
+class CpDivertPluginGroup : public CpSettingFormItemData
+{
+    Q_OBJECT
+
+    enum DivertRequest{
+        ActivateDivert = 0, 
+        DeactivateDivert, 
+        CheckDivertStatus
+    };  
+
+    class CpDivertRequestQueueItem
+    {
+    public:
+        DivertRequest request;
+        CpDivertItemData *item;
+    };
+    
+    
+public:
+
+    explicit CpDivertPluginGroup(CpItemDataHelper &helper);
+    
+    ~CpDivertPluginGroup();
+
+public slots:
+    
+    // PSetCallDivertingWrapper signal handling
+    /**
+     Set info request results
+     */
+    void handleDivertingChanged(
+            const PSCallDivertingCommand& aSetting, 
+            bool aPlural);
+    
+    /**
+     Get info request results
+     */
+    void handleDivertingStatus(
+        QList<PSCallDivertingStatus*>& divertList, 
+        bool plural);
+    
+    /**
+     Request failed.
+     */
+    void handleDivertingError(int aReason);
+
+    /**
+     Adaptation has handled previous request.
+     */
+    void divertRequestProcessed();
+    
+    /**
+     Slot which handles change requests according UI.
+     */
+    void changeDivertingStateRequested(CpDivertItemData &item);
+
+    /**
+     Slot which handles item updating when it is needed.
+     */
+    void itemShown(const QModelIndex& item);
+    
+    void voiceNumberListQueryClosed(HbAction* action);
+    void popUpNumberEditorClosed(HbAction* action);
+    void popUpTimerQueryClosed(HbAction* action);
+    
+private:     
+    
+    /**
+     Creates group items.
+     */
+    void createVoiceCallItems(CpSettingFormItemData *group);
+
+    /**
+     Creates group items.
+     */
+    void createVideoCallItems(CpSettingFormItemData *parent);
+    
+    /**
+     Creates single item.
+     */
+    CpDivertItemData *createDivertItem(
+            PsCallDivertingCondition condition,
+            PsServiceGroup serviceGroup,
+            const QString &label,
+            const QString &queryLabel,
+            bool needTimeoutInfo,
+            CpSettingFormItemData *parent = 0);
+    
+    /**
+     Show to user divert number query list.
+     */
+    bool popUpVoiceNumberListQuery(
+            const QString& heading, QString& result, PsServiceGroup serviceGroup);
+    
+    /**
+     Show to user number query.
+     */
+    void popUpNumberEditor(
+            const QString& heading, QString& result);
+    
+    
+    /**
+     Send comand to psetwrappercalldiverting.
+     */
+    void setCallDiverting(PSCallDivertingCommand& command);
+    
+    /**
+     Show to user divert time out query list.
+     */
+    bool popUpTimerQuery(int &timeout);
+    
+    /**
+     Desides which bsc parameters to use.
+     */
+    int bscParam(PsServiceGroup serviceGroup);
+    
+    /**
+     Adds divert data item for wanted parent.
+     */
+    void addDivertDataItem(
+            CpDivertItemData* item, CpSettingFormItemData *parent);
+
+    /**
+     Process next divert request.
+     */
+    void processDivertingRequestQueue();
+
+    /**
+     Add new request to divert queue.
+     */
+    void addToDivertingRequestQueue(
+            DivertRequest request, 
+            CpDivertItemData &item);
+    
+    /**
+     Changes divertItemData data.
+     */
+    void changeItemData(
+            PsServiceGroup serviceGroup,
+            PsCallDivertingCondition condition, 
+            PsCallDivertingStatus status,
+            const QString& number, 
+            int timeout);
+    
+    /**
+     Reverts divertItemData data to the last known valid values.
+     */
+    void revertItemData(
+            PsServiceGroup serviceGroup, PsCallDivertingCondition condition);
+
+    /**
+     Helper function which fetches model item according service and condition.
+     */
+    CpSettingFormItemData* item(
+            PsService service, PsCallDivertingCondition condition);
+private:
+    
+    /**
+     Creates dialog with default parameters
+     */
+    HbDialog* createDialog( const QString& heading ) const;
+
+    /**
+     Adds item to given list widget
+     */
+    void addItemToListWidget(HbListWidget* w,
+        const QString& item, const QString& data) const;
+
+    /**
+     Adds item to given list widget
+     */
+    void addItemToListWidget(HbListWidget* w,
+        const QString& item, const int& data) const;
+
+    /**
+     Synchronizes content and status of divert options dependent from the 
+     status of some other divert.
+     */
+    void updateDependentDivertOptions(bool fetchFromNetwork = false);
+    void activateDependentDivertOption(CpDivertItemData* item, bool fetchFromNetwork);
+    void deActivateDependentDivertOption(CpDivertItemData* item) const;
+    
+    /**
+     Synchronizes content and status of not available divert option based on
+     statuses of CFB, CFNry and CFNrc.
+     */
+    void updateNotAvailableDivertOption();
+    
+private:   // data
+
+    // Setting wrappers 
+    PSetWrapper *m_pSetWrapper;
+    SsSettingsWrapper *m_ssSettingsWrapper;
+    
+    // Not own
+    PSetCallDivertingWrapper* m_callDivertingWrapper;
+
+    // Not owned objects
+    CpDivertItemData *m_DataItemVoiceAllCalls;
+    CpDivertItemData *m_DataItemVoiceIfBusy;
+    CpDivertItemData *m_DataItemVoiceIfNotAnswered;
+    CpDivertItemData *m_DataItemVoiceIfOutOfReach;
+    CpDivertItemData *m_DataItemVoiceIfNotAvailable;
+    
+    CpDivertItemData *m_DataItemVideoAllCalls;
+    CpDivertItemData *m_DataItemVideoIfBusy;
+    CpDivertItemData *m_DataItemVideoIfNotAnswered;
+    CpDivertItemData *m_DataItemVideoIfOutOfReach;
+    CpDivertItemData *m_DataItemVideoIfNotAvailable;
+
+    int m_activeNoteId;
+    int m_activeProgressNoteId;
+
+    // To prevent adding vmbx number to defaultlist
+    bool m_divertToVoiceMailBox;
+
+    /**
+     Divert request queue
+     */
+    QQueue<CpDivertRequestQueueItem> m_divertRequestQueue;
+
+    CpItemDataHelper &m_helper;
+    
+    int m_divertTimeout;
+    
+    HbListWidget *m_voiceNumberList;
+    HbListWidget *m_popupTimerList; 
+    QString m_divertNumber; 
+    HbLineEdit *m_voiceNumberEditor; 
+    QEventLoop *m_eventLoop; 
+    
+};
+
+#endif // CPDIVERTPLUGINGROUP_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 "cpdivertselectioncustomitem.h"
+#include <hblabel.h>
+#include <hbcheckbox.h>
+#include <qgraphicsgridlayout.h>
+#include <cppluginlogging.h>
+
+
+/*!
+  CpDivertSelectionCustomitem::CpDivertSelectionCustomitem.
+ */
+CpDivertSelectionCustomitem::CpDivertSelectionCustomitem(
+        QGraphicsItem *parent /**=0*/,
+        Qt::WindowFlags wFlags /**=0*/):
+        HbWidget(parent, wFlags),
+        layout(NULL),
+        checkbox(NULL),
+        timeoutLabel(NULL),
+        timeoutValueLabel(NULL),
+        m_state(Disabled)
+{
+    DPRINT;
+
+    layout = new QGraphicsGridLayout(this);
+    layout->setSpacing(0);
+    layout->setContentsMargins(0,0,0,0);
+    layout->setRowMaximumHeight(0,0);
+    layout->setRowMaximumHeight(1,0);
+
+    checkbox = new HbCheckBox(this);
+    HbStyle::setItemName(checkbox, "dataItem_ContentWidget");
+
+    layout->addItem(checkbox, 0, 0, 1, 2);
+    connect(checkbox,SIGNAL(clicked()), this, SIGNAL(clicked()));
+
+    timeoutLabel = new HbLabel(this);
+    HbStyle::setItemName(timeoutLabel, "dataItem_ContentWidget");
+    timeoutLabel->setAlignment(Qt::AlignRight);
+    layout->addItem(timeoutLabel, 1, 0);
+
+    timeoutLabel->hide();
+    timeoutValueLabel = new HbLabel(this);
+    HbStyle::setItemName(timeoutValueLabel, "dataItem_ContentWidget");
+    timeoutValueLabel->hide();
+    layout->addItem(timeoutValueLabel, 1, 1);
+
+    setLayout(layout);
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::~CpDivertSelectionCustomitem. 
+ */
+CpDivertSelectionCustomitem::~CpDivertSelectionCustomitem()
+{
+    DPRINT;
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::number.
+ */
+const QString CpDivertSelectionCustomitem::number() const
+{
+    DPRINT;
+    return checkbox->text();
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::setNumber.
+ */
+void CpDivertSelectionCustomitem::setNumber(const QString& number)
+{
+    DPRINT << number;    
+    checkbox->setText(number);
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::timeout.
+ */
+int CpDivertSelectionCustomitem::timeout() const
+{
+    DPRINT;
+    return timeoutValueLabel->plainText().toInt();
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::setTimeout.
+ */
+void CpDivertSelectionCustomitem::setTimeout(int timeout)
+{
+    DPRINT << timeout;
+    timeoutValueLabel->setPlainText(QString::number(timeout));
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::timeoutText.
+ */
+const QString CpDivertSelectionCustomitem::timeoutText() const
+{
+    DPRINT;
+    return timeoutLabel->plainText();
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::setTimeoutText.
+ */
+void CpDivertSelectionCustomitem::setTimeoutText( const QString& text )
+{
+    DPRINT << text;
+    timeoutLabel->setPlainText(text);
+
+    if (text != QString("")) {
+        timeoutLabel->show();
+        timeoutValueLabel->show();
+
+    } else {
+        timeoutLabel->hide();
+        timeoutValueLabel->hide();
+    }
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::state.
+ */
+int CpDivertSelectionCustomitem::state() const
+{
+    DPRINT << m_state;
+    return m_state;
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::setState.
+ */
+void CpDivertSelectionCustomitem::setState(int state)
+{
+    DPRINT << state;
+    m_state = state;
+    updateCheckState();
+}
+
+
+/*!
+  CpDivertSelectionCustomitem::updateCheckState.
+ */
+void CpDivertSelectionCustomitem::updateCheckState()
+{
+    DPRINT << m_state;
+    
+    switch (m_state) {
+        case Enabled:
+            checkbox->setCheckState(Qt::Checked);
+            break;
+        case Deactivated:
+            setNumber(QString(""));
+            setTimeout(0);
+			//intended fall-through
+        case Disabled:
+            checkbox->setCheckState(Qt::Unchecked);
+            break;
+        default:
+            break;
+    }
+}
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies 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 CPDIVERTSELECTIONCUSTOMITEM_H
+#define CPDIVERTSELECTIONCUSTOMITEM_H
+
+#include <hbwidget.h>
+
+class QGraphicsGridLayout;
+class HbCheckBox;
+class HbLabel;
+
+class CpDivertSelectionCustomitem : public HbWidget
+{
+    Q_OBJECT
+    Q_PROPERTY(QString number READ number WRITE setNumber)
+    Q_PROPERTY(QString timeoutText READ timeoutText WRITE setTimeoutText)
+    Q_PROPERTY(int timeout READ timeout WRITE setTimeout)
+    Q_PROPERTY(int state READ state WRITE setState)
+
+public:    
+    enum State {
+        /** Divert is registered and activated.*/
+        Enabled,
+        /** Divert is registered but inactive.*/
+        Deactivated,
+        /** Divert is not registered.*/
+        Disabled
+    };
+
+public:
+    CpDivertSelectionCustomitem(
+            QGraphicsItem *parent=0,
+            Qt::WindowFlags wFlags=0);
+
+    ~CpDivertSelectionCustomitem();
+
+    const QString number() const;
+
+    void setNumber( const QString& number );
+
+    int timeout() const;
+
+    void setTimeout( int timeout);
+
+    const QString timeoutText() const;
+
+    void setTimeoutText( const QString& text );
+    
+    int state() const;
+
+    void setState( int state);
+    
+signals:
+    void clicked();
+
+private:
+    void removeItemFromLayout( QGraphicsWidget* item );
+    void updateCheckState();
+
+private:
+    QGraphicsGridLayout *layout;
+    HbCheckBox *checkbox;
+    HbLabel *timeoutLabel;
+    HbLabel *timeoutValueLabel;
+    int m_state;
+};
+
+#endif // CPDIVERTSELECTIONCUSTOMITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectionitem.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include "cpdivertselectionitem.h"
+#include "cpdivertselectioncustomitem.h"
+#include <HbDataFormModel>
+#include <HbAbstractItemView>
+#include <cppluginlogging.h>
+#include <qmetaobject.h>
+
+
+
+CpDivertSelectionItem::CpDivertSelectionItem(QGraphicsItem *parent )
+: HbDataFormViewItem(parent)
+{
+    DPRINT;
+}
+
+CpDivertSelectionItem::~CpDivertSelectionItem()
+{
+    DPRINT;
+}
+
+HbAbstractViewItem* CpDivertSelectionItem::createItem()
+{
+    DPRINT;
+    return new CpDivertSelectionItem(*this);
+}
+
+bool CpDivertSelectionItem::canSetModelIndex(const QModelIndex &index) const
+{
+    DPRINT << "index:" << index;
+    int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt();
+    return type == CpDivertSelectionItemId;
+}
+
+HbWidget *CpDivertSelectionItem::createCustomWidget()
+{
+    DPRINT << ": IN";
+
+    int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt();
+
+    if (type == CpDivertSelectionItemId) {
+            CpDivertSelectionCustomitem *retWidget =
+                    new CpDivertSelectionCustomitem(this);
+
+            DPRINT << ": OUT, retWidget";
+            return retWidget;
+    }
+    DPRINT << ": OUT, 0";
+    return 0;
+}
+
+
+void CpDivertSelectionItem::restore()
+{
+    HbDataFormViewItem::restore();
+
+    if (dataItemContentWidget()) {
+        HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>(
+            modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
+
+        if (CpDivertSelectionItemId == itemType) {
+
+            QModelIndex itemIndex = modelIndex();
+            HbDataFormModel *model = static_cast<HbDataFormModel*>(itemView()->model());
+            HbDataFormModelItem *modelItem = static_cast<HbDataFormModelItem*>(
+                model->itemFromIndex(itemIndex));
+
+            const QMetaObject *metaObj = dataItemContentWidget()->metaObject();
+            int count = metaObj->propertyCount();
+            for (int i = 0; i < count; i++) {
+                QMetaProperty metaProperty = metaObj->property(i);
+                if (metaProperty.isValid() && metaProperty.isWritable()) {
+                    metaProperty.write(
+                            dataItemContentWidget(),
+                            modelItem->contentWidgetData(metaProperty.name()));
+                }
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectionitem.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+
+#ifndef CPDIVERTSELECTIONITEM_H
+#define CPDIVERTSELECTIONITEM_H
+
+#include <hbdataformviewitem.h>
+#include <hbdataformmodelitem.h>
+
+
+class CpDivertSelectionItem : public HbDataFormViewItem
+{
+    Q_OBJECT
+public:
+    enum { CpDivertSelectionItemId = HbDataFormModelItem::CustomItemBase + 66 };
+
+    explicit CpDivertSelectionItem(QGraphicsItem *parent = 0);
+    virtual ~CpDivertSelectionItem();
+    virtual HbAbstractViewItem* createItem();
+    virtual bool canSetModelIndex(const QModelIndex &index) const;
+    void restore();
+protected:
+    virtual HbWidget* createCustomWidget();
+};
+
+#endif //CPDIVERTSELECTIONITEM_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs --config winscw_udeb --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+    call %PATH_TO_DLL%\%%a.exe
+    move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/qtestmains60ui.h	Fri Jun 04 10:19:18 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 QTESTMAINS60
+#define QTESTMAINS60
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+char *new_argv[3];
+HbMainWindow *mainWindow;
+#define QTEST_MAIN_S60UI(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+HbApplication *app = new HbApplication(argc, argv); \
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+QResource::registerResource("../hbcore.rcc"); \
+mainWindow = new HbMainWindow;\
+mainWindow->show(); \
+int ret = QTest::qExec(&tc, 3, new_argv); \
+delete mainWindow; \
+delete app; \
+return ret; \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,577 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ut_cpdivertplugin.h"
+#include "qtestmains60ui.h"
+#include <psetcalldivertingwrapper.h>
+#include <hbdialog.h>
+#include <qaction>
+#include <hblabel.h>
+#include <HbListWidgetItem>
+#include <HbListWidget>
+#include <HbDialog>
+#include <HbLineEdit>
+#include <HbAbstractViewItem>
+#include <HbDataFormModel>
+#include "cpitemdatahelper.h"
+#include "cpdivertitemdata.h"
+#include "psetwrappertypes.h"
+#include "cpdivertselectioncustomitem.h"
+
+#define private public
+#include "cpdivertplugin.h"
+#include "cpdivertplugingroup.h"
+
+
+Q_DECLARE_METATYPE(PsCallDivertingCondition)
+Q_EXTERN_C const char * qt_plugin_query_verification_data();
+Q_EXTERN_C ::QObject *  qt_plugin_instance();
+
+class CPsetContainer
+{
+public:
+    CPsetContainer(){};
+    ~CPsetContainer(){};
+};
+
+void fillNumber(QString& number)
+{
+    number = "1234567";
+}
+    
+
+/*!
+  UT_CpDivertPlugin::UT_CpDivertPlugin
+ */
+UT_CpDivertPlugin::UT_CpDivertPlugin() 
+    : m_divertplugin(NULL)
+{
+    const char * verificationData = qt_plugin_query_verification_data();
+	qRegisterMetaType<PsCallDivertingCondition>(
+        "PsCallDivertingCondition");
+}
+
+/*!
+  UT_CpDivertPlugin::~UT_CpDivertPlugin
+ */
+UT_CpDivertPlugin::~UT_CpDivertPlugin()
+{
+    delete m_divertpluginGroup;
+    delete m_helper;
+    delete m_divertplugin;
+}
+
+/*!
+  UT_CpDivertPlugin::init
+ */
+void UT_CpDivertPlugin::init()
+{
+    initialize();
+
+    CPsetContainer tmpPsetContainer;
+    PSetCallDivertingWrapper *tmpDivWrapper = 
+            new PSetCallDivertingWrapper(tmpPsetContainer, this);
+    expect("PSetWrapper::callDivertingWrapper").returns(tmpDivWrapper); // FIXME to mock framework
+    m_divertplugin = (CpDivertPlugin*)qt_plugin_instance();
+    
+    QVERIFY(m_divertplugin);
+    
+    m_helper = new CpItemDataHelper;
+    QList<CpSettingFormItemData*> list;
+    list.append(m_divertplugin->createSettingFormItemData(*m_helper));
+    m_divertpluginGroup = qobject_cast<CpDivertPluginGroup *>(list.takeFirst());
+    QVERIFY(m_divertpluginGroup);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpDivertPlugin::cleanup
+ */
+void UT_CpDivertPlugin::cleanup()
+{
+    reset();
+    delete m_divertpluginGroup;
+    m_divertpluginGroup = NULL;
+
+    delete m_helper;
+    m_helper = NULL;
+    
+    delete m_divertplugin;
+    m_divertplugin = NULL;
+
+}
+
+/*!
+  UT_CpDivertPlugin::t_memleak
+ */
+void UT_CpDivertPlugin::t_memleak()
+{
+    
+}
+
+/*!
+  UT_CpDivertPlugin::t_createSettingFormItemData
+ */
+void UT_CpDivertPlugin::t_createSettingFormItemData()
+{
+    CpItemDataHelper itemDataHelper;
+    CPsetContainer tmpContainer;
+    PSetCallDivertingWrapper tmpDivWrapper(tmpContainer); 
+    
+    expect("PSetWrapper::callDivertingWrapper").returns(&tmpDivWrapper); 
+    
+    CpDivertPlugin* p = (CpDivertPlugin*)qt_plugin_instance(); // Get static
+    QList<CpSettingFormItemData*> list;
+    list.append(p->createSettingFormItemData(itemDataHelper));
+    qDeleteAll(list);
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpDivertPlugin::t_changeDivertingStateRequested
+ */
+void UT_CpDivertPlugin::t_changeDivertingStateRequested()
+{
+    //except user cancels
+    appendAction("All voice calls:", selectAction, "Cancel");
+    expect("PSetCallDivertingWrapper::getDefaultNumbers");
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData("number", "");
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData(
+            "state", CpDivertSelectionCustomitem::Disabled);
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked();
+    QVERIFY(verify());
+    
+    //except user selects vmb
+    appendAction("All voice calls:", selectItem, "txt_phone_setlabel_voice_mbx");
+    expect("PSetCallDivertingWrapper::getDefaultNumbers");
+    expect("PSetCallDivertingWrapper::getVoiceMailBoxNumber").willOnce(invoke(fillNumber));
+    expect("SsSettingsWrapper::get");
+    expect("PSetCallDivertingWrapper::setCallDiverting");
+    expect("CpPhoneNotes::noteShowing").returns(false);
+    expect("CpPhoneNotes::showGlobalProgressNote");
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked();
+    QVERIFY(verify()); // Verify item click
+    PSCallDivertingCommand command;
+    command.iNumber = "12345";
+    command.iStatus = DivertingStatusActive;
+    command.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition"));
+    command.iServiceGroup = ServiceGroupVoice;
+    expect("CpPhoneNotes::showGlobalNote");
+    m_divertpluginGroup->handleDivertingChanged(command, false);
+    expect("CpPhoneNotes::cancelNote");
+    m_divertpluginGroup->divertRequestProcessed();
+    QVERIFY(verify()); // Verify result processing
+
+    //except user selects one of the default numbers
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData("number","");
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->setContentWidgetData(
+            "state", CpDivertSelectionCustomitem::Disabled);
+    appendAction("All voice calls:", selectItem, "0401234567");
+    expect("PSetCallDivertingWrapper::getDefaultNumbers");
+    expect("SsSettingsWrapper::get");
+    expect("PSetCallDivertingWrapper::setCallDiverting");
+    expect("CpPhoneNotes::noteShowing").returns(false);
+    expect("CpPhoneNotes::showGlobalProgressNote");
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked();
+    command.iNumber = "0401234567";
+    command.iStatus = DivertingStatusActive;
+    command.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition"));
+    command.iServiceGroup = ServiceGroupVoice;
+    expect("CpPhoneNotes::cancelNote");
+    expect("CpPhoneNotes::showGlobalNote");
+    expect("PSetCallDivertingWrapper::setNewDefaultNumber").with(QString("0401234567"));
+    expect("Tools::voipSupported").returns(false);
+    m_divertpluginGroup->handleDivertingChanged(command, true);
+    expect("CpPhoneNotes::cancelNote");
+    m_divertpluginGroup->divertRequestProcessed();
+    QVERIFY(verify());
+    
+    // Divert is disabled
+    expect("SsSettingsWrapper::get");
+    expect("PSetCallDivertingWrapper::setCallDiverting"); // Disable divert
+    expect("CpPhoneNotes::noteShowing").returns(false);
+    expect("CpPhoneNotes::showGlobalProgressNote");
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked();
+    command.iNumber = "";
+    command.iStatus = DivertingStatusInactive;
+    command.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition"));
+    command.iServiceGroup = ServiceGroupVoice;
+    expect("CpPhoneNotes::showGlobalNote");
+    m_divertpluginGroup->handleDivertingChanged(command, false);
+    expect("CpPhoneNotes::cancelNote");
+    m_divertpluginGroup->divertRequestProcessed();
+    QVERIFY(verify());
+    
+    //except user selects other number, inserts number and cancels
+    appendAction("All voice calls:", selectItem, "Other number");
+    appendAction("Number:", insertText, "12345");
+    appendAction("Number:", selectAction, "Cancel");
+    expect("PSetCallDivertingWrapper::getDefaultNumbers");
+    m_divertpluginGroup->m_DataItemVoiceAllCalls->thisItemClicked();
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpDivertPlugin::t_itemShown
+ */
+void UT_CpDivertPlugin::t_itemShown()
+{
+    HbDataFormModel* model = 
+            qobject_cast<HbDataFormModel*>(m_divertpluginGroup->model());
+    
+    expect("PSetCallDivertingWrapper::getCallDivertingStatus");
+    expect("CpPhoneNotes::noteShowing").returns(false);
+    expect("CpPhoneNotes::showGlobalProgressNote");
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceAllCalls));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfBusy));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAnswered));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfOutOfReach));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAvailable));
+    
+    QList<PSCallDivertingStatus*> list;
+    PSCallDivertingStatus divertStatus;
+    list.append(&divertStatus);
+    divertStatus.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceAllCalls->property("condition"));
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    m_divertpluginGroup->divertRequestProcessed();
+    divertStatus.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceIfBusy->property("condition"));
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    m_divertpluginGroup->divertRequestProcessed();
+    divertStatus.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->property("condition"));
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    m_divertpluginGroup->divertRequestProcessed();
+    divertStatus.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceIfOutOfReach->property("condition"));
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    m_divertpluginGroup->divertRequestProcessed();
+    divertStatus.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceIfNotAvailable->property("condition"));
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    m_divertpluginGroup->divertRequestProcessed();
+    
+    m_divertpluginGroup->divertRequestProcessed(); // Test overflow
+
+    // Test, Do not check status again
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceAllCalls));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfBusy));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAnswered));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfOutOfReach));
+    m_divertpluginGroup->itemShown(
+            model->indexFromItem(m_divertpluginGroup->m_DataItemVoiceIfNotAvailable));
+    
+
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpDivertPlugin::t_popUpTimerQuery
+ */
+void UT_CpDivertPlugin::t_popUpTimerQuery()
+{
+    appendAction("If not answered:", selectItem, "0401234567");
+    appendAction("Time out", selectAction, "Cancel");
+    expect("PSetCallDivertingWrapper::getDefaultNumbers");
+    m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->setContentWidgetData("number", "");
+    m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->setContentWidgetData(
+            "state", CpDivertSelectionCustomitem::Disabled);
+    m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->thisItemClicked();
+    QVERIFY(verify());
+    
+    appendAction("If not answered:", selectItem, "Other number");
+    appendAction("Number:", insertText, "12345");
+    appendAction("Number:", selectAction, "OK");
+    appendAction("Time out", selectItem, "15 second");
+    //except user chooses other number and inserts number and timeout
+    expect("PSetCallDivertingWrapper::getDefaultNumbers");    
+    expect("SsSettingsWrapper::get");
+    expect("PSetCallDivertingWrapper::setCallDiverting");
+    m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->thisItemClicked();
+    PSCallDivertingCommand command;
+    command.iNumber = "12345";
+    command.iNoReplyTimer = 15;
+    command.iStatus = DivertingStatusActive;
+    command.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->property("condition"));
+    command.iServiceGroup = ServiceGroupVoice;
+    expect("CpPhoneNotes::showGlobalNote");
+    m_divertpluginGroup->handleDivertingChanged(command, false);
+    expect("CpPhoneNotes::cancelNote");
+    m_divertpluginGroup->divertRequestProcessed();
+    QVERIFY(verify());
+    
+    expect("SsSettingsWrapper::get");
+    expect("PSetCallDivertingWrapper::setCallDiverting");
+    m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->thisItemClicked();
+    command.iNumber = "";
+    command.iNoReplyTimer = 0;
+    command.iStatus = DivertingStatusInactive;
+    command.iCondition = qvariant_cast<PsCallDivertingCondition>(
+            m_divertpluginGroup->m_DataItemVoiceIfNotAnswered->property("condition"));
+    command.iServiceGroup = ServiceGroupVoice;
+    expect("CpPhoneNotes::showGlobalNote");
+    m_divertpluginGroup->handleDivertingChanged(command, false);
+    expect("CpPhoneNotes::cancelNote");
+    m_divertpluginGroup->divertRequestProcessed();
+    QVERIFY(verify());
+
+}
+
+/*!
+  UT_CpDivertPlugin::t_handleDivertingChanged
+ */
+void UT_CpDivertPlugin::t_handleDivertingChanged()
+{
+    PSCallDivertingCommand c;
+    
+    c.iStatus = DivertingStatusActive;
+    c.iServiceGroup = ServiceGroupAllTeleservices;
+    bool bRet = false;
+    expect("PSetCallDivertingWrapper::setNewDefaultNumber");
+    expect("Tools::voipSupported").returns(bRet);
+    m_divertpluginGroup->handleDivertingChanged(c, true);
+    
+    QVERIFY(verify());
+    
+    bRet = true;
+    c.iServiceGroup = ServiceGroupAllTeleservices;
+    c.iCondition = DivertConditionUnconditional;
+    expect("PSetCallDivertingWrapper::setNewDefaultNumber");
+    expect("Tools::voipSupported").returns(bRet);
+    m_divertpluginGroup->handleDivertingChanged(c, false);
+    
+    QVERIFY(verify());
+    
+    c.iStatus = DivertingStatusInactive;
+    c.iCondition = DivertConditionBusy;
+    m_divertpluginGroup->handleDivertingChanged(c, true);
+    m_divertpluginGroup->handleDivertingChanged(c, false);
+    
+    c.iStatus = DivertingStatusNotRegistered;
+    c.iCondition = DivertConditionNoReply;
+    m_divertpluginGroup->handleDivertingChanged(c, true);
+    
+    c.iStatus = DivertingStatusNotProvisioned;
+    c.iCondition = DivertConditionNotReachable;
+    m_divertpluginGroup->handleDivertingChanged(c, true);
+    
+    c.iStatus = DivertingStatusUnknown;
+    c.iCondition = DivertConditionAllCalls;
+    m_divertpluginGroup->handleDivertingChanged(c, true);
+    
+    c.iStatus = (PsCallDivertingStatus)5;
+    c.iCondition = DivertConditionAllConditionalCases;
+    m_divertpluginGroup->handleDivertingChanged(c, true);
+    
+    QVERIFY(verify());
+}
+
+/*!
+  UT_CpDivertPlugin::t_handleDivertingStatus
+ */
+void UT_CpDivertPlugin::t_handleDivertingStatus()
+{
+    QList<PSCallDivertingStatus*> list;
+    PSCallDivertingStatus divertStatus;
+    
+    divertStatus.iTimeout =5;
+    divertStatus.iStatus = DivertingStatusActive;
+    list.append(&divertStatus);
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    divertStatus.iTimeout =0;
+    list.replace(0, &divertStatus);
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    
+    divertStatus.iStatus = DivertingStatusInactive;
+    list.replace(0, &divertStatus);
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    
+    divertStatus.iStatus = DivertingStatusNotRegistered;
+    list.replace(0, &divertStatus);
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    m_divertpluginGroup->handleDivertingStatus(list, false);
+    
+    divertStatus.iStatus = DivertingStatusNotProvisioned;
+    list.replace(0, &divertStatus);
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    
+    divertStatus.iStatus = DivertingStatusUnknown;
+    list.replace(0, &divertStatus);
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+    
+    divertStatus.iStatus = (PsCallDivertingStatus)5;
+    list.replace(0, &divertStatus);
+    m_divertpluginGroup->handleDivertingStatus(list, true);
+
+}
+
+/*!
+  UT_CpDivertPlugin::t_handleDivertingError
+ */
+void UT_CpDivertPlugin::t_handleDivertingError()
+{
+    m_divertpluginGroup->handleDivertingError(-1);
+}
+
+/*!
+  UT_CpDivertPlugin::appendAction
+ */
+void UT_CpDivertPlugin::appendAction(
+        const QString& dialog, actionType actionType, const QString& action)
+{
+    if (!actionQueue.count()) {
+        startTimer(2000);
+    }
+    qDebug() << "appendAction(" << dialog << actionType << action <<")";
+    actionQueue.append(new dialogAction(dialog, actionType, action));
+}
+
+/*!
+  UT_CpDivertPlugin::executeAction
+ */
+void UT_CpDivertPlugin::executeAction( const dialogAction &action )
+{
+    qDebug() << "executeAction(" << action.dialog << action.type << action.item <<")";
+    switch (action.type) {
+    case selectAction:
+        doAndVerifyAction(action.dialog, action.item);
+        break;
+    case selectItem:
+        selectItemFromListWidget(action.dialog, action.item);
+        break;
+    case insertText:
+        HbDialog *dialog = visibleDialog(action.dialog);
+        QVERIFY( dialog );
+        HbLineEdit* editor = qobject_cast<HbLineEdit*>(
+                dialog->contentWidget() );
+        QVERIFY( editor );
+        editor->setText(action.item);
+        break;
+    default:
+        break;
+    }
+}
+
+/*!
+  UT_CpDivertPlugin::visibleDialog
+ */
+HbDialog *UT_CpDivertPlugin::visibleDialog( const QString &heading )
+{
+    QList<QGraphicsItem*> items = mainWindow->scene()->items();
+    foreach (QGraphicsItem* item, items) {
+        HbDialog *w = qobject_cast<HbDialog*>(item->parentWidget());
+        if (w && w->isVisible() && ( qobject_cast<HbLabel*>(w->headingWidget())->plainText() == heading )) {
+            qDebug() << "visibleDialog: " << w->getStaticMetaObject().className() <<
+                    "contentWidget: " << w->contentWidget()->getStaticMetaObject().className();
+            return w;
+        }
+    }
+    
+    return 0;
+}
+
+/*!
+  UT_CpDivertPlugin::selectItemFromListWidget
+ */
+void UT_CpDivertPlugin::selectItemFromListWidget(
+        const QString& dialog, const QString& item )
+{
+    HbDialog* d = visibleDialog(dialog);
+    QVERIFY(d);
+    HbListWidget *list = qobject_cast<HbListWidget*>(d->contentWidget());
+    QVERIFY(list);
+    
+    bool ok=true;
+    HbListWidgetItem *itemObject = 0;
+    for (int i=0; i < list->count();i++) {
+        itemObject = list->item(i);
+        if (itemObject->text() == item) {
+            ok=true;
+            QSignalSpy spy( d, SIGNAL(aboutToClose()));
+            list->setCurrentItem(itemObject);
+            d->close();
+            qDebug() << "selectItemFromListWidget: " << itemObject->text();
+            while (!spy.count()) {
+                QTest::qWait(50);
+            }
+            QTest::qWait(50);
+        }
+        
+    }
+    
+    QVERIFY(ok);
+}
+
+/*!
+  UT_CpDivertPlugin::doAndVerifyAction
+ */
+void UT_CpDivertPlugin::doAndVerifyAction(
+        const QString& dialog, const QString& action )
+{
+    HbDialog* d = visibleDialog(dialog);
+    QVERIFY(d);
+    
+    QAction* o;
+    bool ok=false;
+    foreach (o, d->actions()) {
+        if (o->text() == action) {
+            ok=true;
+            QSignalSpy spy( d, SIGNAL(aboutToClose()));
+            o->trigger();
+            qDebug() << "doAndVerifyAction: " << o->text();
+            while (!spy.count()) {
+                QTest::qWait(50);
+            }
+            QTest::qWait(50);
+        }
+    }
+    QVERIFY(ok);
+}
+
+/*!
+  UT_CpDivertPlugin::timerEvent
+ */
+void UT_CpDivertPlugin::timerEvent(
+        QTimerEvent* event )
+{
+    QString currentTest(QTest::currentTestFunction());
+    qDebug() << "timerEvent:" << currentTest;
+    killTimer(event->timerId());
+    executeAction(*actionQueue.takeFirst());
+    if (actionQueue.count()) {
+        startTimer(1000);
+    }
+
+    qDebug() << "timerEvent, OUT";
+}
+
+QTEST_MAIN_S60UI(UT_CpDivertPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.h	Fri Jun 04 10:19:18 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 UT_CPTELEPHONYPLUGIN_H
+#define UT_CPTELEPHONYPLUGIN_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpDivertPlugin;
+class CpDivertPluginGroup;
+class CpItemDataHelper;
+class HbDialog;
+
+class UT_CpDivertPlugin : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpDivertPlugin();
+    ~UT_CpDivertPlugin();
+    
+private slots:
+
+    void init();
+    
+    void t_createSettingFormItemData();
+
+    void t_changeDivertingStateRequested();
+    
+    void t_itemShown();
+    void t_popUpTimerQuery();
+    
+    void t_handleDivertingChanged();
+    void t_handleDivertingStatus();
+    void t_handleDivertingError();
+    
+    void cleanup();
+    
+    void t_memleak();
+    
+private:
+    
+    enum actionType {
+        selectAction,
+        selectItem,
+        insertText
+    };
+    
+    class dialogAction {
+    public:
+        dialogAction( const QString& d, actionType t, const QString& i )
+        {
+            dialog = d;
+            type = t;
+            item = i;
+        }
+        
+        QString dialog;
+        actionType type;
+        QString item;
+    };
+    
+private:
+    void appendAction(const QString& dialog, actionType actionType, const QString& action);
+    void executeAction( const dialogAction &action );
+    HbDialog *visibleDialog( const QString &heading );
+    void doAndVerifyAction( const QString& dialog, const QString& action );
+    void selectItemFromListWidget( const QString& dialog, const QString& item );
+    void timerEvent( QTimerEvent* event );
+    
+private:
+
+    CpDivertPlugin *m_divertplugin;
+    CpDivertPluginGroup *m_divertpluginGroup;
+    CpItemDataHelper *m_helper;
+
+    QQueue<dialogAction*> actionQueue;
+    
+};
+
+#endif // UT_CPTELEPHONYPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertplugin/ut_cpdivertplugin.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../cptelephonyutils/inc
+DEFINES += BUILD_CPTELEPHONYUTILS BUILD_PSETWRAPPER BUILD_SSSETTINGSWRAPPER 
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  #CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+
+# test code
+HEADERS += ut_cpdivertplugin.h
+SOURCES += ut_cpdivertplugin.cpp
+
+# code to be tested
+HEADERS += ../../src/cpdivertplugin.h \
+           ../../src/cpdivertplugingroup.h \
+           ../../src/cpdivertitemdata.h \
+           ../../src/cpdivertselectionitem.h \
+           ../../../cptelephonyutils/inc/cpphonenotes.h \
+           ../../../cptelephonyutils/inc/cpplugincommon.h \
+           /epoc32/include/platform/mw/psetwrapper.h \
+           /epoc32/include/platform/mw/psetcliwrapper.h \
+           /epoc32/include/platform/mw/psetcallwaitingwrapper.h \
+           /epoc32/include/platform/mw/psetcalldivertingwrapper.h \
+           /epoc32/include/platform/mw/psetnetworkwrapper.h \
+           /epoc32/include/platform/mw/sssettingswrapper.h 
+           
+SOURCES += ../../src/cpdivertplugin.cpp \
+           ../../src/cpdivertplugingroup.cpp \
+           ../../src/cpdivertitemdata.cpp
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cpdivertselectionitem.cpp \
+           ../../../tsrc/mocks/mock_psetcalldivertingwrapper.cpp \
+           ../../../tsrc/mocks/mock_sssettingswrapper.cpp \
+           ../../../tsrc/mocks/mock_cpplugincommon.cpp \
+           ../../../tsrc/mocks/mock_cpphonenotes.cpp \
+           ../../../tsrc/mocks/mock_psetwrapper.cpp 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/qtestmains60ui.h	Fri Jun 04 10:19:18 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 QTESTMAINS60
+#define QTESTMAINS60
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+char *new_argv[3];
+HbMainWindow *mainWindow;
+#define QTEST_MAIN_S60UI(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+HbApplication *app = new HbApplication(argc, argv); \
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+QResource::registerResource("../hbcore.rcc"); \
+mainWindow = new HbMainWindow;\
+mainWindow->show(); \
+int ret = QTest::qExec(&tc, 3, new_argv); \
+delete mainWindow; \
+delete app; \
+return ret; \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_cpdivertselectionitem.h"
+#include "qtestmains60ui.h"
+#include <HbDataFormModel>
+#include <HbWidget>
+#include <HbDataForm>
+#include "cpdivertselectioncustomitem.h"
+
+#define protected public
+#define private public
+#include "cpdivertselectionitem.h"
+
+
+
+/*!
+  UT_CpDivertSelectionItem::UT_CpDivertSelectionItem
+ */
+UT_CpDivertSelectionItem::UT_CpDivertSelectionItem() 
+    : m_item(NULL)
+{
+
+}
+
+/*!
+  UT_CpDivertSelectionItem::~UT_CpDivertSelectionItem
+ */
+UT_CpDivertSelectionItem::~UT_CpDivertSelectionItem()
+{
+
+}
+
+/*!
+  UT_CpDivertSelectionItem::init
+ */
+void UT_CpDivertSelectionItem::init()
+{
+    initialize();
+    m_item = new CpDivertSelectionItem();
+    m_form = new HbDataForm;
+    m_form->setModel(new HbDataFormModel);
+    
+    QList<HbAbstractViewItem *> prototypes = m_form->itemPrototypes();
+    prototypes.append(m_item);
+    m_form->setItemPrototypes(prototypes);
+}
+
+/*!
+  UT_CpDivertSelectionItem::cleanup
+ */
+void UT_CpDivertSelectionItem::cleanup()
+{
+    reset();
+    if (m_form) {
+        delete m_form->model();
+    }
+    delete m_form;
+    m_form = NULL;
+}
+
+/*!
+  UT_CpDivertSelectionItem::t_memleak
+ */
+void UT_CpDivertSelectionItem::t_memleak()
+{
+    
+}
+
+/*!
+  UT_CpDivertSelectionItem::t_createItem
+ */
+void UT_CpDivertSelectionItem::t_createItem()
+{
+    delete m_item->createItem();
+}
+
+/*!
+  UT_CpDivertSelectionItem::t_canSetModelIndex
+ */
+void UT_CpDivertSelectionItem::t_canSetModelIndex()
+{
+    QModelIndex index = qobject_cast<HbDataFormModel*>(m_form->model())->indexFromItem(
+            qobject_cast<HbDataFormModel*>(m_form->model())->appendDataFormItem(
+                    HbDataFormModelItem::TextItem, "test"));
+    
+    QVERIFY( !m_item->canSetModelIndex(index) );
+
+    index = qobject_cast<HbDataFormModel*>(m_form->model())->indexFromItem(
+                qobject_cast<HbDataFormModel*>(m_form->model())->appendDataFormItem(
+                    static_cast<HbDataFormModelItem::DataItemType>(
+                            CpDivertSelectionItem::CpDivertSelectionItemId), 
+                            "test2"));
+    
+    QVERIFY( m_item->canSetModelIndex(index) );
+}
+
+/*!
+  UT_CpDivertSelectionItem::t_createCustomWidget
+ */
+void UT_CpDivertSelectionItem::t_createCustomWidget()
+{
+    QVERIFY( !m_item->createCustomWidget() );
+    
+    QModelIndex index = qobject_cast<HbDataFormModel*>(m_form->model())->indexFromItem(
+            qobject_cast<HbDataFormModel*>(m_form->model())->appendDataFormItem(
+                    static_cast<HbDataFormModelItem::DataItemType>(
+                            CpDivertSelectionItem::CpDivertSelectionItemId), 
+                            "test3"));
+    
+    m_item->setModelIndex(index);
+    HbWidget *widget=NULL;
+    QVERIFY( widget = m_item->createCustomWidget() );
+    QVERIFY( widget->setProperty("number", "12345") );
+    QVERIFY( widget->property("number").toString() == QString("12345") );
+    
+    QVERIFY( widget->setProperty("timeoutText", "Delay:") );
+    QVERIFY( widget->property("timeoutText").toString() == QString("Delay:") );
+    
+    QVERIFY( widget->setProperty("timeout", "25") );
+    QVERIFY( widget->property("timeout").toInt() == 25 );
+    
+    QVERIFY( widget->setProperty("state", "0"));
+    QVERIFY( widget->property("state").toInt() 
+        == CpDivertSelectionCustomitem::Enabled);
+    QVERIFY( widget->setProperty("state", "1"));
+    QVERIFY( widget->property("state").toInt() 
+        == CpDivertSelectionCustomitem::Deactivated);
+    QVERIFY( widget->setProperty("state", "2"));
+    QVERIFY( widget->property("state").toInt() 
+        == CpDivertSelectionCustomitem::Disabled);
+    
+    delete widget;
+}
+
+QTEST_MAIN_S60UI(UT_CpDivertSelectionItem)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.h	Fri Jun 04 10:19:18 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 UT_CPDIVERTSELECTIONITEM_H
+#define UT_CPDIVERTSELECTIONITEM_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpDivertSelectionItem;
+class HbDataForm;
+
+class UT_CpDivertSelectionItem : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpDivertSelectionItem();
+    ~UT_CpDivertSelectionItem();
+    
+private slots:
+
+    void init();
+    
+    void cleanup();
+    
+    void t_memleak();
+    
+    void t_createItem();
+    void t_canSetModelIndex();
+    void t_createCustomWidget();
+private:
+    // Not own
+    CpDivertSelectionItem *m_item;
+    
+    // Own
+    HbDataForm *m_form;
+    
+};
+
+#endif // UT_CPDIVERTSELECTIONITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/divertplugin/tsrc/ut_cpdivertselectionitem/ut_cpdivertselectionitem.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../cptelephonyutils/inc
+DEFINES +=
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  #CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+
+# test code
+HEADERS += ut_cpdivertselectionitem.h
+SOURCES += ut_cpdivertselectionitem.cpp
+
+# code to be tested
+HEADERS += ../../src/cpdivertselectioncustomitem.h \
+           ../../src/cpdivertselectionitem.h
+           
+SOURCES += ../../src/cpdivertselectioncustomitem.cpp \
+           ../../src/cpdivertselectionitem.cpp
+
+# mocks needed for testing
+SOURCES += 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/eabi/cptelephonyutilsu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+EXPORTS
+	_ZN12CpPhoneNotes10cancelNoteEi @ 1 NONAME
+	_ZN12CpPhoneNotes11noteShowingEv @ 2 NONAME
+	_ZN12CpPhoneNotes11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
+	_ZN12CpPhoneNotes11qt_metacastEPKc @ 4 NONAME
+	_ZN12CpPhoneNotes14showGlobalNoteERiRK7QStringN12HbMessageBox14MessageBoxTypeE @ 5 NONAME
+	_ZN12CpPhoneNotes16staticMetaObjectE @ 6 NONAME DATA 16
+	_ZN12CpPhoneNotes19getStaticMetaObjectEv @ 7 NONAME
+	_ZN12CpPhoneNotes19passwordTextChangedEv @ 8 NONAME
+	_ZN12CpPhoneNotes19showGlobalErrorNoteERii @ 9 NONAME
+	_ZN12CpPhoneNotes20progressNoteCanceledEv @ 10 NONAME
+	_ZN12CpPhoneNotes20showBasicServiceListERK7QStringRK5QListIhE @ 11 NONAME
+	_ZN12CpPhoneNotes21launchNextNoteIfReadyEv @ 12 NONAME
+	_ZN12CpPhoneNotes21showCallDivertDetailsERK21PSCallDivertingStatus @ 13 NONAME
+	_ZN12CpPhoneNotes22activeNoteAboutToCloseEv @ 14 NONAME
+	_ZN12CpPhoneNotes22passwordQueryCompletedE7QStringb @ 15 NONAME
+	_ZN12CpPhoneNotes22showGlobalProgressNoteERiRK7QString @ 16 NONAME
+	_ZN12CpPhoneNotes23showPasswordQueryDialogERK7QStringRK10QValidatori @ 17 NONAME
+	_ZN12CpPhoneNotes26handleProgressNoteCanceledEv @ 18 NONAME
+	_ZN12CpPhoneNotes27finishedPasswordQueryDialogEP8HbAction @ 19 NONAME
+	_ZN12CpPhoneNotes8instanceEv @ 20 NONAME
+	_ZN12CpPhoneNotesC1Ev @ 21 NONAME
+	_ZN12CpPhoneNotesC2Ev @ 22 NONAME
+	_ZN12CpPhoneNotesD0Ev @ 23 NONAME
+	_ZN12CpPhoneNotesD1Ev @ 24 NONAME
+	_ZN12CpPhoneNotesD2Ev @ 25 NONAME
+	_ZN17CpSettingsWrapper11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME
+	_ZN17CpSettingsWrapper11qt_metacastEPKc @ 27 NONAME
+	_ZN17CpSettingsWrapper16showCallDurationEv @ 28 NONAME
+	_ZN17CpSettingsWrapper16staticMetaObjectE @ 29 NONAME DATA 16
+	_ZN17CpSettingsWrapper18readSoftRejectTextER7QStringRb @ 30 NONAME
+	_ZN17CpSettingsWrapper19getStaticMetaObjectEv @ 31 NONAME
+	_ZN17CpSettingsWrapper19setShowCallDurationEb @ 32 NONAME
+	_ZN17CpSettingsWrapper19writeSoftRejectTextERK7QStringb @ 33 NONAME
+	_ZN17CpSettingsWrapper51isFeatureCallWaitingDistiquishNotProvisionedEnabledEv @ 34 NONAME
+	_ZN17CpSettingsWrapperC1EP7QObject @ 35 NONAME
+	_ZN17CpSettingsWrapperC2EP7QObject @ 36 NONAME
+	_ZN17CpSettingsWrapperD0Ev @ 37 NONAME
+	_ZN17CpSettingsWrapperD1Ev @ 38 NONAME
+	_ZN17CpSettingsWrapperD2Ev @ 39 NONAME
+	_ZN5Tools11qt_metacallEN11QMetaObject4CallEiPPv @ 40 NONAME
+	_ZN5Tools11qt_metacastEPKc @ 41 NONAME
+	_ZN5Tools13voipSupportedEv @ 42 NONAME
+	_ZN5Tools14videoSupportedEv @ 43 NONAME
+	_ZN5Tools16staticMetaObjectE @ 44 NONAME DATA 16
+	_ZN5Tools19getStaticMetaObjectEv @ 45 NONAME
+	_ZN5Tools20errorCodeTextMappingEiR7QString @ 46 NONAME
+	_ZNK12CpPhoneNotes10metaObjectEv @ 47 NONAME
+	_ZNK12CpPhoneNotes17formatPhoneNumberE7QString @ 48 NONAME
+	_ZNK12CpPhoneNotes21basicServiceGroupNameEN16CpTelephonyUtils18BasicServiceGroupsE @ 49 NONAME
+	_ZNK17CpSettingsWrapper10metaObjectEv @ 50 NONAME
+	_ZNK17CpSettingsWrapper14isPhoneOfflineEv @ 51 NONAME
+	_ZNK17CpSettingsWrapper15readCenrepValueElm @ 52 NONAME
+	_ZNK17CpSettingsWrapper16readCenrepStringElm @ 53 NONAME
+	_ZNK17CpSettingsWrapper16writeCenrepValueElmRK8QVariant @ 54 NONAME
+	_ZNK17CpSettingsWrapper23numberGroupingSupportedEv @ 55 NONAME
+	_ZNK5Tools10metaObjectEv @ 56 NONAME
+	_ZTI12CpPhoneNotes @ 57 NONAME
+	_ZTI17CpSettingsWrapper @ 58 NONAME
+	_ZTI5Tools @ 59 NONAME
+	_ZTV12CpPhoneNotes @ 60 NONAME
+	_ZTV17CpSettingsWrapper @ 61 NONAME
+	_ZTV5Tools @ 62 NONAME
+	_ZN19CpPhoneLocalisation11qt_metacallEN11QMetaObject4CallEiPPv @ 63 NONAME
+	_ZN19CpPhoneLocalisation11qt_metacastEPKc @ 64 NONAME
+	_ZN19CpPhoneLocalisation16staticMetaObjectE @ 65 NONAME DATA 16
+	_ZN19CpPhoneLocalisation17installTranslatorENS_17TranslationFileIdE @ 66 NONAME
+	_ZN19CpPhoneLocalisation17removeTranslatorsEv @ 67 NONAME
+	_ZN19CpPhoneLocalisation19getStaticMetaObjectEv @ 68 NONAME
+	_ZN19CpPhoneLocalisationC1EP7QObject @ 69 NONAME
+	_ZN19CpPhoneLocalisationC2EP7QObject @ 70 NONAME
+	_ZN19CpPhoneLocalisationD0Ev @ 71 NONAME
+	_ZN19CpPhoneLocalisationD1Ev @ 72 NONAME
+	_ZN19CpPhoneLocalisationD2Ev @ 73 NONAME
+	_ZNK19CpPhoneLocalisation10metaObjectEv @ 74 NONAME
+	_ZTI19CpPhoneLocalisation @ 75 NONAME
+	_ZTV19CpPhoneLocalisation @ 76 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/rom/cpphonesettingsplugins.iby	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef __PHONESETTINGSPLUGINS_IBY__
+#define __PHONESETTINGSPLUGINS_IBY__
+
+#include <bldvariant.hrh>
+
+file=ABI_DIR/BUILD_DIR/cptelephonyutils.dll             SHARED_LIB_DIR/cptelephonyutils.dll
+file=ABI_DIR/BUILD_DIR/cptelephonyplugin.dll            SHARED_LIB_DIR/cptelephonyplugin.dll
+file=ABI_DIR/BUILD_DIR/cpcallsplugin.dll                SHARED_LIB_DIR/cpcallsplugin.dll
+file=ABI_DIR/BUILD_DIR/cpnetworkplugin.dll              SHARED_LIB_DIR/cpnetworkplugin.dll
+file=ABI_DIR/BUILD_DIR/cpdivertplugin.dll               SHARED_LIB_DIR/cpdivertplugin.dll
+file=ABI_DIR/BUILD_DIR/cpbarringplugin.dll              SHARED_LIB_DIR/cpbarringplugin.dll
+
+
+data=DATAZ_/resource/qt/plugins/controlpanel/cptelephonyplugin.qtplugin          resource/qt/plugins/controlpanel/cptelephonyplugin.qtplugin
+data=DATAZ_/resource/qt/plugins/controlpanel/cpcallsplugin.qtplugin              resource/qt/plugins/controlpanel/cpcallsplugin.qtplugin
+data=DATAZ_/resource/qt/plugins/controlpanel/cpnetworkplugin.qtplugin            resource/qt/plugins/controlpanel/cpnetworkplugin.qtplugin
+data=DATAZ_/resource/qt/plugins/controlpanel/cpdivertplugin.qtplugin             resource/qt/plugins/controlpanel/cpdivertplugin.qtplugin
+data=DATAZ_/resource/qt/plugins/controlpanel/cpbarringplugin.qtplugin            resource/qt/plugins/controlpanel/cpbarringplugin.qtplugin
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/rom/cpphonesettingsplugins_resources.iby	Fri Jun 04 10:19:18 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 __PHONESETTINGSPLUGINS_RESOURCE_IBY__
+#define __PHONESETTINGSPLUGINS_RESOURCE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\telephone_cp.qm QT_TRANSLATIONS_DIR\telephone_cp.qm 
+
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include <cpsettingformentryitemdataimpl.h>
+#include <cpitemdatahelper.h>
+#include "cptelephonyplugin.h"
+#include "cptelephonypluginview.h"
+#include "cppluginlogging.h"
+
+
+/*!
+    CpTelephonyPlugin::CpTelephonyPlugin() 
+*/
+CpTelephonyPlugin::CpTelephonyPlugin() : 
+    QObject(0),
+    m_localisation(0)
+{
+    // Install plugin specific msg handler
+    INSTALL_TRACE_MSG_HANDLER;  
+    DPRINT << ": IN";
+    
+    // Set scoped pointer 
+    m_localisation.reset(new CpPhoneLocalisation(this)); 
+    
+    // Install required translations
+    m_localisation->installTranslator(
+            CpPhoneLocalisation::
+            TranslationFileCommon);
+    m_localisation->installTranslator(
+            CpPhoneLocalisation::
+            TranslationFileTelephoneCp);
+
+    DPRINT << ": OUT"; 
+}
+
+/*!
+    CpTelephonyPlugin::~CpTelephonyPlugin() 
+*/
+CpTelephonyPlugin::~CpTelephonyPlugin()
+{
+    DPRINT; 
+    
+    // Uninstall plugin specific msg handler
+    UNINSTALL_TRACE_MSG_HANDLER; 
+}
+
+/*!
+    CpTelephonyPlugin::createSettingFormItemData() const
+*/
+QList<CpSettingFormItemData*> CpTelephonyPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+{
+    DPRINT;
+
+    QList<CpSettingFormItemData*> ret;
+    ret.append(new CpSettingFormEntryItemDataImpl<CpTelephonyPluginView>(
+            itemDataHelper, hbTrId("txt_cp_dblist_telephone"), hbTrId("")));
+    return ret;
+}
+
+Q_EXPORT_PLUGIN2(cptelephonyplugin, CpTelephonyPlugin);
+
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonyplugin.h	Fri Jun 04 10:19:18 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 CPTELEPHONYPLUGIN_H
+#define CPTELEPHONYPLUGIN_H
+
+#include <QObject>
+#include <QList>
+#include <cpplugininterface.h>
+#include "cpphonelocalisation.h"
+
+/*!
+    \class CpTelephonyPlugin
+    \brief The class CpTelephonyPlugin implements telephony plugin functionality. 
+ */
+class CpTelephonyPlugin
+        : public QObject,
+          public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+    
+public:
+ 
+    CpTelephonyPlugin();
+    ~CpTelephonyPlugin();
+    
+    /*!
+     From CpPluginInterface.
+     @see CpPluginInterface.
+     */
+    QList<CpSettingFormItemData*> createSettingFormItemData(
+            CpItemDataHelper &itemDataHelper) const;
+    
+private: 
+    
+    QScopedPointer<CpPhoneLocalisation> m_localisation; 
+};
+
+#endif /* CPTELEPHONYPLUGIN_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "cptelephonypluginview.h"
+#include "cppluginlogging.h"
+#include <QPluginLoader>
+#include <hbdataformmodel.h>
+#include <cpplugininterface.h>
+#include <cpsettingformitemdata.h>
+#include <cpitemdatahelper.h>
+#include <cppluginutility.h>
+#include <cppluginloader.h>
+
+
+/*!
+    CpTelephonyPluginView::CpTelephonyPluginView()
+*/
+CpTelephonyPluginView::CpTelephonyPluginView() : 
+    CpBaseSettingView(0,0),
+    m_helper(NULL)
+{
+    DPRINT << ": IN";
+    
+    HbDataForm *form = qobject_cast<HbDataForm*>(widget());
+    if (form) {
+        HbDataFormModel *model = new HbDataFormModel;
+        form->setHeading(hbTrId("txt_phone_subhead_telephone"));
+        // Create and initialize plugin's item data helper
+        m_helper = initializeItemDataHelper(); 
+        QList<CpSettingFormItemData*> items;
+        
+        // Load calls plugin
+        DPRINT << ": Loading cpcallsplugin";
+        items.append(groupItemFromPlugin("cpcallsplugin"));
+        
+        // Load diverts plugin
+        DPRINT << ": Loading cpdivertsplugin";
+        items.append(groupItemFromPlugin("cpdivertplugin"));
+        
+        // Load call mailboxes plugin
+        DPRINT << ": Loading vmbxcpplugin";
+        items.append(groupItemFromPlugin("vmbxcpplugin"));
+
+        // Load barring plugin
+        DPRINT << ": Loading cpbarringplugin";
+        items.append(groupItemFromPlugin("cpbarringplugin"));
+        
+        // Insert items to form model
+        foreach (CpSettingFormItemData* i, items) {
+            model->appendDataFormItem(i);
+        }
+        
+        form->setModel(model);
+    }
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    CpTelephonyPluginView::~CpTelephonyPluginView()
+*/
+CpTelephonyPluginView::~CpTelephonyPluginView()
+{
+    DPRINT << ": IN";
+    
+    delete m_helper;
+    
+    DPRINT << ": OUT";
+}
+
+/*!
+    CpTelephonyPluginView::groupItemFromPlugin()
+*/
+QList<CpSettingFormItemData*> CpTelephonyPluginView::groupItemFromPlugin( const QString& plugin )
+{
+    DPRINT << ": IN";
+ 
+    QList<CpSettingFormItemData*> items;
+    CpPluginInterface *p(NULL);
+    try {
+        p = CpPluginLoader::loadCpPlugin(plugin);
+        if (p && m_helper){
+            items = p->createSettingFormItemData(*m_helper);
+        }
+    } catch(...) {
+        DPRINT << "CATCH ERROR";
+        delete p;
+    }
+    
+    DPRINT << ": OUT";
+    return items;
+}
+
+/*!
+    CpTelephonyPluginView::initializeItemDataHelper()
+*/
+CpItemDataHelper* CpTelephonyPluginView::initializeItemDataHelper()
+{
+    DPRINT;
+    return new CpItemDataHelper(qobject_cast<HbDataForm*>(widget()));
+}
+
+// End of File. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef CPTELEPHONYPLUGINVIEW_H_
+#define CPTELEPHONYPLUGINVIEW_H_
+
+#include <QObject>
+#include <hbdataform.h>
+#include <cpbasesettingview.h>
+
+class HbDataFormModelItem;
+class CpSettingFormItemData;
+
+/*!
+    \class CpTelephonyPluginView
+    \brief The class CpTelephonyPluginView. 
+ */
+class CpTelephonyPluginView : public CpBaseSettingView
+{
+    Q_OBJECT
+
+public:
+    CpTelephonyPluginView();
+    ~CpTelephonyPluginView();
+
+private: 
+    
+    CpItemDataHelper* initializeItemDataHelper();
+
+private: 
+ 
+    QList<CpSettingFormItemData*> groupItemFromPlugin(const QString& plugin);
+    
+private:   // data
+ 
+    CpItemDataHelper *m_helper;
+};
+
+#endif /* CPTELEPHONYPLUGINVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/telephonyplugin.pro	Fri Jun 04 10:19:18 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: 
+#
+
+TEMPLATE = lib
+TARGET = cptelephonyplugin
+DEPENDPATH += . 
+INCLUDEPATH += .
+INCLUDEPATH += ../cptelephonyutils/inc
+CONFIG += hb plugin
+
+TRANSLATIONS = telephone_cp.ts
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+RCC_DIR = rcc
+
+LIBS += -lcpframework \
+        -lcptelephonyutils
+
+
+# Input
+HEADERS += src/cptelephonyplugin.h  \
+			src/cptelephonypluginview.h
+SOURCES += src/cptelephonyplugin.cpp \
+		   src/cptelephonypluginview.cpp
+
+include(../cpplugincommon.pri)
+
+symbian: {
+    LIBS += -lxqsysinfo \
+        -lxqsettingsmanager
+        
+    TARGET.UID3 = 0X20029F23
+}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/run_auto_tests_qt.bat	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+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
+setlocal
+goto :startup 
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function DEFAULT
+::
+:: Modify this function
+::  - TESTED_SRC can be changed to match tested code.
+::    Specifies path from testcode group directory to
+::    tested code
+::  - Add test directories to be runned
+::    ie. "call :build ut_projectdirectory" or use
+::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
+::    which compiles, instruments and runs all test directories
+::    starting with "ut_".
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:DEFAULT
+set TESTED_SRC=..\..\src\*.cpp
+
+for /f %%a in ('dir /b ut_*') do call :build %%a
+if [%DOMODULESTESTS%] EQU [TRUE] (
+for /f %%a in ('dir /b mt_*') do call :build %%a
+)
+
+call :finish
+goto :END
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function STARTUP
+::
+:: Initializing script
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:STARTUP
+
+set BUILDTESTS=TRUE
+set RUNTESTS=TRUE
+set INSTRUMENT=TRUE
+set REMOVEINSTRUMENT=TRUE
+set DOMODULESTESTS=TRUE
+set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
+set PATH_TO_DLL=\epoc32\release\winscw\udeb
+set PATH_TO_COVERAGE_DATA=\coverage_data
+set PATH_TO_RESULT=\test_result
+
+if not exist %PATH_TO_COVERAGE_DATA% (
+mkdir %PATH_TO_COVERAGE_DATA%
+)
+
+if not exist %PATH_TO_RESULT% (
+mkdir %PATH_TO_RESULT%
+)
+
+if [%1] EQU [] ( goto default )
+
+call :%1
+call :%2
+call :%3
+call :%4
+call :%5
+echo Running tests = %RUNTESTS%
+echo Instrumenting tests = %INSTRUMENT%
+goto default
+
+:/NOCLEANUP
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NORUN
+set RUNTESTS=FALSE
+set REMOVEINSTRUMENT=FALSE
+goto end
+
+:/NOINSTRUMENT
+set INSTRUMENT=FALSE
+goto end
+
+:/NOBUILD
+set BUILDTESTS=FALSE
+goto end
+
+:/ONLYUNITTESTS
+set DOMODULESTESTS=FALSE
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function FINISH
+::
+:: Finishes run_auto_tests.bat
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:FINISH
+
+if [%RUNTESTS%] EQU [TRUE] (
+call :runtests
+)
+
+if [%INSTRUMENT%] EQU [TRUE] (
+call :calculatecoverage
+)
+
+if [%REMOVEINSTRUMENT%] EQU [TRUE] (
+call :removecoverage
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function BUILD
+::    param directory
+::
+:: builds test from given directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:BUILD
+setlocal
+if [%BUILDTESTS%] EQU [FALSE] ( goto end )
+echo Building %1
+if not exist %1 ( 
+echo %1 Not found! 
+goto end
+)
+
+pushd .
+call cd %1
+call qmake
+call sbs --config winscw_udeb --keepgoing CLEAN
+if [%INSTRUMENT%] EQU [TRUE] (
+call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
+) else (
+call %SBS_CALL%
+)
+
+popd
+endlocal
+goto end
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function RUNTESTS
+::
+:: NOTE! Function assumes that test binary is named according to test directory.
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:RUNTESTS
+echo Running tests
+for /f %%a in ('dir /b ut_*') do (
+    call %PATH_TO_DLL%\%%a.exe
+    move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
+)
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function CALCULATECOVERAGE
+::
+:: Calculates test coverage. Generates html
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:CALCULATECOVERAGE
+echo Calculating coverage
+ctcpost %PATH_TO_COVERAGE_DATA%\*.sym | ctcmerge -i - -o profile.txt
+call ctc2html -t 70 -i profile.txt -o \coverage_result -nsb
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function REMOVECOVERAGE
+::
+:: Removes data from coverage directory
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:REMOVECOVERAGE
+echo Removing deleting coverage data
+call del %PATH_TO_COVERAGE_DATA%\*.sym
+call del %PATH_TO_COVERAGE_DATA%\*.dat
+call del profile.txt
+goto end
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: function END
+::
+:: Prints done
+::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:END
+echo Done!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/qtestmains60ui.h	Fri Jun 04 10:19:18 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 QTESTMAINS60
+#define QTESTMAINS60
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+char *new_argv[3];
+#define QTEST_MAIN_S60UI(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+HbApplication app(argc, argv); \
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+QResource::registerResource("../hbcore.rcc"); \
+HbMainWindow mainWindow; \
+mainWindow.show(); \
+return  QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/ut_cptelephonyplugin.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include "ut_cptelephonyplugin.h"
+#include "qtestmains60ui.h"
+#include <cpsettingformitemdata.h>
+#define private public
+#include "cptelephonyplugin.h"
+#include "cpitemdatahelper.h"
+
+Q_EXTERN_C const char * qt_plugin_query_verification_data();
+Q_EXTERN_C ::QObject *  qt_plugin_instance();
+
+/*!
+  UT_CpTelephonyPlugin::UT_CpTelephonyPlugin
+ */
+UT_CpTelephonyPlugin::UT_CpTelephonyPlugin() 
+    : m_callsplugin(NULL)
+{
+    const char * verificationData = qt_plugin_query_verification_data();
+}
+
+/*!
+  UT_CpTelephonyPlugin::~UT_CpTelephonyPlugin
+ */
+UT_CpTelephonyPlugin::~UT_CpTelephonyPlugin()
+{
+    delete m_callsplugin;
+}
+
+/*!
+  UT_CpTelephonyPlugin::init
+ */
+void UT_CpTelephonyPlugin::init()
+{
+    initialize();
+
+    m_callsplugin = (CpTelephonyPlugin*)qt_plugin_instance();
+}
+
+/*!
+  UT_CpTelephonyPlugin::cleanup
+ */
+void UT_CpTelephonyPlugin::cleanup()
+{
+    reset();
+    
+    delete m_callsplugin;
+    m_callsplugin = NULL;
+}
+
+/*!
+  UT_CpTelephonyPlugin::t_memleak
+ */
+void UT_CpTelephonyPlugin::t_memleak()
+{
+    
+}
+
+/*!
+  UT_CpTelephonyPlugin::t_createSettingFormItemData
+ */
+void UT_CpTelephonyPlugin::t_createSettingFormItemData()
+{
+    CpItemDataHelper itemDataHelper;
+    QList<CpSettingFormItemData*> items = 
+            m_callsplugin->createSettingFormItemData(itemDataHelper);
+    
+    QVERIFY(items.count()==1);
+    qDeleteAll(items);
+}
+
+
+
+QTEST_MAIN_S60UI(UT_CpTelephonyPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/ut_cptelephonyplugin.h	Fri Jun 04 10:19:18 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 UT_CPTELEPHONYPLUGIN_H
+#define UT_CPTELEPHONYPLUGIN_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpTelephonyPlugin;
+
+class UT_CpTelephonyPlugin : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpTelephonyPlugin();
+    ~UT_CpTelephonyPlugin();
+    
+private slots:
+
+    void init();
+
+    void t_createSettingFormItemData();
+    
+    void cleanup();
+    
+    void t_memleak();
+private:
+    CpTelephonyPlugin *m_callsplugin;
+
+};
+
+#endif // UT_CPTELEPHONYPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonyplugin/ut_cptelephonyplugin.pro	Fri Jun 04 10:19:18 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: 
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../cptelephonyutils/inc
+DEFINES += 
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  #CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+
+# test code
+HEADERS += ut_cptelephonyplugin.h
+SOURCES += ut_cptelephonyplugin.cpp
+
+# code to be tested
+HEADERS += ../../src/cptelephonyplugin.h \
+           ../../src/cptelephonypluginview.h
+           
+SOURCES += ../../src/cptelephonyplugin.cpp 
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cptelephonypluginview.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/qtestmains60ui.h	Fri Jun 04 10:19:18 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 QTESTMAINS60
+#define QTESTMAINS60
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+char *new_argv[3];
+#define QTEST_MAIN_S60UI(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+HbApplication app(argc, argv); \
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+QResource::registerResource("../hbcore.rcc"); \
+HbMainWindow mainWindow; \
+mainWindow.show(); \
+return  QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/ut_cptelephonypluginview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_cptelephonypluginview.h"
+#include "qtestmains60ui.h"
+#include <cpplugininterface.h>
+#include <cpitemdatahelper.h>
+#include <cpsettingformitemdata.h>
+#include <smcmockclassincludes.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbsettingformitem.h>
+#include "cptelephonypluginview.h"
+
+
+class DummyPlugin : public CpPluginInterface
+{
+public:
+    DummyPlugin(){}
+    ~DummyPlugin(){}
+    
+    QList<CpSettingFormItemData*> createSettingFormItemData(
+            CpItemDataHelper &itemDataHelper) const
+    {
+        SMC_MOCK_METHOD1( QList<CpSettingFormItemData*>, CpItemDataHelper &, itemDataHelper )
+    }
+};
+
+/*!
+  UT_CpTelephonyPluginView::UT_CpTelephonyPluginView
+ */
+UT_CpTelephonyPluginView::UT_CpTelephonyPluginView() 
+    : m_callspluginview(NULL)
+{
+
+}
+
+/*!
+  UT_CpTelephonyPluginView::~UT_CpTelephonyPluginView
+ */
+UT_CpTelephonyPluginView::~UT_CpTelephonyPluginView()
+{
+    delete m_callspluginview;
+}
+
+
+
+/*!
+  UT_CpTelephonyPluginView::init
+ */
+void UT_CpTelephonyPluginView::init()
+{
+    initialize();
+    CpPluginInterface *nullPlugin=0;
+    expect("CpPluginLoader::loadCpPlugin").with(QString("cpcallsplugin")).returns(nullPlugin);
+    DummyPlugin *ret = new DummyPlugin;
+    
+    //ret = new DummyPlugin;
+    QList<CpSettingFormItemData*> list;
+    list.append(new CpSettingFormItemData);
+    expect("CpPluginLoader::loadCpPlugin").with(QString("cpdivertplugin")).returns(ret); // cpnetworkplugin
+    expect("DummyPlugin::createSettingFormItemData").returns(list);
+    
+    m_callspluginview = new CpTelephonyPluginView;
+    QVERIFY( verify() );
+}
+
+/*!
+  UT_CpTelephonyPluginView::cleanup
+ */
+void UT_CpTelephonyPluginView::cleanup()
+{
+    reset();
+    
+    delete m_callspluginview;
+    m_callspluginview = NULL;
+}
+
+/*!
+  UT_CpTelephonyPluginView::t_memleak
+ */
+void UT_CpTelephonyPluginView::t_memleak()
+{
+    QList<CpSettingFormItemData*> list;
+    list.append(new CpSettingFormItemData);
+    DummyPlugin *ret = new DummyPlugin;
+    expect("CpPluginLoader::loadCpPlugin").with(QString("cpcallsplugin")).returns(ret);
+    expect("DummyPlugin::createSettingFormItemData").returns(list);
+    
+    ret = new DummyPlugin;
+    expect("CpPluginLoader::loadCpPlugin").with(QString("cpdivertplugin")).returns(ret);
+    expect("DummyPlugin::createSettingFormItemData").returns(list);
+    
+    
+    CpTelephonyPluginView *tmp = new CpTelephonyPluginView;
+    QVERIFY( verify() );
+    delete tmp;
+}
+
+
+
+QTEST_MAIN_S60UI(UT_CpTelephonyPluginView)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/ut_cptelephonypluginview.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef UT_CPTELEPHONYPLUGINVIEW_H
+#define UT_CPTELEPHONYPLUGINVIEW_H
+
+#include <QtTest/QtTest>
+#include <mockservice.h>
+
+class CpTelephonyPluginView;
+
+class UT_CpTelephonyPluginView : public QObject, MockService
+{
+    Q_OBJECT
+
+public:    
+    UT_CpTelephonyPluginView();
+    ~UT_CpTelephonyPluginView();
+    
+private slots:
+
+    void init();
+
+    void cleanup();
+    
+    void t_memleak();
+
+private:
+    CpTelephonyPluginView *m_callspluginview;
+
+};
+
+#endif // UT_CPTELEPHONYPLUGINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/telephonyplugin/tsrc/ut_cptelephonypluginview/ut_cptelephonypluginview.pro	Fri Jun 04 10:19:18 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: 
+#
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../src/
+INCLUDEPATH += .
+INCLUDEPATH +=../../../cptelephonyutils/inc
+DEFINES += BUILD_CP_FRAMEWORK
+
+QT -= gui
+QT += testlib
+
+symbian: {
+  #CONFIG += no_icon
+  INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+  
+  LIBS += -lmocklib \
+        -lsymbianmock \
+        -lcpframework
+}
+
+# test code
+HEADERS += ut_cptelephonypluginview.h
+SOURCES += ut_cptelephonypluginview.cpp
+
+# code to be tested
+HEADERS += ../../src/cptelephonypluginview.h
+           
+SOURCES += ../../src/cptelephonypluginview.cpp 
+
+# mocks needed for testing
+SOURCES += ../../../tsrc/mocks/mock_cppluginloader.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cellulardatasettings.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,86 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <cellulardatasettings.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CellularDataSettings::CellularDataSettings
+// -----------------------------------------------------------------------------
+//
+CellularDataSettings::CellularDataSettings(  )
+    //:
+    //QObject( /**/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CellularDataSettings::~CellularDataSettings
+// -----------------------------------------------------------------------------
+//
+CellularDataSettings::~CellularDataSettings(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CellularDataSettings::dataUseHome
+// -----------------------------------------------------------------------------
+//
+int CellularDataSettings::dataUseHome(  )
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CellularDataSettings::setDataUseHome
+// -----------------------------------------------------------------------------
+//
+void CellularDataSettings::setDataUseHome( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CellularDataSettings::dataUseRoam
+// -----------------------------------------------------------------------------
+//
+int CellularDataSettings::dataUseRoam(  )
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CellularDataSettings::setDataUseRoam
+// -----------------------------------------------------------------------------
+//
+void CellularDataSettings::setDataUseRoam( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cmmanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,435 @@
+/* 
+* 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 <smcmockclassincludes.h>
+#include "cmmanager.h"
+
+class RCmConnectionMethod
+{
+public:
+    RCmConnectionMethod(){};
+};
+
+class RCmDestination
+{
+public:
+    RCmDestination(){};
+};
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// RCmManager::OpenL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::OpenL(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::OpenLC
+// -----------------------------------------------------------------------------
+//
+void RCmManager::OpenLC(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::Close
+// -----------------------------------------------------------------------------
+//
+void RCmManager::Close(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetBearerInfoIntL
+// -----------------------------------------------------------------------------
+//
+TUint32 RCmManager::GetBearerInfoIntL( 
+        TUint32 aBearerType,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( TUint32, TUint32, aBearerType, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetBearerInfoBoolL
+// -----------------------------------------------------------------------------
+//
+TBool RCmManager::GetBearerInfoBoolL( 
+        TUint32 aBearerType,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( TBool, TUint32, aBearerType, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetBearerInfoStringL
+// -----------------------------------------------------------------------------
+//
+HBufC * RCmManager::GetBearerInfoStringL( 
+        TUint32 aBearerType,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( HBufC *, TUint32, aBearerType, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetBearerInfoString8L
+// -----------------------------------------------------------------------------
+//
+HBufC8 * RCmManager::GetBearerInfoString8L( 
+        TUint32 aBearerType,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( HBufC8 *, TUint32, aBearerType, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetConnectionMethodInfoIntL
+// -----------------------------------------------------------------------------
+//
+TUint32 RCmManager::GetConnectionMethodInfoIntL( 
+        TUint32 aIapId,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( TUint32, TUint32, aIapId, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetConnectionMethodInfoBoolL
+// -----------------------------------------------------------------------------
+//
+TBool RCmManager::GetConnectionMethodInfoBoolL( 
+        TUint32 aIapId,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( TBool, TUint32, aIapId, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetConnectionMethodInfoStringL
+// -----------------------------------------------------------------------------
+//
+HBufC * RCmManager::GetConnectionMethodInfoStringL( 
+        TUint32 aIapId,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( HBufC *, TUint32, aIapId, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::GetConnectionMethodInfoString8L
+// -----------------------------------------------------------------------------
+//
+HBufC8 * RCmManager::GetConnectionMethodInfoString8L( 
+        TUint32 aIapId,
+        TUint32 aAttribute ) const
+    {
+    SMC_MOCK_METHOD2( HBufC8 *, TUint32, aIapId, 
+        TUint32, aAttribute )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::ConnectionMethodL
+// -----------------------------------------------------------------------------
+//
+RCmConnectionMethod RCmManager::ConnectionMethodL( 
+        TUint32 aConnectionMethodId ) const
+    {
+    SMC_MOCK_METHOD1( RCmConnectionMethod, TUint32, aConnectionMethodId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::ConnectionMethodL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::ConnectionMethodL( 
+        RArray<TUint32> & aCMArray,
+        TBool aCheckBearerType,
+        TBool aLegacyOnly,
+        TBool aEasyWlan ) const
+    {
+    SMC_MOCK_METHOD4( void, RArray<TUint32> &, aCMArray, 
+        TBool, aCheckBearerType, 
+        TBool, aLegacyOnly, 
+        TBool, aEasyWlan )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::AllDestinationsL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::AllDestinationsL( 
+        RArray<TUint32> & aDestArray ) const
+    {
+    SMC_MOCK_METHOD1( void, RArray<TUint32> &, aDestArray )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::DestinationL
+// -----------------------------------------------------------------------------
+//
+RCmDestination RCmManager::DestinationL( 
+        TUint32 aDestinationId ) const
+    {
+    SMC_MOCK_METHOD1( RCmDestination, TUint32, aDestinationId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::BearerPriorityArrayL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::BearerPriorityArrayL( 
+        RArray<TBearerPriority> & aArray ) const
+    {
+    SMC_MOCK_METHOD1( void, RArray<TBearerPriority> &, aArray )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::CleanupGlobalPriorityArray
+// -----------------------------------------------------------------------------
+//
+void RCmManager::CleanupGlobalPriorityArray( 
+        RArray<TBearerPriority> & aArray ) const
+    {
+    SMC_MOCK_METHOD1( void, RArray<TBearerPriority> &, aArray )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::EasyWlanIdL
+// -----------------------------------------------------------------------------
+//
+TUint32 RCmManager::EasyWlanIdL(  ) const
+    {
+    SMC_MOCK_METHOD0( TUint32 )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::ReadDefConnL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::ReadDefConnL( 
+        TCmDefConnValue &  )
+    {
+    //SMC_MOCK_METHOD1( void, TCmDefConnValue &, aDCSetting )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::WriteDefConnL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::WriteDefConnL( 
+        const TCmDefConnValue &  )
+    {
+    //SMC_MOCK_METHOD1( void, const TCmDefConnValue &, aDCSetting )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::ReadGenConnSettingsL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::ReadGenConnSettingsL( 
+        TCmGenConnSettings & aGenConnSettings )
+    {
+    SMC_MOCK_METHOD1( void, TCmGenConnSettings &, aGenConnSettings )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::WriteGenConnSettingsL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::WriteGenConnSettingsL( 
+        const TCmGenConnSettings & aGenConnSettings )
+    {
+    SMC_MOCK_METHOD1( void, const TCmGenConnSettings &, aGenConnSettings )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::CreateTablesAndOpenL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::CreateTablesAndOpenL(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::CreateDestinationL
+// -----------------------------------------------------------------------------
+//
+RCmDestination RCmManager::CreateDestinationL( 
+        const TDesC & aName )
+    {
+    SMC_MOCK_METHOD1( RCmDestination, const TDesC &, aName )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::CreateConnectionMethodL
+// -----------------------------------------------------------------------------
+//
+RCmConnectionMethod RCmManager::CreateConnectionMethodL( 
+        TUint32 aBearerType )
+    {
+    SMC_MOCK_METHOD1( RCmConnectionMethod, TUint32, aBearerType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::CopyConnectionMethodL
+// -----------------------------------------------------------------------------
+//
+TInt RCmManager::CopyConnectionMethodL( 
+        RCmDestination & aTargetDestination,
+        RCmConnectionMethod & aConnectionMethod )
+    {
+    SMC_MOCK_METHOD2( TInt, RCmDestination &, aTargetDestination, 
+        RCmConnectionMethod &, aConnectionMethod )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::MoveConnectionMethodL
+// -----------------------------------------------------------------------------
+//
+TInt RCmManager::MoveConnectionMethodL( 
+        RCmDestination & aSourceDestination,
+        RCmDestination & aTargetDestination,
+        RCmConnectionMethod & aConnectionMethod )
+    {
+    SMC_MOCK_METHOD3( TInt, RCmDestination &, aSourceDestination, 
+        RCmDestination &, aTargetDestination, 
+        RCmConnectionMethod &, aConnectionMethod )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::RemoveConnectionMethodL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::RemoveConnectionMethodL( 
+        RCmDestination & aDestination,
+        RCmConnectionMethod & aConnectionMethod )
+    {
+    SMC_MOCK_METHOD2( void, RCmDestination &, aDestination, 
+        RCmConnectionMethod &, aConnectionMethod )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::RemoveAllReferencesL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::RemoveAllReferencesL( 
+        RCmConnectionMethod & aConnectionMethod )
+    {
+    SMC_MOCK_METHOD1( void, RCmConnectionMethod &, aConnectionMethod )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::UpdateBearerPriorityArrayL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::UpdateBearerPriorityArrayL( 
+        const RArray<TBearerPriority> & aArray )
+    {
+    SMC_MOCK_METHOD1( void, const RArray<TBearerPriority> &, aArray )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::CreateDestinationL
+// -----------------------------------------------------------------------------
+//
+RCmDestination RCmManager::CreateDestinationL( 
+        const TDesC & aName,
+        TUint32 aDestId )
+    {
+    SMC_MOCK_METHOD2( RCmDestination, const TDesC &, aName, 
+        TUint32, aDestId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::CreateConnectionMethodL
+// -----------------------------------------------------------------------------
+//
+RCmConnectionMethod RCmManager::CreateConnectionMethodL( 
+        TUint32 aImplementationUid,
+        TUint32 aConnMethodId )
+    {
+    SMC_MOCK_METHOD2( RCmConnectionMethod, TUint32, aImplementationUid, 
+        TUint32, aConnMethodId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::SupportedBearersL
+// -----------------------------------------------------------------------------
+//
+void RCmManager::SupportedBearersL( 
+        RArray<TUint32> & aArray ) const
+    {
+    SMC_MOCK_METHOD1( void, RArray<TUint32> &, aArray )
+    }
+
+
+// -----------------------------------------------------------------------------
+// RCmManager::UncategorizedIconL
+// -----------------------------------------------------------------------------
+//
+CGulIcon * RCmManager::UncategorizedIconL(  ) const
+    {
+    SMC_MOCK_METHOD0( CGulIcon * )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugin.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include "cpbarringplugin.h"
+#include <cpsettingformitemdata.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpBarringPlugin::Q_INTERFACES
+// -----------------------------------------------------------------------------
+//
+CpBarringPlugin::CpBarringPlugin()
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPlugin::~CpBarringPlugin
+// -----------------------------------------------------------------------------
+//
+CpBarringPlugin::~CpBarringPlugin(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPlugin::createSettingFormItemData
+// -----------------------------------------------------------------------------
+//
+QList<CpSettingFormItemData*> CpBarringPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+    {
+    Q_UNUSED( itemDataHelper )
+    return QList<CpSettingFormItemData *> ();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbarringplugingroup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <smcmockclassincludes.h>
+#include <QDebug>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <HbCheckBox>
+#include <QTranslator>
+#include <QLocale>
+#include <QApplication>
+#include <QTimer>
+#include <cpitemdatahelper.h>
+#include <psetwrapper.h>
+#include "cpbarringplugingroup.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::CpBarringPluginGroup
+// -----------------------------------------------------------------------------
+//
+CpBarringPluginGroup::CpBarringPluginGroup( 
+        CpItemDataHelper & helper )
+    :CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId("Barring"),0),
+    m_helper(helper)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::~CpBarringPluginGroup
+// -----------------------------------------------------------------------------
+//
+CpBarringPluginGroup::~CpBarringPluginGroup(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::itemShown
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::itemShown( 
+        const QModelIndex & item )
+    {
+    SMC_MOCK_METHOD1( void, const QModelIndex &, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::barringStatusRequestCompleted
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::barringStatusRequestCompleted(
+    int result,
+    const QList<unsigned char> & basicServiceGroupIds,
+    PSetCallBarringWrapper::BarringStatus status)
+{
+    SMC_MOCK_METHOD3( void, 
+        int, result,
+        const QList<unsigned char> &, basicServiceGroupIds, 
+        PSetCallBarringWrapper::BarringStatus, status)
+}
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::enableBarringRequestCompleted
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::enableBarringRequestCompleted(
+    int result,
+    PSetCallBarringWrapper::BarringType barringType,
+    PSetCallBarringWrapper::BarringStatus barringStatus, 
+    bool plural)
+{
+    SMC_MOCK_METHOD4( void, 
+        int, result,
+        PSetCallBarringWrapper::BarringType, barringType, 
+        PSetCallBarringWrapper::BarringStatus, barringStatus,
+        bool, plural)
+}
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::disableBarringRequestCompleted
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::disableBarringRequestCompleted(
+    int result,
+    PSetCallBarringWrapper::BarringType barringType,
+    PSetCallBarringWrapper::BarringStatus barringStatus, 
+    bool plural)
+{
+    SMC_MOCK_METHOD4( void, 
+        int, result,
+        PSetCallBarringWrapper::BarringType, barringType, 
+        PSetCallBarringWrapper::BarringStatus, barringStatus,
+        bool, plural)
+}
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::barringPasswordChangeRequestCompleted
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::barringPasswordChangeRequestCompleted(int result)
+{
+    SMC_MOCK_METHOD1( void, int, result)
+}
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::changeBarringStateRequested
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::changeBarringStateRequested(int checkState)
+{
+    SMC_MOCK_METHOD1( void, int, checkState)
+}
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::changeBarringPasswordRequested
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::changeBarringPasswordRequested(bool checked)
+{
+    SMC_MOCK_METHOD1( void, bool, checked)
+}
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::processBarringStatusRequestQueue
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::processBarringStatusRequestQueue()
+{
+    SMC_MOCK_METHOD0( void )    
+}
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::completeBarringStateChangeRequestHandling
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::completeBarringStateChangeRequestHandling(
+        QString barringPassword,
+        bool okPressed)
+{
+    SMC_MOCK_METHOD2( void, QString, barringPassword, bool, okPressed)
+}
+
+
+// -----------------------------------------------------------------------------
+// CpBarringPluginGroup::changeBarringPasswordPhasesHandling
+// -----------------------------------------------------------------------------
+//
+void CpBarringPluginGroup::changeBarringPasswordPhasesHandling(
+        QString barringPassword,
+        bool okPressed)
+{
+    SMC_MOCK_METHOD2( void, QString, barringPassword, bool, okPressed)
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpbasesettingview.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <cpbasesettingview.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpBaseSettingView::CpBaseSettingView
+// -----------------------------------------------------------------------------
+//
+CpBaseSettingView::CpBaseSettingView( 
+        QGraphicsWidget * ,
+        QGraphicsItem *  )
+    //:
+    //HbView( /*settingForm, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBaseSettingView::~CpBaseSettingView
+// -----------------------------------------------------------------------------
+//
+CpBaseSettingView::~CpBaseSettingView(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBaseSettingView::setSettingForm
+// -----------------------------------------------------------------------------
+//
+void CpBaseSettingView::setSettingForm( 
+        HbDataForm * settingForm )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpBaseSettingView::settingForm
+// -----------------------------------------------------------------------------
+//
+HbDataForm * CpBaseSettingView::settingForm(  ) const
+    {
+    SMC_MOCK_METHOD0( HbDataForm * )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpcallsplugin.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include "cpcallsplugin.h"
+#include <cpsettingformitemdata.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpCallsPlugin::Q_INTERFACES
+// -----------------------------------------------------------------------------
+//
+CpCallsPlugin::CpCallsPlugin()
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPlugin::~CpCallsPlugin
+// -----------------------------------------------------------------------------
+//
+CpCallsPlugin::~CpCallsPlugin(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPlugin::createSettingFormItemData
+// -----------------------------------------------------------------------------
+//
+QList<CpSettingFormItemData*> CpCallsPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+    {
+    Q_UNUSED( itemDataHelper )
+    return QList<CpSettingFormItemData *> ();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpcallsplugingroup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,132 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include "cpcallsplugingroup.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::CpCallsPluginGroup
+// -----------------------------------------------------------------------------
+//
+CpCallsPluginGroup::CpCallsPluginGroup( 
+        CpItemDataHelper &helper )
+    :CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId("Calls"),0),
+    m_helper(helper)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::~CpCallsPluginGroup
+// -----------------------------------------------------------------------------
+//
+CpCallsPluginGroup::~CpCallsPluginGroup(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::showCallDurationStateChanged
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::showCallDurationStateChanged( )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::softRejectTextChanged
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::softRejectTextChanged(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::callWaitingCurrentIndexChanged
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::callWaitingCurrentIndexChanged( )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::cliCurrentIndexChanged
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::cliCurrentIndexChanged( int index )
+    {
+    Q_UNUSED( index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::handleCallWaitingGetStatus
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::handleCallWaitingGetStatus( 
+        const PSetCallWaitingWrapper::PsCallWaitingStatus status,
+        const QList<unsigned char> &basicServiceGroupIds )
+    {
+    Q_UNUSED( status )
+    Q_UNUSED( basicServiceGroupIds )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::handleCallWaitingChanged
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::handleCallWaitingChanged( 
+        const PSetCallWaitingWrapper::PsCallWaitingCommand setting,
+        const int aResult )
+    {
+    Q_UNUSED( setting )
+    Q_UNUSED( aResult )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::handleCallWaitingRequesting
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::handleCallWaitingRequesting( 
+        bool ongoing,
+        bool interrupted )
+    {
+    Q_UNUSED( ongoing )
+    Q_UNUSED( interrupted )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCallsPluginGroup::handleCallWaitingError
+// -----------------------------------------------------------------------------
+//
+void CpCallsPluginGroup::handleCallWaitingError( int aError )
+    {
+    Q_UNUSED( aError )
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpdivertselectionitem.cpp	Fri Jun 04 10:19:18 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "cpdivertselectionitem.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpDivertSelectionItem::CpDivertSelectionItem
+// -----------------------------------------------------------------------------
+//
+CpDivertSelectionItem::CpDivertSelectionItem( 
+        QGraphicsItem * parent )
+    //:
+    //HbDataFormViewItem( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpDivertSelectionItem::~CpDivertSelectionItem
+// -----------------------------------------------------------------------------
+//
+CpDivertSelectionItem::~CpDivertSelectionItem(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpDivertSelectionItem::createItem
+// -----------------------------------------------------------------------------
+//
+HbAbstractViewItem * CpDivertSelectionItem::createItem(  )
+    {
+    SMC_MOCK_METHOD0( HbAbstractViewItem * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpDivertSelectionItem::canSetModelIndex
+// -----------------------------------------------------------------------------
+//
+bool CpDivertSelectionItem::canSetModelIndex( 
+        const QModelIndex & index ) const
+    {
+    SMC_MOCK_METHOD1( bool, const QModelIndex &, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpDivertSelectionItem::restore
+// -----------------------------------------------------------------------------
+//
+void CpDivertSelectionItem::restore(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpDivertSelectionItem::createCustomWidget
+// -----------------------------------------------------------------------------
+//
+HbWidget * CpDivertSelectionItem::createCustomWidget(  )
+    {
+    SMC_MOCK_METHOD0( HbWidget * )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpitemdatahelper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,147 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <QList>
+#include <hbdataform.h>
+#include <hbdataformmodelitem.h>
+#include <hbdataformviewitem.h>
+#include "cpitemdatahelper.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::CpItemDataHelper
+// -----------------------------------------------------------------------------
+//
+CpItemDataHelper::CpItemDataHelper( 
+        HbDataForm * form )
+    //:
+    //QObject( /*form*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::~CpItemDataHelper
+// -----------------------------------------------------------------------------
+//
+CpItemDataHelper::~CpItemDataHelper(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::bindToForm
+// -----------------------------------------------------------------------------
+//
+void CpItemDataHelper::bindToForm( 
+        HbDataForm * form )
+    {
+    SMC_MOCK_METHOD1( void, HbDataForm *, form )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::addItemPrototype
+// -----------------------------------------------------------------------------
+//
+void CpItemDataHelper::addItemPrototype( 
+        HbAbstractViewItem * prototype )
+    {
+    SMC_MOCK_METHOD1( void, HbAbstractViewItem *, prototype )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::addConnection
+// -----------------------------------------------------------------------------
+//
+void CpItemDataHelper::addConnection( 
+        HbDataFormModelItem * item,
+        const char * signal,
+        QObject * receiver,
+        const char * method )
+    {
+    SMC_MOCK_METHOD4( void, HbDataFormModelItem *, item, 
+        const char *, signal, 
+        QObject *, receiver, 
+        const char *, method )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::removeConnection
+// -----------------------------------------------------------------------------
+//
+void CpItemDataHelper::removeConnection( 
+        HbDataFormModelItem * item,
+        const char * signal,
+        QObject * receiver,
+        const char * method )
+    {
+    SMC_MOCK_METHOD4( void, HbDataFormModelItem *, item, 
+        const char *, signal, 
+        QObject *, receiver, 
+        const char *, method )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::connectToForm
+// -----------------------------------------------------------------------------
+//
+void CpItemDataHelper::connectToForm( 
+        const char * signal,
+        QObject * receiver,
+        const char * method )
+    {
+    SMC_MOCK_METHOD3( void, const char *, signal, 
+        QObject *, receiver, 
+        const char *, method )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::disconnectFromForm
+// -----------------------------------------------------------------------------
+//
+void CpItemDataHelper::disconnectFromForm( 
+        const char * signal,
+        QObject * receiver,
+        const char * method )
+    {
+    SMC_MOCK_METHOD3( void, const char *, signal, 
+        QObject *, receiver, 
+        const char *, method )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpItemDataHelper::widgetFromModelIndex
+// -----------------------------------------------------------------------------
+//
+HbWidget * CpItemDataHelper::widgetFromModelIndex( 
+        const QModelIndex & index )
+    {
+    SMC_MOCK_METHOD1( HbWidget *, const QModelIndex &, index )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkplugin.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include "cpnetworkplugin.h"
+#include <cpsettingformitemdata.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpNetworkPlugin::Q_INTERFACES
+// -----------------------------------------------------------------------------
+//
+CpNetworkPlugin::CpNetworkPlugin()
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPlugin::~CpNetworkPlugin
+// -----------------------------------------------------------------------------
+//
+CpNetworkPlugin::~CpNetworkPlugin(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPlugin::createSettingFormItemData
+// -----------------------------------------------------------------------------
+//
+QList<CpSettingFormItemData*> CpNetworkPlugin::createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const
+    {
+    Q_UNUSED( itemDataHelper )
+    return QList<CpSettingFormItemData *> ();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginform.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,185 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <cpsettingformitemdata.h>
+#include <psetwrapper.h>
+#include "cpnetworkpluginform.h"
+
+class CellularDataSettings
+{
+public:
+    CellularDataSettings();
+};
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::CpNetworkPluginForm
+// -----------------------------------------------------------------------------
+//
+CpNetworkPluginForm::CpNetworkPluginForm( 
+        QGraphicsItem * /*parent*/ )
+    //:
+    //HbDataForm( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::~CpNetworkPluginForm
+// -----------------------------------------------------------------------------
+//
+CpNetworkPluginForm::~CpNetworkPluginForm(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::searchAvailableNetworks
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::searchAvailableNetworks(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::cellularDataUseHomeStateChanged
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::cellularDataUseHomeStateChanged( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( void, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::cellularDataUseRoamStateChanged
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::cellularDataUseRoamStateChanged( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( void, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::networkModeStateChanged
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::networkModeStateChanged( 
+        int index )
+    {
+    SMC_MOCK_METHOD1( void, int, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::operatorSelectionStateChanged
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::operatorSelectionStateChanged( 
+        bool index )
+    {
+    SMC_MOCK_METHOD1( void, bool, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::networkAccessModeGot
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::networkAccessModeGot( 
+        int mode )
+    {
+    SMC_MOCK_METHOD1( void, int, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::availableNetworksGot
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::availableNetworksGot( 
+        QList<PSetNetworkWrapper::NetworkInfo *> &  )
+    {
+//    SMC_MOCK_METHOD1( void, QList<PSetNetworkWrapper::NetworkInfo *> &, m_networkInfoList )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::networkReqestFailed
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::networkReqestFailed( 
+        PSetNetworkWrapper::ErrorCode ,
+        PSetNetworkWrapper::RequestType  )
+    {
+//    SMC_MOCK_METHOD2( void, PSetNetworkWrapper::ErrorCode, error, 
+//        PSetNetworkWrapper::RequestType, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::userCancel
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::userCancel(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::handleSearchingNetworks
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::handleSearchingNetworks( 
+        PSetNetworkWrapper::RequestType &  )
+    {
+//    SMC_MOCK_METHOD1( void, PSetNetworkWrapper::RequestType &, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::handleRequestingSelectedNetwork
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::handleRequestingSelectedNetwork( 
+        bool ongoing )
+    {
+    SMC_MOCK_METHOD1( void, bool, ongoing )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginForm::handleNetworkChanged
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginForm::handleNetworkChanged( 
+        PSetNetworkWrapper::NetworkInfo & ,
+        PSetNetworkWrapper::RegistrationStatus &  )
+    {
+//    SMC_MOCK_METHOD2( void, PSetNetworkWrapper::NetworkInfo &, currentInfo, 
+//        PSetNetworkWrapper::RegistrationStatus &, status )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpnetworkpluginview.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "cpnetworkpluginview.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginView::CpNetworkPluginView
+// -----------------------------------------------------------------------------
+//
+CpNetworkPluginView::CpNetworkPluginView( 
+        QGraphicsItem * parent )
+    :
+    /*CpBaseSettingView(0, parent),*/
+    m_networkSettingsForm(0)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginView::~CpNetworkPluginView
+// -----------------------------------------------------------------------------
+//
+CpNetworkPluginView::~CpNetworkPluginView(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpNetworkPluginView::SearchAvailableNetworks
+// -----------------------------------------------------------------------------
+//
+void CpNetworkPluginView::SearchAvailableNetworks(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonelocalisation.cpp	Fri Jun 04 10:19:18 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "cpphonelocalisation.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpPhoneLocalisation::CpPhoneLocalisation
+// -----------------------------------------------------------------------------
+//
+CpPhoneLocalisation::CpPhoneLocalisation( 
+        QObject * parent )
+    //:
+    //QObject( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneLocalisation::~CpPhoneLocalisation
+// -----------------------------------------------------------------------------
+//
+CpPhoneLocalisation::~CpPhoneLocalisation(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneLocalisation::installTranslator
+// -----------------------------------------------------------------------------
+//
+bool CpPhoneLocalisation::installTranslator( 
+        TranslationFileId translationFileId )
+    {
+    SMC_MOCK_METHOD1( bool, TranslationFileId, translationFileId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneLocalisation::removeTranslators
+// -----------------------------------------------------------------------------
+//
+void CpPhoneLocalisation::removeTranslators(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpphonenotes.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <QString>
+#include <smcmockclassincludes.h>
+#include "cpphonenotes.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::CpPhoneNotes
+// -----------------------------------------------------------------------------
+//
+CpPhoneNotes::CpPhoneNotes( ): QObject(NULL) 
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::instance
+// -----------------------------------------------------------------------------
+//
+CpPhoneNotes * CpPhoneNotes::instance(  )
+    {
+    static CpPhoneNotes theInstance;
+    return &theInstance; 
+    }
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::~CpPhoneNotes
+// -----------------------------------------------------------------------------
+//
+CpPhoneNotes::~CpPhoneNotes(  )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::showGlobalProgressNote
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::showGlobalProgressNote( 
+        int & noteId,
+        const QString & text )
+    {
+    SMC_MOCK_METHOD2( void, int &, noteId, 
+        const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::showGlobalNote
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::showGlobalNote( 
+        int & noteId,
+        const QString & text,
+        HbMessageBox::MessageBoxType noteType )
+    {
+    SMC_MOCK_METHOD3( void, int &, noteId, 
+        const QString &, text, 
+        HbMessageBox::MessageBoxType, noteType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::showGlobalErrorNote
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::showGlobalErrorNote( 
+        int & noteId,
+        int errorCode )
+    {
+    SMC_MOCK_METHOD2( void, int &, noteId, 
+        int, errorCode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::showBasicServiceList
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::showBasicServiceList( 
+        const QString & title,
+        const QList<unsigned char> & basicServiceGroupIds )
+    {
+    SMC_MOCK_METHOD2( void, const QString &, title, 
+        const QList<unsigned char> &, basicServiceGroupIds )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::showCallDivertDetails
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::showCallDivertDetails( 
+        const PSCallDivertingStatus & divertStatus )
+    {
+    SMC_MOCK_METHOD1( void, const PSCallDivertingStatus &, divertStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::showPasswordQueryDialog
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::showPasswordQueryDialog( 
+        const QString & title,
+        const QValidator & validator,
+        int maxPasswordLength )
+    {
+    SMC_MOCK_METHOD3( void, const QString &, title, 
+        const QValidator &, validator, 
+        int, maxPasswordLength )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::cancelNote
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::cancelNote( 
+        int noteId )
+    {
+    SMC_MOCK_METHOD1( void, int, noteId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::noteShowing
+// -----------------------------------------------------------------------------
+//
+bool CpPhoneNotes::noteShowing(  )
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::finishedPasswordQueryDialog
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::finishedPasswordQueryDialog( 
+        HbAction * action )
+    {
+    //SMC_MOCK_METHOD1( void, HbAction *, action )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::activeNoteAboutToClose
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::activeNoteAboutToClose()
+{
+    SMC_MOCK_METHOD0( void )
+}
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::handleProgressNoteCanceled
+// -----------------------------------------------------------------------------
+//
+void CpPhoneNotes::handleProgressNoteCanceled()
+{
+    SMC_MOCK_METHOD0( void )
+}
+
+
+// -----------------------------------------------------------------------------
+// CpPhoneNotes::passwordTextChanged
+// -----------------------------------------------------------------------------
+//
+
+
+void CpPhoneNotes::passwordTextChanged()
+{
+    SMC_MOCK_METHOD0( void )
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpplugincommon.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,149 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "cpplugincommon.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::CpSettingsWrapper
+// -----------------------------------------------------------------------------
+//
+CpSettingsWrapper::CpSettingsWrapper( 
+        QObject * parent ) : QObject( parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::~CpSettingsWrapper
+// -----------------------------------------------------------------------------
+//
+CpSettingsWrapper::~CpSettingsWrapper(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::showCallDuration
+// -----------------------------------------------------------------------------
+//
+bool CpSettingsWrapper::showCallDuration(  )
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::setShowCallDuration
+// -----------------------------------------------------------------------------
+//
+int CpSettingsWrapper::setShowCallDuration( bool value )
+    {
+    SMC_MOCK_METHOD1( int, bool, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::readSoftRejectText
+// -----------------------------------------------------------------------------
+//
+void CpSettingsWrapper::readSoftRejectText( 
+        QString & text, bool & userDefined )
+    {
+    //To improve coverage
+    static int i=0;
+    if(i==0){
+        text = "Soittelen myöhemmin...";
+        userDefined = true;
+        i=1;
+    }
+    SMC_MOCK_METHOD2( void, QString &, text, bool, userDefined )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::writeSoftRejectText
+// -----------------------------------------------------------------------------
+//
+int CpSettingsWrapper::writeSoftRejectText( 
+        const QString & text, bool userDefined )
+    {
+    SMC_MOCK_METHOD2( int, const QString &, text, bool, userDefined )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::numberGroupingSupported
+// -----------------------------------------------------------------------------
+//
+bool CpSettingsWrapper::numberGroupingSupported(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled
+// -----------------------------------------------------------------------------
+//
+bool CpSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled()
+{
+    SMC_MOCK_METHOD0( bool )
+}
+
+// -----------------------------------------------------------------------------
+// CpSettingsWrapper::isPhoneOffline
+// -----------------------------------------------------------------------------
+//
+bool CpSettingsWrapper::isPhoneOffline() const
+{
+    SMC_MOCK_METHOD0( bool )
+}
+
+
+// -----------------------------------------------------------------------------
+// Tools::voipSupported
+// -----------------------------------------------------------------------------
+//
+bool Tools::voipSupported(  )
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// Tools::videoSupported
+// -----------------------------------------------------------------------------
+//
+bool Tools::videoSupported(  )
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+// -----------------------------------------------------------------------------
+// Tools::errorCodeTextMapping
+// -----------------------------------------------------------------------------
+//
+bool Tools::errorCodeTextMapping( const int errorcode, QString & errorText )
+    {
+    SMC_MOCK_METHOD2( bool, int, errorcode, QString &, errorText )
+    }
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cppluginloader.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "cppluginloader.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpPluginLoader::loadCpPlugin
+// -----------------------------------------------------------------------------
+//
+CpPluginInterface * CpPluginLoader::loadCpPlugin( 
+        const QString & pluginFile )
+    {
+    SMC_MOCK_METHOD1( CpPluginInterface *, const QString &, pluginFile )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpPluginLoader::loadPlatCpPlugin
+// -----------------------------------------------------------------------------
+//
+CpPluginPlatInterface * CpPluginLoader::loadPlatCpPlugin( 
+        const QString & pluginFile )
+    {
+    SMC_MOCK_METHOD1( CpPluginPlatInterface *, const QString &, pluginFile )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpsettingformentryitemdata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,142 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <cpsettingformentryitemdata.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::CpSettingFormEntryItemData
+// -----------------------------------------------------------------------------
+//
+CpSettingFormEntryItemData::CpSettingFormEntryItemData( 
+        const HbDataFormModelItem * parent )
+    //:
+    //CpSettingFormItemData( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::CpSettingFormEntryItemData
+// -----------------------------------------------------------------------------
+//
+CpSettingFormEntryItemData::CpSettingFormEntryItemData( 
+        CpItemDataHelper & itemDataHelper,
+        const QString & text,
+        const QString & description,
+        const HbIcon & icon,
+        const HbDataFormModelItem * parent )
+    //:
+    //CpSettingFormItemData( /*itemDataHelper, text, description, icon, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::CpSettingFormEntryItemData
+// -----------------------------------------------------------------------------
+//
+CpSettingFormEntryItemData::CpSettingFormEntryItemData( 
+        HbDataForm * dataForm,
+        const QString & text,
+        const QString & description,
+        const HbIcon & icon,
+        const HbDataFormModelItem * parent )
+    //:
+    //CpSettingFormItemData( /*dataForm, text, description, icon, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::~CpSettingFormEntryItemData
+// -----------------------------------------------------------------------------
+//
+CpSettingFormEntryItemData::~CpSettingFormEntryItemData(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::text
+// -----------------------------------------------------------------------------
+//
+QString CpSettingFormEntryItemData::text(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::setText
+// -----------------------------------------------------------------------------
+//
+void CpSettingFormEntryItemData::setText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::description
+// -----------------------------------------------------------------------------
+//
+QString CpSettingFormEntryItemData::description(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::setDescription
+// -----------------------------------------------------------------------------
+//
+void CpSettingFormEntryItemData::setDescription( 
+        const QString & description )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, description )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::entryItemIcon
+// -----------------------------------------------------------------------------
+//
+HbIcon CpSettingFormEntryItemData::entryItemIcon(  ) const
+    {
+//    SMC_MOCK_METHOD0( HbIcon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormEntryItemData::setEntryItemIcon
+// -----------------------------------------------------------------------------
+//
+void CpSettingFormEntryItemData::setEntryItemIcon( 
+        const HbIcon & icon )
+    {
+//    SMC_MOCK_METHOD1( void, const HbIcon &, icon )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cpsettingformitemdata.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <cpsettingformitemdata.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpSettingFormItemData::CpSettingFormItemData
+// -----------------------------------------------------------------------------
+//
+CpSettingFormItemData::CpSettingFormItemData( 
+        HbDataFormModelItem::DataItemType type,
+        const QString & label,
+        const HbDataFormModelItem * parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormItemData::CpSettingFormItemData
+// -----------------------------------------------------------------------------
+//
+CpSettingFormItemData::CpSettingFormItemData( 
+        const HbDataFormModelItem * parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpSettingFormItemData::~CpSettingFormItemData
+// -----------------------------------------------------------------------------
+//
+CpSettingFormItemData::~CpSettingFormItemData(  )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_cptelephonypluginview.cpp	Fri Jun 04 10:19:18 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:  
+ *
+ */
+#include <QDebug>
+#include "cptelephonypluginview.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpTelephonyPluginView::CpTelephonyPluginView
+// -----------------------------------------------------------------------------
+//
+CpTelephonyPluginView::CpTelephonyPluginView(  )
+    :CpBaseSettingView(0, 0)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpTelephonyPluginView::~CpTelephonyPluginView
+// -----------------------------------------------------------------------------
+//
+CpTelephonyPluginView::~CpTelephonyPluginView(  )
+    {
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbabstractitemview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,815 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbabstractitemview.h>
+
+HbScrollAreaPrivate* pointerHbScrollAreaPrivate(NULL);
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::HbAbstractItemView
+// -----------------------------------------------------------------------------
+//
+HbAbstractItemView::HbAbstractItemView( 
+        HbAbstractItemViewPrivate & dd,
+        HbAbstractItemContainer * container,
+        QGraphicsItem * parent )
+    : HbScrollArea( *pointerHbScrollAreaPrivate, parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::~HbAbstractItemView
+// -----------------------------------------------------------------------------
+//
+HbAbstractItemView::~HbAbstractItemView(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::type
+// -----------------------------------------------------------------------------
+//
+/*
+int HbAbstractItemView::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setModel
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setModel( 
+        QAbstractItemModel * model,
+        HbAbstractViewItem * prototype )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::model
+// -----------------------------------------------------------------------------
+//
+QAbstractItemModel * HbAbstractItemView::model(  ) const
+    {
+  
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setItemPrototype
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setItemPrototype( 
+        HbAbstractViewItem * prototype )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setItemPrototypes
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setItemPrototypes( 
+        const QList<HbAbstractViewItem *> & prototypes )
+    {
+  
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::itemPrototypes
+// -----------------------------------------------------------------------------
+//
+QList <HbAbstractViewItem * > HbAbstractItemView::itemPrototypes(  ) const
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setSelectionModel
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setSelectionModel( 
+        QItemSelectionModel * selectionModel )
+    {
+  
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::selectionModel
+// -----------------------------------------------------------------------------
+//
+QItemSelectionModel * HbAbstractItemView::selectionModel(  ) const
+    {
+  
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::currentIndex
+// -----------------------------------------------------------------------------
+//
+QModelIndex HbAbstractItemView::currentIndex(  ) const
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::rootIndex
+// -----------------------------------------------------------------------------
+//
+QModelIndex HbAbstractItemView::rootIndex(  ) const
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setSelectionMode
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setSelectionMode( 
+        SelectionMode newMode,
+        bool resetSelection )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::selectionMode
+// -----------------------------------------------------------------------------
+//
+HbAbstractItemView::SelectionMode HbAbstractItemView::selectionMode(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setItemRecycling
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setItemRecycling( 
+        bool enabled )
+    {
+    SMC_MOCK_METHOD1( void, bool, enabled )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::itemRecycling
+// -----------------------------------------------------------------------------
+//
+bool HbAbstractItemView::itemRecycling(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::isVisible
+// -----------------------------------------------------------------------------
+//
+bool HbAbstractItemView::isVisible( 
+        const QModelIndex & index ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::isVisible
+// -----------------------------------------------------------------------------
+//
+bool HbAbstractItemView::isVisible( 
+        HbAbstractViewItem * item ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::currentViewItem
+// -----------------------------------------------------------------------------
+//
+HbAbstractViewItem * HbAbstractItemView::currentViewItem(  ) const
+    {
+    SMC_MOCK_METHOD0( HbAbstractViewItem * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::itemByIndex
+// -----------------------------------------------------------------------------
+//
+HbAbstractViewItem * HbAbstractItemView::itemByIndex( 
+        const QModelIndex & index ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::scrollTo
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::scrollTo( 
+        const QModelIndex & index,
+        ScrollHint hint )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::visibleItems
+// -----------------------------------------------------------------------------
+//
+QList <HbAbstractViewItem * > HbAbstractItemView::visibleItems(  ) const
+    {
+ 
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::itemAtPosition
+// -----------------------------------------------------------------------------
+//
+HbAbstractViewItem * HbAbstractItemView::itemAtPosition( 
+        const QPointF & position ) const
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::indexCount
+// -----------------------------------------------------------------------------
+//
+int HbAbstractItemView::indexCount(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::indexPosition
+// -----------------------------------------------------------------------------
+//
+int HbAbstractItemView::indexPosition( 
+        const QModelIndex & index ) const
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::nextIndex
+// -----------------------------------------------------------------------------
+//
+QModelIndex HbAbstractItemView::nextIndex( 
+        const QModelIndex & index ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::previousIndex
+// -----------------------------------------------------------------------------
+//
+QModelIndex HbAbstractItemView::previousIndex( 
+        const QModelIndex & index ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::layoutName
+// -----------------------------------------------------------------------------
+//
+QString HbAbstractItemView::layoutName(  ) const
+    {
+ 
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setLayoutName
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setLayoutName( 
+        const QString & layoutName )
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setUniformItemSizes
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setUniformItemSizes( 
+        bool enable )
+    {
+    SMC_MOCK_METHOD1( void, bool, enable )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::uniformItemSizes
+// -----------------------------------------------------------------------------
+//
+bool HbAbstractItemView::uniformItemSizes(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setCurrentIndex
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setCurrentIndex( 
+        const QModelIndex & index,
+        QItemSelectionModel::SelectionFlags selectionFlag )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::setRootIndex
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::setRootIndex( 
+        const QModelIndex & index )
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::reset
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::reset(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::selectAll
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::selectAll(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::clearSelection
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::clearSelection(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::pressed
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::pressed( 
+        const QModelIndex & index )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::released
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::released( 
+        const QModelIndex & index )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::activated
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::activated( 
+        const QModelIndex & index )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::longPressed
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::longPressed( 
+        HbAbstractViewItem * item,
+        const QPointF & coords )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::selectionCommand
+// -----------------------------------------------------------------------------
+//
+QItemSelectionModel::SelectionFlags HbAbstractItemView::selectionCommand( 
+        const HbAbstractViewItem *item, 
+        const QEvent *event )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::event
+// -----------------------------------------------------------------------------
+//
+bool HbAbstractItemView::event( 
+        QEvent * e )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::mousePressEvent
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::mousePressEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::mouseReleaseEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::mouseMoveEvent
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::mouseMoveEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::focusOutEvent
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::focusOutEvent( 
+        QFocusEvent * event )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::upGesture
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::upGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::downGesture
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::downGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::leftGesture
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::leftGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::rightGesture
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::rightGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::emitActivated
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::emitActivated( 
+        const QModelIndex & modelIndex )
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::emitPressed
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::emitPressed( 
+        const QModelIndex & modelIndex )
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::emitReleased
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::emitReleased( 
+        const QModelIndex & modelIndex )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::scrollByAmount
+// -----------------------------------------------------------------------------
+//
+bool HbAbstractItemView::scrollByAmount( 
+        const QPointF & delta )
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::container
+// -----------------------------------------------------------------------------
+//
+HbAbstractItemContainer * HbAbstractItemView::container(  ) const
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbAbstractItemView::itemChange( 
+        GraphicsItemChange change,
+        const QVariant & value )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::dataChanged
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::dataChanged( 
+        const QModelIndex & topLeft,
+        const QModelIndex & bottomRight )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::orientationChanged
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::orientationChanged( 
+        Qt::Orientation newOrientation )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::orientationAboutToBeChanged
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::orientationAboutToBeChanged(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::currentIndexChanged
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::currentIndexChanged( 
+        const QModelIndex & current,
+        const QModelIndex & previous )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::currentSelectionChanged
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::currentSelectionChanged( 
+        const QItemSelection & selected,
+        const QItemSelection & deselected )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::rowsAboutToBeInserted
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::rowsAboutToBeInserted( 
+        const QModelIndex & index,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::rowsInserted
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::rowsInserted( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::rowsAboutToBeRemoved
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::rowsAboutToBeRemoved( 
+        const QModelIndex & index,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::rowsRemoved
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::rowsRemoved( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::columnsAboutToBeInserted
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::columnsAboutToBeInserted( 
+        const QModelIndex & index,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::columnsInserted
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::columnsInserted( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::columnsAboutToBeRemoved
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::columnsAboutToBeRemoved( 
+        const QModelIndex & index,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::columnsRemoved
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::columnsRemoved( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::panGesture
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::panGesture( 
+        const QPointF & point )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAbstractItemView::longPressGesture
+// -----------------------------------------------------------------------------
+//
+void HbAbstractItemView::longPressGesture( 
+        const QPointF & point )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbaction.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,169 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbaction.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        const QString & text,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        const HbIcon & icon,
+        const QString & text,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        Hb::SoftKeyAction action,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::~HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::~HbAction(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setIcon
+// -----------------------------------------------------------------------------
+//
+void HbAction::setIcon( 
+        const HbIcon & icon )
+    {
+ //   SMC_MOCK_METHOD1( void, const HbIcon &, icon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::icon
+// -----------------------------------------------------------------------------
+//
+HbIcon HbAction::icon(  ) const
+    {
+ //   SMC_MOCK_METHOD0( HbIcon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setMenu
+// -----------------------------------------------------------------------------
+//
+void HbAction::setMenu( 
+        HbMenu * menu )
+    {
+ //   SMC_MOCK_METHOD1( void, HbMenu *, menu )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::menu
+// -----------------------------------------------------------------------------
+//
+HbMenu * HbAction::menu(  ) const
+    {
+ //   SMC_MOCK_METHOD0( HbMenu * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setToolBarExtension
+// -----------------------------------------------------------------------------
+//
+void HbAction::setToolBarExtension( 
+        HbToolBarExtension * extension )
+    {
+//    SMC_MOCK_METHOD1( void, HbToolBarExtension *, extension )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::toolBarExtension
+// -----------------------------------------------------------------------------
+//
+HbToolBarExtension * HbAction::toolBarExtension(  ) const
+    {
+//    SMC_MOCK_METHOD0( HbToolBarExtension * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::setCommandRole
+// -----------------------------------------------------------------------------
+//
+void HbAction::setCommandRole( 
+        HbAction::CommandRole commandRole )
+    {
+ //   SMC_MOCK_METHOD1( void, CommandRole, commandRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::commandRole
+// -----------------------------------------------------------------------------
+//
+HbAction::CommandRole HbAction::commandRole(  ) const
+    {
+ //   SMC_MOCK_METHOD0( CommandRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbAction::HbAction
+// -----------------------------------------------------------------------------
+//
+HbAction::HbAction( 
+        HbActionPrivate & dd,
+        QObject * parent )
+    : QAction( parent ), d_ptr(NULL)
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbcheckbox.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QDebug>
+#include <hbcheckbox.h>
+#include <hbstyleoptioncheckbox.h>
+#include <QGraphicsSceneMouseEvent>
+#include <QGraphicsItem>
+#include <smcmockclassincludes.h>
+#include "hbcheckbox.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::HbCheckBox
+// -----------------------------------------------------------------------------
+//
+HbCheckBox::HbCheckBox( 
+        const QString & text,
+        QGraphicsItem * parent )
+    :
+    HbAbstractButton( parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::~HbCheckBox
+// -----------------------------------------------------------------------------
+//
+HbCheckBox::~HbCheckBox(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::setText
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::setText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::text
+// -----------------------------------------------------------------------------
+//
+QString HbCheckBox::text(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::setTristate
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::setTristate( 
+        bool isTristate )
+    {
+    SMC_MOCK_METHOD1( void, bool, isTristate )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::isTristate
+// -----------------------------------------------------------------------------
+//
+bool HbCheckBox::isTristate(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::checkState
+// -----------------------------------------------------------------------------
+//
+Qt::CheckState HbCheckBox::checkState(  ) const
+    {
+    SMC_MOCK_METHOD0( Qt::CheckState )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::primitive
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbCheckBox::primitive( 
+        HbStyle::Primitive primitive ) const
+    {
+    SMC_MOCK_METHOD1( QGraphicsItem *, HbStyle::Primitive, primitive )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::setCheckState
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::setCheckState( 
+        Qt::CheckState state )
+    {
+    SMC_MOCK_METHOD1( void, Qt::CheckState, state )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::updatePrimitives
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::updatePrimitives(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::initStyleOption
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::initStyleOption( 
+        HbStyleOptionCheckBox * option ) const
+    {
+    SMC_MOCK_METHOD1( void, HbStyleOptionCheckBox *, option )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::resizeEvent( 
+        QGraphicsSceneResizeEvent * event )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsSceneResizeEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::hitButton
+// -----------------------------------------------------------------------------
+//
+bool HbCheckBox::hitButton( 
+        const QPointF & pos ) const
+    {
+    SMC_MOCK_METHOD1( bool, const QPointF &, pos )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::checkStateSet
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::checkStateSet(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::nextCheckState
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::nextCheckState(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::mouseReleaseEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::mouseMoveEvent
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::mouseMoveEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::keyPressEvent
+// -----------------------------------------------------------------------------
+//
+void HbCheckBox::keyPressEvent( 
+        QKeyEvent * keyEvent )
+    {
+    SMC_MOCK_METHOD1( void, QKeyEvent *, keyEvent )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbCheckBox::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbCheckBox::itemChange( 
+        GraphicsItemChange change,
+        const QVariant & value )
+    {
+    SMC_MOCK_METHOD2( QVariant, GraphicsItemChange, change, 
+        const QVariant &, value )
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbdataform.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "hbdataform.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbDataForm::HbDataForm
+// -----------------------------------------------------------------------------
+//
+HbAbstractItemViewPrivate* temp(NULL);
+HbAbstractItemContainer* temp2(NULL);
+
+HbDataForm::HbDataForm( 
+        HbDataFormPrivate & /*dd*/,
+        HbAbstractItemContainer * /*container*/,
+        QGraphicsItem * parent ) : HbAbstractItemView( *temp, temp2, parent)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::Q_PROPERTY
+// -----------------------------------------------------------------------------
+//
+/*
+void HbDataForm::Q_PROPERTY( 
+        QString heading READ heading WRITE setHeading ) Q_PROPERTY ( QString description READ description WRITE setDescription ):HbDataForm ( QGraphicsItem * parent )
+    {
+    SMC_MOCK_METHOD1( void, QString heading READ heading WRITE setHeading ) Q_PROPERTY ( QString description READ description WRITE setDescription ):HbDataForm ( QGraphicsItem *, parent )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// HbDataForm::~HbDataForm
+// -----------------------------------------------------------------------------
+//
+HbDataForm::~HbDataForm(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::type
+// -----------------------------------------------------------------------------
+//
+/*
+int HbDataForm::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }*/
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::scrollTo
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::scrollTo( 
+        const QModelIndex & index,
+        ScrollHint hint )
+    {
+  //  SMC_MOCK_METHOD2( void, const QModelIndex &, index, 
+    //    ScrollHint, hint )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::indexCount
+// -----------------------------------------------------------------------------
+//
+int HbDataForm::indexCount(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::nextIndex
+// -----------------------------------------------------------------------------
+//
+QModelIndex HbDataForm::nextIndex( 
+        const QModelIndex & index ) const
+    {
+//    SMC_MOCK_METHOD1( QModelIndex, const QModelIndex &, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::previousIndex
+// -----------------------------------------------------------------------------
+//
+QModelIndex HbDataForm::previousIndex( 
+        const QModelIndex & index ) const
+    {
+//    SMC_MOCK_METHOD1( QModelIndex, const QModelIndex &, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::setExpanded
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::setExpanded( 
+        const QModelIndex & index,
+        bool expanded )
+    {
+ //   SMC_MOCK_METHOD2( void, const QModelIndex &, index, 
+   //     bool, expanded )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::isExpanded
+// -----------------------------------------------------------------------------
+//
+bool HbDataForm::isExpanded( 
+        const QModelIndex & index ) const
+    {
+  //  SMC_MOCK_METHOD1( bool, const QModelIndex &, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::setHeading
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::setHeading( 
+        const QString & heading )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, heading )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::heading
+// -----------------------------------------------------------------------------
+//
+QString HbDataForm::heading(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::setDescription
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::setDescription( 
+        const QString & description )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, description )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::description
+// -----------------------------------------------------------------------------
+//
+QString HbDataForm::description(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::primitive
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbDataForm::primitive( 
+        HbStyle::Primitive primitive ) const
+    {
+ //   SMC_MOCK_METHOD1( QGraphicsItem *, HbStyle::Primitive, primitive )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::dataFormViewItem
+// -----------------------------------------------------------------------------
+//
+HbDataFormViewItem * HbDataForm::dataFormViewItem( 
+        const QModelIndex & index ) const
+    {
+  //  SMC_MOCK_METHOD1( HbDataFormViewItem *, const QModelIndex &, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::setModel
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::setModel( 
+        QAbstractItemModel * model,
+        HbAbstractViewItem * prototype )
+    {
+//    SMC_MOCK_METHOD2( void, QAbstractItemModel *, model, 
+  //      HbAbstractViewItem *, prototype )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::addConnection
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::addConnection( 
+        HbDataFormModelItem * item,
+        const char * signal,
+        QObject * receiver,
+        const char * slot )
+    {
+ /*   SMC_MOCK_METHOD4( void, HbDataFormModelItem *, item, 
+        const char *, signal, 
+        QObject *, receiver, 
+        const char *, slot )
+   */ }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::removeConnection
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::removeConnection( 
+        HbDataFormModelItem * item,
+        const char * signal,
+        QObject * receiver,
+        const char * slot )
+    {
+ /*   SMC_MOCK_METHOD4( void, HbDataFormModelItem *, item, 
+        const char *, signal, 
+        QObject *, receiver, 
+        const char *, slot )
+   */ }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::removeAllConnection
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::removeAllConnection(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::removeAllConnection
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::removeAllConnection( 
+        HbDataFormModelItem * item )
+    {
+//    SMC_MOCK_METHOD1( void, HbDataFormModelItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::loadSettings
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::loadSettings(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::storeSettings
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::storeSettings(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::itemShown
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::itemShown( 
+        const QModelIndex & index )
+    {
+   // SMC_MOCK_METHOD1( void, const QModelIndex &, index )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::rowsInserted
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::rowsInserted( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+//    SMC_MOCK_METHOD3( void, const QModelIndex &, parent, 
+  //      int, start, 
+    //    int, end )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::rowsAboutToBeRemoved
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::rowsAboutToBeRemoved( 
+        const QModelIndex & index,
+        int start,
+        int end )
+    {
+//    SMC_MOCK_METHOD3( void, const QModelIndex &, index, 
+  //      int, start, 
+    //    int, end )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::dataChanged
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::dataChanged( 
+        const QModelIndex & topLeft,
+        const QModelIndex & bottomRight )
+    {
+  //  SMC_MOCK_METHOD2( void, const QModelIndex &, topLeft, 
+    //    const QModelIndex &, bottomRight )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDataForm::initStyleOption
+// -----------------------------------------------------------------------------
+//
+void HbDataForm::initStyleOption( 
+        HbStyleOptionDataForm * option )
+    {
+ //   SMC_MOCK_METHOD1( void, HbStyleOptionDataForm *, option )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbdialog.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,209 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbdialog.h>
+#include <HbAction.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbDialog::HbDialog
+// -----------------------------------------------------------------------------
+//
+HbDialog::HbDialog( 
+        QGraphicsItem * parent )
+    //:
+    //HbPopup( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::~HbDialog
+// -----------------------------------------------------------------------------
+//
+HbDialog::~HbDialog(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::headingWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbDialog::headingWidget(  ) const
+    {
+    SMC_MOCK_METHOD0( QGraphicsWidget * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::setHeadingWidget
+// -----------------------------------------------------------------------------
+//
+void HbDialog::setHeadingWidget( 
+        QGraphicsWidget * headingWidget )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsWidget *, headingWidget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::contentWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbDialog::contentWidget(  ) const
+    {
+    SMC_MOCK_METHOD0( QGraphicsWidget * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::setContentWidget
+// -----------------------------------------------------------------------------
+//
+void HbDialog::setContentWidget( 
+        QGraphicsWidget * contentWidget )
+    {
+    SMC_MOCK_METHOD1( void, QGraphicsWidget *, contentWidget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::primaryAction
+// -----------------------------------------------------------------------------
+//
+HbAction * HbDialog::primaryAction(  ) const
+    {
+    SMC_MOCK_METHOD0( HbAction * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::setPrimaryAction
+// -----------------------------------------------------------------------------
+//
+void HbDialog::setPrimaryAction( 
+        HbAction * action )
+    {
+    //SMC_MOCK_METHOD1( void, HbAction *, action )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::secondaryAction
+// -----------------------------------------------------------------------------
+//
+HbAction * HbDialog::secondaryAction(  ) const
+    {
+ //   SMC_MOCK_METHOD0( HbAction * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::setSecondaryAction
+// -----------------------------------------------------------------------------
+//
+void HbDialog::setSecondaryAction( 
+        HbAction * action )
+    {
+  //  SMC_MOCK_METHOD1( void, HbAction *, action )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::type
+// -----------------------------------------------------------------------------
+//
+/*
+int HbDialog::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// HbDialog::exec
+// -----------------------------------------------------------------------------
+//
+HbAction * HbDialog::exec(  )
+    {
+  //  SMC_MOCK_METHOD0( HbAction * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::HbDialog
+// -----------------------------------------------------------------------------
+//
+HbDialog::HbDialog( 
+        HbDialogPrivate & dd,
+        QGraphicsItem * parent )
+    //:
+    //HbPopup( /*dd, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::focusInEvent
+// -----------------------------------------------------------------------------
+//
+void HbDialog::focusInEvent( 
+        QFocusEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( void, QFocusEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::closeEvent
+// -----------------------------------------------------------------------------
+//
+void HbDialog::closeEvent( 
+        QCloseEvent * event )
+    {
+ //   SMC_MOCK_METHOD1( void, QCloseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::changeEvent
+// -----------------------------------------------------------------------------
+//
+void HbDialog::changeEvent( 
+        QEvent * event )
+    {
+   // SMC_MOCK_METHOD1( void, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbDialog::event
+// -----------------------------------------------------------------------------
+//
+bool HbDialog::event( 
+        QEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( bool, QEvent *, event )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbicon.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,307 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbicon.h>
+
+class HbIconPrivate
+{
+public:
+    HbIconPrivate(){};
+    ~HbIconPrivate(){};
+    
+    QAtomicInt ref;
+};
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbIcon::HbIcon
+// -----------------------------------------------------------------------------
+//
+HbIcon::HbIcon(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::HbIcon
+// -----------------------------------------------------------------------------
+//
+HbIcon::HbIcon( 
+        const QString & iconName )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::HbIcon
+// -----------------------------------------------------------------------------
+//
+HbIcon::HbIcon( 
+        const QIcon & icon )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::HbIcon
+// -----------------------------------------------------------------------------
+//
+HbIcon::HbIcon( 
+        const HbIcon & other )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// HbIcon::~HbIcon
+// -----------------------------------------------------------------------------
+//
+HbIcon::~HbIcon(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::isNull
+// -----------------------------------------------------------------------------
+//
+bool HbIcon::isNull(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::clear
+// -----------------------------------------------------------------------------
+//
+void HbIcon::clear(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::pixmap
+// -----------------------------------------------------------------------------
+//
+QPixmap HbIcon::pixmap(  )
+    {
+//    SMC_MOCK_METHOD0( QPixmap )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::setColor
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setColor( 
+        const QColor & color )
+    {
+//    SMC_MOCK_METHOD1( void, const QColor &, color )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::color
+// -----------------------------------------------------------------------------
+//
+QColor HbIcon::color(  ) const
+    {
+//    SMC_MOCK_METHOD0( QColor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::iconName
+// -----------------------------------------------------------------------------
+//
+QString HbIcon::iconName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::setIconName
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setIconName( 
+        const QString & iconName )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, iconName )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::iconName
+// -----------------------------------------------------------------------------
+//
+QString HbIcon::iconName( 
+        QIcon::Mode mode,
+        QIcon::State state ) const
+    {
+//    SMC_MOCK_METHOD2( QString, QIcon::Mode, mode, 
+//        QIcon::State, state )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::setIconName
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setIconName( 
+        const QString & iconName,
+        QIcon::Mode mode,
+        QIcon::State state )
+    {
+//    SMC_MOCK_METHOD3( void, const QString &, iconName, 
+//        QIcon::Mode, mode, 
+//        QIcon::State, state )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::defaultSize
+// -----------------------------------------------------------------------------
+//
+QSizeF HbIcon::defaultSize(  ) const
+    {
+//    SMC_MOCK_METHOD0( QSizeF )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::size
+// -----------------------------------------------------------------------------
+//
+QSizeF HbIcon::size(  ) const
+    {
+//    SMC_MOCK_METHOD0( QSizeF )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::setSize
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setSize( 
+        const QSizeF & size )
+    {
+//    SMC_MOCK_METHOD1( void, const QSizeF &, size )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::setHeight
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setHeight( 
+        qreal height )
+    {
+//    SMC_MOCK_METHOD1( void, qreal, height )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::setWidth
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setWidth( 
+        qreal width )
+    {
+//    SMC_MOCK_METHOD1( void, qreal, width )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::width
+// -----------------------------------------------------------------------------
+//
+qreal HbIcon::width(  ) const
+    {
+//    SMC_MOCK_METHOD0( qreal )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::height
+// -----------------------------------------------------------------------------
+//
+qreal HbIcon::height(  ) const
+    {
+//    SMC_MOCK_METHOD0( qreal )
+    }
+
+// -----------------------------------------------------------------------------
+// HbIcon::setMirroringMode
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setMirroringMode( 
+        MirroringMode mode )
+    {
+//    SMC_MOCK_METHOD1( void, MirroringMode, mode )
+    }
+
+// -----------------------------------------------------------------------------
+// HbIcon::setFlags
+// -----------------------------------------------------------------------------
+//
+void HbIcon::setFlags( 
+        Flags flags )
+    {
+//    SMC_MOCK_METHOD1( void, Flags, flags )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::paint
+// -----------------------------------------------------------------------------
+//
+void HbIcon::paint( 
+        QPainter * painter,
+        const QRectF & rect,
+        Qt::AspectRatioMode aspectRatioMode,
+        Qt::Alignment alignment,
+        QIcon::Mode mode,
+        QIcon::State state ) const
+    {
+/*    SMC_MOCK_METHOD6( void, QPainter *, painter, 
+        const QRectF &, rect, 
+        Qt::AspectRatioMode, aspectRatioMode, 
+        Qt::Alignment, alignment, 
+        QIcon::Mode, mode, 
+        QIcon::State, state )*/
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbIcon::qicon
+// -----------------------------------------------------------------------------
+//
+QIcon & HbIcon::qicon(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QIcon & )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblabel.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,309 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hblabel.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::HbLabel
+// -----------------------------------------------------------------------------
+//
+HbLabel::HbLabel( 
+        const QString & displayText,
+        QGraphicsItem * parent )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::~HbLabel
+// -----------------------------------------------------------------------------
+//
+HbLabel::~HbLabel(  )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::plainText
+// -----------------------------------------------------------------------------
+//
+QString HbLabel::plainText(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::html
+// -----------------------------------------------------------------------------
+//
+QString HbLabel::html(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setElideMode
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setElideMode( 
+        Qt::TextElideMode elideMode )
+    {
+   // SMC_MOCK_METHOD1( void, Qt::TextElideMode, elideMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::elideMode
+// -----------------------------------------------------------------------------
+//
+Qt::TextElideMode HbLabel::elideMode(  ) const
+    {
+   // SMC_MOCK_METHOD0( Qt::TextElideMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setTextWrapping
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setTextWrapping( 
+        Hb::TextWrapping mode )
+    {
+  //  SMC_MOCK_METHOD1( void, Hb::TextWrapping, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::textWrapping
+// -----------------------------------------------------------------------------
+//
+Hb::TextWrapping HbLabel::textWrapping(  ) const
+    {
+   // SMC_MOCK_METHOD0( Hb::TextWrapping )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setIcon
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setIcon( 
+        const HbIcon & icon )
+    {
+  //  SMC_MOCK_METHOD1( void, const HbIcon &, icon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::icon
+// -----------------------------------------------------------------------------
+//
+HbIcon HbLabel::icon(  ) const
+    {
+   // SMC_MOCK_METHOD0( HbIcon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setAspectRatioMode
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setAspectRatioMode( 
+        Qt::AspectRatioMode mode )
+    {
+    //SMC_MOCK_METHOD1( void, Qt::AspectRatioMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::aspectRatioMode
+// -----------------------------------------------------------------------------
+//
+Qt::AspectRatioMode HbLabel::aspectRatioMode(  ) const
+    {
+   // SMC_MOCK_METHOD0( Qt::AspectRatioMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setAlignment
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setAlignment( 
+        Qt::Alignment alignment )
+    {
+   // SMC_MOCK_METHOD1( void, Qt::Alignment, alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::alignment
+// -----------------------------------------------------------------------------
+//
+Qt::Alignment HbLabel::alignment(  ) const
+    {
+   // SMC_MOCK_METHOD0( Qt::Alignment )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setTextColor
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setTextColor( 
+        const QColor & textColor )
+    {
+   // SMC_MOCK_METHOD1( void, const QColor &, textColor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::textColor
+// -----------------------------------------------------------------------------
+//
+QColor HbLabel::textColor(  ) const
+    {
+  //  SMC_MOCK_METHOD0( QColor )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::isEmpty
+// -----------------------------------------------------------------------------
+//
+bool HbLabel::isEmpty(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::primitive
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbLabel::primitive( 
+        HbStyle::Primitive primitive ) const
+    {
+ //   SMC_MOCK_METHOD1( QGraphicsItem *, HbStyle::Primitive, primitive )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::type
+// -----------------------------------------------------------------------------
+//
+int HbLabel::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setPlainText
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setPlainText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setHtml
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setHtml( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setNumber
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setNumber( 
+        int number )
+    {
+    SMC_MOCK_METHOD1( void, int, number )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::setNumber
+// -----------------------------------------------------------------------------
+//
+void HbLabel::setNumber( 
+        qreal number )
+    {
+    SMC_MOCK_METHOD1( void, qreal, number )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::updatePrimitives
+// -----------------------------------------------------------------------------
+//
+void HbLabel::updatePrimitives(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::clear
+// -----------------------------------------------------------------------------
+//
+void HbLabel::clear(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::HbLabel
+// -----------------------------------------------------------------------------
+//
+HbLabel::HbLabel( 
+        HbLabelPrivate & dd,
+        QGraphicsItem * parent )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbLabel::initStyleOption
+// -----------------------------------------------------------------------------
+//
+void HbLabel::initStyleOption( 
+        HbStyleOptionLabel * option ) const
+    {
+//    SMC_MOCK_METHOD1( void, HbStyleOptionLabel *, option )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistview.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hblistview.h>
+#include <hbabstractitemview.h>
+#include <hbabstractitemcontainer.h>
+
+HbAbstractItemViewPrivate *pointerHbAbstractItemViewPrivate(NULL);
+HbAbstractItemContainer *pointerHbAbstractItemContainer(NULL);
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbListView::HbListView
+// -----------------------------------------------------------------------------
+//
+HbListView::HbListView( 
+        HbListViewPrivate & dd,
+        HbAbstractItemContainer * container,
+        QGraphicsItem * parent )
+    : HbAbstractItemView( *pointerHbAbstractItemViewPrivate, pointerHbAbstractItemContainer, parent )
+    {
+    
+    }
+
+HbListView::HbListView(QGraphicsItem *parent)
+    : HbAbstractItemView( *pointerHbAbstractItemViewPrivate, pointerHbAbstractItemContainer, parent )
+		{
+		
+		}
+
+// -----------------------------------------------------------------------------
+// HbListView::~HbListView
+// -----------------------------------------------------------------------------
+//
+HbListView::~HbListView(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::type
+// -----------------------------------------------------------------------------
+//
+
+int HbListView::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::listItemPrototype
+// -----------------------------------------------------------------------------
+//
+HbListViewItem * HbListView::listItemPrototype(  ) const
+    {
+   //  SMC_MOCK_METHOD0( HbListViewItem * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::arrangeMode
+// -----------------------------------------------------------------------------
+//
+bool HbListView::arrangeMode(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::setArrangeMode
+// -----------------------------------------------------------------------------
+//
+bool HbListView::setArrangeMode( 
+        bool arrangeMode )
+    {
+    SMC_MOCK_METHOD1( bool, bool, arrangeMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::viewItem
+// -----------------------------------------------------------------------------
+//
+HbAbstractViewItem * HbListView::viewItem( 
+        int row ) const
+    {
+  //   SMC_MOCK_METHOD1( HbAbstractViewItem *, int, row )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::scrollTo
+// -----------------------------------------------------------------------------
+//
+void HbListView::scrollTo( 
+        const QModelIndex & index,
+        ScrollHint hint )
+    {
+   //  SMC_MOCK_METHOD2( void, const QModelIndex &, index, 
+  //       ScrollHint, hint )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::rowsInserted
+// -----------------------------------------------------------------------------
+//
+void HbListView::rowsInserted( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+  //   SMC_MOCK_METHOD3( void, const QModelIndex &, parent, 
+  //       int, start, 
+  //       int, end )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::rowsAboutToBeRemoved
+// -----------------------------------------------------------------------------
+//
+void HbListView::rowsAboutToBeRemoved( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+  //   SMC_MOCK_METHOD3( void, const QModelIndex &, parent, 
+ //        int, start, 
+ //        int, end )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::rowsRemoved
+// -----------------------------------------------------------------------------
+//
+void HbListView::rowsRemoved( 
+        const QModelIndex & parent,
+        int start,
+        int end )
+    {
+ //    SMC_MOCK_METHOD3( void, const QModelIndex &, parent, 
+ //        int, start, 
+  //       int, end )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::dataChanged
+// -----------------------------------------------------------------------------
+//
+void HbListView::dataChanged( 
+        const QModelIndex & topLeft,
+        const QModelIndex & bottomRight )
+    {
+ //    SMC_MOCK_METHOD2( void, const QModelIndex &, topLeft, 
+ //        const QModelIndex &, bottomRight )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::orientationChanged
+// -----------------------------------------------------------------------------
+//
+void HbListView::orientationChanged( 
+        Qt::Orientation newOrientation )
+    {
+  //   SMC_MOCK_METHOD1( void, Qt::Orientation, newOrientation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::mousePressEvent
+// -----------------------------------------------------------------------------
+//
+void HbListView::mousePressEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+  //   SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void HbListView::mouseReleaseEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+  //   SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::mouseMoveEvent
+// -----------------------------------------------------------------------------
+//
+void HbListView::mouseMoveEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+  //   SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::move
+// -----------------------------------------------------------------------------
+//
+void HbListView::move( 
+        const QModelIndex & from,
+        const QModelIndex & to )
+    {
+   //  SMC_MOCK_METHOD2( void, const QModelIndex &, from, 
+  //       const QModelIndex &, to )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListView::scrolling
+// -----------------------------------------------------------------------------
+//
+void HbListView::scrolling( 
+        QPointF newPosition )
+    {
+   //  SMC_MOCK_METHOD1( void, QPointF, newPosition )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistwidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,333 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hblistwidget.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbListWidget::HbListWidget
+// -----------------------------------------------------------------------------
+//
+HbListWidget::HbListWidget( 
+        HbListWidgetPrivate & dd,
+        HbAbstractItemContainer * container,
+        QGraphicsItem * parent )
+    :
+    HbListView( parent )
+    {
+    
+    }
+    
+HbListWidget::HbListWidget(QGraphicsItem *parent)
+    : HbListView( parent )
+		{
+		
+		}
+
+// -----------------------------------------------------------------------------
+// HbListWidget::~HbListWidget
+// -----------------------------------------------------------------------------
+//
+HbListWidget::~HbListWidget(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::count
+// -----------------------------------------------------------------------------
+//
+int HbListWidget::count(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::currentRow
+// -----------------------------------------------------------------------------
+//
+int HbListWidget::currentRow(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::setCurrentRow
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::setCurrentRow( 
+        int row )
+    {
+    SMC_MOCK_METHOD1( void, int, row )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::currentItem
+// -----------------------------------------------------------------------------
+//
+HbListWidgetItem * HbListWidget::currentItem(  ) const
+    {
+  //  SMC_MOCK_METHOD0( HbListWidgetItem * )
+    return NULL;
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::setCurrentItem
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::setCurrentItem( 
+        HbListWidgetItem * item )
+    {
+  //   SMC_MOCK_METHOD1( void, HbListWidgetItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::item
+// -----------------------------------------------------------------------------
+//
+HbListWidgetItem * HbListWidget::item( 
+        int row ) const
+    {
+  //   SMC_MOCK_METHOD1( HbListWidgetItem *, int, row )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::row
+// -----------------------------------------------------------------------------
+//
+int HbListWidget::row( 
+        const HbListWidgetItem * item ) const
+    {
+   //  SMC_MOCK_METHOD1( int, const HbListWidgetItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::addItem
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::addItem( 
+        const HbIcon & icon,
+        const QString & text )
+    {
+  //   SMC_MOCK_METHOD2( void, const HbIcon &, icon, 
+   //      const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::addItem
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::addItem( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::addItem
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::addItem( 
+        HbListWidgetItem * item )
+    {
+  //   SMC_MOCK_METHOD1( void, HbListWidgetItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::insertItem
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::insertItem( 
+        int row,
+        const HbIcon & icon,
+        const QString & text )
+    {
+ //    SMC_MOCK_METHOD3( void, int, row, 
+ //        const HbIcon &, icon, 
+ //        const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::insertItem
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::insertItem( 
+        int row,
+        const QString & text )
+    {
+    SMC_MOCK_METHOD2( void, int, row, 
+        const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::insertItem
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::insertItem( 
+        int row,
+        HbListWidgetItem * item )
+    {
+  //   SMC_MOCK_METHOD2( void, int, row, 
+  //       HbListWidgetItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::setText
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::setText( 
+        int row,
+        const QString & text )
+    {
+    SMC_MOCK_METHOD2( void, int, row, 
+        const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::setIcon
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::setIcon( 
+        int row,
+        const HbIcon & icon )
+    {
+ //    SMC_MOCK_METHOD2( void, int, row, 
+  //       const HbIcon &, icon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::takeItem
+// -----------------------------------------------------------------------------
+//
+HbListWidgetItem * HbListWidget::takeItem( 
+        int row )
+    {
+  //   SMC_MOCK_METHOD1( HbListWidgetItem *, int, row )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::setArrangeMode
+// -----------------------------------------------------------------------------
+//
+bool HbListWidget::setArrangeMode( 
+        bool arrangeMode )
+    {
+    SMC_MOCK_METHOD1( bool, bool, arrangeMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::clear
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::clear(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::setModel
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::setModel( 
+        QAbstractItemModel * model,
+        HbAbstractViewItem * prototype )
+    {
+  //   SMC_MOCK_METHOD2( void, QAbstractItemModel *, model, 
+ //        HbAbstractViewItem *, prototype )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::activated
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::activated( 
+        HbListWidgetItem * item )
+    {
+ //    SMC_MOCK_METHOD1( void, HbListWidgetItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::pressed
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::pressed( 
+        HbListWidgetItem * item )
+    {
+  //   SMC_MOCK_METHOD1( void, HbListWidgetItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::released
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::released( 
+        HbListWidgetItem * item )
+    {
+  //   SMC_MOCK_METHOD1( void, HbListWidgetItem *, item )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::longPressed
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::longPressed( 
+        HbListWidgetItem * item,
+        const QPointF & coords )
+    {
+  //   SMC_MOCK_METHOD2( void, HbListWidgetItem *, item, 
+  //       const QPointF &, coords )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidget::move
+// -----------------------------------------------------------------------------
+//
+void HbListWidget::move( 
+        const QModelIndex & from,
+        const QModelIndex & to )
+    {
+  //   SMC_MOCK_METHOD2( void, const QModelIndex &, from, 
+   //      const QModelIndex &, to )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hblistwidgetitem.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <hblistwidgetitem.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::HbListWidgetItem
+// -----------------------------------------------------------------------------
+//
+HbListWidgetItem::HbListWidgetItem( 
+        int type )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::~HbListWidgetItem
+// -----------------------------------------------------------------------------
+//
+HbListWidgetItem::~HbListWidgetItem(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::data
+// -----------------------------------------------------------------------------
+//
+QVariant HbListWidgetItem::data( 
+        int role ) const
+    {
+ //   SMC_MOCK_METHOD1( QVariant, int, role )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::setData
+// -----------------------------------------------------------------------------
+//
+void HbListWidgetItem::setData( 
+        const QVariant & value,
+        int role )
+    {
+//    SMC_MOCK_METHOD2( void, const QVariant &, value, 
+//        int, role )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::text
+// -----------------------------------------------------------------------------
+//
+QString HbListWidgetItem::text(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::setText
+// -----------------------------------------------------------------------------
+//
+void HbListWidgetItem::setText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::secondaryText
+// -----------------------------------------------------------------------------
+//
+QString HbListWidgetItem::secondaryText(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::setSecondaryText
+// -----------------------------------------------------------------------------
+//
+void HbListWidgetItem::setSecondaryText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::setEnabled
+// -----------------------------------------------------------------------------
+//
+void HbListWidgetItem::setEnabled( 
+        bool enabled )
+    {
+    SMC_MOCK_METHOD1( void, bool, enabled )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::isEnabled
+// -----------------------------------------------------------------------------
+//
+bool HbListWidgetItem::isEnabled(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbListWidgetItem::type
+// -----------------------------------------------------------------------------
+//
+int HbListWidgetItem::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbpopup.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,352 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbpopup.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbPopup::HbPopup
+// -----------------------------------------------------------------------------
+//
+HbPopup::HbPopup( 
+        QGraphicsItem * parent )
+    //:
+    //HbWidget( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::Q_ENUMS
+// -----------------------------------------------------------------------------
+//
+/*
+void HbPopup::Q_ENUMS( 
+        DefaultTimeout DismissPolicy FrameType ) Q_PROPERTY ( int timeout READ timeout WRITE setTimeout ) Q_PROPERTY ( bool modal READ isModal WRITE setModal ) Q_PROPERTY ( bool backgroundFaded READ isBackgroundFaded WRITE setBackgroundFaded ) Q_PROPERTY ( DismissPolicy dismissPolicy READ dismissPolicy WRITE setDismissPolicy ) Q_PROPERTY ( FrameType frameType READ frameType WRITE setFrameType )
+    {
+    SMC_MOCK_METHOD1( void, DefaultTimeout DismissPolicy FrameType ) Q_PROPERTY ( int timeout READ timeout WRITE setTimeout ) Q_PROPERTY ( bool modal READ isModal WRITE setModal ) Q_PROPERTY ( bool backgroundFaded READ isBackgroundFaded WRITE setBackgroundFaded ) Q_PROPERTY ( DismissPolicy dismissPolicy READ dismissPolicy WRITE setDismissPolicy ) Q_PROPERTY ( FrameType frameType READ frameType WRITE, setFrameType )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// HbPopup::~HbPopup
+// -----------------------------------------------------------------------------
+//
+HbPopup::~HbPopup(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::timeout
+// -----------------------------------------------------------------------------
+//
+int HbPopup::timeout(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::setTimeout
+// -----------------------------------------------------------------------------
+//
+void HbPopup::setTimeout( 
+        int timeout )
+    {
+    SMC_MOCK_METHOD1( void, int, timeout )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::setTimeout
+// -----------------------------------------------------------------------------
+//
+void HbPopup::setTimeout( 
+        HbPopup::DefaultTimeout timeout )
+    {
+    SMC_MOCK_METHOD1( void, HbPopup::DefaultTimeout, timeout )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::isModal
+// -----------------------------------------------------------------------------
+//
+bool HbPopup::isModal(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::setModal
+// -----------------------------------------------------------------------------
+//
+void HbPopup::setModal( 
+        bool enabled )
+    {
+    SMC_MOCK_METHOD1( void, bool, enabled )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::setBackgroundFaded
+// -----------------------------------------------------------------------------
+//
+void HbPopup::setBackgroundFaded( 
+        bool fadeBackground )
+    {
+    SMC_MOCK_METHOD1( void, bool, fadeBackground )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::isBackgroundFaded
+// -----------------------------------------------------------------------------
+//
+bool HbPopup::isBackgroundFaded(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::dismissPolicy
+// -----------------------------------------------------------------------------
+//
+HbPopup::DismissPolicy HbPopup::dismissPolicy(  ) const
+    {
+    SMC_MOCK_METHOD0( DismissPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::setDismissPolicy
+// -----------------------------------------------------------------------------
+//
+void HbPopup::setDismissPolicy( 
+        HbPopup::DismissPolicy dismissPolicy )
+    {
+    SMC_MOCK_METHOD1( void, HbPopup::DismissPolicy, dismissPolicy )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::frameType
+// -----------------------------------------------------------------------------
+//
+HbPopup::FrameType HbPopup::frameType(  ) const
+    {
+    SMC_MOCK_METHOD0( FrameType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::setFrameType
+// -----------------------------------------------------------------------------
+//
+void HbPopup::setFrameType( 
+        HbPopup::FrameType frameType )
+    {
+    SMC_MOCK_METHOD1( void, HbPopup::FrameType, frameType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::type
+// -----------------------------------------------------------------------------
+//
+/*
+int HbPopup::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// HbPopup::setPreferredPos
+// -----------------------------------------------------------------------------
+//
+void HbPopup::setPreferredPos( 
+        const QPointF & position,
+        HbPopup::Placement placement )
+    {
+    //SMC_MOCK_METHOD2( void, const QPointF &, position, 
+      //  HbPopup::Placement, placement )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::exec
+// -----------------------------------------------------------------------------
+//
+void HbPopup::exec(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::aboutToShow
+// -----------------------------------------------------------------------------
+//
+void HbPopup::aboutToShow(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::aboutToHide
+// -----------------------------------------------------------------------------
+//
+void HbPopup::aboutToHide(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::aboutToClose
+// -----------------------------------------------------------------------------
+//
+void HbPopup::aboutToClose(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::HbPopup
+// -----------------------------------------------------------------------------
+//
+HbPopup::HbPopup( 
+        HbPopupPrivate & dd,
+        QGraphicsItem * parent )
+    //:
+    //HbWidget( /*dd, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbPopup::itemChange( 
+        GraphicsItemChange change,
+        const QVariant & value )
+    {
+  //  SMC_MOCK_METHOD2( QVariant, GraphicsItemChange, change, 
+    //    const QVariant &, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::mousePressEvent
+// -----------------------------------------------------------------------------
+//
+void HbPopup::mousePressEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+ //   SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void HbPopup::mouseReleaseEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+   // SMC_MOCK_METHOD1( void, QGraphicsSceneMouseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::keyPressEvent
+// -----------------------------------------------------------------------------
+//
+void HbPopup::keyPressEvent( 
+        QKeyEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QKeyEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::showEvent
+// -----------------------------------------------------------------------------
+//
+void HbPopup::showEvent( 
+        QShowEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QShowEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::hideEvent
+// -----------------------------------------------------------------------------
+//
+void HbPopup::hideEvent( 
+        QHideEvent * event )
+    {
+    //SMC_MOCK_METHOD1( void, QHideEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void HbPopup::resizeEvent( 
+        QGraphicsSceneResizeEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( void, QGraphicsSceneResizeEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::closeEvent
+// -----------------------------------------------------------------------------
+//
+void HbPopup::closeEvent( 
+        QCloseEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( void, QCloseEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbPopup::event
+// -----------------------------------------------------------------------------
+//
+bool HbPopup::event( 
+        QEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( bool, QEvent *, event )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbscrollarea.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,586 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbscrollarea.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::HbScrollArea
+// -----------------------------------------------------------------------------
+//
+HbScrollArea::HbScrollArea( 
+        HbScrollAreaPrivate & dd,
+        QGraphicsItem * parent )
+    //:
+    //HbWidget( /*dd, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::Q_PROPERTY
+// -----------------------------------------------------------------------------
+//
+/*
+void HbScrollArea::Q_PROPERTY( 
+        Qt::Orientations scrollDirections READ scrollDirections WRITE setScrollDirections ) Q_PROPERTY ( ClampingStyle clampingStyle READ clampingStyle WRITE setClampingStyle ) Q_PROPERTY ( ScrollingStyle scrollingStyle READ scrollingStyle WRITE setScrollingStyle ) Q_PROPERTY ( bool frictionEnabled READ frictionEnabled WRITE setFrictionEnabled ) Q_PROPERTY ( bool longPressEnabled READ longPressEnabled WRITE setLongPressEnabled ) Q_PROPERTY ( ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy WRITE setVerticalScrollBarPolicy ) Q_PROPERTY ( ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy WRITE setHorizontalScrollBarPolicy ) Q_PROPERTY ( Qt::Alignment alignment READ alignment WRITE setAlignment ) Q_PROPERTY ( bool continuationIndicators READ continuationIndicators WRITE setContinuationIndicators ) Q_ENUMS ( ClampingStyle ) Q_ENUMS ( ScrollingStyle ) Q_ENUMS ( ScrollBarPolicy ):HbScrollArea ( QGraphicsItem * parent )
+    {
+    SMC_MOCK_METHOD1( void, Qt::Orientations scrollDirections READ scrollDirections WRITE setScrollDirections ) Q_PROPERTY ( ClampingStyle clampingStyle READ clampingStyle WRITE setClampingStyle ) Q_PROPERTY ( ScrollingStyle scrollingStyle READ scrollingStyle WRITE setScrollingStyle ) Q_PROPERTY ( bool frictionEnabled READ frictionEnabled WRITE setFrictionEnabled ) Q_PROPERTY ( bool longPressEnabled READ longPressEnabled WRITE setLongPressEnabled ) Q_PROPERTY ( ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy WRITE setVerticalScrollBarPolicy ) Q_PROPERTY ( ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy WRITE setHorizontalScrollBarPolicy ) Q_PROPERTY ( Qt::Alignment alignment READ alignment WRITE setAlignment ) Q_PROPERTY ( bool continuationIndicators READ continuationIndicators WRITE setContinuationIndicators ) Q_ENUMS ( ClampingStyle ) Q_ENUMS ( ScrollingStyle ) Q_ENUMS ( ScrollBarPolicy ):HbScrollArea ( QGraphicsItem *, parent )
+    }*/
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::~HbScrollArea
+// -----------------------------------------------------------------------------
+//
+HbScrollArea::~HbScrollArea(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::contentWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbScrollArea::contentWidget(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setContentWidget
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setContentWidget( 
+        QGraphicsWidget * widget )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::takeContentWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbScrollArea::takeContentWidget(  )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::clampingStyle
+// -----------------------------------------------------------------------------
+//
+HbScrollArea::ClampingStyle HbScrollArea::clampingStyle(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setClampingStyle
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setClampingStyle( 
+        ClampingStyle value )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollingStyle
+// -----------------------------------------------------------------------------
+//
+HbScrollArea::ScrollingStyle HbScrollArea::scrollingStyle(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setScrollingStyle
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setScrollingStyle( 
+        ScrollingStyle value )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollDirections
+// -----------------------------------------------------------------------------
+//
+Qt::Orientations HbScrollArea::scrollDirections(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setScrollDirections
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setScrollDirections( 
+        Qt::Orientations value )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::frictionEnabled
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::frictionEnabled(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setFrictionEnabled
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setFrictionEnabled( 
+        bool value )
+    {
+    SMC_MOCK_METHOD1( void, bool, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::longPressEnabled
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::longPressEnabled(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setLongPressEnabled
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setLongPressEnabled( 
+        bool value )
+    {
+    SMC_MOCK_METHOD1( void, bool, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::verticalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+HbScrollArea::ScrollBarPolicy HbScrollArea::verticalScrollBarPolicy(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setVerticalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setVerticalScrollBarPolicy( 
+        HbScrollArea::ScrollBarPolicy policy )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::verticalScrollBar
+// -----------------------------------------------------------------------------
+//
+HbScrollBar * HbScrollArea::verticalScrollBar(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setVerticalScrollBar
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setVerticalScrollBar( 
+        HbScrollBar * scrollBar )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::horizontalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+HbScrollArea::ScrollBarPolicy HbScrollArea::horizontalScrollBarPolicy(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setHorizontalScrollBarPolicy
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setHorizontalScrollBarPolicy( 
+        HbScrollArea::ScrollBarPolicy policy )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::horizontalScrollBar
+// -----------------------------------------------------------------------------
+//
+HbScrollBar * HbScrollArea::horizontalScrollBar(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setHorizontalScrollBar
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setHorizontalScrollBar( 
+        HbScrollBar * scrollBar )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::alignment
+// -----------------------------------------------------------------------------
+//
+Qt::Alignment HbScrollArea::alignment(  ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setAlignment
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setAlignment( 
+        Qt::Alignment alignment )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::continuationIndicators
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::continuationIndicators(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::setContinuationIndicators
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::setContinuationIndicators( 
+        bool indication )
+    {
+    SMC_MOCK_METHOD1( void, bool, indication )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::isScrolling
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::isScrolling(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::isDragging
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::isDragging(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::ensureVisible
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::ensureVisible( 
+        const QPointF & position,
+        qreal xMargin,
+        qreal yMargin )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollContentsTo
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::scrollContentsTo( 
+        const QPointF & newPosition,
+        int time )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::mousePressEvent
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::mousePressEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::mouseReleaseEvent
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::mouseReleaseEvent( 
+        QGraphicsSceneMouseEvent * event )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::sizeHint
+// -----------------------------------------------------------------------------
+//
+QSizeF HbScrollArea::sizeHint( 
+        Qt::SizeHint which,
+        const QSizeF & constraint ) const
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbScrollArea::itemChange( 
+        GraphicsItemChange change,
+        const QVariant & value )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::event
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::event( 
+        QEvent * event )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::focusOutEvent
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::focusOutEvent( 
+        QFocusEvent * event )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollByAmount
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::scrollByAmount( 
+        const QPointF & delta )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::polish
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::polish( 
+        HbStyleParameters & params )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::eventFilter
+// -----------------------------------------------------------------------------
+//
+bool HbScrollArea::eventFilter( 
+        QObject * obj,
+        QEvent * event )
+    {
+  
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollingStarted
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::scrollingStarted(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollingEnded
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::scrollingEnded(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollDirectionsChanged
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::scrollDirectionsChanged( 
+        Qt::Orientations newValue )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::gestureSceneFilterChanged
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::gestureSceneFilterChanged( 
+        HbGestureSceneFilter * newFilter )
+    {
+   
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::scrollPositionChanged
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::scrollPositionChanged( 
+        const QPointF & newPosition )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::upGesture
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::upGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::downGesture
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::downGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::leftGesture
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::leftGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::rightGesture
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::rightGesture( 
+        int value )
+    {
+    SMC_MOCK_METHOD1( void, int, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::panGesture
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::panGesture( 
+        const QPointF & point )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbScrollArea::longPressGesture
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::longPressGesture( 
+        const QPointF & point )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,335 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbview.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbView::HbView
+// -----------------------------------------------------------------------------
+//
+HbView::HbView( 
+        QGraphicsItem * parent )
+    //:
+    //HbWidget( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::~HbView
+// -----------------------------------------------------------------------------
+//
+HbView::~HbView(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::title
+// -----------------------------------------------------------------------------
+//
+QString HbView::title(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::icon
+// -----------------------------------------------------------------------------
+//
+HbIcon HbView::icon(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setIcon
+// -----------------------------------------------------------------------------
+//
+void HbView::setIcon( 
+        const HbIcon & )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::menu
+// -----------------------------------------------------------------------------
+//
+HbMenu * HbView::menu(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setMenu
+// -----------------------------------------------------------------------------
+//
+void HbView::setMenu( 
+        HbMenu * )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::takeMenu
+// -----------------------------------------------------------------------------
+//
+HbMenu * HbView::takeMenu(  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::toolBar
+// -----------------------------------------------------------------------------
+//
+HbToolBar * HbView::toolBar(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setToolBar
+// -----------------------------------------------------------------------------
+//
+void HbView::setToolBar( 
+        HbToolBar *  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::takeToolBar
+// -----------------------------------------------------------------------------
+//
+HbToolBar * HbView::takeToolBar(  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::dockWidget
+// -----------------------------------------------------------------------------
+//
+HbDockWidget * HbView::dockWidget(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setDockWidget
+// -----------------------------------------------------------------------------
+//
+void HbView::setDockWidget( 
+        HbDockWidget *  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::widget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbView::widget(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setWidget
+// -----------------------------------------------------------------------------
+//
+void HbView::setWidget( 
+        QGraphicsWidget *  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::takeWidget
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget * HbView::takeWidget(  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::showItems
+// -----------------------------------------------------------------------------
+//
+void HbView::showItems( 
+        Hb::SceneItems  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::hideItems
+// -----------------------------------------------------------------------------
+//
+void HbView::hideItems( 
+        Hb::SceneItems  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::visibleItems
+// -----------------------------------------------------------------------------
+//
+Hb::SceneItems HbView::visibleItems(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::isItemVisible
+// -----------------------------------------------------------------------------
+//
+bool HbView::isItemVisible( 
+        Hb::SceneItem  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setItemVisible
+// -----------------------------------------------------------------------------
+//
+void HbView::setItemVisible( 
+        Hb::SceneItem ,
+        bool  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::unsetVisibleItems
+// -----------------------------------------------------------------------------
+//
+void HbView::unsetVisibleItems(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::isContentFullScreen
+// -----------------------------------------------------------------------------
+//
+bool HbView::isContentFullScreen(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::titleBarFlags
+// -----------------------------------------------------------------------------
+//
+HbView::HbTitleBarFlags HbView::titleBarFlags(  ) const
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setTitleBarVisible
+// -----------------------------------------------------------------------------
+//
+void HbView::setTitleBarVisible( 
+        bool visible )
+    {
+    SMC_MOCK_METHOD1( void, bool, visible )
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// HbView::addAction
+// -----------------------------------------------------------------------------
+//
+void HbView::addAction( 
+        HbAction * ,
+        ActionContainer  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setTitle
+// -----------------------------------------------------------------------------
+//
+void HbView::setTitle( 
+        const QString & title )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, title )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setContentFullScreen
+// -----------------------------------------------------------------------------
+//
+void HbView::setContentFullScreen( 
+        bool enable )
+    {
+    SMC_MOCK_METHOD1( void, bool, enable )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::setTitleBarFlags
+// -----------------------------------------------------------------------------
+//
+void HbView::setTitleBarFlags( 
+        HbView::HbTitleBarFlags  )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::HbView
+// -----------------------------------------------------------------------------
+//
+HbView::HbView( 
+        HbViewPrivate & ,
+        QGraphicsItem *  )
+    //:
+    //HbWidget( /*dd, parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbView::event
+// -----------------------------------------------------------------------------
+//
+bool HbView::event( 
+        QEvent *  )
+    {
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbwidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,511 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <hbwidget.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbWidget::HbWidget
+// -----------------------------------------------------------------------------
+//
+HbWidget::HbWidget( 
+        QGraphicsItem * parent,
+        Qt::WindowFlags wFlags )
+    //:
+    //HbWidgetBase( /*parent, wFlags*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::Q_ENUMS
+// -----------------------------------------------------------------------------
+//
+/*
+void HbWidget::Q_ENUMS( 
+        FocusDelegation FocusMode ) Q_PROPERTY ( QString toolTipText READ toolTip WRITE setToolTip ) Q_PROPERTY ( HbWidget::FocusDelegation focusDelegation READ focusDelegation WRITE setFocusDelegation ) Q_PROPERTY ( bool focusLooping READ hasFocusLooping WRITE setFocusLooping ) Q_PROPERTY ( HbWidget::FocusMode focusMode READ focusMode WRITE setFocusMode )
+    {
+    SMC_MOCK_METHOD1( void, FocusDelegation FocusMode ) Q_PROPERTY ( QString toolTipText READ toolTip WRITE setToolTip ) Q_PROPERTY ( HbWidget::FocusDelegation focusDelegation READ focusDelegation WRITE setFocusDelegation ) Q_PROPERTY ( bool focusLooping READ hasFocusLooping WRITE setFocusLooping ) Q_PROPERTY ( HbWidget::FocusMode focusMode READ focusMode WRITE, setFocusMode )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// HbWidget::~HbWidget
+// -----------------------------------------------------------------------------
+//
+HbWidget::~HbWidget(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::event
+// -----------------------------------------------------------------------------
+//
+bool HbWidget::event( 
+        QEvent * e )
+    {
+  //  SMC_MOCK_METHOD1( bool, QEvent *, e )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setStyle
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setStyle( 
+        HbStyle * style )
+    {
+ //   SMC_MOCK_METHOD1( void, HbStyle *, style )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::style
+// -----------------------------------------------------------------------------
+//
+HbStyle * HbWidget::style(  ) const
+    {
+   // SMC_MOCK_METHOD0( HbStyle * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::clearActions
+// -----------------------------------------------------------------------------
+//
+void HbWidget::clearActions(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::type
+// -----------------------------------------------------------------------------
+/*
+int HbWidget::type(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// HbWidget::pluginBaseId
+// -----------------------------------------------------------------------------
+//
+int HbWidget::pluginBaseId(  ) const
+    {
+    SMC_MOCK_METHOD0( int )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::mainWindow
+// -----------------------------------------------------------------------------
+//
+HbMainWindow * HbWidget::mainWindow(  ) const
+    {
+   // SMC_MOCK_METHOD0( HbMainWindow * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::primitive
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbWidget::primitive( 
+        HbStyle::Primitive primitive ) const
+    {
+  //  SMC_MOCK_METHOD1( QGraphicsItem *, HbStyle::Primitive, primitive )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusOrientation
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusOrientation( 
+        Qt::Orientations previous,
+        Qt::Orientations next )
+    {
+   // SMC_MOCK_METHOD2( void, Qt::Orientations, previous, 
+     //   Qt::Orientations, next )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::keyForFocusNextChild
+// -----------------------------------------------------------------------------
+//
+QKeySequence HbWidget::keyForFocusNextChild(  ) const
+    {
+   // SMC_MOCK_METHOD0( QKeySequence )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::keyForFocusPreviousChild
+// -----------------------------------------------------------------------------
+//
+QKeySequence HbWidget::keyForFocusPreviousChild(  ) const
+    {
+  //  SMC_MOCK_METHOD0( QKeySequence )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setKeyFocusMode
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setKeyFocusMode( 
+        const QKeySequence & key )
+    {
+//    SMC_MOCK_METHOD1( void, const QKeySequence &, key )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::keyFocusMode
+// -----------------------------------------------------------------------------
+//
+QKeySequence HbWidget::keyFocusMode(  ) const
+    {
+//    SMC_MOCK_METHOD0( QKeySequence )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::lastFocusedChild
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbWidget::lastFocusedChild(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QGraphicsItem * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusOrder
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusOrder( 
+        QGraphicsItem * first,
+        QGraphicsItem * second )
+    {
+   // SMC_MOCK_METHOD2( void, QGraphicsItem *, first, 
+     //   QGraphicsItem *, second )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusDelegation
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusDelegation( 
+        HbWidget::FocusDelegation focusDelegation )
+    {
+ //   SMC_MOCK_METHOD1( void, HbWidget::FocusDelegation, focusDelegation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusDelegation
+// -----------------------------------------------------------------------------
+//
+HbWidget::FocusDelegation HbWidget::focusDelegation(  ) const
+    {
+  //  SMC_MOCK_METHOD0( HbWidget::FocusDelegation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusLooping
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusLooping( 
+        bool enable )
+    {
+    SMC_MOCK_METHOD1( void, bool, enable )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::hasFocusLooping
+// -----------------------------------------------------------------------------
+//
+bool HbWidget::hasFocusLooping(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusMode
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusMode( 
+        HbWidget:: FocusMode )
+    {
+   // SMC_MOCK_METHOD1( void, HbWidget::, FocusMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusMode
+// -----------------------------------------------------------------------------
+//
+HbWidget::FocusMode HbWidget::focusMode(  ) const
+    {
+  //  SMC_MOCK_METHOD0( HbWidget::FocusMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setFocusHighlight
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setFocusHighlight( 
+        HbStyle::Primitive type,
+        HbWidget::FocusHighlight focusHighlight )
+    {
+  //  SMC_MOCK_METHOD2( void, HbStyle::Primitive, type, 
+    //    HbWidget::FocusHighlight, focusHighlight )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusHighlight
+// -----------------------------------------------------------------------------
+//
+HbStyle::Primitive HbWidget::focusHighlight( 
+        HbWidget::FocusHighlight focusHighlight )
+    {
+ //   SMC_MOCK_METHOD1( HbStyle::Primitive, HbWidget::FocusHighlight, focusHighlight )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setBackgroundItem
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setBackgroundItem( 
+        HbStyle::Primitive type,
+        int zValue )
+    {
+  //  SMC_MOCK_METHOD2( void, HbStyle::Primitive, type, 
+    //    int, zValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setBackgroundItem
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setBackgroundItem( 
+        QGraphicsItem * item,
+        int zValue )
+    {
+   // SMC_MOCK_METHOD2( void, QGraphicsItem *, item, 
+     //   int, zValue )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::backgroundItem
+// -----------------------------------------------------------------------------
+//
+QGraphicsItem * HbWidget::backgroundItem(  ) const
+    {
+   // SMC_MOCK_METHOD0( QGraphicsItem * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::overrideFeedback
+// -----------------------------------------------------------------------------
+//
+HbFeedback::InstantEffect HbWidget::overrideFeedback( 
+        Hb::InstantInteraction interaction ) const
+    {
+  //  SMC_MOCK_METHOD1( HbFeedback::InstantEffect, Hb::InstantInteraction, interaction )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::overrideContinuousFeedback
+// -----------------------------------------------------------------------------
+//
+HbFeedback::ContinuousEffect HbWidget::overrideContinuousFeedback( 
+        Hb::ContinuousInteraction interaction,
+        int * intensity ) const
+    {
+  //  SMC_MOCK_METHOD2( HbFeedback::ContinuousEffect, Hb::ContinuousInteraction, interaction, 
+    //    int *, intensity )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::recreatePrimitives
+// -----------------------------------------------------------------------------
+//
+void HbWidget::recreatePrimitives(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::updatePrimitives
+// -----------------------------------------------------------------------------
+//
+void HbWidget::updatePrimitives(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusInEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::focusInEvent( 
+        QFocusEvent * event )
+    {
+ //   SMC_MOCK_METHOD1( void, QFocusEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::focusOutEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::focusOutEvent( 
+        QFocusEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( void, QFocusEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::resizeEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::resizeEvent( 
+        QGraphicsSceneResizeEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( void, QGraphicsSceneResizeEvent *, event )
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::changeEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::changeEvent( 
+        QEvent * event )
+    {
+   // SMC_MOCK_METHOD1( void, QEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbWidget::itemChange( 
+        GraphicsItemChange change,
+        const QVariant & value )
+    {
+ //   SMC_MOCK_METHOD2( QVariant, GraphicsItemChange, change, 
+   //     const QVariant &, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::polishEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::polishEvent(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::polish
+// -----------------------------------------------------------------------------
+//
+void HbWidget::polish( 
+        HbStyleParameters & params )
+    {
+ //   SMC_MOCK_METHOD1( void, HbStyleParameters &, params )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::repolish
+// -----------------------------------------------------------------------------
+//
+void HbWidget::repolish(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::setPluginBaseId
+// -----------------------------------------------------------------------------
+//
+void HbWidget::setPluginBaseId( 
+        int baseId )
+    {
+    SMC_MOCK_METHOD1( void, int, baseId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::gestureEvent
+// -----------------------------------------------------------------------------
+//
+void HbWidget::gestureEvent( 
+        QGestureEvent * event )
+    {
+  //  SMC_MOCK_METHOD1( void, QGestureEvent *, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidget::HbWidget
+// -----------------------------------------------------------------------------
+//
+HbWidget::HbWidget( 
+        HbWidgetPrivate & dd,
+        QGraphicsItem * parent,
+        Qt::WindowFlags wFlags )
+    //:
+    //HbWidgetBase( /*dd, parent, wFlags*/ )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_hbwidgetbase.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "hbwidgetbase.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::HbWidgetBase
+// -----------------------------------------------------------------------------
+//
+HbWidgetBase::HbWidgetBase( 
+        HbWidgetBasePrivate & dd,
+        QGraphicsItem * parent,
+        Qt::WindowFlags wFlags ) :d_ptr()
+    //:
+    //HbAbstractItem( /*dd, parent, wFlags*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::~HbWidgetBase
+// -----------------------------------------------------------------------------
+//
+HbWidgetBase::~HbWidgetBase(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::event
+// -----------------------------------------------------------------------------
+//
+bool HbWidgetBase::event( 
+        QEvent * e )
+    {
+    SMC_MOCK_METHOD1( bool, QEvent *, e )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::fontSpec
+// -----------------------------------------------------------------------------
+//
+HbFontSpec HbWidgetBase::fontSpec(  ) const
+    {
+    SMC_MOCK_METHOD0( HbFontSpec )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::setFontSpec
+// -----------------------------------------------------------------------------
+//
+void HbWidgetBase::setFontSpec( 
+        const HbFontSpec & fontSpec )
+    {
+    SMC_MOCK_METHOD1( void, const HbFontSpec &, fontSpec )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::setAttribute
+// -----------------------------------------------------------------------------
+//
+void HbWidgetBase::setAttribute( 
+        Qt::WidgetAttribute att,
+        bool on )
+    {
+    SMC_MOCK_METHOD2( void, Qt::WidgetAttribute, att, 
+        bool, on )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::testAttribute
+// -----------------------------------------------------------------------------
+//
+bool HbWidgetBase::testAttribute( 
+        Qt::WidgetAttribute att ) const
+    {
+    SMC_MOCK_METHOD1( bool, Qt::WidgetAttribute, att )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::setAttribute
+// -----------------------------------------------------------------------------
+//
+void HbWidgetBase::setAttribute( 
+        Hb::WidgetAttribute att,
+        bool on )
+    {
+    SMC_MOCK_METHOD2( void, Hb::WidgetAttribute, att, 
+        bool, on )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::testAttribute
+// -----------------------------------------------------------------------------
+//
+bool HbWidgetBase::testAttribute( 
+        Hb::WidgetAttribute att ) const
+    {
+    SMC_MOCK_METHOD1( bool, Hb::WidgetAttribute, att )
+    }
+
+
+// -----------------------------------------------------------------------------
+// HbWidgetBase::itemChange
+// -----------------------------------------------------------------------------
+//
+QVariant HbWidgetBase::itemChange( 
+        GraphicsItemChange change,
+        const QVariant & value )
+    {
+    SMC_MOCK_METHOD2( QVariant, GraphicsItemChange, change, 
+        const QVariant &, value )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallbarringwrapper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <psetcontainer.h>
+#include <psetcallbarring.h>
+#include <psetcallbarringwrapper.h>
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "psetcallbarringwrapper.h"
+
+class PSetCallBarringWrapperPrivate {
+public:
+    PSetCallBarringWrapperPrivate() {}
+    ~PSetCallBarringWrapperPrivate() {}
+};
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetCallBarringWrapper::PSetCallBarringWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallBarringWrapper::PSetCallBarringWrapper( 
+        CPsetContainer & psetContainer,
+        QObject * parent )
+    :
+    QObject(parent)
+    {
+    Q_UNUSED(psetContainer)
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallBarringWrapper::~PSetCallBarringWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallBarringWrapper::~PSetCallBarringWrapper(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallBarringWrapper::barringStatus
+// -----------------------------------------------------------------------------
+//
+void PSetCallBarringWrapper::barringStatus( 
+        PsServiceGroup serviceGroup,
+        BarringType barringType )
+    {
+    SMC_MOCK_METHOD2( void, int/*PsServiceGroup*/, static_cast<int>(serviceGroup), 
+        BarringType, barringType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallBarringWrapper::enableBarring
+// -----------------------------------------------------------------------------
+//
+void PSetCallBarringWrapper::enableBarring(
+    PsServiceGroup serviceGroup,
+    BarringType barringType,
+    QString barringPassword)
+    {
+    SMC_MOCK_METHOD3( void, int/*PsServiceGroup*/, static_cast<int>(serviceGroup), 
+        BarringType, barringType, QString, barringPassword )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallBarringWrapper::disableBarring
+// -----------------------------------------------------------------------------
+//
+void PSetCallBarringWrapper::disableBarring(
+    PsServiceGroup serviceGroup,
+    BarringType barringType,
+    QString barringPassword)
+    {
+    SMC_MOCK_METHOD3( void, int/*PsServiceGroup*/, static_cast<int>(serviceGroup), 
+        BarringType, barringType, QString, barringPassword )
+    }
+
+// -----------------------------------------------------------------------------
+// PSetCallBarringWrapper::changeBarringPassword
+// -----------------------------------------------------------------------------
+//
+void PSetCallBarringWrapper::changeBarringPassword(
+    const QString &oldPassword, 
+    const QString &newPassword,
+    const QString &verifiedPassword)
+{
+    SMC_MOCK_METHOD3( void, 
+        const QString &, oldPassword, 
+        const QString &, newPassword, 
+        const QString &, verifiedPassword )
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcalldivertingwrapper.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "psetcalldivertingwrapper.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::PSetCallDivertingWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallDivertingWrapper::PSetCallDivertingWrapper( 
+        CPsetContainer & psetContainer,
+        QObject * parent ) : QObject( parent )
+    {
+    Q_UNUSED(psetContainer);
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::~PSetCallDivertingWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallDivertingWrapper::~PSetCallDivertingWrapper(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::setCallDiverting
+// -----------------------------------------------------------------------------
+//
+int PSetCallDivertingWrapper::setCallDiverting( 
+        PSCallDivertingCommand & aSetting,
+        int aBasicServiceGroup )
+    {
+    SMC_MOCK_METHOD2( int, PSCallDivertingCommand &, aSetting, 
+        int, aBasicServiceGroup )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::getCallDivertingStatus
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapper::getCallDivertingStatus( 
+        const PsServiceGroup aServiceGroup,
+        const PsCallDivertingCondition aCondition,
+        int aBsc )
+    {
+    int iDummy = aServiceGroup;
+    SMC_MOCK_METHOD3( void, int, iDummy, 
+        const PsCallDivertingCondition, aCondition, 
+        int, aBsc )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::cancelProcess
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapper::cancelProcess(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::getDefaultNumbers
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapper::getDefaultNumbers( 
+        QStringList & aDefNumbers )
+    {
+    static int i =0;
+    if(i == 0){
+        QStringList list;
+        list << "0401234567" << "0501234567" << "0451234567";
+        aDefNumbers = list;
+        i=1;
+    }else{
+        i=0;
+    }
+    SMC_MOCK_METHOD1( void, QStringList &, aDefNumbers )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::setNewDefaultNumber
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapper::setNewDefaultNumber( 
+        QString aNumber )
+    {
+    SMC_MOCK_METHOD1( void, QString, aNumber )
+    }
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapper::getVoiceMailBoxNumber
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapper::getVoiceMailBoxNumber(QString &number)
+{
+    SMC_MOCK_METHOD1( void, QString&, number )
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcalldivertingwrapper_p.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,165 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <mpsetdivertobs.h>
+#include <mphcltemergencycallobserver.h>
+#include <mmlist.h>
+#include <smcmockclassincludes.h>
+#include "psetcalldivertingwrapper_p.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::PSetCallDivertingWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetCallDivertingWrapperPrivate::PSetCallDivertingWrapperPrivate( 
+        PSetCallDivertingWrapper & owner )
+    : m_Owner(owner)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::~PSetCallDivertingWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetCallDivertingWrapperPrivate::~PSetCallDivertingWrapperPrivate(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::HandleDivertingChangedL
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapperPrivate::HandleDivertingChangedL( 
+        const TCallDivertSetting & aSetting,
+        TBool aPlural )
+    {
+    SMC_MOCK_METHOD2( void, const TCallDivertSetting &, aSetting, 
+        TBool, aPlural )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::HandleDivertingStatusL
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapperPrivate::HandleDivertingStatusL( 
+        CMobilePhoneCFList & aSetting,
+        TBool aPlural )
+    {
+    SMC_MOCK_METHOD2( void, CMobilePhoneCFList &, aSetting, 
+        TBool, aPlural )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::HandleDivertingErrorL
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapperPrivate::HandleDivertingErrorL( 
+        TInt aReason )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aReason )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::HandleCFRequestingL
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapperPrivate::HandleCFRequestingL( 
+        TBool aOngoing,
+        TBool aInterrupted )
+    {
+    SMC_MOCK_METHOD2( void, TBool, aOngoing, 
+        TBool, aInterrupted )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::SetEngineContact
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapperPrivate::SetEngineContact( 
+        MPsetCallDiverting * aDivertEngine )
+    {
+    SMC_MOCK_METHOD1( void, MPsetCallDiverting *, aDivertEngine )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::HandleEmergencyDialL
+// -----------------------------------------------------------------------------
+//
+void PSetCallDivertingWrapperPrivate::HandleEmergencyDialL( 
+        const TInt aStatus )
+    {
+    SMC_MOCK_METHOD1( void, const TInt, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::convert
+// -----------------------------------------------------------------------------
+//
+TCallDivertingCondition PSetCallDivertingWrapperPrivate::convert( 
+        PsCallDivertingCondition type )
+    {
+    SMC_MOCK_METHOD1( TCallDivertingCondition, PsCallDivertingCondition, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::convert
+// -----------------------------------------------------------------------------
+//
+TDivertingStatus PSetCallDivertingWrapperPrivate::convert( 
+        PsCallDivertingStatus type )
+    {
+    SMC_MOCK_METHOD1( TDivertingStatus, PsCallDivertingStatus, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::convert
+// -----------------------------------------------------------------------------
+//
+TServiceGroup PSetCallDivertingWrapperPrivate::convert( 
+        PsServiceGroup type )
+    {
+    // TODO: QFlags does not compile with SymbianMock
+    // SMC_MOCK_METHOD1( TServiceGroup, PsServiceGroup, type )
+    Q_UNUSED(type)
+    SMC_MOCK_METHOD0( TServiceGroup )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallDivertingWrapperPrivate::convert
+// -----------------------------------------------------------------------------
+//
+TDivertingSetting PSetCallDivertingWrapperPrivate::convert( 
+        PsCallDivertingSetting type )
+    {
+    SMC_MOCK_METHOD1( TDivertingSetting, PsCallDivertingSetting, type )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallwaitingwrapper.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "psetcallwaitingwrapper.h"
+#include "psetcallwaitingwrapper_p.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapper::PSetCallWaitingWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallWaitingWrapper::PSetCallWaitingWrapper( 
+        CPsetContainer & psetContainer,
+        QObject * parent ) : QObject( parent )
+    {
+    Q_UNUSED(psetContainer);
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapper::~PSetCallWaitingWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallWaitingWrapper::~PSetCallWaitingWrapper(  )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapper::setCallWaiting
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapper::setCallWaiting( 
+        PsCallWaitingCommand aSetting,
+        int aBasicServiceGroup )
+    {
+    SMC_MOCK_METHOD2( void, PsCallWaitingCommand, aSetting, 
+        int, aBasicServiceGroup )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapper::getCallWaitingStatus
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapper::getCallWaitingStatus(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapper::cancelProcess
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapper::cancelProcess(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcallwaitingwrapper_p.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QObject>
+#include <rsssettings.h>
+#include <psetcontainer.h>
+#include <psetcallwaiting.h>
+#include <smcmockclassincludes.h>
+#include "psetcallwaitingwrapper_p.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapperPrivate::PSetCallWaitingWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetCallWaitingWrapperPrivate::PSetCallWaitingWrapperPrivate( 
+        PSetCallWaitingWrapper & owner )
+    : m_Owner(owner)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapperPrivate::~PSetCallWaitingWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetCallWaitingWrapperPrivate::~PSetCallWaitingWrapperPrivate(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapperPrivate::HandleCallWaitingGetStatusL
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapperPrivate::HandleCallWaitingGetStatusL( 
+        const MPsetCallWaiting::TGetCallWaitingStatus aStatus,
+        TUint8 aBsc[KPSetNumberOfBsc])
+    {
+    Q_UNUSED(aStatus)
+    Q_UNUSED(aBsc)
+    // TODO: make compile
+    //    SMC_MOCK_METHOD2( void, const MPsetCallWaiting::TGetCallWaitingStatus, aStatus, 
+    //        TUint8[KPSetNumberOfBsc], aBsc)
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapperPrivate::HandleCallWaitingChangedL
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapperPrivate::HandleCallWaitingChangedL( 
+        const MPsetCallWaiting::TSetCallWaiting aSetting,
+        const TInt aResult )
+    {
+    SMC_MOCK_METHOD2( void, const MPsetCallWaiting::TSetCallWaiting, aSetting, 
+        const TInt, aResult )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapperPrivate::HandleCWRequestingL
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapperPrivate::HandleCWRequestingL( 
+        TBool aOngoing,
+        TBool aInterrupted )
+    {
+    SMC_MOCK_METHOD2( void, TBool, aOngoing, 
+        TBool, aInterrupted )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapperPrivate::HandleCWErrorL
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapperPrivate::HandleCWErrorL( 
+        TInt aReason )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aReason )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCallWaitingWrapperPrivate::SetEngineContact
+// -----------------------------------------------------------------------------
+//
+void PSetCallWaitingWrapperPrivate::SetEngineContact( 
+        MPsetCallWaiting & aEngineContact )
+    {
+    SMC_MOCK_METHOD1( void, MPsetCallWaiting &, aEngineContact )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcliwrapper.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "psetcliwrapper.h"
+#include "psetcliwrapper_p.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::PSetCliWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCliWrapper::PSetCliWrapper( 
+        CPsetContainer & psetContainer,
+        QObject * parent ) : QObject( parent )
+    {
+    Q_UNUSED(psetContainer);
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::~PSetCliWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCliWrapper::~PSetCliWrapper(  )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::getColpMode
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapper::getColpMode(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::getClipMode
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapper::getClipMode(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::getClirMode
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapper::getClirMode(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::getColrMode
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapper::getColrMode(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::getCnap
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapper::getCnap(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapper::cancelAll
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapper::cancelAll(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetcliwrapper_p.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QObject>
+#include <rsssettings.h>
+#include <psetcontainer.h>
+#include <psetcli.h>
+#include <psuiconstants.h>
+#include <smcmockclassincludes.h>
+#include "psetcliwrapper_p.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::PSetCliWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetCliWrapperPrivate::PSetCliWrapperPrivate( 
+        PSetCliWrapper & owner )
+    : m_Owner(owner)
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::~PSetCliWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetCliWrapperPrivate::~PSetCliWrapperPrivate(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::SetEngineContact
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapperPrivate::SetEngineContact( 
+        MPsetCli * aEngine )
+    {
+    SMC_MOCK_METHOD1( void, MPsetCli *, aEngine )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::HandleCliRequestingL
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapperPrivate::HandleCliRequestingL( 
+        TBool aOngoing,
+        TBool aInterrupted )
+    {
+    SMC_MOCK_METHOD2( void, TBool, aOngoing, 
+        TBool, aInterrupted )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::CliInformationL
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapperPrivate::CliInformationL( 
+        TPsuiCli aType )
+    {
+    SMC_MOCK_METHOD1( void, TPsuiCli, aType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::HandleCliStatusL
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapperPrivate::HandleCliStatusL( 
+        TUint8 aBsc[KPSetNumberOfBsc],
+        TPsuiCli aMode )
+    {
+    // TODO: make compile
+    Q_UNUSED(aBsc)
+    Q_UNUSED(aMode)
+    //SMC_MOCK_METHOD2( void, TUint8[KPSetNumberOfBsc], aBsc, TPsuiCli, aMode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::HandleCnapStatusL
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapperPrivate::HandleCnapStatusL( 
+        TInt aStatus )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aStatus )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetCliWrapperPrivate::HandleCliErrorL
+// -----------------------------------------------------------------------------
+//
+void PSetCliWrapperPrivate::HandleCliErrorL( 
+        TInt aError )
+    {
+    SMC_MOCK_METHOD1( void, TInt, aError )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetnetworkwrapper.cpp	Fri Jun 04 10:19:18 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "psetnetworkwrapper.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::PSetNetworkWrapper
+// -----------------------------------------------------------------------------
+//
+PSetNetworkWrapper::PSetNetworkWrapper( 
+        CPsetContainer & psetContainer,
+        QObject * parent ) : QObject( parent )
+    {
+    Q_UNUSED(psetContainer);
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::~PSetNetworkWrapper
+// -----------------------------------------------------------------------------
+//
+PSetNetworkWrapper::~PSetNetworkWrapper(  )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::getAvailableNetworks
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapper::getAvailableNetworks(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::getNetworkSelectionMode
+// -----------------------------------------------------------------------------
+//
+PSetNetworkWrapper::ErrorCode PSetNetworkWrapper::getNetworkSelectionMode( 
+        PSetNetworkWrapper::NetworkSelectionMode & mode ) const
+    {
+    SMC_MOCK_METHOD1( PSetNetworkWrapper::ErrorCode, PSetNetworkWrapper::NetworkSelectionMode &, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::selectNetwork
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapper::selectNetwork( 
+        const PSetNetworkWrapper::NetworkInfo & info )
+    {
+    Q_UNUSED(info);
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::cancelRequest
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapper::cancelRequest(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::getNetworkAccessMode
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapper::getNetworkAccessMode(  ) const
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapper::setNetworkAccessMode
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapper::setNetworkAccessMode( 
+        PSetNetworkWrapper::NetworkAccessMode mode )
+    {
+    SMC_MOCK_METHOD1( void, PSetNetworkWrapper::NetworkAccessMode, mode )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetnetworkwrapper_p.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,237 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <rmmcustomapi.h>
+#include <PsetContainer.h>
+#include <PsetNetwork.h>
+#include <smcmockclassincludes.h>
+#include "psetnetworkwrapper_p.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::PSetNetworkWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetNetworkWrapperPrivate::PSetNetworkWrapperPrivate( 
+        PSetNetworkWrapper & owner,
+        CPsetContainer & psetContainer )
+    : m_owner(owner)
+    {
+    Q_UNUSED(psetContainer)
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::~PSetNetworkWrapperPrivate
+// -----------------------------------------------------------------------------
+//
+PSetNetworkWrapperPrivate::~PSetNetworkWrapperPrivate(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::getAvailableNetworks
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::getAvailableNetworks(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::getNetworkSelectionMode
+// -----------------------------------------------------------------------------
+//
+PSetNetworkWrapper::ErrorCode PSetNetworkWrapperPrivate::getNetworkSelectionMode( 
+        PSetNetworkWrapper::NetworkSelectionMode & mode ) const
+    {
+    SMC_MOCK_METHOD1( PSetNetworkWrapper::ErrorCode, PSetNetworkWrapper::NetworkSelectionMode &, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::selectNetwork
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::selectNetwork( 
+        const PSetNetworkWrapper::NetworkInfo & networkInfo )
+    {
+    SMC_MOCK_METHOD1( void, const PSetNetworkWrapper::NetworkInfo &, networkInfo )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::cancelRequest
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::cancelRequest(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::getNetworkAccessMode
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::getNetworkAccessMode(  ) const
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::setNetworkAccessMode
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::setNetworkAccessMode( 
+        PSetNetworkWrapper::NetworkAccessMode mode )
+    {
+    SMC_MOCK_METHOD1( void, PSetNetworkWrapper::NetworkAccessMode, mode )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleNetworkInfoReceivedL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleNetworkInfoReceivedL( 
+        const CNetworkInfoArray * aInfoArray,
+        const TInt aResult )
+    {
+    SMC_MOCK_METHOD2( void, const CNetworkInfoArray *, aInfoArray, 
+        const TInt, aResult )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleCurrentNetworkInfoL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleCurrentNetworkInfoL( 
+        const MPsetNetworkSelect::TCurrentNetworkInfo & aCurrentInfo,
+        const TInt aResult )
+    {
+    SMC_MOCK_METHOD2( void, const MPsetNetworkSelect::TCurrentNetworkInfo &, aCurrentInfo, 
+        const TInt, aResult )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleNetworkChangedL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleNetworkChangedL( 
+        const MPsetNetworkSelect::TNetworkInfo & aCurrentInfo,
+        const MPsetNetworkSelect::TCurrentNetworkStatus aStatus,
+        const TInt aResult )
+    {
+    SMC_MOCK_METHOD3( void, const MPsetNetworkSelect::TNetworkInfo &, aCurrentInfo, 
+        const MPsetNetworkSelect::TCurrentNetworkStatus, aStatus, 
+        const TInt, aResult )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleNetworkChangedL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleNetworkChangedL( 
+        const MPsetNetworkSelect::TNetworkInfo & aCurrentInfo,
+        const RMobilePhone::TMobilePhoneRegistrationStatus & aStatus,
+        const TInt aResult )
+    {
+    SMC_MOCK_METHOD3( void, const MPsetNetworkSelect::TNetworkInfo &, aCurrentInfo, 
+        const RMobilePhone::TMobilePhoneRegistrationStatus &, aStatus, 
+        const TInt, aResult )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleSearchingNetworksL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleSearchingNetworksL( 
+        MPsetNetworkInfoObserver::TServiceRequest aRequest )
+    {
+    SMC_MOCK_METHOD1( void, MPsetNetworkInfoObserver::TServiceRequest, aRequest )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleRequestingSelectedNetworkL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleRequestingSelectedNetworkL( 
+        TBool aOngoing )
+    {
+    SMC_MOCK_METHOD1( void, TBool, aOngoing )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleCallActivatedL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleCallActivatedL(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleNetworkErrorL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleNetworkErrorL( 
+        const MPsetNetworkInfoObserver::TServiceRequest aRequest,
+        const TInt aError )
+    {
+    SMC_MOCK_METHOD2( void, const MPsetNetworkInfoObserver::TServiceRequest, aRequest, 
+        const TInt, aError )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleNetworkSystemModeEventsL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleNetworkSystemModeEventsL( 
+        const MPsetNetworkModeObserver::TServiceRequest aRequest,
+        const TUint32 aNetworkModeCaps )
+    {
+    SMC_MOCK_METHOD2( void, const MPsetNetworkModeObserver::TServiceRequest, aRequest, 
+        const TUint32, aNetworkModeCaps )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetNetworkWrapperPrivate::HandleNetworkErrorL
+// -----------------------------------------------------------------------------
+//
+void PSetNetworkWrapperPrivate::HandleNetworkErrorL( 
+        const MPsetNetworkModeObserver::TServiceRequest aRequest,
+        const TInt aError )
+    {
+    SMC_MOCK_METHOD2( void, const MPsetNetworkModeObserver::TServiceRequest, aRequest, 
+        const TInt, aError )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_psetwrapper.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include <psetwrapper.h>
+#include <psetcliwrapper.h>
+#include <psetcallwaitingwrapper.h> 
+#include <psetcalldivertingwrapper.h>
+#include <psetnetworkwrapper.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// PSetWrapper::PSetWrapper
+// -----------------------------------------------------------------------------
+//
+PSetWrapper::PSetWrapper( 
+        QObject * parent ) : QObject( parent ) 
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetWrapper::~PSetWrapper
+// -----------------------------------------------------------------------------
+//
+PSetWrapper::~PSetWrapper(  )
+    {
+
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetWrapper::cliWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCliWrapper & PSetWrapper::cliWrapper(  )
+    {
+    SMC_MOCK_METHOD0( PSetCliWrapper & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetWrapper::callWaitingWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallWaitingWrapper & PSetWrapper::callWaitingWrapper(  )
+    {
+    SMC_MOCK_METHOD0( PSetCallWaitingWrapper & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetWrapper::callDivertingWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallDivertingWrapper & PSetWrapper::callDivertingWrapper(  )
+    {
+    SMC_MOCK_METHOD0( PSetCallDivertingWrapper & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetWrapper::networkWrapper
+// -----------------------------------------------------------------------------
+//
+PSetNetworkWrapper & PSetWrapper::networkWrapper(  )
+    {
+    SMC_MOCK_METHOD0( PSetNetworkWrapper & )
+    }
+
+
+// -----------------------------------------------------------------------------
+// PSetWrapper::callBarringWrapper
+// -----------------------------------------------------------------------------
+//
+PSetCallBarringWrapper & PSetWrapper::callBarringWrapper(  )
+    {
+    SMC_MOCK_METHOD0( PSetCallBarringWrapper & )
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qaction.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,737 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <QAction>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QAction::QAction
+// -----------------------------------------------------------------------------
+//
+QAction::QAction( 
+        QObject * parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::QAction
+// -----------------------------------------------------------------------------
+//
+QAction::QAction( 
+        const QString & text,
+        QObject * parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::QAction
+// -----------------------------------------------------------------------------
+//
+QAction::QAction( 
+        const QIcon & icon,
+        const QString & text,
+        QObject * parent )
+    {
+    
+    }
+
+
+#ifdef QT3_SUPPORT
+// -----------------------------------------------------------------------------
+// QAction::QAction
+// -----------------------------------------------------------------------------
+//
+QAction::QAction( 
+        QObject * parent,
+        const char * name )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::QAction
+// -----------------------------------------------------------------------------
+//
+QAction::QAction( 
+        const QString & text,
+        const QKeySequence & shortcut,
+        QObject * parent,
+        const char * name )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::QAction
+// -----------------------------------------------------------------------------
+//
+QAction::QAction( 
+        const QIcon & icon,
+        const QString & text,
+        const QKeySequence & shortcut,
+        QObject * parent,
+        const char * name )
+    {
+    
+    }
+#endif
+
+// -----------------------------------------------------------------------------
+// QAction::~QAction
+// -----------------------------------------------------------------------------
+//
+QAction::~QAction(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setActionGroup
+// -----------------------------------------------------------------------------
+//
+void QAction::setActionGroup( 
+        QActionGroup * group )
+    {
+//    SMC_MOCK_METHOD1( void, QActionGroup *, group )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::actionGroup
+// -----------------------------------------------------------------------------
+//
+QActionGroup * QAction::actionGroup(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QActionGroup * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setIcon
+// -----------------------------------------------------------------------------
+//
+void QAction::setIcon( 
+        const QIcon & icon )
+    {
+//    SMC_MOCK_METHOD1( void, const QIcon &, icon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::icon
+// -----------------------------------------------------------------------------
+//
+QIcon QAction::icon(  ) const
+    {
+//    SMC_MOCK_METHOD0( QIcon )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setText
+// -----------------------------------------------------------------------------
+//
+void QAction::setText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::text
+// -----------------------------------------------------------------------------
+//
+QString QAction::text(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setIconText
+// -----------------------------------------------------------------------------
+//
+void QAction::setIconText( 
+        const QString & text )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, text )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::iconText
+// -----------------------------------------------------------------------------
+//
+QString QAction::iconText(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setToolTip
+// -----------------------------------------------------------------------------
+//
+void QAction::setToolTip( 
+        const QString & tip )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, tip )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::toolTip
+// -----------------------------------------------------------------------------
+//
+QString QAction::toolTip(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setStatusTip
+// -----------------------------------------------------------------------------
+//
+void QAction::setStatusTip( 
+        const QString & statusTip )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, statusTip )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::statusTip
+// -----------------------------------------------------------------------------
+//
+QString QAction::statusTip(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setWhatsThis
+// -----------------------------------------------------------------------------
+//
+void QAction::setWhatsThis( 
+        const QString & what )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, what )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::whatsThis
+// -----------------------------------------------------------------------------
+//
+QString QAction::whatsThis(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setPriority
+// -----------------------------------------------------------------------------
+//
+void QAction::setPriority( 
+        QAction::Priority priority )
+    {
+ //   SMC_MOCK_METHOD1( void, Priority, priority )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::priority
+// -----------------------------------------------------------------------------
+//
+QAction::Priority QAction::priority(  ) const
+    {
+ //   SMC_MOCK_METHOD0( Priority )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::menu
+// -----------------------------------------------------------------------------
+//
+QMenu * QAction::menu(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QMenu * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setMenu
+// -----------------------------------------------------------------------------
+//
+void QAction::setMenu( 
+        QMenu * menu )
+    {
+//    SMC_MOCK_METHOD1( void, QMenu *, menu )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setSeparator
+// -----------------------------------------------------------------------------
+//
+void QAction::setSeparator( 
+        bool b )
+    {
+    SMC_MOCK_METHOD1( void, bool, b )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::isSeparator
+// -----------------------------------------------------------------------------
+//
+bool QAction::isSeparator(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setShortcut
+// -----------------------------------------------------------------------------
+//
+void QAction::setShortcut( 
+        const QKeySequence & shortcut )
+    {
+//    SMC_MOCK_METHOD1( void, const QKeySequence &, shortcut )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::shortcut
+// -----------------------------------------------------------------------------
+//
+QKeySequence QAction::shortcut(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QKeySequence )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setShortcuts
+// -----------------------------------------------------------------------------
+//
+void QAction::setShortcuts( 
+        const QList<QKeySequence> & shortcuts )
+    {
+ //   SMC_MOCK_METHOD1( void, const QList<QKeySequence> &, shortcuts )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setShortcuts
+// -----------------------------------------------------------------------------
+//
+void QAction::setShortcuts( 
+        QKeySequence:: StandardKey )
+    {
+//    SMC_MOCK_METHOD1( void, QKeySequence::, StandardKey )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::shortcuts
+// -----------------------------------------------------------------------------
+//
+QList <QKeySequence > QAction::shortcuts(  ) const
+    {
+//    SMC_MOCK_METHOD0( QList <QKeySequence > )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setShortcutContext
+// -----------------------------------------------------------------------------
+//
+void QAction::setShortcutContext( 
+        Qt::ShortcutContext context )
+    {
+//    SMC_MOCK_METHOD1( void, Qt::ShortcutContext, context )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::shortcutContext
+// -----------------------------------------------------------------------------
+//
+Qt::ShortcutContext QAction::shortcutContext(  ) const
+    {
+ //   SMC_MOCK_METHOD0( Qt::ShortcutContext )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setAutoRepeat
+// -----------------------------------------------------------------------------
+//
+void QAction::setAutoRepeat( bool )
+    {
+   // SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::autoRepeat
+// -----------------------------------------------------------------------------
+//
+bool QAction::autoRepeat(  ) const
+    {
+  //  SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setFont
+// -----------------------------------------------------------------------------
+//
+void QAction::setFont( 
+        const QFont & font )
+    {
+ //   SMC_MOCK_METHOD1( void, const QFont &, font )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::font
+// -----------------------------------------------------------------------------
+//
+QFont QAction::font(  ) const
+    {
+//    SMC_MOCK_METHOD0( QFont )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setCheckable
+// -----------------------------------------------------------------------------
+//
+void QAction::setCheckable( bool  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::isCheckable
+// -----------------------------------------------------------------------------
+//
+bool QAction::isCheckable(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::data
+// -----------------------------------------------------------------------------
+//
+QVariant QAction::data(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QVariant )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setData
+// -----------------------------------------------------------------------------
+//
+void QAction::setData( 
+        const QVariant & var )
+    {
+ //   SMC_MOCK_METHOD1( void, const QVariant &, var )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::isChecked
+// -----------------------------------------------------------------------------
+//
+bool QAction::isChecked(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::isEnabled
+// -----------------------------------------------------------------------------
+//
+bool QAction::isEnabled(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::isVisible
+// -----------------------------------------------------------------------------
+//
+bool QAction::isVisible(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::activate
+// -----------------------------------------------------------------------------
+//
+void QAction::activate( 
+        ActionEvent event )
+    {
+ //   SMC_MOCK_METHOD1( void, ActionEvent, event )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::showStatusText
+// -----------------------------------------------------------------------------
+//
+bool QAction::showStatusText( 
+        QWidget * widget )
+    {
+ //   SMC_MOCK_METHOD1( bool, QWidget *, widget )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setMenuRole
+// -----------------------------------------------------------------------------
+//
+void QAction::setMenuRole( 
+        QAction::MenuRole menuRole )
+    {
+ //   SMC_MOCK_METHOD1( void, MenuRole, menuRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::menuRole
+// -----------------------------------------------------------------------------
+//
+QAction::MenuRole QAction::menuRole(  ) const
+    {
+ //   SMC_MOCK_METHOD0( MenuRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setSoftKeyRole
+// -----------------------------------------------------------------------------
+//
+void QAction::setSoftKeyRole( 
+        QAction::SoftKeyRole softKeyRole )
+    {
+  //  SMC_MOCK_METHOD1( void, SoftKeyRole, softKeyRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::softKeyRole
+// -----------------------------------------------------------------------------
+//
+QAction::SoftKeyRole QAction::softKeyRole(  ) const
+    {
+ //   SMC_MOCK_METHOD0( SoftKeyRole )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setIconVisibleInMenu
+// -----------------------------------------------------------------------------
+//
+void QAction::setIconVisibleInMenu( 
+        bool visible )
+    {
+    SMC_MOCK_METHOD1( void, bool, visible )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::isIconVisibleInMenu
+// -----------------------------------------------------------------------------
+//
+bool QAction::isIconVisibleInMenu(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::parentWidget
+// -----------------------------------------------------------------------------
+//
+QWidget * QAction::parentWidget(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QWidget * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::associatedWidgets
+// -----------------------------------------------------------------------------
+//
+QList <QWidget * > QAction::associatedWidgets(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QList <QWidget * > )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::associatedGraphicsWidgets
+// -----------------------------------------------------------------------------
+//
+QList <QGraphicsWidget * > QAction::associatedGraphicsWidgets(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QList <QGraphicsWidget * > )
+    }
+
+// -----------------------------------------------------------------------------
+// QAction::setChecked
+// -----------------------------------------------------------------------------
+//
+void QAction::setChecked( bool )
+    {
+    //SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::toggle
+// -----------------------------------------------------------------------------
+//
+void QAction::toggle(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setEnabled
+// -----------------------------------------------------------------------------
+//
+void QAction::setEnabled( bool )
+    {
+   // SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::setVisible
+// -----------------------------------------------------------------------------
+//
+void QAction::setVisible( bool  )
+    {
+  //  SMC_MOCK_METHOD0( void )
+    }
+
+/*
+// -----------------------------------------------------------------------------
+// QAction::changed
+// -----------------------------------------------------------------------------
+//
+void QAction::changed(  )
+    {
+ //   SMC_MOCK_METHOD0( Q_SIGNALS : void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::triggered
+// -----------------------------------------------------------------------------
+//
+void QAction::triggered( 
+        bool checked )
+    {
+    SMC_MOCK_METHOD1( void, bool, checked )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::hovered
+// -----------------------------------------------------------------------------
+//
+void QAction::hovered(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::toggled
+// -----------------------------------------------------------------------------
+//
+void QAction::toggled(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::activated
+// -----------------------------------------------------------------------------
+//
+void QAction::activated( 
+         int )
+    {
+ //   SMC_MOCK_METHOD1( QT_MOC_COMPAT void, , int )
+    }
+*/
+
+// -----------------------------------------------------------------------------
+// QAction::event
+// -----------------------------------------------------------------------------
+//
+bool QAction::event( 
+        QEvent * )
+    {
+//    SMC_MOCK_METHOD1( bool, QEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QAction::QAction
+// -----------------------------------------------------------------------------
+//
+QAction::QAction( 
+        QActionPrivate & dd,
+        QObject * parent )
+    //:
+    //QObject( /*dd, parent*/ )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qobject.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,557 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include <QObject>
+#include <QVariant>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QObjectUserData::~QObjectUserData
+// -----------------------------------------------------------------------------
+//
+QObjectUserData::~QObjectUserData(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObjectData::~QObjectData
+// -----------------------------------------------------------------------------
+//
+QObjectData::~QObjectData(  )
+    {
+    
+    }
+
+#ifdef QT3_SUPPORT
+// -----------------------------------------------------------------------------
+// QObject::QObject
+// -----------------------------------------------------------------------------
+//
+QT3_SUPPORT_CONSTRUCTOR QObject::QObject( 
+        QObject * parent,
+        const char * name )
+    {
+    
+    }
+#endif
+
+// -----------------------------------------------------------------------------
+// QObject::~QObject
+// -----------------------------------------------------------------------------
+//
+QObject::~QObject(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::event
+// -----------------------------------------------------------------------------
+//
+bool QObject::event( 
+        QEvent * )
+    {
+ //   SMC_MOCK_METHOD1( bool, QEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::eventFilter
+// -----------------------------------------------------------------------------
+//
+bool QObject::eventFilter( 
+        QObject *,
+        QEvent * )
+    {
+ //   SMC_MOCK_METHOD2( bool, QObject, *, 
+//        QEvent, * )
+    }
+
+#ifdef qdoc
+// -----------------------------------------------------------------------------
+// QObject::tr
+// -----------------------------------------------------------------------------
+//
+QString QObject::tr( 
+        const char * sourceText,
+        const char * comment,
+        int n )
+    {
+    SMC_MOCK_METHOD3( QString, const char *, sourceText, 
+        const char *, comment, 
+        int, n )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::trUtf8
+// -----------------------------------------------------------------------------
+//
+QString QObject::trUtf8( 
+        const char * sourceText,
+        const char * comment,
+        int n )
+    {
+    SMC_MOCK_METHOD3( QString, const char *, sourceText, 
+        const char *, comment, 
+        int, n )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::metaObject
+// -----------------------------------------------------------------------------
+//
+const QMetaObject * QObject::metaObject(  ) const
+    {
+ //   SMC_MOCK_METHOD0( const QMetaObject * )
+    }
+
+#endif
+#ifdef QT_NO_TRANSLATION
+// -----------------------------------------------------------------------------
+// QObject::tr
+// -----------------------------------------------------------------------------
+//
+QString QObject::tr( 
+        const char * sourceText,
+        const char * )
+    {
+    SMC_MOCK_METHOD2( QString, const char *, sourceText, 
+        const char, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::tr
+// -----------------------------------------------------------------------------
+//
+QString QObject::tr( 
+        const char * sourceText,
+        const char * )
+    {
+    SMC_MOCK_METHOD2( QString, const char *, sourceText, 
+        const char, * )
+    }
+#ifndef QT_NO_TEXTCODEC
+
+// -----------------------------------------------------------------------------
+// QObject::trUtf8
+// -----------------------------------------------------------------------------
+//
+QString QObject::trUtf8( 
+        const char * sourceText,
+        const char * )
+    {
+    SMC_MOCK_METHOD2( QString, const char *, sourceText, 
+        const char, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::trUtf8
+// -----------------------------------------------------------------------------
+//
+QString QObject::trUtf8( 
+        const char * sourceText,
+        const char * )
+    {
+    SMC_MOCK_METHOD2( QString, const char *, sourceText, 
+        const char, * )
+    }
+#endif
+#endif //QT_NO_TRANSLATION
+
+// -----------------------------------------------------------------------------
+// QObject::objectName
+// -----------------------------------------------------------------------------
+//
+QString QObject::objectName(  ) const
+    {
+    SMC_MOCK_METHOD0( QString )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::setObjectName
+// -----------------------------------------------------------------------------
+//
+void QObject::setObjectName( 
+        const QString & name )
+    {
+    SMC_MOCK_METHOD1( void, const QString &, name )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::blockSignals
+// -----------------------------------------------------------------------------
+//
+bool QObject::blockSignals( 
+        bool b )
+    {
+    SMC_MOCK_METHOD1( bool, bool, b )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::thread
+// -----------------------------------------------------------------------------
+//
+QThread * QObject::thread(  ) const
+    {
+//    SMC_MOCK_METHOD0( QThread * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::moveToThread
+// -----------------------------------------------------------------------------
+//
+void QObject::moveToThread( 
+        QThread * thread )
+    {
+ //   SMC_MOCK_METHOD1( void, QThread *, thread )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::startTimer
+// -----------------------------------------------------------------------------
+//
+int QObject::startTimer( 
+        int interval )
+    {
+    SMC_MOCK_METHOD1( int, int, interval )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::killTimer
+// -----------------------------------------------------------------------------
+//
+void QObject::killTimer( 
+        int id )
+    {
+    SMC_MOCK_METHOD1( void, int, id )
+    }
+
+#ifdef QT3_SUPPORT
+// -----------------------------------------------------------------------------
+// QObject::child
+// -----------------------------------------------------------------------------
+//
+QT3_SUPPORT QObject * QObject::child( 
+        const char * objName,
+        const char * inheritsClass,
+        bool recursiveSearch ) const
+    {
+    SMC_MOCK_METHOD3( QT3_SUPPORT QObject *, const char *, objName, 
+        const char *, inheritsClass, 
+        bool, recursiveSearch )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::queryList
+// -----------------------------------------------------------------------------
+//
+QT3_SUPPORT QObjectList QObject::queryList( 
+        const char * inheritsClass,
+        const char * objName,
+        bool regexpMatch,
+        bool recursiveSearch ) const
+    {
+    SMC_MOCK_METHOD4( QT3_SUPPORT QObjectList, const char *, inheritsClass, 
+        const char *, objName, 
+        bool, regexpMatch, 
+        bool, recursiveSearch )
+    }
+#endif
+
+// -----------------------------------------------------------------------------
+// QObject::setParent
+// -----------------------------------------------------------------------------
+//
+void QObject::setParent( 
+        QObject * )
+    {
+ //   SMC_MOCK_METHOD1( void, QObject, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::installEventFilter
+// -----------------------------------------------------------------------------
+//
+void QObject::installEventFilter( 
+        QObject * )
+    {
+ //   SMC_MOCK_METHOD1( void, QObject, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::removeEventFilter
+// -----------------------------------------------------------------------------
+//
+void QObject::removeEventFilter( 
+        QObject * )
+    {
+ //   SMC_MOCK_METHOD1( void, QObject, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::connect
+// -----------------------------------------------------------------------------
+//
+bool QObject::connect( 
+        const QObject * sender,
+        const char * signal,
+        const QObject * receiver,
+        const char * member,
+        Qt:: ConnectionType )
+    {
+//    SMC_MOCK_METHOD5( bool, const QObject *, sender, 
+//        const char *, signal, 
+//        const QObject *, receiver, 
+//        const char *, member, 
+//        Qt::, ConnectionType )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::disconnect
+// -----------------------------------------------------------------------------
+//
+bool QObject::disconnect( 
+        const QObject * sender,
+        const char * signal,
+        const QObject * receiver,
+        const char * member )
+    {
+//    SMC_MOCK_METHOD4( bool, const QObject *, sender, 
+//        const char *, signal, 
+//        const QObject *, receiver, 
+//        const char *, member )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::dumpObjectTree
+// -----------------------------------------------------------------------------
+//
+void QObject::dumpObjectTree(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::dumpObjectInfo
+// -----------------------------------------------------------------------------
+//
+void QObject::dumpObjectInfo(  )
+    {
+    SMC_MOCK_METHOD0( void )
+    }
+
+#ifndef QT_NO_PROPERTIES
+// -----------------------------------------------------------------------------
+// QObject::setProperty
+// -----------------------------------------------------------------------------
+//
+bool QObject::setProperty( 
+        const char * name,
+        const QVariant & value )
+    {
+//    SMC_MOCK_METHOD2( bool, const char *, name, 
+//        const QVariant &, value )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::property
+// -----------------------------------------------------------------------------
+//
+QVariant QObject::property( 
+        const char * name ) const
+    {
+//    SMC_MOCK_METHOD1( QVariant, const char *, name )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::dynamicPropertyNames
+// -----------------------------------------------------------------------------
+//
+QList <QByteArray > QObject::dynamicPropertyNames(  ) const
+    {
+//    SMC_MOCK_METHOD0( QList <QByteArray > )
+    }
+#endif // QT_NO_PROPERTIES
+#ifndef QT_NO_USERDATA
+// -----------------------------------------------------------------------------
+// QObject::registerUserData
+// -----------------------------------------------------------------------------
+//
+uint QObject::registerUserData(  )
+    {
+    SMC_MOCK_METHOD0( uint )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::setUserData
+// -----------------------------------------------------------------------------
+//
+void QObject::setUserData( 
+        uint id,
+        QObjectUserData * data )
+    {
+//    SMC_MOCK_METHOD2( void, uint, id, 
+//        QObjectUserData *, data )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::userData
+// -----------------------------------------------------------------------------
+//
+QObjectUserData * QObject::userData( 
+        uint id ) const
+    {
+//    SMC_MOCK_METHOD1( QObjectUserData *, uint, id )
+    }
+#endif // QT_NO_USERDATA
+
+// -----------------------------------------------------------------------------
+// QObject::destroyed
+// -----------------------------------------------------------------------------
+//
+/*
+Q_SIGNALS : void QObject::destroyed( 
+        QObject * )
+    {
+    SMC_MOCK_METHOD1( Q_SIGNALS : void, QObject, * )
+    }*/
+
+
+// -----------------------------------------------------------------------------
+// QObject::deleteLater
+// -----------------------------------------------------------------------------
+//
+void QObject::deleteLater(  )
+    {
+  //  SMC_MOCK_METHOD0( Q_SLOTS : void )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::sender
+// -----------------------------------------------------------------------------
+//
+QObject * QObject::sender(  ) const
+    {
+ //   SMC_MOCK_METHOD0( QObject * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::receivers
+// -----------------------------------------------------------------------------
+//
+int QObject::receivers( 
+        const char * signal ) const
+    {
+    SMC_MOCK_METHOD1( int, const char *, signal )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::timerEvent
+// -----------------------------------------------------------------------------
+//
+void QObject::timerEvent( 
+        QTimerEvent * )
+    {
+ //   SMC_MOCK_METHOD1( void, QTimerEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::childEvent
+// -----------------------------------------------------------------------------
+//
+void QObject::childEvent( 
+        QChildEvent * )
+    {
+ //   SMC_MOCK_METHOD1( void, QChildEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::customEvent
+// -----------------------------------------------------------------------------
+//
+void QObject::customEvent( 
+        QEvent * )
+    {
+ //   SMC_MOCK_METHOD1( void, QEvent, * )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::connectNotify
+// -----------------------------------------------------------------------------
+//
+void QObject::connectNotify( 
+        const char * signal )
+    {
+ //   SMC_MOCK_METHOD1( void, const char *, signal )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::disconnectNotify
+// -----------------------------------------------------------------------------
+//
+void QObject::disconnectNotify( 
+        const char * signal )
+    {
+  //  SMC_MOCK_METHOD1( void, const char *, signal )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QObject::QObject
+// -----------------------------------------------------------------------------
+//
+QObject::QObject( 
+        QObjectPrivate & dd,
+        QObject * parent )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_qtranslator.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include <qcoreapplication.h>
+#include <smcmockclassincludes.h>
+#include "qtranslator.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// QTranslator::QTranslator
+// -----------------------------------------------------------------------------
+//
+QTranslator::QTranslator( 
+        QObject * parent )
+    :
+    QObject( parent )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// QTranslator::~QTranslator
+// -----------------------------------------------------------------------------
+//
+QTranslator::~QTranslator(  )
+    {
+    if (QCoreApplication::instance()) 
+        {
+        QCoreApplication::removeTranslator(this);
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// QTranslator::translate
+// -----------------------------------------------------------------------------
+//
+QString QTranslator::translate( 
+        const char * aContext,
+        const char * sourceText,
+        const char * disambiguation ) const
+    {
+    SMC_MOCK_METHOD3( QString, const char *, aContext, 
+        const char *, sourceText, 
+        const char *, disambiguation )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QTranslator::translate
+// -----------------------------------------------------------------------------
+//
+QString QTranslator::translate( 
+        const char * aContext,
+        const char * sourceText,
+        const char * disambiguation,
+        int n ) const
+    {
+    SMC_MOCK_METHOD4( QString, const char *, aContext, 
+        const char *, sourceText, 
+        const char *, disambiguation, 
+        int, n )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QTranslator::isEmpty
+// -----------------------------------------------------------------------------
+//
+bool QTranslator::isEmpty(  ) const
+    {
+    SMC_MOCK_METHOD0( bool )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QTranslator::load
+// -----------------------------------------------------------------------------
+//
+bool QTranslator::load( 
+        const QString & filename,
+        const QString & directory,
+        const QString & search_delimiters,
+        const QString & suffix )
+    {
+    SMC_MOCK_METHOD4( bool, const QString &, filename, 
+        const QString &, directory, 
+        const QString &, search_delimiters, 
+        const QString &, suffix )
+    }
+
+
+// -----------------------------------------------------------------------------
+// QTranslator::load
+// -----------------------------------------------------------------------------
+//
+bool QTranslator::load( 
+        const uchar * data,
+        int len )
+    {
+    SMC_MOCK_METHOD2( bool, const uchar *, data, 
+        int, len )
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_sssettingswrapper.cpp	Fri Jun 04 10:19:18 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "sssettingswrapper.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// SsSettingsWrapper::SsSettingsWrapper
+// -----------------------------------------------------------------------------
+//
+SsSettingsWrapper::SsSettingsWrapper( 
+        QObject * parent ) : QObject( parent )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// SsSettingsWrapper::~SsSettingsWrapper
+// -----------------------------------------------------------------------------
+//
+SsSettingsWrapper::~SsSettingsWrapper(  )
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// SsSettingsWrapper::get
+// -----------------------------------------------------------------------------
+//
+int SsSettingsWrapper::get( 
+        SsSettingsWrapperSettings setting,
+        int & value )
+    {
+    static int tmpValue = 0;
+    if(tmpValue == 0){
+        value = 0;
+        tmpValue = 1;
+    }else{
+        value = 2;
+        tmpValue = 0;
+    }
+    SMC_MOCK_METHOD2( int, SsSettingsWrapperSettings, setting, int&, value )
+    }
+
+// -----------------------------------------------------------------------------
+// SsSettingsWrapper::set
+// -----------------------------------------------------------------------------
+//
+int SsSettingsWrapper::set( 
+        SsSettingsWrapperSettings setting,
+        int value )
+    {
+    SMC_MOCK_METHOD2( int, SsSettingsWrapperSettings, setting, int, value )
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_xqsettingskey.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include <QDebug>
+#include "xqsettingskey.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::XQSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQSettingsKey::XQSettingsKey( 
+        XQSettingsKey::Target target,
+        long int uid,
+        unsigned long int key )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::~XQSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQSettingsKey::~XQSettingsKey(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::target
+// -----------------------------------------------------------------------------
+//
+XQSettingsKey::Target XQSettingsKey::target(  ) const
+    {
+    
+    XQSettingsKey::Target variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::uid
+// -----------------------------------------------------------------------------
+//
+long int XQSettingsKey::uid(  ) const
+    {
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsKey::key
+// -----------------------------------------------------------------------------
+//
+unsigned long int XQSettingsKey::key(  ) const
+    {
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQPublishAndSubscribeSettingsKey::XQPublishAndSubscribeSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQPublishAndSubscribeSettingsKey::XQPublishAndSubscribeSettingsKey( 
+        long int categoryUid,
+        unsigned long int key ) : 
+        XQSettingsKey( XQSettingsKey::TargetPublishAndSubscribe, categoryUid, key )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQPublishAndSubscribeSettingsKey::~XQPublishAndSubscribeSettingsKey
+// -----------------------------------------------------------------------------
+//
+XQPublishAndSubscribeSettingsKey::~XQPublishAndSubscribeSettingsKey(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQCentralRepositorySettingsKey::XQCentralRepositorySettingsKey
+// -----------------------------------------------------------------------------
+//
+XQCentralRepositorySettingsKey::XQCentralRepositorySettingsKey( 
+        long int repositoryUid,
+        unsigned long int key ) : 
+        XQSettingsKey( XQSettingsKey::TargetCentralRepository, repositoryUid, key )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQCentralRepositorySettingsKey::~XQCentralRepositorySettingsKey
+// -----------------------------------------------------------------------------
+//
+XQCentralRepositorySettingsKey::~XQCentralRepositorySettingsKey(  )
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_xqsettingsmanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <QDebug>
+#include <smcmockclassincludes.h>
+#include "xqsettingsmanager.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::XQSettingsManager
+// -----------------------------------------------------------------------------
+//
+XQSettingsManager::XQSettingsManager( 
+        QObject * parent )
+    : QObject( parent )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::~XQSettingsManager
+// -----------------------------------------------------------------------------
+//
+XQSettingsManager::~XQSettingsManager(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::readItemValue
+// -----------------------------------------------------------------------------
+//
+QVariant XQSettingsManager::readItemValue( 
+        const XQSettingsKey & key,
+        XQSettingsManager::Type type )
+    {
+    SMC_MOCK_METHOD2( QVariant, XQSettingsKey &, key, XQSettingsManager::Type, type )
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::writeItemValue
+// -----------------------------------------------------------------------------
+//
+bool XQSettingsManager::writeItemValue( 
+        const XQSettingsKey & key,
+        const QVariant & value )
+    {
+    Q_UNUSED( key )
+    Q_UNUSED( value )
+    bool variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::startMonitoring
+// -----------------------------------------------------------------------------
+//
+bool XQSettingsManager::startMonitoring( 
+        const XQSettingsKey & key,
+        XQSettingsManager::Type type )
+    {
+    Q_UNUSED( key )
+    Q_UNUSED( type )
+    bool variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::stopMonitoring
+// -----------------------------------------------------------------------------
+//
+bool XQSettingsManager::stopMonitoring( 
+        const XQSettingsKey & key )
+    {
+    Q_UNUSED( key )
+    bool variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSettingsManager::error
+// -----------------------------------------------------------------------------
+//
+XQSettingsManager::Error XQSettingsManager::error(  ) const
+    {
+    
+    XQSettingsManager::Error variable;
+    return variable;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/mock_xqsysinfo.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,222 @@
+/* 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QDebug>
+#include <smcmockclassincludes.h>
+#include "xqsysinfo.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::XQSysInfo
+// -----------------------------------------------------------------------------
+//
+XQSysInfo::XQSysInfo( 
+        QObject * parent )
+    //:
+    //QObject( /*parent*/ )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::~XQSysInfo
+// -----------------------------------------------------------------------------
+//
+XQSysInfo::~XQSysInfo(  )
+    {
+    
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::currentLanguage
+// -----------------------------------------------------------------------------
+//
+XQSysInfo::Language XQSysInfo::currentLanguage(  ) const
+    {
+    
+    XQSysInfo::Language variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::imei
+// -----------------------------------------------------------------------------
+//
+QString XQSysInfo::imei(  ) const
+    {
+    
+    QString variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::model
+// -----------------------------------------------------------------------------
+//
+QString XQSysInfo::model(  ) const
+    {
+    
+    QString variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::manufacturer
+// -----------------------------------------------------------------------------
+//
+QString XQSysInfo::manufacturer(  ) const
+    {
+    
+    QString variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::softwareVersion
+// -----------------------------------------------------------------------------
+//
+QString XQSysInfo::softwareVersion(  ) const
+    {
+    
+    QString variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::batteryLevel
+// -----------------------------------------------------------------------------
+//
+uint XQSysInfo::batteryLevel(  ) const
+    {
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::imsi
+// -----------------------------------------------------------------------------
+//
+QString XQSysInfo::imsi(  ) const
+    {
+    
+    QString variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::signalStrength
+// -----------------------------------------------------------------------------
+//
+int XQSysInfo::signalStrength(  ) const
+    {
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::diskSpace
+// -----------------------------------------------------------------------------
+//
+qlonglong XQSysInfo::diskSpace( 
+        XQSysInfo::Drive drive ) const
+    {
+    Q_UNUSED( drive )
+    qlonglong variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::isDiskSpaceCritical
+// -----------------------------------------------------------------------------
+//
+bool XQSysInfo::isDiskSpaceCritical( 
+        XQSysInfo::Drive drive ) const
+    {
+    Q_UNUSED( drive )
+    bool variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::isNetwork
+// -----------------------------------------------------------------------------
+//
+bool XQSysInfo::isNetwork(  ) const
+    {
+    
+    bool variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::memory
+// -----------------------------------------------------------------------------
+//
+int XQSysInfo::memory(  ) const
+    {
+    
+    return 0;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::browserVersion
+// -----------------------------------------------------------------------------
+//
+QString XQSysInfo::browserVersion(  ) const
+    {
+    
+    QString variable;
+    return variable;
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::isSupported
+// -----------------------------------------------------------------------------
+//
+bool XQSysInfo::isSupported( 
+        int featureId )
+    {
+    SMC_MOCK_METHOD1( bool, int, featureId )
+    }
+
+
+// -----------------------------------------------------------------------------
+// XQSysInfo::error
+// -----------------------------------------------------------------------------
+//
+XQSysInfo::Error XQSysInfo::error(  ) const
+    {
+    
+    XQSysInfo::Error variable;
+    return variable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/qtestmains60.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef QTESTMAINS60
+#define QTESTMAINS60
+
+#define QTEST_MAIN_S60(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+char *new_argv[3]; \
+QCoreApplication app(argc, argv); \
+\
+QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
+QByteArray   bytes  = str.toAscii(); \
+\
+char arg1[] = "-o"; \
+\
+new_argv[0] = argv[0]; \
+new_argv[1] = arg1; \
+new_argv[2] = bytes.data(); \
+\
+TestObject tc; \
+return QTest::qExec(&tc, 3, new_argv); \
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+#include "ut_mockintegrity.h"
+#include "qtestmains60.h"
+
+/*!
+  UT_CpDivertPlugin::UT_MockIntegrity
+ */
+UT_MockIntegrity::UT_MockIntegrity()
+{
+    
+}
+
+/*!
+  UT_CpDivertPlugin::~UT_MockIntegrity
+ */
+UT_MockIntegrity::~UT_MockIntegrity()
+{
+    
+}
+
+/*!
+  UT_CpDivertPlugin::init
+ */
+void UT_MockIntegrity::init()
+{
+    
+}
+
+/*!
+  UT_CpDivertPlugin::cleanup
+ */
+void UT_MockIntegrity::cleanup()
+{
+    
+}
+
+QTEST_MAIN_S60(UT_MockIntegrity)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.h	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#ifndef UT_MOCKINTEGRITY_H
+#define UT_MOCKINTEGRITY_H
+
+#include <QObject>
+#include <QtTest/QtTest>
+
+class UT_MockIntegrity : public QObject
+{
+    Q_OBJECT
+    
+public:    
+    UT_MockIntegrity();
+    ~UT_MockIntegrity();
+    
+private slots:
+    
+    void init();
+    void cleanup();
+};
+
+#endif // UT_MOCKINTEGRITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesettings/cpphonesettingsplugins/tsrc/mocks/ut_mockintegrity.pro	Fri Jun 04 10:19:18 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: Project file for building unit test component
+#
+
+CONFIG += qtestlib hb
+TEMPLATE = app
+TARGET = 
+MOC_DIR = moc
+
+INCLUDEPATH += .
+INCLUDEPATH += ../../barringplugin/inc
+INCLUDEPATH += ../../callsplugin/src
+INCLUDEPATH += ../../cptelephonyutils/inc
+INCLUDEPATH += ../../divertplugin/src
+INCLUDEPATH += ../../cpnetworkplugin/src
+INCLUDEPATH += ../../cpnetworkplugin/src
+INCLUDEPATH += ../../telephonyplugin/src
+INCLUDEPATH += /sf/mw/phonesrv/cellular/telephonysettings/xqbindings/psetwrapper/src
+
+DEFINES += BUILD_CPTELEPHONYUTILS BUILD_PSETWRAPPER BUILD_SSSETTINGSWRAPPER
+DEFINES += XQSYSINFO_LIBRARY XQSETTINGSMANAGER_LIBRARY
+
+QT -= gui
+QT += testlib
+
+symbian: { 
+    CONFIG += no_icon
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    LIBS += -lmocklib       \
+            -lsymbianmock   \
+            -lcpframework 
+}
+
+HEADERS += ut_mockintegrity.h
+
+HEADERS += ../../callsplugin/src/cpcallsplugin.h                \
+           ../../cptelephonyutils/inc/cpphonenotes.h            \
+           ../../cptelephonyutils/inc/cpplugincommon.h          \
+           /epoc32/include/platform/mw/psetwrapper.h            \
+           /epoc32/include/platform/mw/psetcliwrapper.h         \
+           /epoc32/include/platform/mw/sssettingswrapper.h      \
+           /epoc32/include/platform/mw/psetcallwaitingwrapper.h \
+           /epoc32/include/platform/mw/psetcalldivertingwrapper.h \
+           /epoc32/include/platform/mw/psetnetworkwrapper.h     \
+           /epoc32/include/platform/mw/psetcallbarringwrapper.h \
+           /epoc32/include/mw/xqsettingskey.h                   \
+           /epoc32/include/mw/xqsettingsmanager.h               \
+           /epoc32/include/mw/xqsysinfo.h
+
+SOURCES += *.cpp
+
+  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/bwins/TelephonyDeviceModeU.DEF	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?CTelDMHandlerCreateL@@YAPAVCTelDMHandler@@XZ @ 1 NONAME ; class CTelDMHandler * CTelDMHandlerCreateL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/eabi/telephonydevicemodeu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z20CTelDMHandlerCreateLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/group/TelephonyDeviceMode.mmp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project specification for Telephony Device Mode
+*
+*/
+
+#include <platform_paths.hrh>
+
+// Capability assignment.
+CAPABILITY CAP_GENERAL_DLL
+// Assign Vendor ID.
+VENDORID VID_DEFAULT
+
+TARGET          telephonydevicemode.dll
+TARGETTYPE      DLL
+UID             0x1000008d 0x1020299B
+
+SOURCEPATH      ../src
+SOURCE          cteldmhandlerimpl.cpp
+SOURCE          cteldmgriphandler.cpp
+SOURCE          cteldmcallstatelistener.cpp
+SOURCE          cteldmcommandhandler.cpp
+SOURCE          cteldmaudioaccessorylistener.cpp
+    
+USERINCLUDE     ../inc
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../../inc    // Telephony internal headers
+
+LIBRARY         euser.lib
+LIBRARY         featmgr.lib
+LIBRARY         avkon.lib
+LIBRARY         telephonyaudiorouting.lib
+LIBRARY         centralrepository.lib
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for TelephonyDeviceMode
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+telephonydevicemode_stub.sis   /epoc32/data/z/system/install/telephonydevicemode_stub.sis
+
+// IBY files
+../rom/telephonydevicemode.iby      CORE_APP_LAYER_IBY_EXPORT_PATH(telephonydevicemode.iby)
+ 
+PRJ_MMPFILES
+../group/telephonydevicemode.mmp
+
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/group/telephonydevicemode.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: Packing for telephony device mode.
+;
+; Languages
+&EN
+
+; Header
+#{"TelephonyDeviceMode"}, (0x1020299B), 10, 1, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+"\epoc32\RELEASE\armv5\UREL\TelephonyDeviceMode.dll"-"z:\sys\bin\TelephonyDeviceMode.dll"
Binary file phoneuis/TelephonyDeviceMode/group/telephonydevicemode_stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/group/telephonydevicemode_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: Packing of telephony device mode.
+;
+; Languages
+&EN
+
+; Header
+#{"TelephonyDeviceMode"}, (0x1020299B), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+;Files
+""-"z:\sys\bin\TelephonyDeviceMode.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/CTelDMAudioAccessoryListener.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Accessory mode.
+*
+*/
+
+
+#ifndef CTELDMAUDIOACCESSORYLISTENER_H
+#define CTELDMAUDIOACCESSORYLISTENER_H
+
+//  INCLUDE FILES   
+#include <MTelephonyAudioRoutingObserver.h>
+#include "mteldmaccessory.h"
+
+// FORWARD DECLARATIONS
+
+//  CLASS DEFINITIONS 
+class CTelephonyAudioRouting;
+
+/**
+* Class for listening accessory mode and routing changes. 
+*
+* @lib telephonydevicemode.dll
+* @since 3.1
+*/
+NONSHARABLE_CLASS( CTelDMAudioAccessoryListener ): public CBase,
+                          public MTelDMAccessory,
+                          public MTelephonyAudioRoutingObserver
+    {
+    public: // constructor & destructor
+
+        /** 
+        * Two phase constructor 
+        */
+        static CTelDMAudioAccessoryListener* NewL();
+
+        // Destructor
+        virtual ~CTelDMAudioAccessoryListener( );
+
+
+    public: // from MTelDMAccessory
+
+        /**
+        * See MTelDMAccessory
+        */
+        TBool IsAccessoryAttached();
+        
+        /**
+        * See MTelDMAccessory
+        */
+        TBool IsAnyActiveAccessory();
+    
+    public: //from  MTelephonyAudioRoutingObserver 
+    
+        void AvailableOutputsChanged( CTelephonyAudioRouting& 
+                                                aTelephonyAudioRouting);
+        
+        void OutputChanged( CTelephonyAudioRouting& 
+                                        aTelephonyAudioRouting);
+        
+        void SetOutputComplete( CTelephonyAudioRouting& 
+                                            aTelephonyAudioRouting, 
+                                            TInt aError); 
+    private: // Constructor
+        
+        /** c++ constructor */
+        CTelDMAudioAccessoryListener();
+
+        /** 2nd phase constructor */
+        void ConstructL();
+        
+        
+    private: 
+    
+        // Array of available outputs         
+        RArray<CTelephonyAudioRouting::TAudioOutput> iOutputArray;
+        
+        // Current accessory mode.
+        TBool iIsActiveAccessory;
+        
+        // Audio routing API 
+        CTelephonyAudioRouting* iAudioRouting;
+        
+    };
+    
+#endif // CTELDMAUDIOACCESSORYLISTENER_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/CTelDMCallStateListener.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MTelDMCallStateObserver class.
+*
+*/
+
+
+
+#ifndef CTELDMCALLSTATELISTENER_H
+#define CTELDMCALLSTATELISTENER_H
+
+//  INCLUDES
+#include    <e32property.h>
+#include    <e32base.h>
+
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class MTelDMCallStateObserver;
+
+/**
+*  Call state listener. Listening TelephonyCallState PS key. 
+*
+*  @since 3.1
+*/
+ 
+NONSHARABLE_CLASS( CTelDMCallStateListener ) : public CActive
+    {
+    public: // Constructors and destructors.
+
+        /**
+        * Two-phased constructor.
+        */ 
+        static CTelDMCallStateListener* NewL();
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CTelDMCallStateListener();
+
+   
+    public:
+   
+        void AddObserverL( MTelDMCallStateObserver& aCallStateObserver );
+        
+    private: // from CActive
+   
+        /**
+        * @see CActive::RunL.
+        */
+        void RunL();
+
+        /**
+        * @see CActive::DoCancel.
+        */
+        void DoCancel();
+     
+    private:
+        
+        /**
+        * Handle notification request
+        */      
+        void HandleChange();
+        
+        /**
+        * Start notification.
+        */
+        void IssueRequest();
+        
+        /**
+        * Constructor.
+        */
+        CTelDMCallStateListener();
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+   
+    private:
+        // Owned Publish & Subscribe instance.
+        RProperty iProperty;
+        
+        // Call state
+        TInt iCallState;
+        
+        // Call State Change Observer array.
+        RPointerArray< MTelDMCallStateObserver > iObserverArray;
+    };
+ 
+#endif      // CTELDMCALLSTATELISTENER_H  
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/CTelDMCommandHandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for CTelDMCommandHandler class.
+*
+*/
+
+
+#ifndef CTELDMCOMMANDHANDLER_H
+#define CTELDMCOMMANDHANDLER_H
+
+//  INCLUDE FILES   
+
+#include    <e32base.h>
+#include    <aknkeylock.h>  
+#include    "mteldmcallstateobserver.h"
+
+// FORWARD DECLARATIONS
+
+//  CLASS DEFINITIONS 
+
+class MTelDMAcessory;
+class MPhoneDeviceModeObserver;
+class MTelDMAccessory;
+class CTelDMCallStateListener;
+/**
+* Class for command 
+*
+* @lib telephonydevicemode.dll
+* @since 3.1
+*/
+NONSHARABLE_CLASS( CTelDMCommandHandler ): public CBase,
+                            public MTelDMCallStateObserver
+    {
+    public: // constructor & destructor
+
+        /** 
+        * Two phase constructor 
+        */
+        static CTelDMCommandHandler* NewL( MPhoneDeviceModeObserver& aCallHandler, 
+                                            MTelDMAccessory& aAccessory );
+
+        // Destructor
+        virtual ~CTelDMCommandHandler();
+
+    public: 
+    
+        enum TCommands
+            {
+            EGripOpen,
+            EGripClose
+            };
+    
+        void HandleCommand( TCommands aCommand );
+        
+    public: // from MTelDMCallStateObserver
+        
+        /** See MTelDMCallStateObserver.h */
+        void CallStateChangedL( TInt aCallState );
+    
+    
+    private: // Constructor
+        
+        /** c++ constructor */
+        CTelDMCommandHandler( MPhoneDeviceModeObserver& aCallHandler, 
+                                MTelDMAccessory& aAccessory );
+
+        /** 2nd phase constructor */
+        void ConstructL();
+        
+    private:
+    
+        /**
+        * Ends calls
+        */
+        void EndCalls();
+        
+        /**
+        * Offer key lock query.
+        */
+        void OfferKeyLock();
+        
+        /**
+        * Check emergency call
+        * @return status of emergency call
+        */
+        TBool IsEmergencyCall() const;
+        
+        /**
+        * Check soft reject
+        * @return status of soft reject operation
+        */
+        TBool IsSoftRejectOngoing() const;
+        
+    private: 
+    
+        // Reference to device mode observer
+        MPhoneDeviceModeObserver& iCallHandler;
+        
+        // Reference to accessory listene
+        MTelDMAccessory& iAccessory; 
+        
+        // For keypad locking.
+        RAknKeyLock iKeyLock;
+        
+        // Is grip open ?
+        TBool iGripOpen;
+        
+        // Grip open when ringing state ?
+        TBool iGripOpenOnRingingState; 
+        
+        // Call state
+        TInt iCallState;
+        
+    };
+    
+#endif // CTELDMCOMMANDHANDLER_H
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/CTelDMDebug.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file defines logging macros for TelephonyDeviceMode
+*
+*/
+
+
+
+#ifndef CTELDMDEBUG_H
+#define CTELDMDEBUG_H
+
+#ifdef _DEBUG
+// ===========================================================================
+                  // RDebug logging for target HW
+// ===========================================================================
+#include <e32svr.h>
+
+#define FLOG( a )   { RDebug::Print( a ); }
+#define FTRACE( a ) { a; }
+
+// Declare the FPrint function
+//
+inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    TInt tmpInt = VA_ARG( list, TInt );
+    TInt tmpInt2 = VA_ARG( list, TInt );
+    TInt tmpInt3 = VA_ARG( list, TInt );
+    VA_END( list );
+    RDebug::Print( aFmt, tmpInt, tmpInt2, tmpInt3 );
+    }
+
+// ===========================================================================
+#else // // No loggings --> Reduced binary size
+// ===========================================================================
+#define FLOG( a )
+#define FTRACE( a )
+
+#endif // _DEBUG
+
+#endif      // 
+            
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/CTelDMGripHandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Concrete session class for Telephony Device Mode
+*
+*/
+
+
+
+#ifndef CTELDMGRIPHANDLER_H
+#define CTELDMGRIPHANDLER_H
+
+//  INCLUDES
+
+#include    <e32property.h>
+#include    <e32base.h>
+
+
+// FORWARD DECLARATIONS
+
+class MPhoneDeviceModeObserver;
+class MTelDMAccessory;
+class CTelDMCommandHandler;
+
+// CLASS DECLARATION
+
+/**
+*  Concrete session class for Telephony Device Mode
+*
+*  @since 3.0
+*/
+ 
+NONSHARABLE_CLASS( CTelDMGripHandler ) : public CActive
+    {
+    public: // Constructors and destructors.
+
+        /**
+        * Two-phased constructor.
+        */ 
+        static CTelDMGripHandler* NewL( CTelDMCommandHandler& aCommandHandler );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CTelDMGripHandler();
+
+    public: // New functions
+          
+    public: // Functions from base classes
+   
+    private: // Functions from base classes  
+   
+        /**
+        * @see CActive::RunL.
+        */
+        void RunL();
+
+        /**
+        * @see CActive::DoCancel.
+        */
+        void DoCancel();
+     
+    private:
+        
+        /**
+        * Handle notification request
+        */      
+        void HandleChange();
+        
+        /**
+        * Start notification.
+        */
+        void IssueRequest();
+        
+        /**
+        * Constructor.
+        */
+        CTelDMGripHandler( CTelDMCommandHandler& aCommandHandler );
+
+        /**
+        * Symbian OS constructor.
+        */
+        void ConstructL();
+        
+        /**
+        * Check phone settings
+        * @return Status of settings value
+        */
+        TBool IsSliderCallAnswer() const;
+        
+        /**
+        * Check phone settings
+        * @return Status of settings value
+        */        
+        TBool IsSliderCallEnd()const;
+        
+        /**
+        * Get integer value of setting
+        * @param aUid identifing the central repository UID.
+        * @param aId central repository ID.
+        * @param aValue the value associated with the central repository ID
+        * @return
+        */
+        TInt CTelDMGripHandler::GetInt( 
+            const TUid& aUid, 
+            const TUint aId,
+            TInt& aValue ) const;
+            
+    private:
+        // Owned Publish & Subscribe instance.
+        RProperty iProperty;
+      
+        // Reference to commander
+        CTelDMCommandHandler& iCommandHandler;       
+        
+
+    };
+ 
+#endif      // CTELDMGRIPHANDLER_H  
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/CTelDMHandlerImpl.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation class for for Telephony Device Mode
+*
+*/
+
+
+
+#ifndef CTELDMHANDLERIMPL_H
+#define CTELDMHANDLERIMPL_H
+
+#include    <e32base.h>
+#include    <cteldmhandler.h>
+#include    <bldvariant.hrh>
+
+// FORWARD DECLARATIONS
+
+class MPhoneDeviceModeObserver;
+class CTelDMCallStateListener;
+class CTelDMGripHandler;
+class CTelDMCommandHandler;
+class CTelDMAudioAccessoryListener;
+class MTelDMAccessory;
+
+
+// CLASS DECLARATION
+ 
+ 
+NONSHARABLE_CLASS( CTelDMHandlerImpl ) : public CTelDMHandler
+    {
+    public: // Constructors and destructors.
+
+        /**
+        * Two-phased constructor.
+        *
+        * @return new instance of the class.
+        */
+        static CTelDMHandlerImpl* NewL();
+        
+        /** D'tor. */
+        virtual ~CTelDMHandlerImpl();
+
+    public: // From base classes.
+
+        /**
+        * Set call event observer
+        * @return void
+        */
+        void SetObserverL( MPhoneDeviceModeObserver* aCallHandler );
+ 
+    private:
+
+        /**
+        * C++ constructor.
+        */
+        CTelDMHandlerImpl();
+        
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+    
+    
+    private:  
+    
+        /**
+        * Grip handler, Owned 
+        */
+        CTelDMGripHandler* iGrip;
+        
+        /**
+        * Accessory status, Owned 
+        */
+        CTelDMAudioAccessoryListener* iAccessory;
+         
+        /**
+        * Call state listener, Owned 
+        */
+        CTelDMCallStateListener* iCallStateListener;
+
+        /**
+        * Commander, Owned 
+        */      
+        CTelDMCommandHandler* iCommandHandler;
+
+    };
+
+
+#endif      // CTELDMHANDLERIMPL_H  
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/MTelDMAccessory.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MTelDMAccessory class.
+*                
+*
+*/
+
+
+#ifndef MTELDMACCESSORY_H
+#define MTELDMACCESSORY_H
+
+// INCLUDES
+
+//CLASS DECLARATION
+
+/**
+* Accessory mode 
+*
+*  @since 3.1
+*/
+class MTelDMAccessory 
+    {
+ 
+    public: // New functions
+ 
+        /**
+        * Is accessory attached ?
+        * @param  none
+        * @return True if accessory attached.
+        */
+        virtual TBool IsAccessoryAttached() = 0;
+        
+        /**
+        * Is any active accessory ? 
+        * @param  none
+        * @return True if active accessory.
+        */
+        virtual TBool IsAnyActiveAccessory() = 0;
+
+     };
+
+#endif      // MTELDMACCESSORY_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/inc/MTelDMCallStateObserver.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Header file for MTelDMCallStateObserver class.
+*                
+*
+*/
+
+
+#ifndef MTELDMSTATEOBSERVER_H
+#define MTELDMSTATEOBSERVER_H
+
+// INCLUDES
+
+//CLASS DECLARATION
+
+/**
+* Call state mode observer.
+*
+*  @since 3.1
+*/
+class MTelDMCallStateObserver 
+    {
+ 
+    public: // New functions
+
+        /**
+        * Notify changes of calls
+        * @param  Call state from TelephonyInternalPSKeys.h
+        * @return none
+        */
+        virtual void CallStateChangedL( TInt aCallState ) = 0;
+
+     };
+
+#endif      // MTELDMSTATEOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/rom/telephonydevicemode.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  IBY file for telephony device mode.
+ *
+*/
+
+#ifndef __TELEPHONYDEVICEMODE_IBY__
+#define __TELEPHONYDEVICEMODE_IBY__
+
+file=ABI_DIR\BUILD_DIR\telephonydevicemode.dll            SHARED_LIB_DIR\telephonydevicemode.dll
+data=ZSYSTEM\Install\telephonydevicemode_stub.sis         \System\Install\telephonydevicemode_stub.sis
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/src/CTelDMAudioAccessoryListener.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Accessory mode.
+*
+*/
+
+
+//  INCLUDE FILES
+#include    "cteldmaudioaccessorylistener.h"               // this
+#include    "cteldmdebug.h"
+#include    <TelephonyAudioRouting.h>
+
+//  CONSTANTS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::NewL
+//
+// Two phase constructor
+// -----------------------------------------------------------------------------
+//
+CTelDMAudioAccessoryListener* CTelDMAudioAccessoryListener::NewL()
+    {    
+    CTelDMAudioAccessoryListener* self = new ( ELeave ) CTelDMAudioAccessoryListener( );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::~CTelDMAudioAccessoryListener
+//
+// -----------------------------------------------------------------------------
+//
+CTelDMAudioAccessoryListener::~CTelDMAudioAccessoryListener( )
+    {
+    FLOG( _L( "CTelDMAudioAccessoryListener::~CTelDMAudioAccessoryListener()" ) )
+    delete iAudioRouting;
+    iOutputArray.Reset();
+    iOutputArray.Close();
+    }
+    
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::CTelDMAudioAccessoryListener
+//
+// -----------------------------------------------------------------------------
+//
+CTelDMAudioAccessoryListener::CTelDMAudioAccessoryListener( ):
+                    iIsActiveAccessory ( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::ConstructL
+//
+// -----------------------------------------------------------------------------
+//
+void CTelDMAudioAccessoryListener::ConstructL()
+    {
+    FLOG( _L( "CTelDMAudioAccessoryListener::ConstructL<" ) )
+    // Audio route handler 
+    iAudioRouting = CTelephonyAudioRouting::NewL( *this );
+    FLOG( _L( "CTelDMAudioAccessoryListener::ConstructL>" ) )
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::AvailableOutputsChanged
+// Receives event on accessory mode change.
+//
+// -----------------------------------------------------------------------------
+//
+void CTelDMAudioAccessoryListener::AvailableOutputsChanged( CTelephonyAudioRouting& 
+                                            aTelephonyAudioRouting )
+    {
+    FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged<" ) )
+    iOutputArray.Reset();
+        
+    TArray<CTelephonyAudioRouting::TAudioOutput> availableOutputs 
+                            = aTelephonyAudioRouting.AvailableOutputs();
+    
+    // Stores available output
+    for ( TInt i=0; i< availableOutputs.Count();i++ )
+        {
+        iOutputArray.Append( availableOutputs[i] );
+        }
+    
+    FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged>" ) )  
+    }
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::OutputChanged
+//
+// -----------------------------------------------------------------------------
+//  
+void CTelDMAudioAccessoryListener::OutputChanged( CTelephonyAudioRouting& 
+                                    aTelephonyAudioRouting)
+    {
+    FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged<" ) )
+    CTelephonyAudioRouting::TAudioOutput output = aTelephonyAudioRouting.Output();
+    
+        switch ( output )
+        {
+        // No active outputs available
+        case CTelephonyAudioRouting::ENone:
+            iIsActiveAccessory = EFalse;
+            break;
+        case CTelephonyAudioRouting::EHandset:
+            iIsActiveAccessory = EFalse;
+            break;
+        case CTelephonyAudioRouting::ELoudspeaker:
+            iIsActiveAccessory = EFalse;
+            break;
+        // Active outputs available
+        case CTelephonyAudioRouting::EWiredAudioAccessory:
+            iIsActiveAccessory = ETrue;
+            break;
+        case CTelephonyAudioRouting::EBTAudioAccessory:
+            iIsActiveAccessory = ETrue;
+            break;
+        case CTelephonyAudioRouting::ETTY:
+            iIsActiveAccessory = ETrue;
+            break;          
+        default:
+            break;     
+        }
+    FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged =%d"), 
+                                                            iIsActiveAccessory ))
+    FLOG( _L( "CTelDMAudioAccessoryListener::AvailableOutputsChanged>" ) )
+    }
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::SetOutputComplete
+//
+// -----------------------------------------------------------------------------
+//  
+void CTelDMAudioAccessoryListener::SetOutputComplete( CTelephonyAudioRouting& 
+                                        /*aTelephonyAudioRouting*/, 
+                                        TInt /*aError*/)
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::IsAnyActiveAccessory
+//
+// -----------------------------------------------------------------------------
+//
+TBool CTelDMAudioAccessoryListener::IsAnyActiveAccessory()
+    {
+    FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::IsAnyActiveAccessory =%d"), 
+                                                            iIsActiveAccessory ))
+    return iIsActiveAccessory;
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMAudioAccessoryListener::IsAccessoryAttached
+//
+// -----------------------------------------------------------------------------
+//
+TBool CTelDMAudioAccessoryListener::IsAccessoryAttached()
+    {
+                
+    TBool accessroryAttached = EFalse;
+    
+    for ( TInt i=0; i < iOutputArray.Count();i++ )
+        {
+        if ( iOutputArray[i] == CTelephonyAudioRouting::EWiredAudioAccessory ||
+             iOutputArray[i] == CTelephonyAudioRouting::EBTAudioAccessory ||
+             iOutputArray[i] == CTelephonyAudioRouting::ETTY )
+            {
+            accessroryAttached = ETrue;
+            break;                
+            } 
+        }
+    FTRACE( FPrint( _L( "CTelDMAudioAccessoryListener::IsAccessoryAttached =%d"), 
+                                                            accessroryAttached ))
+    return accessroryAttached;
+    }
+    
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/src/CTelDMCallStateListener.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CTelDMCallStateListener class.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "cteldmcallstatelistener.h"
+#include    "mteldmcallstateobserver.h"
+#include    "mteldmaccessory.h"
+
+#include    <ctsydomainpskeys.h>
+
+// MODULE DATA STRUCTURES
+ 
+// ============================ MEMBER FUNCTIONS ===============================
+ 
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::NewL
+// 
+// -----------------------------------------------------------------------------
+//  
+CTelDMCallStateListener* CTelDMCallStateListener::NewL() 
+    {
+    
+    CTelDMCallStateListener* self =
+        new ( ELeave ) CTelDMCallStateListener;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::CTelDMCallStateListener
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMCallStateListener::CTelDMCallStateListener():
+CActive( CActive::EPriorityStandard )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::~CTelDMCallStateListener
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMCallStateListener::~CTelDMCallStateListener()
+    {
+    Cancel();
+    iProperty.Close();
+    iObserverArray.Reset();
+    iObserverArray.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//    
+void CTelDMCallStateListener::ConstructL()
+    {
+    /// Attach to key. Start listening call state changes.
+    iProperty.Attach( KPSUidCtsyCallInformation, KCTsyCallState );
+    IssueRequest();                               
+      
+    }
+ 
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::HandleChange
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMCallStateListener::HandleChange()
+    {
+    TInt err( KErrNone );
+    iCallState = KErrNone;
+    err = RProperty::Get( KPSUidCtsyCallInformation, 
+                            KCTsyCallState,
+                            iCallState );
+    if ( err == KErrNone )
+        {                   
+        for ( TInt i = 0; i < iObserverArray.Count(); i++ ) 
+            {
+            TRAP_IGNORE( iObserverArray[ i ]->CallStateChangedL(iCallState) );
+            }
+        }
+    } 
+  
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::RunL
+// Cannot leave, no RunError implementation
+// -----------------------------------------------------------------------------
+//
+void CTelDMCallStateListener::RunL()
+    { 
+    if ( iStatus.Int() == KErrNone )
+        {
+        HandleChange();    
+        }
+    IssueRequest();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::DoCancel
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMCallStateListener::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::IssueRequest
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMCallStateListener::IssueRequest()
+    {
+    if ( !IsActive() )
+        {        
+        iProperty.Subscribe( iStatus );
+        SetActive();
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CTelDMCallStateListener::AddObserver
+// 
+// -----------------------------------------------------------------------------
+void CTelDMCallStateListener::AddObserverL( MTelDMCallStateObserver& 
+                                                            aCallStateObserver )
+    {
+    if ( iObserverArray.Find( &aCallStateObserver ) != KErrNone )
+        {
+        User::LeaveIfError( iObserverArray.Append( &aCallStateObserver ) );
+        }
+    }
+
+ 
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/src/CTelDMCommandHandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CTelDMCommandHandler class.
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include    <mphonedevicemodeobserver.h>
+#include    <PSVariables.h>
+#include    <ctsydomainpskeys.h>
+
+#include    "cteldmcommandhandler.h"
+#include    "cteldmcallstatelistener.h"
+#include    "mteldmaccessory.h"
+#include    "cteldmdebug.h"
+#include     <coreapplicationuisdomainpskeys.h>
+
+// MODULE DATA STRUCTURES
+ 
+// ============================ MEMBER FUNCTIONS ===============================
+ 
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::NewL
+// 
+// -----------------------------------------------------------------------------
+//  
+CTelDMCommandHandler* CTelDMCommandHandler::NewL( 
+                                    MPhoneDeviceModeObserver& aCallHandler, 
+                                    MTelDMAccessory& aAccessory ) 
+    {
+    CTelDMCommandHandler* self =
+        new ( ELeave ) CTelDMCommandHandler( aCallHandler, 
+                                                aAccessory );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::CTelDMCommandHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMCommandHandler::CTelDMCommandHandler( 
+                                    MPhoneDeviceModeObserver& aCallHandler, 
+                                    MTelDMAccessory& aAccessory ):
+    iCallHandler( aCallHandler ),
+    iAccessory ( aAccessory ),
+    iGripOpen ( EFalse ),
+    iGripOpenOnRingingState ( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::~CTelDMCommandHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMCommandHandler::~CTelDMCommandHandler()
+    {
+    iKeyLock.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//    
+void CTelDMCommandHandler::ConstructL()
+    { 
+    User::LeaveIfError( iKeyLock.Connect() );                             
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::CallStateChanged()
+// 
+// -----------------------------------------------------------------------------
+//    
+void CTelDMCommandHandler::CallStateChangedL( TInt aCallState )
+    {
+    FLOG( _L( "CTelDMCommandHandler::CallStateChanged<" ) )
+    FTRACE( FPrint( _L( "CTelDMCommandHandler::CallStateChangedL.aCallState=%d"), 
+                                                                aCallState ))
+    iCallState = aCallState;                                                            
+    switch( aCallState )
+        {  
+        // Arriving call                    
+        case EPSCTsyCallStateRinging: 
+            FLOG( _L( "CTelDMCommandHandler::CallStateChanged.Ringing" ) )
+            RProperty::Set( KPSUidCoreApplicationUIs,
+                            KCoreAppUIsSoftReject,
+                            ECoreAppUIsSoftRejectUninitialized );
+            iGripOpenOnRingingState = iGripOpen;
+            break;
+        // Answered
+        case EPSCTsyCallStateConnected:  
+            {   
+            FLOG( _L( "CTelDMCommandHandler::CallStateChanged.Connected" ) )
+            if ( iGripOpenOnRingingState )
+                {
+                OfferKeyLock(); 
+                }
+            
+            // Clear the flag.
+            iGripOpenOnRingingState = EFalse;
+            }
+            break;
+        // Disconnected 
+        case EPSCTsyCallStateNone:
+            {
+            FLOG( _L( "CTelDMCommandHandler::CallStateChanged.None" ) )
+            if ( iGripOpenOnRingingState )
+                {
+                OfferKeyLock(); 
+                }           
+            }
+            break; 
+        default:
+            break;
+        }     
+    FLOG( _L( "CTelDMCommandHandler::CallStateChanged>" ) )  
+    }
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::HandleEvent
+// 
+// -----------------------------------------------------------------------------
+//    
+void CTelDMCommandHandler::HandleCommand( TCommands aCommand )
+    {           
+    FLOG( _L( "CTelDMCommandHandler::HandleCommand<" ) ) 
+    switch( aCommand )
+        {                      
+        case EGripOpen:
+            {
+            FLOG( _L( "CTelDMCommandHandler::HandleCommand.Open" ) ) 
+            iGripOpen = ETrue;
+            if ( !IsSoftRejectOngoing() )
+                {
+                iCallHandler.Answer();
+                }
+            }
+            break;
+        // Do not end calls if accessory is connected. 
+        case EGripClose:
+            {
+            FLOG( _L( "CTelDMCommandHandler::HandleCommand.Close" ) ) 
+            iGripOpen = EFalse;
+            EndCalls();
+            break;
+            }
+        default:
+            break;
+        }  
+    FLOG( _L( "CTelDMCommandHandler::HandleCommand>" ) )      
+    }
+    
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::EndCalls
+// 
+// -----------------------------------------------------------------------------
+//    
+void CTelDMCommandHandler::EndCalls()
+
+    {
+    if ( IsEmergencyCall() )
+        {
+        // None
+        }
+    else if ( iAccessory.IsAccessoryAttached()  &&
+              !iAccessory.IsAnyActiveAccessory() &&
+              iCallState == EPSCTsyCallStateConnected )
+        {
+        FLOG( _L( "CTelDMCommandHandler::EndCalls#1" ) )
+        iCallHandler.EndVoiceCalls();
+        }
+    else if ( !iAccessory.IsAccessoryAttached() )
+        {
+        FLOG( _L( "CTelDMCommandHandler::EndCalls#2" ) )
+        iCallHandler.EndVoiceCalls();
+        }
+    }
+// -----------------------------------------------------------------------------
+// CTelDMCommandHandler::OfferKeyLock
+//
+// -----------------------------------------------------------------------------
+//
+void CTelDMCommandHandler::OfferKeyLock()
+
+    {
+    //- AudioAccessory attached (BT headset, Wired headset etc.)
+    //- Arriving call and grip open.  
+    //- Call terminated or answered  
+    //-> KeyLock query is shown if not locked       
+    if ( iAccessory.IsAccessoryAttached() && 
+                                       !iGripOpen && 
+                                       !iKeyLock.IsKeyLockEnabled() )
+        {
+        FLOG( _L( "CTelDMCommandHandler::CallStateChanged -lock?" ) ) 
+        //Lock keypad ?
+        iKeyLock.OfferKeyLock();
+        }  
+    }
+
+// ---------------------------------------------------------
+// CTelDMCommandHandler::IsEmergencyCall
+// ---------------------------------------------------------
+//
+TBool CTelDMCommandHandler::IsEmergencyCall() const
+    {
+    FLOG( _L( "CTelDMCommandHandler::IsEmergencyCall" ) ) 
+    TBool retVal( EFalse );
+    TInt err( KErrNone );
+    TInt state( 0 );
+    
+    err = RProperty::Get(
+            KPSUidCtsyEmergencyCallInfo,
+            KCTSYEmergencyCallInfo,
+            state );
+    
+    if ( err == KErrNone && state )
+        {
+        retVal = ETrue;            
+        }
+    return retVal;
+    }
+
+// ---------------------------------------------------------
+// CTelDMCommandHandler::IsSoftRejectOngoing
+// ---------------------------------------------------------
+//
+TBool CTelDMCommandHandler::IsSoftRejectOngoing() const
+    {
+    FLOG( _L( "CTelDMCommandHandler::IsSoftRejectOngoing" ) )
+    TBool retVal( EFalse );
+    TInt err( KErrNone );
+    TInt state( 0 );
+        
+    err = RProperty::Get(
+            KPSUidCoreApplicationUIs,
+            KCoreAppUIsSoftReject,
+            state );
+    
+    if ( err == KErrNone && state == ECoreAppUIsSoftReject )
+        {
+        retVal = ETrue;            
+        }
+    return retVal;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/src/CTelDMGripHandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CTelDMGripHandler class.
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include    <mphonedevicemodeobserver.h>
+#include    <hwrmdomainpskeys.h>
+#include    "cteldmgriphandler.h"
+#include    "mteldmaccessory.h"
+#include    "cteldmcommandhandler.h"
+#include    <settingsinternalcrkeys.h>
+#include    <centralrepository.h>
+
+// MODULE DATA STRUCTURES
+ 
+// ============================ MEMBER FUNCTIONS ===============================
+ 
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::NewL
+// 
+// -----------------------------------------------------------------------------
+//  
+CTelDMGripHandler* CTelDMGripHandler::NewL( CTelDMCommandHandler& aCommandHandler ) 
+    {
+    
+    CTelDMGripHandler* self =
+        new ( ELeave ) CTelDMGripHandler( aCommandHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::CTelDMGripHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMGripHandler::CTelDMGripHandler( CTelDMCommandHandler& aCommandHandler ):
+CActive( CActive::EPriorityStandard ),
+iCommandHandler ( aCommandHandler )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::~CTelDMGripHandler
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMGripHandler::~CTelDMGripHandler()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//    
+void CTelDMGripHandler::ConstructL()
+    {    
+    /// Attach to key. Start listening for changes.
+    iProperty.Attach( KPSUidHWRM, KHWRMGripStatus );
+    IssueRequest();                               
+    }
+ 
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::HandleChange
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMGripHandler::HandleChange()
+    {
+    TInt err( KErrNone );
+    TInt state( KErrNone ); 
+    err = RProperty::Get(
+        KPSUidHWRM,
+        KHWRMGripStatus,
+        state );
+ 
+    if ( err == KErrNone && state == EPSHWRMGripOpen && IsSliderCallAnswer() )
+        {
+        iCommandHandler.HandleCommand( CTelDMCommandHandler::EGripOpen ); 
+        }
+    else if ( err == KErrNone && state == EPSHWRMGripClosed && IsSliderCallEnd())
+        {
+        iCommandHandler.HandleCommand( CTelDMCommandHandler::EGripClose );
+        }
+    } 
+ 
+ 
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::RunL
+// Cannot leave, no RunError implementation
+// -----------------------------------------------------------------------------
+//
+void CTelDMGripHandler::RunL()
+    { 
+    if ( iStatus.Int() == KErrNone )
+        {
+        HandleChange();    
+        }
+    IssueRequest();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::DoCancel
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMGripHandler::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMGripHandler::IssueRequest
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMGripHandler::IssueRequest()
+    {
+    if ( !IsActive() )
+        {        
+        iProperty.Subscribe( iStatus );
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::IsSliderCallAnswer
+// ---------------------------------------------------------
+//
+TBool CTelDMGripHandler::IsSliderCallAnswer() const
+    {
+    TInt answerEnabled = 0;
+    TBool retVal ( EFalse );
+    TInt err = GetInt(          
+        KCRUidTelephonySettings,
+        KSettingsOpeningSlideAnswer,
+        answerEnabled );
+        
+    if ( err == KErrNone && answerEnabled )
+        {
+        retVal = ETrue;            
+        }
+    return retVal;
+    }
+
+// ---------------------------------------------------------
+// CPhoneState::IsSliderCallEnd
+// ---------------------------------------------------------
+//
+TBool CTelDMGripHandler::IsSliderCallEnd() const
+    {
+    TInt endEnabled = 0;
+    TBool retVal ( EFalse );
+    TInt err = GetInt(          
+        KCRUidTelephonySettings,
+        KSettingsClosingSlideEnd,
+        endEnabled );
+        
+    if ( err == KErrNone && endEnabled )
+        {
+        retVal = ETrue;            
+        }
+    return retVal;
+    }
+
+// ---------------------------------------------------------
+// CTelDMGripHandler::GetInt
+// ---------------------------------------------------------
+//
+TInt CTelDMGripHandler::GetInt( 
+    const TUid& aUid, 
+    const TUint aId,
+    TInt& aValue ) const
+    {
+    CRepository* repository = NULL;
+    TRAPD( err, repository = CRepository::NewL( aUid ) );
+    if ( err == KErrNone )
+        {
+        err = repository->Get( aId, aValue );
+        delete repository;
+        }
+    return err;
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/src/CTelDMHandlerImpl.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of the CTelDMFactoryImpl class.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <featmgr.h>
+#include    <mphonedevicemodeobserver.h>
+#include    <telinternalpskeys.h>
+#include    "cteldmhandlerimpl.h"
+#include    "cteldmgriphandler.h"
+#include    "cteldmcommandhandler.h"
+#include    "cteldmcallstatelistener.h"
+#include    "cteldmaudioaccessorylistener.h"
+#include    "cteldmdebug.h"
+ 
+// MODULE DATA STRUCTURES
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl
+// 
+// Creates instance of telephony device mode factory.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTelDMHandler* CTelDMHandlerCreateL()
+    {
+    return CTelDMHandlerImpl::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::CTelDMHandlerImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CTelDMHandlerImpl::CTelDMHandlerImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::~CTelDMHandlerImpl
+// -----------------------------------------------------------------------------
+//    
+CTelDMHandlerImpl::~CTelDMHandlerImpl()
+    {
+    delete iCallStateListener;
+    delete iAccessory;
+    delete iCommandHandler;
+    delete iGrip;
+    FLOG( _L( "CTelDMHandlerImpl::~CTelDMHandlerImpl()" ) )
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMHandlerImpl* CTelDMHandlerImpl::NewL()
+    {
+    CTelDMHandlerImpl* self = new( ELeave ) CTelDMHandlerImpl;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::SetObserverL
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMHandlerImpl::SetObserverL( MPhoneDeviceModeObserver* aCallHandler )
+    {
+    // Default
+    RProperty::Set( 
+        KPSUidTelAudioPreference,
+        KTelAudioOutput,
+        EPSAudioPrivate );                
+                        
+    if ( !FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) )
+        {
+        iCallStateListener = CTelDMCallStateListener::NewL();
+        iAccessory = CTelDMAudioAccessoryListener::NewL();
+        // Disconnects and answers to calls 
+        iCommandHandler = CTelDMCommandHandler::NewL( 
+                                            *aCallHandler, 
+                                            *iAccessory );
+
+        iCallStateListener->AddObserverL( *iCommandHandler );
+        
+        iGrip = CTelDMGripHandler::NewL( *iCommandHandler );
+
+        }
+    }
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/bubblecore.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = lib
+TARGET = bubblemanager2
+CONFIG += hb
+
+INCLUDEPATH += . ../inc
+
+symbian {
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.UID3 = 0x100058FF
+    
+    defFiles = \
+        "$${LITERAL_HASH}ifdef WINS" \
+            "DEFFILE bwins/bubblecore.def" \
+        "$${LITERAL_HASH}else" \
+            "DEFFILE eabi/bubblecore.def" \
+        "$${LITERAL_HASH}endif"
+    
+    MMP_RULES += defFiles
+
+    LIBS += -lthumbnailmanagerqt
+}
+else:win32 { 
+    # Put it to Hb/lib because it is in path
+    DESTDIR = c:/hb/lib
+    DLLDESTDIR = c:/hb/bin
+    INCLUDEPATH += c:/hb/include/hbcore \
+        c:/hb/include/hbwidgets \
+        c:/hb/include/hbtools
+}
+DEFINES += BUILD_BUBBLEMANAGER
+
+# Input
+include(src/bubblecore.pri)
+RESOURCES += bubblecore.qrc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/bubblecore.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,64 @@
+<RCC>
+    <qresource prefix="/">
+        <file>xml/bubble_layout_1.docml</file>
+        <file>xml/bubble_layout_2.docml</file>
+        <file>xml/bubble_layout_3.docml</file>
+        <file>xml/bubble_layout_4.docml</file>
+        <file>xml/bubble_layout_5.docml</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_avatar.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_b.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_bl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_br.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_c.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_l.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_r.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_t.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tr.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_b.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_bl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_br.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_c.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_l.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_r.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_t.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tr.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_b.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_bl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_br.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_c.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_l.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_r.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_t.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tr.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_b.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_bl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_br.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_c.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_l.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_r.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_t.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tl.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tr.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_waiting_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_active_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_end_call.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg</file>
+        <file>themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg</file>
+        <file alias="bubble_muted_disappear.fxml">effects/bubble_muted_disappear.fxml</file>
+        <file alias="bubble_muted_appear.fxml">effects/bubble_muted_appear.fxml</file>
+        <file alias="bubbleheadingwidget.widgetml">xml/bubbleheadingwidget.widgetml</file>
+        <file alias="bubbleimagewidget.css">xml/bubbleimagewidget.css</file>
+        <file alias="bubbleimagewidget.widgetml">xml/bubbleimagewidget.widgetml</file>
+        <file alias="bubbleparticipantlistitem.css">xml/bubbleparticipantlistitem.css</file>
+        <file alias="bubbleparticipantlistitem.widgetml">xml/bubbleparticipantlistitem.widgetml</file>
+        <file alias="bubbleheadingwidget.css">xml/bubbleheadingwidget.css</file>
+        <file alias="qtg_mono_call_diverted.svg">themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg</file>
+        <file alias="bubble_icon_anim.axml">resources/bubble_icon_anim.axml</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/bwins/bubblecoreu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,65 @@
+EXPORTS
+	?connectSignals@BubbleManager@@AAEXPAVQGraphicsWidget@@@Z @ 1 NONAME ; void BubbleManager::connectSignals(class QGraphicsWidget *)
+	?createConference@BubbleManager@@UAEHHH@Z @ 2 NONAME ; int BubbleManager::createConference(int, int)
+	?tr@BubbleManager@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString BubbleManager::tr(char const *, char const *, int)
+	?staticMetaObject@BubbleManager@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const BubbleManager::staticMetaObject
+	?setState@BubbleManager@@UAEXHW4PhoneCallState@BubbleManagerIF@@@Z @ 5 NONAME ; void BubbleManager::setState(int, enum BubbleManagerIF::PhoneCallState)
+	?tr@BubbleManager@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString BubbleManager::tr(char const *, char const *)
+	?selectionInConference@BubbleManager@@UBEHXZ @ 7 NONAME ; int BubbleManager::selectionInConference(void) const
+	??_EBubbleManager@@UAE@I@Z @ 8 NONAME ; BubbleManager::~BubbleManager(unsigned int)
+	?addToLayout@BubbleManager@@AAE_NPAVQGraphicsWidget@@@Z @ 9 NONAME ; bool BubbleManager::addToLayout(class QGraphicsWidget *)
+	?updateCallTime@BubbleManager@@UAEXHABVQString@@@Z @ 10 NONAME ; void BubbleManager::updateCallTime(int, class QString const &)
+	?removeFromLayout@BubbleManager@@AAEXPAVQGraphicsWidget@@@Z @ 11 NONAME ; void BubbleManager::removeFromLayout(class QGraphicsWidget *)
+	?polishEvent@BubbleManager@@EAEXXZ @ 12 NONAME ; void BubbleManager::polishEvent(void)
+	?graphicsWidgetForAction@BubbleManager@@UBEPAVQGraphicsWidget@@PAVHbAction@@@Z @ 13 NONAME ; class QGraphicsWidget * BubbleManager::graphicsWidgetForAction(class HbAction *) const
+	?setCallObjectImage@BubbleManager@@UAEXHABVQString@@@Z @ 14 NONAME ; void BubbleManager::setCallObjectImage(int, class QString const &)
+	?isConferenceExpanded@BubbleManager@@UBE_NXZ @ 15 NONAME ; bool BubbleManager::isConferenceExpanded(void) const
+	?setNumberType@BubbleManager@@UAEXHW4PhoneNumberType@BubbleManagerIF@@@Z @ 16 NONAME ; void BubbleManager::setNumberType(int, enum BubbleManagerIF::PhoneNumberType)
+	?selectView@BubbleManager@@AAEPAVQGraphicsWidget@@XZ @ 17 NONAME ; class QGraphicsWidget * BubbleManager::selectView(void)
+	?startChanges@BubbleManager@@UAEXXZ @ 18 NONAME ; void BubbleManager::startChanges(void)
+	?removeRowFromConference@BubbleManager@@UAEXH@Z @ 19 NONAME ; void BubbleManager::removeRowFromConference(int)
+	?clearActions@BubbleManager@@UAEXH@Z @ 20 NONAME ; void BubbleManager::clearActions(int)
+	?qt_metacall@BubbleManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 21 NONAME ; int BubbleManager::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?findActiveHeader@BubbleManager@@AAE_NHAAPAVBubbleHeader@@@Z @ 22 NONAME ; bool BubbleManager::findActiveHeader(int, class BubbleHeader * &)
+	?shownHeaderCount@BubbleManager@@UBEHXZ @ 23 NONAME ; int BubbleManager::shownHeaderCount(void) const
+	?setBubbleSelectionDisabled@BubbleManager@@UAEX_N@Z @ 24 NONAME ; void BubbleManager::setBubbleSelectionDisabled(bool)
+	??1BubbleManager@@UAE@XZ @ 25 NONAME ; BubbleManager::~BubbleManager(void)
+	?findNextDrawableHeader@BubbleManager@@ABEXAAH@Z @ 26 NONAME ; void BubbleManager::findNextDrawableHeader(int &) const
+	?trUtf8@BubbleManager@@SA?AVQString@@PBD0@Z @ 27 NONAME ; class QString BubbleManager::trUtf8(char const *, char const *)
+	??0BubbleManager@@QAE@PAVQGraphicsItem@@@Z @ 28 NONAME ; BubbleManager::BubbleManager(class QGraphicsItem *)
+	?expandedBubble@BubbleManager@@UBEHXZ @ 29 NONAME ; int BubbleManager::expandedBubble(void) const
+	?setSelectionIdInConference@BubbleManager@@UAEXH@Z @ 30 NONAME ; void BubbleManager::setSelectionIdInConference(int)
+	?moveHighlightOneUpInConference@BubbleManager@@UAEXXZ @ 31 NONAME ; void BubbleManager::moveHighlightOneUpInConference(void)
+	?createCallHeader@BubbleManager@@UAEHXZ @ 32 NONAME ; int BubbleManager::createCallHeader(void)
+	?setCallObjectFromTheme@BubbleManager@@UAEXH@Z @ 33 NONAME ; void BubbleManager::setCallObjectFromTheme(int)
+	?handleOrientationChange@BubbleManager@@QAEXW4Orientation@Qt@@@Z @ 34 NONAME ; void BubbleManager::handleOrientationChange(enum Qt::Orientation)
+	?setSecondaryCli@BubbleManager@@UAEXHABVQString@@W4TextElideMode@Qt@@@Z @ 35 NONAME ; void BubbleManager::setSecondaryCli(int, class QString const &, enum Qt::TextElideMode)
+	?selectionIdInConference@BubbleManager@@UBEHXZ @ 36 NONAME ; int BubbleManager::selectionIdInConference(void) const
+	?addAction@BubbleManager@@UAEXHPAVHbAction@@@Z @ 37 NONAME ; void BubbleManager::addAction(int, class HbAction *)
+	?qt_metacast@BubbleManager@@UAEPAXPBD@Z @ 38 NONAME ; void * BubbleManager::qt_metacast(char const *)
+	?getStaticMetaObject@BubbleManager@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & BubbleManager::getStaticMetaObject(void)
+	?moveHighlightOneDownInConference@BubbleManager@@UAEXXZ @ 40 NONAME ; void BubbleManager::moveHighlightOneDownInConference(void)
+	?removeConference@BubbleManager@@UAEXXZ @ 41 NONAME ; void BubbleManager::removeConference(void)
+	?removeCallHeader@BubbleManager@@UAEXH@Z @ 42 NONAME ; void BubbleManager::removeCallHeader(int)
+	?setViewData@BubbleManager@@AAEXPAVQGraphicsWidget@@@Z @ 43 NONAME ; void BubbleManager::setViewData(class QGraphicsWidget *)
+	?setPhoneMuted@BubbleManager@@UAEX_N@Z @ 44 NONAME ; void BubbleManager::setPhoneMuted(bool)
+	?metaObject@BubbleManager@@UBEPBUQMetaObject@@XZ @ 45 NONAME ; struct QMetaObject const * BubbleManager::metaObject(void) const
+	?updateCLI@BubbleManager@@UAEXHABVQString@@W4TextElideMode@Qt@@@Z @ 46 NONAME ; void BubbleManager::updateCLI(int, class QString const &, enum Qt::TextElideMode)
+	?addParticipantListAction@BubbleManager@@UAEXPAVHbAction@@@Z @ 47 NONAME ; void BubbleManager::addParticipantListAction(class HbAction *)
+	?setCallTime@BubbleManager@@UAEXHABVQString@@@Z @ 48 NONAME ; void BubbleManager::setCallTime(int, class QString const &)
+	?endChanges@BubbleManager@@UAEXXZ @ 49 NONAME ; void BubbleManager::endChanges(void)
+	?setSelectionInConference@BubbleManager@@UAEXH@Z @ 50 NONAME ; void BubbleManager::setSelectionInConference(int)
+	?setParticipantListCli@BubbleManager@@UAEXHW4ParticipantListCli@BubbleManagerIF@@@Z @ 51 NONAME ; void BubbleManager::setParticipantListCli(int, enum BubbleManagerIF::ParticipantListCli)
+	?setCallFlag@BubbleManager@@UAEXHV?$QFlags@W4PhoneCallFlag@BubbleManagerIF@@@@_N@Z @ 52 NONAME ; void BubbleManager::setCallFlag(int, class QFlags<enum BubbleManagerIF::PhoneCallFlag>, bool)
+	?setExpandAction@BubbleManager@@UAEXHPAVHbAction@@@Z @ 53 NONAME ; void BubbleManager::setExpandAction(int, class HbAction *)
+	?trUtf8@BubbleManager@@SA?AVQString@@PBD0H@Z @ 54 NONAME ; class QString BubbleManager::trUtf8(char const *, char const *, int)
+	?showExpanded@BubbleManager@@AAEXH@Z @ 55 NONAME ; void BubbleManager::showExpanded(int)
+	?setCli@BubbleManager@@UAEXHABVQString@@W4TextElideMode@Qt@@@Z @ 56 NONAME ; void BubbleManager::setCli(int, class QString const &, enum Qt::TextElideMode)
+	?conferenceRowCount@BubbleManager@@UBEHXZ @ 57 NONAME ; int BubbleManager::conferenceRowCount(void) const
+	?setExpandedConferenceCallHeader@BubbleManager@@UAEX_N@Z @ 58 NONAME ; void BubbleManager::setExpandedConferenceCallHeader(bool)
+	?clearParticipantListActions@BubbleManager@@UAEXXZ @ 59 NONAME ; void BubbleManager::clearParticipantListActions(void)
+	?setCallFlags@BubbleManager@@UAEXHH@Z @ 60 NONAME ; void BubbleManager::setCallFlags(int, int)
+	?addRowToConference@BubbleManager@@UAEXH@Z @ 61 NONAME ; void BubbleManager::addRowToConference(int)
+	?setLabel@BubbleManager@@UAEXHABVQString@@W4TextElideMode@Qt@@@Z @ 62 NONAME ; void BubbleManager::setLabel(int, class QString const &, enum Qt::TextElideMode)
+	?releaseImageIfNotUsed@BubbleManager@@AAEXABVQString@@@Z @ 63 NONAME ; void BubbleManager::releaseImageIfNotUsed(class QString const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/eabi/bubblecoreu.def	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,109 @@
+EXPORTS
+	_ZN13BubbleManager10endChangesEv @ 1 NONAME
+	_ZN13BubbleManager10selectViewEv @ 2 NONAME
+	_ZN13BubbleManager11addToLayoutEP15QGraphicsWidget @ 3 NONAME
+	_ZN13BubbleManager11polishEventEv @ 4 NONAME
+	_ZN13BubbleManager11qt_metacallEN11QMetaObject4CallEiPPv @ 5 NONAME
+	_ZN13BubbleManager11qt_metacastEPKc @ 6 NONAME
+	_ZN13BubbleManager11setCallFlagEi6QFlagsIN15BubbleManagerIF13PhoneCallFlagEEb @ 7 NONAME
+	_ZN13BubbleManager11setCallTimeEiRK7QString @ 8 NONAME
+	_ZN13BubbleManager11setViewDataEP15QGraphicsWidget @ 9 NONAME
+	_ZN13BubbleManager12clearActionsEi @ 10 NONAME
+	_ZN13BubbleManager12setCallFlagsEii @ 11 NONAME
+	_ZN13BubbleManager12showExpandedEi @ 12 NONAME
+	_ZN13BubbleManager12startChangesEv @ 13 NONAME
+	_ZN13BubbleManager13setNumberTypeEiN15BubbleManagerIF15PhoneNumberTypeE @ 14 NONAME
+	_ZN13BubbleManager13setPhoneMutedEb @ 15 NONAME
+	_ZN13BubbleManager14connectSignalsEP15QGraphicsWidget @ 16 NONAME
+	_ZN13BubbleManager14updateCallTimeEiRK7QString @ 17 NONAME
+	_ZN13BubbleManager15setExpandActionEiP8HbAction @ 18 NONAME
+	_ZN13BubbleManager15setSecondaryCliEiRK7QStringN2Qt13TextElideModeE @ 19 NONAME
+	_ZN13BubbleManager16createCallHeaderEv @ 20 NONAME
+	_ZN13BubbleManager16createConferenceEii @ 21 NONAME
+	_ZN13BubbleManager16findActiveHeaderEiRP12BubbleHeader @ 22 NONAME
+	_ZN13BubbleManager16removeCallHeaderEi @ 23 NONAME
+	_ZN13BubbleManager16removeConferenceEv @ 24 NONAME
+	_ZN13BubbleManager16removeFromLayoutEP15QGraphicsWidget @ 25 NONAME
+	_ZN13BubbleManager16staticMetaObjectE @ 26 NONAME DATA 16
+	_ZN13BubbleManager18addRowToConferenceEi @ 27 NONAME
+	_ZN13BubbleManager18setCallObjectImageEiRK7QString @ 28 NONAME
+	_ZN13BubbleManager19getStaticMetaObjectEv @ 29 NONAME
+	_ZN13BubbleManager21setParticipantListCliEiN15BubbleManagerIF18ParticipantListCliE @ 30 NONAME
+	_ZN13BubbleManager22setCallObjectFromThemeEi @ 31 NONAME
+	_ZN13BubbleManager23handleOrientationChangeEN2Qt11OrientationE @ 32 NONAME
+	_ZN13BubbleManager23removeRowFromConferenceEi @ 33 NONAME
+	_ZN13BubbleManager24addParticipantListActionEP8HbAction @ 34 NONAME
+	_ZN13BubbleManager24setSelectionInConferenceEi @ 35 NONAME
+	_ZN13BubbleManager26setBubbleSelectionDisabledEb @ 36 NONAME
+	_ZN13BubbleManager26setSelectionIdInConferenceEi @ 37 NONAME
+	_ZN13BubbleManager27clearParticipantListActionsEv @ 38 NONAME
+	_ZN13BubbleManager30moveHighlightOneUpInConferenceEv @ 39 NONAME
+	_ZN13BubbleManager31setExpandedConferenceCallHeaderEb @ 40 NONAME
+	_ZN13BubbleManager32moveHighlightOneDownInConferenceEv @ 41 NONAME
+	_ZN13BubbleManager6setCliEiRK7QStringN2Qt13TextElideModeE @ 42 NONAME
+	_ZN13BubbleManager8setLabelEiRK7QStringN2Qt13TextElideModeE @ 43 NONAME
+	_ZN13BubbleManager8setStateEiN15BubbleManagerIF14PhoneCallStateE @ 44 NONAME
+	_ZN13BubbleManager9addActionEiP8HbAction @ 45 NONAME
+	_ZN13BubbleManager9updateCLIEiRK7QStringN2Qt13TextElideModeE @ 46 NONAME
+	_ZN13BubbleManagerC1EP13QGraphicsItem @ 47 NONAME
+	_ZN13BubbleManagerC2EP13QGraphicsItem @ 48 NONAME
+	_ZN13BubbleManagerD0Ev @ 49 NONAME
+	_ZN13BubbleManagerD1Ev @ 50 NONAME
+	_ZN13BubbleManagerD2Ev @ 51 NONAME
+	_ZNK13BubbleManager10metaObjectEv @ 52 NONAME
+	_ZNK13BubbleManager14expandedBubbleEv @ 53 NONAME
+	_ZNK13BubbleManager16shownHeaderCountEv @ 54 NONAME
+	_ZNK13BubbleManager18conferenceRowCountEv @ 55 NONAME
+	_ZNK13BubbleManager20isConferenceExpandedEv @ 56 NONAME
+	_ZNK13BubbleManager21selectionInConferenceEv @ 57 NONAME
+	_ZNK13BubbleManager22findNextDrawableHeaderERi @ 58 NONAME
+	_ZNK13BubbleManager23graphicsWidgetForActionEP8HbAction @ 59 NONAME
+	_ZNK13BubbleManager23selectionIdInConferenceEv @ 60 NONAME
+	_ZTI13BubbleManager @ 61 NONAME
+	_ZTV13BubbleManager @ 62 NONAME
+	_ZThn16_N13BubbleManagerD0Ev @ 63 NONAME
+	_ZThn16_N13BubbleManagerD1Ev @ 64 NONAME
+	_ZThn28_N13BubbleManager10endChangesEv @ 65 NONAME
+	_ZThn28_N13BubbleManager11setCallFlagEi6QFlagsIN15BubbleManagerIF13PhoneCallFlagEEb @ 66 NONAME
+	_ZThn28_N13BubbleManager11setCallTimeEiRK7QString @ 67 NONAME
+	_ZThn28_N13BubbleManager12clearActionsEi @ 68 NONAME
+	_ZThn28_N13BubbleManager12setCallFlagsEii @ 69 NONAME
+	_ZThn28_N13BubbleManager12startChangesEv @ 70 NONAME
+	_ZThn28_N13BubbleManager13setNumberTypeEiN15BubbleManagerIF15PhoneNumberTypeE @ 71 NONAME
+	_ZThn28_N13BubbleManager13setPhoneMutedEb @ 72 NONAME
+	_ZThn28_N13BubbleManager14updateCallTimeEiRK7QString @ 73 NONAME
+	_ZThn28_N13BubbleManager15setExpandActionEiP8HbAction @ 74 NONAME
+	_ZThn28_N13BubbleManager15setSecondaryCliEiRK7QStringN2Qt13TextElideModeE @ 75 NONAME
+	_ZThn28_N13BubbleManager16createCallHeaderEv @ 76 NONAME
+	_ZThn28_N13BubbleManager16createConferenceEii @ 77 NONAME
+	_ZThn28_N13BubbleManager16removeCallHeaderEi @ 78 NONAME
+	_ZThn28_N13BubbleManager16removeConferenceEv @ 79 NONAME
+	_ZThn28_N13BubbleManager18addRowToConferenceEi @ 80 NONAME
+	_ZThn28_N13BubbleManager18setCallObjectImageEiRK7QString @ 81 NONAME
+	_ZThn28_N13BubbleManager21setParticipantListCliEiN15BubbleManagerIF18ParticipantListCliE @ 82 NONAME
+	_ZThn28_N13BubbleManager22setCallObjectFromThemeEi @ 83 NONAME
+	_ZThn28_N13BubbleManager23removeRowFromConferenceEi @ 84 NONAME
+	_ZThn28_N13BubbleManager24addParticipantListActionEP8HbAction @ 85 NONAME
+	_ZThn28_N13BubbleManager24setSelectionInConferenceEi @ 86 NONAME
+	_ZThn28_N13BubbleManager26setBubbleSelectionDisabledEb @ 87 NONAME
+	_ZThn28_N13BubbleManager26setSelectionIdInConferenceEi @ 88 NONAME
+	_ZThn28_N13BubbleManager27clearParticipantListActionsEv @ 89 NONAME
+	_ZThn28_N13BubbleManager30moveHighlightOneUpInConferenceEv @ 90 NONAME
+	_ZThn28_N13BubbleManager31setExpandedConferenceCallHeaderEb @ 91 NONAME
+	_ZThn28_N13BubbleManager32moveHighlightOneDownInConferenceEv @ 92 NONAME
+	_ZThn28_N13BubbleManager6setCliEiRK7QStringN2Qt13TextElideModeE @ 93 NONAME
+	_ZThn28_N13BubbleManager8setLabelEiRK7QStringN2Qt13TextElideModeE @ 94 NONAME
+	_ZThn28_N13BubbleManager8setStateEiN15BubbleManagerIF14PhoneCallStateE @ 95 NONAME
+	_ZThn28_N13BubbleManager9addActionEiP8HbAction @ 96 NONAME
+	_ZThn28_N13BubbleManager9updateCLIEiRK7QStringN2Qt13TextElideModeE @ 97 NONAME
+	_ZThn28_NK13BubbleManager14expandedBubbleEv @ 98 NONAME
+	_ZThn28_NK13BubbleManager16shownHeaderCountEv @ 99 NONAME
+	_ZThn28_NK13BubbleManager18conferenceRowCountEv @ 100 NONAME
+	_ZThn28_NK13BubbleManager20isConferenceExpandedEv @ 101 NONAME
+	_ZThn28_NK13BubbleManager21selectionInConferenceEv @ 102 NONAME
+	_ZThn28_NK13BubbleManager23graphicsWidgetForActionEP8HbAction @ 103 NONAME
+	_ZThn28_NK13BubbleManager23selectionIdInConferenceEv @ 104 NONAME
+	_ZThn8_N13BubbleManagerD0Ev @ 105 NONAME
+	_ZThn8_N13BubbleManagerD1Ev @ 106 NONAME
+	_ZN13BubbleManager21releaseImageIfNotUsedERK7QString @ 107 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_appear.fxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,13 @@
+<layers>
+<visual>
+
+  <param name="opacity" type="anim">
+      <duration>0.2</duration>
+      <style>linear</style>
+      <keyframe at="0">0</keyframe>
+      <keyframe at="1">1</keyframe>
+  </param>
+
+</visual>
+</layers>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/effects/bubble_muted_disappear.fxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,12 @@
+<layers>
+<visual>
+
+  <param name="opacity" type="anim">
+      <duration>0.2</duration>
+      <style>linear</style>
+      <keyframe at="0">1</keyframe>
+      <keyframe at="1">0</keyframe>
+  </param>
+
+</visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/resources/bubble_icon_anim.axml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+
+<animations>
+
+<icon name="voice_call_waiting_anim" playmode="loop">
+<frame duration="500">qtg_large_active_call</frame>
+<frame duration="500">qtg_large_waiting_call</frame>
+</icon>
+
+<icon name="video_call_waiting_anim" playmode="loop">
+<frame duration="500">qtg_large_video_call_active</frame>
+<frame duration="500">qtg_large_video_call_waiting</frame>
+</icon>
+
+<icon name="voip_call_waiting_anim" playmode="loop">
+<frame duration="500">qtg_large_voip_call_active</frame>
+<frame duration="500">qtg_large_voip_call_waiting</frame>
+</icon>
+
+</animations>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblebutton.cpp	Fri Jun 04 10:19:18 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: Custom button
+*
+*/
+
+#include <hbevent.h>
+#include <hbframeitem.h>
+
+#include "bubblebutton.h"
+
+BubbleButton::BubbleButton(QGraphicsItem *parent)
+    : HbPushButton(parent), mButtonType(DefaultButton)
+{
+}
+
+BubbleButton::~BubbleButton()
+{
+}
+
+BubbleButton::BubbleButtonType BubbleButton::buttonType() const
+{
+    return mButtonType;
+}
+
+void BubbleButton::setButtonType(BubbleButtonType type)
+{
+    mButtonType = type;
+}
+
+bool BubbleButton::sceneEvent(QEvent *event)
+{
+    bool result = HbPushButton::sceneEvent(event);
+
+    if (event->type() == QEvent::UngrabMouse) {
+        if (isDown()) {
+            // this is needed in situation, where
+            // longpress launches a dialog (vmbx)
+            // and button release event goes to
+            // dialog (HbPopup grabs mouse).
+            setDown(false);
+            emit clicked();
+            emit released();
+        }
+    }
+
+    return result;
+}
+
+void BubbleButton::updatePrimitives()
+{
+    HbPushButton::updatePrimitives();
+
+    HbFrameItem* frame =
+        qgraphicsitem_cast<HbFrameItem*>(HbWidget::primitive("background"));
+
+    if (!frame) {
+        return;
+    }
+
+    QString graphicsName;
+
+    if (isDown()) {
+        if (buttonType()==GreenButton) {
+            graphicsName = "qtg_fr_btn_green_pressed";
+        } else if (buttonType()==RedButton) {
+            graphicsName = "qtg_fr_btn_red_pressed";
+        }
+    } else {
+        if (buttonType()==GreenButton) {
+            graphicsName = "qtg_fr_btn_green_normal";
+        } else if (buttonType()==RedButton) {
+            graphicsName = "qtg_fr_btn_red_normal";
+        }
+    }
+
+    if (graphicsName.length()) {
+        frame->frameDrawer().setFrameGraphicsName(graphicsName);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblebutton.h	Fri Jun 04 10:19:18 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: Custom button
+*
+*/
+
+#ifndef BUBBLEBUTTON_H
+#define BUBBLEBUTTON_H
+
+#include "hbpushbutton.h"
+
+class BubbleButton : public HbPushButton
+{
+    Q_OBJECT
+
+    Q_PROPERTY(BubbleButtonType buttonType READ buttonType WRITE setButtonType)
+    Q_ENUMS(BubbleButtonType)
+
+public:
+    enum BubbleButtonType {
+        DefaultButton = 0x1,
+        GreenButton   = 0x2,
+        RedButton     = 0x3  
+    };
+
+public:
+    explicit BubbleButton(QGraphicsItem *parent = 0 );
+    virtual ~BubbleButton( );
+
+    BubbleButtonType buttonType() const;
+    void setButtonType(BubbleButtonType type);
+
+    void updatePrimitives();
+
+protected:
+    bool sceneEvent(QEvent *event);
+
+private:
+    BubbleButtonType mButtonType;
+};
+
+#endif // BUBBLEBUTTON_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecollapsedhandler.cpp	Fri Jun 04 10:19:18 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:  Collapsed call bubble handler.
+*
+*/
+
+#include <QtGui>
+#include <hbaction.h>
+
+#include "bubblemanager2.h"
+#include "bubblecollapsedhandler.h"
+#include "bubbleheader.h"
+#include "bubbleutils.h"
+#include "bubbleheadingwidget.h"
+#include "bubblecontainerwidget.h"
+
+BubbleCollapsedHandler::BubbleCollapsedHandler(
+    BubbleWidgetManager& widgetManager,
+    BubbleWidgetManager::View view,
+    BubbleWidgetManager::Container container,
+    QObject* parent )
+    : BubbleHandler(widgetManager,view,container,parent)
+{
+    mHeading =
+        qobject_cast<BubbleHeadingWidget*>(
+                widget(BubbleWidgetManager::Heading));
+    Q_ASSERT(mHeading);
+
+    BubbleContainerWidget* bubble
+        = qobject_cast<BubbleContainerWidget*>(
+                widgetManager.container(view,container));
+    Q_ASSERT(bubble);
+
+    connect(bubble,SIGNAL(clicked()),this,SLOT(handleBubbleClicked()));
+
+    reset();
+}
+
+BubbleCollapsedHandler::~BubbleCollapsedHandler()
+{
+}
+
+void BubbleCollapsedHandler::reset()
+{  
+    mHeader = 0;
+    mHeading->reset();
+}
+
+void BubbleCollapsedHandler::readBubbleHeader(
+    const BubbleHeader& header )
+{
+    mHeader = &header;
+    mHeading->readBubbleHeader(header);
+}
+
+QGraphicsWidget* BubbleCollapsedHandler::graphicsWidgetForAction(
+    HbAction* action ) const
+{
+    Q_UNUSED(action)
+    return 0;
+}
+
+void BubbleCollapsedHandler::updateTimerDisplayNow()
+{
+    mHeading->updateTimerDisplayNow();
+}
+
+void BubbleCollapsedHandler::handleBubbleClicked()
+{
+    emit headerSelected(mHeader->bubbleId());
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecollapsedhandler.h	Fri Jun 04 10:19:18 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:  Collapsed call bubble handler.
+*
+*/
+
+#ifndef BUBBLECOLLAPSEDHANDLER_H_
+#define BUBBLECOLLAPSEDHANDLER_H_
+
+#include "bubblehandler.h"
+#include "bubblewidgetmanager.h"
+
+class BubbleHeader;
+class HbAction;
+class BubbleHeadingWidget;
+
+class BubbleCollapsedHandler : public BubbleHandler
+    {
+    Q_OBJECT
+
+public:
+    explicit BubbleCollapsedHandler(
+            BubbleWidgetManager& widgetManager,
+            BubbleWidgetManager::View view,
+            BubbleWidgetManager::Container container,
+            QObject* parent = 0);
+    virtual ~BubbleCollapsedHandler();
+
+protected:
+    void reset();
+
+    void readBubbleHeader(const BubbleHeader& header);
+
+    QGraphicsWidget* graphicsWidgetForAction( HbAction* action ) const;
+    
+    void updateTimerDisplayNow();
+
+protected slots:
+    void handleBubbleClicked();
+
+protected: //data
+    const BubbleHeader* mHeader;
+    BubbleHeadingWidget* mHeading;
+    };
+
+#endif /* BUBBLECOLLAPSEDHANDLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,223 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Conference call bubble handler.
+*
+*/
+
+#include <QtGui>
+#include <hbaction.h>
+#include <hbtextitem.h>
+#include <hblabel.h>
+#include <hblistview.h>
+#include <hbcolorscheme.h>
+
+#include "bubblemanager2.h"
+#include "bubbleconferencehandler.h"
+#include "bubbleconferenceheader.h"
+#include "bubbleutils.h"
+#include "bubbleparticipantlistitem.h"
+#include "bubbleparticipantlistmodel.h"
+#include "bubblebutton.h"
+
+static const int BUBBLE_SELECTION_TIMEOUT = 3000;
+
+BubbleConferenceHandler::BubbleConferenceHandler(
+    BubbleWidgetManager& widgetManager,
+    BubbleWidgetManager::View view,
+    BubbleWidgetManager::Container container,
+    QObject* parent )
+    : BubbleHandler(widgetManager,view,container,parent)
+{
+    mTimerLabel =
+        qobject_cast<HbLabel*>(widget(BubbleWidgetManager::ConferenceTimer));
+    Q_ASSERT(mTimerLabel);
+    HbDeviceProfile profile;
+    HbFontSpec spec(HbFontSpec::Secondary);
+    spec.setTextHeight(4*HbDeviceProfile::current().unitValue());
+    mTimerLabel->setFontSpec(spec);
+    mTimerLabel->setAlignment(Qt::AlignLeft);
+
+    mButtonCenter =
+        qobject_cast<BubbleButton*>(widget(BubbleWidgetManager::CenterButton));
+    Q_ASSERT(mButtonCenter);
+    mButtonLeft =
+        qobject_cast<BubbleButton*>(widget(BubbleWidgetManager::LeftButton));
+    Q_ASSERT(mButtonLeft);
+    mButtonRight =
+        qobject_cast<BubbleButton*>(widget(BubbleWidgetManager::RightButton));
+    Q_ASSERT(mButtonRight);
+
+    mList =
+        qobject_cast<HbListView*>(widget(BubbleWidgetManager::ParticipantList));
+    Q_ASSERT(mList);
+    mModel = new BubbleParticipantListModel();
+    mList->setModel(mModel);
+
+    mPrototype =
+        qobject_cast<BubbleParticipantListItem*>(
+            widgetManager.createParticipantListItem());
+    Q_ASSERT(mPrototype);
+    mList->setItemPrototype(mPrototype);
+    connect(mList->selectionModel(),
+            SIGNAL(currentChanged(QModelIndex,QModelIndex)),
+            this,
+            SLOT(handleItemSelected(QModelIndex,QModelIndex)));
+
+    mSelectionTimer = new QTimer(this);
+    connect(mSelectionTimer,SIGNAL(timeout()),SLOT(clearSelection()));
+    mSelectionTimer->setSingleShot(true);
+
+    reset();
+}
+
+BubbleConferenceHandler::~BubbleConferenceHandler()
+{
+}
+
+void BubbleConferenceHandler::reset()
+{  
+    mHeader = 0;
+
+    mSelectionTimer->stop();
+    mPrototype->clearActions();
+    mTimerLabel->hide();
+    mButtonCenter->hide();
+    mButtonCenter->setDown(false);
+    mButtonCenter->disconnect();
+    mButtonLeft->hide();
+    mButtonLeft->setDown(false);
+    mButtonLeft->disconnect();
+    mButtonRight->hide();
+    mButtonRight->setDown(false);
+    mButtonRight->disconnect();
+}
+
+void BubbleConferenceHandler::readBubbleHeader( const BubbleHeader& header )
+{
+    Q_ASSERT(header.isConference());
+    mHeader = static_cast<const BubbleConferenceHeader*>(&header);
+
+    // set actions to item prototype
+    QList<HbAbstractViewItem*> prototypes = mList->itemPrototypes();
+    QList<HbAction*> actions = mHeader->participantListActions();
+    foreach (HbAction* action, actions ) {
+        mPrototype->addAction(action);
+    }
+
+    // populate participant list model
+    QList<BubbleHeader*> participants = mHeader->headers();
+    foreach(BubbleHeader* participant, participants) {
+         mModel->addParticipant(
+            participant->bubbleId(),
+            participant->cli(),
+            (int)participant->callState(),
+            !(mHeader->callFlags()&BubbleManagerIF::NoCiphering));
+    }
+
+    if (header.timerCost().length()) {
+        QColor color;
+        color = HbColorScheme::color("list_item_title_normal");
+        if (color.isValid()) {
+            mTimerLabel->setTextColor(color);
+        }
+        mTimerLabel->setPlainText(header.timerCost());
+        mTimerLabel->show();
+    }
+
+    setButtons(mHeader->actions());
+
+    clearSelection();
+}
+
+void BubbleConferenceHandler::setButtons(const QList<HbAction*>& actions)
+{
+    if ( actions.count()==1 && mButtonCenter ) {
+        HbAction* action = actions.at(0);
+        mButtonCenter->setIcon( action->icon() );
+        BubbleUtils::setButtonStyleForAction(*mButtonCenter,*action);
+        connect(mButtonCenter, SIGNAL( clicked() ),
+                action, SLOT( trigger() ) );
+        mButtonCenter->show();
+    } else  if (actions.count()==2 && mButtonLeft && mButtonRight ) {
+        // Left button
+        HbAction* action1 = actions.at(0);
+        mButtonLeft->setIcon( action1->icon() );
+        BubbleUtils::setButtonStyleForAction(*mButtonLeft,*action1);
+        connect( mButtonLeft, SIGNAL( clicked() ),
+                 action1, SLOT( trigger() ) );
+        mButtonLeft->show();
+        // Right button
+        HbAction* action2 = actions.at(1);
+        mButtonRight->setIcon( action2->icon() );
+        BubbleUtils::setButtonStyleForAction(*mButtonRight,*action2);
+        connect( mButtonRight, SIGNAL( clicked() ),
+                 action2, SLOT( trigger() ) );
+        mButtonRight->show();
+    }
+}
+
+QGraphicsWidget* BubbleConferenceHandler::graphicsWidgetForAction(
+    HbAction* action ) const
+{
+    if ( mButtonLeft->text() == action->text() ) {
+        return mButtonLeft;
+    } else if ( mButtonRight->text() == action->text() ) {
+        return mButtonRight;
+    } else if ( mButtonCenter->text() == action->text() ) {
+        return mButtonCenter;
+    } else {
+        return 0;
+    }
+}
+
+void BubbleConferenceHandler::updateTimerDisplayNow()
+{
+    Q_ASSERT(mHeader);
+
+    mTimerLabel->setPlainText(mHeader->timerCost());
+    mTimerLabel->update();
+}
+
+void BubbleConferenceHandler::handleItemSelected(
+    const QModelIndex & current,
+    const QModelIndex & previous )
+{
+    Q_UNUSED(previous);
+
+    if (current.isValid()) {
+        Q_ASSERT( mHeader != 0 );
+        // need to cast constness away
+        BubbleConferenceHeader& mutableHeader =
+            const_cast<BubbleConferenceHeader&>(*mHeader);
+        mutableHeader.setSelectedHeader(mModel->bubbleId(current.row()));
+        mSelectionTimer->stop();
+        mSelectionTimer->start(BUBBLE_SELECTION_TIMEOUT);
+    }
+}
+
+void BubbleConferenceHandler::clearSelection()
+{
+    mList->selectionModel()->clear();
+}
+
+void BubbleConferenceHandler::conferenceMemberRemoved(int bubbleId)
+{
+    mModel->removeParticipant(bubbleId);
+}
+
+void BubbleConferenceHandler::conferenceRemoved()
+{
+    mModel->reset();
+    mList->reset();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.h	Fri Jun 04 10:19:18 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:  Conference call bubble handler.
+*
+*/
+
+#ifndef BUBBLECONFERENCEHANDLER_H_
+#define BUBBLECONFERENCEHANDLER_H_
+
+#include "bubblehandler.h"
+#include "bubblewidgetmanager.h"
+
+class BubbleHeader;
+class HbAction;
+class BubbleButton;
+class HbLabel;
+class BubbleConferenceHeader;
+class HbListWidgetItem;
+class BubbleParticipantListItem;
+class HbListView;
+class BubbleParticipantListModel;
+class QTimer;
+class QModelIndex;
+
+class BubbleConferenceHandler : public BubbleHandler
+    {
+    Q_OBJECT
+
+public:
+    explicit BubbleConferenceHandler(
+            BubbleWidgetManager& widgetManager,
+            BubbleWidgetManager::View view,
+            BubbleWidgetManager::Container container,
+            QObject* parent = 0);
+    virtual ~BubbleConferenceHandler();
+
+protected:
+    void reset();
+
+    void readBubbleHeader( const BubbleHeader& header );
+
+    void setButtons(const QList<HbAction*>& actions);
+
+    QGraphicsWidget* graphicsWidgetForAction( HbAction* action ) const;
+    
+    void updateTimerDisplayNow();
+
+    void conferenceMemberRemoved(int bubbleId);
+
+    void conferenceRemoved();
+
+protected slots:
+    void handleItemSelected( const QModelIndex& current,
+                             const QModelIndex& previous);
+    void clearSelection();
+
+protected: //data
+    const BubbleConferenceHeader* mHeader;
+    HbLabel* mTimerLabel;
+    BubbleButton* mButtonCenter;
+    BubbleButton* mButtonLeft;
+    BubbleButton* mButtonRight;
+    HbListView* mList;
+    BubbleParticipantListModel* mModel;
+    BubbleParticipantListItem* mPrototype; // not owned
+    QTimer* mSelectionTimer;
+    };
+
+#endif /* BUBBLECONFERENCEHANDLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleconferenceheader.cpp	Fri Jun 04 10:19:18 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: Conference call header
+*
+*/
+
+#include "bubbleconferenceheader.h"
+
+BubbleConferenceHeader::BubbleConferenceHeader()
+{
+    reset();
+}
+
+void BubbleConferenceHeader::reset()
+{
+    BubbleHeader::reset();
+
+    mExpanded = false;
+    mSelection = -1;
+
+    foreach(BubbleHeader* header,mHeaders) {
+        header->setInConference(false);
+    }
+    mHeaders.clear();
+
+    mParticipantListActions.clear();
+}
+
+void BubbleConferenceHeader::addHeader(BubbleHeader* header)
+{
+    header->setInConference(true);
+    mHeaders.append(header);
+}
+
+void BubbleConferenceHeader::removeHeader(int bubbleId)
+{
+    for(int i=0; i<mHeaders.count(); i++) {
+        if (mHeaders.at(i)->bubbleId()==bubbleId) {
+            mHeaders.at(i)->setInConference(false);
+            mHeaders.removeAt(i);            
+            break;
+        }
+    }
+}
+
+bool BubbleConferenceHeader::isConference() const
+{
+    return true;
+}
+
+QList<BubbleHeader*> BubbleConferenceHeader::headers() const
+{
+    return mHeaders;
+}
+
+void BubbleConferenceHeader::addParticipantListAction( HbAction* action )
+{
+    mParticipantListActions.append( action );
+}
+
+const QList<HbAction*>& BubbleConferenceHeader::participantListActions() const
+{
+    return mParticipantListActions;
+}
+
+void BubbleConferenceHeader::clearParticipantListActions()
+{
+    mParticipantListActions.clear();
+}
+
+void BubbleConferenceHeader::setExpanded(bool expanded)
+{
+    mExpanded = expanded;
+}
+
+bool BubbleConferenceHeader::isExpanded() const
+{
+    return mExpanded;
+}
+
+void BubbleConferenceHeader::setSelectedHeader(int bubbleId)
+{
+    mSelection = bubbleId;
+}
+
+int BubbleConferenceHeader::selectedHeader() const
+{
+    return mSelection;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleconferenceheader.h	Fri Jun 04 10:19:18 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: Conference call header
+*
+*/
+
+#ifndef BUBBLECONFERENCEHEADER_H
+#define BUBBLECONFERENCEHEADER_H
+
+#include "bubbleheader.h"
+
+class BubbleConferenceHeader : public BubbleHeader
+{
+public:
+    BubbleConferenceHeader();
+
+    virtual void reset();
+
+    void addHeader(BubbleHeader* header);
+    void removeHeader(int bubbleId);
+
+    QList<BubbleHeader*> headers() const;
+
+    // header type
+    virtual bool isConference() const;
+
+    // participant list actions
+    void addParticipantListAction( HbAction* action );
+    const QList<HbAction*>& participantListActions() const;
+    void clearParticipantListActions();
+
+    // expanded
+    void setExpanded(bool expanded);
+    bool isExpanded() const;
+
+    // selection in list
+    void setSelectedHeader(int bubbleId);
+    int selectedHeader() const;
+
+private:
+    QList<BubbleHeader*> mHeaders;
+    QList<HbAction*> mParticipantListActions;
+    bool mExpanded;
+    int mSelection;
+};
+
+#endif // BUBBLECONFERENCEHEADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.cpp	Fri Jun 04 10:19:18 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: Bubble container.
+*
+*/
+
+#include <QtGui>
+#include <hbstyle.h>
+#include <hbframeitem.h>
+#include <hbframedrawer.h>
+#include "bubblecontainerwidget.h"
+
+BubbleContainerWidget::BubbleContainerWidget(QGraphicsItem* item)
+    : HbWidget(item), mBackground(0)
+{
+    createPrimitives();
+    updatePrimitives();
+    Q_ASSERT(mBackground);
+}
+
+BubbleContainerWidget::~BubbleContainerWidget()
+{
+}
+
+void BubbleContainerWidget::createPrimitives()
+{
+    delete mBackground;
+    mBackground = new HbFrameItem(this);
+    style()->setItemName(mBackground, "background");
+    mBackground->setZValue(-1.0);
+    mBackground->setVisible(false); // background in drawn in paint()
+}
+
+void BubbleContainerWidget::updatePrimitives()
+{
+    mBackground->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    mBackground->frameDrawer().setFrameGraphicsName("qtg_fr_list_normal");
+}
+
+void BubbleContainerWidget::mousePressEvent(
+    QGraphicsSceneMouseEvent * event)
+{
+    if (event->button() != Qt::LeftButton) {
+        event->ignore();
+        return;
+    }
+
+    mPressed = true;
+    event->accept();
+}
+
+void BubbleContainerWidget::mouseMoveEvent(
+    QGraphicsSceneMouseEvent *event)
+{
+    if (!(event->buttons() & Qt::LeftButton)) {
+        event->ignore();
+        return;
+    }
+
+    if ( !rect().contains(event->pos()) && mPressed ) {
+        ungrabMouse();
+        mPressed = false;
+    }
+}
+
+void BubbleContainerWidget::mouseReleaseEvent(
+    QGraphicsSceneMouseEvent *event)
+{
+    if (event->button() != Qt::LeftButton) {
+        event->ignore();
+        return;
+    }
+
+    if (mPressed) {
+        emit clicked();
+        mPressed = false;
+        event->accept();
+    }
+}
+
+void BubbleContainerWidget::paint(
+    QPainter *painter,
+    const QStyleOptionGraphicsItem *option,
+    QWidget *widget)
+{
+    Q_UNUSED(widget)
+    Q_UNUSED(option)
+
+    mBackground->frameDrawer().paint(painter,boundingRect());
+}
+
+void BubbleContainerWidget::showEvent(QShowEvent *event)
+{
+    Q_UNUSED(event)
+    mPressed = false;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecontainerwidget.h	Fri Jun 04 10:19:18 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: Bubble container
+*
+*/
+
+#ifndef BUBBLECONTAINERWIDGET_H
+#define BUBBLECONTAINERWIDGET_H
+
+#include <hbwidget.h>
+
+class HbFrameItem;
+
+class BubbleContainerWidget : public HbWidget
+{
+    Q_OBJECT
+
+public:
+    BubbleContainerWidget(QGraphicsItem* item=0);
+    virtual ~BubbleContainerWidget();
+
+signals:
+    void clicked();
+
+private:
+    void createPrimitives();
+    void updatePrimitives();
+
+    void mousePressEvent( QGraphicsSceneMouseEvent * event );
+    void mouseMoveEvent( QGraphicsSceneMouseEvent *event );
+    void mouseReleaseEvent( QGraphicsSceneMouseEvent * event );
+
+    void paint(
+        QPainter *painter,
+        const QStyleOptionGraphicsItem *option,
+        QWidget *widget = 0);
+
+    void showEvent(QShowEvent *event);
+
+private:
+    HbFrameItem* mBackground;
+    bool mPressed;
+};
+
+#endif // BUBBLECONTAINERWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblecore.pri	Fri Jun 04 10:19:18 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:
+#
+#
+HEADERS += ../inc/bubblemanager2.h \
+    src/bubbleimagewidget.h \
+    src/bubbleheader.h \
+    src/bubbleutils.h \
+    src/bubbleconferenceheader.h \
+    src/bubbleparticipantlistitem.h \
+    src/bubbleparticipantlistmodel.h \
+    src/bubblecontainerwidget.h \
+    src/bubbleheadingwidget.h \
+    src/bubblewidgetmanager.h \
+    src/bubblehandler.h \
+    src/bubbleexpandedhandler.h \
+    src/bubblecollapsedhandler.h \
+    src/bubbleconferencehandler.h \
+    src/bubbleimagemanager.h \
+    src/bubbleimagemanager_p.h \
+    src/bubbleeffecthandler.h \
+    src/bubblebutton.h
+
+
+SOURCES += src/bubblemanager2.cpp \
+    src/bubbleheader.cpp \
+    src/bubbleimagewidget.cpp \
+    src/bubbleutils.cpp \
+    src/bubbleconferenceheader.cpp \
+    src/bubbleparticipantlistitem.cpp \
+    src/bubbleparticipantlistmodel.cpp \
+    src/bubblecontainerwidget.cpp \
+    src/bubbleheadingwidget.cpp \
+    src/bubblewidgetmanager.cpp \
+    src/bubblehandler.cpp \
+    src/bubbleexpandedhandler.cpp \
+    src/bubblecollapsedhandler.cpp \
+    src/bubbleconferencehandler.cpp \
+    src/bubbleimagemanager.cpp \
+    src/bubbleeffecthandler.cpp \
+    src/bubblebutton.cpp
+
+symbian {
+    SOURCES += src/bubbleimagemanager_p.cpp
+} else:win32 {
+    SOURCES += src/bubbleimagemanager_p_stub.cpp
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,105 @@
+/*!
+* 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 <QtCore>
+#include "bubbleeffecthandler.h"
+
+const char *BUBBLE_MUTED_APPEAR_FXML = ":/bubble_muted_appear.fxml";
+const char *BUBBLE_MUTED_DISAPPEAR_FXML = ":/bubble_muted_disappear.fxml";
+const char *BUBBLE_APPEAR_EVENT = "appear";
+const char *BUBBLE_DISAPPEAR_EVENT = "disappear";
+
+
+BubbleEffectHandler::BubbleEffectHandler(QObject* parent)
+    : QObject(parent)
+{
+}
+
+BubbleEffectHandler::~BubbleEffectHandler()
+{
+}
+
+void BubbleEffectHandler::addEffect(QGraphicsItem* item, BubbleEffect effect)
+{
+    switch (effect) {
+    case BubbleMutedAppear:
+        HbEffect::add(item, BUBBLE_MUTED_APPEAR_FXML, BUBBLE_APPEAR_EVENT);
+        mEffectItem.insert(effect,item);
+        break;
+    case BubbleMutedDisappear:
+        HbEffect::add(item, BUBBLE_MUTED_DISAPPEAR_FXML, BUBBLE_DISAPPEAR_EVENT);
+        mEffectItem.insert(effect,item);
+        break;
+    default:
+        break;
+    }
+}
+
+void BubbleEffectHandler::removeEffect(QGraphicsItem* item, BubbleEffect effect)
+{
+    switch (effect) {
+    case BubbleMutedAppear:
+        HbEffect::remove(item, BUBBLE_MUTED_APPEAR_FXML, BUBBLE_APPEAR_EVENT);
+        mEffectItem.remove(effect);
+        break;
+    case BubbleMutedDisappear:
+        HbEffect::remove(item, BUBBLE_MUTED_DISAPPEAR_FXML, BUBBLE_DISAPPEAR_EVENT);
+        mEffectItem.remove(effect);
+        break;
+    default:
+        break;
+    }
+}
+
+void BubbleEffectHandler::startEffect(BubbleEffect effect)
+{
+    QGraphicsItem* item;
+
+    switch (effect) {
+    case BubbleMutedAppear:
+        item = mEffectItem.value(effect);
+        Q_ASSERT(item);
+        item->setVisible(true);
+        HbEffect::start(item, BUBBLE_APPEAR_EVENT);
+        break;
+    case BubbleMutedDisappear:
+        item = mEffectItem.value(effect);
+        Q_ASSERT(item);
+        item->setVisible(true);
+        HbEffect::start(item, BUBBLE_DISAPPEAR_EVENT,
+                        this, "handleEffectFinished", QVariant(effect));
+        break;
+    default:
+        break;
+    }
+}
+
+void BubbleEffectHandler::handleEffectFinished(
+    const HbEffect::EffectStatus &status)
+{
+    int effect = status.userData.toInt();
+
+    switch (effect) {
+    case BubbleMutedDisappear:
+        if (status.item) {
+            status.item->setVisible(false);
+        }
+        break;
+    default:
+        break;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleeffecthandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,53 @@
+/*!
+* 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 BUBBLEEFFECTHANDLER_H_
+#define BUBBLEEFFECTHANDLER_H_
+
+#include <QObject>
+#include <QMap>
+#include <hbeffect.h>
+
+class QGraphicsItem;
+
+enum BubbleEffect
+    {
+    BubbleMutedAppear = 1,
+    BubbleMutedDisappear
+    };
+
+class BubbleEffectHandler : public QObject
+    {
+    Q_OBJECT
+    
+public:
+    explicit BubbleEffectHandler(QObject* parent = 0);
+    virtual ~BubbleEffectHandler();
+
+    void addEffect(QGraphicsItem* item, BubbleEffect effect);
+    void removeEffect(QGraphicsItem* item, BubbleEffect effect);
+
+    void startEffect(BubbleEffect effect);
+
+protected slots:
+    void handleEffectFinished(const HbEffect::EffectStatus &status);
+
+protected:
+    QMap<int,QGraphicsItem*> mEffectItem;
+    };
+
+#endif /* BUBBLEEFFECTHANDLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.cpp	Fri Jun 04 10:19:18 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:  Expanded call bubble handler.
+*
+*/
+
+#include <QtGui>
+#include <hbaction.h>
+#include <hbtextitem.h>
+
+#include "bubblemanager2.h"
+#include "bubbleexpandedhandler.h"
+#include "bubbleheader.h"
+#include "bubbleutils.h"
+#include "bubbleimagewidget.h"
+#include "bubbleheadingwidget.h"
+#include "bubblebutton.h"
+
+BubbleExpandedHandler::BubbleExpandedHandler(
+    BubbleWidgetManager& widgetManager,
+    BubbleWidgetManager::View view,
+    BubbleWidgetManager::Container container,
+    QObject* parent )
+    : BubbleHandler(widgetManager,view,container,parent)
+{
+    mHeading = qobject_cast<BubbleHeadingWidget*>(
+        widget(BubbleWidgetManager::Heading));
+    Q_ASSERT(mHeading);
+
+    mImage = qobject_cast<BubbleImageWidget*>(
+        widget(BubbleWidgetManager::Image));
+    Q_ASSERT(mImage);
+
+    mButtonCenter = qobject_cast<BubbleButton*>(
+        widget(BubbleWidgetManager::CenterButton));
+    Q_ASSERT(mButtonCenter);
+    mButtonLeft = qobject_cast<BubbleButton*>(
+        widget(BubbleWidgetManager::LeftButton));
+    Q_ASSERT(mButtonLeft);
+    mButtonRight = qobject_cast<BubbleButton*>(
+        widget(BubbleWidgetManager::RightButton));
+    Q_ASSERT(mButtonRight);
+
+    reset();
+}
+
+BubbleExpandedHandler::~BubbleExpandedHandler()
+{
+}
+
+void BubbleExpandedHandler::reset()
+{  
+    mHeader = 0;
+    mButtonCenter->hide();
+    mButtonCenter->setDown(false);
+    mButtonCenter->disconnect();
+    mButtonLeft->hide();
+    mButtonLeft->setDown(false);
+    mButtonLeft->disconnect();
+    mButtonRight->hide();
+    mButtonRight->setDown(false);
+    mButtonRight->disconnect();
+    mImage->hide();
+    mHeading->reset();
+}
+
+void BubbleExpandedHandler::readBubbleHeader(
+    const BubbleHeader& header )
+{
+    mHeader = &header;
+
+    mHeading->readBubbleHeader(header);
+
+    if (!mHeader->callImage().isEmpty() ||
+        header.showDefaultAvatar()) {
+        mImage->setImage(header.callImage());
+        mImage->show();
+    } else {
+        mImage->hide();
+    }
+
+    setButtons(mHeader->actions());
+}
+
+void BubbleExpandedHandler::setButtons(const QList<HbAction*>& actions)
+{
+    if ( actions.count()==1 && mButtonCenter ) {
+        HbAction* action = actions.at(0);
+        mButtonCenter->setIcon( action->icon() );
+        connect(mButtonCenter, SIGNAL( clicked() ),
+                action, SLOT( trigger() ) );
+        BubbleUtils::setButtonStyleForAction(*mButtonCenter,*action);
+        mButtonCenter->show();
+    } else  if (actions.count()==2 && mButtonLeft && mButtonRight ) {
+        // Left button
+        HbAction* action1 = actions.at(0);
+        mButtonLeft->setIcon(action1->icon());
+        connect( mButtonLeft, SIGNAL( clicked() ),
+                 action1, SLOT( trigger() ) );
+        BubbleUtils::setButtonStyleForAction(*mButtonLeft,*action1);
+        mButtonLeft->show();
+        // Right button
+        HbAction* action2 = actions.at(1);
+        mButtonRight->setIcon( action2->icon() );
+        connect( mButtonRight, SIGNAL( clicked() ),
+                 action2, SLOT( trigger() ) );
+        BubbleUtils::setButtonStyleForAction(*mButtonRight,*action2);
+        mButtonRight->show();
+    }
+}
+
+QGraphicsWidget* BubbleExpandedHandler::graphicsWidgetForAction(
+    HbAction* action ) const
+{
+    if ( mButtonLeft->text() == action->text() ) {
+        return mButtonLeft;
+    } else if ( mButtonRight->text() == action->text() ) {
+        return mButtonRight;
+    } else if ( mButtonCenter->text() == action->text() ) {
+        return mButtonCenter;
+    } else {
+        return 0;
+    }
+}
+
+void BubbleExpandedHandler::updateTimerDisplayNow()
+{
+    mHeading->updateTimerDisplayNow();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleexpandedhandler.h	Fri Jun 04 10:19:18 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:  Expanded call bubble handler.
+*
+*/
+
+#ifndef BUBBLEEXPANDEDHANDLER_H_
+#define BUBBLEEXPANDEDHANDLER_H_
+
+#include "bubblehandler.h"
+
+class BubbleHeader;
+class HbAction;
+class BubbleButton;
+class BubbleImageWidget;
+class BubbleHeadingWidget;
+
+class BubbleExpandedHandler : public BubbleHandler
+    {
+    Q_OBJECT
+
+public:
+    explicit BubbleExpandedHandler(
+            BubbleWidgetManager& widgetManager,
+            BubbleWidgetManager::View view,
+            BubbleWidgetManager::Container container,
+            QObject* parent = 0);
+    virtual ~BubbleExpandedHandler();
+
+protected:
+    void reset();
+
+    void readBubbleHeader( const BubbleHeader& header );
+
+    void setButtons(const QList<HbAction*>& actions);
+
+    QGraphicsWidget* graphicsWidgetForAction( HbAction* action ) const;
+
+    void updateTimerDisplayNow();
+
+protected: //data
+    const BubbleHeader* mHeader;
+
+    BubbleHeadingWidget* mHeading;
+
+    BubbleImageWidget* mImage;
+
+    BubbleButton* mButtonCenter;
+    BubbleButton* mButtonLeft;
+    BubbleButton* mButtonRight;
+    };
+
+#endif /* BUBBLEEXPANDEDHANDLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblehandler.cpp	Fri Jun 04 10:19:18 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:  Base class for bubble handlers.
+*
+*/
+
+#include <QtGui>
+#include "bubblehandler.h"
+#include "bubbleheader.h"
+
+BubbleHandler::BubbleHandler(
+    BubbleWidgetManager& widgetManager,
+    BubbleWidgetManager::View view,
+    BubbleWidgetManager::Container container,
+    QObject* parent )
+    : QObject( parent ), mWidgetManager(widgetManager),
+      mView(view), mContainer(container)
+{
+}
+
+BubbleHandler::~BubbleHandler()
+{
+}
+
+QGraphicsWidget* BubbleHandler::widget(
+    BubbleWidgetManager::Widget widget) const
+{
+    return mWidgetManager.widget(mView,mContainer,widget);
+}
+
+void BubbleHandler::conferenceMemberRemoved(int bubbleId)
+{
+    Q_UNUSED(bubbleId);
+}
+
+void BubbleHandler::conferenceRemoved()
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblehandler.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,61 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Base class for bubble handlers.
+*
+*/
+
+#ifndef BUBBLEHANDLER_H_
+#define BUBBLEHANDLER_H_
+
+#include <QObject>
+#include "bubblewidgetmanager.h"
+
+class BubbleHeader;
+class HbAction;
+class QGraphicsWidget;
+
+class BubbleHandler : public QObject
+    {
+    Q_OBJECT
+
+public:
+    explicit BubbleHandler(
+        BubbleWidgetManager& widgetManager,
+        BubbleWidgetManager::View view,
+        BubbleWidgetManager::Container container,
+        QObject* parent = 0);
+
+    virtual ~BubbleHandler();
+
+    virtual void reset() = 0;
+    virtual void readBubbleHeader( const BubbleHeader& header ) = 0;
+    virtual QGraphicsWidget* graphicsWidgetForAction(
+        HbAction* action ) const = 0;
+    virtual void updateTimerDisplayNow() = 0;
+    virtual void conferenceMemberRemoved(int bubbleId);
+    virtual void conferenceRemoved();
+
+protected:
+    QGraphicsWidget* widget(BubbleWidgetManager::Widget widget) const;
+
+signals:
+    void headerSelected(int bubbleId);
+
+private:
+    BubbleWidgetManager& mWidgetManager;
+    BubbleWidgetManager::View mView;
+    BubbleWidgetManager::Container mContainer;    
+    };
+
+#endif /* BUBBLEHANDLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheader.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,252 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Container for call data.
+*
+*/
+
+#include "bubbleheader.h"
+
+BubbleHeader::BubbleHeader()
+{
+    reset();
+}
+
+BubbleHeader::~BubbleHeader()
+{
+}
+
+void BubbleHeader::reset()
+{
+    mIsUsed = false;
+    mCallState = BubbleManager::None;
+    mNumberType = BubbleManager::NotSet;
+    mCallFlags = 0;
+    mText.clear();
+    mCli.clear();
+    mTimerCost.clear();
+    mSecondaryCli.clear();
+    mActions.clear();
+    mTextClip = Qt::ElideNone;
+    mSecondaryCliClip = Qt::ElideNone;
+    mCliClip = Qt::ElideNone;
+    mCallImage.clear();
+    mIsInConference = false;
+    mExpandAction = 0;
+    mShowDefaultAvatar = false;
+}
+
+void BubbleHeader::setIsUsed( bool used )
+{
+    mIsUsed = used;
+}
+
+bool BubbleHeader::isUsed() const
+{
+    return mIsUsed;
+}
+
+void BubbleHeader::setBubbleId( int bubbleId )
+{
+    mBubbleId = bubbleId;   
+}
+
+int BubbleHeader::bubbleId() const
+{
+    return mBubbleId;
+}
+
+void BubbleHeader::setCallState( BubbleManager::PhoneCallState state )
+{
+    if (state == BubbleManager::Disconnected) {
+        if ( mCallState == BubbleManager::Waiting ||
+             mCallState == BubbleManager::Incoming ||
+             mCallState == BubbleManager::Alerting ||
+             mCallState == BubbleManager::Outgoing ||
+             mCallState == BubbleManager::AlertToDisconnected ) {
+            mCallState = BubbleManager::AlertToDisconnected;
+            return;
+            }
+        }
+
+    mCallState = state;
+}
+
+BubbleManager::PhoneCallState BubbleHeader::callState() const
+{
+    return mCallState;
+}
+
+void BubbleHeader::setCallFlags( int flags )
+{
+    mCallFlags = flags;
+}
+
+void BubbleHeader::setCallFlag( BubbleManager::PhoneCallFlags flag )
+{
+    if ( flag == BubbleManager::Normal ) {
+        mCallFlags = 0;
+        return;
+    }
+    
+    mCallFlags |= flag;
+}
+
+void BubbleHeader::removeCallFlag( BubbleManager::PhoneCallFlags flag )
+{
+    if ( flag == BubbleManager::Normal ) {
+        return;
+    }
+    
+    mCallFlags &= ~flag;
+}
+
+int BubbleHeader::callFlags() const
+{
+    return mCallFlags;
+}
+
+void BubbleHeader::setNumberType( BubbleManager::PhoneNumberType numberType )
+{
+    mNumberType = numberType;
+}
+
+BubbleManager::PhoneNumberType BubbleHeader::numberType() const
+{
+    return mNumberType;
+}
+
+void BubbleHeader::setText( 
+    const QString& text,
+    Qt::TextElideMode clip )
+{
+    mText = text;
+    mTextClip = clip;
+}
+
+const QString& BubbleHeader::text() const
+{
+    return mText;
+}
+
+Qt::TextElideMode BubbleHeader::textClipDirection() const
+{
+    return mTextClip;
+}
+
+void BubbleHeader::setCli( 
+    const QString& cli, 
+    Qt::TextElideMode clip )
+{
+    mCli = cli;
+    mCliClip = clip;
+}
+
+const QString& BubbleHeader::cli() const
+{
+    return mCli;
+}
+
+Qt::TextElideMode BubbleHeader::cliClipDirection() const
+{
+    return mCliClip;
+}
+
+void BubbleHeader::setSecondaryCli( 
+    const QString& cli, 
+    Qt::TextElideMode clip )
+{
+    mSecondaryCli = cli;
+    mSecondaryCliClip = clip;
+}
+
+const QString& BubbleHeader::secondaryCli() const
+{
+    return mSecondaryCli;
+}
+
+Qt::TextElideMode BubbleHeader::secondaryCliClipDirection() const
+{
+    return mSecondaryCliClip;
+}
+
+void BubbleHeader::setTimerCost( 
+    const QString& timerCost )
+{
+    mTimerCost = timerCost;
+}
+
+const QString& BubbleHeader::timerCost() const
+{
+    return mTimerCost;
+}
+
+void BubbleHeader::setCallImage( const QString& image )
+{
+    mCallImage = image;
+}
+
+const QString& BubbleHeader::callImage() const
+{
+    return mCallImage;
+}
+
+void BubbleHeader::setShowDefaultAvatar(bool show)
+{
+    mShowDefaultAvatar = show;
+}
+
+bool BubbleHeader::showDefaultAvatar() const
+{
+    return mShowDefaultAvatar;
+}
+
+void BubbleHeader::addAction ( HbAction* action )
+{
+    mActions.append( action );
+}
+
+const QList<HbAction*>& BubbleHeader::actions() const
+{
+    return mActions;    
+}
+
+void BubbleHeader::clearActions()
+{
+    mActions.clear();
+}
+
+bool BubbleHeader::isConference() const
+{
+    return false;
+}
+
+void BubbleHeader::setInConference( bool inConference )
+{
+    mIsInConference = inConference;
+}
+
+bool BubbleHeader::isInConference() const
+{
+    return mIsInConference;
+}
+
+void BubbleHeader::setExpandAction( HbAction* action )
+{
+    mExpandAction = action;
+}
+
+HbAction* BubbleHeader::expandAction() const
+{
+    return mExpandAction;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheader.h	Fri Jun 04 10:19:18 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:  Container for call data.
+*
+*/
+
+#ifndef BUBBLEHEADER_H_
+#define BUBBLEHEADER_H_
+
+#include "bubblemanager2.h"
+
+class HbAction;
+
+class BubbleHeader
+    {
+public:
+    BubbleHeader();
+    virtual ~BubbleHeader();
+    
+public:
+    /**
+    * To put everything in initial state.
+    */
+    virtual void reset();
+    
+    // used
+    void setIsUsed( bool used );
+    bool isUsed() const;
+    
+    // bubble id
+    void setBubbleId( int bubbleId );
+    int bubbleId() const;
+
+    // call state
+    void setCallState( BubbleManager::PhoneCallState state );
+    BubbleManager::PhoneCallState callState() const;
+    
+    // call flags
+    void setCallFlags( int flags ); 
+    void setCallFlag( BubbleManager::PhoneCallFlags flag );
+    void removeCallFlag( BubbleManager::PhoneCallFlags flag );
+    int callFlags() const;
+    
+    // number type
+    void setNumberType( BubbleManager::PhoneNumberType numberType );
+    BubbleManager::PhoneNumberType numberType() const;
+    
+    // text "calling"
+    void setText( 
+        const QString& text,
+        Qt::TextElideMode clip );
+    const QString& text() const;
+    Qt::TextElideMode textClipDirection() const;
+
+    // call index or name
+    void setCli( 
+        const QString& cli, 
+        Qt::TextElideMode clip );
+    const QString& cli() const;
+    Qt::TextElideMode cliClipDirection() const;
+    
+    // number
+    void setSecondaryCli( 
+        const QString& cli, 
+        Qt::TextElideMode clip );
+    const QString& secondaryCli() const;
+    Qt::TextElideMode secondaryCliClipDirection() const;
+    
+    // timer or cost
+    void setTimerCost( 
+            const QString& timerCost );
+    const QString& timerCost() const;
+    
+    // caller image
+    void setCallImage( const QString& image );
+    const QString& callImage() const;
+
+    // default avatar
+    void setShowDefaultAvatar(bool show);
+    bool showDefaultAvatar() const;
+    
+    // actions
+    void addAction( HbAction* action );
+    const QList<HbAction*>& actions() const; 
+    void clearActions();
+    
+    // header type
+    virtual bool isConference() const;
+
+    // conference participation
+    void setInConference( bool inConference );
+    bool isInConference() const;
+
+    // expand action
+    void setExpandAction( HbAction* action );
+    HbAction* expandAction() const;
+    
+private: //data
+    
+    bool mIsUsed;
+    int mBubbleId;
+    BubbleManager::PhoneCallState mCallState;
+    BubbleManager::PhoneNumberType mNumberType;
+    int mCallFlags; 
+    QString mText;
+    Qt::TextElideMode mTextClip;
+    QString mCli;
+    Qt::TextElideMode mCliClip;
+    QString mSecondaryCli;
+    Qt::TextElideMode mSecondaryCliClip;
+    QString mTimerCost;
+    QString mCallImage;
+    QList<HbAction*> mActions;
+    HbAction* mExpandAction;
+    bool mIsInConference;
+    bool mShowDefaultAvatar;
+    };
+
+#endif /* BUBBLEHEADER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Bubble heading widget
+*
+*/
+
+#include <hbstyle.h>
+#include <hbmainwindow.h>
+#include <hbevent.h>
+#include <hbiconitem.h>
+#include <hbtextitem.h>
+#include <hbfontspec.h>
+#include <hbdeviceprofile.h>
+#include <hbstyleloader.h>
+#include <hbiconanimationmanager.h>
+#include <hbiconanimator.h>
+
+#include "bubbleheadingwidget.h"
+#include "bubblemanager2.h"
+#include "bubbleutils.h"
+#include "bubbleheader.h"
+
+BubbleHeadingWidget::BubbleHeadingWidget(QGraphicsItem* item)
+    : HbWidget(item), mStatusIcon(0), mNumberTypeIcon(0),
+      mCipheringIcon(0), mText1(0), mText2(0), mText3(0)
+{
+    createPrimitives();
+
+    HbStyleLoader::registerFilePath(":/bubbleheadingwidget.css");
+    HbStyleLoader::registerFilePath(":/bubbleheadingwidget.widgetml");
+
+    // font is update in code, because cli position is changing
+    mCliFont = new HbFontSpec(HbFontSpec::Primary);
+    mTextFont = new HbFontSpec(HbFontSpec::Secondary);
+
+    HbDeviceProfile profile;
+    mCliFont->setTextHeight(4*HbDeviceProfile::current().unitValue());
+    mTextFont->setTextHeight(4*HbDeviceProfile::current().unitValue());
+
+    HbIconAnimationManager *mgr = HbIconAnimationManager::global();
+    mgr->addDefinitionFile(":/bubble_icon_anim.axml");
+}
+
+BubbleHeadingWidget::~BubbleHeadingWidget()
+{
+    delete mCliFont;
+    delete mTextFont;
+}
+
+void BubbleHeadingWidget::reset()
+{
+    mHeader = 0;
+    mText1->setText(QString());
+    mText2->setText(QString());
+    mText3->setText(QString());
+    mStatusIcon->hide();
+    mStatusIcon->animator().stopAnimation();
+    mNumberTypeIcon->hide();
+    mCipheringIcon->hide();
+}
+
+void BubbleHeadingWidget::readBubbleHeader(const BubbleHeader& header)
+{
+    mHeader = &header;
+    updatePrimitives();
+}
+
+void BubbleHeadingWidget::createPrimitives()
+{
+    mText1 = new HbTextItem(this);
+    style()->setItemName( mText1, "text_line_1" );
+
+    mText2 = new HbTextItem(this);
+    style()->setItemName( mText2, "text_line_2" );
+
+    mText3 = new HbTextItem(this);
+    style()->setItemName( mText3, "text_line_3" );
+
+    //mStatusIcon = new BubbleAnimIconItem(BUBBLE_ICON_ANIM_INTERVAL, this);
+    mStatusIcon = new HbIconItem(this);
+    style()->setItemName( mStatusIcon, "status_icon" );
+
+    mNumberTypeIcon = new HbIconItem(this);
+    style()->setItemName( mNumberTypeIcon, "number_type_icon" );
+
+    mCipheringIcon = new HbIconItem(this);
+    style()->setItemName( mCipheringIcon, "ciphering_icon" );
+}
+
+void BubbleHeadingWidget::updatePrimitives()
+{
+    if (mHeader!=0) {
+        BubbleUtils::setCallStatusIcon(
+            mHeader->callState(), mHeader->callFlags(), *mStatusIcon);
+
+        BubbleUtils::setNumberTypeIcon(
+            mHeader->callState(), mHeader->callFlags(), *mNumberTypeIcon);
+
+        BubbleUtils::setCipheringIcon(
+            mHeader->callState(), mHeader->callFlags(), *mCipheringIcon);
+
+        // update text lines
+        int cliLine = 0;
+
+        if (lines==3) {
+            BubbleUtils::setCallHeaderTexts3Lines(
+                *mHeader, *mText1, *mText2, *mText3, cliLine,
+                mCallTimerTextLine );
+        } else if (lines==2) {
+            BubbleUtils::setCallHeaderTexts2Lines(
+                *mHeader, *mText1, *mText2, cliLine,
+                mCallTimerTextLine );
+        } else {
+            // todo: 1-line
+            BubbleUtils::setCallHeaderTexts2Lines(
+                *mHeader, *mText1, *mText2, cliLine,
+                mCallTimerTextLine );
+        }
+
+        // update font
+        if (cliLine==2) {
+            mText1->setFontSpec(*mTextFont);
+            mText2->setFontSpec(*mCliFont);
+            mText3->setFontSpec(*mTextFont);
+        } else {
+            mText1->setFontSpec(*mCliFont);
+            mText2->setFontSpec(*mTextFont);
+            mText3->setFontSpec(*mTextFont);
+        }
+    }
+
+    repolish();
+}
+
+void BubbleHeadingWidget::polishEvent()
+{
+    if (lines == 3) {
+        setLayout("three_lines");
+        mText1->setVisible(true);
+        mText2->setVisible(true);
+        mText3->setVisible(true);
+    } else if (lines == 2) {
+        setLayout("two_lines");
+        mText1->setVisible(true);
+        mText2->setVisible(true);
+        mText3->setVisible(false);
+    } else if (lines == 1) {
+        setLayout("one_line");
+        mText1->setVisible(true);
+        mText2->setVisible(true);
+        mText3->setVisible(false);
+    }
+
+    HbWidget::polishEvent();
+}
+
+int BubbleHeadingWidget::lineCount() const
+{
+    return lines;
+}
+
+void BubbleHeadingWidget::setLineCount(int count)
+{
+    lines = count;
+    if (isVisible()) {
+        repolish();        
+    }
+}
+
+QString BubbleHeadingWidget::layout() const
+{
+    return layoutOption;
+}
+
+void BubbleHeadingWidget::setLayout(const QString& layout)
+{
+    layoutOption = layout;
+}
+
+void BubbleHeadingWidget::updateTimerDisplayNow()
+{
+    if ( mHeader && ( mHeader->callState() == BubbleManager::Active ) ) {
+        if ( mCallTimerTextLine == 2 ) {
+            mText2->setText(mHeader->timerCost());
+            mText2->setElideMode(Qt::ElideRight);
+        } else if ( mCallTimerTextLine == 3 ) {
+            mText3->setText(mHeader->timerCost());
+            mText3->setElideMode(Qt::ElideRight);
+        }
+    }
+}
+
+void BubbleHeadingWidget::changeEvent(QEvent *event)
+{
+    if (event->type() == HbEvent::ThemeChanged) {
+        updatePrimitives();
+    }
+
+    HbWidget::changeEvent(event);
+}
+
+void BubbleHeadingWidget::showEvent(QShowEvent *event)
+{
+    Q_UNUSED(event)
+    mStatusIcon->animator().startAnimation();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleheadingwidget.h	Fri Jun 04 10:19:18 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: Bubble heading widget
+*
+*/
+
+#ifndef BUBBLEHEADINGWIDGET_H
+#define BUBBLEHEADINGWIDGET_H
+
+#include <hbwidget.h>
+
+class HbIconItem;
+class HbTextItem;
+class HbFontSpec;
+class BubbleHeader;
+
+class BubbleHeadingWidget : public HbWidget
+{
+    Q_OBJECT
+    Q_PROPERTY(int lines READ lineCount WRITE setLineCount)
+    Q_PROPERTY(QString layoutOption READ layout WRITE setLayout)
+
+public:
+    BubbleHeadingWidget(QGraphicsItem* item=0);
+    virtual ~BubbleHeadingWidget();
+
+    int lineCount() const;
+    void setLineCount(int count);
+
+    QString layout() const;
+    void setLayout(const QString& layout);
+
+    void reset();
+    void readBubbleHeader(const BubbleHeader& header);
+    void updateTimerDisplayNow();
+
+private:
+    void createPrimitives();
+    void updatePrimitives();
+
+protected:
+    void polishEvent();
+    void changeEvent(QEvent *event);
+    void showEvent(QShowEvent *event);
+
+private:
+    int lines;
+    QString layoutOption;
+
+    const BubbleHeader* mHeader;
+
+    // primitives
+    //BubbleAnimIconItem* mStatusIcon;
+    HbIconItem* mStatusIcon;
+    HbIconItem* mNumberTypeIcon;
+    HbIconItem* mCipheringIcon;
+    HbTextItem* mText1;
+    HbTextItem* mText2;
+    HbTextItem* mText3;
+    int mCallTimerTextLine;
+    HbFontSpec* mCliFont;
+    HbFontSpec* mTextFont;
+};
+
+#endif // BUBBLEHEADINGWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,53 @@
+/*!
+* 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 <QtCore>
+#include "bubbleimagemanager.h"
+#include "bubbleimagemanager_p.h"
+
+BubbleImageManager::BubbleImageManager(QObject* parent)
+    : QObject(parent),
+      d_ptr(new BubbleImageManagerPrivate(this))
+{
+}
+
+BubbleImageManager::~BubbleImageManager()
+{
+    delete d_ptr;
+}
+
+const QPixmap* BubbleImageManager::pixmap(
+    const QString& imageFileName)
+{
+    return d_ptr->pixmap(imageFileName);
+}
+
+void BubbleImageManager::loadImage(const QString& imageFileName)
+{
+    d_ptr->loadImage(imageFileName);
+}
+
+void BubbleImageManager::unloadImage(const QString& imageFileName)
+{
+    d_ptr->unloadImage(imageFileName);
+}
+
+void BubbleImageManager::releasePixmaps()
+{
+    d_ptr->releasePixmaps();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,50 @@
+/*!
+* 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 BUBBLEIMAGEMANAGER_H_
+#define BUBBLEIMAGEMANAGER_H_
+
+#include <QObject>
+#include <QPixmap>
+
+class BubbleImageManagerPrivate;
+
+class BubbleImageManager : public QObject
+    {
+    Q_OBJECT
+    
+public:
+    explicit BubbleImageManager(QObject* parent = 0);
+    virtual ~BubbleImageManager();
+
+    const QPixmap* pixmap(const QString& imageFileName);
+
+    void loadImage(const QString& imageFileName);
+
+    void unloadImage(const QString& imageFileName);
+
+    void releasePixmaps();
+
+signals:
+    void pixmapReady(const QString& imageFileName);
+    
+protected:
+    BubbleImageManagerPrivate* const d_ptr;
+    Q_DECLARE_PRIVATE(BubbleImageManager)
+    };
+
+#endif /* BUBBLEIMAGEMANAGER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,171 @@
+/*!
+* 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 <QtCore>
+#include "bubbleimagemanager_p.h"
+#include "bubbleimagemanager.h"
+#include <thumbnailmanager_qt.h>
+
+//#define BUBBLE_IMAGEMANAGER_DEBUG
+#if defined(BUBBLE_IMAGEMANAGER_DEBUG)
+   #define BUBBLE_QDEBUG( a )
+   #define BUBBLE_QDEBUG_2( a, b)
+#else
+   #define BUBBLE_QDEBUG( a )\
+       qDebug() << a;
+
+   #define BUBBLE_QDEBUG_2( a, b)\
+       qDebug() << a << b;
+#endif
+
+BubbleImageManagerPrivate::BubbleImageManagerPrivate(
+    BubbleImageManager* parent)
+    : q_ptr(parent),
+      mInitialized(false)
+{
+}
+
+BubbleImageManagerPrivate::~BubbleImageManagerPrivate()
+{
+}
+
+void BubbleImageManagerPrivate::initialize()
+{
+    mThumbnailManager = new ThumbnailManager(this);
+    
+    mThumbnailManager->setMode(ThumbnailManager::Default);
+    
+    mThumbnailManager->setQualityPreference(
+        ThumbnailManager::OptimizeForPerformance);
+    
+    mThumbnailManager->setThumbnailSize(
+        ThumbnailManager::ThumbnailLarge);
+    
+    connect(mThumbnailManager,
+            SIGNAL(thumbnailReady(QPixmap, void *, int, int)),
+            this,
+            SLOT(thumbnailReady(QPixmap, void *, int, int)));
+    
+    mInitialized = true;
+}
+
+const QPixmap* BubbleImageManagerPrivate::pixmap(
+    const QString& imageFileName)
+{
+    if (mImageCache.contains(imageFileName)) {
+        return mImageCache.value(imageFileName);
+    } else {
+        return 0;
+    }
+}
+
+void BubbleImageManagerPrivate::loadImage(const QString& imageFileName)
+{
+    if (mImageCache.contains(imageFileName) ||
+        isLoading(imageFileName)) {
+        return;
+    }
+
+    if (!mInitialized) {
+        // connect to thumbnail server
+        initialize();
+    }
+
+    BUBBLE_QDEBUG_2("loading image: ", imageFileName);
+
+    QString* data = new QString(imageFileName);
+    int reqId = mThumbnailManager->getThumbnail(imageFileName, data);
+    mRequestQueue.enqueue(qMakePair(imageFileName,reqId));
+}
+
+void BubbleImageManagerPrivate::unloadImage(const QString& imageFileName)
+{
+    BUBBLE_QDEBUG_2("unloading image: ", imageFileName);
+
+    // returns null, if key doesn't exists
+    QPixmap* pixmap = mImageCache.take(imageFileName);
+    delete pixmap;
+
+    // cancel possible outstanding request
+    QMutableListIterator< QPair<QString,int> > requests(mRequestQueue);
+    while(requests.hasNext()) {
+        QPair<QString,int>& request = requests.next();  
+        
+        if (request.first==imageFileName) {
+            BUBBLE_QDEBUG_2("cancelling request: ", imageFileName);
+            mThumbnailManager->cancelRequest(request.second);            
+            requests.remove();
+            break;
+        }
+    }
+}
+
+void BubbleImageManagerPrivate::releasePixmaps()
+{
+    BUBBLE_QDEBUG_2("releasing all pixmaps: ", mImageCache.count());
+
+    // release all cached pixmaps
+    QList<QPixmap*> pixmaps = mImageCache.values();
+    qDeleteAll(pixmaps);
+    mImageCache.clear();
+}
+
+void BubbleImageManagerPrivate::thumbnailReady(
+    const QPixmap& pixmap, void *data, int id, int error)
+{
+    QString* fileName = (QString*)data;            
+    
+    if (error==0 && fileName) {
+        QPixmap *p = new QPixmap(pixmap);
+        mImageCache.insert(*fileName,p);
+        emit q_ptr->pixmapReady(*fileName);
+        BUBBLE_QDEBUG_2("thumbnailReady: ", *fileName);
+    }
+    
+    // request complete, remove it from queue
+    QMutableListIterator< QPair<QString,int> > requests(mRequestQueue);
+    while(requests.hasNext()) {
+        QPair<QString,int>& request = requests.next();  
+        if (request.second==id) {
+            BUBBLE_QDEBUG_2("deleting completed request: ", *fileName);
+            requests.remove();
+            break;
+        }
+    }    
+    
+    delete fileName;    
+}
+
+void BubbleImageManagerPrivate::thumbnailReady()
+{
+}
+
+bool BubbleImageManagerPrivate::isLoading(const QString& imageFileName) const
+{
+    bool loading = false;
+
+    QListIterator< QPair<QString,int> > requests(mRequestQueue);
+    while(requests.hasNext()) {
+        if (requests.next().first==imageFileName) {
+            loading = true;
+            break;
+        }
+    }
+
+    return loading;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,67 @@
+/*!
+* 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 BUBBLEIMAGEMANAGER_P_H_
+#define BUBBLEIMAGEMANAGER_P_H_
+
+#include <QObject>
+#include <QMap>
+#include <QPixmap>
+#include <QQueue>
+#include <QPair>
+
+class ThumbnailManager;
+class BubbleImageManager;
+
+class BubbleImageManagerPrivate : public QObject
+    {
+    Q_OBJECT
+
+    Q_DECLARE_PUBLIC( BubbleImageManager )
+
+public:
+    explicit BubbleImageManagerPrivate(BubbleImageManager* parent = 0);
+    virtual ~BubbleImageManagerPrivate();
+
+    const QPixmap* pixmap(const QString& imageFileName);
+
+    void loadImage(const QString& imageFileName);
+
+    void unloadImage(const QString& imageFileName);
+
+    void releasePixmaps();
+
+protected:
+    void initialize();
+    bool isLoading(const QString& imageFileName) const;
+
+protected slots:
+    void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
+    void thumbnailReady(); // for stub
+
+signals:
+    void pixmapReady(const QString& imageFileName);
+    
+private:
+    BubbleImageManager* q_ptr;
+    ThumbnailManager* mThumbnailManager;
+    QMap<QString,QPixmap*> mImageCache;
+    QQueue< QPair<QString, int> > mRequestQueue;
+    bool mInitialized;
+    };
+
+#endif /* BUBBLEIMAGEMANAGER_P_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagemanager_p_stub.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,143 @@
+/*!
+* 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: Stub implementation for desktop environment.
+*
+*/
+
+#include <QtCore>
+#include <QImageReader>
+#include <QTimer>
+#include "bubbleimagemanager.h"
+#include "bubbleimagemanager_p.h"
+
+BubbleImageManagerPrivate::BubbleImageManagerPrivate(
+    BubbleImageManager* parent)
+    : q_ptr(parent), mInitialized(false)
+{
+}
+
+BubbleImageManagerPrivate::~BubbleImageManagerPrivate()
+{
+}
+
+void BubbleImageManagerPrivate::initialize()
+{
+    mInitialized = true;
+}
+
+const QPixmap* BubbleImageManagerPrivate::pixmap(
+    const QString& imageFileName)
+{
+    if (mImageCache.contains(imageFileName)) {
+        return mImageCache.value(imageFileName);
+    } else {
+        return 0;
+    }
+}
+
+void BubbleImageManagerPrivate::loadImage(const QString& imageFileName)
+{
+    if (mImageCache.contains(imageFileName) ||
+        isLoading(imageFileName)) {
+        return;
+    }
+
+    if (!mInitialized) {
+        // connect to thumbnail server
+        initialize();
+    }
+
+    qDebug() << "loading image: " << imageFileName;
+
+    mRequestQueue.enqueue(qMakePair(imageFileName,0));
+    QTimer::singleShot(100,this,SLOT(thumbnailReady()));
+}
+
+void BubbleImageManagerPrivate::unloadImage(const QString& imageFileName)
+{
+    qDebug() << "unloading image: " << imageFileName;
+
+    // returns null, if key doesn't exists
+    QPixmap* pixmap = mImageCache.take(imageFileName);
+    delete pixmap;
+
+    // cancel possible outstanding request
+    QMutableListIterator< QPair<QString,int> > requests(mRequestQueue);
+    while(requests.hasNext()) {
+        if (requests.next().first==imageFileName) {
+            qDebug() << "cancelling request: " << imageFileName;
+            //requests.remove();
+            requests.value().second = 1; // mark as cancelled
+            break;
+        }
+    }
+}
+
+void BubbleImageManagerPrivate::releasePixmaps()
+{
+    qDebug() << "releasing all pixmaps: " << mImageCache.count();
+    // release all cached pixmaps
+    QList<QPixmap*> pixmaps = mImageCache.values();
+    qDeleteAll(pixmaps);
+    mImageCache.clear();
+}
+
+void BubbleImageManagerPrivate::thumbnailReady(
+    const QPixmap& pixmap, void *data, int id, int error)
+{
+    Q_UNUSED(pixmap);
+    Q_UNUSED(data);
+    Q_UNUSED(id);
+    Q_UNUSED(error);
+}
+
+void BubbleImageManagerPrivate::thumbnailReady()
+{
+    QPair<QString,int> request = mRequestQueue.dequeue();
+
+    if (request.second==1) {
+        // canceled
+        return;
+    }
+
+    QString readFile = request.first;
+    qDebug() << "reading: " << readFile;
+
+    QImageReader reader(readFile);
+    QSize size(reader.size());
+    QImage *image = new QImage();
+    if (reader.read(image)) {
+        QPixmap *pixmap = new QPixmap();
+        *pixmap = QPixmap::fromImage(*image);
+        mImageCache.insert(readFile,pixmap);
+        emit  q_ptr->pixmapReady(readFile);
+    }
+    delete image;
+}
+
+bool BubbleImageManagerPrivate::isLoading(const QString& imageFileName) const
+{
+    bool loading = false;
+
+    QListIterator< QPair<QString,int> > requests(mRequestQueue);
+    while(requests.hasNext()) {
+        if (requests.next().first==imageFileName) {
+            loading = true;
+            break;
+        }
+    }
+
+    return loading;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.cpp	Fri Jun 04 10:19:18 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:  Widget to display contact image.
+*               Displays default avatar, when image is not set.
+*
+*/
+
+#include <QPainter>
+#include <hbstyle.h>
+#include <hbiconitem.h>
+#include <hbstyleloader.h>
+#include "bubbleimagemanager.h"
+#include "bubbleimagewidget.h"
+
+BubbleImageWidget::BubbleImageWidget(
+    BubbleImageManager& imageManager,
+    QGraphicsItem* parent)
+    : HbWidget(parent),
+      mImageManager(imageManager),
+      mDefaultAvatar(0)
+{
+    // create avatar
+    mDefaultAvatar = new HbIconItem(this);
+    style()->setItemName( mDefaultAvatar, "default_avatar" );
+    mDefaultAvatar->setAspectRatioMode(Qt::KeepAspectRatioByExpanding);
+    mDefaultAvatar->setAlignment(Qt::AlignCenter);
+
+    connect(&mImageManager, SIGNAL(pixmapReady(QString)),
+            this, SLOT(imageLoaded(QString)));
+
+    HbStyleLoader::registerFilePath(":/bubbleimagewidget.css");
+    HbStyleLoader::registerFilePath(":/bubbleimagewidget.widgetml");
+}
+
+BubbleImageWidget::~BubbleImageWidget()
+{
+}
+
+void BubbleImageWidget::setImage(const QString& name)
+{
+    mImageName = name;
+
+    if (!mImageName.isEmpty()) {
+        mDefaultAvatar->setVisible(false);
+        mDefaultAvatar->setIcon(HbIcon());
+        mImageManager.loadImage(mImageName);
+    } else {
+        mDefaultAvatar->setIconName("qtg_large_avatar");
+        mDefaultAvatar->setVisible(true);
+    }
+}
+
+void BubbleImageWidget::imageLoaded(QString imageFileName)
+{
+    if (imageFileName==mImageName) {
+        update(); // does nothing if invisible
+    }
+}
+
+void BubbleImageWidget::paint(
+    QPainter* painter,
+    const QStyleOptionGraphicsItem* option,
+    QWidget* widget)
+{
+    Q_UNUSED(option);
+    Q_UNUSED(widget);
+    
+    if (mImageName.isEmpty())
+        return;
+
+    const QPixmap* pixmap =
+        mImageManager.pixmap(mImageName);
+
+    if (pixmap) {
+        // up or downscales images to fill image area
+        QSize imageSize(pixmap->size());
+        QSize sourceSize(rect().size().toSize());
+        sourceSize.scale(imageSize,Qt::KeepAspectRatio);
+        QRect sourceRect(QPoint(0,0),sourceSize);
+        int xOff = (imageSize.width() - sourceSize.width())/2;
+        int yOff = (imageSize.height() - sourceSize.height())/2;
+        sourceRect.moveLeft(xOff);
+        sourceRect.moveTop(yOff);
+        // qDebug() << "imageSize:" << imageSize;
+        // qDebug() << "sourceRect:" << sourceRect;
+        painter->setRenderHint(QPainter::SmoothPixmapTransform);
+
+#ifdef __WINS__
+        // sourceRect crashes emulator, RC ou1cimx1#320113
+        painter->drawPixmap(rect().toRect(),*pixmap);
+#else        
+        painter->drawPixmap(rect().toRect(),*pixmap,sourceRect);
+#endif        
+        
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleimagewidget.h	Fri Jun 04 10:19:18 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:  Widget to display contact image.
+*
+*/
+
+#ifndef BUBBLEIMAGEWIDGET_H_
+#define BUBBLEIMAGEWIDGET_H_
+
+#include <hbwidget.h>
+
+class BubbleImageManager;
+class HbIconItem;
+
+class BubbleImageWidget : public HbWidget
+    {
+    Q_OBJECT
+    
+public:
+    explicit BubbleImageWidget(
+        BubbleImageManager& imageManager,
+        QGraphicsItem* parent = 0 );
+    virtual ~BubbleImageWidget();
+
+    void setImage(const QString& name);
+
+protected slots:
+    void imageLoaded(QString imageFileName);
+
+protected:
+    void paint(
+        QPainter* painter,
+        const QStyleOptionGraphicsItem* option,
+        QWidget* widget);
+
+private:
+    BubbleImageManager& mImageManager;
+    QString  mImageName;
+    HbIconItem* mDefaultAvatar;
+    };
+
+#endif /* BUBBLEIMAGEWIDGET_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblemanager2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,927 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BubbleManager widget.
+*
+*/
+
+#include <QtGui>
+#include <QtAlgorithms>
+
+#include <hblabel.h>
+#include <hbstyle.h>
+#include <hbiconitem.h>
+#include <hbaction.h>
+#include <hbstackedlayout.h>
+#include <hbmainwindow.h>
+
+#include "bubblemanager2.h"
+#include "bubbleheader.h"
+#include "bubbleconferenceheader.h"
+#include "bubbleutils.h"
+#include "bubblewidgetmanager.h"
+#include "bubbleimagemanager.h"
+#include "bubblehandler.h"
+#include "bubbleeffecthandler.h"
+
+
+BubbleManager::BubbleManager( QGraphicsItem *parent ) :
+    HbWidget( parent ),
+    mIsReadyToDraw(0),
+    mMuted(0),
+    mMutedIcon(0),
+    mSortHeaders(false),
+    mInitialized(false),
+    mBubbleSelectionDisabled(0)
+{
+    // allocate headers
+    BubbleHeader* header;
+    for ( int i = 0 ; i < BUBBLE_MAX_CALL_COUNT ; i++ ) {
+        header = new BubbleHeader;
+        header->setBubbleId( i );
+        mCallHeaders.append( header );
+    }
+
+    mConferenceHeader = new BubbleConferenceHeader();
+    mConferenceHeader->setBubbleId(BUBBLE_CONF_CALL_ID);
+
+    mBubbleImageManager = new BubbleImageManager(this);
+
+    mEffectHandler = new BubbleEffectHandler(this);
+
+    mWidgetManager = new BubbleWidgetManager(
+        *mBubbleImageManager, this);
+
+    mMainLayout = new HbStackedLayout(this);
+    mMainLayout->setContentsMargins(0.0,0.0,0.0,0.0);
+    setLayout(mMainLayout);
+
+    // preload views on boot
+    mWidgetManager->view(BubbleWidgetManager::SingleCallView);
+}
+
+BubbleManager::~BubbleManager()
+{
+    qDeleteAll(mCallHeaders);
+    mCallHeaders.clear();
+    delete mConferenceHeader;
+}
+
+/**
+* Before making any changes to bubble headers, call this function so
+* manager can prapare for them properly.
+*/
+void BubbleManager::startChanges()
+{
+    mIsReadyToDraw++;
+    if ( mIsReadyToDraw > 1 ) {
+        return;
+    }
+    
+    if (parentItem()) {
+        // reset/hide on outlooks may result clearFocus() call,
+        // which means that there is no focused item. move focus
+        // to parent item, before reset/hide calls.
+        parentItem()->setFocus();
+    }
+
+    // invalidate current widgets
+    for (int i=0; i<mMainLayout->count(); i++) {
+        mMainLayout->itemAt(i)->graphicsItem()->hide();
+    }
+
+    // reset active handlers
+    foreach (BubbleHandler* handler, mActiveHandlers) {
+        handler->reset();
+    }
+    mActiveHandlers.clear();
+}
+
+/**
+* After the changes to bubble headers call this function so manager
+* can prepare bubbles to right places and check the drawing order.
+* Memory for arrays has been allocated beforehand.
+*/
+void BubbleManager::endChanges()
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    mIsReadyToDraw--;
+    if ( mIsReadyToDraw != 0 ) {
+        return;
+    }
+
+    if (!mInitialized) {
+        if (mainWindow()) {
+            mWidgetManager->handleOrientationChange(mainWindow()->orientation());
+            mInitialized=true;
+        }
+    }
+
+    // sort active headers
+    if ( mActiveHeaders.count() && mSortHeaders) {
+        qStableSort(mActiveHeaders.begin(),
+                    mActiveHeaders.end(),
+                    BubbleUtils::compareHeaders );
+        mSortHeaders = false;
+    }
+
+    // select view
+    QGraphicsWidget* view = selectView();
+
+    if (view) {
+        setViewData(view);
+        view->show();
+    }
+
+    if (!mActiveHeaders.count()) {
+        mBubbleImageManager->releasePixmaps();
+    }
+
+    // restore mute state
+    setPhoneMuted(mMuted);
+
+    update();
+}
+
+QGraphicsWidget* BubbleManager::selectView()
+{
+    QGraphicsWidget* view=0;
+    int bubbleCount = shownHeaderCount();
+
+    if (bubbleCount && isConferenceExpanded()) {
+        view = mWidgetManager->view(BubbleWidgetManager::ConferenceView);
+    } else {
+        switch(bubbleCount) {
+        case 1:
+            view = mWidgetManager->view(BubbleWidgetManager::SingleCallView);
+            break;
+        case 2:
+            view = mWidgetManager->view(BubbleWidgetManager::TwoCallsView);
+            break;
+        case 3:
+            view = mWidgetManager->view(BubbleWidgetManager::ThreeCallsView);
+            break;
+        default:
+            break;
+        }
+    }
+
+    if (view) {
+        if (addToLayout(view)) {
+            // connect signals
+            connectSignals(view);
+        }
+    }
+
+    return view;
+}
+
+bool BubbleManager::addToLayout(QGraphicsWidget* widget)
+{
+    Q_ASSERT(widget);
+
+    bool added=false;
+    int index = mMainLayout->indexOf(widget);
+    if (index == -1) {
+        mMainLayout->addItem(widget);
+        added=true;
+    }
+
+    return added;
+}
+
+void BubbleManager::removeFromLayout(QGraphicsWidget* widget)
+{
+    mMainLayout->removeItem(widget);
+}
+
+void BubbleManager::connectSignals(QGraphicsWidget* widget)
+{
+    QList<BubbleHandler*>* handlers = mWidgetManager->handlers(widget);
+    if (handlers) {
+        foreach (BubbleHandler* handler, *handlers) {
+            connect(handler,SIGNAL(headerSelected(int)),
+                    SLOT(showExpanded(int)));
+        }
+    }
+}
+
+void BubbleManager::setViewData(QGraphicsWidget* view)
+{
+    Q_ASSERT(view);
+
+    QList<BubbleHandler*>* handlers =
+            mWidgetManager->handlers(view);
+
+    if (handlers) {
+        if (isConferenceExpanded()) {
+            // only conference call is displayed
+            Q_ASSERT(handlers->count()==1);
+            BubbleHandler* handler = handlers->at(0);
+            handler->readBubbleHeader(*mConferenceHeader);
+            mActiveHandlers.append(handler);
+        } else {
+            int i=0;
+            foreach (BubbleHandler* handler, *handlers) {
+                findNextDrawableHeader(i);
+                handler->readBubbleHeader(*mActiveHeaders.at(i));
+                mActiveHandlers.append(handler);
+                i++;
+                if (i==mActiveHeaders.count()) {
+                    break;
+                }
+            }
+        }
+    }
+}
+
+/**
+* Takes a new call header in use.
+* Returns bubble idenfication number.
+*/
+int BubbleManager::createCallHeader()
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    quint8 index = 0;
+    while ( mCallHeaders[index]->isUsed( ) ) {
+        index++;
+        Q_ASSERT( index < mCallHeaders.size() );
+    }
+
+    BubbleHeader* header = mCallHeaders[index];
+
+    header->setIsUsed( true );
+
+    mActiveHeaders.insert( 0, header ); // in priority order
+
+    return header->bubbleId();
+}
+
+/**
+* Removes call header from use
+*/
+void BubbleManager::removeCallHeader( int bubbleId )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    for ( int i=0; i < mActiveHeaders.size(); i++ ) {
+        if ( mActiveHeaders[i]->bubbleId() == bubbleId ) {
+            QString image = mActiveHeaders[i]->callImage();
+            mActiveHeaders[i]->reset();
+            mActiveHeaders.remove( i );
+            releaseImageIfNotUsed(image);
+            break;
+        }
+    }
+}
+
+/**
+* Finds header by bubble id.
+*/
+bool BubbleManager::findActiveHeader( int bubbleId, BubbleHeader*& header )
+{
+    header = 0;
+    for ( int i=0; i < mActiveHeaders.size(); i++ ) {
+        if ( mActiveHeaders[i]->bubbleId() == bubbleId ) {
+            header = mActiveHeaders[i];
+            break;
+        }
+    }
+
+    return header ? true : false;
+}
+
+void BubbleManager::findNextDrawableHeader(int& index) const
+{
+    while (mActiveHeaders.at(index)->isInConference()) {
+        index++;
+    }
+}
+
+/**
+* Sets call state to header.
+*/
+void BubbleManager::setState(
+    int bubbleId,
+    PhoneCallState state )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    BubbleManager::PhoneCallState oldState =
+        header->callState();
+
+    if ( shownHeaderCount()<3 &&
+         !header->isInConference() &&
+         (expandedBubble() != bubbleId) &&
+         (oldState==OnHold && state==Active) ) {
+        // send key swap -> make active call expanded
+        int i = mActiveHeaders.indexOf(header);
+        mActiveHeaders.remove(i);
+        mActiveHeaders.insert(0, header);
+    }
+
+    header->setCallState( state );
+}
+
+/**
+* Sets text label to header. For conf also.
+* Text to be seen in bubble ( e.g. 'on hold' )
+*/
+void BubbleManager::setLabel(
+    int bubbleId,
+    const QString& text,
+    Qt::TextElideMode clipDirection )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setText( text, clipDirection );
+}
+
+/**
+* Sets caller's line identification ( name or number) to header.
+* For conf also. Caller's CLI ( e.g. 'Mother' )
+*/
+void BubbleManager::setCli(
+    int bubbleId,
+    const QString& cliText,
+    Qt::TextElideMode clipDirection )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setCli( cliText, clipDirection );
+}
+
+/**
+* Updates caller's line identification ( name or number) to header.
+* Caller's CLI ( e.g. 'Daddy' )-
+*/
+void BubbleManager::updateCLI(
+    int bubbleId,
+    const QString& cliText,
+    Qt::TextElideMode clipDirection )
+{
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setCli( cliText, clipDirection );
+
+    // ToDo: take care of redrawing
+}
+
+/**
+* Number or voip adress, when phonebook name takes Cli.
+*/
+void BubbleManager::setSecondaryCli(
+    int bubbleId,
+    const QString& cliText,
+    Qt::TextElideMode clipDirection )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setSecondaryCli( cliText, clipDirection );
+}
+
+/**
+* Sets call time or cost text to header. For conf also.
+*/
+void BubbleManager::setCallTime(
+    int bubbleId,
+    const QString& callTime )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setTimerCost( callTime );
+}
+
+/**
+* Updates call time or cost text to header.  For conf also.
+* Timer or cost text ( e.g. '00:12:34' or '£01.23' ).
+*/
+void BubbleManager::updateCallTime(
+    int bubbleId,
+    const QString& callTime )
+{
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setTimerCost( callTime );
+
+    foreach (BubbleHandler* handler,mActiveHandlers) {
+        handler->updateTimerDisplayNow();
+    }
+}
+
+/**
+* Attach a call image to header.
+*/
+void BubbleManager::setCallObjectImage(
+    int bubbleId,
+    const QString& fileName )
+{
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setCallImage(fileName);
+}
+
+/**
+* Attach the theme call image to header.
+*/
+void BubbleManager::setCallObjectFromTheme(
+    int bubbleId )
+{
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setShowDefaultAvatar(true);
+}
+
+/**
+* Sets call flags to header.
+*/
+void BubbleManager::setCallFlags(
+    int bubbleId,
+    int flags )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setCallFlags( flags );
+}
+
+/**
+* Sets call flags to header.
+*/
+void BubbleManager::setCallFlag(
+    int bubbleId,
+    PhoneCallFlags flag,
+    bool set )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    if ( set ) {
+        header->setCallFlag( flag );
+    }
+    else {
+        header->removeCallFlag( flag );
+    }
+}
+
+/**
+* Sets number type.
+*/
+void BubbleManager::setNumberType(
+    int bubbleId,
+    PhoneNumberType type )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->setNumberType( type );
+}
+
+/**
+* Sets phone muted/unmuted.
+* @param aIsMuted ETrue if phone is muted.
+*/
+void BubbleManager::setPhoneMuted(
+    bool muted )
+{
+    if (!mMutedIcon && muted) {
+        mMutedIcon = mWidgetManager->view(BubbleWidgetManager::MutedOverlay);
+        Q_ASSERT(mMutedIcon);
+        addToLayout(mMutedIcon);
+        mMutedIcon->setZValue(10.0);
+        mEffectHandler->addEffect(mMutedIcon,BubbleMutedAppear);
+        mEffectHandler->addEffect(mMutedIcon,BubbleMutedDisappear);
+    }
+
+    if (mMutedIcon) {
+        // run effect when mute status changes
+        if (muted && !mMuted) {
+            mEffectHandler->startEffect(BubbleMutedAppear);
+        } else if (!muted && mMuted) {
+            mEffectHandler->startEffect(BubbleMutedDisappear);
+        } else {
+            mMutedIcon->setVisible(muted);
+        }
+    }
+
+    mMuted = muted;
+}
+
+/**
+* Creates a conference call based upon two calls. Bubbles must be
+* created first.
+*/
+int BubbleManager::createConference(
+    int bubble1,
+    int bubble2 )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    mConferenceHeader->setIsUsed(true);
+    mActiveHeaders.append(mConferenceHeader);
+    addRowToConference(bubble1);
+    addRowToConference(bubble2);
+    return mConferenceHeader->bubbleId();
+}
+
+/**
+* Splits conference call into invidual two calls. Call headers stays
+* in use. Headers' state will not be changed.
+*/
+void BubbleManager::removeConference()
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    mConferenceHeader->reset();
+    mSortHeaders = true;
+
+    for ( int i=0; i < mActiveHeaders.size(); i++ ) {
+        if ( mActiveHeaders[i]->bubbleId() == BUBBLE_CONF_CALL_ID ) {
+            mActiveHeaders.remove( i );
+            break;
+        }
+    }
+
+    QGraphicsWidget* view =
+        mWidgetManager->view(BubbleWidgetManager::ConferenceView);
+    if (view) {
+        QList<BubbleHandler*>* handlers = mWidgetManager->handlers(view);
+        if (handlers) {
+            foreach (BubbleHandler* handler, *handlers) {
+                handler->conferenceRemoved();
+            }
+        }
+    }
+}
+
+/**
+* Adds new call to conference call.
+*/
+void BubbleManager::addRowToConference( int bubbleId )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+    
+    Q_ASSERT( !header->isInConference() );
+    Q_ASSERT( !header->isConference() );
+
+    mConferenceHeader->addHeader(header);
+
+    // release image while in conference
+    releaseImageIfNotUsed(header->callImage());
+}
+
+/**
+* Takes specified call out of conference. Use RemoveConference if
+* conference has only two calls in it. Header's state is same as
+* before adding it to conference (if not changed inside the conf).
+*/
+void BubbleManager::removeRowFromConference( int bubbleId )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+    mConferenceHeader->removeHeader(bubbleId);
+    mSortHeaders = true;
+
+    QGraphicsWidget* view =
+        mWidgetManager->view(BubbleWidgetManager::ConferenceView);
+
+    if (view) {
+        QList<BubbleHandler*>* handlers = mWidgetManager->handlers(view);
+        if (handlers) {
+            foreach (BubbleHandler* handler, *handlers) {
+                handler->conferenceMemberRemoved(bubbleId);
+            }
+        }
+    }
+}
+
+/**
+* Counts calls in conference call.
+*/
+int BubbleManager::conferenceRowCount() const
+{
+    return mConferenceHeader->headers().count();
+}
+
+
+/**
+* Sets highlight to specified line in conference.
+*/
+void BubbleManager::setSelectionInConference( int rowNumber )
+{
+    Q_UNUSED(rowNumber)
+}
+
+/**
+* Sets highlight to specified bubble id in conference.
+*/
+void BubbleManager::setSelectionIdInConference( int bubbleId )
+{
+    Q_UNUSED(bubbleId)
+}
+
+/**
+* Gets highlighted item in conference.
+*/
+int BubbleManager::selectionInConference() const
+{
+    return -1;
+}
+
+/**
+* Gets highlighted item in conference.
+*/
+int BubbleManager::selectionIdInConference() const
+{
+    return mConferenceHeader->selectedHeader();
+}
+
+/**
+* Moves highligh one up if possible
+*/
+void BubbleManager::moveHighlightOneUpInConference()
+{
+// may be needed in non-touch
+}
+
+/**
+* Moves highligh one down if possible
+*/
+void BubbleManager::moveHighlightOneDownInConference()
+{
+// may be needed in non-touch
+}
+
+/**
+* Use this function to expand or shrink conference bubble.
+*/
+void BubbleManager::setExpandedConferenceCallHeader(
+    bool expanded )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+    if ( mConferenceHeader->isUsed() ) {
+        mConferenceHeader->setExpanded(expanded);
+        mSortHeaders = true;
+    }
+}
+
+/**
+* Query: is conference expanded?
+*/
+bool BubbleManager::isConferenceExpanded( ) const
+{
+    return mConferenceHeader->isExpanded();
+}
+
+
+/**
+* Number of headers shown on the screen.
+*/
+int BubbleManager::shownHeaderCount() const
+{
+    QVectorIterator<BubbleHeader*> i(mActiveHeaders);
+    int count = 0;
+    while (i.hasNext()) {
+        if ( !i.next()->isInConference() ) {
+            count++;
+        }
+    }
+    return count;
+}
+
+/**
+* Set CLI used in participant list (text or phonenumber).
+*/
+void BubbleManager::setParticipantListCli(
+    int bubbleId,
+    ParticipantListCli aParticipantCli )
+{
+    Q_UNUSED(bubbleId)
+    Q_UNUSED(aParticipantCli)
+}
+
+void BubbleManager::addAction( int bubbleId, HbAction* action )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->addAction(action);
+}
+
+void BubbleManager::clearActions( int bubbleId )
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );     
+    Q_ASSERT( header );
+
+    header->clearActions();
+}
+
+QGraphicsWidget* BubbleManager::graphicsWidgetForAction(
+    HbAction* action ) const
+{
+    QGraphicsWidget* widget = 0;
+
+    foreach (BubbleHandler* handler,mActiveHandlers) {
+        widget = handler->graphicsWidgetForAction(action);
+        if (widget) {
+            break;
+        }
+    }
+
+    if (!widget) {
+        // check if it's expand action
+        QVectorIterator<BubbleHeader*> i(mActiveHeaders);
+        bool bubbleWidget=false;
+        while (i.hasNext()) {
+            BubbleHeader* h = i.next();
+            if ( h->expandAction() &&
+                 (h->expandAction()->text()==action->text()) ) {
+                bubbleWidget=true;
+                break;
+            }
+        }
+
+        if (bubbleWidget) {
+            if ( mActiveHandlers.count()==2 ) {
+                widget = mWidgetManager->container(
+                    BubbleWidgetManager::TwoCallsView,
+                    BubbleWidgetManager::CollapsedBubble );
+            } else if ( mActiveHandlers.count()==3 ) {
+                // return top most bubble
+                widget = mWidgetManager->container(
+                    BubbleWidgetManager::ThreeCallsView,
+                    BubbleWidgetManager::CollapsedBubble2 );
+            }
+        }
+    }
+
+    return widget;
+}
+
+void BubbleManager::addParticipantListAction(HbAction *action)
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+    mConferenceHeader->addParticipantListAction(action);
+}
+
+void BubbleManager::clearParticipantListActions()
+{
+    Q_ASSERT( mIsReadyToDraw > 0 );
+    mConferenceHeader->clearParticipantListActions();
+}
+
+int BubbleManager::expandedBubble() const
+{
+    // shall not be called without creating call headers first
+    Q_ASSERT(mActiveHeaders.count());
+
+    if (isConferenceExpanded()) {
+        return mConferenceHeader->bubbleId();
+    } else {
+        int i=0;
+        findNextDrawableHeader(i);
+        return mActiveHeaders.at(i)->bubbleId();
+    }
+}
+
+void BubbleManager::setExpandAction(int bubbleId, HbAction* action)
+{
+    BubbleHeader* header = 0;
+    findActiveHeader( bubbleId, header );
+    Q_ASSERT( header );
+    header->setExpandAction(action);
+}
+
+void BubbleManager::setBubbleSelectionDisabled(bool disabled)
+{
+    mBubbleSelectionDisabled = disabled;
+}
+
+void BubbleManager::handleOrientationChange(
+    Qt::Orientation orientation)        
+{
+    mWidgetManager->handleOrientationChange(orientation);
+}
+
+void BubbleManager::polishEvent()
+{
+    // for debugging - remove
+    HbWidget::polishEvent();
+}
+
+void BubbleManager::showExpanded( int bubbleId )
+{
+    if ( !mBubbleSelectionDisabled && (mActiveHeaders.count() > 1) ) {
+        int expanded = mActiveHeaders[0]->bubbleId();
+        if ( bubbleId != expanded ) {
+            startChanges();
+
+            BubbleHeader* header = 0;
+
+            if (bubbleId == BUBBLE_CONF_CALL_ID) {
+                header = mConferenceHeader;
+            } else {
+                // find header
+                for ( int i=0; i < mActiveHeaders.size(); i++ ) {
+                    if ( mActiveHeaders[i]->bubbleId() == bubbleId ) {
+                        header = mActiveHeaders[i];
+                        mActiveHeaders.remove(i);
+                        break;
+                    }
+                }
+
+                Q_ASSERT(header);
+
+                // set it first
+                mActiveHeaders.insert(0,header);
+            }
+
+            endChanges();
+
+            // trigger the expand action
+            HbAction* action = header->expandAction();
+            if (action) {
+                action->trigger();
+            }
+        }
+    }
+}
+
+void BubbleManager::releaseImageIfNotUsed(
+    const QString& imageFileName)
+{
+    bool used = false;
+
+    if (!imageFileName.isEmpty()) {
+        foreach(BubbleHeader* header, mActiveHeaders) {
+            if (!header->isInConference() &&
+                header->callImage()==imageFileName) {
+                used = true;
+                break;
+            }
+        }
+
+        if (!used) {
+            mBubbleImageManager->unloadImage(imageFileName);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: List item for conference participant list.
+*
+*/
+
+#include <QGraphicsLinearLayout>
+#include <hbiconitem.h>
+#include <hbtextitem.h>
+#include <hbaction.h>
+#include <hbpushbutton.h>
+#include <hbstyleloader.h>
+#include <hbabstractitemview.h>
+#include <hblistviewitem.h>
+
+#include "bubbleparticipantlistitem.h"
+#include "bubblemanagerif.h"
+#include "bubbleutils.h"
+
+BubbleParticipantListItem::BubbleParticipantListItem(
+    QGraphicsItem *parent) :
+    HbAbstractViewItem(parent),
+    mText(0),
+    mStatusIcon(0),
+    mCipheringIcon(0),
+    mExpandIcon(0),
+    mButton1(0),
+    mButton2(0),
+    mExpanded(false)
+{
+    HbStyleLoader::registerFilePath(":/bubbleparticipantlistitem.css");
+    HbStyleLoader::registerFilePath(":/bubbleparticipantlistitem.widgetml");
+}
+
+BubbleParticipantListItem::~BubbleParticipantListItem()
+{
+}
+
+HbAbstractViewItem* BubbleParticipantListItem::createItem()
+{
+    return new BubbleParticipantListItem(*this);
+}
+
+void BubbleParticipantListItem::updateChildItems()
+{
+    HbAbstractViewItem::updateChildItems();
+
+    setFocusPolicy(Qt::ClickFocus); // to enable expanding
+
+    // create primitives
+    if (!mText) {
+        mText = new HbTextItem(this);
+        style()->setItemName( mText, "text" );
+    }
+
+    if (!mCipheringIcon) {
+        mCipheringIcon = new HbIconItem(this);
+        style()->setItemName( mCipheringIcon, "ciphering" );
+    }
+
+    if (!mStatusIcon) {
+        mStatusIcon = new HbIconItem(this);
+        style()->setItemName( mStatusIcon, "icon" );
+    }
+
+    if (!mExpandIcon) {
+        mExpandIcon = new HbIconItem(this);
+        style()->setItemName( mExpandIcon, "expand-indi" );
+
+        // for expand/collapse controls
+        if (itemView()) {
+            connect( itemView()->selectionModel(),
+                     SIGNAL(currentChanged(QModelIndex,QModelIndex)),
+                     this,
+                     SLOT(currentIndexChanged(QModelIndex,QModelIndex)) );
+        }
+    }
+
+    BubbleParticipantListItem* p =
+            static_cast<BubbleParticipantListItem*>(prototype());
+
+    if (mExpanded && !mButton1) {
+        Q_ASSERT(p->mActions.count()==2);
+        HbAction* action = p->mActions.at(0);
+        mButton1 = new HbPushButton(this);
+        mButton1->setIcon(action->icon());
+        style()->setItemName( mButton1, "button-1" );
+
+        // connect first action
+        connect(mButton1,
+                SIGNAL(clicked()),
+                action,
+                SLOT(trigger()),
+                Qt::QueuedConnection);
+    } else {
+        delete mButton1;
+        mButton1 = 0;
+    }
+
+    if (mExpanded && !mButton2) {
+        Q_ASSERT(p->mActions.count()==2);
+        HbAction* action = p->mActions.at(1);
+        mButton2 = new HbPushButton(this);
+        mButton2->setIcon(action->icon());
+        style()->setItemName( mButton2, "button-2" );
+
+        // connect second action
+        connect(mButton2,
+                SIGNAL(clicked()),
+                action,
+                SLOT(trigger()),
+                Qt::QueuedConnection );
+
+    } else {
+        delete mButton2;
+        mButton2 = 0;
+    }
+
+    if (mText) {
+        mText->setText(modelIndex().data(Qt::DisplayRole).toString());
+    }
+
+    int state = (BubbleManagerIF::PhoneCallState)
+        modelIndex().data(Qt::DecorationRole).toInt();
+
+    if (mStatusIcon) {
+        BubbleUtils::setCallStatusIcon(state,0,*mStatusIcon);
+    }
+
+    if (mCipheringIcon) {
+        int flags = !modelIndex().data(Qt::StatusTipRole).toBool() ?
+                    BubbleManagerIF::NoCiphering : 0;
+
+        BubbleUtils::setCipheringIcon(state,flags,*mCipheringIcon);
+    }
+
+    if (mExpandIcon) {
+        if (mExpanded) {
+            mExpandIcon->setIcon(HbIcon("qtg_small_collapse"));
+        } else {
+            mExpandIcon->setIcon(HbIcon("qtg_small_expand"));
+        }
+    }
+
+    repolish();
+}
+
+void BubbleParticipantListItem::polish(HbStyleParameters& params)
+{
+    if (mExpanded) {
+        setProperty("layoutOption","expanded");
+    } else {
+        setProperty("layoutOption","collapsed");
+    }
+
+    HbAbstractViewItem::polish(params);
+}
+
+void BubbleParticipantListItem::setExpanded(bool expanded)
+{
+    mExpanded = expanded;
+    updateChildItems();
+}
+
+void BubbleParticipantListItem::addAction(HbAction* action)
+{
+    mActions.append(action);
+}
+
+void BubbleParticipantListItem::clearActions()
+{
+    mActions.clear();
+    mExpanded = false;
+}
+
+void BubbleParticipantListItem::currentIndexChanged(
+    const QModelIndex &current,
+    const QModelIndex &previous)
+{
+    Q_UNUSED(previous);
+
+    if (modelIndex() == current) {
+        if ( !mExpanded ) {
+            setExpanded(true);
+        }
+    } else if (mExpanded) {
+        setExpanded(false);
+    }
+}
+
+int BubbleParticipantListItem::type() const
+{
+    return HbListViewItem::Type;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistitem.h	Fri Jun 04 10:19:18 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: List item for conference participant list.
+*
+*/
+
+#ifndef BUBBLEPARTICIPANTLISTITEM_H
+#define BUBBLEPARTICIPANTLISTITEM_H
+
+#include <hbabstractviewitem.h>
+
+class QGraphicsItem;
+class HbPushButton;
+class HbAction;
+class HbIconItem;
+class HbFrameItem;
+class HbTextItem;
+
+class BubbleParticipantListItem : public HbAbstractViewItem
+{
+    Q_OBJECT
+
+public:
+    BubbleParticipantListItem(QGraphicsItem *parent = 0);
+
+    ~BubbleParticipantListItem();
+
+    HbAbstractViewItem* createItem();
+
+    void updateChildItems();
+    void setExpanded(bool expanded);
+    void addAction(HbAction* action);
+    void clearActions();
+
+private:
+    void polish(HbStyleParameters& params);
+
+    int type() const;
+
+private slots:
+    void currentIndexChanged(const QModelIndex &current,
+                             const QModelIndex &previous);
+
+private:
+    HbTextItem* mText;
+    HbIconItem* mStatusIcon;
+    HbIconItem* mCipheringIcon;
+    HbIconItem* mExpandIcon;
+    HbPushButton* mButton1;
+    HbPushButton* mButton2;
+    QList<HbAction*> mActions;
+
+    bool mExpanded;
+};
+
+#endif // BUBBLEPARTICIPANTLISTITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistmodel.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Model for conference participant list.
+*
+*/
+
+#include <QtCore>
+#include "bubbleparticipantlistmodel.h"
+
+class Participant
+{
+public:
+    int mBubbleId;
+    QString mName;
+    int mState;
+    bool mCiphering;
+
+public:
+    Participant(int bubbleId, const QString &name, int state, bool ciphering);
+
+};
+
+Participant::Participant(
+    int bubbleId,
+    const QString &name,
+    int state,
+    bool ciphering) :
+    mBubbleId(bubbleId), mName(name), mState(state), mCiphering(ciphering)
+{
+}
+
+
+BubbleParticipantListModel::BubbleParticipantListModel()
+{
+}
+
+BubbleParticipantListModel::~BubbleParticipantListModel()
+{
+    qDeleteAll(mParticipants);
+}
+
+int BubbleParticipantListModel::rowCount(const QModelIndex &parent) const
+{
+    Q_UNUSED(parent);
+    return mParticipants.count();
+}
+
+QVariant BubbleParticipantListModel::data(
+    const QModelIndex &index,
+    int role ) const
+{
+    Participant *player = mParticipants.at(index.row());
+
+    if (role == Qt::DisplayRole) {
+        return player->mName;
+    } else if (role == Qt::DecorationRole) {
+        return player->mState;
+    } else if (role == Qt::StatusTipRole) {
+        return player->mCiphering;
+    } else {
+        return QVariant();
+    }
+}
+
+void BubbleParticipantListModel::addParticipant(
+    int bubbleId,
+    const QString &name,
+    int state,
+    bool ciphering)
+{
+    bool itemExist=false;
+
+    // check, if existing item (bubble)
+    for (int i=0; i < mParticipants.count(); i++) {
+        Participant* p = mParticipants[i];
+        if (p->mBubbleId == bubbleId) {
+            if (isDataChanged(*p,name,state,ciphering)) {
+                updateData(*p,name,state,ciphering);
+                QModelIndex index = QAbstractListModel::createIndex(i,0);
+                emit dataChanged(index,index);
+            }
+            itemExist=true;
+            break;
+        }
+    }
+
+    if (!itemExist) {
+        // insert new item
+        beginInsertRows(QModelIndex(), mParticipants.count(), mParticipants.count());
+        Participant* p = new Participant(bubbleId,name,state, ciphering);
+        mParticipants.append(p);
+        endInsertRows();
+    }
+}
+
+bool BubbleParticipantListModel::isDataChanged(
+    const Participant& participant,
+    const QString &name,
+    int state,
+    bool ciphering) const
+{
+    if ( participant.mName != name ||
+         participant.mState != state ||
+         participant.mCiphering != ciphering ) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+void BubbleParticipantListModel::updateData(
+    Participant& participant,
+    const QString &name,
+    int state,
+    bool ciphering) const
+{
+    participant.mName = name;
+    participant.mState = state;
+    participant.mCiphering = ciphering;
+}
+
+void BubbleParticipantListModel::removeParticipant(int bubbleId)
+{
+    QMutableListIterator<Participant*> i(mParticipants);
+    int j=0;
+    while(i.hasNext()) {
+        Participant* p = i.next();
+        if (p->mBubbleId == bubbleId) {
+            beginRemoveRows(QModelIndex(), j, j);
+            i.remove();
+            endRemoveRows();
+        }
+        j++;
+    }
+}
+
+int BubbleParticipantListModel::bubbleId(int row)
+{
+    if (mParticipants.count()>=row) {
+        return mParticipants.at(row)->mBubbleId;
+    } else {
+        return -1;
+    }
+}
+
+void BubbleParticipantListModel::reset()
+{
+    qDeleteAll(mParticipants);
+    mParticipants.clear();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleparticipantlistmodel.h	Fri Jun 04 10:19:18 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: Model for conference participant list.
+*
+*/
+
+#ifndef BUBBLEPARTICIPANTLISTMODEL_H
+#define BUBBLEPARTICIPANTLISTMODEL_H
+
+#include <QAbstractListModel>
+#include <QObject>
+
+class Participant; // helper class
+
+class BubbleParticipantListModel : public QAbstractListModel
+{
+    Q_OBJECT
+
+public:
+    BubbleParticipantListModel();
+    ~BubbleParticipantListModel();
+
+    void addParticipant(
+        int bubbleId,
+        const QString &name,
+        int state,
+        bool ciphering);
+
+    void removeParticipant(
+        int bubbleId);
+
+    int bubbleId(int row);
+
+    void reset();
+
+    int rowCount(const QModelIndex &parent=QModelIndex()) const;
+
+    QVariant data( const QModelIndex &index,
+                   int role = Qt::DisplayRole ) const;
+
+private:
+    inline bool isDataChanged(
+        const Participant& participant,
+        const QString &name,
+        int state,
+        bool ciphering) const;
+
+    inline void updateData(
+        Participant& participant,
+        const QString &name,
+        int state,
+        bool ciphering) const;
+
+private:
+    QList<Participant*> mParticipants;
+};
+
+
+#endif // BUBBLEPARTICIPANTLISTMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleutils.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,301 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Utility methods.
+*
+*/
+
+#include <hbiconitem.h>
+#include <hbaction.h>
+#include <hbtextitem.h>
+#include <hbstringutil.h>
+#include <hbiconanimator.h>
+#include <hbcolorscheme.h>
+
+#include "bubblemanager2.h"
+#include "bubbleutils.h"
+#include "bubbleheader.h"
+#include "bubblebutton.h"
+
+void BubbleUtils::setCallHeaderTexts3Lines(
+    const BubbleHeader& header,
+    HbTextItem& textLine1,
+    HbTextItem& textLine2,
+    HbTextItem& textLine3,
+    int& cliLineNumber,
+    int& timerLineNumber)
+{
+    switch( header.callState() ) {
+    case BubbleManager::Incoming:
+    case BubbleManager::Waiting:
+    case BubbleManager::AlertToDisconnected:
+    {
+        if ( header.secondaryCli().length() ) {
+            setText(textLine1, header.cli(), header.cliClipDirection());
+            setText(textLine2, header.secondaryCli(),
+                    header.secondaryCliClipDirection());
+            setText(textLine3, header.text(), header.textClipDirection());
+            cliLineNumber = 1;
+        } else {
+            setText(textLine1,header.cli(), header.cliClipDirection());
+            setText(textLine2,header.text(), header.textClipDirection());
+            cliLineNumber = 1;
+        }
+        break;
+    }
+
+    case BubbleManager::Outgoing:
+    {
+        if ( header.secondaryCli().length() ) {
+            setText(textLine1, header.text(), header.textClipDirection());
+            setText(textLine2, header.cli(), header.cliClipDirection());
+            setText(textLine3, header.secondaryCli(),
+                    header.secondaryCliClipDirection());
+            cliLineNumber = 2;
+        } else {
+            setText(textLine1, header.text(), header.textClipDirection());
+            setText(textLine2, header.cli(), header.cliClipDirection());
+            cliLineNumber = 2;
+        }
+        break;
+    }
+
+    case BubbleManager::Active:
+    case BubbleManager::Alerting:
+    {
+        if ( header.secondaryCli().length() ) {
+            setText(textLine1, header.cli(), header.cliClipDirection());
+            setText(textLine2, header.secondaryCli(),
+                    header.secondaryCliClipDirection());
+            setText(textLine3, header.timerCost(), Qt::ElideRight);
+            cliLineNumber = 1;
+            timerLineNumber = 3;
+        } else {
+            setText(textLine1, header.cli(), header.cliClipDirection());
+            setText(textLine2, header.timerCost(), Qt::ElideRight);
+            cliLineNumber = 1;
+            timerLineNumber = 2;
+        }
+        break;
+    }
+
+    case BubbleManager::OnHold:
+    case BubbleManager::Disconnected:
+    {
+        if ( header.secondaryCli().length() ) {
+            setText(textLine1, header.cli(), header.cliClipDirection());
+            setText(textLine2, header.secondaryCli(),
+                    header.secondaryCliClipDirection());
+            setText(textLine3, header.text(), header.textClipDirection());
+            cliLineNumber = 1;
+        } else {
+            setText(textLine1, header.cli(), header.cliClipDirection());
+            setText(textLine2, header.text(), header.textClipDirection());
+            cliLineNumber = 1;
+        }
+        break;
+    }
+
+    default:
+        // do nothing
+        break;
+    } // switch
+}
+
+void BubbleUtils::setCallHeaderTexts2Lines(
+    const BubbleHeader& header,
+    HbTextItem& textLine1,
+    HbTextItem& textLine2,
+    int& cliLineNumber,
+    int& timerLineNumber)
+{
+    switch( header.callState() ) {
+    case BubbleManager::Active:
+        setText(textLine1, header.cli(), header.cliClipDirection());
+        setText(textLine2, header.timerCost(), Qt::ElideRight);
+        cliLineNumber = 1;
+        timerLineNumber = 2;
+        break;
+
+
+    case BubbleManager::OnHold:
+    case BubbleManager::Disconnected:
+        setText(textLine1, header.cli(), header.cliClipDirection());
+        setText(textLine2, header.text(), header.textClipDirection());
+        cliLineNumber = 1;
+        break;
+
+    case BubbleManager::Waiting:
+    case BubbleManager::AlertToDisconnected:
+        setText(textLine1, header.cli(), header.cliClipDirection());
+        setText(textLine2, header.text(), header.textClipDirection());
+        cliLineNumber = 1;
+        break;
+
+    case BubbleManager::Outgoing:
+        setText(textLine1, header.text(), header.textClipDirection());
+        setText(textLine2, header.cli(), header.cliClipDirection());
+        cliLineNumber = 2;
+        break;
+
+    default:
+        // do nothing
+        break;
+    } // switch
+}
+
+void BubbleUtils::setText(
+    HbTextItem& item,
+    const QString& text,
+    Qt::TextElideMode clip)
+{
+    if (clip == Qt::ElideLeft) {
+        // convert phonenumber to phone ui language
+        QString converted = HbStringUtil::convertDigits(text);
+        item.setText(converted);
+    } else {
+        item.setText( text );
+    }
+    item.setElideMode( clip );
+}
+
+bool BubbleUtils::compareHeaders(
+    const BubbleHeader* header1,
+    const BubbleHeader* header2 )
+{
+    // sort according to call states, but keep conference header
+    // last, it shown at foreground only when expanded.
+    if ( (header1->callState() < header2->callState()) ||
+         header1->isConference() ) {
+        return false;
+    } else {
+        return true;
+    }
+}
+
+void BubbleUtils::setButtonStyleForAction(
+    BubbleButton& button,
+    const HbAction& action)
+{
+    if (action.softKeyRole()==QAction::PositiveSoftKey) {
+        button.setButtonType(BubbleButton::GreenButton);
+    } else if (action.softKeyRole()==QAction::NegativeSoftKey) {
+        button.setButtonType(BubbleButton::RedButton);
+    } else {
+        button.setButtonType(BubbleButton::DefaultButton);
+    }
+
+    button.updatePrimitives();
+}
+
+void BubbleUtils::setCallStatusIcon(
+    int callState,
+    int callFlags,
+    HbIconItem& icon)
+{
+    bool showIcon = true;
+
+    switch(callState) {
+    case BubbleManagerIF::Incoming:
+    case BubbleManagerIF::Alerting:
+    case BubbleManagerIF::Waiting:
+        // from bubble_icon_anim.axml
+        if ( callFlags & BubbleManagerIF::VoIPCall ) {
+            icon.setIconName("voip_call_waiting_anim");
+        } else if ( callFlags & BubbleManagerIF::Video ) {
+            icon.setIconName("video_call_waiting_anim");
+        } else {
+            icon.setIconName("voice_call_waiting_anim");
+        }
+        break;
+    case BubbleManagerIF::Outgoing:
+    case BubbleManagerIF::Active:
+        if ( callFlags & BubbleManagerIF::VoIPCall ) {
+            icon.setIconName("qtg_large_voip_call_active");
+        } else if ( callFlags & BubbleManagerIF::Video ) {
+            icon.setIconName("qtg_large_video_call_active");
+        } else {
+            icon.setIconName("qtg_large_active_call");
+        }
+        break;
+    case BubbleManagerIF::OnHold:
+        if ( callFlags & BubbleManagerIF::VoIPCall ) {
+            icon.setIconName("qtg_large_voip_call_waiting");
+        } else if ( callFlags & BubbleManagerIF::Video ) {
+            icon.setIconName("qtg_large_video_call_waiting");
+        } else {
+            icon.setIconName("qtg_large_waiting_call");
+        }
+        break;
+    case BubbleManagerIF::Disconnected:
+    case BubbleManagerIF::AlertToDisconnected:
+        if ( callFlags & BubbleManagerIF::VoIPCall ) {
+            icon.setIconName("qtg_large_end_call");
+        } else if ( callFlags & BubbleManagerIF::Video ) {
+            icon.setIconName("qtg_large_end_call");
+        } else {
+            icon.setIconName("qtg_large_end_call");
+        }
+        break;
+    default:
+        icon.setIcon(HbIcon());
+        showIcon = false;
+        break;
+    }
+
+    if (showIcon) {
+        icon.show();
+    }
+}
+
+void BubbleUtils::setNumberTypeIcon(
+    int callState,
+    int callFlags,
+    HbIconItem& icon)
+{
+    if ( (( callState == BubbleManagerIF::Incoming ) ||
+          ( callState == BubbleManagerIF::Waiting )) &&
+         (callFlags & BubbleManagerIF::Diverted) ) {
+        icon.setIcon( HbIcon(":/qtg_mono_call_diverted.svg") );
+
+        // temporary, diverted icon is not yet in theme and
+        // because of that css coloring doesn't work
+        QColor color;
+        color = HbColorScheme::color("qtc_list_item_title_normal");
+        if (color.isValid()) {
+            icon.setColor(Qt::white);
+        }
+
+        icon.show();
+    } else {
+        icon.setIcon( HbIcon() );
+        icon.hide();
+    }
+}
+
+void BubbleUtils::setCipheringIcon(
+    int callState,
+    int callFlags,
+    HbIconItem& icon)
+{
+    Q_UNUSED(callState)
+
+    if (callFlags & BubbleManagerIF::NoCiphering) {
+        icon.setIcon( HbIcon("qtg_mono_ciphering_off") );
+        icon.show();
+    } else {
+        icon.setIcon( HbIcon() );
+        icon.hide();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleutils.h	Fri Jun 04 10:19:18 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:  Utility methods.
+*
+*/
+
+#ifndef BUBBLEUTILS_H_
+#define BUBBLEUTILS_H_
+
+#include <QString>
+
+class BubbleHeader;
+class BubbleCallIndicator;
+class HbIconItem;
+class BubbleButton;
+class HbAction;
+class HbTextItem;
+
+class BubbleUtils
+    {
+public:
+    static void setCallHeaderTexts3Lines(
+        const BubbleHeader& header,
+        HbTextItem& textLine1,
+        HbTextItem& textLine2,
+        HbTextItem& textLine3,
+        int& cliLineNumber,
+        int& timerLineNumber);
+
+    static void setCallHeaderTexts2Lines(
+        const BubbleHeader& header,
+        HbTextItem& textLine1,
+        HbTextItem& textLine2,
+        int& cliLineNumber,
+        int& timerLineNumber);
+
+    static bool compareHeaders(
+        const BubbleHeader* header1,
+        const BubbleHeader* header2);
+
+    static void setButtonStyleForAction(
+        BubbleButton& button,
+        const HbAction& action);
+
+    static void setCallStatusIcon(
+        int callState,
+        int callFlags,
+        HbIconItem& icon);
+
+    static void setNumberTypeIcon(
+        int callState,
+        int callFlags,
+        HbIconItem& icon);
+
+    static void setCipheringIcon(
+        int callState,
+        int callFlags,
+        HbIconItem& icon);
+
+private:
+    static void setText(
+        HbTextItem& item,
+        const QString& text,
+        Qt::TextElideMode clip);
+
+    };
+
+#endif /* BUBBLEUTILS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.cpp	Fri Jun 04 10:19:18 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: Interface to HbDocumentLoader (DocML files).
+*
+*/
+
+#include <QtCore>
+#include <hbstyle.h>
+#include <hbdocumentloader.h>
+#include <hbframeitem.h>
+#include "bubblewidgetmanager.h"
+#include "bubblecontainerwidget.h"
+#include "bubbleimagewidget.h"
+#include "bubbleheadingwidget.h"
+#include "bubbleexpandedhandler.h"
+#include "bubblecollapsedhandler.h"
+#include "bubbleconferencehandler.h"
+#include "bubbleparticipantlistitem.h"
+#include "bubblebutton.h"
+#include "hbtextitem.h"
+
+const char *BUBBLE_DOCUMENT_CONTENT = "content";
+
+// document loader
+class BubbleDocumentLoader : public HbDocumentLoader
+{
+public:
+    BubbleDocumentLoader(BubbleImageManager& imageManager);
+    virtual QObject *createObject(const QString& type,
+                                  const QString &name);
+private:
+    BubbleImageManager& mImageManager;
+};
+
+
+BubbleWidgetManager::BubbleWidgetManager(
+    BubbleImageManager& imageManager, QObject* parent)
+    : QObject(parent), mImageManager(imageManager),
+      mOrientation(Qt::Vertical)
+{
+    // .docml mappings
+    mFileNames.insert(SingleCallView,":/xml/bubble_layout_1.docml");
+    mFileNames.insert(TwoCallsView,  ":/xml/bubble_layout_2.docml");
+    mFileNames.insert(ThreeCallsView,":/xml/bubble_layout_3.docml");
+    mFileNames.insert(ConferenceView,":/xml/bubble_layout_4.docml");
+    mFileNames.insert(MutedOverlay,  ":/xml/bubble_layout_5.docml");
+
+    mOrientationName.insert(Qt::Vertical,   "portrait");
+    mOrientationName.insert(Qt::Horizontal, "landscape");
+
+    mWidgetPrefix.insert(ExpandedBubble, "eb:");
+    mWidgetPrefix.insert(CollapsedBubble,    "cb:");
+    mWidgetPrefix.insert(CollapsedBubble2,    "cb2:");
+    mContainerName.insert(ExpandedBubble, "expandedBubble");
+    mContainerName.insert(CollapsedBubble,   "collapsedBubble");
+    mContainerName.insert(CollapsedBubble2,   "collapsedBubble2");
+    mWidgetName.insert(Heading,        "bubbleHeading");
+    mWidgetName.insert(Image,          "callImage");
+    mWidgetName.insert(LeftButton,     "leftButton");
+    mWidgetName.insert(CenterButton,   "centerButton");
+    mWidgetName.insert(RightButton,    "rightButton");
+    mWidgetName.insert(ConferenceTimer,"callTimer");
+    mWidgetName.insert(ParticipantList,"participantList");
+    mWidgetName.insert(MutedIcon,      "mutedIcon");
+}
+
+BubbleWidgetManager::~BubbleWidgetManager()
+{
+    qDeleteAll(mDocumentLoaders);
+    mDocumentLoaders.clear();
+
+    QList<int> keys = mDocumentHandlers.keys();
+    foreach (int key, keys) {
+        qDeleteAll(*mDocumentHandlers[key]);
+    }
+    qDeleteAll(mDocumentHandlers);
+    mDocumentHandlers.clear();
+}
+
+QGraphicsWidget* BubbleWidgetManager::view(View view)
+{
+    if (mDocumentContent.contains(view)) {
+        // already loaded
+        return mDocumentContent[view];
+    } else {
+        // load from .docml
+        return loadDocument(view,mOrientation);
+    }
+}
+
+void BubbleWidgetManager::releaseView(View view)
+{
+    Q_UNUSED(view)
+}
+
+QGraphicsWidget* BubbleWidgetManager::loadDocument(
+    View view,
+    Qt::Orientation orientation)
+{
+    BubbleDocumentLoader* loader =
+        new BubbleDocumentLoader(mImageManager);
+    bool ok;
+
+    loader->load(mFileNames[view],&ok);
+    Q_ASSERT(ok);
+    loader->load(mFileNames[view],mOrientationName[orientation],&ok);
+    Q_ASSERT(ok);
+
+    mDocumentLoaders.insert(view,loader);
+
+    QGraphicsWidget* widget =
+        mDocumentLoaders[view]->findWidget(BUBBLE_DOCUMENT_CONTENT);
+
+    Q_ASSERT(widget);
+    widget->setVisible(false);
+    mDocumentContent.insert(view,widget);
+
+    if (view!=MutedOverlay) {
+        createDocumentHandlers(view);
+    }
+
+    applyCustomStyles(view);
+
+    return widget;
+}
+
+void BubbleWidgetManager::applyCustomStyles(View view)
+{
+    setBackground(widget(view,None,MutedIcon));
+}
+
+void BubbleWidgetManager::setBackground(QGraphicsWidget* widget)
+{
+    HbWidget* w;
+    w = qobject_cast<HbWidget*>(widget);
+    if (w) {
+        HbFrameItem* item =
+            new HbFrameItem("qtg_fr_popup_trans",HbFrameDrawer::NinePieces);
+        w->setBackgroundItem(item); // takes ownership
+    }
+}
+
+void BubbleWidgetManager::createDocumentHandlers(View view)
+{
+    Q_ASSERT(mDocumentLoaders.contains(view));
+
+    QList<BubbleHandler*>* handlers = new QList<BubbleHandler*>;
+
+    if (mDocumentLoaders[view]->findWidget(mContainerName[ExpandedBubble]) ) {
+        if (view==ConferenceView) {
+            BubbleConferenceHandler* handler =
+                new BubbleConferenceHandler(*this,view,ExpandedBubble);
+            handlers->append(handler);
+        } else {
+            BubbleExpandedHandler* handler =
+                new BubbleExpandedHandler(*this,view,ExpandedBubble);
+            handlers->append(handler);
+        }
+    }
+
+    if (mDocumentLoaders[view]->findWidget(mContainerName[CollapsedBubble]) ) {
+        BubbleCollapsedHandler* handler =
+            new BubbleCollapsedHandler(*this,view,CollapsedBubble);
+        handlers->append(handler);
+    }
+
+    if (mDocumentLoaders[view]->findWidget(mContainerName[CollapsedBubble2]) ) {
+        BubbleCollapsedHandler* handler =
+            new BubbleCollapsedHandler(*this,view,CollapsedBubble2);
+        handlers->append(handler);
+    }
+
+
+    mDocumentHandlers.insert(view,handlers);
+}
+
+QGraphicsWidget* BubbleWidgetManager::container(
+    View view,
+    Container container) const
+{
+    QGraphicsWidget* w=0;
+
+    if (mDocumentLoaders.contains(view)) {
+        w = mDocumentLoaders.value(view)->findWidget(
+            mContainerName[container]);
+    }
+
+    return w;
+}
+
+
+QGraphicsWidget* BubbleWidgetManager::widget(
+    View view,
+    Container container,
+    Widget widget ) const
+{
+    QGraphicsWidget* w=0;
+
+    if (mDocumentLoaders.contains(view)) {
+        QString name;
+        name.append(mWidgetPrefix.value(container));
+        name.append(mWidgetName.value(widget));
+        w = mDocumentLoaders.value(view)->findWidget(name);
+    }
+
+    return w;
+}
+
+QList<BubbleHandler*>* BubbleWidgetManager::handlers(
+    QGraphicsWidget* widget) const
+{
+    int doc = mDocumentContent.key(widget);
+    return mDocumentHandlers[doc];
+}
+
+void BubbleWidgetManager::handleOrientationChange(
+    Qt::Orientation orientation)
+{
+    if (mOrientation!=orientation) {
+        bool ok;
+        QList<int> docs = mDocumentLoaders.keys();
+        foreach (int doc, docs) {
+            mDocumentLoaders[doc]->load(
+                mFileNames[doc],mOrientationName.value(orientation),&ok);
+            Q_ASSERT(ok);
+        }
+        mOrientation = orientation;
+    }
+}
+
+QGraphicsWidget* BubbleWidgetManager::createParticipantListItem()
+{
+    return new BubbleParticipantListItem();
+}
+
+// custom widget loading
+BubbleDocumentLoader::BubbleDocumentLoader(BubbleImageManager& imageManager)
+    : mImageManager(imageManager)
+{
+}
+
+QObject *BubbleDocumentLoader::createObject(
+    const QString& type,
+    const QString &name)
+{
+    if ( type == BubbleContainerWidget::staticMetaObject.className() ) {
+        QObject *object = new BubbleContainerWidget();
+        object->setObjectName(name);
+        return object;
+    }
+
+    if ( type == BubbleImageWidget::staticMetaObject.className() ) {
+        QObject *object = new BubbleImageWidget(mImageManager);
+        object->setObjectName(name);
+        return object;
+    }
+
+    if ( type == BubbleHeadingWidget::staticMetaObject.className() ) {
+        QObject *object = new BubbleHeadingWidget();
+        object->setObjectName(name);
+        return object;
+    }
+
+    if ( type == BubbleButton::staticMetaObject.className() ) {
+        QObject *object = new BubbleButton;
+        object->setObjectName(name);
+        return object;
+    }
+
+    return HbDocumentLoader::createObject(type, name);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Interface to HbDocumentLoader (DocML files).
+*
+*/
+
+#ifndef BUBBLEWIDGETMANAGER_H
+#define BUBBLEWIDGETMANAGER_H
+
+#include <QObject>
+#include <QMap>
+
+class QGraphicsWidget;
+class BubbleDocumentLoader;
+class BubbleHandler;
+class BubbleImageManager;
+
+class BubbleWidgetManager : public QObject
+{
+    Q_OBJECT
+
+public:
+    enum View
+    {
+        SingleCallView,
+        TwoCallsView,
+        ThreeCallsView,
+        ConferenceView,
+        MutedOverlay
+    };
+
+    enum Container
+    {
+        None,
+        ExpandedBubble,
+        CollapsedBubble, // top most when 2 calls
+        CollapsedBubble2 // top most when 3 calls
+    };
+
+    enum Widget
+    {
+        Heading,
+        Image,
+        LeftButton,
+        CenterButton,
+        RightButton,
+        ConferenceTimer,
+        ParticipantList,
+        ParticipantListItem,
+        ParticipantListButton,
+        MutedIcon
+    };
+
+public:
+    BubbleWidgetManager(
+        BubbleImageManager& imageManager,
+        QObject* parent=0);
+    virtual ~BubbleWidgetManager();
+
+    QGraphicsWidget* view(View view);
+
+    void releaseView(View view);
+
+    QGraphicsWidget* container(View view,
+                               Container container) const;
+
+    QGraphicsWidget* widget(View view,
+                            Container container,
+                            Widget widget) const;
+
+    QList<BubbleHandler*>* handlers(QGraphicsWidget* widget) const;
+
+    QGraphicsWidget* createParticipantListItem();
+
+public slots:
+    void handleOrientationChange(Qt::Orientation orientation);
+
+private:
+    QGraphicsWidget* loadDocument(View view, Qt::Orientation orientation);
+    void createDocumentHandlers(View view);
+    void applyCustomStyles(View view);
+    void setButtonStyle(Widget widget, QGraphicsWidget* button);
+    void setBackground(QGraphicsWidget* widget);
+
+private:
+    BubbleImageManager& mImageManager;
+    Qt::Orientation mOrientation;
+    QMap<int,BubbleDocumentLoader*>  mDocumentLoaders;
+    QMap<int,QList<BubbleHandler*>*> mDocumentHandlers;
+    QMap<int,QGraphicsWidget*>       mDocumentContent;
+
+    QMap<int,QString> mFileNames;
+    QMap<int,QString> mContainerName;
+    QMap<int,QString> mWidgetPrefix;
+    QMap<int,QString> mWidgetName;
+    QMap<int,QString> mOrientationName;
+};
+
+#endif // BUBBLEWIDGETMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_b.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-39.8838" x2="24.9995" y2="10.0715">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-39.8838" x2="24.9995" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect y="9" opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_bl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="10.0715">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,5c0,2.762,2.238,5,5,5h5V0H0V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M0,0v5c0,2.762,2.238,5,5,5h5V9H5C2.794,9,1,7.206,1,5V0H0z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_br.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="10.0715">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,10h5c2.762,0,5-2.238,5-5V0H0V10z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M9,5c0,2.206-1.794,4-4,4H0v1h5c2.762,0,5-2.238,5-5V0H9V5z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_c.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+<?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="50px" height="30px" viewBox="0 0 50 30" enable-background="new 0 0 50 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-9.8843" x2="24.9995" y2="40.0719">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="30"/>
+<rect fill="none" width="50" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="50" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_l.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-9.8843" x2="5" y2="40.0719">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="0.5" y1="-9.8843" x2="0.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect x="3" opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_r.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-9.8843" x2="5" y2="40.0719">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="9.5" y1="-9.8843" x2="9.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect x="9" opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_t.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="0.1157" x2="24.9995" y2="50.071">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="0.1157" x2="24.9995" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+<rect y="3" opacity="0.1" fill="#FFFFFF" width="50" height="7"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="50.071">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,0H5C2.238,0,0,2.238,0,5v5h10V0z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M1,5c0-2.206,1.794-4,4-4h5V0H5C2.238,0,0,2.238,0,5v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M10,3H5C3.897,3,3,3.896,3,5v5h7V3z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tr.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="50.071">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,5c0-2.762-2.238-5-5-5H0v10h10V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M10,5c0-2.762-2.238-5-5-5H0v1h5c2.206,0,4,1.794,4,4v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M7,5c0-1.104-0.896-2-2-2H0v7h7V5z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_b.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="25.0005" y1="10.1279" x2="25.0005" y2="-39.7534">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-39.8838" x2="24.9995" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect y="9" opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_bl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="10.1279" x2="5" y2="-39.7534">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,5c0,2.762,2.238,5,5,5h5V0H0V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M0,0v5c0,2.762,2.238,5,5,5h5V9H5C2.794,9,1,7.206,1,5V0H0z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_br.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="10.1279" x2="5" y2="-39.7534">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,10h5c2.762,0,5-2.238,5-5V0H0V10z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M9,5c0,2.206-1.794,4-4,4H0v1h5c2.762,0,5-2.238,5-5V0H9V5z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_c.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+<?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="50px" height="30px" viewBox="0 0 50 30" enable-background="new 0 0 50 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="25.0005" y1="40.127" x2="25.0005" y2="-9.7536">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="30"/>
+<rect fill="none" width="50" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="50" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_l.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="40.127" x2="5" y2="-9.7536">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="0.5" y1="-9.8843" x2="0.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect x="3" opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_r.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="40.127" x2="5" y2="-9.7536">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="9.5" y1="-9.8843" x2="9.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect x="9" opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_t.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="25.0005" y1="50.1279" x2="25.0005" y2="0.2466">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="0.1157" x2="24.9995" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+<rect y="3" opacity="0.1" fill="#FFFFFF" width="50" height="7"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="50.1279" x2="5" y2="0.2466">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,0H5C2.238,0,0,2.238,0,5v5h10V0z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M1,5c0-2.206,1.794-4,4-4h5V0H5C2.238,0,0,2.238,0,5v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M10,3H5C3.897,3,3,3.897,3,5v5h7V3z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tr.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="50.1279" x2="5" y2="0.2466">
+	<stop  offset="0" style="stop-color:#85BF24"/>
+	<stop  offset="1" style="stop-color:#387300"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,5c0-2.762-2.238-5-5-5H0v10h10V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M10,5c0-2.762-2.238-5-5-5H0v1h5c2.206,0,4,1.794,4,4v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M7,5c0-1.103-0.896-2-2-2H0v7h7V5z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_b.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="25.0005" y1="9.8145" x2="25.0005" y2="-39.8316">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-39.8838" x2="24.9995" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect y="9" opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_bl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="9.8145" x2="5" y2="-39.8316">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,5c0,2.762,2.238,5,5,5h5V0H0V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M0,0v5c0,2.762,2.238,5,5,5h5V9H5C2.794,9,1,7.206,1,5V0H0z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_br.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="9.8145" x2="5" y2="-39.8316">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,10h5c2.762,0,5-2.238,5-5V0H0V10z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M9,5c0,2.206-1.794,4-4,4H0v1h5c2.762,0,5-2.238,5-5V0H9V5z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_c.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+<?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="50px" height="30px" viewBox="0 0 50 30" enable-background="new 0 0 50 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="25.0005" y1="39.8135" x2="25.0005" y2="-9.8318">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="30"/>
+<rect fill="none" width="50" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="50" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_l.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="39.8135" x2="5" y2="-9.8318">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="0.5" y1="-9.8843" x2="0.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect x="3" opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_r.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="39.8135" x2="5" y2="-9.8318">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="9.5" y1="-9.8843" x2="9.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect x="9" opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_t.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="25.0005" y1="49.8145" x2="25.0005" y2="0.1684">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="0.1157" x2="24.9995" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+<rect y="3" opacity="0.1" fill="#FFFFFF" width="50" height="7"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="49.8145" x2="5" y2="0.1684">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,0H5C2.238,0,0,2.238,0,5v5h10V0z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M1,5c0-2.206,1.794-4,4-4h5V0H5C2.238,0,0,2.238,0,5v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M10,3H5C3.897,3,3,3.897,3,5v5h7V3z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tr.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="49.8145" x2="5" y2="0.1684">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,5c0-2.762-2.238-5-5-5H0v10h10V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M10,5c0-2.762-2.238-5-5-5H0v1h5c2.206,0,4,1.794,4,4v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M7,5c0-1.103-0.896-2-2-2H0v7h7V5z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_b.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-39.667" x2="24.9995" y2="10.422">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-39.8838" x2="24.9995" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect y="9" opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_bl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.667" x2="5" y2="10.422">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,5c0,2.762,2.238,5,5,5h5V0H0V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M0,0v5c0,2.762,2.238,5,5,5h5V9H5C2.794,9,1,7.206,1,5V0H0z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_br.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,23 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.667" x2="5" y2="10.422">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M0,10h5c2.762,0,5-2.238,5-5V0H0V10z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="-39.8838" x2="5" y2="9.8873">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M9,5c0,2.206-1.794,4-4,4H0v1h5c2.762,0,5-2.238,5-5V0H9V5z"/>
+<rect fill="none" width="10" height="10"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_c.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,19 @@
+<?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="50px" height="30px" viewBox="0 0 50 30" enable-background="new 0 0 50 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="-9.6675" x2="24.9995" y2="40.4223">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="30"/>
+<rect fill="none" width="50" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="50" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_l.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-9.6675" x2="5" y2="40.4223">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="0.5" y1="-9.8843" x2="0.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect x="3" opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_r.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="30px" viewBox="0 0 10 30" enable-background="new 0 0 10 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="30"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="-9.6675" x2="5" y2="40.4223">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="10" height="30"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="9.5" y1="-9.8843" x2="9.5" y2="39.8876">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect x="9" opacity="0.35" fill="url(#SVGID_2_)" width="1" height="30"/>
+<rect fill="none" width="10" height="30"/>
+<rect opacity="0.1" fill="#FFFFFF" width="7" height="9"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_t.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="50px" height="10px" viewBox="0 0 50 10" enable-background="new 0 0 50 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="50" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="0.3325" x2="24.9995" y2="50.4215">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="50" height="10"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="24.9995" y1="0.1157" x2="24.9995" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<rect opacity="0.35" fill="url(#SVGID_2_)" width="50" height="1"/>
+<rect fill="none" width="50" height="10"/>
+<rect y="3" opacity="0.1" fill="#FFFFFF" width="50" height="7"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tl.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="0.3325" x2="5" y2="50.4215">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,0H5C2.238,0,0,2.238,0,5v5h10V0z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M1,5c0-2.206,1.794-4,4-4h5V0H5C2.238,0,0,2.238,0,5v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M10,3H5C3.897,3,3,3.897,3,5v5h7V3z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tr.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,24 @@
+<?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="10px" height="10px" viewBox="0 0 10 10" enable-background="new 0 0 10 10" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="10" height="10"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="5" y1="0.3325" x2="5" y2="50.4215">
+	<stop  offset="0" style="stop-color:#700000"/>
+	<stop  offset="1" style="stop-color:#CF1708"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M10,5c0-2.762-2.238-5-5-5H0v10h10V5z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="5" y1="0.1157" x2="5" y2="49.8868">
+	<stop  offset="0" style="stop-color:#FFFFFF"/>
+	<stop  offset="1" style="stop-color:#999999"/>
+</linearGradient>
+<path opacity="0.35" fill="url(#SVGID_2_)" d="M10,5c0-2.762-2.238-5-5-5H0v1h5c2.206,0,4,1.794,4,4v5h1V5z"/>
+<rect fill="none" width="10" height="10"/>
+<path opacity="0.1" fill="#FFFFFF" d="M7,5c0-1.103-0.896-2-2-2H0v7h7V5z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_active_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5609 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="423.0967" x2="429.6524" y1="-578.646" y2="-582.9078">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.1333" style="stop-color:#A7E722"/>
+<stop offset="0.6303" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</linearGradient>
+<path d="M19.081,33.91c2.089-3.595,4.591-6.496,7.281-9.188c2.593-2.591,6.72-5.3,8.562-6.256l9.604-10.282  c-0.845-0.3-3.693-0.464-7.279,0.616c-3.586,1.083-11.736,6.303-16.979,11.547c-5.242,5.246-9.727,12.347-10.581,14.595  c-1.343,3.541-1.221,7.445-0.929,8.58c0,0,0.34,1.035,1.144,2.377C10.248,46.475,19.081,33.91,19.081,33.91z" fill="url(#SVGID_1_)"/>
+<path d="M31.184,20.8c1.488-1.036,2.87-1.882,3.74-2.334L44.271,8.46  c-0.132-0.058-0.209-0.088-0.209-0.088c-0.247-0.088-0.642-0.162-1.124-0.219c-0.793,0.006-1.596,0.093-2.401,0.27  C34.843,9.673,31.019,14.958,31.184,20.8z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
+<path d="M31.906,20.306c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04  c-0.146-0.063-0.233-0.098-0.233-0.098c-0.231-0.08-0.604-0.152-1.06-0.203c-0.751,0.006-1.51,0.087-2.27,0.253  C35.275,9.576,31.636,14.695,31.906,20.306z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M44.079,8.263c-0.21-0.073-0.55-0.137-0.962-0.186c-0.681,0.006-1.369,0.08-2.06,0.231  c-5.087,1.116-8.426,5.984-7.978,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.424-10.088C44.178,8.302,44.079,8.263,44.079,8.263z  " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="40.9697" cy="9.21" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="12.2872">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.6242" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</radialGradient>
+<path d="M34.924,18.466l0.929,1.55c0,0,15.101-6.784,14.084-8.038c-0.513-0.631-0.577-0.656-1.237-1.263  c-1.985-1.815-4.172-2.531-4.172-2.531c-0.186-0.063-0.481-0.12-0.845-0.161c-0.596,0.004-1.2,0.068-1.806,0.201  c-4.591,1.009-7.57,5.501-6.963,10.257C34.916,18.477,34.921,18.47,34.924,18.466z" fill="url(#SVGID_2_)"/>
+<path d="M17.483,34.105c-0.988-0.139-2.007-0.119-3.027,0.105c-2.418,0.531-4.376,2.066-5.646,4.131  c-0.367,2.35-0.25,4.408-0.05,5.18c0,0,0.34,1.035,1.144,2.377c0.29,0.482,6.54-8.264,8.556-11.107L17.483,34.105z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M18.366,34.135c-0.989-0.139-2.008-0.117-3.029,0.105c-3.313,0.727-5.775,3.332-6.76,6.623  c-0.026,1.025,0.034,1.873,0.127,2.398c0.003,0.012,0.005,0.033,0.01,0.047c0,0,0.34,1.033,1.144,2.379  c0.3,0.498,6.981-8.887,8.75-11.383L18.366,34.135z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="437.4258" cy="-571.231" gradientTransform="matrix(0.2095 0.9787 -0.9682 0.2124 -629.4526 -270.6148)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6187">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.6242" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</radialGradient>
+<path d="M11.202,47.738c0.616,0.74,0.646,0.953,1.295,1.523c1.194,1.055,9.301-13.611,9.301-13.611  l-2.683-1.719c-0.941-0.111-1.914-0.08-2.89,0.135c-4.777,1.049-7.806,5.869-6.87,10.832C9.749,45.686,10.349,46.709,11.202,47.738z  " fill="url(#SVGID_3_)"/>
+<path d="M49.937,11.978c-0.179-0.22-0.381-0.446-0.578-0.67l-13.944,7.959l0.438,0.749  C35.853,20.016,50.953,13.231,49.937,11.978z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="422.2881" x2="427.4786" y1="-610.9287" y2="-594.4409">
+<stop offset="0" style="stop-color:#C6FF45"/>
+<stop offset="0.6788" style="stop-color:#387300"/>
+<stop offset="1" style="stop-color:#66A00E"/>
+</linearGradient>
+<path d="M35.853,20.016l1.178,1.981c0.302,0.515,0.972,0.674,1.569,0.422l4.09-2.334l8.043-4.668  c0.632-0.363,0.878-1.119,0.549-1.686c0,0-0.333-0.501-1.349-1.751L35.853,20.016z" fill="url(#SVGID_4_)"/>
+<path d="M21.798,35.65l-0.725-0.473l-9.215,13.486c0.216,0.205,0.43,0.414,0.639,0.598  C13.691,50.316,21.798,35.65,21.798,35.65z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="439.6982" x2="451.5232" y1="-577.7549" y2="-564.7323">
+<stop offset="0" style="stop-color:#C6FF45"/>
+<stop offset="0.6788" style="stop-color:#387300"/>
+<stop offset="1" style="stop-color:#66A00E"/>
+</linearGradient>
+<path d="M12.498,49.262c1.193,1.049,1.686,1.369,1.686,1.369c0.567,0.367,1.363,0.17,1.781-0.441l7.9-11.605  c0.419-0.615,0.307-1.412-0.26-1.777l-1.808-1.156L12.498,49.262z" fill="url(#SVGID_5_)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_avatar.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<path d="M46.691,42.35c-1.665-0.866-9.918-3.756-10.072-3.936l-0.002,0.002  c-0.934-1.068-0.896-3.433-0.43-4.46c0.001-0.001,0.002-0.001,0.002-0.002c0.032-0.071,0.065-0.139,0.104-0.197  c0.113-0.177,0.219-0.354,0.326-0.533l0,0c0.813-1.329,1.494-2.651,2.054-3.892c1.009,0.349,2.307-0.59,2.95-2.18  c0.667-1.645,0.379-3.354-0.645-3.815c-0.058-0.026-0.119-0.03-0.178-0.048c0-0.001,0-0.002,0-0.002  c0.133-0.521,0.191-0.826,0.191-0.826c1.77-7.934-2.078-14.223-11.402-14.533c-3.832,0-5.617,0.578-7.039,2.398  c-2.313,0.357-6.039,3.642-3.453,12.927c-0.098,0.016-0.195,0.031-0.289,0.071c-1.032,0.436-1.355,2.128-0.724,3.782  c0.633,1.653,1.983,2.643,3.017,2.208c0.063-0.027,0.117-0.072,0.176-0.11c0.568,1.279,1.266,2.646,2.104,4.02H23.38  c0.022,0.037,0.046,0.073,0.067,0.11c0.023,0.038,0.045,0.076,0.068,0.114c0.002,0.003,0.005,0.005,0.007,0.008  c0.061,0.101,0.12,0.201,0.185,0.301c0.532,0.833,0.663,3.229-0.166,4.457c-0.208,0.283-8.346,3.135-10.23,4.136  c-2.161,1.147-5.688,3.782-5.688,9.723h44.756C52.378,46.132,48.354,43.216,46.691,42.35z" fill="url(#SVGID_1_)"/>
+<path d="M7.659,51.072c-0.022,0.323-0.037,0.655-0.037,1h44.756c0-0.345-0.017-0.676-0.042-1H7.659z" fill="#FFFFFF" fill-opacity="0.15" stroke-opacity="0.15"/>
+<path d="M22.551,11.326c1.422-1.82,3.207-2.398,7.039-2.398c7.565,0.252,11.524,4.44,11.804,10.248  C41.535,12.856,37.58,8.194,29.59,7.928c-3.832,0-5.617,0.578-7.039,2.398c-1.81,0.279-4.472,2.367-4.311,7.704  C18.419,13.429,20.858,11.588,22.551,11.326z" fill="#FFFFFF" fill-opacity="0.5" stroke-opacity="0.5"/>
+<path d="M36.617,38.416c-0.441-0.505-0.66-1.3-0.725-2.106c-0.086,1.09,0.098,2.389,0.725,3.106  l0.002-0.002c0.154,0.18,8.407,3.069,10.072,3.936c1.566,0.816,5.225,3.453,5.645,8.723h0.042c0-5.94-4.024-8.856-5.687-9.723  c-1.665-0.866-9.918-3.756-10.072-3.936L36.617,38.416z" fill="#FFFFFF" fill-opacity="0.5" stroke-opacity="0.5"/>
+<path d="M13.311,43.35c1.885-1.001,10.022-3.853,10.23-4.136c0.508-0.752,0.652-1.938,0.568-2.938  c-0.053,0.717-0.225,1.429-0.568,1.938c-0.208,0.283-8.346,3.135-10.23,4.136c-2.161,1.147-5.688,3.782-5.688,9.723h0.037  C8.029,46.833,11.275,44.431,13.311,43.35z" fill="#FFFFFF" fill-opacity="0.5" stroke-opacity="0.5"/>
+<rect fill="none" height="60" width="60"/>
+<defs>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="29.9995" x2="29.9995" y1="8.5967" y2="52.3536">
+<stop offset="0" style="stop-color:#8E8E8E"/>
+<stop offset="1" style="stop-color:#444444"/>
+</linearGradient>
+</defs>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_end_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientTransform="matrix(-0.5413 0.8408 -0.8408 -0.5413 1896.0922 -2198.2874)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="2876.6201" x2="2883.1765" y1="367.9102" y2="363.6479">
+<stop offset="0" style="stop-color:#FF7236"/>
+<stop offset="0.6242" style="stop-color:#BA1212"/>
+<stop offset="1" style="stop-color:#E8522A"/>
+</linearGradient>
+<path d="M19.072,29.698c4.021-1.066,7.842-1.348,11.646-1.35c3.666,0.002,8.5,1.004,10.479,1.631l14.061-0.48  c-0.385-0.81-2.283-2.939-5.582-4.711c-3.303-1.771-11.847-3.841-20.172-3.841S13.896,22.8,11.703,23.785  c-3.453,1.555-6.129,4.401-6.725,5.411c0,0-0.49,0.972-0.873,2.489C3.943,32.337,19.072,29.698,19.072,29.698z" fill="url(#SVGID_1_)"/>
+<path d="M36.902,28.984c1.785,0.32,3.359,0.699,4.295,0.995l13.684-0.467  c-0.053-0.134-0.086-0.21-0.086-0.21c-0.111-0.236-0.338-0.568-0.639-0.949c-0.566-0.557-1.195-1.063-1.889-1.508  C47.357,23.704,40.916,24.737,36.902,28.984z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
+<path d="M37.762,29.146c1.424,0.28,2.654,0.586,3.436,0.833l13.729-0.47  c-0.059-0.148-0.096-0.233-0.096-0.233c-0.105-0.221-0.318-0.535-0.605-0.894c-0.535-0.526-1.129-1.006-1.783-1.426  C47.73,23.941,41.537,24.988,37.762,29.146z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M54.885,29.238c-0.096-0.2-0.291-0.485-0.549-0.812c-0.484-0.478-1.023-0.911-1.619-1.293  c-4.387-2.808-10.189-1.726-13.584,2.303c0.834,0.19,1.547,0.38,2.064,0.543l13.797-0.47C54.928,29.336,54.885,29.238,54.885,29.238  z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="-362.4932" cy="2606.3809" gradientTransform="matrix(0.7071 0.7071 -0.7071 0.7071 2153.4434 -1558.1849)" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="14.0807">
+<stop offset="0" style="stop-color:#FF7236"/>
+<stop offset="0.6242" style="stop-color:#BA1212"/>
+<stop offset="1" style="stop-color:#E8522A"/>
+</radialGradient>
+<path d="M41.197,29.979l-0.439,1.752c0,0,15.475,5.881,15.643,4.275c0.084-0.809,0.057-0.872,0.018-1.768  c-0.119-2.688-1.16-4.74-1.16-4.74c-0.086-0.176-0.256-0.425-0.482-0.711c-0.424-0.419-0.898-0.801-1.42-1.135  c-3.959-2.533-9.242-1.463-12.176,2.329C41.184,29.981,41.191,29.979,41.197,29.979z" fill="url(#SVGID_2_)"/>
+<path d="M17.805,28.706c-0.6-0.797-1.334-1.503-2.215-2.065c-2.084-1.335-4.555-1.633-6.914-1.072  c-1.92,1.402-3.293,2.939-3.697,3.628c0,0-0.49,0.972-0.873,2.489c-0.135,0.546,10.469-1.219,13.904-1.805L17.805,28.706z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M18.408,29.352c-0.6-0.799-1.336-1.504-2.217-2.067c-2.855-1.829-6.439-1.728-9.463-0.097  c-0.744,0.706-1.299,1.348-1.605,1.785c-0.006,0.011-0.02,0.027-0.027,0.04c0,0-0.49,0.972-0.873,2.491  c-0.141,0.564,11.221-1.348,14.236-1.862L18.408,29.352z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="2885.8242" cy="377.8994" gradientTransform="matrix(-0.5439 0.8402 -0.8348 -0.5344 1899.8433 -2194.1335)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6192">
+<stop offset="0" style="stop-color:#FF7236"/>
+<stop offset="0.6242" style="stop-color:#BA1212"/>
+<stop offset="1" style="stop-color:#E8522A"/>
+</radialGradient>
+<path d="M3.725,33.904c-0.088,0.959-0.219,1.131-0.162,1.993c0.098,1.591,16.201-3.049,16.201-3.049  l-0.682-3.112c-0.586-0.744-1.297-1.409-2.139-1.947c-4.119-2.637-9.67-1.369-12.518,2.802C4.148,31.425,3.848,32.573,3.725,33.904z  " fill="url(#SVGID_3_)"/>
+<path d="M56.4,36.007c0.029-0.282,0.047-0.585,0.064-0.883l-15.488-4.232l-0.219,0.84  C40.758,31.731,56.232,37.612,56.4,36.007z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(-0.5413 0.8408 -0.8408 -0.5413 1896.0941 -2198.2864)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="2875.8125" x2="2881.0032" y1="335.625" y2="352.1139">
+<stop offset="0" style="stop-color:#FF7236"/>
+<stop offset="0.6242" style="stop-color:#BA1212"/>
+<stop offset="1" style="stop-color:#E8522A"/>
+</linearGradient>
+<path d="M40.758,31.731l-0.568,2.234c-0.15,0.577,0.211,1.163,0.811,1.408l4.543,1.241l8.988,2.387  c0.703,0.189,1.412-0.171,1.58-0.804c0,0,0.119-0.59,0.283-2.192L40.758,31.731z" fill="url(#SVGID_4_)"/>
+<path d="M19.764,32.849l-0.178-0.846L3.533,35.023c0.008,0.297,0.012,0.597,0.029,0.874  C3.66,37.488,19.764,32.849,19.764,32.849z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(-0.5413 0.8408 -0.8408 -0.5413 1896.0941 -2198.2869)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="2893.2236" x2="2905.0479" y1="368.8027" y2="381.8245">
+<stop offset="0" style="stop-color:#FF7236"/>
+<stop offset="0.6242" style="stop-color:#BA1212"/>
+<stop offset="1" style="stop-color:#E8522A"/>
+</linearGradient>
+<path d="M3.563,35.897c0.102,1.587,0.225,2.161,0.225,2.161c0.141,0.66,0.844,1.083,1.572,0.946l13.793-2.62  c0.73-0.138,1.213-0.78,1.072-1.44l-0.461-2.096L3.563,35.897z" fill="url(#SVGID_5_)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5609 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="423.0967" x2="429.6524" y1="-578.646" y2="-582.9078">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.1333" style="stop-color:#A7E722"/>
+<stop offset="0.6303" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</linearGradient>
+<path d="M19.081,33.91c2.089-3.595,4.591-6.496,7.281-9.188c2.593-2.591,6.72-5.3,8.562-6.256l9.604-10.282  c-0.845-0.3-3.693-0.464-7.279,0.616c-3.586,1.083-11.736,6.303-16.979,11.547c-5.242,5.246-9.727,12.347-10.581,14.595  c-1.343,3.541-1.221,7.445-0.929,8.58c0,0,0.34,1.035,1.144,2.377C10.248,46.475,19.081,33.91,19.081,33.91z" fill="url(#SVGID_1_)"/>
+<path d="M31.184,20.8c1.488-1.036,2.87-1.882,3.74-2.334L44.271,8.46  c-0.132-0.058-0.209-0.088-0.209-0.088c-0.247-0.088-0.642-0.162-1.124-0.219c-0.793,0.006-1.596,0.093-2.401,0.27  C34.843,9.673,31.019,14.958,31.184,20.8z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
+<path d="M31.906,20.306c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04  c-0.146-0.063-0.233-0.098-0.233-0.098c-0.231-0.08-0.604-0.152-1.06-0.203c-0.751,0.006-1.51,0.087-2.27,0.253  C35.275,9.576,31.636,14.695,31.906,20.306z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M44.079,8.263c-0.21-0.073-0.55-0.137-0.962-0.186c-0.681,0.006-1.369,0.08-2.06,0.231  c-5.087,1.116-8.426,5.984-7.978,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.424-10.088C44.178,8.302,44.079,8.263,44.079,8.263z  " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="40.9697" cy="9.21" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="12.2872">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.6242" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</radialGradient>
+<path d="M34.924,18.466l0.929,1.55c0,0,15.101-6.784,14.084-8.038c-0.513-0.631-0.577-0.656-1.237-1.263  c-1.985-1.815-4.172-2.531-4.172-2.531c-0.186-0.063-0.481-0.12-0.845-0.161c-0.596,0.004-1.2,0.068-1.806,0.201  c-4.591,1.009-7.57,5.501-6.963,10.257C34.916,18.477,34.921,18.47,34.924,18.466z" fill="url(#SVGID_2_)"/>
+<path d="M17.483,34.105c-0.988-0.139-2.007-0.119-3.027,0.105c-2.418,0.531-4.376,2.066-5.646,4.131  c-0.367,2.35-0.25,4.408-0.05,5.18c0,0,0.34,1.035,1.144,2.377c0.29,0.482,6.54-8.264,8.556-11.107L17.483,34.105z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M18.366,34.135c-0.989-0.139-2.008-0.117-3.029,0.105c-3.313,0.727-5.775,3.332-6.76,6.623  c-0.026,1.025,0.034,1.873,0.127,2.398c0.003,0.012,0.005,0.033,0.01,0.047c0,0,0.34,1.033,1.144,2.379  c0.3,0.498,6.981-8.887,8.75-11.383L18.366,34.135z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="437.4258" cy="-571.231" gradientTransform="matrix(0.2095 0.9787 -0.9682 0.2124 -629.4526 -270.6148)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6187">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.6242" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</radialGradient>
+<path d="M11.202,47.738c0.616,0.74,0.646,0.953,1.295,1.523c1.194,1.055,9.301-13.611,9.301-13.611  l-2.683-1.719c-0.941-0.111-1.914-0.08-2.89,0.135c-4.777,1.049-7.806,5.869-6.87,10.832C9.749,45.686,10.349,46.709,11.202,47.738z  " fill="url(#SVGID_3_)"/>
+<path d="M49.937,11.978c-0.179-0.22-0.381-0.446-0.578-0.67l-13.944,7.959l0.438,0.749  C35.853,20.016,50.953,13.231,49.937,11.978z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="422.2881" x2="427.4786" y1="-610.9287" y2="-594.4409">
+<stop offset="0" style="stop-color:#C6FF45"/>
+<stop offset="0.6788" style="stop-color:#387300"/>
+<stop offset="1" style="stop-color:#66A00E"/>
+</linearGradient>
+<path d="M35.853,20.016l1.178,1.981c0.302,0.515,0.972,0.674,1.569,0.422l4.09-2.334l8.043-4.668  c0.632-0.363,0.878-1.119,0.549-1.686c0,0-0.333-0.501-1.349-1.751L35.853,20.016z" fill="url(#SVGID_4_)"/>
+<path d="M21.798,35.65l-0.725-0.473l-9.215,13.486c0.216,0.205,0.43,0.414,0.639,0.598  C13.691,50.316,21.798,35.65,21.798,35.65z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="439.6982" x2="451.5232" y1="-577.7549" y2="-564.7323">
+<stop offset="0" style="stop-color:#C6FF45"/>
+<stop offset="0.6788" style="stop-color:#387300"/>
+<stop offset="1" style="stop-color:#66A00E"/>
+</linearGradient>
+<path d="M12.498,49.262c1.193,1.049,1.686,1.369,1.686,1.369c0.567,0.367,1.363,0.17,1.781-0.441l7.9-11.605  c0.419-0.615,0.307-1.412-0.26-1.777l-1.808-1.156L12.498,49.262z" fill="url(#SVGID_5_)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+<g transform="matrix(1 0 0 1 30 30)">
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1__" x1="12.3789" x2="17.6203" y1="23.6504" y2="23.6504">
+<stop offset="0" style="stop-color:#878A8C"/>
+<stop offset="0.2606" style="stop-color:#BDC2C4"/>
+<stop offset="0.6606" style="stop-color:#5B6163"/>
+<stop offset="1" style="stop-color:#959A9C"/>
+</linearGradient>
+<rect fill="url(#SVGID_1__)" height="7.853" width="5.105" x="12.447" y="19.724"/>
+<path d="M12.447,24.655c0.82,0.199,1.673,0.315,2.553,0.315c0.881,0,1.732-0.116,2.553-0.315v-4.294  h-5.105V24.655z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M12.447,24.018c0.82,0.199,1.673,0.315,2.553,0.315c0.881,0,1.732-0.116,2.553-0.315v-4.294  h-5.105V24.018z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2__" x1="14.9995" x2="14.9995" y1="1.9746" y2="23.6704">
+<stop offset="0" style="stop-color:#F2F2F2"/>
+<stop offset="0.3212" style="stop-color:#E6E6E6"/>
+<stop offset="1" style="stop-color:#666666"/>
+</linearGradient>
+<path d="M15,23.695c-5.98,0-10.848-4.867-10.848-10.848S9.02,2,15,2c5.982,0,10.848,4.866,10.848,10.847  S20.982,23.695,15,23.695L15,23.695z" fill="url(#SVGID_2__)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3__" x1="14.9995" x2="14.9995" y1="2.6143" y2="23.0332">
+<stop offset="0" style="stop-color:#D1D7D9"/>
+<stop offset="0.0667" style="stop-color:#D1D7D9"/>
+<stop offset="0.2606" style="stop-color:#BDC2C4"/>
+<stop offset="0.6606" style="stop-color:#7C8487"/>
+<stop offset="1" style="stop-color:#ADB3B5"/>
+</linearGradient>
+<circle cx="15" cy="12.847" fill="url(#SVGID_3__)" r="10.209"/>
+<path d="M15,21.989c-5.315,0-9.657-4.23-9.843-9.5c-0.004,0.116-0.009,0.231-0.009,0.349  c0,5.431,4.419,9.851,9.852,9.851s9.852-4.42,9.852-9.851c0-0.117-0.005-0.232-0.009-0.349C24.658,17.759,20.315,21.989,15,21.989z" fill="#FFFFFF" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M23.295,12.413c0,4.704-3.715,9.346-8.299,9.345c-4.58-0.003-8.292-4.646-8.291-9.35  c0.002-4.706,3.718-8.517,8.298-8.517C19.584,3.894,23.298,7.707,23.295,12.413z" fill="#231F20" fill-opacity="0.3" stroke-opacity="0.3"/>
+<path d="M14.996,21.066c-2.387-0.002-4.63-0.932-6.315-2.619c-1.688-1.688-2.615-3.932-2.614-6.318  c0-4.923,4.009-8.929,8.935-8.929c2.387,0,4.632,0.931,6.317,2.618c1.688,1.688,2.616,3.933,2.615,6.318  c-0.002,4.924-4.01,8.93-8.934,8.93H14.996z" fill="#231F20" fill-opacity="0.2" stroke-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4__" x1="14.9995" x2="14.9995" y1="3.7212" y2="20.3517">
+<stop offset="0" style="stop-color:#CFCFCF"/>
+<stop offset="0.1091" style="stop-color:#CFCFCF"/>
+<stop offset="0.6848" style="stop-color:#121212"/>
+<stop offset="1" style="stop-color:#A6A6A6"/>
+</linearGradient>
+<path d="M14.996,20.428c-2.216-0.002-4.298-0.864-5.864-2.432c-1.567-1.566-2.428-3.65-2.427-5.866  c0-4.573,3.723-8.293,8.296-8.293c2.218,0.001,4.3,0.864,5.866,2.432c1.566,1.568,2.43,3.651,2.428,5.867  c-0.001,4.573-3.723,8.292-8.295,8.292H14.996z" fill="url(#SVGID_4__)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5__" x1="14.9995" x2="14.9995" y1="4.3682" y2="19.7187">
+<stop offset="0" style="stop-color:#F2F2F2"/>
+<stop offset="1" style="stop-color:#606769"/>
+</linearGradient>
+<circle cx="15" cy="12.133" fill="url(#SVGID_5__)" r="7.657"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_6_" x1="14.9995" x2="14.9995" y1="5.7715" y2="18.454">
+<stop offset="0" style="stop-color:#1A1A1A"/>
+<stop offset="0.503" style="stop-color:#343434"/>
+<stop offset="0.7515" style="stop-color:#9E9E9E"/>
+<stop offset="1" style="stop-color:#CFCFCF"/>
+</linearGradient>
+<path d="M15,18.514c-1.706-0.001-3.309-0.666-4.514-1.871c-1.204-1.206-1.867-2.808-1.867-4.512  c0-3.517,2.862-6.378,6.382-6.378c1.706,0,3.308,0.664,4.513,1.871c1.205,1.205,1.868,2.808,1.867,4.513  C21.381,15.652,18.519,18.514,15,18.514L15,18.514z" fill="url(#SVGID_6_)"/>
+<radialGradient cx="25.7734" cy="10.2729" gradientTransform="matrix(1.0143 3.000000e-004 -3.000000e-004 1.0141 -10.5185 2.1979)" gradientUnits="userSpaceOnUse" id="SVGID_7_" r="6.4991">
+<stop offset="0" style="stop-color:#000000"/>
+<stop offset="0.5917" style="stop-color:#000000"/>
+<stop offset="0.627" style="stop-color:#050505"/>
+<stop offset="0.7652" style="stop-color:#121212"/>
+<stop offset="0.8876" style="stop-color:#171717"/>
+<stop offset="1" style="stop-color:#171717"/>
+</radialGradient>
+<path d="M20.743,12.135c0,3.172-2.574,5.74-5.744,5.74c-3.175-0.001-5.743-2.573-5.741-5.745  c0-3.171,2.573-5.742,5.745-5.74C18.173,6.391,20.744,8.962,20.743,12.135z" fill="url(#SVGID_7_)"/>
+<radialGradient cx="21.6543" cy="5.0659" gradientTransform="matrix(1.0143 0 0 1.0141 -9.5579 3.1299)" gradientUnits="userSpaceOnUse" id="SVGID_8_" r="10.3515">
+<stop offset="0" style="stop-color:#242424"/>
+<stop offset="0.4303" style="stop-color:#242424"/>
+<stop offset="0.7818" style="stop-color:#000000"/>
+<stop offset="1" style="stop-color:#000000"/>
+</radialGradient>
+<circle cx="15" cy="12.133" fill="url(#SVGID_8_)" r="4.712"/>
+<radialGradient cx="23.9639" cy="3.5498" gradientTransform="matrix(1.0143 3.000000e-004 -3.000000e-004 1.0141 -10.5185 2.1979)" gradientUnits="userSpaceOnUse" id="SVGID_9_" r="11.3574">
+<stop offset="0" style="stop-color:#A700F5"/>
+<stop offset="0.3091" style="stop-color:#A700F5"/>
+<stop offset="0.4364" style="stop-color:#5E008A"/>
+<stop offset="0.8061" style="stop-color:#0E1402"/>
+<stop offset="1" style="stop-color:#0E1402"/>
+</radialGradient>
+<path d="M19.211,12.133c0,2.326-1.886,4.21-4.212,4.21c-2.326-0.002-4.213-1.888-4.213-4.212  c0.004-2.327,1.89-4.21,4.213-4.21C17.328,7.923,19.214,9.808,19.211,12.133z" fill="url(#SVGID_9_)"/>
+<radialGradient cx="25.1709" cy="13.2505" gradientTransform="matrix(1.0143 3.000000e-004 -3.000000e-004 1.0141 -10.5185 2.1979)" gradientUnits="userSpaceOnUse" id="SVGID_10_" r="4.6113">
+<stop offset="0" style="stop-color:#48630C"/>
+<stop offset="0.7879" style="stop-color:#000000"/>
+<stop offset="1" style="stop-color:#000000"/>
+</radialGradient>
+<path d="M19.211,12.133c0,2.326-1.886,4.21-4.212,4.21c-2.326-0.002-4.213-1.888-4.213-4.212  c0,0,1.444,2.569,4.213,2.569C17.767,14.701,19.211,12.133,19.211,12.133z" fill="url(#SVGID_10_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_11_" x1="14.979" x2="14.979" y1="7.0654" y2="12.0939">
+<stop offset="0" style="stop-color:#F8FBFF"/>
+<stop offset="1" style="stop-color:#808080"/>
+</linearGradient>
+<path d="M14.979,12.069c1.828,0,3.549-0.277,5.067-0.765  c-0.431-2.41-2.532-4.239-5.067-4.239c-2.532,0-4.632,1.83-5.065,4.239C11.431,11.792,13.153,12.069,14.979,12.069z" fill="url(#SVGID_11_)" fill-opacity="0.35" stroke-opacity="0.35"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_12_" x1="5.7617" x2="24.2852" y1="26.7236" y2="26.7236">
+<stop offset="0" style="stop-color:#878A8C"/>
+<stop offset="0.2606" style="stop-color:#BDC2C4"/>
+<stop offset="0.6606" style="stop-color:#5B6163"/>
+<stop offset="1" style="stop-color:#959A9C"/>
+</linearGradient>
+<path d="M24.245,28c0.025-0.635,0.04-0.508,0.04-0.639v-0.035c0-1.037-0.852-1.879-1.901-1.879H7.662  c-1.05,0-1.9,0.842-1.9,1.879v0.035c0,0.131,0.014,0.004,0.04,0.639H24.245z" fill="url(#SVGID_12_)"/>
+<path d="M5.879,26.7h18.29c-0.084-0.234-0.212-0.444-0.377-0.626H6.256  C6.092,26.256,5.963,26.466,5.879,26.7z" fill="#FFFFFF" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M5.772,27.361C5.779,27.492,5.789,27.684,5.802,28h18.443  c0.012-0.316,0.022-0.508,0.028-0.639H5.772z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M6.255,26.074h17.536c-0.348-0.383-0.846-0.627-1.407-0.627H7.662  C7.102,25.447,6.603,25.691,6.255,26.074z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
+<rect fill="none" height="30" width="30"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="20.3613" x2="26.6141" y1="20.2744" y2="26.4485">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.5939" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M19.081,33.911c2.089-3.597,4.591-6.497,7.281-9.189c2.593-2.591,6.72-5.3,8.562-6.256l9.604-10.282  c-0.845-0.3-3.693-0.464-7.279,0.616c-3.586,1.083-11.736,6.303-16.979,11.547c-5.242,5.246-9.727,12.347-10.581,14.595  c-1.343,3.541-1.221,7.445-0.929,8.581c0,0,0.34,1.034,1.144,2.377C10.248,46.476,19.081,33.911,19.081,33.911z" fill="url(#SVGID_1_)"/>
+<path d="M31.184,20.8c1.488-1.036,2.87-1.882,3.74-2.334L44.271,8.46  c-0.132-0.058-0.209-0.088-0.209-0.088c-0.247-0.088-0.642-0.162-1.124-0.219c-0.793,0.006-1.596,0.093-2.401,0.27  C34.843,9.673,31.019,14.958,31.184,20.8z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
+<path d="M31.906,20.306c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04  c-0.146-0.063-0.233-0.098-0.233-0.098c-0.231-0.08-0.604-0.152-1.06-0.203c-0.751,0.006-1.51,0.087-2.27,0.253  C35.275,9.576,31.636,14.695,31.906,20.306z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M44.079,8.263c-0.21-0.073-0.55-0.137-0.962-0.186c-0.681,0.006-1.369,0.08-2.06,0.231  c-5.087,1.116-8.426,5.984-7.978,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.424-10.088C44.178,8.302,44.079,8.263,44.079,8.263z  " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="43.6406" cy="10.1128" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="13.348">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.6061" style="stop-color:#F1830A"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</radialGradient>
+<path d="M34.924,18.466l0.929,1.55c0,0,15.101-6.784,14.084-8.038c-0.513-0.631-0.577-0.656-1.237-1.263  c-1.985-1.815-4.172-2.531-4.172-2.531c-0.186-0.063-0.481-0.12-0.845-0.161c-0.596,0.004-1.2,0.068-1.806,0.201  c-4.591,1.009-7.57,5.501-6.963,10.257C34.916,18.477,34.921,18.47,34.924,18.466z" fill="url(#SVGID_2_)"/>
+<path d="M17.483,34.106c-0.988-0.14-2.007-0.119-3.027,0.105c-2.418,0.53-4.376,2.066-5.646,4.131  c-0.367,2.35-0.25,4.407-0.05,5.18c0,0,0.34,1.034,1.144,2.377c0.29,0.482,6.54-8.264,8.556-11.107L17.483,34.106z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M18.366,34.136c-0.989-0.14-2.008-0.118-3.029,0.105c-3.313,0.727-5.775,3.332-6.76,6.623  c-0.026,1.025,0.034,1.872,0.127,2.397c0.003,0.013,0.005,0.034,0.01,0.048c0,0,0.34,1.033,1.144,2.379  c0.3,0.498,6.981-8.888,8.75-11.384L18.366,34.136z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="437.4258" cy="-571.231" gradientTransform="matrix(0.2095 0.9787 -0.9682 0.2124 -629.4526 -270.6148)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6198">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.6061" style="stop-color:#F1830A"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</radialGradient>
+<path d="M11.202,47.738c0.616,0.74,0.646,0.954,1.295,1.524c1.194,1.055,9.301-13.612,9.301-13.612  l-2.683-1.719c-0.941-0.111-1.914-0.079-2.89,0.136c-4.777,1.048-7.806,5.868-6.87,10.832C9.749,45.686,10.349,46.71,11.202,47.738z  " fill="url(#SVGID_3_)"/>
+<path d="M49.937,11.978c-0.179-0.22-0.381-0.446-0.578-0.67l-13.944,7.959l0.438,0.749  C35.853,20.016,50.953,13.231,49.937,11.978z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="422.2881" x2="427.4786" y1="-610.9287" y2="-594.4409">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.7576" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M35.853,20.016l1.178,1.981c0.302,0.515,0.972,0.674,1.569,0.422l4.09-2.334l8.043-4.668  c0.632-0.363,0.878-1.119,0.549-1.686c0,0-0.333-0.501-1.349-1.751L35.853,20.016z" fill="url(#SVGID_4_)"/>
+<path d="M21.798,35.65l-0.725-0.472l-9.215,13.486c0.216,0.204,0.43,0.414,0.639,0.598  C13.691,50.317,21.798,35.65,21.798,35.65z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="439.6982" x2="451.5232" y1="-577.7549" y2="-564.7323">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.7576" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M12.498,49.262c1.193,1.05,1.686,1.37,1.686,1.37c0.567,0.367,1.363,0.169,1.781-0.442l7.9-11.605  c0.419-0.614,0.307-1.411-0.26-1.777l-1.808-1.156L12.498,49.262z" fill="url(#SVGID_5_)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+<g transform="matrix(1 0 0 1 30 30)">
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1__" x1="12.3789" x2="17.6203" y1="23.6504" y2="23.6504">
+<stop offset="0" style="stop-color:#878A8C"/>
+<stop offset="0.2606" style="stop-color:#BDC2C4"/>
+<stop offset="0.6606" style="stop-color:#5B6163"/>
+<stop offset="1" style="stop-color:#959A9C"/>
+</linearGradient>
+<rect fill="url(#SVGID_1__)" height="7.853" width="5.105" x="12.447" y="19.724"/>
+<path d="M12.447,24.655c0.82,0.199,1.673,0.315,2.553,0.315c0.881,0,1.732-0.116,2.553-0.315v-4.294  h-5.105V24.655z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M12.447,24.018c0.82,0.199,1.673,0.315,2.553,0.315c0.881,0,1.732-0.116,2.553-0.315v-4.294  h-5.105V24.018z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2__" x1="14.9995" x2="14.9995" y1="1.9746" y2="23.6704">
+<stop offset="0" style="stop-color:#F2F2F2"/>
+<stop offset="0.3212" style="stop-color:#E6E6E6"/>
+<stop offset="1" style="stop-color:#666666"/>
+</linearGradient>
+<path d="M15,23.695c-5.98,0-10.848-4.867-10.848-10.848S9.02,2,15,2c5.982,0,10.848,4.866,10.848,10.847  S20.982,23.695,15,23.695L15,23.695z" fill="url(#SVGID_2__)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3__" x1="14.9995" x2="14.9995" y1="2.6143" y2="23.0332">
+<stop offset="0" style="stop-color:#D1D7D9"/>
+<stop offset="0.0667" style="stop-color:#D1D7D9"/>
+<stop offset="0.2606" style="stop-color:#BDC2C4"/>
+<stop offset="0.6606" style="stop-color:#7C8487"/>
+<stop offset="1" style="stop-color:#ADB3B5"/>
+</linearGradient>
+<circle cx="15" cy="12.847" fill="url(#SVGID_3__)" r="10.209"/>
+<path d="M15,21.989c-5.315,0-9.657-4.23-9.843-9.5c-0.004,0.116-0.009,0.231-0.009,0.349  c0,5.431,4.419,9.851,9.852,9.851s9.852-4.42,9.852-9.851c0-0.117-0.005-0.232-0.009-0.349C24.658,17.759,20.315,21.989,15,21.989z" fill="#FFFFFF" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M23.295,12.413c0,4.704-3.715,9.346-8.299,9.345c-4.58-0.003-8.292-4.646-8.291-9.35  c0.002-4.706,3.718-8.517,8.298-8.517C19.584,3.894,23.298,7.707,23.295,12.413z" fill="#231F20" fill-opacity="0.3" stroke-opacity="0.3"/>
+<path d="M14.996,21.066c-2.387-0.002-4.63-0.932-6.315-2.619c-1.688-1.688-2.615-3.932-2.614-6.318  c0-4.923,4.009-8.929,8.935-8.929c2.387,0,4.632,0.931,6.317,2.618c1.688,1.688,2.616,3.933,2.615,6.318  c-0.002,4.924-4.01,8.93-8.934,8.93H14.996z" fill="#231F20" fill-opacity="0.2" stroke-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4__" x1="14.9995" x2="14.9995" y1="3.7212" y2="20.3517">
+<stop offset="0" style="stop-color:#CFCFCF"/>
+<stop offset="0.1091" style="stop-color:#CFCFCF"/>
+<stop offset="0.6848" style="stop-color:#121212"/>
+<stop offset="1" style="stop-color:#A6A6A6"/>
+</linearGradient>
+<path d="M14.996,20.428c-2.216-0.002-4.298-0.864-5.864-2.432c-1.567-1.566-2.428-3.65-2.427-5.866  c0-4.573,3.723-8.293,8.296-8.293c2.218,0.001,4.3,0.864,5.866,2.432c1.566,1.568,2.43,3.651,2.428,5.867  c-0.001,4.573-3.723,8.292-8.295,8.292H14.996z" fill="url(#SVGID_4__)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5__" x1="14.9995" x2="14.9995" y1="4.3682" y2="19.7187">
+<stop offset="0" style="stop-color:#F2F2F2"/>
+<stop offset="1" style="stop-color:#606769"/>
+</linearGradient>
+<circle cx="15" cy="12.133" fill="url(#SVGID_5__)" r="7.657"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_6_" x1="14.9995" x2="14.9995" y1="5.7715" y2="18.454">
+<stop offset="0" style="stop-color:#1A1A1A"/>
+<stop offset="0.503" style="stop-color:#343434"/>
+<stop offset="0.7515" style="stop-color:#9E9E9E"/>
+<stop offset="1" style="stop-color:#CFCFCF"/>
+</linearGradient>
+<path d="M15,18.514c-1.706-0.001-3.309-0.666-4.514-1.871c-1.204-1.206-1.867-2.808-1.867-4.512  c0-3.517,2.862-6.378,6.382-6.378c1.706,0,3.308,0.664,4.513,1.871c1.205,1.205,1.868,2.808,1.867,4.513  C21.381,15.652,18.519,18.514,15,18.514L15,18.514z" fill="url(#SVGID_6_)"/>
+<radialGradient cx="25.7734" cy="10.2729" gradientTransform="matrix(1.0143 3.000000e-004 -3.000000e-004 1.0141 -10.5185 2.1979)" gradientUnits="userSpaceOnUse" id="SVGID_7_" r="6.4991">
+<stop offset="0" style="stop-color:#000000"/>
+<stop offset="0.5917" style="stop-color:#000000"/>
+<stop offset="0.627" style="stop-color:#050505"/>
+<stop offset="0.7652" style="stop-color:#121212"/>
+<stop offset="0.8876" style="stop-color:#171717"/>
+<stop offset="1" style="stop-color:#171717"/>
+</radialGradient>
+<path d="M20.743,12.135c0,3.172-2.574,5.74-5.744,5.74c-3.175-0.001-5.743-2.573-5.741-5.745  c0-3.171,2.573-5.742,5.745-5.74C18.173,6.391,20.744,8.962,20.743,12.135z" fill="url(#SVGID_7_)"/>
+<radialGradient cx="21.6543" cy="5.0659" gradientTransform="matrix(1.0143 0 0 1.0141 -9.5579 3.1299)" gradientUnits="userSpaceOnUse" id="SVGID_8_" r="10.3515">
+<stop offset="0" style="stop-color:#242424"/>
+<stop offset="0.4303" style="stop-color:#242424"/>
+<stop offset="0.7818" style="stop-color:#000000"/>
+<stop offset="1" style="stop-color:#000000"/>
+</radialGradient>
+<circle cx="15" cy="12.133" fill="url(#SVGID_8_)" r="4.712"/>
+<radialGradient cx="23.9639" cy="3.5498" gradientTransform="matrix(1.0143 3.000000e-004 -3.000000e-004 1.0141 -10.5185 2.1979)" gradientUnits="userSpaceOnUse" id="SVGID_9_" r="11.3574">
+<stop offset="0" style="stop-color:#A700F5"/>
+<stop offset="0.3091" style="stop-color:#A700F5"/>
+<stop offset="0.4364" style="stop-color:#5E008A"/>
+<stop offset="0.8061" style="stop-color:#0E1402"/>
+<stop offset="1" style="stop-color:#0E1402"/>
+</radialGradient>
+<path d="M19.211,12.133c0,2.326-1.886,4.21-4.212,4.21c-2.326-0.002-4.213-1.888-4.213-4.212  c0.004-2.327,1.89-4.21,4.213-4.21C17.328,7.923,19.214,9.808,19.211,12.133z" fill="url(#SVGID_9_)"/>
+<radialGradient cx="25.1709" cy="13.2505" gradientTransform="matrix(1.0143 3.000000e-004 -3.000000e-004 1.0141 -10.5185 2.1979)" gradientUnits="userSpaceOnUse" id="SVGID_10_" r="4.6113">
+<stop offset="0" style="stop-color:#48630C"/>
+<stop offset="0.7879" style="stop-color:#000000"/>
+<stop offset="1" style="stop-color:#000000"/>
+</radialGradient>
+<path d="M19.211,12.133c0,2.326-1.886,4.21-4.212,4.21c-2.326-0.002-4.213-1.888-4.213-4.212  c0,0,1.444,2.569,4.213,2.569C17.767,14.701,19.211,12.133,19.211,12.133z" fill="url(#SVGID_10_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_11_" x1="14.979" x2="14.979" y1="7.0654" y2="12.0939">
+<stop offset="0" style="stop-color:#F8FBFF"/>
+<stop offset="1" style="stop-color:#808080"/>
+</linearGradient>
+<path d="M14.979,12.069c1.828,0,3.549-0.277,5.067-0.765  c-0.431-2.41-2.532-4.239-5.067-4.239c-2.532,0-4.632,1.83-5.065,4.239C11.431,11.792,13.153,12.069,14.979,12.069z" fill="url(#SVGID_11_)" fill-opacity="0.35" stroke-opacity="0.35"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_12_" x1="5.7617" x2="24.2852" y1="26.7236" y2="26.7236">
+<stop offset="0" style="stop-color:#878A8C"/>
+<stop offset="0.2606" style="stop-color:#BDC2C4"/>
+<stop offset="0.6606" style="stop-color:#5B6163"/>
+<stop offset="1" style="stop-color:#959A9C"/>
+</linearGradient>
+<path d="M24.245,28c0.025-0.635,0.04-0.508,0.04-0.639v-0.035c0-1.037-0.852-1.879-1.901-1.879H7.662  c-1.05,0-1.9,0.842-1.9,1.879v0.035c0,0.131,0.014,0.004,0.04,0.639H24.245z" fill="url(#SVGID_12_)"/>
+<path d="M5.879,26.7h18.29c-0.084-0.234-0.212-0.444-0.377-0.626H6.256  C6.092,26.256,5.963,26.466,5.879,26.7z" fill="#FFFFFF" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M5.772,27.361C5.779,27.492,5.789,27.684,5.802,28h18.443  c0.012-0.316,0.022-0.508,0.028-0.639H5.772z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M6.255,26.074h17.536c-0.348-0.383-0.846-0.627-1.407-0.627H7.662  C7.102,25.447,6.603,25.691,6.255,26.074z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
+<rect fill="none" height="30" width="30"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5609 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="423.0967" x2="429.6524" y1="-578.646" y2="-582.9078">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.1333" style="stop-color:#A7E722"/>
+<stop offset="0.6303" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</linearGradient>
+<path d="M19.081,33.91c2.089-3.595,4.591-6.496,7.281-9.188c2.593-2.591,6.72-5.3,8.562-6.256l9.604-10.282  c-0.845-0.3-3.693-0.464-7.279,0.616c-3.586,1.083-11.736,6.303-16.979,11.547c-5.242,5.246-9.727,12.347-10.581,14.595  c-1.343,3.541-1.221,7.445-0.929,8.58c0,0,0.34,1.035,1.144,2.377C10.248,46.475,19.081,33.91,19.081,33.91z" fill="url(#SVGID_1_)"/>
+<path d="M31.184,20.8c1.488-1.036,2.87-1.882,3.74-2.334L44.271,8.46  c-0.132-0.058-0.209-0.088-0.209-0.088c-0.247-0.088-0.642-0.162-1.124-0.219c-0.793,0.006-1.596,0.093-2.401,0.27  C34.843,9.673,31.019,14.958,31.184,20.8z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
+<path d="M31.906,20.306c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04  c-0.146-0.063-0.233-0.098-0.233-0.098c-0.231-0.08-0.604-0.152-1.06-0.203c-0.751,0.006-1.51,0.087-2.27,0.253  C35.275,9.576,31.636,14.695,31.906,20.306z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M44.079,8.263c-0.21-0.073-0.55-0.137-0.962-0.186c-0.681,0.006-1.369,0.08-2.06,0.231  c-5.087,1.116-8.426,5.984-7.978,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.424-10.088C44.178,8.302,44.079,8.263,44.079,8.263z  " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="40.9697" cy="9.21" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="12.2872">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.6242" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</radialGradient>
+<path d="M34.924,18.466l0.929,1.55c0,0,15.101-6.784,14.084-8.038c-0.513-0.631-0.577-0.656-1.237-1.263  c-1.985-1.815-4.172-2.531-4.172-2.531c-0.186-0.063-0.481-0.12-0.845-0.161c-0.596,0.004-1.2,0.068-1.806,0.201  c-4.591,1.009-7.57,5.501-6.963,10.257C34.916,18.477,34.921,18.47,34.924,18.466z" fill="url(#SVGID_2_)"/>
+<path d="M17.483,34.105c-0.988-0.139-2.007-0.119-3.027,0.105c-2.418,0.531-4.376,2.066-5.646,4.131  c-0.367,2.35-0.25,4.408-0.05,5.18c0,0,0.34,1.035,1.144,2.377c0.29,0.482,6.54-8.264,8.556-11.107L17.483,34.105z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M18.366,34.135c-0.989-0.139-2.008-0.117-3.029,0.105c-3.313,0.727-5.775,3.332-6.76,6.623  c-0.026,1.025,0.034,1.873,0.127,2.398c0.003,0.012,0.005,0.033,0.01,0.047c0,0,0.34,1.033,1.144,2.379  c0.3,0.498,6.981-8.887,8.75-11.383L18.366,34.135z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="437.4258" cy="-571.231" gradientTransform="matrix(0.2095 0.9787 -0.9682 0.2124 -629.4526 -270.6148)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6187">
+<stop offset="0" style="stop-color:#A7E722"/>
+<stop offset="0.6242" style="stop-color:#428C0F"/>
+<stop offset="1" style="stop-color:#5CA617"/>
+</radialGradient>
+<path d="M11.202,47.738c0.616,0.74,0.646,0.953,1.295,1.523c1.194,1.055,9.301-13.611,9.301-13.611  l-2.683-1.719c-0.941-0.111-1.914-0.08-2.89,0.135c-4.777,1.049-7.806,5.869-6.87,10.832C9.749,45.686,10.349,46.709,11.202,47.738z  " fill="url(#SVGID_3_)"/>
+<path d="M49.937,11.978c-0.179-0.22-0.381-0.446-0.578-0.67l-13.944,7.959l0.438,0.749  C35.853,20.016,50.953,13.231,49.937,11.978z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="422.2881" x2="427.4786" y1="-610.9287" y2="-594.4409">
+<stop offset="0" style="stop-color:#C6FF45"/>
+<stop offset="0.6788" style="stop-color:#387300"/>
+<stop offset="1" style="stop-color:#66A00E"/>
+</linearGradient>
+<path d="M35.853,20.016l1.178,1.981c0.302,0.515,0.972,0.674,1.569,0.422l4.09-2.334l8.043-4.668  c0.632-0.363,0.878-1.119,0.549-1.686c0,0-0.333-0.501-1.349-1.751L35.853,20.016z" fill="url(#SVGID_4_)"/>
+<path d="M21.798,35.65l-0.725-0.473l-9.215,13.486c0.216,0.205,0.43,0.414,0.639,0.598  C13.691,50.316,21.798,35.65,21.798,35.65z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="439.6982" x2="451.5232" y1="-577.7549" y2="-564.7323">
+<stop offset="0" style="stop-color:#C6FF45"/>
+<stop offset="0.6788" style="stop-color:#387300"/>
+<stop offset="1" style="stop-color:#66A00E"/>
+</linearGradient>
+<path d="M12.498,49.262c1.193,1.049,1.686,1.369,1.686,1.369c0.567,0.367,1.363,0.17,1.781-0.441l7.9-11.605  c0.419-0.615,0.307-1.412-0.26-1.777l-1.808-1.156L12.498,49.262z" fill="url(#SVGID_5_)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+<g transform="matrix(0.5 0 0 0.5 30 30)">
+<path d="M30,54.705C16.376,54.705,5.294,43.623,5.294,30  C5.294,16.376,16.376,5.294,30,5.294c13.623,0,24.705,11.083,24.705,24.706C54.705,43.623,43.623,54.705,30,54.705L30,54.705z" style="opacity:0.6;enable-background:new    ;"/>
+<radialGradient cx="2.7217" cy="-242.9165" gradientTransform="matrix(0.618 0 0 -0.618 28.3176 -128.0637)" gradientUnits="userSpaceOnUse" id="SVGID_1__" r="48.9069">
+<stop offset="0" style="stop-color:#94FFFF"/>
+<stop offset="0.5" style="stop-color:#36B5FF"/>
+<stop offset="1" style="stop-color:#1B66D8"/>
+</radialGradient>
+<circle cx="30" cy="30" r="22.941" style="fill:url(#SVGID_1__);"/>
+<path d="M52.122,28.744c-0.509-8.961-6.312-16.677-14.788-19.661l-1.032,0.169  l-5.995-1.147l-7.474,4.456l-0.281,1.878h-4.336l1.714,2.914l-4.643,3.787l-1.082,4.675l3.834,6.795l3.914-0.799l1.429,1.229  l1.117,0.111l0.738,2.883l-0.974,2.527l3.552,9.086h3.623l3.592-2.9v-1.185l0.947-1.47l0.783-0.4  c-0.199,0.303-0.512,0.998-0.512,0.998c-0.033,0.236,0.51,4.862,2.104,4.5c1.211-0.273,5.533-8.303,5.615-9.066  c0.164-1.51-0.658-2.134-1.162-2.37l-0.562-0.265l-2.58,2.587c-0.276,0.021-0.526,0.067-0.751,0.134v-2.147l2.802-2.737l1.426-4.595  l2.173-1.769l-0.477-0.866l1.639-1.578l-0.916-1.669l0.697,0.084l4.082,9.138l0.836-0.666c-0.025-0.447-0.074-0.887-0.125-1.329  L52.122,28.744z M30.275,18.466l-0.341-0.911h2.049l0.997,2.243h-1.484v-1.333H30.275z M37.035,22.983l1.637,2.388l0.111,0.286  l-1.677-1.013l-0.401-1.445L37.035,22.983z M39.496,27.155l0.494,0.494l-0.639,0.143l-0.145-0.177L39.496,27.155z M26.695,11.093  l1.041,1.611l-1.183,0.362l-0.462-0.263L26.695,11.093z" style="opacity:0.3;enable-background:new    ;"/>
+<path d="M30,7.059C17.331,7.059,7.059,17.331,7.059,30  c0,12.674,10.272,22.941,22.941,22.941c12.674,0,22.941-10.268,22.941-22.941C52.941,17.331,42.674,7.059,30,7.059z M30,51.176  C18.323,51.176,8.823,41.677,8.823,30c0-11.677,9.5-21.177,21.177-21.177c11.677,0,21.176,9.5,21.176,21.177  C51.176,41.677,41.677,51.176,30,51.176z" style="opacity:0.3;fill:url(#SVGID_2__);enable-background:new    ;"/>
+<radialGradient cx="182.1514" cy="-162.9028" gradientTransform="matrix(1.7647 0 0 -1.7647 -290.1173 -274.2362)" gradientUnits="userSpaceOnUse" id="SVGID_3__" r="15.4155">
+<stop offset="0" style="stop-color:#94FF26"/>
+<stop offset="0.3152" style="stop-color:#94FF26"/>
+<stop offset="0.7273" style="stop-color:#1FC211"/>
+<stop offset="1" style="stop-color:#0BA133"/>
+</radialGradient>
+<path d="M42.431,36.555l-2.388,2.391c0,0-1.443,0-1.511,0.572c-0.032,0.246-0.111,1.313-0.354,1.863  c-0.48,0.332-1.054,1.434-1.054,1.434s-0.298,2.129,1.296,1.768C40.004,44.224,44.883,37.707,42.431,36.555z" style="fill:url(#SVGID_3__);"/>
+<radialGradient cx="182.1514" cy="-162.9023" gradientTransform="matrix(1.7647 0 0 -1.7647 -290.1173 -274.2362)" gradientUnits="userSpaceOnUse" id="SVGID_4__" r="17.8322">
+<stop offset="0" style="stop-color:#94FF26"/>
+<stop offset="0.3152" style="stop-color:#94FF26"/>
+<stop offset="0.7273" style="stop-color:#1FC211"/>
+<stop offset="1" style="stop-color:#0BA133"/>
+</radialGradient>
+<path d="M37.041,9.916c-0.392,0.148-0.66,0.25-0.66,0.25L30.48,9.037l-2.894,1.811l1.523,2.356  l-2.663,0.819l-1.435-0.819l0.504-1.431l-1.871,1.295l-0.333,2.255h-3.554l1.314,2.238l-4.996,4.073l-0.94,4.066l1.855,3.591  L18.104,30l3.914-0.799l1.43,1.228l1.299,0.127l1.414,5.53l-0.941,2.446l2.079,4.595l0.585,1.908h3.623l2.048-1.108l1.543-1.793  v-2.169l2.936-1.498v-3.213l1.16-2.208l2.59-2.329l0.619-2.7l-3.387,0.755l-0.891-1.085l0.633-1.013l-2.404-1.454l-1.025-3.687  l1.776-1.158l1.636,2.388l0.613,1.572l1.228,1.229l1.435,0.75l1.594-0.258l1.77-1.703l-1.246-2.273l-1.568,0.409L41.146,20.8  l1.349-0.94l4.23,0.512v1.505l3.681,7.585l0.837-0.669C50.746,20.045,44.965,12.704,37.041,9.916z M35.119,20.169l-1.932,0.512  h-2.573v-1.333h-2.46l-1.946,0.514l-2.966-0.821l-0.821-1.535l4.096-0.921h4.098L30,14.945h2.049l1.14,2.561l1.933,0.678v1.985  H35.119z M39.523,16.79l-3.482-0.616v-1.228l1.741-0.41l0.512-0.614l1.229,1.023L39.523,16.79L39.523,16.79z" style="fill:url(#SVGID_4__);"/>
+<rect height="60" style="fill:none;" width="60"/>
+<defs>
+<linearGradient gradientTransform="matrix(1.7647 0 0 -1.7647 -290.1173 -274.2362)" gradientUnits="userSpaceOnUse" id="SVGID_2__" x1="181.4004" x2="181.4004" y1="-159.4634" y2="-185.5335">
+<stop offset="0" style="stop-color:#31A7F8"/>
+<stop offset="0.497" style="stop-color:#1E74DC"/>
+<stop offset="1" style="stop-color:#C8E4EB"/>
+</linearGradient>
+</defs>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="20.3613" x2="26.6141" y1="20.2744" y2="26.4485">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.5939" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M19.081,33.911c2.089-3.597,4.591-6.497,7.281-9.189c2.593-2.591,6.72-5.3,8.562-6.256l9.604-10.282  c-0.845-0.3-3.693-0.464-7.279,0.616c-3.586,1.083-11.736,6.303-16.979,11.547c-5.242,5.246-9.727,12.347-10.581,14.595  c-1.343,3.541-1.221,7.445-0.929,8.581c0,0,0.34,1.034,1.144,2.377C10.248,46.476,19.081,33.911,19.081,33.911z" fill="url(#SVGID_1_)"/>
+<path d="M31.184,20.8c1.488-1.036,2.87-1.882,3.74-2.334L44.271,8.46  c-0.132-0.058-0.209-0.088-0.209-0.088c-0.247-0.088-0.642-0.162-1.124-0.219c-0.793,0.006-1.596,0.093-2.401,0.27  C34.843,9.673,31.019,14.958,31.184,20.8z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
+<path d="M31.906,20.306c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04  c-0.146-0.063-0.233-0.098-0.233-0.098c-0.231-0.08-0.604-0.152-1.06-0.203c-0.751,0.006-1.51,0.087-2.27,0.253  C35.275,9.576,31.636,14.695,31.906,20.306z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M44.079,8.263c-0.21-0.073-0.55-0.137-0.962-0.186c-0.681,0.006-1.369,0.08-2.06,0.231  c-5.087,1.116-8.426,5.984-7.978,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.424-10.088C44.178,8.302,44.079,8.263,44.079,8.263z  " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="43.6406" cy="10.1128" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="13.348">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.6061" style="stop-color:#F1830A"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</radialGradient>
+<path d="M34.924,18.466l0.929,1.55c0,0,15.101-6.784,14.084-8.038c-0.513-0.631-0.577-0.656-1.237-1.263  c-1.985-1.815-4.172-2.531-4.172-2.531c-0.186-0.063-0.481-0.12-0.845-0.161c-0.596,0.004-1.2,0.068-1.806,0.201  c-4.591,1.009-7.57,5.501-6.963,10.257C34.916,18.477,34.921,18.47,34.924,18.466z" fill="url(#SVGID_2_)"/>
+<path d="M17.483,34.106c-0.988-0.14-2.007-0.119-3.027,0.105c-2.418,0.53-4.376,2.066-5.646,4.131  c-0.367,2.35-0.25,4.407-0.05,5.18c0,0,0.34,1.034,1.144,2.377c0.29,0.482,6.54-8.264,8.556-11.107L17.483,34.106z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M18.366,34.136c-0.989-0.14-2.008-0.118-3.029,0.105c-3.313,0.727-5.775,3.332-6.76,6.623  c-0.026,1.025,0.034,1.872,0.127,2.397c0.003,0.013,0.005,0.034,0.01,0.048c0,0,0.34,1.033,1.144,2.379  c0.3,0.498,6.981-8.888,8.75-11.384L18.366,34.136z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="437.4258" cy="-571.231" gradientTransform="matrix(0.2095 0.9787 -0.9682 0.2124 -629.4526 -270.6148)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6198">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.6061" style="stop-color:#F1830A"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</radialGradient>
+<path d="M11.202,47.738c0.616,0.74,0.646,0.954,1.295,1.524c1.194,1.055,9.301-13.612,9.301-13.612  l-2.683-1.719c-0.941-0.111-1.914-0.079-2.89,0.136c-4.777,1.048-7.806,5.868-6.87,10.832C9.749,45.686,10.349,46.71,11.202,47.738z  " fill="url(#SVGID_3_)"/>
+<path d="M49.937,11.978c-0.179-0.22-0.381-0.446-0.578-0.67l-13.944,7.959l0.438,0.749  C35.853,20.016,50.953,13.231,49.937,11.978z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="422.2881" x2="427.4786" y1="-610.9287" y2="-594.4409">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.7576" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M35.853,20.016l1.178,1.981c0.302,0.515,0.972,0.674,1.569,0.422l4.09-2.334l8.043-4.668  c0.632-0.363,0.878-1.119,0.549-1.686c0,0-0.333-0.501-1.349-1.751L35.853,20.016z" fill="url(#SVGID_4_)"/>
+<path d="M21.798,35.65l-0.725-0.472l-9.215,13.486c0.216,0.204,0.43,0.414,0.639,0.598  C13.691,50.317,21.798,35.65,21.798,35.65z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="439.6982" x2="451.5232" y1="-577.7549" y2="-564.7323">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.7576" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M12.498,49.262c1.193,1.05,1.686,1.37,1.686,1.37c0.567,0.367,1.363,0.169,1.781-0.442l7.9-11.605  c0.419-0.614,0.307-1.411-0.26-1.777l-1.808-1.156L12.498,49.262z" fill="url(#SVGID_5_)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+<g transform="matrix(0.5 0 0 0.5 30 30)">
+<path d="M30,54.705C16.376,54.705,5.294,43.623,5.294,30  C5.294,16.376,16.376,5.294,30,5.294c13.623,0,24.705,11.083,24.705,24.706C54.705,43.623,43.623,54.705,30,54.705L30,54.705z" style="opacity:0.6;enable-background:new    ;"/>
+<radialGradient cx="2.7217" cy="-242.9165" gradientTransform="matrix(0.618 0 0 -0.618 28.3176 -128.0637)" gradientUnits="userSpaceOnUse" id="SVGID_1__" r="48.9069">
+<stop offset="0" style="stop-color:#94FFFF"/>
+<stop offset="0.5" style="stop-color:#36B5FF"/>
+<stop offset="1" style="stop-color:#1B66D8"/>
+</radialGradient>
+<circle cx="30" cy="30" r="22.941" style="fill:url(#SVGID_1__);"/>
+<path d="M52.122,28.744c-0.509-8.961-6.312-16.677-14.788-19.661l-1.032,0.169  l-5.995-1.147l-7.474,4.456l-0.281,1.878h-4.336l1.714,2.914l-4.643,3.787l-1.082,4.675l3.834,6.795l3.914-0.799l1.429,1.229  l1.117,0.111l0.738,2.883l-0.974,2.527l3.552,9.086h3.623l3.592-2.9v-1.185l0.947-1.47l0.783-0.4  c-0.199,0.303-0.512,0.998-0.512,0.998c-0.033,0.236,0.51,4.862,2.104,4.5c1.211-0.273,5.533-8.303,5.615-9.066  c0.164-1.51-0.658-2.134-1.162-2.37l-0.562-0.265l-2.58,2.587c-0.276,0.021-0.526,0.067-0.751,0.134v-2.147l2.802-2.737l1.426-4.595  l2.173-1.769l-0.477-0.866l1.639-1.578l-0.916-1.669l0.697,0.084l4.082,9.138l0.836-0.666c-0.025-0.447-0.074-0.887-0.125-1.329  L52.122,28.744z M30.275,18.466l-0.341-0.911h2.049l0.997,2.243h-1.484v-1.333H30.275z M37.035,22.983l1.637,2.388l0.111,0.286  l-1.677-1.013l-0.401-1.445L37.035,22.983z M39.496,27.155l0.494,0.494l-0.639,0.143l-0.145-0.177L39.496,27.155z M26.695,11.093  l1.041,1.611l-1.183,0.362l-0.462-0.263L26.695,11.093z" style="opacity:0.3;enable-background:new    ;"/>
+<path d="M30,7.059C17.331,7.059,7.059,17.331,7.059,30  c0,12.674,10.272,22.941,22.941,22.941c12.674,0,22.941-10.268,22.941-22.941C52.941,17.331,42.674,7.059,30,7.059z M30,51.176  C18.323,51.176,8.823,41.677,8.823,30c0-11.677,9.5-21.177,21.177-21.177c11.677,0,21.176,9.5,21.176,21.177  C51.176,41.677,41.677,51.176,30,51.176z" style="opacity:0.3;fill:url(#SVGID_2__);enable-background:new    ;"/>
+<radialGradient cx="182.1514" cy="-162.9028" gradientTransform="matrix(1.7647 0 0 -1.7647 -290.1173 -274.2362)" gradientUnits="userSpaceOnUse" id="SVGID_3__" r="15.4155">
+<stop offset="0" style="stop-color:#94FF26"/>
+<stop offset="0.3152" style="stop-color:#94FF26"/>
+<stop offset="0.7273" style="stop-color:#1FC211"/>
+<stop offset="1" style="stop-color:#0BA133"/>
+</radialGradient>
+<path d="M42.431,36.555l-2.388,2.391c0,0-1.443,0-1.511,0.572c-0.032,0.246-0.111,1.313-0.354,1.863  c-0.48,0.332-1.054,1.434-1.054,1.434s-0.298,2.129,1.296,1.768C40.004,44.224,44.883,37.707,42.431,36.555z" style="fill:url(#SVGID_3__);"/>
+<radialGradient cx="182.1514" cy="-162.9023" gradientTransform="matrix(1.7647 0 0 -1.7647 -290.1173 -274.2362)" gradientUnits="userSpaceOnUse" id="SVGID_4__" r="17.8322">
+<stop offset="0" style="stop-color:#94FF26"/>
+<stop offset="0.3152" style="stop-color:#94FF26"/>
+<stop offset="0.7273" style="stop-color:#1FC211"/>
+<stop offset="1" style="stop-color:#0BA133"/>
+</radialGradient>
+<path d="M37.041,9.916c-0.392,0.148-0.66,0.25-0.66,0.25L30.48,9.037l-2.894,1.811l1.523,2.356  l-2.663,0.819l-1.435-0.819l0.504-1.431l-1.871,1.295l-0.333,2.255h-3.554l1.314,2.238l-4.996,4.073l-0.94,4.066l1.855,3.591  L18.104,30l3.914-0.799l1.43,1.228l1.299,0.127l1.414,5.53l-0.941,2.446l2.079,4.595l0.585,1.908h3.623l2.048-1.108l1.543-1.793  v-2.169l2.936-1.498v-3.213l1.16-2.208l2.59-2.329l0.619-2.7l-3.387,0.755l-0.891-1.085l0.633-1.013l-2.404-1.454l-1.025-3.687  l1.776-1.158l1.636,2.388l0.613,1.572l1.228,1.229l1.435,0.75l1.594-0.258l1.77-1.703l-1.246-2.273l-1.568,0.409L41.146,20.8  l1.349-0.94l4.23,0.512v1.505l3.681,7.585l0.837-0.669C50.746,20.045,44.965,12.704,37.041,9.916z M35.119,20.169l-1.932,0.512  h-2.573v-1.333h-2.46l-1.946,0.514l-2.966-0.821l-0.821-1.535l4.096-0.921h4.098L30,14.945h2.049l1.14,2.561l1.933,0.678v1.985  H35.119z M39.523,16.79l-3.482-0.616v-1.228l1.741-0.41l0.512-0.614l1.229,1.023L39.523,16.79L39.523,16.79z" style="fill:url(#SVGID_4__);"/>
+<rect height="60" style="fill:none;" width="60"/>
+<defs>
+<linearGradient gradientTransform="matrix(1.7647 0 0 -1.7647 -290.1173 -274.2362)" gradientUnits="userSpaceOnUse" id="SVGID_2__" x1="181.4004" x2="181.4004" y1="-159.4634" y2="-185.5335">
+<stop offset="0" style="stop-color:#31A7F8"/>
+<stop offset="0.497" style="stop-color:#1E74DC"/>
+<stop offset="1" style="stop-color:#C8E4EB"/>
+</linearGradient>
+</defs>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_large_waiting_call.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="20.3613" x2="26.6141" y1="20.2744" y2="26.4485">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.5939" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M19.081,33.911c2.089-3.597,4.591-6.497,7.281-9.189c2.593-2.591,6.72-5.3,8.562-6.256l9.604-10.282  c-0.845-0.3-3.693-0.464-7.279,0.616c-3.586,1.083-11.736,6.303-16.979,11.547c-5.242,5.246-9.727,12.347-10.581,14.595  c-1.343,3.541-1.221,7.445-0.929,8.581c0,0,0.34,1.034,1.144,2.377C10.248,46.476,19.081,33.911,19.081,33.911z" fill="url(#SVGID_1_)"/>
+<path d="M31.184,20.8c1.488-1.036,2.87-1.882,3.74-2.334L44.271,8.46  c-0.132-0.058-0.209-0.088-0.209-0.088c-0.247-0.088-0.642-0.162-1.124-0.219c-0.793,0.006-1.596,0.093-2.401,0.27  C34.843,9.673,31.019,14.958,31.184,20.8z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
+<path d="M31.906,20.306c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04  c-0.146-0.063-0.233-0.098-0.233-0.098c-0.231-0.08-0.604-0.152-1.06-0.203c-0.751,0.006-1.51,0.087-2.27,0.253  C35.275,9.576,31.636,14.695,31.906,20.306z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M44.079,8.263c-0.21-0.073-0.55-0.137-0.962-0.186c-0.681,0.006-1.369,0.08-2.06,0.231  c-5.087,1.116-8.426,5.984-7.978,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.424-10.088C44.178,8.302,44.079,8.263,44.079,8.263z  " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="43.6406" cy="10.1128" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="13.348">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.6061" style="stop-color:#F1830A"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</radialGradient>
+<path d="M34.924,18.466l0.929,1.55c0,0,15.101-6.784,14.084-8.038c-0.513-0.631-0.577-0.656-1.237-1.263  c-1.985-1.815-4.172-2.531-4.172-2.531c-0.186-0.063-0.481-0.12-0.845-0.161c-0.596,0.004-1.2,0.068-1.806,0.201  c-4.591,1.009-7.57,5.501-6.963,10.257C34.916,18.477,34.921,18.47,34.924,18.466z" fill="url(#SVGID_2_)"/>
+<path d="M17.483,34.106c-0.988-0.14-2.007-0.119-3.027,0.105c-2.418,0.53-4.376,2.066-5.646,4.131  c-0.367,2.35-0.25,4.407-0.05,5.18c0,0,0.34,1.034,1.144,2.377c0.29,0.482,6.54-8.264,8.556-11.107L17.483,34.106z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<path d="M18.366,34.136c-0.989-0.14-2.008-0.118-3.029,0.105c-3.313,0.727-5.775,3.332-6.76,6.623  c-0.026,1.025,0.034,1.872,0.127,2.397c0.003,0.013,0.005,0.034,0.01,0.048c0,0,0.34,1.033,1.144,2.379  c0.3,0.498,6.981-8.888,8.75-11.384L18.366,34.136z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
+<radialGradient cx="437.4258" cy="-571.231" gradientTransform="matrix(0.2095 0.9787 -0.9682 0.2124 -629.4526 -270.6148)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6198">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.6061" style="stop-color:#F1830A"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</radialGradient>
+<path d="M11.202,47.738c0.616,0.74,0.646,0.954,1.295,1.524c1.194,1.055,9.301-13.612,9.301-13.612  l-2.683-1.719c-0.941-0.111-1.914-0.079-2.89,0.136c-4.777,1.048-7.806,5.868-6.87,10.832C9.749,45.686,10.349,46.71,11.202,47.738z  " fill="url(#SVGID_3_)"/>
+<path d="M49.937,11.978c-0.179-0.22-0.381-0.446-0.578-0.67l-13.944,7.959l0.438,0.749  C35.853,20.016,50.953,13.231,49.937,11.978z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="422.2881" x2="427.4786" y1="-610.9287" y2="-594.4409">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.7576" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M35.853,20.016l1.178,1.981c0.302,0.515,0.972,0.674,1.569,0.422l4.09-2.334l8.043-4.668  c0.632-0.363,0.878-1.119,0.549-1.686c0,0-0.333-0.501-1.349-1.751L35.853,20.016z" fill="url(#SVGID_4_)"/>
+<path d="M21.798,35.65l-0.725-0.472l-9.215,13.486c0.216,0.204,0.43,0.414,0.639,0.598  C13.691,50.317,21.798,35.65,21.798,35.65z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="439.6982" x2="451.5232" y1="-577.7549" y2="-564.7323">
+<stop offset="0" style="stop-color:#FEE16E"/>
+<stop offset="0.7576" style="stop-color:#D96900"/>
+<stop offset="1" style="stop-color:#FED43A"/>
+</linearGradient>
+<path d="M12.498,49.262c1.193,1.05,1.686,1.37,1.686,1.37c0.567,0.367,1.363,0.169,1.781-0.442l7.9-11.605  c0.419-0.614,0.307-1.411-0.26-1.777l-1.808-1.156L12.498,49.262z" fill="url(#SVGID_5_)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="32" height="32" viewBox="0 0 32 32">
+<polygon points="20.57,25.147 4.998,25.147 4.998,28.813 22.889,28.819 25.58,24.735 22.346,22.573 "/>
+<polygon points="20.492,21.345 22.346,22.573 25.58,24.735 25.602,24.751 27.445,26.001 28.82,16.104 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="8.005" version="1.1" viewBox="0 0 9 8.005" width="9" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<path d="M7.029,3.005V1c0-0.553-0.446-1-1-1L4,0.005v0.997c0.492-0.001,1.326,0,1.375,0.001c0.006,0,0.01,0.001,0.017,0.001   C6.008,1.022,6.01,1.15,6.01,2L6.002,3.005H1v5h7v-5H7.029z M5,7.005H4v-3h1V7.005z"/>
+<rect fill="none" height="8" width="9" y="0.005"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_1.docml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.1">
+    <widget name="content" type="HbWidget">
+        <widget name="expandedBubble" type="BubbleContainerWidget">
+            <widget name="eb:bubbleHeading" type="BubbleHeadingWidget">
+                <sizehint height="13.0un" type="PREFERRED"/>
+                <integer name="lines" value="3"/>
+            </widget>
+            <widget name="eb:callImage" type="BubbleImageWidget">
+            </widget>
+            <widget name="eb:centerButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="28.0un" type="PREFERRED"/>
+            </widget>
+            <widget name="eb:leftButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="28.0un" type="PREFERRED"/>                
+            </widget>
+            <widget name="eb:rightButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="28.0un" type="PREFERRED"/>                
+            </widget>
+        </widget>
+    </widget>
+
+<section name="portrait">
+    <layout type="anchor" widget="content">
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="" dstEdge="TOP"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+    
+    <layout type="anchor" widget="expandedBubble">
+        <anchoritem src="eb:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="BOTTOM" dst="eb:callImage" dstEdge="TOP" spacing="2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-4.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="4.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="BOTTOM" dst="eb:centerButton" dstEdge="TOP"  spacing="3.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="RIGHT" dst="" dstEdge="CENTERH" spacing="1.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-4.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-1.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="CENTERH" dst="" dstEdge="CENTERH"/>
+        <anchoritem src="eb:centerButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="CENTERH" dst="" dstEdge="CENTERH"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+    </layout>
+</section>
+
+<section name="landscape">
+    <layout type="anchor" widget="content">
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="" dstEdge="TOP"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+
+    <layout type="anchor" widget="expandedBubble">        
+        <anchoritem src="eb:bubbleHeading" srcEdge="LEFT" dst="eb:leftButton" dstEdge="LEFT"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        
+        <anchoritem src="eb:centerButton" srcEdge="CENTERH" dst="eb:bubbleHeading" dstEdge="CENTERH"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+        
+        <anchoritem src="eb:leftButton" srcEdge="LEFT" dst="eb:callImage" dstEdge="RIGHT" spacing="-2.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+        
+        <anchoritem src="eb:rightButton" srcEdge="LEFT" dst="eb:leftButton" dstEdge="RIGHT" spacing="-2.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>        
+        
+        <anchoritem src="eb:callImage" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>
+</section>
+
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_2.docml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.1">
+    <widget name="content" type="HbWidget">
+<section name="portrait">
+        <widget name="collapsedBubble" type="BubbleContainerWidget">
+            <sizehint height="11.0un" type="FIXED"/>
+            <widget name="cb:bubbleHeading" type="BubbleHeadingWidget">
+                <integer name="lines" value="2"/>
+            </widget>
+        </widget>
+</section>
+<section name="landscape">        
+        <widget name="collapsedBubble" type="BubbleContainerWidget">
+            <sizehint height="9.0un" type="FIXED"/>
+            <real name="z" value="-1.0"/>
+            <widget name="cb:bubbleHeading" type="BubbleHeadingWidget">
+                <integer name="lines" value="1"/>
+            </widget>
+        </widget>
+</section>            
+        
+        <widget name="expandedBubble" type="BubbleContainerWidget">
+            <widget name="eb:bubbleHeading" type="BubbleHeadingWidget">
+                <sizehint height="14.0un" type="PREFERRED"/>
+                <integer name="lines" value="3"/>
+            </widget>
+            <widget name="eb:callImage" type="BubbleImageWidget">
+            </widget>
+            <widget name="eb:centerButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="28.0un" type="PREFERRED"/>                
+            </widget>
+            <widget name="eb:leftButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="28.0un" type="PREFERRED"/>                
+            </widget>
+            <widget name="eb:rightButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="28.0un" type="PREFERRED"/>                
+            </widget>
+        </widget>
+        
+    </widget>
+
+<section name="portrait">
+
+    <layout type="anchor" widget="content">
+        <anchoritem src="collapsedBubble" srcEdge="TOP" dst="" dstEdge="TOP"/>        
+        <anchoritem src="collapsedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="collapsedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="collapsedBubble" dstEdge="BOTTOM"/>
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+
+    <layout type="anchor" widget="collapsedBubble">
+        <anchoritem src="cb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>        
+        <anchoritem src="cb:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>
+
+    <layout type="anchor" widget="expandedBubble">
+        <anchoritem src="eb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="BOTTOM" dst="eb:callImage" dstEdge="TOP" spacing="2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-10.75un"/>
+        <anchoritem src="eb:callImage" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="10.75un"/>
+        <anchoritem src="eb:callImage" srcEdge="BOTTOM" dst="eb:centerButton" dstEdge="TOP"  spacing="3.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="RIGHT" dst="" dstEdge="CENTERH" spacing="1.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-4.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-1.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="CENTERH" dst="" dstEdge="CENTERH"/>
+        <anchoritem src="eb:centerButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+    </layout>
+</section>
+
+<section name="landscape">
+    <layout type="anchor" widget="content">
+        <anchoritem src="collapsedBubble" srcEdge="TOP" dst="" dstEdge="TOP"/>        
+        <anchoritem src="collapsedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="collapsedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="collapsedBubble" dstEdge="BOTTOM"/>
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+
+    <layout type="anchor" widget="collapsedBubble">
+        <anchoritem src="cb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-1.5un"/>        
+        <anchoritem src="cb:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>
+    
+    <layout type="anchor" widget="expandedBubble">
+        <anchoritem src="eb:bubbleHeading" srcEdge="LEFT" dst="eb:callImage" dstEdge="RIGHT" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+
+        <anchoritem src="eb:centerButton" srcEdge="CENTERH" dst="eb:bubbleHeading" dstEdge="CENTERH"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+
+        <anchoritem src="eb:leftButton" srcEdge="LEFT" dst="eb:callImage" dstEdge="RIGHT" spacing="-10.5un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+        
+        <anchoritem src="eb:rightButton" srcEdge="LEFT" dst="eb:leftButton" dstEdge="RIGHT" spacing="-2.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+
+        <anchoritem src="eb:callImage" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>    
+    
+</section>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_3.docml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.1">
+    <widget name="content" type="HbWidget">
+<section name="portrait">
+        <widget name="collapsedBubble2" type="BubbleContainerWidget">
+            <sizehint height="11.0un" type="FIXED"/>
+            <widget name="cb2:bubbleHeading" type="BubbleHeadingWidget">
+                <integer name="lines" value="2"/>
+            </widget>
+        </widget>
+
+        <widget name="collapsedBubble" type="BubbleContainerWidget">
+            <sizehint height="11.0un" type="FIXED"/>
+            <widget name="cb:bubbleHeading" type="BubbleHeadingWidget">
+                <integer name="lines" value="2"/>
+            </widget>
+        </widget>
+
+        <widget name="expandedBubble" type="BubbleContainerWidget">
+            <widget name="eb:bubbleHeading" type="BubbleHeadingWidget">
+                <sizehint height="13.0un" type="PREFERRED"/>
+                <integer name="lines" value="3"/>
+            </widget>
+            <widget name="eb:callImage" type="BubbleImageWidget">
+            </widget>
+            <widget name="eb:centerButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="20.0un" type="PREFERRED"/>
+            </widget>
+            <widget name="eb:leftButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="20.0un" type="PREFERRED"/>                
+            </widget>
+            <widget name="eb:rightButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="20.0un" type="PREFERRED"/>                
+            </widget>
+        </widget>
+
+</section>
+
+<section name="landscape">        
+        <widget name="collapsedBubble2" type="BubbleContainerWidget">
+            <sizehint height="9.0un" type="FIXED"/>
+            <real name="z" value="-1.0"/>           
+            <widget name="cb2:bubbleHeading" type="BubbleHeadingWidget">
+                <integer name="lines" value="1"/>
+            </widget>
+        </widget>
+
+        <widget name="collapsedBubble" type="BubbleContainerWidget">
+            <sizehint height="9.0un" type="FIXED"/>
+            <real name="z" value="-1.0"/>
+            <widget name="cb:bubbleHeading" type="BubbleHeadingWidget">
+                <integer name="lines" value="1"/>
+            </widget>
+        </widget>
+
+        <widget name="expandedBubble" type="BubbleContainerWidget">
+            <widget name="eb:bubbleHeading" type="BubbleHeadingWidget">
+                <sizehint height="13.0un" type="PREFERRED"/>
+                <integer name="lines" value="2"/>
+            </widget>
+            <widget name="eb:callImage" type="BubbleImageWidget">
+            </widget>
+            <widget name="eb:centerButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="20.0un" type="PREFERRED"/>                
+            </widget>
+            <widget name="eb:leftButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="20.0un" type="PREFERRED"/>
+            </widget>
+            <widget name="eb:rightButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+                <sizehint width="20.0un" type="PREFERRED"/>
+            </widget>
+        </widget>
+</section>
+
+    </widget>
+
+<section name="portrait">
+
+    <layout type="anchor" widget="content">
+        <anchoritem src="collapsedBubble2" srcEdge="TOP" dst="" dstEdge="TOP"/>        
+        <anchoritem src="collapsedBubble2" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="collapsedBubble2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="collapsedBubble" srcEdge="TOP" dst="collapsedBubble2" dstEdge="BOTTOM"/>        
+        <anchoritem src="collapsedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="collapsedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>        
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="collapsedBubble" dstEdge="BOTTOM"/>
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+
+    <layout type="anchor" widget="collapsedBubble2">
+        <anchoritem src="cb2:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>        
+        <anchoritem src="cb2:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="cb2:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="cb2:bubbleHeading" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>
+
+    <layout type="anchor" widget="collapsedBubble">
+        <anchoritem src="cb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>        
+        <anchoritem src="cb:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>
+
+    <layout type="anchor" widget="expandedBubble">
+        <anchoritem src="eb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="BOTTOM" dst="eb:callImage" dstEdge="TOP" spacing="2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-14.75un"/>
+        <anchoritem src="eb:callImage" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="14.75un"/>
+        <anchoritem src="eb:callImage" srcEdge="BOTTOM" dst="eb:centerButton" dstEdge="TOP"  spacing="3.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="RIGHT" dst="" dstEdge="CENTERH" spacing="1.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-4.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-1.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="CENTERH" dst="" dstEdge="CENTERH"/>
+        <anchoritem src="eb:centerButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+    </layout>
+</section>
+
+<section name="landscape">
+    <layout type="anchor" widget="content">
+        <anchoritem src="collapsedBubble2" srcEdge="TOP" dst="" dstEdge="TOP"/>        
+        <anchoritem src="collapsedBubble2" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="collapsedBubble2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+
+        <anchoritem src="collapsedBubble" srcEdge="TOP" dst="collapsedBubble2" dstEdge="BOTTOM"/>        
+        <anchoritem src="collapsedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="collapsedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>        
+        
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="collapsedBubble" dstEdge="BOTTOM"/>
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+
+    <layout type="anchor" widget="collapsedBubble2">
+        <anchoritem src="cb2:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-1.5un"/>        
+        <anchoritem src="cb2:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="cb2:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="cb2:bubbleHeading" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>
+
+    <layout type="anchor" widget="collapsedBubble">
+        <anchoritem src="cb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-1.5un"/>        
+        <anchoritem src="cb:bubbleHeading" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="cb:bubbleHeading" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>    
+
+    <layout type="anchor" widget="expandedBubble">
+        <anchoritem src="eb:bubbleHeading" srcEdge="LEFT" dst="eb:callImage" dstEdge="RIGHT" spacing="-2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="RIGHT" dst="eb:centerButton" dstEdge="LEFT" spacing="2.0un"/>
+        <anchoritem src="eb:bubbleHeading" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        
+        <anchoritem src="eb:centerButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+        
+        <anchoritem src="eb:leftButton" srcEdge="CENTERH" dst="eb:centerButton" dstEdge="CENTERH" spacing="2.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+        
+        <anchoritem src="eb:rightButton" srcEdge="CENTERH" dst="eb:centerButton" dstEdge="CENTERH" spacing="2.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+        
+        <anchoritem src="eb:callImage" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="RIGHT" dst="" dstEdge="LEFT" spacing="-20.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:callImage" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>    
+    
+</section>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_4.docml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.1">
+    <widget name="content" type="HbWidget">
+        <widget name="expandedBubble" type="BubbleContainerWidget">
+            <widget name="eb:participantList" type="HbListView">
+            </widget>
+            <widget name="eb:callTimer" type="HbLabel">
+                <string name="text" value="00:01"/>
+                <sizehint height="4.0un" width="22.0un" type="FIXED"/>
+            </widget>            
+            <widget name="eb:centerButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+            </widget>
+            <widget name="eb:leftButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+            </widget>
+            <widget name="eb:rightButton" type="BubbleButton">
+                <sizehint height="9.0un" type="FIXED"/>
+            </widget>
+        </widget>
+    </widget>
+
+<section name="portrait">
+    <layout type="anchor" widget="content">
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="" dstEdge="TOP"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+    
+    <layout type="anchor" widget="expandedBubble">
+        <anchoritem src="eb:participantList" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:participantList" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+        <anchoritem src="eb:participantList" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:participantList" srcEdge="BOTTOM" dst="eb:callTimer" dstEdge="TOP" spacing="2.0un"/>
+        <anchoritem src="eb:callTimer" srcEdge="CENTERH" dst="" dstEdge="CENTERH"/>
+        <anchoritem src="eb:callTimer" srcEdge="BOTTOM" dst="eb:centerButton" dstEdge="TOP" spacing="3.0un"/>        
+        <anchoritem src="eb:leftButton" srcEdge="RIGHT" dst="" dstEdge="CENTERH" spacing="1.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-4.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-1.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="4.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="CENTERH" dst="" dstEdge="CENTERH"/>
+        <anchoritem src="eb:centerButton" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="16.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4.0un"/>
+    </layout>
+</section>
+
+<section name="landscape">
+    <layout type="anchor" widget="content">
+        <anchoritem src="expandedBubble" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+        <anchoritem src="expandedBubble" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+        <anchoritem src="expandedBubble" srcEdge="TOP" dst="" dstEdge="TOP"/>
+        <anchoritem src="expandedBubble" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+    </layout>
+
+    <layout type="anchor" widget="expandedBubble">
+        <anchoritem src="eb:callTimer" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+        <anchoritem src="eb:callTimer" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-2.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-13.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="13.0un"/>
+        <anchoritem src="eb:centerButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="3.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-1.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="RIGHT" dst="eb:centerButton" dstEdge="CENTERH" spacing="1.0un"/>
+        <anchoritem src="eb:leftButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="3.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="LEFT" dst="eb:centerButton" dstEdge="CENTERH" spacing="-1.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="1.0un"/>
+        <anchoritem src="eb:rightButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="3.0un"/>        
+        <anchoritem src="eb:participantList" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+        <anchoritem src="eb:participantList" srcEdge="RIGHT" dst="" dstEdge="CENTERH" spacing="2.0un"/>
+        <anchoritem src="eb:participantList" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="eb:participantList" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>
+    </layout>
+</section>
+
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubble_layout_5.docml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.1">
+    <widget name="content" type="HbWidget">
+
+<section name="portrait">    
+        <widget name="mutedIcon" type="HbLabel">
+            <real name="z" value="10.0"/>
+            <icon name="icon" iconName="qtg_large_call_muted"/>
+            <sizehint height="25.5un" width="25.5un" type="PREFERRED"/>
+        </widget>            
+</section>            
+<section name="landscape">    
+        <widget name="mutedIcon" type="HbLabel">
+            <real name="z" value="10.0"/>
+            <icon name="icon" iconName="qtg_large_call_muted"/>
+            <sizehint height="19.0un" width="19.0un" type="PREFERRED"/>
+        </widget>            
+</section>
+    </widget>
+
+<section name="portrait">
+    <layout type="anchor" widget="content">
+        <anchoritem src="mutedIcon" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-26.0un"/>
+        <anchoritem src="mutedIcon" srcEdge="CENTERH" dst="" dstEdge="CENTERH"/>
+    </layout>
+</section>
+
+<section name="landscape">
+    <layout type="anchor" widget="content">
+        <anchoritem src="mutedIcon" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-2.0un"/>
+        <anchoritem src="mutedIcon" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="21.0un"/>        
+    </layout>
+</section>
+
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.css	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,70 @@
+
+
+BubbleHeadingWidget[layoutOption="three_lines"]
+{
+    layout: three_lines_layout;
+}
+
+BubbleHeadingWidget[layoutOption="two_lines"]
+{
+    layout: two_lines_layout;
+}
+
+BubbleHeadingWidget[layoutOption="one_line"]
+{
+    layout: one_line_layout;
+}
+
+BubbleHeadingWidget:text_line_1
+{
+    preferred-height: var(hb-param-text-height-primary);
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:text_line_2[layoutOption!="one_line"]
+{
+    preferred-height: var(hb-param-text-height-primary);
+    preferred-width: -1;
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    top: -var(hb-param-margin-gene-middle-vertical);
+    text-align: left;
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:text_line_2[layoutOption="one_line"]
+{
+    preferred-height: var(hb-param-text-height-primary);
+    preferred-width: 30un;
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    text-align: right;
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:text_line_3
+{
+    preferred-height: var(hb-param-text-height-primary);
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    top: -var(hb-param-margin-gene-middle-vertical);
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:status_icon
+{
+    fixed-width:   var(hb-param-graphic-size-primary-large);
+    fixed-height:  var(hb-param-graphic-size-primary-large);
+}
+
+BubbleHeadingWidget:number_type_icon
+{
+    fixed-height: var(hb-param-graphic-size-secondary);
+    fixed-width:  var(hb-param-graphic-size-secondary);
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:ciphering_icon
+{
+    fixed-height: 2.5un;
+    fixed-width:  2.5un;
+    color: var(qtc_list_item_title_normal);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleheadingwidget.widgetml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,63 @@
+<hbwidget version="0.1" type="be">  
+  <layout name="three_lines_layout" type="mesh">
+    <meshitem src="status_icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="status_icon" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="number_type_icon" srcEdge="RIGHT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="number_type_icon" srcEdge="BOTTOM" dst="status_icon" dstEdge="BOTTOM"/>
+    
+    <meshitem src="ciphering_icon" srcEdge="LEFT" dst="status_icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering_icon" srcEdge="TOP" dst="status_icon" dstEdge="TOP"/>    
+    
+    <meshitem src="text_line_1" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="text_line_2" srcEdge="TOP" dst="text_line_1" dstEdge="BOTTOM"/>
+    <meshitem src="text_line_2" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    
+    <meshitem src="text_line_3" srcEdge="TOP" dst="text_line_2" dstEdge="BOTTOM"/>
+    <meshitem src="text_line_3" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_3" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+  </layout>
+
+  <layout name="two_lines_layout" type="mesh">
+    <meshitem src="status_icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="status_icon" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="number_type_icon" srcEdge="RIGHT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="number_type_icon" srcEdge="BOTTOM" dst="status_icon" dstEdge="BOTTOM"/>
+
+    <meshitem src="ciphering_icon" srcEdge="LEFT" dst="status_icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering_icon" srcEdge="TOP" dst="status_icon" dstEdge="TOP"/>    
+    
+    <meshitem src="text_line_1" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="text_line_2" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="text_line_2" srcEdge="TOP" dst="text_line_1" dstEdge="BOTTOM"/>
+  </layout>
+
+  <layout name="one_line_layout" type="mesh">
+    <meshitem src="status_icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="status_icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    
+    <meshitem src="number_type_icon" srcEdge="RIGHT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="number_type_icon" srcEdge="BOTTOM" dst="status_icon" dstEdge="BOTTOM"/>
+    
+    <meshitem src="ciphering_icon" srcEdge="LEFT" dst="status_icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering_icon" srcEdge="TOP" dst="status_icon" dstEdge="TOP"/>    
+    
+    <meshitem src="text_line_1" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    <meshitem src="text_line_1" srcEdge="RIGHT" dst="text_line_2" dstEdge="LEFT"/>
+    
+    <meshitem src="text_line_2" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    <meshitem src="text_line_2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+  </layout>
+  
+</hbwidget>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.css	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+
+
+BubbleImageWidget
+{
+    layout: avatar_layout;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleimagewidget.widgetml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,11 @@
+<hbwidget version="0.1" type="bi">  
+
+  <layout name="avatar_layout" type="mesh">
+    <meshitem src="default_avatar" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="default_avatar" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    <meshitem src="default_avatar" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="default_avatar" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
+  </layout>
+  
+</hbwidget>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.css	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,44 @@
+
+BubbleParticipantListItem[layoutOption="collapsed"] {
+    layout:collapsed;
+}
+
+BubbleParticipantListItem[layoutOption="expanded"] {
+    layout:expanded;
+}
+
+BubbleParticipantListItem::icon {
+    fixed-width: var(hb-param-graphic-size-primary-medium);
+    fixed-height: var(hb-param-graphic-size-primary-medium);
+}
+
+BubbleParticipantListItem::ciphering {
+    fixed-width: 2.0un;
+    fixed-height: 2.0un;
+    left: (hb-param-margin-gene-middle-horizontal);
+    top: (hb-param-margin-gene-middle-vertical);
+    color: var(qtc_list_item_title_normal);   
+}
+
+BubbleParticipantListItem::expand-indi {
+    fixed-width: var(hb-param-graphic-size-primary-small);
+    fixed-height: var(hb-param-graphic-size-primary-small);
+    right: var(hb-param-margin-gene-middle-horizontal);
+}
+
+BubbleParticipantListItem::text
+{
+    text-height: var(hb-param-text-height-primary);
+	  font-variant: primary;
+	  color: var(qtc_list_item_title_normal);
+	  left: var(hb-param-margin-gene-middle-horizontal);
+	  right: var(hb-param-margin-gene-middle-horizontal);
+}
+
+BubbleParticipantListItem::button-1 {
+    fixed-height: 9.0un;
+}
+
+BubbleParticipantListItem::button-2 {
+    fixed-height: 9.0un;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblecore/xml/bubbleparticipantlistitem.widgetml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,62 @@
+<hbwidget version="0.1" type="bl">
+
+  <layout name="collapsed" type="mesh">
+    
+    <meshitem src="icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    <meshitem src="icon" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="1.0un" spacer="spacer1"/>
+    <meshitem src="icon" srcEdge="TOP" dst="" dstEdge="TOP" spacing="1.0un" spacer="spacer2"/>
+    
+    <meshitem src="ciphering" srcEdge="LEFT" dst="icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering" srcEdge="TOP" dst="icon" dstEdge="TOP"/>
+
+    <meshitem src="text" srcEdge="LEFT" dst="icon" dstEdge="RIGHT"/>
+    <meshitem src="text" srcEdge="RIGHT" dst="expand-indi" dstEdge="LEFT"/>
+    <meshitem src="text" srcEdge="CENTERV" dst="icon" dstEdge="CENTERV"/>
+    
+    <meshitem src="expand-indi" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="expand-indi" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+
+  </layout>
+  
+  <layout name="expanded" type="mesh">
+    
+    <meshitem src="icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="icon" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-1.5un"/>
+    <meshitem src="icon" srcEdge="BOTTOM" dst="button-1" dstEdge="TOP" spacing="1.0un"/>
+    
+    <meshitem src="ciphering" srcEdge="LEFT" dst="icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering" srcEdge="TOP" dst="icon" dstEdge="TOP"/>
+
+    <meshitem src="text" srcEdge="LEFT" dst="icon" dstEdge="RIGHT"/>
+    <meshitem src="text" srcEdge="RIGHT" dst="expand-indi" dstEdge="LEFT"/>
+    <meshitem src="text" srcEdge="CENTERV" dst="icon" dstEdge="CENTERV"/>
+    
+    <meshitem src="expand-indi" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="expand-indi" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-1.5un"/>
+    
+    <meshitem src="button-1" srcEdge="RIGHT" dst="" dstEdge="CENTERH" spacing="1.0un"/>
+    <meshitem src="button-1" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-2.0un"/>
+    <meshitem src="button-1" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>        
+    
+    <meshitem src="button-2" srcEdge="LEFT" dst="" dstEdge="CENTERH" spacing="-1.0un"/>
+    <meshitem src="button-2" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="2.0un"/>
+    <meshitem src="button-2" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="2.0un"/>        
+    
+  </layout>  
+
+</hbwidget>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/bubblemanager2.pro	Fri Jun 04 10:19:18 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:                                                        
+#                                                                     
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+
+symbian: {
+    load(data_caging_paths)
+
+    include(./inc/api_headers.pri)
+
+    headers.sources = $$BUBBLEMGR2_API_HEADERS
+    headers.path = |../../inc
+    for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$headers.path/$$basename(header)"
+    
+    BLD_INF_RULES.prj_exports += \
+    "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "./rom/bubblemanager.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(bubblemanager.iby)"
+}
+
+SUBDIRS += ./bubblecore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/inc/api_headers.pri	Fri Jun 04 10:19:18 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:
+#
+#
+
+BUBBLEMGR2_API_HEADERS = \
+    ./inc/bubblemanager2.h \
+    ./inc/bubblemanagerif.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/inc/bubblemanager2.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,388 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  BubbleManager widget.
+*
+*/
+
+// Bubble widget API
+
+#ifndef BUBBLEMANAGER2_H
+#define BUBBLEMANAGER2_H
+
+#include <QtCore>
+#include <hbwidget.h>
+#include "bubblemanagerif.h"
+
+#ifdef BUILD_BUBBLEMANAGER
+#define BUBBLEMANAGER_EXPORT Q_DECL_EXPORT
+#else
+#define BUBBLEMANAGER_EXPORT Q_DECL_IMPORT
+#endif
+
+class BubbleHeader;
+class BubbleConferenceHeader;
+class BubbleWidgetManager;
+class BubbleImageManager;
+class HbAction;
+class HbStackedLayout;
+class BubbleHandler;
+class BubbleEffectHandler;
+
+static const int BUBBLE_MAX_CALL_COUNT = 7;
+static const int BUBBLE_CONF_CALL_ID   = 10;
+
+class BUBBLEMANAGER_EXPORT BubbleManager : public HbWidget, public BubbleManagerIF
+{
+    Q_OBJECT
+
+public:
+    explicit BubbleManager( QGraphicsItem *parent = 0 );
+    ~BubbleManager();
+
+public:
+
+    // ====================================================
+    // Must surround all the changes:
+    // ====================================================
+    //
+
+    /**
+    * Before making any changes to bubble headers, call this function
+    * so that manager can prapare for them properly.
+    */
+    void startChanges();
+
+    /**
+    * After the changes to bubble headers call this function so manager
+    * can prepare bubbles to right places and check the drawing order.
+    * Memory for arrays has been allocated beforehand.
+    */
+    void endChanges();
+
+
+    // ====================================================
+    // For call headers and some for conference call
+    // ====================================================
+    //
+
+    /**
+    * Takes a new call header in use.
+    * Returns bubble idenfication number.
+    */
+    int createCallHeader();
+
+    /**
+    * Removes call header from use
+    */
+    void removeCallHeader( int bubbleId );
+
+    /**
+    * Sets call state to header.
+    */
+    void setState( int bubbleId,
+                   PhoneCallState state );
+
+    /**
+    * Sets text label to header. For conf also.
+    * Text to be seen in bubble ( e.g. 'on hold' )
+    */
+    void setLabel(
+        int bubbleId,
+        const QString& text,
+        Qt::TextElideMode clipDirection = Qt::ElideRight );
+
+    /**
+    * Sets caller's line identification ( name or number) to header.
+    * For conf also. Caller's CLI ( e.g. 'Mother' )
+    */
+    void setCli( int bubbleId,
+                 const QString& cliText,
+                 Qt::TextElideMode clipDirection );
+
+    /**
+    * Updates caller's line identification ( name or number) to header.
+    * Caller's CLI ( e.g. 'Daddy' )-
+    */
+    void updateCLI(
+        int bubbleId,
+        const QString& cliText,
+        Qt::TextElideMode clipDirection );
+
+    /**
+    * Number or voip adress, when phonebook name takes Cli.
+    */
+    void setSecondaryCli(
+        int bubbleId,
+        const QString& cliText,
+        Qt::TextElideMode clipDirection = Qt::ElideLeft );
+
+
+    /**
+    * Sets call time or cost text to header. For conf also.
+    */
+    void setCallTime(
+        int bubbleId,
+        const QString& callTime );
+
+    /**
+    * Updates call time or cost text to header.  For conf also.
+    * Timer or cost text ( e.g. '00:12:34' or '£01.23' ).
+    */
+    void updateCallTime(
+        int bubbleId,
+        const QString& callTime );
+
+    /**
+    * Attach a call image to header.
+    */
+    void setCallObjectImage( int bubbleId,
+                             const QString& fileName );
+
+    /**
+    * Attach the theme call image to header.
+    */
+    void setCallObjectFromTheme( int bubbleId );
+
+    /**
+    * Sets call flags to header.
+    */
+    void setCallFlags(
+        int bubbleId,
+        int flags );
+
+    /**
+    * Sets call flags to header.
+    */
+    void setCallFlag( int bubbleId,
+                      PhoneCallFlags flag,
+                      bool set );
+
+    /**
+    * Sets number type.
+    */
+    void setNumberType( int bubbleId,
+                        PhoneNumberType type );
+
+    // ====================================================
+    // For all bubbles
+    // ====================================================
+    //
+
+    /**
+    * Sets phone muted/unmuted.
+    * @param aIsMuted ETrue if phone is muted.
+    */
+    void setPhoneMuted( bool muted = true );
+
+
+    // ====================================================
+    // For conference call
+    // ====================================================
+    //
+
+    /**
+    * Creates a conference call based upon two calls. Bubbles must be
+    * created first.
+    */
+    int createConference( int bubble1,
+                          int bubble2 );
+
+    /**
+    * Splits conference call into invidual two calls. Call headers stays
+    * in use. Headers' state will not be changed.
+    */
+    void removeConference();
+
+    /**
+    * Adds new call to conference call.
+    */
+    void addRowToConference( int bubbleId );
+
+    /**
+    * Takes specified call out of conference. Use RemoveConference if
+    * conference has only two calls in it. Header's state is same as
+    * before adding it to conference (if not changed inside the conf).
+    */
+    void removeRowFromConference( int bubbleId );
+
+    /**
+    * Counts calls in conference call.
+    */
+    int conferenceRowCount() const;
+
+    /**
+    * Sets highlight to specified line in conference.
+    */
+    void setSelectionInConference( int rowNumber );
+
+    /**
+    * Sets highlight to specified bubble id in conference.
+    */
+    void setSelectionIdInConference( int bubbleId );
+
+    /**
+    * Gets highlighted item in conference.
+    */
+    int selectionInConference() const;
+
+    /**
+    * Gets highlighted item in conference.
+    */
+    int selectionIdInConference() const;
+
+    /**
+    * Moves highligh one up if possible
+    */
+    void moveHighlightOneUpInConference();
+
+    /**
+    * Moves highligh one down if possible
+    */
+    void moveHighlightOneDownInConference();
+
+    /**
+    * Use this function to expand or shrink conference bubble.
+    */
+    void setExpandedConferenceCallHeader(
+        bool expanded = true );
+
+    /**
+    * Query: is conference expanded?
+    */
+    bool isConferenceExpanded( ) const;
+
+    /**
+    * Number of headers shown on the screen.
+    */
+    int shownHeaderCount() const;
+
+    /**
+    * Set CLI used in participant list (text or phonenumber).
+    */
+    void setParticipantListCli(
+        int aBubbleId,
+        ParticipantListCli aParticipantCli );
+
+
+    // ====================================================
+    // Call bubble actions
+    // ====================================================
+    //
+
+    /**
+    * Appends new action to call bubble
+    */
+    void addAction ( int bubbleId, HbAction* action );
+
+    /**
+    * Removes all actions from call bubble
+    */
+    void clearActions( int bubbleId );
+
+    /**
+    * Gets graphics widget for action
+    */
+    QGraphicsWidget* graphicsWidgetForAction(
+        HbAction* action ) const;
+
+    /**
+    * Appends new action to participant list in conference call bubble.
+    */
+    void addParticipantListAction(HbAction *action);
+
+    /**
+    * Removes participant list actions from conference call bubble.
+    */
+    void clearParticipantListActions();
+
+
+    // ====================================================
+    // Bubble state related (multicall)
+    // ====================================================
+    //
+
+    /**
+    * Bubble shown in expanded position.
+    */
+    int expandedBubble() const;
+
+    /**
+    * Sets action that is triggered when user taps collapsed
+    * call bubble and it changes to expanded. Setting null
+    * pointer removes expand action.
+    */
+    void setExpandAction(int bubbleId, HbAction* action);
+
+    /**
+    * Bubble state (expanded/collapsed) cannot be changed when
+    * disabled is set true.
+    */
+    void setBubbleSelectionDisabled(bool disabled);
+
+public slots:
+    void handleOrientationChange(Qt::Orientation orientation);
+
+private:
+    QGraphicsWidget* selectView();
+    bool addToLayout(QGraphicsWidget* widget);
+    void removeFromLayout(QGraphicsWidget* widget);
+    void connectSignals(QGraphicsWidget* widget);
+    void setViewData(QGraphicsWidget* view);
+
+    bool findActiveHeader(int bubbleId, BubbleHeader*& header);
+    void findNextDrawableHeader(int& index) const;
+    void polishEvent();
+    void releaseImageIfNotUsed(const QString& imageFileName);
+
+private slots:
+    void showExpanded( int bubbleId );
+
+private:
+    QVector<BubbleHeader*> mCallHeaders;
+    BubbleConferenceHeader* mConferenceHeader;
+    QVector<BubbleHeader*> mActiveHeaders;
+    QVector<BubbleHandler*> mActiveHandlers;
+
+    int mIsReadyToDraw;
+    bool mMuted;
+    QGraphicsWidget* mMutedIcon;
+    bool mSortHeaders;
+    BubbleWidgetManager* mWidgetManager;
+    BubbleImageManager* mBubbleImageManager;
+    HbStackedLayout* mMainLayout;
+    bool mInitialized;
+    bool mBubbleSelectionDisabled;
+    BubbleEffectHandler* mEffectHandler;
+};
+
+#endif /* BUBBLEMANAGER2_H */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/inc/bubblemanagerif.h	Fri Jun 04 10:19:18 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:  Bubble manager's interface.
+*
+*/
+
+#ifndef BUBBLEMANAGERIF_H
+#define BUBBLEMANAGERIF_H
+
+#include <QtCore>
+
+class HbAction;
+class QGraphicsWidget;
+
+class BubbleManagerIF
+{
+
+public:
+
+    // Call states
+    enum PhoneCallState
+        {
+        None           = 0, // Default on creation
+        OnHold,
+        Disconnected,
+        Active,
+        Incoming,
+        Waiting,
+        AlertToDisconnected,
+        Outgoing,
+        Alerting
+        };
+
+    // Call Flags
+    enum PhoneCallFlag
+        {
+        Normal         = 0x00,     // Default
+        NoCiphering    = 0x08,
+        Line2          = 0x10,
+        Muted          = 0x20,
+        Diverted       = 0x40,
+        Video          = 0x80,
+        VoIPCall       = 0x100
+        };
+    Q_DECLARE_FLAGS(PhoneCallFlags, PhoneCallFlag)
+
+    // Number types
+    enum PhoneNumberType
+        {
+        NotSet    = 0, // Default
+        Home,
+        Mobile,
+        Work,
+        Phone,
+        FaxNumber,
+        Pager,
+        Car,
+        Assistant
+        };
+
+    // Cli shown in conference participant list
+    enum ParticipantListCli
+        {
+        ParticipantListCliText,        // Name or Call %N
+        ParticipantListPhoneNumber     // Phonenumber
+        };
+
+
+public:
+
+    // ====================================================
+    // Must surround all the changes:
+    // ====================================================
+    //
+
+    /**
+    * Before making any changes to bubble headers, call this function
+    * so that manager can prapare for them properly.
+    */
+    virtual void startChanges () = 0;
+
+    /**
+    * After the changes to bubble headers call this function so manager
+    * can prepare bubbles to right places and check the drawing order.
+    * Memory for arrays has been allocated beforehand.
+    */
+    virtual void endChanges () = 0;
+
+
+    // ====================================================
+    // For call headers and some for conference call
+    // ====================================================
+    //
+
+    /**
+    * Takes a new call header in use.
+    * Returns bubble idenfication number.
+    */
+    virtual int createCallHeader () = 0;
+
+    /**
+    * Removes call header from use
+    */
+
+    virtual void removeCallHeader (int bubbleId) = 0;
+
+    /**
+    * Sets call state to header.
+    */
+    virtual void setState (int bubbleId, PhoneCallState state) = 0;
+
+    /**
+    * Sets text label to header. For conf also.
+    * Text to be seen in bubble ( e.g. 'on hold' )
+    */
+    virtual void setLabel (
+        int bubbleId,
+        const QString& text,
+        Qt::TextElideMode clipDirection) = 0;
+
+    /**
+    * Sets caller's line identification ( name or number) to header.
+    * For conf also. Caller's CLI ( e.g. 'Mother' )
+    */
+    virtual void setCli (int bubbleId,
+                 const QString& cliText,
+                 Qt::TextElideMode clipDirection) = 0;
+
+    /**
+    * Updates caller's line identification ( name or number) to header.
+    * Caller's CLI ( e.g. 'Daddy' )-
+    */
+    virtual void updateCLI (
+        int bubbleId,
+        const QString& cliText,
+        Qt::TextElideMode clipDirection) = 0;
+
+    /**
+    * Number or voip adress, when phonebook name takes Cli.
+    */
+    virtual void setSecondaryCli (
+        int bubbleId,
+        const QString& cliText,
+        Qt::TextElideMode clipDirection = Qt::ElideLeft) = 0;
+
+    /**
+    * Sets call time or cost text to header. For conf also.
+    */
+    virtual void setCallTime (int bubbleId, const QString& callTime) = 0;
+
+    /**
+    * Updates call time or cost text to header.  For conf also.
+    * Timer or cost text ( e.g. '00:12:34' or '£01.23' ).
+    */
+    virtual void updateCallTime (int bubbleId, const QString& callTime) = 0;
+
+    /**
+    * Attach a call image to header.
+    */
+    virtual void setCallObjectImage (int bubbleId, const QString &fileName) = 0;
+
+    /**
+    * Attach the theme call image to header.
+    */
+    virtual void setCallObjectFromTheme (int bubbleId) = 0;
+
+    /**
+    * Sets call flags to header.
+    */
+    virtual void setCallFlags (int bubbleId, int flags) = 0;
+
+    /**
+    * Sets call flags to header.
+    */
+    virtual void setCallFlag (int bubbleId, BubbleManagerIF::PhoneCallFlags callFlags, bool set) = 0;
+
+    /**
+    * Sets number type.
+    */
+    virtual void setNumberType (int bubbleId, PhoneNumberType type) = 0;
+
+    // ====================================================
+    // For all bubbles
+    // ====================================================
+    //
+
+    /**
+    * Sets phone muted/unmuted.
+    * @param aIsMuted ETrue if phone is muted.
+    */
+    virtual void setPhoneMuted (bool muted) = 0;
+
+
+    // ====================================================
+    // For conference call
+    // ====================================================
+    //
+
+    /**
+    * Creates a conference call based upon two calls. Bubbles must be
+    * created first.
+    */
+    virtual int createConference (int bubble1, int bubble2) = 0;
+
+    /**
+    * Splits conference call into invidual two calls. Call headers stays
+    * in use. Headers' state will not be changed.
+    */
+    virtual void removeConference () = 0;
+
+    /**
+    * Adds new call to conference call.
+    */
+    virtual void addRowToConference (int bubbleId) = 0;
+
+    /**
+    * Takes specified call out of conference. Use RemoveConference if
+    * conference has only two calls in it. Header's state is same as
+    * before adding it to conference (if not changed inside the conf).
+    */
+    virtual void removeRowFromConference (int bubbleId) = 0;
+
+    /**
+    * Counts calls in conference call.
+    */
+    virtual int conferenceRowCount () const = 0;
+
+    /**
+    * Sets highlight to specified line in conference.
+    */
+    virtual void setSelectionInConference (int rowNumber) = 0;
+
+    /**
+    * Sets highlight to specified bubble id in conference.
+    */
+    virtual void setSelectionIdInConference (int bubbleId) = 0;
+
+    /**
+    * Gets highlighted item in conference.
+    */
+    virtual int selectionInConference () const = 0;
+
+    /**
+    * Gets highlighted item in conference.
+    */
+    virtual int selectionIdInConference () const = 0;
+
+    /**
+    * Moves highligh one up if possible
+    */
+    virtual void moveHighlightOneUpInConference () = 0;
+
+    /**
+    * Moves highligh one down if possible
+    */
+    virtual void moveHighlightOneDownInConference () = 0;
+
+    /**
+    * Use this function to expand or shrink conference bubble.
+    */
+    virtual void setExpandedConferenceCallHeader (bool expanded) = 0;
+
+    /**
+    * Query: is conference expanded?
+    */
+    virtual bool isConferenceExpanded () const = 0;
+
+    /**
+    * Number of headers shown on the screen.
+    */
+    virtual int shownHeaderCount () const = 0;
+
+    /**
+    * Set CLI used in participant list (text or phonenumber).
+    */
+    virtual void setParticipantListCli (int aBubbleId, ParticipantListCli aParticipantCli) = 0;
+
+
+    // ====================================================
+    // Call bubble actions
+    // ====================================================
+    //
+
+    /**
+    * Appends new action to call bubble
+    */
+    virtual void addAction (int bubble, HbAction *action) = 0;
+
+    /**
+    * Removes all actions from call bubble
+    */
+    virtual void clearActions (int bubble) = 0;
+    
+    /**
+    * Gets graphics widget for action
+    */
+    virtual QGraphicsWidget* graphicsWidgetForAction (HbAction *action) const = 0;
+
+    /**
+    * Appends new action to participant list in conference call bubble.
+    */
+    virtual void addParticipantListAction (HbAction *action) = 0;
+
+    /**
+    * Removes participant list actions from conference call bubble.
+    */
+    virtual void clearParticipantListActions () = 0;
+
+
+    // ====================================================
+    // Bubble state related (multicall)
+    // ====================================================
+    //
+
+    /**
+    * Bubble shown in expanded position.
+    */
+    virtual int expandedBubble() const = 0;
+
+    /**
+    * Sets action that is triggered when user taps collapsed
+    * call bubble and it changes to expanded. Setting null
+    * pointer removes expand action.
+    */
+    virtual void setExpandAction(int bubble, HbAction* action) = 0;
+
+    /**
+    * Bubble state (expanded/collapsed) cannot be changed when
+    * disabled is set true.
+    */
+    virtual void setBubbleSelectionDisabled(bool disabled) = 0;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(BubbleManagerIF::PhoneCallFlags)
+
+#endif // BUBBLEMANAGERIF_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/rom/bubblemanager.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#ifndef __BUBBLEMANAGER_IBY__
+#define __BUBBLEMANAGER_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR/BUILD_DIR/bubblemanager2.dll       SHARED_LIB_DIR/bubblemanager2.dll
+
+#endif // __BUBBLEMANAGER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletest2.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+CONFIG += hb
+QT += network xml
+INCLUDEPATH += . \
+    ../../inc
+win32:INCLUDEPATH += c:/hb/include/hbcore \
+    c:/hb/include/hbwidgets
+
+symbian {    
+TARGET.EPOCHEAPSIZE = 0x1000 0xA00000
+INCLUDEPATH += . \
+    /sf/app/phone/inc
+TARGET.CAPABILITY = CAP_APPLICATION    
+}
+
+# Input
+HEADERS += bubbletestview.h \
+    bubbletester.h
+SOURCES += main.cpp \
+    bubbletestview.cpp \
+    bubbletester.cpp
+RESOURCES += bubbletest2.qrc
+
+# Libraries
+unix:!symbian LIBS += -L../../bubblecore
+LIBS += -lbubblemanager2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletest2.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+<RCC>
+    <qresource prefix="/">
+        <file>resources/contactpic.jpg</file>
+        <file>resources/contactpic2.jpg</file>
+        <file>resources/contactpic3.png</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester.cpp	Fri Jun 04 10:19:18 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:  Animated icon.
+*
+*/
+
+#include <QLocalSocket>
+
+#include "bubbletester.h"
+
+
+BubbleTester::BubbleTester() : mLocalSocket(new QLocalSocket())
+{
+}
+
+BubbleTester::~BubbleTester()
+{
+    mLocalSocket->disconnectFromServer();
+    delete mLocalSocket;
+}
+
+bool BubbleTester::connectToServer()
+{
+    mLocalSocket->connectToServer("bubbletestserver");
+
+    // This logic needs to be improved
+    bool success = mLocalSocket->waitForConnected(500);
+
+    qDebug() << "Socket Connect status: " << success;
+
+    if (success) {
+        connect(mLocalSocket, SIGNAL(readyRead()), this, SLOT(readData()));
+    }
+
+    return success;
+}
+
+void BubbleTester::readData()        
+{
+    QByteArray inputByteArray = mLocalSocket->readAll();
+    QDataStream inputDataStream(inputByteArray);
+    QString textDocument;
+    inputDataStream >> textDocument;
+
+    QString errorStr;
+    int errorLine;
+    int errorColumn;
+
+    if (!mDomDocument.setContent(textDocument, true, &errorStr, &errorLine,
+                                &errorColumn)) {
+        qDebug() << "Cannot read tester data!";
+    } else {
+        emit dataChanged();
+    }
+}
+
+QList<QString> BubbleTester::bubbles()
+{
+    QDomNodeList list = mDomDocument.elementsByTagName("bubble");
+
+    QList<QString> testBubbles;
+
+    for (int i=0; i<list.count(); i++ ) {
+        QDomNode node = list.at(i);
+        if (node.isElement()) {
+            QDomElement e = node.toElement();
+            QString id = e.attribute("id");
+            testBubbles.append(id);
+        }
+    }
+
+    return testBubbles;
+}
+
+QString BubbleTester::dataField( const QString&  bubble, const QString& fieldName )
+{
+    QString text("");
+    QDomElement elem = bubbleElement(bubble);
+
+    if (!elem.isNull()) {
+        QDomNodeList list = elem.elementsByTagName(fieldName);
+
+        if (list.count()) {
+            QDomNode node = list.at(0);
+            if (node.isElement()) {
+                QDomElement e = node.toElement();
+                text = e.text();
+            }
+        }
+    }
+
+    return text;
+}
+
+QDomElement BubbleTester::bubbleElement(const QString&  bubble)
+{
+    QDomNodeList list = mDomDocument.elementsByTagName("bubble");
+
+    QDomElement elem;
+
+    for (int i=0; i<list.count(); i++ ) {
+        QDomNode node = list.at(i);
+        if (node.isElement()) {
+            QDomElement e = node.toElement();
+            QString id = e.attribute("id");
+            if (id == bubble) {
+                elem = e;
+                break;
+            }
+        }
+    }
+
+    return elem;
+}
+
+QString BubbleTester::dataField(const QString& fieldName)
+{
+    QString text("");
+    QDomNodeList list = mDomDocument.elementsByTagName(fieldName);
+
+    if (list.count()) {
+        QDomNode node = list.at(0);
+        if (node.isElement()) {
+            QDomElement e = node.toElement();
+            text = e.text();
+        }
+    }
+
+    return text;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester.h	Fri Jun 04 10:19:18 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:  Animated icon.
+*
+*/
+
+#ifndef BUBBLETESTER_H
+#define BUBBLETESTER_H
+
+#include <QObject>
+#include <QDomDocument>
+
+class QLocalSocket;
+
+class BubbleTester : public QObject
+{
+    Q_OBJECT
+
+public:
+    BubbleTester();
+    ~BubbleTester();
+
+    bool connectToServer();
+
+    QList<QString> bubbles();
+    QString dataField(const QString& fieldName);
+    QString dataField(const QString&  bubble, const QString& fieldName);
+    QDomElement bubbleElement(const QString&  bubble);
+
+signals:
+    void dataChanged();
+
+private slots:
+    void readData();
+
+private:
+    QLocalSocket* mLocalSocket;
+    QDomDocument  mDomDocument;
+};
+
+#endif // BUBBLETESTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbledata.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,153 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Animated icon.
+*
+*/
+
+#include <QFile>
+#include <QMessageBox>
+#include <QDomDocument>
+#include "bubbledata.h"
+
+BubbleData::BubbleData( QObject *parent ) : QObject(parent)
+{
+    QFile file(":/testdata.xml");
+
+    if (!file.open(QFile::ReadOnly | QFile::Text)) {
+        QMessageBox::critical((QWidget*)parent, tr("Bubble tester"),
+                              tr("Cannot read testdata.xml") );
+        return;
+    }
+
+    createDomFromFile(&file);
+}
+
+void BubbleData::createDomFromFile(QIODevice *device)
+{
+    QString errorStr;
+    int errorLine;
+    int errorColumn;
+
+    if (!mDomDocument.setContent(device, true, &errorStr, &errorLine,
+                                &errorColumn)) {
+        QMessageBox::information((QWidget*)parent(), tr("Bubble tester"),
+                                 tr("Parse error at line %1, column %2:\n%3")
+                                 .arg(errorLine)
+                                 .arg(errorColumn)
+                                 .arg(errorStr));
+    }
+}
+
+QString BubbleData::dataField( const QString&  bubble, const QString& fieldName )
+{
+    QString text("");
+    QDomElement elem = bubbleElement(bubble);
+
+    if (!elem.isNull()) {
+        QDomNodeList list = elem.elementsByTagName(fieldName);
+
+        if (list.count()) {
+            QDomNode node = list.at(0);
+            if (node.isElement()) {
+                QDomElement e = node.toElement();
+                text = e.text();
+            }
+        }
+    }
+
+    return text;
+}
+
+QDomElement BubbleData::bubbleElement(const QString&  bubble)
+{
+    QDomNodeList list = mDomDocument.elementsByTagName("bubble");
+
+    QDomElement elem;
+
+    for (int i=0; i<list.count(); i++ ) {
+        QDomNode node = list.at(i);
+        if (node.isElement()) {
+            QDomElement e = node.toElement();
+            QString id = e.attribute("id");
+            if (id == bubble) {
+                elem = e;
+                break;
+            }
+        }
+    }
+
+    return elem;
+}
+
+void BubbleData::setDataField( const QString&  bubble, const QString& fieldName, const QString& value )
+{
+    QDomElement elem = bubbleElement(bubble);
+    if (elem.isNull()) {
+        return;
+    }
+
+    QDomText domText = mDomDocument.createTextNode(value);
+    QDomElement newElem = mDomDocument.createElement(fieldName);
+    newElem.appendChild(domText);
+
+    QDomNodeList list = elem.elementsByTagName(fieldName);
+
+    if (list.count()) {
+        QDomNode node = list.at(0);
+        if (node.isElement()) {
+            QDomNode parent = node.parentNode();
+            parent.replaceChild(newElem,node);
+        }
+    }
+}
+
+QString BubbleData::dataField(const QString& fieldName)
+{
+    QString text("");
+    QDomNodeList list = mDomDocument.elementsByTagName(fieldName);
+
+    if (list.count()) {
+        QDomNode node = list.at(0);
+        if (node.isElement()) {
+            QDomElement e = node.toElement();
+            text = e.text();
+        }
+    }
+
+    return text;
+}
+
+void BubbleData::setDataField(const QString& fieldName, const QString& value)
+{
+    QDomText domText = mDomDocument.createTextNode(value);
+    QDomElement newElem = mDomDocument.createElement(fieldName);
+    newElem.appendChild(domText);
+
+    QDomNodeList list = mDomDocument.elementsByTagName(fieldName);
+
+    if (list.count()) {
+        QDomNode node = list.at(0);
+        if (node.isElement()) {
+            QDomNode parent = node.parentNode();
+            parent.replaceChild(newElem,node);
+        }
+    }
+
+}
+
+const QDomDocument& BubbleData::document() const
+{
+    return mDomDocument;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbledata.h	Fri Jun 04 10:19:18 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:  Animated icon.
+*
+*/
+
+#ifndef BUBBLEDATA_H
+#define BUBBLEDATA_H
+
+#include <QObject>
+#include <QDomDocument>
+
+class BubbleData : public QObject
+{
+public:
+    BubbleData( QObject *parent = 0 );
+
+    void createDomFromFile(QIODevice *device);
+
+    // generic
+    QString dataField(const QString& fieldName);
+    void setDataField(const QString& fieldName, const QString& value);
+
+    // bubble related
+    QString dataField(const QString&  bubble, const QString& fieldName);
+    void setDataField(const QString&  bubble, const QString& fieldName, const QString& value);
+
+    const QDomDocument& document() const;
+
+private:
+    QDomElement bubbleElement(const QString&  bubble);
+
+private:
+    QDomDocument mDomDocument;
+};
+
+#endif // BUBBLEDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbletester.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TARGET = bubbletester
+TEMPLATE = app
+QT = core \
+    gui \
+    svg \
+    network \
+    xml
+SOURCES += main.cpp \
+    mainwindow.cpp \
+    bubbledata.cpp
+HEADERS += mainwindow.h \
+    bubbledata.h
+FORMS += mainwindow.ui
+RESOURCES += bubbletester.qrc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/bubbletester.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/" >
+        <file>testdata.xml</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/main.cpp	Fri Jun 04 10:19:18 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:  Animated icon.
+*
+*/
+
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+    w.start();
+    return a.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/mainwindow.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,184 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Animated icon.
+*
+*/
+
+#include <QLocalServer>
+#include <QLocalSocket>
+#include <QMessageBox>
+#include <QLabel>
+#include <QStatusBar>
+#include <QDomDocument>
+
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include "bubbledata.h"
+
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent),
+      ui(new Ui::MainWindow),
+      mServer(new QLocalServer(this)),
+      mClientConnection(0),
+      mStatusLabel(new QLabel(this)),
+      mBubbleId("1")
+{
+    ui->setupUi(this);
+    statusBar()->addWidget(mStatusLabel,1);
+
+    connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(bubbleChanged()) );
+    connect( ui->lineEdit, SIGNAL(editingFinished()), this, SLOT(updateName()) );
+    connect( ui->lineEdit_2, SIGNAL(editingFinished()), this, SLOT(updateNumber()) );
+    connect( ui->comboBox_2, SIGNAL(currentIndexChanged(int)), this, SLOT(updateState()) );
+    connect( ui->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(updateDivert(int)) );
+    connect( ui->checkBox_2, SIGNAL(stateChanged(int)) , this, SLOT(updateMute(int)) );
+
+    mDataModel = new BubbleData(this);
+
+    initUi();
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+    mServer->close();
+    delete mServer;
+}
+
+
+bool MainWindow::start()
+{
+    bool success = false;
+    if (!mServer->listen("bubbletestserver")) {
+        QMessageBox::critical( this,
+                               tr("Bubble Tester"),
+                               tr("Unable to start the server: %1.").arg(mServer->errorString()));
+        return success;
+    }
+
+    mStatusLabel->setText(tr("Server running"));
+
+    connect( mServer, SIGNAL(newConnection()), this, SLOT(clientConnected()));
+    success = true;
+    return success;
+}
+
+
+void MainWindow::clientConnected()
+{
+    if (mClientConnection) {
+        return;
+    }
+
+    // get the next pending connection
+    mClientConnection = mServer->nextPendingConnection();
+
+    mStatusLabel->setText(tr("Connected"));
+
+    connect(mClientConnection, SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
+}
+
+void MainWindow::clientDisconnected()
+{
+    mClientConnection = 0;
+    connect((QLocalSocket*)sender(), SIGNAL(disconnected()), (QLocalSocket*)sender(), SLOT(deleteLater()));
+    mStatusLabel->setText(tr("Disconnected"));
+}
+
+void MainWindow::sendData()
+{
+    QByteArray block;
+    QDataStream out(&block, QIODevice::WriteOnly);
+
+    out << mDataModel->document().toString();
+
+    if (mClientConnection) {
+        mClientConnection->write(block);
+    }
+}
+
+void MainWindow::initUi()
+{
+    ui->lineEdit->setText(mDataModel->dataField(mBubbleId,"name"));
+    ui->lineEdit_2->setText(mDataModel->dataField(mBubbleId,"number"));
+
+    QString state = mDataModel->dataField(mBubbleId,"state");
+    int index = ui->comboBox_2->findText(state);
+    ui->comboBox_2->setCurrentIndex(index);
+
+    QString divert = mDataModel->dataField(mBubbleId,"divert");
+    ui->checkBox->setChecked((divert=="On"));
+
+    QString mute = mDataModel->dataField("mute");
+    ui->checkBox_2->setChecked((mute=="On"));
+}
+
+void MainWindow::bubbleChanged()
+{
+    mBubbleId = ui->comboBox->currentText();
+    initUi();
+}
+
+void MainWindow::updateName()
+{
+    mDataModel->setDataField(mBubbleId,"name",ui->lineEdit->text());
+    sendData();
+}
+
+void MainWindow::updateNumber()
+{
+    mDataModel->setDataField(mBubbleId,"number",ui->lineEdit_2->text());
+    sendData();
+}
+
+void MainWindow::updateState()
+{
+    mDataModel->setDataField(mBubbleId,"state",ui->comboBox_2->currentText());
+    sendData();
+}
+
+void MainWindow::updateDivert(int state)
+{
+    if (!state) {
+        mDataModel->setDataField(mBubbleId,"divert","Off");
+    } else {
+        mDataModel->setDataField(mBubbleId,"divert","On");
+    }
+
+    sendData();
+}
+
+void MainWindow::updateMute(int state)
+{
+    if (!state) {
+        mDataModel->setDataField("mute","Off");
+    } else {
+        mDataModel->setDataField("mute","On");
+    }
+
+    sendData();
+}
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/mainwindow.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,69 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Animated icon.
+*
+*/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+
+namespace Ui
+{
+    class MainWindow;
+}
+
+class QLocalServer;
+class QLocalSocket;
+class QLabel;
+class BubbleData;
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+    bool start();
+
+private slots:
+    void clientConnected();
+    void clientDisconnected();
+
+    void bubbleChanged();
+    void updateName();
+    void updateNumber();
+    void updateState();
+    void updateDivert(int);
+    void updateMute(int);
+
+    void sendData();
+
+private:
+    void initUi();
+
+private:
+    Ui::MainWindow *ui;
+
+    QLocalServer *mServer;
+    QLocalSocket *mClientConnection;
+    QLabel       *mStatusLabel;
+    BubbleData   *mDataModel;
+    QString      mBubbleId;
+};
+
+#endif // MAINWINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/mainwindow.ui	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>397</width>
+    <height>277</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Bubble Tester</string>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <widget class="QComboBox" name="comboBox">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>20</y>
+      <width>51</width>
+      <height>22</height>
+     </rect>
+    </property>
+    <item>
+     <property name="text">
+      <string>1</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>2</string>
+     </property>
+    </item>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>20</y>
+      <width>41</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Bubble</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>60</y>
+      <width>46</width>
+      <height>14</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Name</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>60</y>
+      <width>301</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Gloria Andersson</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_3">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>100</y>
+      <width>46</width>
+      <height>14</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Number</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_2">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>100</y>
+      <width>301</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>+35850123456789</string>
+    </property>
+   </widget>
+   <widget class="QComboBox" name="comboBox_2">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>140</y>
+      <width>121</width>
+      <height>22</height>
+     </rect>
+    </property>
+    <item>
+     <property name="text">
+      <string>Idle</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Incoming</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Outgoing</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Waiting</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Active</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>OnHold</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Disconnected</string>
+     </property>
+    </item>
+   </widget>
+   <widget class="QLabel" name="label_4">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>140</y>
+      <width>46</width>
+      <height>14</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>State</string>
+    </property>
+   </widget>
+   <widget class="QCheckBox" name="checkBox">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>220</y>
+      <width>71</width>
+      <height>19</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Diverted</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_5">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>220</y>
+      <width>46</width>
+      <height>14</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Flags</string>
+    </property>
+   </widget>
+   <widget class="QCheckBox" name="checkBox_2">
+    <property name="geometry">
+     <rect>
+      <x>140</x>
+      <y>220</y>
+      <width>71</width>
+      <height>19</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Muted</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_6">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>180</y>
+      <width>46</width>
+      <height>14</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Type</string>
+    </property>
+   </widget>
+   <widget class="QComboBox" name="comboBox_3">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>180</y>
+      <width>121</width>
+      <height>22</height>
+     </rect>
+    </property>
+    <item>
+     <property name="text">
+      <string>Mobile</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Work</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Home</string>
+     </property>
+    </item>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>397</width>
+     <height>19</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusBar"/>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester/testdata.xml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xbel>
+<xbel version="1.0">
+    <mute>Off</mute>
+    <bubble id="1">
+        <name>Elvis Pelvis</name>
+        <number>12345</number>
+        <state>Idle</state>
+        <type>Mobile</type>
+        <divert>Off</divert>
+    </bubble>
+    <bubble id="2">
+        <name>Jim Morrison</name>
+        <number>67890</number>
+        <state>Idle</state>
+        <type>Mobile</type>
+        <divert>Off</divert>
+    </bubble>
+</xbel>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletestview.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,1119 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QDebug>
+#include <hbaction.h>
+#include <hbtoolbar.h>
+#include <bubblemanager2.h>
+#include <hbmenu.h>
+#include <hbmainwindow.h>
+
+#include "bubbletestview.h"
+#include "bubbletester.h"
+
+BubbleTestView::BubbleTestView(HbMainWindow& window, QGraphicsItem *parent) :
+    HbView (parent), mMainWindow(window), mMuted(0), mConfBubbleId(-1),
+    mProvideJoin(false)
+{
+    setFlags (QGraphicsItem::ItemIsFocusable);
+    setFocusPolicy (Qt::StrongFocus);
+    setTitle("BubbleTest2");
+    
+    // the widget under the test
+    mBubbleManager = new BubbleManager (this);
+    setWidget(mBubbleManager);
+
+    // init toolbar
+    createToolBarActions();
+    //toolBar()->setOrientation(mMainWindow.orientation());
+    connect( &mMainWindow,SIGNAL(orientationChanged(Qt::Orientation)),
+             this,SLOT(handleOrientationChange(Qt::Orientation)));
+    
+    // init menu
+    createMenuActions();
+
+    // create actions for push buttons
+    createBubbleActions();
+
+    // tester
+    mBubbleTester = new BubbleTester();
+    connect(mBubbleTester,SIGNAL(dataChanged()),this,SLOT(handleTesterDataChanged()));
+    mBubbleTester->connectToServer();
+
+    // create state map
+    mStateMap.insert("Idle", BubbleManagerIF::None );
+    mStateMap.insert("Incoming", BubbleManagerIF::Incoming );
+    mStateMap.insert("Active", BubbleManagerIF::Active );
+    mStateMap.insert("Disconnected", BubbleManagerIF::Disconnected );
+    mStateMap.insert("Outgoing", BubbleManagerIF::Outgoing );
+    mStateMap.insert("Waiting", BubbleManagerIF::Waiting );
+    mStateMap.insert("OnHold", BubbleManagerIF::OnHold );
+    // create label map
+    mLabelMap.insert("Idle", "" );
+    mLabelMap.insert("Incoming", "calling" );
+    mLabelMap.insert("Active", "" );
+    mLabelMap.insert("Disconnected", "disconnected" );
+    mLabelMap.insert("Outgoing", "Calling" );
+    mLabelMap.insert("Waiting", "waiting" );
+    mLabelMap.insert("OnHold", "on hold" );
+}
+
+BubbleTestView::~BubbleTestView()
+{
+    toolBar()->clearActions();
+    delete mBubbleTester;
+}
+
+void BubbleTestView::keyPressEvent(QKeyEvent *event)
+{
+    switch( event->key() )
+    {
+    case '1': // create incoming call
+    {
+        if ( mEmergencyCall->isChecked() ) {
+            return; // not supported
+        }
+
+        if ( mCalls.count() == 0 ) {
+            bubbleManager().startChanges();
+            int bubbleId = bubbleManager().createCallHeader();
+            setBubbleData(bubbleId, BubbleManager::Incoming);
+            setBubbleActions(bubbleId, BubbleManager::Incoming);
+            bubbleManager().endChanges();
+            
+            // store this call
+            TestCall call;
+            call.bubbleId = bubbleId;
+            call.callState = BubbleManager::Incoming;
+            mCalls.append( call );
+
+            updateToolBarActions();
+
+        } else if ( !initializingCallExists() ) {
+            // waiting call
+            bubbleManager().startChanges();
+            int bubbleId = bubbleManager().createCallHeader();
+            setBubbleData(bubbleId, BubbleManager::Waiting);
+            setBubbleActions( bubbleId, BubbleManager::Waiting );
+            bubbleManager().setExpandedConferenceCallHeader(false);
+            bubbleManager().endChanges();
+
+            // store this call
+            TestCall call;
+            call.bubbleId = bubbleId;
+            call.callState = BubbleManager::Waiting;
+            mCalls.append( call );
+
+            setExpandActions();
+            updateToolBarActions();
+        }
+        break;
+    }
+    
+    case '2': // create outgoing call
+    {
+        if ( !initializingCallExists() && (callCount()<3) ) {
+            bubbleManager().startChanges();
+            int bubbleId = bubbleManager().createCallHeader();
+            setBubbleData(bubbleId, BubbleManager::Outgoing);
+            setBubbleActions( bubbleId, BubbleManager::Outgoing );
+            bubbleManager().endChanges();
+
+            // store this call
+            TestCall call;
+            call.bubbleId = bubbleId;
+            call.callState = BubbleManager::Outgoing;
+            mCalls.append( call );
+
+            bubbleManager().setBubbleSelectionDisabled(false);
+            updateToolBarActions();
+       }
+       break;
+    }
+    
+    case '3': // connect
+    {
+        int i,j;
+
+        if (callIndexByState(BubbleManagerIF::Outgoing, i)) {
+            // outgoing to alerting
+            bubbleManager().startChanges();
+            setBubbleData(mCalls[i].bubbleId, BubbleManager::Alerting);
+            bubbleManager().endChanges();
+            mCalls[i].callState = BubbleManager::Alerting;
+            return;
+        }
+
+        if (callCount()==3) {
+            // replace active call
+            bubbleManager().startChanges();
+            Q_ASSERT(callIndexByState(BubbleManagerIF::Active, j));
+            bubbleManager().removeCallHeader(mCalls[j].bubbleId);
+            mCalls.removeAt(j);
+            Q_ASSERT(callIndexByState(BubbleManagerIF::Waiting, i));
+            setBubbleData(mCalls[i].bubbleId, BubbleManager::Active);
+            setBubbleActions(mCalls[i].bubbleId, BubbleManager::Active);
+            bubbleManager().endChanges();
+            mCalls[i].callState = BubbleManager::Active;
+            setExpandActions();
+            updateToolBarActions();
+            bubbleManager().setBubbleSelectionDisabled(false);
+        } else if (callIndexByState(BubbleManagerIF::Incoming, i)||
+                   callIndexByState(BubbleManagerIF::Alerting, i)||
+                   callIndexByState(BubbleManagerIF::Waiting, i)) {
+            bubbleManager().startChanges();
+            setBubbleData(mCalls[i].bubbleId, BubbleManager::Active);
+            mProvideJoin = true; // bit hackish
+            setBubbleActions(mCalls[i].bubbleId, BubbleManager::Active);
+            mProvideJoin = false;
+            if (callIndexByState(BubbleManagerIF::Active, j)) {
+                setBubbleData(mCalls[j].bubbleId, BubbleManager::OnHold);
+                setBubbleActions(mCalls[j].bubbleId, BubbleManager::OnHold);
+                mCalls[j].callState = BubbleManager::OnHold;
+            }
+            bubbleManager().endChanges();
+            mCalls[i].callState = BubbleManager::Active;
+            setExpandActions();
+            updateToolBarActions();
+            bubbleManager().setBubbleSelectionDisabled(false);
+        }
+        break;
+    }
+
+    case '4': // hold
+    {
+        int i,j;
+
+        if (bubbleManager().isConferenceExpanded()) {
+            toggleHoldConference();
+        } else if (callCount()==1) {
+            // toggle hold
+            bubbleManager().startChanges();
+            if (callIndexByState(BubbleManagerIF::Active, i)||
+                callIndexByState(BubbleManagerIF::OnHold, i)) {
+                BubbleManagerIF::PhoneCallState state =
+                    mCalls[i].callState == BubbleManagerIF::Active ?
+                    BubbleManagerIF::OnHold : BubbleManagerIF::Active;
+
+                setBubbleData(mCalls[i].bubbleId, state);
+                setBubbleActions(mCalls[i].bubbleId, state );
+                mCalls[i].callState=state;
+            }
+            bubbleManager().endChanges();
+            updateToolBarActions();
+        } else if (callIndexByState(BubbleManagerIF::Active, i)) {
+            // swap calls
+            bubbleManager().startChanges();
+            if (callIndexByState(BubbleManagerIF::OnHold, j)) {
+                setBubbleData(mCalls[j].bubbleId, BubbleManager::Active);
+                setBubbleActions(mCalls[j].bubbleId, BubbleManager::Active );
+                mCalls[j].callState=BubbleManager::Active;
+            }
+            setBubbleData(mCalls[i].bubbleId, BubbleManager::OnHold);
+            setBubbleActions(mCalls[i].bubbleId, BubbleManager::OnHold );
+            mCalls[i].callState=BubbleManager::OnHold;
+            if (conferenceCallExists()) {
+                bubbleManager().setExpandedConferenceCallHeader(
+                    bubbleIdByState(BubbleManager::Active)==mConfBubbleId);
+            }
+            bubbleManager().endChanges();
+            setExpandActions();
+            updateToolBarActions();
+        } else if (callIndexByState(BubbleManagerIF::Waiting, i)) {
+            // activate held call
+            bubbleManager().startChanges();
+            if (callIndexByState(BubbleManagerIF::OnHold, j)) {
+                setBubbleData(mCalls[j].bubbleId, BubbleManager::Active);
+                setBubbleActions(mCalls[j].bubbleId, BubbleManager::Active );
+                mCalls[j].callState=BubbleManager::Active;
+            }
+            bubbleManager().endChanges();
+            setExpandActions();
+            updateToolBarActions();
+        }
+        break;
+    }
+    
+    case '5': // disconnect
+    {
+        int i,j;
+
+        if (callIndexByState(BubbleManagerIF::Disconnected, i)) {
+            bubbleManager().startChanges();
+            bubbleManager().removeCallHeader(mCalls[i].bubbleId);
+            // remove call
+            mCalls.removeAt(i);
+
+            if (mMuted) {
+                setMuted(); // unmute
+            }
+
+            bool expand = true;
+            QListIterator<TestCall> calls(mCalls);
+            while(calls.hasNext()) {
+                TestCall call = calls.next();
+                  if (!call.isConf && !call.isInConf) {
+                      expand = false;
+                  }
+            }
+            bubbleManager().setExpandedConferenceCallHeader(expand);
+            bubbleManager().endChanges();
+
+            updateToolBarActions();
+            return;
+        }
+
+        if (callCount()) {
+            int expanded = bubbleManager().expandedBubble();
+            callIndexByBubbleId(expanded,i);
+            bubbleManager().startChanges();
+
+            if (mCalls.at(i).isConf) {
+                bubbleManager().removeConference();
+                mConfBubbleId = -1;
+                mCalls.removeAt(i);
+
+                QMutableListIterator<TestCall> calls(mCalls);
+                j=0;
+                while(calls.hasNext()) {                  
+                    if (mCalls[j].isInConf) {
+                        bubbleManager().removeCallHeader(mCalls[j].bubbleId);
+                        mCalls.removeAt(j);
+                    } else {
+                        j++;
+                    }
+                    calls.next();
+                }
+            } else {
+                setBubbleData(mCalls[i].bubbleId, BubbleManager::Disconnected);
+                setBubbleActions(mCalls[i].bubbleId, BubbleManager::Disconnected);
+                mCalls[i].callState=BubbleManager::Disconnected;
+            }
+            bubbleManager().endChanges();
+            updateToolBarActions();
+        }
+        break;
+    }
+    
+    case '7': // create/join conference
+    {
+        int activeCallId = bubbleIdByState(BubbleManagerIF::Active);
+        int heldCallId = bubbleIdByState(BubbleManagerIF::OnHold);
+        int i;
+
+        if (conferenceCallExists()&&(activeCallId!=-1)) {
+            int j;
+            callIndexByBubbleId(mConfBubbleId,j);
+            callIndexByBubbleId(activeCallId,i);
+            mCalls[i].isInConf = true;
+            mCalls[i].callState = BubbleManagerIF::Active;
+            mCalls[j].callState = BubbleManagerIF::Active;
+            bubbleManager().startChanges();
+            bubbleManager().addRowToConference(activeCallId);
+            bubbleManager().setExpandedConferenceCallHeader(true);
+            bubbleManager().setState(mConfBubbleId,BubbleManagerIF::Active);
+            setBubbleActions(mConfBubbleId,BubbleManagerIF::Active);
+            bubbleManager().endChanges();            
+        } else if (activeCallId!=-1 && heldCallId!=-1) {
+            bubbleManager().startChanges();
+            mConfBubbleId = bubbleManager().createConference(heldCallId, activeCallId);
+            bubbleManager().setExpandedConferenceCallHeader(true);
+            bubbleManager().setState(mConfBubbleId,BubbleManagerIF::Active);
+            bubbleManager().setCli(mConfBubbleId,"Conference call",Qt::ElideRight);
+            if (mCallTimer->isChecked()) {
+                bubbleManager().setCallTime( mConfBubbleId, "0:00" );
+            }
+            bubbleManager().addAction(mConfBubbleId, mHold);
+            bubbleManager().addAction(mConfBubbleId, mEndConference);
+            bubbleManager().clearParticipantListActions();
+            bubbleManager().addParticipantListAction(mPrivate);
+            bubbleManager().addParticipantListAction(mDrop);
+            bubbleManager().setState(heldCallId,BubbleManagerIF::Active);
+            bubbleManager().setCallFlag(mConfBubbleId, BubbleManager::NoCiphering,
+                                        mCipheringOff->isChecked());
+            bubbleManager().endChanges();
+
+            callIndexByBubbleId(activeCallId,i);
+            mCalls[i].isInConf = true;
+            mCalls[i].callState = BubbleManagerIF::Active;
+            callIndexByBubbleId(heldCallId,i);
+            mCalls[i].isInConf = true;
+            mCalls[i].callState = BubbleManagerIF::Active;
+
+            // store the call
+            TestCall call;
+            call.bubbleId = mConfBubbleId;
+            call.callState = BubbleManagerIF::Active;
+            call.isConf = true;
+            call.isInConf = false;
+            mCalls.append(call);
+        }
+        break;
+    }
+
+    case '9': // conference shortcut
+    {
+        conferenceWizard();
+        break;
+    }
+
+    case '0': // updates
+    case Qt::Key_Space: // updates
+    {
+        if (mCallTimer->isChecked()) {
+            foreach (TestCall call, mCalls) {
+                if ( call.callState == BubbleManager::Active ||
+                     call.callState == BubbleManager::OnHold ) {
+                    bubbleManager().updateCallTime(call.bubbleId,"0:01");
+                }
+            }
+        }
+    }
+    
+    default:
+    break;
+    }
+}
+
+bool BubbleTestView::initializingCallExists() const
+{
+    bool result = false;
+    foreach(TestCall call, mCalls) {
+        if (call.callState>=BubbleManagerIF::Incoming) {
+            result = true;
+            break;
+        }
+    }
+
+    return result;
+}
+
+bool BubbleTestView::conferenceCallExists() const
+{
+    bool result = false;
+    QListIterator<TestCall> i(mCalls);
+    while (i.hasNext()) {
+        if (i.next().isConf) {
+            result = true;
+            break;
+        }
+    }
+    return result;
+}
+
+int BubbleTestView::callCount() const
+{
+    int count = 0;
+    foreach(TestCall call, mCalls) {
+        if (!call.isInConf) {
+            count++;
+        }
+    }
+
+    return count;
+}
+
+bool BubbleTestView::callIndexByState(
+    BubbleManagerIF::PhoneCallState state, int& index)
+{
+    bool result = false;
+    int i = 0;
+    foreach(TestCall call, mCalls) {
+        if (call.callState==state && !call.isInConf) {
+            result = true;
+            index = i;
+            break;
+        }
+        i++;
+    }
+
+    return result;
+}
+
+bool BubbleTestView::callIndexByBubbleId(int bubbleId, int& index)
+{
+    bool result = false;
+    int i = 0;
+    foreach(TestCall call, mCalls) {
+        if (call.bubbleId==bubbleId) {
+            result = true;
+            index = i;
+            break;
+        }
+        i++;
+    }
+
+    return result;
+}
+
+BubbleManagerIF& BubbleTestView::bubbleManager()
+{
+    return *mBubbleManager;
+}
+
+void BubbleTestView::setBubbleData(int bubble, BubbleManagerIF::PhoneCallState state)
+{
+    bubbleManager().setState(bubble, state);
+
+    switch (state) {
+    case BubbleManager::Incoming:
+        {
+        if ( mContactName->isChecked() ) {
+            bubbleManager().setCli(bubble, "Gloria Andersson", Qt::ElideRight);
+            bubbleManager().setSecondaryCli( bubble, "+35850123456789" );
+            mPhoneNumber.clear();
+        } else {
+            mPhoneNumber.append("+35850123456789");
+            bubbleManager().setCli(bubble, mPhoneNumber, Qt::ElideRight);
+        }
+
+        setCallObject(bubble, ":resources/contactpic.jpg");
+        bubbleManager().setNumberType(bubble, BubbleManager::Mobile);
+        bubbleManager().setCallFlag(bubble, BubbleManager::Diverted, mCallDivert->isChecked());
+        bubbleManager().setCallFlag(bubble, BubbleManager::NoCiphering, mCipheringOff->isChecked());
+        bubbleManager().setLabel(bubble, "calling", Qt::ElideRight);
+        break;
+        }
+
+    case BubbleManager::Waiting:
+        {
+        if ( mContactName->isChecked() ) {
+            if (callCount()==2) {
+                bubbleManager().setCli(bubble, "Mary Poppins", Qt::ElideRight);
+                bubbleManager().setSecondaryCli(bubble, "+35840987654321");
+            } else {
+                bubbleManager().setCli(bubble, "John Doe", Qt::ElideRight);
+                bubbleManager().setSecondaryCli(bubble, "+35840987654321");
+            }
+            mPhoneNumber.clear();
+        } else {
+            if (callCount()==2) {
+                mPhoneNumber.append("+35850232323232");
+            } else {
+                mPhoneNumber.append("+35840987654321");
+            }
+            bubbleManager().setCli(bubble, mPhoneNumber, Qt::ElideRight);
+        }
+        setCallObject(bubble, ":resources/contactpic3.png");
+        bubbleManager().setNumberType(bubble, BubbleManager::Mobile);
+        bubbleManager().setCallFlag(bubble, BubbleManager::Diverted, mCallDivert->isChecked());
+        bubbleManager().setCallFlag(bubble, BubbleManager::NoCiphering, mCipheringOff->isChecked());
+        bubbleManager().setLabel(bubble, "waiting", Qt::ElideRight);
+        break;
+        }
+
+    case BubbleManager::Outgoing:
+        {
+        bubbleManager().setCallFlag(bubble, BubbleManager::NoCiphering, mCipheringOff->isChecked());
+
+        if (mEmergencyCall->isChecked()) {
+            bubbleManager().setCli( bubble, "emergency call", Qt::ElideRight );
+            bubbleManager().setLabel( bubble, "Attempting", Qt::ElideRight );
+        } else {
+            if ( mContactName->isChecked() ) {
+                bubbleManager().setCli( bubble, "Bart Simpson", Qt::ElideRight );
+                bubbleManager().setSecondaryCli( bubble, "+35890987654321" );
+                mPhoneNumber.clear();
+            } else {
+                mPhoneNumber.append("+35890987654321");
+                bubbleManager().setCli( bubble, mPhoneNumber, Qt::ElideRight );
+            }
+            setCallObject(bubble, ":resources/contactpic2.jpg");
+            bubbleManager().setLabel( bubble, "Calling", Qt::ElideRight );
+        }
+        break;
+        }
+
+    case BubbleManager::Alerting:
+        {
+        if ( mPhoneNumber.length() ) {
+            QString cli("Call %1");
+            QString index;
+            index.setNum(bubble+1);
+            cli = cli.arg(index);
+            bubbleManager().setCli( bubble, cli, Qt::ElideRight );
+            bubbleManager().setSecondaryCli( bubble, mPhoneNumber );
+            mPhoneNumber.clear();
+        }
+
+        if ( mEmergencyCall->isChecked() ) {
+            bubbleManager().setCli( bubble, "Emergency call", Qt::ElideRight );
+        }
+        break;
+        }
+
+    case BubbleManager::Active:
+        {
+        if ( mPhoneNumber.length() && bubble!=mConfBubbleId ) {
+            QString cli("Call %1");
+            QString index;
+            index.setNum(bubble+1);
+            cli = cli.arg(index);
+            bubbleManager().setCli( bubble, cli, Qt::ElideRight );
+            bubbleManager().setSecondaryCli( bubble, mPhoneNumber );
+            mPhoneNumber.clear();
+        }
+
+        if ( mCallTimer->isChecked() ) {
+            bubbleManager().setCallTime( bubble, "0:00" );
+        }
+        break;
+        }
+
+    case BubbleManager::OnHold:
+        {
+        bubbleManager().setLabel( bubble, "on hold", Qt::ElideRight );
+        break;
+        }
+
+    case BubbleManager::Disconnected:
+        {
+        bubbleManager().setLabel( bubble, "disconnected", Qt::ElideRight );
+        break;
+        }
+
+    default:
+        {
+        break;
+        }
+    }
+}
+
+void BubbleTestView::setCallObject(int bubble, const QString& filename)
+{
+    if (mContactPicture->isChecked()) {
+        bubbleManager().setCallObjectImage(bubble, filename);
+    } else {
+        bubbleManager().setCallObjectFromTheme(bubble);
+    }
+}
+
+void BubbleTestView::setBubbleActions(int bubble, BubbleManagerIF::PhoneCallState state )
+{
+    if (bubble==mConfBubbleId) {
+        // check, if all call are in conference
+        bool swapButton = false;
+        QListIterator<TestCall> calls(mCalls);
+        while(calls.hasNext()) {
+            TestCall call = calls.next();
+            if (!call.isConf && !call.isInConf) {
+                swapButton = true;
+            }
+        }
+
+        bubbleManager().clearActions(bubble);
+
+        if (swapButton) {
+            bubbleManager().addAction(bubble, mSwap);
+        } else {
+            if (state == BubbleManager::OnHold)
+                bubbleManager().addAction(bubble, mUnhold);
+            else
+                bubbleManager().addAction(bubble, mHold);
+        }
+
+        bubbleManager().addAction(bubble, mEndConference);
+        return;
+    }
+
+    bubbleManager().clearActions(bubble);
+
+    switch (state) {
+    case BubbleManager::Incoming:
+    case BubbleManager::Waiting:
+        {
+        if (callCount()==2) {
+            bubbleManager().addAction( bubble, mReplace );
+        } else {
+            bubbleManager().addAction( bubble, mAnswer );
+            bubbleManager().addAction( bubble, mReject );
+        }
+        break;
+        }
+    case BubbleManager::Outgoing:
+    case BubbleManager::Alerting: // flow through
+        {
+        bubbleManager().addAction( bubble, mEndCall );
+        break;
+        }
+    case BubbleManager::OnHold:
+        {
+        bubbleManager().addAction( bubble, mUnhold );
+        bubbleManager().addAction( bubble, mEndCall );
+        }
+        break;
+    default: // Active call
+        {
+        HbAction* action;
+
+        if (!mEmergencyCall->isChecked()) {
+            int i;
+            if ( (mCalls.count()>1 && !callIndexByState(BubbleManagerIF::Waiting,i))
+                  || (mCalls.count()> 1 && mProvideJoin) ) {
+                action = mJoin;
+            } else {
+                action = mHold;
+            }
+
+            bubbleManager().addAction( bubble, action );
+        }
+                    
+        bubbleManager().addAction( bubble, mEndCall );
+        break;
+        }
+    }
+}
+
+void BubbleTestView::setExpandActions()
+{
+    if (callCount() >= 2) {
+        int i;
+        int j;
+        int heldBubble = -1;
+        if (callIndexByState(BubbleManagerIF::Active,i) &&
+            callIndexByState(BubbleManagerIF::OnHold,j)) {
+            heldBubble = mCalls[j].bubbleId;
+            bubbleManager().setExpandAction(heldBubble, mSwap);
+        } else if (callIndexByState(BubbleManagerIF::Waiting,i) &&
+                   callIndexByState(BubbleManagerIF::OnHold,j)) {
+            heldBubble = mCalls[j].bubbleId;
+            bubbleManager().setExpandAction(heldBubble, mUnhold);
+        }
+
+        // for rest set update toolbar action
+        QListIterator<TestCall> calls(mCalls);
+        while (calls.hasNext()) {
+            TestCall call = calls.next();
+            if (!call.isInConf && call.bubbleId!=heldBubble) {
+                bubbleManager().setExpandAction(call.bubbleId, mUpdateUiControls);
+            }
+        }
+    }
+}
+
+void BubbleTestView::answerCall()
+{
+    QKeyEvent event( QEvent::KeyPress, '3', 0 );
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::endCall()
+{
+    QKeyEvent event( QEvent::KeyPress, '5', 0 );
+    keyPressEvent(&event);
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::endConferenceCall()
+{
+    QKeyEvent event( QEvent::KeyPress, '5', 0 );
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::rejectCall()
+{
+    QKeyEvent event( QEvent::KeyPress, '5', 0 );
+    keyPressEvent(&event);
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::toggleHold()
+{
+    if (callCount() > 1) {
+        QTimer::singleShot(1000, this, SLOT(toggleHoldDelayed()));
+    } else {
+        QKeyEvent event( QEvent::KeyPress, '4', 0 );
+        keyPressEvent(&event);
+    }
+}
+
+void BubbleTestView::toggleHoldDelayed()
+{
+    QKeyEvent event( QEvent::KeyPress, '4', 0 );
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::createIncomingCall()
+{
+    QKeyEvent event( QEvent::KeyPress, '1', 0 );
+    keyPressEvent(&event);
+    setFocus(); // hack because toolbar steals the focus
+}
+
+void BubbleTestView::createOutgoingCall()
+{
+    QKeyEvent event( QEvent::KeyPress, '2', 0 );
+    keyPressEvent(&event);
+    setFocus(); // hack because toolbar steals the focus
+}
+
+void BubbleTestView::setMuted()
+{
+    mMuted = !mMuted;
+    updateToolBarActions();
+    bubbleManager().setPhoneMuted( mMuted );
+    setFocus(); // hack because toolbar steals the focus
+}
+
+void BubbleTestView::joinToConference()
+{
+    QKeyEvent event( QEvent::KeyPress, '7', 0 );
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::handlePrivate()
+{
+    int i;
+    qDebug() << "Handle private";
+    int selection = bubbleManager().selectionIdInConference();
+    qDebug() << "bubble:" << selection;
+    bubbleManager().startChanges();
+    if (bubbleManager().conferenceRowCount()>2) {
+        bubbleManager().removeRowFromConference(selection);
+        bubbleManager().setExpandedConferenceCallHeader(false);
+        callIndexByBubbleId(selection,i);
+        mCalls[i].isInConf = false;
+        setBubbleActions(mCalls[i].bubbleId,BubbleManagerIF::Active);
+        setBubbleData(mConfBubbleId,BubbleManagerIF::OnHold);
+        setExpandActions();
+    } else {
+        bubbleManager().removeConference();
+        callIndexByBubbleId(mConfBubbleId,i);
+        mCalls.removeAt(i);
+        mConfBubbleId = -1;
+        callIndexByBubbleId(selection,i);
+        int held = (i==0) ? 1 : 0;
+        setBubbleActions(selection,BubbleManagerIF::Active);
+        setBubbleData(selection,BubbleManagerIF::Active);
+        setBubbleActions(held,BubbleManagerIF::OnHold);
+        setBubbleData(held,BubbleManagerIF::OnHold);
+        mCalls[0].isInConf = false;
+        mCalls[1].isInConf = false;
+        setExpandActions();
+    }
+    bubbleManager().endChanges();
+}
+
+void BubbleTestView::handleDrop()
+{
+    int i;
+    qDebug() << "Handle drop";
+    int selection = bubbleManager().selectionIdInConference();
+    qDebug() << "bubble:" << selection;
+    bubbleManager().startChanges();
+    if (bubbleManager().conferenceRowCount()>2) {
+        bubbleManager().removeRowFromConference(selection);
+        bubbleManager().removeCallHeader(selection);
+        callIndexByBubbleId(selection,i);
+        mCalls.removeAt(i);
+    } else {
+        bubbleManager().removeConference();
+        callIndexByBubbleId(mConfBubbleId,i);
+        mCalls.removeAt(i);
+        mConfBubbleId = -1;
+        bubbleManager().removeCallHeader(selection);
+        callIndexByBubbleId(selection,i);
+        mCalls.removeAt(i);
+        mCalls[0].isInConf = false;
+        setBubbleActions(mCalls[0].bubbleId,BubbleManagerIF::Active);
+        setExpandActions();
+    }
+    bubbleManager().endChanges();
+}
+
+void BubbleTestView::replaceActiveCall()
+{
+    QKeyEvent event( QEvent::KeyPress, '3', 0 );
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::updateUiControls()
+{
+    if (conferenceCallExists()) {
+        bubbleManager().startChanges();
+        bubbleManager().setExpandedConferenceCallHeader(
+            bubbleManager().expandedBubble()==mConfBubbleId );
+        bubbleManager().endChanges();
+    }
+
+    updateToolBarActions();
+}
+
+void BubbleTestView::createToolBarActions()
+{
+    mCallIn = new HbAction("Call in", this);
+    connect( mCallIn, SIGNAL(triggered()), this, SLOT(createIncomingCall()), Qt::QueuedConnection );
+
+    mCallOut = new HbAction("Call out", this);
+    connect( mCallOut, SIGNAL(triggered()), this, SLOT(createOutgoingCall()), Qt::QueuedConnection );
+
+    mMute = new HbAction(HbIcon("qtg_mono_mic_mute"), "", this);
+    connect( mMute, SIGNAL(triggered()), this, SLOT(setMuted()), Qt::QueuedConnection );
+
+    mUnmute = new HbAction(HbIcon("qtg_mono_mic_unmute"), "", this);
+    connect( mUnmute, SIGNAL(triggered()), this, SLOT(setMuted()), Qt::QueuedConnection );
+
+    // not connected to anywhere
+    mActivateLoudspeaker = new HbAction(HbIcon("qtg_mono_speaker"), "", this);
+    mActivateHandset = new HbAction(HbIcon("qtg_mono_mobile"), "", this);
+    mSendMessage = new HbAction(HbIcon("qtg_mono_send"), "", this);
+    mSilence = new HbAction(HbIcon("qtg_mono_speaker_off"), "", this);
+    mOpenDialer = new HbAction(HbIcon("qtg_mono_dialer"), "", this);
+    mOpenContacts = new HbAction(HbIcon("qtg_mono_contacts"), "", this);
+
+    updateToolBarActions();
+}
+
+void BubbleTestView::createMenuActions()
+{
+    // HbMenu* typeMenu = menu()->addMenu("Call type"); current submenu layout sucks
+    menu()->addAction("Switch orientation",this,SLOT(switchOrientation()));
+    mCallDivert = menu()->addAction("Diverted call");
+    mCallTimer = menu()->addAction("Call timer");
+    mContactName = menu()->addAction("Contact name");
+    mContactPicture = menu()->addAction("Contact picture");
+    mCipheringOff = menu()->addAction("Ciphering off");
+    mEmergencyCall = menu()->addAction( "Emergency call" );    
+    HbAction* exit = menu()->addAction( "Exit" );
+    mCallDivert->setCheckable(true);
+    mCallTimer->setCheckable(true);
+    mContactPicture->setCheckable(true);
+    mContactName->setCheckable(true);
+    mCipheringOff->setCheckable(true);
+    mEmergencyCall->setCheckable(true);
+    connect( exit, SIGNAL(triggered()), qApp, SLOT(quit()) );
+}
+
+void BubbleTestView::updateToolBarActions()
+{
+    toolBar()->clearActions();
+
+    if (!mCalls.count()) {
+        toolBar()->addAction(mCallIn);
+        toolBar()->addAction(mCallOut);
+        return;
+    }
+
+    int bubble = bubbleManager().expandedBubble();
+    int i;
+    callIndexByBubbleId(bubble,i);
+    int state = mCalls[i].callState;
+
+    if ( state == BubbleManagerIF::Incoming ||
+         state == BubbleManagerIF::Waiting ) {
+        toolBar()->addAction(mSendMessage);
+        toolBar()->addAction(mSilence);
+    } else {
+        toolBar()->addAction(mOpenDialer);
+        if (!mMuted) {
+            toolBar()->addAction(mMute);
+        } else if (mMuted) {
+            toolBar()->addAction(mUnmute);
+        }
+        toolBar()->addAction(mActivateLoudspeaker);
+        toolBar()->addAction(mOpenContacts);
+    }
+}
+
+void BubbleTestView::createBubbleActions()
+{
+    mAnswer = new HbAction( HbIcon("qtg_mono_call"),"Answer", this);
+    mAnswer->setSoftKeyRole(QAction::PositiveSoftKey);
+    connect( mAnswer, SIGNAL( triggered() ), this, SLOT( answerCall() ) );
+
+    mReject= new HbAction( HbIcon("qtg_mono_reject_call"),"Reject", this);
+    mReject->setSoftKeyRole(QAction::NegativeSoftKey);
+    connect( mReject, SIGNAL( triggered() ), this, SLOT( rejectCall() ) );
+
+    mHold = new HbAction( HbIcon("qtg_mono_hold_call"),"Hold", this);
+    connect( mHold, SIGNAL( triggered() ), this, SLOT( toggleHold() ) );
+
+    mUnhold = new HbAction( HbIcon("qtg_mono_call"),"Activate", this);
+    connect( mUnhold, SIGNAL( triggered() ), this, SLOT( toggleHold() ) );
+
+    mSwap = new HbAction( HbIcon("qtg_mono_hold_call"),"Swap", this);
+    connect( mSwap, SIGNAL( triggered() ), this, SLOT( toggleHold() ) );
+
+    mEndCall = new HbAction(HbIcon("qtg_mono_end_call"),"End call", this);
+    mEndCall->setSoftKeyRole(QAction::NegativeSoftKey);
+    connect( mEndCall, SIGNAL( triggered() ), this, SLOT( endCall() ) );
+
+    mEndConference = new HbAction(HbIcon("qtg_mono_end_all_call"),"End conference", this);
+    mEndConference->setSoftKeyRole(QAction::NegativeSoftKey);
+    connect( mEndConference, SIGNAL( triggered() ), this, SLOT( endConferenceCall() ) );
+
+    mJoin = new HbAction(HbIcon("qtg_mono_join_call"),"Join", this);
+    connect( mJoin, SIGNAL( triggered() ), this, SLOT(joinToConference()) );
+
+    mPrivate = new HbAction(HbIcon("qtg_mono_private_call"),"Private", this);
+    connect( mPrivate, SIGNAL( triggered() ), this, SLOT(handlePrivate()) );
+
+    mDrop = new HbAction(HbIcon("qtg_mono_drop_call"),"Drop", this);
+    connect( mDrop, SIGNAL( triggered() ), this, SLOT(handleDrop()) );
+
+    mReplace = new HbAction(HbIcon("qtg_mono_replace_call"),"Replace", this);
+    connect( mReplace, SIGNAL( triggered() ), this, SLOT(replaceActiveCall()) );
+
+    mUpdateUiControls = new HbAction(QString(), this);
+    connect( mUpdateUiControls, SIGNAL(triggered()), this, SLOT(updateUiControls()) );
+}
+
+int BubbleTestView::bubbleIdByState(BubbleManagerIF::PhoneCallState state)
+{
+    int bubbleId=-1;
+    foreach(TestCall call, mCalls) {
+        if ((call.callState==state) && !call.isInConf) {
+            bubbleId = call.bubbleId;
+            break;
+        }
+    }
+
+    return bubbleId;
+}
+
+void BubbleTestView::conferenceWizard() {
+    bubbleManager().startChanges();
+
+    for (int i=0; i<5; i++) {
+        sendKeyEvent('1');
+        sendKeyEvent('3');
+        sendKeyEvent('7');
+    }
+
+    bubbleManager().endChanges();
+}
+
+void BubbleTestView::sendKeyEvent(int key)
+{
+    QKeyEvent event( QEvent::KeyPress, key, 0 );
+    keyPressEvent(&event);
+}
+
+void BubbleTestView::switchOrientation()
+{
+    if (mMainWindow.orientation()==Qt::Vertical) {
+        mMainWindow.setOrientation(Qt::Horizontal);
+
+    } else {
+        mMainWindow.setOrientation(Qt::Vertical);
+    }
+}
+
+void BubbleTestView::handleOrientationChange(Qt::Orientation orientation)
+{
+    if (orientation==Qt::Horizontal) {
+        toolBar()->setOrientation(Qt::Horizontal);
+    }
+
+    mBubbleManager->handleOrientationChange(orientation);
+}
+
+void BubbleTestView::toggleHoldConference()
+{
+    int i;
+    if (callIndexByBubbleId(mConfBubbleId, i) ) {
+        BubbleManagerIF::PhoneCallState state =
+            (mCalls[i].callState == BubbleManagerIF::Active) ?
+            BubbleManagerIF::OnHold : BubbleManagerIF::Active;
+        bubbleManager().startChanges();
+        setBubbleData(mCalls[i].bubbleId, state);
+        setBubbleActions(mCalls[i].bubbleId, state );
+        qDebug() << "toggleHoldConference:" << state;
+        mCalls[i].callState=state;
+        bubbleManager().endChanges();
+        // update participants
+        QTimer::singleShot(500, this, SLOT(toggleConferenceHoldDelayed()));
+    }
+}
+
+void BubbleTestView::toggleConferenceHoldDelayed()
+{
+    int i;
+    callIndexByBubbleId(mConfBubbleId, i);
+    BubbleManagerIF::PhoneCallState confState =
+        (BubbleManagerIF::PhoneCallState)mCalls[i].callState;
+    qDebug() << "toggleConferenceHoldDelayed state:" << confState;
+
+    QListIterator<TestCall> calls(mCalls);
+    int j=0;
+    while(calls.hasNext()) {
+        TestCall call = calls.next();
+        qDebug() << "toggleConferenceHoldDelayed callState:" << call.callState;
+        if (call.isInConf && call.callState!=confState) {
+            bubbleManager().startChanges();
+            setBubbleData(call.bubbleId, confState);
+            setBubbleActions(call.bubbleId, confState);
+            mCalls[j].callState=confState;
+            bubbleManager().endChanges();
+            // next
+            QTimer::singleShot(500, this, SLOT(toggleConferenceHoldDelayed()));
+            break;
+        }
+        j++;
+    }
+}
+
+void BubbleTestView::connectToTester()
+{
+    mBubbleTester->connectToServer();
+}
+
+void BubbleTestView::handleTesterDataChanged()
+{
+    bubbleManager().startChanges();
+
+    QString mute = mBubbleTester->dataField("mute");
+    bubbleManager().setPhoneMuted( mute == "On" );
+
+    QList<QString> testBubbles = mBubbleTester->bubbles();
+
+    foreach (QString bubbleId, testBubbles) {
+        QString state = mBubbleTester->dataField(bubbleId,"state");
+
+        // create or remove bubble
+        if ( mTestBubbleIds.contains(bubbleId) && state=="Idle" ) {
+            bubbleManager().removeCallHeader(mTestBubbleIds.value(bubbleId));
+            mTestBubbleIds.remove(bubbleId);
+        } else if (!mTestBubbleIds.contains(bubbleId) && state!="Idle" ) {
+            int id = bubbleManager().createCallHeader();
+            mTestBubbleIds.insert(bubbleId,id);
+        }
+
+        // set data
+        if (mTestBubbleIds.contains(bubbleId)) {
+            int id = mTestBubbleIds.value(bubbleId);
+
+            QString name = mBubbleTester->dataField(bubbleId,"name");
+            QString number = mBubbleTester->dataField(bubbleId,"number");
+            QString divert = mBubbleTester->dataField(bubbleId,"divert");
+
+            bubbleManager().setState(id, mStateMap.value(state));
+            bubbleManager().setCli(id, name, Qt::ElideRight);
+            bubbleManager().setSecondaryCli(id, number );
+            bubbleManager().setLabel(id, mLabelMap.value(state), Qt::ElideRight);
+
+            bubbleManager().setCallFlag(id, BubbleManager::Diverted, (divert == "On") );
+
+            setCallObject(id,":resources/contactpic.jpg");
+
+            setBubbleActions(id, mStateMap.value(state) );
+        }
+    }
+
+    bubbleManager().endChanges();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletestview.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,152 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 BUBBLETESTVIEW_H
+#define BUBBLETESTVIEW_H
+
+#include <hbview.h>
+#include <bubblemanagerif.h>
+
+class HbAction;
+class HbMainWindow;
+class QSignalMapper;
+class HbToolBar;
+class BubbleTester;
+class BubbleManager;
+
+class BubbleTestView : public HbView
+{
+    Q_OBJECT
+
+public:
+
+    BubbleTestView(HbMainWindow& window, QGraphicsItem *parent = 0);
+    
+    virtual ~BubbleTestView();
+    
+    BubbleManagerIF& bubbleManager();
+    
+private slots:
+    void answerCall();
+    void endCall();
+    void endConferenceCall();
+    void rejectCall();
+    void toggleHold();
+    void toggleHoldDelayed();
+    void toggleConferenceHoldDelayed();
+    void createIncomingCall();
+    void createOutgoingCall();
+    void setMuted();
+    void joinToConference();
+    void handlePrivate();
+    void handleDrop();
+    void replaceActiveCall();
+    void updateUiControls();
+    
+    void switchOrientation();
+    void handleOrientationChange(Qt::Orientation orientation);
+
+    void connectToTester();
+    void handleTesterDataChanged();
+
+private:
+    void keyPressEvent(QKeyEvent *event);
+    
+    void setBubbleData(int bubble, BubbleManagerIF::PhoneCallState state);
+    void setBubbleActions(int bubble, BubbleManagerIF::PhoneCallState state);
+    void setExpandActions();
+    void setCallObject(int bubble, const QString& filename);
+    void createToolBarActions();
+    void updateToolBarActions();
+    void createMenuActions();
+    void createBubbleActions();
+    int bubbleIdByState(BubbleManagerIF::PhoneCallState state);
+    bool initializingCallExists() const;
+    bool conferenceCallExists() const;
+    int  callCount() const;
+    bool callIndexByState(BubbleManagerIF::PhoneCallState state, int& index);
+    bool callIndexByBubbleId(int bubbleId, int& index);
+    void conferenceWizard();
+    void sendKeyEvent(int key);
+    void toggleHoldConference();
+
+private:
+    HbMainWindow&     mMainWindow;
+    BubbleManager    *mBubbleManager;
+    QList<HbAction*>  mBubbleActions;
+    
+    // settings
+    HbAction          *mCallDivert;
+    HbAction          *mCipheringOff;
+    HbAction          *mCallTimer;
+    HbAction          *mEmergencyCall;
+    HbAction          *mContactPicture;
+    HbAction          *mContactName;
+
+    // Toolbar actions
+    HbAction          *mCallIn;
+    HbAction          *mCallOut;
+    HbAction          *mMute;
+    HbAction          *mUnmute;
+    HbAction          *mActivateLoudspeaker;
+    HbAction          *mActivateHandset;
+    HbAction          *mSendMessage;
+    HbAction          *mSilence;
+    HbAction          *mOpenDialer;
+    HbAction          *mOpenContacts;
+
+    // Bubble actions
+    HbAction          *mAnswer;
+    HbAction          *mReject;
+    HbAction          *mHold;
+    HbAction          *mUnhold;
+    HbAction          *mSwap;
+    HbAction          *mEndCall;
+    HbAction          *mEndConference;
+    HbAction          *mJoin;
+    HbAction          *mPrivate;
+    HbAction          *mDrop;
+    HbAction          *mReplace;
+    HbAction          *mUpdateUiControls;
+    
+    // Test call data
+    struct TestCall {
+        int bubbleId;
+        int callState;
+        bool isConf;
+        bool isInConf;
+
+        TestCall() {
+            isConf = false;
+            isInConf = false;
+        }
+    };  
+    
+    QList<TestCall> mCalls;
+    bool mMuted;
+
+    HbAction         *mConnectTester;
+    BubbleTester     *mBubbleTester;
+    QMap<QString, int> mTestBubbleIds;
+    QMap<QString, BubbleManagerIF::PhoneCallState> mStateMap;
+    QMap<QString, QString> mLabelMap;
+    QString mPhoneNumber;
+    int mConfBubbleId;
+    bool mProvideJoin;
+};
+
+#endif // BUBBLETESTVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/main.cpp	Fri Jun 04 10:19:18 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:  Animated icon.
+*
+*/
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+#include "bubbletestview.h"
+
+int main(int argc, char *argv[])
+{
+    // Initialization
+    HbApplication app(argc, argv);
+
+    // Main window widget. 
+    // Includes decorators such as signal strength and battery life indicator.
+    HbMainWindow mainWindow;
+
+    // View
+    BubbleTestView *view = new BubbleTestView(mainWindow);
+    mainWindow.addView(view);
+
+    // Show widget
+    mainWindow.setAttribute( Qt::WA_InputMethodEnabled, false ); 
+    mainWindow.show();
+    
+    mainWindow.scene()->setFocusItem( view );
+
+    // Enter event loop
+    return app.exec();
+}
Binary file phoneuis/bubblemanager2/tsrc/bubbletest2/resources/contactpic.jpg has changed
Binary file phoneuis/bubblemanager2/tsrc/bubbletest2/resources/contactpic2.jpg has changed
Binary file phoneuis/bubblemanager2/tsrc/bubbletest2/resources/contactpic3.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/sis/bubbletest2.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,28 @@
+; bubbletest2_armv5_urel.pkg generated by qmake at Fri 5. Jun 09:43:30 2009
+; This file is generated by qmake and should not be modified by the user
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"bubbletest2"},(0xEe4d96a5),1,0,0
+
+; Localised Vendor name
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+
+; Executable and default resource files
+"\epoc32\release\armv5\urel\bubbletest2.exe"    - "!:\sys\bin\bubbletest2.exe"
+"\epoc32\data\z\resource\apps\bubbletest2.rsc"    - "!:\resource\apps\bubbletest2.rsc"
+"\epoc32\data\z\private\10003a3f\import\apps\bubbletest2_reg.rsc"    - "!:\private\10003a3f\import\apps\bubbletest2_reg.rsc"
+"\epoc32\release\armv5\urel\bubblemanager2.dll"    - "!:\sys\bin\bubblemanager2.dll"
+"\epoc32\release\armv5\urel\bubblestyleplugin.dll"    - "!:\sys\bin\bubblestyleplugin.dll"
+"\epoc32\release\winscw\udeb\z\resource\plugins\bubblestyleplugin.qtplugin" - "!:\resource\plugins\bubblestyleplugin.qtplugin"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/bubbletest2/sis/sisTool.pl	Fri Jun 04 10:19:18 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: 
+#
+#! /usr/local/bin/perl -w
+#
+#  Change history:
+#
+# 06-Aug-2006 : DLL versioning support added (Elftran tool)
+# 02-Aug-2007 : Updated for changed RnD certificate path
+#
+#
+#
+
+sub updateVersion ;
+sub signSis ;
+
+my @args = @ARGV;
+# signing related variables
+my $certPath = "\\s60_RnD\\RD_RootCA";
+my $certificate = "rd.cer";
+my $key = "rd-key.pem";
+my $version = "10.1";
+my $packageFile = undef;
+my $sisFile = undef;
+
+# path to copy signed sis (if optional -c argument used)
+my $copyPath = undef;
+
+# 
+my $updateDllVersion = 0;
+    
+# print help if needed
+if ( scalar(@args) == 0 || 
+     $args[0] =~ /-[h,\?]/i )
+    {
+print <<HELP;
+
+-------------------------------------------------------------------------
+======= Script for making and signing an installation (.sis) file =======
+
+Usage: sisTool <package-file-w/o-ext> [-d<version>] [-c<destination-path>] 
+               [-s<stub-package-file-w/o-ext>]
+
+ -d changes minor DLL version number - needed when eclipsing DLLs in ROM.
+ -c copies target file to specific destination
+ -s also creates stub SIS. File name is not needed if it same as base file
+    name followed by "_stub" (e.g. pkg files for eclipsing SIS and stub SIS
+    are component.pkg and component_stub.pkg respectively).
+
+Examples:
+=========
+sisTool myPackage -d2
+
+  Creates and signs(* 'myPackage.sis' from 'myPackage.pkg'.
+  Before creating sis file myPackage.pkg is searched for DLLs
+  and their version numbers are changed to 10.2 (i.e. minor
+  version is changed - default major version number is 10).
+
+sisTool myPackage -d -s
+  
+  Same as first example but uses default minor version number (=1)
+  for DLLs, and creates stub sis with name myPackage_stub.sis.
+
+                                                     
+(* Uses R&D certificate 'rd.cer' from \\S60\\s60_RnD\\RD_RootCA
+HELP
+    exit;
+    }
+$packageFile = shift;
+
+foreach ( @args ) {
+    # check if dll version number should be updated
+    if ( /-d(\d+)?\b/ ) {
+        $version = $1 ;
+        $version = 1 if ( not defined $version );            
+        $updateDllVersion = 1;
+        }
+    # check if stub SIS should be created
+    elsif ( /-s((\w|\.|\\|_|:|-)+)?/ )
+        {
+        my $stubPkgFile = "${packageFile}_stub.pkg";
+        if ( defined $1 ) {
+            # user defined stub
+            $stubPkgFile = $1; 
+            $stubPkgFile = $stubPkgFile . ".pkg" if $stubPkgFile !~ /\.pkg$/; 
+            }        
+        my $cmd = "makesis -s $stubPkgFile";
+        print "\n";
+        system "$cmd";
+        print "\n";
+        }
+    $copyPath = $1 if /-c(\S+)/;
+    }
+
+if ( defined($packageFile) ) {
+    ( -e "$packageFile.pkg" ) or die "package file '$packageFile' not found.\n";
+    
+    # Update version number of DLLs listed in pkg-file.
+    updateVersion if $updateDllVersion;
+
+    my $cmd = "makesis $packageFile\.pkg\n";
+   
+    if ( !defined( $sisFile ) ) {
+        $sisFile = "$packageFile.sis";
+        }
+    #################
+    # Do create sis #
+    #################
+    
+    my $err = system "$cmd";
+    die "\nFailed making sis file $!" if $err;
+    signSis;
+    if ( defined( $copyPath ) )
+        {
+        system "xcopy $sisFile $copyPath 2>&1";
+        }
+    }
+
+sub signSis {
+    # sign a sis file
+    my $signedFile = "${sisFile}S\.sis";
+    ( -e "$certPath\\$certificate" ) or die <<NOCERT;
+    
+    
+Certificate could not be found from $certPath\\$certificate
+Check and modifiy the path in line ~17 in the script if needed.
+NOCERT
+
+    my $cmd = "signsis -s $packageFile.sis $signedFile $certPath\\$certificate $certPath\\$key";        
+    if ( system ( "$cmd" ) == 0 )
+        {        
+        # delete original unsigned sis file
+        system "del $sisFile";
+        system "ren $signedFile $sisFile";
+        print "\nSigned with R&D certificate\n";
+        if ( defined ( $copyPath ) ) {
+            # copy signed sis to specified directory
+            system "xcopy $sisFile $copyPath";
+            }
+        }        
+    }
+    
+
+sub updateVersion {
+    open PACKAGE, "<$packageFile.pkg";    
+    foreach ( <PACKAGE> )
+        {
+        if ( /\"(.*?\.dll)\"/i ) 
+            {                        
+            system "elftran -version 10\.$version $1";
+            system "elftran -compressionmethod bytepair $1";
+            print STDOUT "\nUpdated version number of\n$1 to 10.$version\n";
+            }
+        }
+    close PACKAGE;  
+    }    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/checkcoverage.cmd	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,42 @@
+@echo off
+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 on
+:FINAL
+
+@echo off
+
+rmdir /q /s coverage
+mkdir coverage
+cd coverage
+
+if not "%1"=="mt_bubblemanager2" (
+echo Instrumenting %1
+call qmake^
+ ..\%1\%1.pro
+call ctcwrap^
+ mingw32-make debug
+call %1.exe
+)
+
+call ctcpost^
+ mon.sym mon.dat^
+ -p profile.txt
+call ctc2html -i profile.txt
+cd ..
+echo All done!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/mt_bubblemanager2/mt_bubblemanager2.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,569 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+#include <hbtoolbar.h>
+#include <hbview.h>
+
+#include "bubbletest.h"
+#include "bubblemanager2.h"
+
+const int WAIT_TIME = 200;
+
+class mt_BubbleManager2 : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testBasicMtCall();
+    void testBasicMoCall();
+    void testWaitingCall();
+    void testConferenceCall();
+    void testEmergencyCall();
+
+private:
+    void mouseClickWidget(const QString& name);
+    void mouseClickWidgetAction(const QString& name, HbAction* action);
+    QGraphicsWidget* getWidgetByName(const QString& name);
+
+private:
+    HbMainWindow*  mainWindow;
+    BubbleManager* bubbleManager; // widget under test
+    HbAction*      toolbarAction;
+    HbView*        view; // not owned
+};
+
+void mt_BubbleManager2::initTestCase()
+{
+    mainWindow = new HbMainWindow;
+
+    bubbleManager = new BubbleManager();
+
+    view = mainWindow->addView( bubbleManager );
+
+    HbToolBar *toolBar = new HbToolBar();
+    toolbarAction = new HbAction(this);
+    toolBar->addAction( toolbarAction );
+    toolBar->addAction( toolbarAction );
+    //toolBar->setOrientation(mainWindow->orientation());
+    mainWindow->currentView()->setToolBar(toolBar);
+
+    mainWindow->show();
+}
+
+void mt_BubbleManager2::cleanupTestCase()
+{
+    delete mainWindow;
+    delete toolbarAction;
+}
+
+void mt_BubbleManager2::testBasicMtCall()
+{
+    view->setTitle( "Basic MT call" );
+    bubbleManager->startChanges();
+    int bubbleId = bubbleManager->createCallHeader();
+    QVERIFY( bubbleId == 0 );
+    bubbleManager->setState( bubbleId, BubbleManager::Incoming );
+    bubbleManager->setCli( bubbleId, "John Doe", Qt::ElideRight );
+    bubbleManager->setSecondaryCli( bubbleId, "0407284096" );
+    bubbleManager->setNumberType( bubbleId, BubbleManager::Mobile );
+    bubbleManager->setCallFlags( bubbleId, BubbleManager::Diverted );
+    bubbleManager->setCallFlag( bubbleId, BubbleManager::NoCiphering, true );
+    bubbleManager->setLabel( bubbleId,"calling");
+    bubbleManager->setCallObjectFromTheme(bubbleId);
+    HbAction action1("Answer", this);
+    action1.setSoftKeyRole(QAction::PositiveSoftKey);
+    bubbleManager->addAction( bubbleId, &action1 );
+    HbAction action2("Reject", this);
+    action2.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId, &action2 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    mouseClickWidgetAction("eb:leftButton",&action1);
+    mouseClickWidgetAction("eb:rightButton",&action2);
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::Active );
+    bubbleManager->setLabel( bubbleId,"");
+    bubbleManager->setCallTime( bubbleId, "00:00" );
+    bubbleManager->setCallFlag( bubbleId, BubbleManager::NoCiphering, false );
+    bubbleManager->clearActions(bubbleId);
+    HbAction action3("Hold", this);
+    bubbleManager->addAction( bubbleId, &action3 );
+    HbAction action4("End call", this);
+    action4.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId, &action4 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->updateCallTime( bubbleId, "00:01" );
+    bubbleManager->updateCLI(bubbleId, "John Doe", Qt::ElideRight);
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->updateCallTime( bubbleId, "00:02" );
+    mouseClickWidgetAction("eb:leftButton",&action3);
+    mouseClickWidgetAction("eb:rightButton",&action4);
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::OnHold );
+    bubbleManager->setLabel( bubbleId,"on hold");
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+    
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::Disconnected );
+    bubbleManager->setLabel( bubbleId,"disconnected");
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->startChanges();
+    bubbleManager->removeCallHeader( bubbleId );
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+}
+
+void mt_BubbleManager2::testBasicMoCall()
+{
+    view->setTitle( "Basic M0 call" );
+    bubbleManager->startChanges();
+    int bubbleId = bubbleManager->createCallHeader();
+    QVERIFY( bubbleId == 0 );
+    bubbleManager->setState( bubbleId, BubbleManager::Outgoing );
+    bubbleManager->setCli( bubbleId, "Mary Poppins", Qt::ElideRight );
+    bubbleManager->setSecondaryCli( bubbleId, "0507284096" );
+    bubbleManager->setNumberType( bubbleId, BubbleManager::Mobile );
+    bubbleManager->setLabel( bubbleId,"Calling");
+    bubbleManager->setCallFlag( bubbleId, BubbleManager::NoCiphering, true );
+    bubbleManager->setCallObjectFromTheme(bubbleId);
+    HbAction action1("End call", this);
+    action1.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->clearActions(bubbleId);
+    bubbleManager->addAction( bubbleId, &action1 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    mouseClickWidgetAction("eb:centerButton", &action1 );
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::Alerting );
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+    
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::Active );
+    bubbleManager->setLabel( bubbleId,"");
+    bubbleManager->setCallTime( bubbleId, "00:00" );
+    bubbleManager->setCallFlag( bubbleId, BubbleManager::NoCiphering, false);
+    bubbleManager->clearActions(bubbleId);
+    HbAction action2("Hold", this);
+    bubbleManager->addAction( bubbleId, &action2 );
+    HbAction action3("End call", this);
+    action3.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId, &action3 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->updateCallTime( bubbleId, "00:01" );
+    mouseClickWidgetAction("eb:leftButton",&action2);
+    mouseClickWidgetAction("eb:rightButton",&action3);
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->setPhoneMuted(true);
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->setPhoneMuted(false);
+
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::Disconnected );
+    bubbleManager->setLabel( bubbleId,"disconnected");
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->startChanges();
+    bubbleManager->removeCallHeader( bubbleId );
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+}
+
+void mt_BubbleManager2::testWaitingCall()
+{
+    view->setTitle( "Waiting call" );
+    bubbleManager->startChanges();
+    int bubbleId1 = bubbleManager->createCallHeader();
+    QVERIFY( bubbleId1 == 0 );
+    bubbleManager->setState( bubbleId1, BubbleManager::Active );
+    bubbleManager->setCli( bubbleId1, "Mary Poppins", Qt::ElideRight );
+    bubbleManager->setSecondaryCli( bubbleId1, "0507284096" );
+    bubbleManager->setCallObjectFromTheme(bubbleId1);
+    bubbleManager->setCallTime( bubbleId1, "00:00" );
+    bubbleManager->clearActions(bubbleId1);
+    HbAction action1("Hold", this);
+    bubbleManager->addAction( bubbleId1, &action1 );
+    HbAction action2("End call", this);
+    action2.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId1, &action2 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+
+    // waiting call
+    bubbleManager->startChanges();
+    int bubbleId2 = bubbleManager->createCallHeader();
+    QVERIFY( bubbleId2 == 1 );
+    bubbleManager->setState( bubbleId2, BubbleManager::Waiting );
+    bubbleManager->setCli( bubbleId2, "John Doe", Qt::ElideRight );
+    bubbleManager->setLabel( bubbleId2,"Waiting");
+    bubbleManager->setSecondaryCli( bubbleId2, "0501234567" );
+    bubbleManager->setCallObjectFromTheme(bubbleId2);
+    bubbleManager->clearActions(bubbleId2);
+    HbAction action3("Answer", this);
+    action3.setSoftKeyRole(QAction::PositiveSoftKey);
+    bubbleManager->addAction( bubbleId2, &action3 );
+    HbAction action4("Reject", this);
+    action4.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId2, &action4 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    mouseClickWidgetAction("eb:leftButton",&action3);
+    mouseClickWidgetAction("eb:rightButton",&action4);
+    bubbleManager->updateCallTime(bubbleId1,"00:01");
+
+    // two calls
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId1, BubbleManager::OnHold );
+    bubbleManager->setLabel( bubbleId1,"On hold");
+    bubbleManager->setState( bubbleId2, BubbleManager::Active );
+    bubbleManager->setLabel( bubbleId2,"");
+    bubbleManager->clearActions(bubbleId2);
+    bubbleManager->addAction( bubbleId2, &action1 );
+    bubbleManager->addAction( bubbleId2, &action2 );
+    HbAction action5("Swap", this);
+    bubbleManager->setExpandAction( bubbleId1, &action5 );
+    bubbleManager->setExpandAction( bubbleId2, &action5 );
+    bubbleManager->endChanges();
+
+    int expanded = bubbleManager->expandedBubble();
+    QVERIFY( expanded == bubbleId2 );
+
+    QTest::qWait( WAIT_TIME );
+    mouseClickWidgetAction("collapsedBubble",&action5);
+    expanded = bubbleManager->expandedBubble();
+    QVERIFY( expanded == bubbleId1 );
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->setBubbleSelectionDisabled(true);
+    mouseClickWidget("collapsedBubble");
+    expanded = bubbleManager->expandedBubble();
+    QVERIFY( expanded == bubbleId1 );
+    bubbleManager->setBubbleSelectionDisabled(false);
+
+    // waiting call (third call)
+    bubbleManager->startChanges();
+    int bubbleId3 = bubbleManager->createCallHeader();
+    QVERIFY( bubbleId3 == 2 );
+    bubbleManager->setState( bubbleId3, BubbleManager::Waiting );
+    bubbleManager->setCli( bubbleId3, "Mary Poppins", Qt::ElideRight );
+    bubbleManager->setLabel( bubbleId3,"Waiting");
+    bubbleManager->setSecondaryCli( bubbleId3, "0501234567" );
+    bubbleManager->setCallObjectFromTheme(bubbleId3);
+    bubbleManager->clearActions(bubbleId3);
+    HbAction action6("Replace", this);
+    bubbleManager->addAction( bubbleId3, &action6 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    expanded = bubbleManager->expandedBubble();
+    QVERIFY( expanded == bubbleId3 );
+
+    // click top most bubble - bubble2
+    mouseClickWidgetAction("collapsedBubble2",&action5);
+    expanded = bubbleManager->expandedBubble();
+    QVERIFY( expanded == bubbleId2 );
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->removeCallHeader( bubbleId3 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId2, BubbleManager::Disconnected );
+    bubbleManager->setLabel( bubbleId2,"disconnected");
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->startChanges();
+    bubbleManager->removeCallHeader( bubbleId1 );
+    bubbleManager->removeCallHeader( bubbleId2 );
+    bubbleManager->endChanges();
+}
+
+void mt_BubbleManager2::testConferenceCall()
+{
+    view->setTitle( "Test conference" );
+    bubbleManager->startChanges();
+    // held call
+    int bubbleId1 = bubbleManager->createCallHeader();
+    bubbleManager->setState( bubbleId1, BubbleManager::OnHold );
+    bubbleManager->setCli( bubbleId1, "Mary Poppins", Qt::ElideRight );
+    bubbleManager->setSecondaryCli( bubbleId1, "0507284096" );
+    bubbleManager->setCallObjectFromTheme(bubbleId1);
+    bubbleManager->setLabel( bubbleId1,"On hold");
+    bubbleManager->clearActions(bubbleId1);
+    HbAction action1("Activate", this);
+    bubbleManager->addAction( bubbleId1, &action1 );
+    HbAction action2("End call", this);
+    action2.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId1, &action2 );
+    // active call
+    int bubbleId2 = bubbleManager->createCallHeader();
+    bubbleManager->setState( bubbleId2, BubbleManager::Waiting );
+    bubbleManager->setCli( bubbleId2, "John Doe", Qt::ElideRight );
+    bubbleManager->setSecondaryCli( bubbleId2, "0501234567" );
+    bubbleManager->setCallObjectFromTheme(bubbleId2);
+    bubbleManager->clearActions(bubbleId2);
+    HbAction action3("Hold", this);
+    bubbleManager->addAction( bubbleId2, &action3 );
+    HbAction action4("End call", this);
+    action4.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId2, &action4 );
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    int bubbleIdC = bubbleManager->createConference(bubbleId1,bubbleId2);
+    bubbleManager->setCli(bubbleIdC,"Conference call",Qt::ElideRight);
+    bubbleManager->setExpandedConferenceCallHeader(true);
+    bubbleManager->setState(bubbleIdC,BubbleManager::Active);
+    bubbleManager->setState(bubbleId1,BubbleManager::Active);
+    bubbleManager->setState(bubbleId2,BubbleManager::Active);
+    bubbleManager->setCallTime(bubbleIdC,"00:00");
+    HbAction action5("End conference");
+    action5.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction(bubbleIdC,&action5);
+    bubbleManager->clearParticipantListActions();
+    HbAction action6("Private");
+    bubbleManager->addParticipantListAction(&action6);
+    HbAction action7("Drop");
+    bubbleManager->addParticipantListAction(&action7);
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->updateCallTime(bubbleIdC,"00:01");
+    mouseClickWidgetAction("eb:centerButton",&action5);
+    QVERIFY(bubbleManager->conferenceRowCount()==2);
+    QVERIFY(bubbleManager->expandedBubble()==bubbleIdC);
+    QTest::qWait( WAIT_TIME );
+
+    // add call to conference
+    bubbleManager->startChanges();
+    int bubbleId3 = bubbleManager->createCallHeader();
+    bubbleManager->setState( bubbleId3, BubbleManager::Active );
+    bubbleManager->setCli( bubbleId3, "123457", Qt::ElideLeft );
+    bubbleManager->setCallObjectFromTheme(bubbleId3);
+    bubbleManager->clearActions(bubbleId3);
+    HbAction action8("Hold", this);
+    bubbleManager->addAction( bubbleId3, &action8 );
+    HbAction action9("End call", this);
+    action9.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->addAction( bubbleId3, &action9 );
+    bubbleManager->setExpandedConferenceCallHeader(false);
+    bubbleManager->setState(bubbleIdC,BubbleManager::OnHold);
+    bubbleManager->setLabel(bubbleIdC,"On hold",Qt::ElideRight);
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->startChanges();
+    bubbleManager->setExpandedConferenceCallHeader(true);
+    bubbleManager->addRowToConference(bubbleId3);
+    bubbleManager->setState(bubbleIdC,BubbleManager::Active);
+    // to test two button layout
+    bubbleManager->clearActions(bubbleIdC);
+    bubbleManager->addAction(bubbleIdC,&action8);
+    bubbleManager->addAction(bubbleIdC,&action5);
+    bubbleManager->endChanges();
+    Q_ASSERT(bubbleManager->conferenceRowCount()==3);
+    QTest::qWait( WAIT_TIME );
+    mouseClickWidgetAction("eb:leftButton",&action8);
+    mouseClickWidgetAction("eb:rightButton",&action5);
+
+    // try to click conference list
+    QTest::mouseClick(mainWindow->viewport(),Qt::LeftButton,0,QPoint(100,100));
+    QTest::qWait( 2*WAIT_TIME );
+
+    // hold/unhold conference
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleIdC, BubbleManager::OnHold );
+    bubbleManager->setState( bubbleId1, BubbleManager::OnHold );
+    bubbleManager->setState( bubbleId2, BubbleManager::OnHold );
+    bubbleManager->setState( bubbleId3, BubbleManager::OnHold );
+    bubbleManager->endChanges();
+    QTest::qWait( 2*WAIT_TIME );
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleIdC, BubbleManager::Active );
+    bubbleManager->setState( bubbleId1, BubbleManager::Active );
+    bubbleManager->setState( bubbleId2, BubbleManager::Active );
+    bubbleManager->setState( bubbleId3, BubbleManager::Active );
+    bubbleManager->endChanges();
+
+    // remove call from conference
+    bubbleManager->startChanges();
+    bubbleManager->removeRowFromConference(bubbleId3);
+    bubbleManager->removeCallHeader(bubbleId3);
+    bubbleManager->endChanges();
+    Q_ASSERT(bubbleManager->conferenceRowCount()==2);
+    QTest::qWait( WAIT_TIME );
+
+    // to be implemented API methods
+    bubbleManager->startChanges();
+    bubbleManager->setSelectionInConference(0);
+    bubbleManager->setSelectionIdInConference(bubbleId1);
+    bubbleManager->selectionInConference();
+    bubbleManager->selectionIdInConference();
+    bubbleManager->moveHighlightOneUpInConference();
+    bubbleManager->moveHighlightOneDownInConference();
+    bubbleManager->setParticipantListCli(bubbleId1,
+        BubbleManagerIF::ParticipantListCliText);
+    bubbleManager->endChanges();
+
+    bubbleManager->startChanges();
+    bubbleManager->removeConference();
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->removeCallHeader(bubbleId1);
+    bubbleManager->removeCallHeader(bubbleId2);
+    bubbleManager->endChanges();
+}
+
+void mt_BubbleManager2::testEmergencyCall()
+{
+    view->setTitle( "Emergency call" );
+    bubbleManager->startChanges();
+    int bubbleId = bubbleManager->createCallHeader();
+    QVERIFY( bubbleId == 0 );
+    bubbleManager->setState( bubbleId, BubbleManager::Outgoing );
+    bubbleManager->setCli( bubbleId, "emergency call", Qt::ElideRight );
+    bubbleManager->setNumberType( bubbleId, BubbleManager::Mobile );
+    bubbleManager->setLabel( bubbleId,"Attempting");
+    HbAction action1("End call", this);
+    action1.setSoftKeyRole(QAction::NegativeSoftKey);
+    bubbleManager->clearActions(bubbleId);
+    bubbleManager->addAction( bubbleId, &action1 );
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    mouseClickWidgetAction("eb:centerButton",&action1);
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->setCli( bubbleId, "Emergency call", Qt::ElideRight );
+    bubbleManager->setState( bubbleId, BubbleManager::Alerting );
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::Active );
+    bubbleManager->setLabel( bubbleId,"");
+    bubbleManager->setCallTime( bubbleId, "00:00" );
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+
+    bubbleManager->startChanges();
+    bubbleManager->setState( bubbleId, BubbleManager::Disconnected );
+    bubbleManager->setLabel( bubbleId,"disconnected");
+    bubbleManager->endChanges();
+
+    QTest::qWait( WAIT_TIME );
+    bubbleManager->startChanges();
+    bubbleManager->removeCallHeader( bubbleId );
+    bubbleManager->endChanges();
+    QTest::qWait( WAIT_TIME );
+}
+
+void mt_BubbleManager2::mouseClickWidget(
+    const QString& name )
+{
+    QGraphicsWidget* widget = getWidgetByName(name);
+
+    if ( widget ) {
+        QPointF widgetPos = widget->scenePos() +
+                            widget->rect().center();
+
+        QPoint windowPos = mainWindow->mapFromScene( widgetPos );
+
+        QTest::mouseClick( mainWindow->viewport(), Qt::LeftButton, 0, windowPos );
+        QTest::qWait( WAIT_TIME );
+    } else {
+        QFAIL( "Widget cannot be accessed!" );
+    }
+}
+
+void mt_BubbleManager2::mouseClickWidgetAction(
+    const QString& name,
+    HbAction* action )
+{
+    QSignalSpy spy( action, SIGNAL( triggered() ) );
+
+    QGraphicsWidget* widget = getWidgetByName(name);
+
+    if ( widget ) {
+        QPointF widgetPos = widget->scenePos() +
+                            widget->rect().center();
+
+        QPoint windowPos = mainWindow->mapFromScene( widgetPos );
+
+        QTest::mouseClick( mainWindow->viewport(), Qt::LeftButton, 0, windowPos );
+        QTest::qWait( WAIT_TIME );
+        QVERIFY( spy.count() == 1 );
+    } else {
+        QFAIL( "Widget cannot be accessed!" );
+    }
+}
+
+QGraphicsWidget* mt_BubbleManager2::getWidgetByName(const QString& name)
+{
+    Q_ASSERT(mainWindow!=0);
+
+    QGraphicsWidget* widget = 0;
+
+    QList<QGraphicsItem*> items = mainWindow->scene()->items();
+    foreach (QGraphicsItem* item, items) {
+        if (item->isWidget()) {
+            QGraphicsWidget *w = static_cast<QGraphicsWidget*>(item);
+            if (w->objectName()==name) {
+                widget = w;
+            }
+        }
+    }
+
+    return widget;
+}
+
+BUBBLE_TEST_MAIN(mt_BubbleManager2)
+#include "mt_bubblemanager2.moc"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/mt_bubblemanager2/mt_bubblemanager2.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET =
+INCLUDEPATH += . ../../../inc  ../shared
+
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+SOURCES += mt_bubblemanager2.cpp
+
+# 
+unix:!symbian: LIBS += -L../../../bubblecore
+LIBS += -lbubblemanager2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/runall.cmd	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,62 @@
+@echo off
+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
+
+if "%1"=="winscw" (
+call runtest.cmd ut_bubbleutils
+call runtest.cmd ut_bubbleheader
+call runtest.cmd ut_bubbleconferenceheader
+call runtest.cmd ut_bubblepartlistmodel
+call runtest.cmd ut_bubblecontainerwidget
+call runtest.cmd ut_bubbleheadingwidget
+call runtest.cmd ut_bubbleimagewidget
+call runtest.cmd ut_bubbleparticipantlistitem
+rem call runtest.cmd mt_bubblemanager2
+)
+
+@echo off
+if "%1"=="win32" (
+call runtest_w32.cmd ut_bubbleutils
+call runtest_w32.cmd ut_bubbleheader
+call runtest_w32.cmd ut_bubbleconferenceheader
+call runtest_w32.cmd ut_bubblepartlistmodel
+call runtest_w32.cmd ut_bubblecontainerwidget
+call runtest_w32.cmd ut_bubbleheadingwidget
+call runtest_w32.cmd ut_bubbleimagewidget
+call runtest_w32.cmd ut_bubbleparticipantlistitem
+rem call runtest_w32.cmd mt_bubblemanager2
+)
+
+@echo off
+if "%2"=="ctc" (
+call ctcpost^
+ ut_bubbleutils\mon.sym ut_bubbleutils\mon.dat^
+ ut_bubbleheader\mon.sym ut_bubbleheader\mon.dat^
+ ut_bubbleconferenceheader\mon.sym ut_bubbleconferenceheader\mon.dat^
+ ut_bubblepartlistmodel\mon.sym ut_bubblepartlistmodel\mon.dat^
+ ut_bubblecontainerwidget\mon.sym ut_bubblecontainerwidget\mon.dat^
+ ut_bubbleheadingwidget\mon.sym ut_bubbleheadingwidget\mon.dat^
+ ut_bubbleimagewidget\mon.sym ut_bubbleimagewidget\mon.dat^
+ ut_bubbleparticipantlistitem\mon.sym ut_bubbleparticipantlistitem\mon.dat^
+ ut_bubbleanimiconitem\mon.sym ut_bubbleanimiconitem\mon.dat^
+  -p profile.txt
+call ctc2html -i profile.txt
+)
+
+@echo off
+if "%1"=="" echo Usage: 'runall winscw' or 'runall win32'
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/runtest.cmd	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,22 @@
+@echo off
+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
+
+call del %1.log
+@echo on
+:FINAL
+call \epoc32\release\winscw\udeb\%1.exe -o c:\%1.log
+call type \epoc32\winscw\c\%1.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/runtest_w32.cmd	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,20 @@
+@echo off
+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 on
+:FINAL
+call %1\%1.exe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/shared/bubbletest.h	Fri Jun 04 10:19:18 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: 
+*
+*/
+
+#ifndef BUBBLETEST_H
+#define BUBBLETEST_H
+
+#include <QtCore>
+
+#define BUBBLE_TEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    HbApplication app(argc, argv); \
+    TestObject tc; \
+    QResource::registerResource("../hbcore.rcc"); \
+    int ret = QTest::qExec(&tc, argc, argv); \
+    /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \
+    /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \
+    /* app.exec() where the signal is normally emitted is not called here. */ \
+    /* So, invoking the signal explicitly. */ \
+    QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \
+    return ret; \
+}
+
+#endif // BUBBLETEST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/unit.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+
+TEMPLATE = subdirs
+SUBDIRS += ut_bubbleheader
+SUBDIRS += ut_bubbleconferenceheader
+SUBDIRS += ut_bubblepartlistmodel
+SUBDIRS += ut_bubbleutils
+SUBDIRS += ut_bubblecontainerwidget
+SUBDIRS += ut_bubbleheadingwidget
+SUBDIRS += ut_bubbleimagemanager
+SUBDIRS += ut_bubbleimagewidget
+SUBDIRS += ut_bubbleparticipantlistitem
+SUBDIRS += ut_bubbleeffecthandler
+SUBDIRS += mt_bubblemanager2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleconferenceheader/ut_bubbleconferenceheader.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+
+#include "bubbletest.h"
+#include "bubbleconferenceheader.h"
+
+static const int PARTICIPANT_COUNT=5;
+
+class ut_BubbleConferenceHeader : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testIsConference();
+    void testAddHeader();
+    void testRemoveHeader();
+    void testAddParticipantListActions();
+    void testSetExpanded();
+    void testSetSelectedHeader();
+    void testReset(); // keep this last
+
+private:
+    BubbleConferenceHeader* confHeader; // class under test
+    QList<BubbleHeader*> participants;
+};
+
+void ut_BubbleConferenceHeader::initTestCase()
+{
+    confHeader = new BubbleConferenceHeader();
+
+    for (int i=0; i<PARTICIPANT_COUNT; i++) {
+        BubbleHeader* header = new BubbleHeader();
+        header->setBubbleId(i);
+        participants.append(header);
+    }
+}
+
+void ut_BubbleConferenceHeader::cleanupTestCase()
+{
+    qDeleteAll(participants);
+    participants.clear();
+
+    delete confHeader;
+}
+
+void ut_BubbleConferenceHeader::testIsConference()
+{
+    QVERIFY( confHeader->isConference() == true );
+}
+
+void ut_BubbleConferenceHeader::testAddHeader()
+{
+    foreach(BubbleHeader* participant,participants) {
+        confHeader->addHeader(participant);
+    }
+
+    QVERIFY( confHeader->headers().count()==PARTICIPANT_COUNT );
+    QVERIFY( confHeader->headers().at(0)->isInConference()==true );
+}
+
+void ut_BubbleConferenceHeader::testRemoveHeader()
+{
+    confHeader->removeHeader(0);
+    confHeader->removeHeader(0);
+    confHeader->removeHeader(2);
+
+    QVERIFY( confHeader->headers().count()==PARTICIPANT_COUNT-2 );
+    QVERIFY( participants.at(2)->isInConference()==false );
+}
+
+void ut_BubbleConferenceHeader::testAddParticipantListActions()
+{
+    for ( int i=0; i < 2; i++ ) {
+        HbAction* action = new HbAction( "Test", this);
+        confHeader->addParticipantListAction(action);
+    }
+
+    QVERIFY( confHeader->participantListActions().count() == 2 );
+    confHeader->clearParticipantListActions();
+    QVERIFY( confHeader->participantListActions().count() == 0 );    
+
+    HbAction* action = new HbAction( "Test", this);
+    confHeader->addParticipantListAction(action);
+}
+
+void ut_BubbleConferenceHeader::testSetExpanded()
+{
+    confHeader->setExpanded(true);
+    QVERIFY(confHeader->isExpanded());
+    confHeader->setExpanded(true);
+}
+
+void ut_BubbleConferenceHeader::testSetSelectedHeader()
+{
+    confHeader->setSelectedHeader(1);
+    QVERIFY(confHeader->selectedHeader()==1);
+    confHeader->setSelectedHeader(1);
+}
+
+void ut_BubbleConferenceHeader::testReset()
+{
+    confHeader->reset();
+    QVERIFY( confHeader->headers().count()==0 );
+    QVERIFY( participants.at(1)->isInConference()==false );
+    QVERIFY( confHeader->participantListActions().count()==0 );
+    QVERIFY( confHeader->isExpanded()==false );
+    QVERIFY( confHeader->selectedHeader()==-1 );
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleConferenceHeader)
+#include "ut_bubbleconferenceheader.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleconferenceheader/ut_bubbleconferenceheader.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+SOURCES += ut_bubbleconferenceheader.cpp \
+           ../../../bubblecore/src/bubbleheader.cpp \
+           ../../../bubblecore/src/bubbleconferenceheader.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.cpp	Fri Jun 04 10:19:18 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 <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbstyle.h>
+
+#include "bubbletest.h"
+#include "bubblecontainerwidget.h"
+
+class ut_BubbleContainerWidget : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testLeftMouseClick();
+    void testRightMouseClick();
+    void testMouseMove();
+
+private:
+    BubbleContainerWidget* mContainer;
+    HbMainWindow* mMainWindow;
+    int mStyleBaseId;
+};
+
+void ut_BubbleContainerWidget::initTestCase()
+{
+    mMainWindow = new HbMainWindow();
+    mContainer = new BubbleContainerWidget();
+    mMainWindow->addView(mContainer);
+    mMainWindow->show();
+}
+
+void ut_BubbleContainerWidget::cleanupTestCase()
+{
+    delete mMainWindow;
+}
+
+void ut_BubbleContainerWidget::testLeftMouseClick()
+{
+    QSignalSpy spy(mContainer,SIGNAL(clicked()));
+
+    QPointF clickPos = mContainer->scenePos() +
+                       mContainer->rect().center();
+    QPoint windowPos = mMainWindow->mapFromScene( clickPos );
+
+    QTest::mouseClick( mMainWindow->viewport(), Qt::LeftButton, 0, windowPos,100 );
+    QCOMPARE( spy.count(), 1 );
+}
+
+void ut_BubbleContainerWidget::testRightMouseClick()
+{
+    QSignalSpy spy(mContainer,SIGNAL(clicked()));
+
+    QPointF clickPos = mContainer->scenePos() +
+                       mContainer->rect().center();
+    QPoint windowPos = mMainWindow->mapFromScene( clickPos );
+
+    QTest::mouseClick( mMainWindow->viewport(), Qt::RightButton, 0, windowPos,100 );
+    QCOMPARE( spy.count(), 0 );
+}
+
+void ut_BubbleContainerWidget::testMouseMove()
+{
+    QSignalSpy spy(mContainer,SIGNAL(clicked()));
+
+    QPointF clickPos = mContainer->scenePos() +
+                       mContainer->rect().center();
+    QPoint windowPos = mMainWindow->mapFromScene( clickPos );
+    QPoint windowPos2 = windowPos+QPoint(10,10);
+
+    // QTest::mouseMove() doesn't work
+    QTest::mouseMove( mMainWindow->viewport(), windowPos2 );
+    QCOMPARE( spy.count(), 0 );
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleContainerWidget)
+#include "ut_bubblecontainerwidget.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblecontainerwidget/ut_bubblecontainerwidget.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+HEADERS += ../../../bubblecore/src/bubblecontainerwidget.h
+SOURCES += ut_bubblecontainerwidget.cpp \
+           ../../../bubblecore/src/bubblecontainerwidget.cpp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_appear.fxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,13 @@
+<layers>
+<visual>
+
+  <param name="opacity" type="anim">
+      <duration>0.2</duration>
+      <style>linear</style>
+      <keyframe at="0">0</keyframe>
+      <keyframe at="1">1</keyframe>
+  </param>
+
+</visual>
+</layers>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/resources/bubble_muted_disappear.fxml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,12 @@
+<layers>
+<visual>
+
+  <param name="opacity" type="anim">
+      <duration>0.2</duration>
+      <style>linear</style>
+      <keyframe at="0">1</keyframe>
+      <keyframe at="1">0</keyframe>
+  </param>
+
+</visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include <hbapplication.h>
+#include <hbwidget.h>
+#include <hblabel.h>
+#include <hbmainwindow.h>
+#include <hbfontspec.h>
+
+#include "bubbletest.h"
+#include "bubbleeffecthandler.h"
+
+class Container : public HbWidget
+{
+public:
+    Container();
+    ~Container();
+
+    HbLabel *mLabel;
+};
+
+Container::Container()
+{
+    mLabel = new HbLabel(this);
+    mLabel->setAlignment(Qt::AlignCenter);
+    HbFontSpec spec;
+    spec.setRole(HbFontSpec::Primary);
+    spec.setTextHeight(30);
+    mLabel->setFontSpec(spec);
+    QGraphicsLinearLayout* layout =
+        new QGraphicsLinearLayout(Qt::Vertical);
+    layout->addItem(mLabel);
+
+    setLayout(layout);
+}
+
+Container::~Container()
+{
+}
+
+class ut_BubbleEffectHandler : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testMuteAppearEffect();
+    void testMuteDisappearEffect();
+
+private:
+    HbMainWindow* mWindow;
+    BubbleEffectHandler *mEffectHandler;
+    Container *mContainer;
+};
+
+void ut_BubbleEffectHandler::initTestCase()
+{
+    mWindow = new HbMainWindow();
+    mEffectHandler = new BubbleEffectHandler();
+    mContainer = new Container();
+    mContainer->mLabel->setVisible(false);
+    mWindow->addView(mContainer);
+    mWindow->show();
+}
+
+void ut_BubbleEffectHandler::cleanupTestCase()
+{
+    delete mEffectHandler;
+    delete mWindow;
+}
+
+void ut_BubbleEffectHandler::testMuteAppearEffect()
+{
+    QVERIFY(mContainer->mLabel->isVisible()==false);
+    QTest::qWait(500);
+
+    mContainer->mLabel->setPlainText("Appearing");
+
+    mEffectHandler->addEffect(mContainer->mLabel,BubbleMutedAppear);
+    mEffectHandler->startEffect(BubbleMutedAppear);
+    QTest::qWait(1000);
+
+    QVERIFY(mContainer->mLabel->isVisible()==true);
+
+    mEffectHandler->removeEffect(mContainer->mLabel,BubbleMutedAppear);
+}
+
+void ut_BubbleEffectHandler::testMuteDisappearEffect()
+{
+    QVERIFY(mContainer->mLabel->isVisible()==true);
+
+    mContainer->mLabel->setPlainText("Disappearing");
+
+    mEffectHandler->addEffect(mContainer->mLabel,BubbleMutedDisappear);
+    mEffectHandler->startEffect(BubbleMutedDisappear);
+    QTest::qWait(1000);
+
+    QVERIFY(mContainer->mLabel->isVisible()==false);
+
+    mEffectHandler->removeEffect(mContainer->mLabel,BubbleMutedDisappear);
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleEffectHandler)
+#include "ut_bubbleeffecthandler.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+HEADERS += bubbleeffecthandler.h
+SOURCES += ut_bubbleeffecthandler.cpp \
+           bubbleeffecthandler.cpp
+RESOURCES += ut_bubbleeffecthandler.qrc
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleeffecthandler/ut_bubbleeffecthandler.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/">
+        <file alias="bubble_muted_disappear.fxml">resources/bubble_muted_disappear.fxml</file>
+        <file alias="bubble_muted_appear.fxml">resources/bubble_muted_appear.fxml</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheader/ut_bubbleheader.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,228 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+
+#include "bubbletest.h"
+#include "bubbleheader.h"
+
+class ut_BubbleHeader : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testIsUsed();
+    void testBubbleId();
+    void testCallState();
+    void testCallFlags();
+    void testNumberType();
+    void testText();
+    void testCli();
+    void testSecondaryCli();
+    void testTimerCost();
+    void testCallImage();
+    void testShowDefaultAvatar();
+    void testAddActions();
+    void testIsConference();
+    void testIsInConference();
+    void testSetExpandAction();
+    void testReset(); // this should run last
+
+private:
+    BubbleHeader* bubbleHeader; // class under test
+};
+
+void ut_BubbleHeader::initTestCase()
+{
+    bubbleHeader = new BubbleHeader();
+}
+
+void ut_BubbleHeader::cleanupTestCase()
+{
+    delete bubbleHeader;
+}
+
+void ut_BubbleHeader::testIsUsed()
+{
+    bubbleHeader->setIsUsed( true );
+    QVERIFY( bubbleHeader->isUsed() == true );
+}
+
+void ut_BubbleHeader::testBubbleId()
+{
+    bubbleHeader->setBubbleId( 1 );
+    QVERIFY( bubbleHeader->bubbleId() == 1 );
+}
+
+void ut_BubbleHeader::testCallState()
+{
+    bubbleHeader->setCallState( BubbleManager::Active );
+    QVERIFY( bubbleHeader->callState() == BubbleManager::Active );
+
+    bubbleHeader->setCallState( BubbleManager::Disconnected );
+    QVERIFY( bubbleHeader->callState() == BubbleManager::Disconnected );
+
+    bubbleHeader->setCallState( BubbleManager::Incoming );
+    bubbleHeader->setCallState( BubbleManager::Disconnected );
+    QVERIFY( bubbleHeader->callState() == BubbleManager::AlertToDisconnected );
+}
+
+void ut_BubbleHeader::testCallFlags()
+{
+    // set all bits
+    bubbleHeader->setCallFlags( BubbleManager::Diverted );
+    bubbleHeader->setCallFlags( BubbleManager::Video );
+    QVERIFY( bubbleHeader->callFlags() == BubbleManager::Video );
+
+    // set normal (reset all bits)
+    bubbleHeader->setCallFlag( BubbleManager::Normal );
+    QVERIFY( bubbleHeader->callFlags() == 0 );
+
+    // set invidual bit
+    bubbleHeader->setCallFlag( BubbleManager::Diverted );
+    bubbleHeader->setCallFlag( BubbleManager::Video );
+    QVERIFY( bubbleHeader->callFlags() & BubbleManager::Diverted );
+    QVERIFY( bubbleHeader->callFlags() & BubbleManager::Video );
+    QVERIFY( !(bubbleHeader->callFlags() & BubbleManager::NoCiphering) );
+
+    // reset invidual bit
+    bubbleHeader->removeCallFlag( BubbleManager::Video );
+    bubbleHeader->removeCallFlag( BubbleManager::Normal ); // does nothing
+    QVERIFY( bubbleHeader->callFlags() & BubbleManager::Diverted );
+    QVERIFY( !(bubbleHeader->callFlags() & BubbleManager::Video) );
+    QVERIFY( !(bubbleHeader->callFlags() & BubbleManager::NoCiphering) );
+}
+
+void ut_BubbleHeader::testNumberType()
+{
+    bubbleHeader->setNumberType( BubbleManager::Mobile );
+    QVERIFY( bubbleHeader->numberType() == BubbleManager::Mobile );
+}
+
+void ut_BubbleHeader::testText()
+{
+    bubbleHeader->setText( "Calling", Qt::ElideRight );
+    QVERIFY( bubbleHeader->text() == "Calling" );
+    QVERIFY( bubbleHeader->textClipDirection() == Qt::ElideRight );
+
+    bubbleHeader->setText( "", Qt::ElideLeft );
+    QVERIFY( bubbleHeader->text() == "" );
+    QVERIFY( bubbleHeader->textClipDirection() == Qt::ElideLeft );
+}
+
+void ut_BubbleHeader::testCli()
+{
+    bubbleHeader->setCli( "John Doe", Qt::ElideRight );
+    QVERIFY( bubbleHeader->cli() == "John Doe" );
+    QVERIFY( bubbleHeader->cliClipDirection() == Qt::ElideRight );
+
+    bubbleHeader->setCli( "+358501234567", Qt::ElideLeft );
+    QVERIFY( bubbleHeader->cli() == "+358501234567" );
+    QVERIFY( bubbleHeader->cliClipDirection() == Qt::ElideLeft );
+}
+
+void ut_BubbleHeader::testSecondaryCli()
+{
+    bubbleHeader->setSecondaryCli( "John Doe", Qt::ElideRight );
+    QVERIFY( bubbleHeader->secondaryCli() == "John Doe" );
+    QVERIFY( bubbleHeader->secondaryCliClipDirection() == Qt::ElideRight );
+
+    bubbleHeader->setSecondaryCli( "+358501234567", Qt::ElideLeft );
+    QVERIFY( bubbleHeader->secondaryCli() == "+358501234567" );
+    QVERIFY( bubbleHeader->secondaryCliClipDirection() == Qt::ElideLeft );
+}
+
+void ut_BubbleHeader::testTimerCost()
+{
+    bubbleHeader->setTimerCost( "10:01" );
+    QVERIFY( bubbleHeader->timerCost() == "10:01" );
+}
+
+void ut_BubbleHeader::testCallImage()
+{
+    bubbleHeader->setCallImage( "image.png" );
+    QVERIFY( bubbleHeader->callImage() == "image.png" );
+}
+
+void ut_BubbleHeader::testShowDefaultAvatar()
+{
+    bubbleHeader->setShowDefaultAvatar(true);
+    QVERIFY( bubbleHeader->showDefaultAvatar() == true);
+    bubbleHeader->setShowDefaultAvatar(false);
+    QVERIFY( bubbleHeader->showDefaultAvatar() == false);
+}
+
+void ut_BubbleHeader::testAddActions()
+{
+    for ( int i=0; i < 4; i++ )
+    {
+        HbAction* action = new HbAction( "Test", this);
+        bubbleHeader->addAction( action );
+    }
+
+    QVERIFY( bubbleHeader->actions().count() == 4 );
+
+    bubbleHeader->clearActions();
+}
+
+void ut_BubbleHeader::testIsConference()
+{
+    QVERIFY( bubbleHeader->isConference() == false );
+}
+
+void ut_BubbleHeader::testIsInConference()        
+{
+    bubbleHeader->setInConference(true);
+    QVERIFY( bubbleHeader->isInConference() == true );    
+}
+
+void ut_BubbleHeader::testSetExpandAction()
+{
+    HbAction* action = new HbAction( "Test", this);
+
+    bubbleHeader->setExpandAction( action );
+    QVERIFY( bubbleHeader->expandAction() == action );
+
+    bubbleHeader->setExpandAction( 0 );
+    QVERIFY( bubbleHeader->expandAction() == 0 );
+}
+
+void ut_BubbleHeader::testReset()
+{
+    bubbleHeader->reset();
+    QVERIFY( bubbleHeader->isUsed() == false );
+    QVERIFY( bubbleHeader->bubbleId() == 1 );
+    QVERIFY( bubbleHeader->callState() == BubbleManager::None );
+    QVERIFY( bubbleHeader->callFlags() == 0 );
+    QVERIFY( bubbleHeader->numberType() == BubbleManager::NotSet );
+    QVERIFY( bubbleHeader->cli() == "" );
+    QVERIFY( bubbleHeader->secondaryCli() == "" );
+    QVERIFY( bubbleHeader->timerCost() == "" );
+    QVERIFY( bubbleHeader->callImage() == "" );
+    QVERIFY( bubbleHeader->isInConference() == false );
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleHeader)
+#include "ut_bubbleheader.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheader/ut_bubbleheader.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+SOURCES += ut_bubbleheader.cpp \
+           ../../../bubblecore/src/bubbleheader.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.css	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,70 @@
+
+
+BubbleHeadingWidget[layoutOption="three_lines"]
+{
+    layout: three_lines_layout;
+}
+
+BubbleHeadingWidget[layoutOption="two_lines"]
+{
+    layout: two_lines_layout;
+}
+
+BubbleHeadingWidget[layoutOption="one_line"]
+{
+    layout: one_line_layout;
+}
+
+BubbleHeadingWidget:text_line_1
+{
+    preferred-height: var(hb-param-text-height-primary);
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:text_line_2[layoutOption!="one_line"]
+{
+    preferred-height: var(hb-param-text-height-primary);
+    preferred-width: -1;
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    top: -var(hb-param-margin-gene-middle-vertical);
+    text-align: left;
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:text_line_2[layoutOption="one_line"]
+{
+    preferred-height: var(hb-param-text-height-primary);
+    preferred-width: 30un;
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    text-align: right;
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:text_line_3
+{
+    preferred-height: var(hb-param-text-height-primary);
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    top: -var(hb-param-margin-gene-middle-vertical);
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:status_icon
+{
+    fixed-width:   var(hb-param-graphic-size-primary-large);
+    fixed-height:  var(hb-param-graphic-size-primary-large);
+}
+
+BubbleHeadingWidget:number_type_icon
+{
+    fixed-height: var(hb-param-graphic-size-secondary);
+    fixed-width:  var(hb-param-graphic-size-secondary);
+    color: var(qtc_list_item_title_normal);
+}
+
+BubbleHeadingWidget:ciphering_icon
+{
+    fixed-height: 2.5un;
+    fixed-width:  2.5un;
+    color: var(qtc_list_item_title_normal);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/resources/bubbleheadingwidget.widgetml	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,63 @@
+<hbwidget version="0.1" type="be">  
+  <layout name="three_lines_layout" type="mesh">
+    <meshitem src="status_icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="status_icon" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="number_type_icon" srcEdge="RIGHT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="number_type_icon" srcEdge="BOTTOM" dst="status_icon" dstEdge="BOTTOM"/>
+    
+    <meshitem src="ciphering_icon" srcEdge="LEFT" dst="status_icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering_icon" srcEdge="TOP" dst="status_icon" dstEdge="TOP"/>    
+    
+    <meshitem src="text_line_1" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="text_line_2" srcEdge="TOP" dst="text_line_1" dstEdge="BOTTOM"/>
+    <meshitem src="text_line_2" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    
+    <meshitem src="text_line_3" srcEdge="TOP" dst="text_line_2" dstEdge="BOTTOM"/>
+    <meshitem src="text_line_3" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_3" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+  </layout>
+
+  <layout name="two_lines_layout" type="mesh">
+    <meshitem src="status_icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="status_icon" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="number_type_icon" srcEdge="RIGHT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="number_type_icon" srcEdge="BOTTOM" dst="status_icon" dstEdge="BOTTOM"/>
+
+    <meshitem src="ciphering_icon" srcEdge="LEFT" dst="status_icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering_icon" srcEdge="TOP" dst="status_icon" dstEdge="TOP"/>    
+    
+    <meshitem src="text_line_1" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="TOP" dst="" dstEdge="TOP"/>
+    
+    <meshitem src="text_line_2" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="text_line_2" srcEdge="TOP" dst="text_line_1" dstEdge="BOTTOM"/>
+  </layout>
+
+  <layout name="one_line_layout" type="mesh">
+    <meshitem src="status_icon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
+    <meshitem src="status_icon" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    
+    <meshitem src="number_type_icon" srcEdge="RIGHT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="number_type_icon" srcEdge="BOTTOM" dst="status_icon" dstEdge="BOTTOM"/>
+    
+    <meshitem src="ciphering_icon" srcEdge="LEFT" dst="status_icon" dstEdge="LEFT"/>
+    <meshitem src="ciphering_icon" srcEdge="TOP" dst="status_icon" dstEdge="TOP"/>    
+    
+    <meshitem src="text_line_1" srcEdge="LEFT" dst="status_icon" dstEdge="RIGHT"/>
+    <meshitem src="text_line_1" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    <meshitem src="text_line_1" srcEdge="RIGHT" dst="text_line_2" dstEdge="LEFT"/>
+    
+    <meshitem src="text_line_2" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    <meshitem src="text_line_2" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+  </layout>
+  
+</hbwidget>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbstyle.h>
+
+#include "bubbletest.h"
+#include "bubbleheadingwidget.h"
+#include "bubbleheader.h"
+#include "bubblemanagerif.h"
+
+class ut_BubbleHeadingWidget : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+    void cleanupTest();
+
+    void testThreeLinedHeading();
+    void testTwoLinedHeading();
+    void testOneLinedHeading();
+
+private:
+    BubbleHeadingWidget* mHeading;
+    HbMainWindow* mMainWindow;
+    int mStyleBaseId;
+};
+
+void ut_BubbleHeadingWidget::initTestCase()
+{
+    mMainWindow = new HbMainWindow();
+    mHeading = new BubbleHeadingWidget();
+    mMainWindow->addView(mHeading);
+    mMainWindow->show();
+}
+
+void ut_BubbleHeadingWidget::cleanupTestCase()
+{
+    delete mMainWindow;
+}
+
+void ut_BubbleHeadingWidget::cleanupTest()
+{
+    mHeading->hide();
+    mHeading->reset();
+}
+
+void ut_BubbleHeadingWidget::testThreeLinedHeading()
+{
+    BubbleHeader header;
+    header.setCli("John Doe",Qt::ElideRight);
+    header.setSecondaryCli("12345",Qt::ElideLeft);
+    header.setText("",Qt::ElideRight);
+    header.setTimerCost("0:00");
+    header.setCallState(BubbleManagerIF::Active);
+    header.setCallFlag(BubbleManagerIF::NoCiphering);
+    mHeading->setLineCount(3);
+    Q_ASSERT(mHeading->lineCount()==3);
+    mHeading->readBubbleHeader(header);
+    mHeading->show();
+    QTest::qWait(1000);
+    mHeading->updateTimerDisplayNow();
+}
+
+void ut_BubbleHeadingWidget::testTwoLinedHeading()
+{
+    BubbleHeader header;
+    header.setCli("John Doe",Qt::ElideRight);
+    header.setSecondaryCli("12345",Qt::ElideLeft);
+    header.setText("",Qt::ElideRight);
+    header.setTimerCost("0:00");
+    header.setCallState(BubbleManagerIF::Outgoing);
+    header.setCallFlag(BubbleManagerIF::NoCiphering);
+
+    mHeading->setLineCount(2);
+    Q_ASSERT(mHeading->lineCount()==2);
+    mHeading->readBubbleHeader(header);
+    mHeading->show();
+    QTest::qWait(100);
+    mHeading->updateTimerDisplayNow();
+}
+
+void ut_BubbleHeadingWidget::testOneLinedHeading()
+{
+    BubbleHeader header;
+    header.setCli("John Doe",Qt::ElideRight);
+    header.setSecondaryCli("12345",Qt::ElideLeft);
+    header.setText("",Qt::ElideRight);
+    header.setTimerCost("0:00");
+    header.setCallState(BubbleManagerIF::Active);
+    header.setCallFlag(BubbleManagerIF::NoCiphering);
+
+    mHeading->setLineCount(1);
+    Q_ASSERT(mHeading->lineCount()==1);
+    header.setCallState(BubbleManagerIF::OnHold);
+    mHeading->readBubbleHeader(header);
+    mHeading->show();
+    QTest::qWait(100);
+    mHeading->updateTimerDisplayNow();
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleHeadingWidget)
+#include "ut_bubbleheadingwidget.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+HEADERS += ../../../bubblecore/src/bubbleheadingwidget.h \
+           ../../../bubblecore/src/bubblebutton.h
+
+SOURCES += ut_bubbleheadingwidget.cpp \
+           ../../../bubblecore/src/bubbleheadingwidget.cpp \
+           ../../../bubblecore/src/bubbleheader.cpp \
+           ../../../bubblecore/src/bubbleutils.cpp \
+           ../../../bubblecore/src/bubblebutton.cpp
+
+RESOURCES += ut_bubbleheadingwidget.qrc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleheadingwidget/ut_bubbleheadingwidget.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/">
+        <file alias="bubbleheadingwidget.widgetml">resources/bubbleheadingwidget.widgetml</file>
+        <file alias="bubbleheadingwidget.css">resources/bubbleheadingwidget.css</file>
+    </qresource>
+</RCC>
Binary file phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic1.png has changed
Binary file phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/resources/testpic2.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,230 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbstyle.h>
+
+#include "bubbletest.h"
+#include "bubbleimagemanager.h"
+
+static const int WAIT_TIME = 500;
+
+class ut_BubbleImageManager : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testLoadImage();
+    void testLoadImageQueued();
+    void testLoadNonExistingImage();
+
+    void testUnloadImageOutstandingRequest();
+
+    void testReleasePixmaps();
+
+private:
+    QString fileNameWithPath(const QString& fileName);
+
+private:
+    BubbleImageManager* mImageManager;
+};
+
+void ut_BubbleImageManager::initTestCase()
+{
+    mImageManager = new BubbleImageManager();
+}
+
+void ut_BubbleImageManager::cleanupTestCase()
+{
+    delete mImageManager;
+}
+
+QString ut_BubbleImageManager::fileNameWithPath(const QString& fileName)
+{
+#ifdef __WINS__
+    return "c:/data/images/" + fileName;
+#else
+    return ":/resources/" + fileName;
+#endif
+}
+
+void ut_BubbleImageManager::testLoadImage()
+{
+    QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString)));
+
+    QString imageFile1 = fileNameWithPath("testpic1.png");
+    qDebug() << imageFile1;
+    mImageManager->loadImage(imageFile1);
+
+    // wait loading to finish
+    QTest::qWait(2*WAIT_TIME);
+
+    QVERIFY(spy.count()==1);
+    QList<QVariant> arguments = spy.takeFirst();
+    QVERIFY(arguments.at(0).toString() == imageFile1);
+
+    const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1);
+    QVERIFY(pixmap1!=0);
+
+    // try to load cached image
+    mImageManager->loadImage(imageFile1);
+    QVERIFY(spy.count()==0);
+
+    QString imageFile2 = fileNameWithPath("testpic2.jpg");
+    qDebug() << imageFile2;
+    mImageManager->loadImage(imageFile2);
+
+    // wait loading to finish
+    QTest::qWait(WAIT_TIME);
+
+    QVERIFY(spy.count()==1);
+    arguments.clear();
+    arguments = spy.takeFirst();
+    QVERIFY(arguments.at(0).toString() == imageFile2);
+
+    const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2);
+    QVERIFY(pixmap2!=0);
+
+    mImageManager->unloadImage(imageFile1);
+    mImageManager->unloadImage(imageFile2);
+}
+
+void ut_BubbleImageManager::testLoadImageQueued()
+{
+    QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString)));
+
+    QString imageFile1 = fileNameWithPath("testpic1.png");
+    qDebug() << imageFile1;
+    mImageManager->loadImage(imageFile1);
+
+    QString imageFile2 = fileNameWithPath("testpic2.jpg");
+    qDebug() << imageFile2;
+    mImageManager->loadImage(imageFile2);
+
+    // try to load images that are being loaded
+    mImageManager->loadImage(imageFile1);
+    mImageManager->loadImage(imageFile2);
+
+    // wait loading to finish
+    QTest::qWait(WAIT_TIME);
+
+    QVERIFY(spy.count()==2);
+
+    const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1);
+    QVERIFY(pixmap1!=0);
+
+    const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2);
+    QVERIFY(pixmap2!=0);
+
+    mImageManager->unloadImage(imageFile1);
+    mImageManager->unloadImage(imageFile2);
+}
+
+void ut_BubbleImageManager::testLoadNonExistingImage()
+{
+    QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString)));
+
+    QString imageFile1 = fileNameWithPath("foobar.png");
+    qDebug() << imageFile1;
+    mImageManager->loadImage(imageFile1);
+
+    // wait loading to finish
+    QTest::qWait(WAIT_TIME);
+
+    QVERIFY(spy.count()==0);
+
+    const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1);
+    QVERIFY(pixmap1==0);
+
+    mImageManager->unloadImage(imageFile1);
+}
+
+void ut_BubbleImageManager::testUnloadImageOutstandingRequest()
+{
+    QSignalSpy spy(mImageManager,SIGNAL(pixmapReady(QString)));
+
+    QString imageFile1 = fileNameWithPath("testpic1.png");
+    qDebug() << imageFile1;
+    mImageManager->loadImage(imageFile1);
+    QTest::qWait(50);
+    mImageManager->unloadImage(imageFile1);
+    mImageManager->unloadImage("foobar.png");
+
+    // wait loading to finish
+    QTest::qWait(WAIT_TIME);
+
+    QVERIFY(spy.count()==0);
+
+    const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1);
+    QVERIFY(pixmap1==0);
+
+    QString imageFile2 = fileNameWithPath("testpic2.jpg");;
+    qDebug() << imageFile2;
+    mImageManager->loadImage(imageFile2);
+
+    QTest::qWait(50);
+    mImageManager->unloadImage(imageFile2);
+
+    // wait loading to finish
+    QTest::qWait(WAIT_TIME);
+
+    QVERIFY(spy.count()==0);
+
+    const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2);
+    QVERIFY(pixmap2==0);
+}
+
+void ut_BubbleImageManager::testReleasePixmaps()
+{
+    QString imageFile1 = fileNameWithPath("testpic1.png");
+    qDebug() << imageFile1;
+    mImageManager->loadImage(imageFile1);
+
+    QString imageFile2 = fileNameWithPath("testpic2.jpg");
+    qDebug() << imageFile2;
+    mImageManager->loadImage(imageFile2);
+
+    // wait loading to finish
+    QTest::qWait(WAIT_TIME);
+
+    const QPixmap* pixmap1 = mImageManager->pixmap(imageFile1);
+    QVERIFY(pixmap1!=0);
+
+    const QPixmap* pixmap2 = mImageManager->pixmap(imageFile2);
+    QVERIFY(pixmap2!=0);
+
+    mImageManager->releasePixmaps();
+
+    pixmap1 = mImageManager->pixmap(imageFile1);
+    QVERIFY(pixmap1==0);
+
+    pixmap2 = mImageManager->pixmap(imageFile2);
+    QVERIFY(pixmap2==0);
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleImageManager)
+#include "ut_bubbleimagemanager.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL -TCB
+
+    BLD_INF_RULES.prj_exports += \
+        "./resources/testpic1.png  /epoc32/winscw/c/data/images/testpic1.png"
+    BLD_INF_RULES.prj_exports += \
+        "./resources/testpic2.jpg  /epoc32/winscw/c/data/images/testpic2.jpg"
+        
+} else:win32 {
+    DESTDIR = ./
+}
+
+HEADERS += ../../../bubblecore/src/bubbleimagemanager.h \
+           ../../../bubblecore/src/bubbleimagemanager_p.h
+SOURCES += ut_bubbleimagemanager.cpp \
+           ../../../bubblecore/src/bubbleimagemanager.cpp
+
+symbian {
+    SOURCES += ../../../bubblecore/src/bubbleimagemanager_p.cpp
+    LIBS += -lthumbnailmanagerqt
+} else:win32 {
+    SOURCES += ../../../bubblecore/src/bubbleimagemanager_p_stub.cpp
+}
+
+RESOURCES += ut_bubbleimagemanager.qrc
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagemanager/ut_bubbleimagemanager.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/" >
+        <file>resources/testpic1.png</file>
+        <file>resources/testpic2.jpg</file>
+    </qresource>
+</RCC>
Binary file phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/data/pixmap.png has changed
Binary file phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/data/pixmap_wide.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/data/vector.svg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60px" version="1.1" viewBox="0 0 60 60" width="60px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<rect fill="none" height="60" width="60"/>
+<path d="M2.438,60c0,0,2.38-18.308,4.263-19c1.884-0.693,11.444-3.266,12.336-3.859  c0.893-0.594,1.388-1.781,2.875-2.771c1.487-0.989,2.677-1.484,2.677-1.484l-0.297-2.276c0,0-1.982-3.959-2.082-4.651  s-1.586-1.188-2.28-2.771c-0.694-1.583,0.396-12.568,0.396-12.568s7.931-8.609,11.004-8.016s2.577,1.781,3.568,1.979  c0.992,0.198,1.785,0.099,3.768,0.891c1.983,0.792,3.668,1.286,3.966,3.464c0.297,2.177,0.297,6.63,0.198,7.224  c-0.1,0.594,0.793,0.594,0.892,1.287c0.1,0.693-0.099,1.583-0.396,2.771s-1.883,3.662-2.181,4.255s-1.784,4.651-1.884,6.037  c-0.099,1.386,0.396,2.969,0.991,3.067s0.595,0.099,2.28,1.979s3.073,2.771,4.659,3.266c1.587,0.495,6.307,2.573,7.199,5.048  c0.892,2.474-0.198,2.275,0.595,3.562c0.794,1.287,1.884,4.157,1.982,6.434C57.066,56.14,57.562,60,57.562,60H2.438z" fill="#4D4D4D"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,106 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbstyle.h>
+
+#include "bubbletest.h"
+#include "bubbleimagewidget.h"
+#include "bubbleimagemanager.h"
+
+class ut_BubbleImageWidget : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testPixmap();
+    void testWidePixmap();
+    void testDefaultAvatar();
+
+private:
+    QString fileNameWithPath(const QString& fileName);    
+
+private:
+    BubbleImageWidget* mImage;
+    HbMainWindow* mMainWindow;
+    BubbleImageManager* mImageManager;
+};
+
+QString ut_BubbleImageWidget::fileNameWithPath(const QString& fileName)
+{
+#ifdef __WINS__
+    return "c:/data/images/" + fileName;
+#else
+    return ":/data/" + fileName;
+#endif
+}
+
+void ut_BubbleImageWidget::initTestCase()
+{
+    mMainWindow = new HbMainWindow();
+    mImageManager = new BubbleImageManager();
+    mImage = new BubbleImageWidget(*mImageManager);
+    mMainWindow->addView(mImage);
+    mMainWindow->show();
+}
+
+void ut_BubbleImageWidget::cleanupTestCase()
+{
+    delete mMainWindow;
+    delete mImageManager;
+}
+
+void ut_BubbleImageWidget::testPixmap()
+{    
+    mImage->hide();
+    mImage->setImage(fileNameWithPath("pixmap.png"));
+    mImage->show();
+    // set same image again
+    QTest::qWait(500);
+    // there is now way to verify using public API
+}
+
+void ut_BubbleImageWidget::testWidePixmap()
+{
+    mImage->hide();
+    mImage->setImage(fileNameWithPath("pixmap_wide.png"));
+    mImage->show();
+    QTest::qWait(500);
+    // there is now way to verify using public API
+}
+
+void ut_BubbleImageWidget::testDefaultAvatar()
+{
+    mImage->hide();
+    mImage->setImage("");
+    mImage->show();
+    QTest::qWait(500);
+    // there is now way to verify using public API
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleImageWidget)
+#include "ut_bubbleimagewidget.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL -TCB
+
+
+    BLD_INF_RULES.prj_exports += \
+        "./data/pixmap.png  /epoc32/winscw/c/data/images/pixmap.png"
+    BLD_INF_RULES.prj_exports += \
+        "./data/pixmap_wide.png  /epoc32/winscw/c/data/images/pixmap_wide.png"
+
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+HEADERS += ../../../bubblecore/src/bubbleimagewidget.h \
+           ../../../bubblecore/src/bubbleimagemanager.h \
+           ../../../bubblecore/src/bubbleimagemanager_p.h
+SOURCES += ut_bubbleimagewidget.cpp \
+           ../../../bubblecore/src/bubbleimagewidget.cpp \
+           ../../../bubblecore/src/bubbleimagemanager.cpp
+
+symbian {
+    SOURCES += ../../../bubblecore/src/bubbleimagemanager_p.cpp
+    LIBS += -lthumbnailmanagerqt
+} else:win32 {
+    SOURCES += ../../../bubblecore/src/bubbleimagemanager_p_stub.cpp
+}
+
+RESOURCES += ut_bubbleimagewidget.qrc
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.qrc	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,7 @@
+<RCC>
+    <qresource prefix="/" >
+        <file>data/vector.svg</file>
+        <file>data/pixmap.png</file>
+        <file>data/pixmap_wide.png</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,83 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbaction.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbstyle.h>
+
+#include "bubbletest.h"
+#include "bubbleparticipantlistitem.h"
+
+class ut_BubbleParticipantListItem : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void testCreateItem();
+    void testUpdateChildItems();
+
+private:
+    BubbleParticipantListItem* mItem;
+    HbMainWindow* mMainWindow;
+    int mStyleBaseId;
+};
+
+void ut_BubbleParticipantListItem::initTestCase()
+{
+    mMainWindow = new HbMainWindow();
+    mItem = new BubbleParticipantListItem();
+    mMainWindow->addView(mItem);
+    BubbleParticipantListItem* item =
+        static_cast<BubbleParticipantListItem*>(mItem);
+    item->updateChildItems();
+    mMainWindow->show();
+}
+
+void ut_BubbleParticipantListItem::cleanupTestCase()
+{
+    mItem->clearActions();
+    delete mMainWindow;
+}
+
+void ut_BubbleParticipantListItem::testCreateItem()
+{
+    HbAbstractViewItem* item = mItem->createItem();
+    Q_ASSERT(item);
+}
+
+void ut_BubbleParticipantListItem::testUpdateChildItems()
+{
+    HbAction act1("Action-1");
+    HbAction act2("Action-2");
+    mItem->addAction(&act1);
+    mItem->addAction(&act2);
+    mItem->updateChildItems();
+    mItem->setExpanded(true);
+    mItem->updateChildItems();
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleParticipantListItem)
+#include "ut_bubbleparticipantlistitem.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+HEADERS += ../../../bubblecore/src/bubbleparticipantlistitem.h \
+           ../../../bubblecore/src/bubblebutton.h
+
+SOURCES += ut_bubbleparticipantlistitem.cpp \
+           ../../../bubblecore/src/bubbleparticipantlistitem.cpp \
+           ../../../bubblecore/src/bubbleutils.cpp \
+           ../../../bubblecore/src/bubbleheader.cpp \
+           ../../../bubblecore/src/bubbleconferenceheader.cpp \
+           ../../../bubblecore/src/bubblebutton.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblepartlistmodel/ut_bubblepartlistmodel.cpp	Fri Jun 04 10:19:18 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:
+*
+*/
+
+#include <QtGui>
+#include <QtTest/QtTest>
+#include <hbapplication.h>
+#include <hbtextitem.h>
+#include <hbiconitem.h>
+
+#include "bubbletest.h"
+#include "bubbleparticipantlistmodel.h"
+
+class ut_BubbleParticipantListModel : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+    void cleanupTest();
+    
+    void test_addParticipant();
+    void test_removeParticipant();
+    void test_bubbleId();
+    void test_dataModel();
+    void test_reset();
+
+private:
+    BubbleParticipantListModel *mModel;
+};
+
+void ut_BubbleParticipantListModel::initTestCase()
+{
+    mModel = new BubbleParticipantListModel();
+}
+
+void ut_BubbleParticipantListModel::cleanupTestCase()
+{
+    delete mModel;
+}
+
+void ut_BubbleParticipantListModel::cleanupTest()
+{
+    mModel->reset();
+}
+
+void ut_BubbleParticipantListModel::test_addParticipant()
+{
+    QSignalSpy spyDataChanged(mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
+
+    mModel->addParticipant(1,"Bubble-1",8,true);
+    mModel->addParticipant(2,"Bubble-2",9,false);
+    mModel->addParticipant(3,"Bubble-3",10,true);
+    QVERIFY(mModel->rowCount()==3);
+    QVERIFY(spyDataChanged.count()==0);
+
+    // name changed
+    mModel->addParticipant(2,"Bubble-Two",9,false);
+    QVERIFY(mModel->rowCount()==3);
+    QVERIFY(spyDataChanged.count()==1);
+
+    // state changed
+    mModel->addParticipant(2,"Bubble-Two",11,false);
+    QVERIFY(mModel->rowCount()==3);
+    QVERIFY(spyDataChanged.count()==2);
+
+    // ciphering changed
+    mModel->addParticipant(2,"Bubble-Two",11,true);
+    QVERIFY(mModel->rowCount()==3);
+    QVERIFY(spyDataChanged.count()==3);
+}
+
+void ut_BubbleParticipantListModel::test_removeParticipant()
+{
+    mModel->addParticipant(1,"Bubble-1",8,true);
+    mModel->addParticipant(2,"Bubble-2",9,false);
+    mModel->addParticipant(3,"Bubble-3",10,true);
+
+    mModel->removeParticipant(2);
+    QVERIFY(mModel->rowCount()==2);
+
+    mModel->removeParticipant(3);
+    QVERIFY(mModel->rowCount()==1);
+
+    mModel->addParticipant(2,"Bubble-2",9,false);
+    QVERIFY(mModel->rowCount()==2);
+}
+
+void ut_BubbleParticipantListModel::test_bubbleId()
+{
+    mModel->addParticipant(1,"Bubble-1",8,true);
+    mModel->addParticipant(2,"Bubble-2",9,false);
+    mModel->addParticipant(3,"Bubble-3",10,true);
+
+    QVERIFY(mModel->bubbleId(1)==2);
+    QVERIFY(mModel->bubbleId(4)==-1);
+}
+
+void ut_BubbleParticipantListModel::test_dataModel()
+{
+    mModel->addParticipant(1,"Bubble-1",8,true);
+    mModel->addParticipant(2,"Bubble-2",9,false);
+    mModel->addParticipant(3,"Bubble-3",10,true);
+
+    QModelIndex index = mModel->index(1,0);
+
+    QVERIFY(index.data(Qt::DecorationRole).toInt()==9);
+    QVERIFY(index.data(Qt::DisplayRole).toString()=="Bubble-2");
+    QVERIFY(index.data(Qt::StatusTipRole).toBool()==false);
+    QVERIFY(index.data(Qt::UserRole).isNull());
+
+    index = mModel->index(2,0);
+    QVERIFY(index.data(Qt::StatusTipRole).toBool()==true);
+
+    index = mModel->index(4,0);
+    QVERIFY(index.data(Qt::DisplayRole).isNull());
+}
+
+void ut_BubbleParticipantListModel::test_reset()
+{
+    mModel->reset();
+    QVERIFY(mModel->rowCount()==0);
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleParticipantListModel)
+#include "ut_bubblepartlistmodel.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubblepartlistmodel/ut_bubblepartlistmodel.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+#
+HEADERS += ../../../bubblecore/src/bubbleparticipantlistmodel.h
+SOURCES += ut_bubblepartlistmodel.cpp \
+           ../../../bubblecore/src/bubbleparticipantlistmodel.cpp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,733 @@
+/*!
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <QtGui>
+#include <QtTest/QtTest>
+#include <hbapplication.h>
+#include <hbtextitem.h>
+#include <hbiconitem.h>
+#include <bubblebutton.h>
+#include <hbaction.h>
+
+#include "bubbletest.h"
+#include "bubbleutils.h"
+#include "bubbleheader.h"
+#include "bubbleconferenceheader.h"
+
+class ut_BubbleUtils : public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    void cleanupTestCase();
+
+    void test_setCallHeaderTexts3Lines_incoming();
+    void test_setCallHeaderTexts3Lines_waiting();
+    void test_setCallHeaderTexts3Lines_active();
+    void test_setCallHeaderTexts3Lines_disconnected();
+    void test_setCallHeaderTexts3Lines_outgoing();
+    void test_setCallHeaderTexts3Lines_alerting();
+    void test_setCallHeaderTexts3Lines_held();
+    void test_setCallHeaderTexts3Lines_alerttodisconnected();
+
+    void test_setCallHeaderTexts2Lines_waiting();
+    void test_setCallHeaderTexts2Lines_alerttodisconnected();
+    void test_setCallHeaderTexts2Lines_active();
+    void test_setCallHeaderTexts2Lines_held();
+    void test_setCallHeaderTexts2Lines_disconnected();
+    void test_setCallHeaderTexts2Lines_outgoing();
+
+    void test_compareHeaders();
+
+    void test_setButtonStyleForAction();
+
+    void test_voiceCallStatusIcon();
+    void test_videoCallStatusIcon();
+    void test_voipCallStatusIcon();
+
+    void test_numberTypeIcon();
+
+    void test_cipheringIcon();
+
+private:
+};
+
+void ut_BubbleUtils::initTestCase()
+{
+}
+
+void ut_BubbleUtils::cleanupTestCase()
+{
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_incoming()
+{
+    // incoming call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+    
+    header.setCallState( BubbleManager::Incoming );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "calling", Qt::ElideRight );
+    
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "calling" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "" );
+    
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+        
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "calling" );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_waiting()
+{
+    // incoming call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Waiting );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "waiting", Qt::ElideRight );
+
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "waiting" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "" );
+
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "waiting" );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_active()
+{
+    // active call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Active );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "", Qt::ElideRight );
+    
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "" );
+    QVERIFY( text3.text() == "" );
+    
+    // add timer
+    header.setTimerCost( "00:00" );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    QVERIFY( text1.text()== "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "00:00" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "" );
+    header.setTimerCost( "" );
+    
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+        
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "" );
+    
+    // add timer
+    header.setTimerCost( "00:00" );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    QVERIFY( text1.text()== "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "00:00" );
+    QVERIFY( text3.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_disconnected()
+{
+    // disconnected call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Disconnected );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "discon", Qt::ElideRight );
+    header.setTimerCost( "00:00" );
+    
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "discon" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "" );
+    
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+        
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "discon" );
+    QVERIFY( text3.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_outgoing()
+{
+    // outgoing call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Outgoing );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "calling", Qt::ElideRight );
+    
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    
+    QVERIFY( text1.text() == "calling" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "john" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "" );
+    
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+        
+    QVERIFY( text1.text() == "calling" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "john" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "12345" );
+    QVERIFY( text3.elideMode() == Qt::ElideLeft );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_alerting()
+{
+    // alerting call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Alerting );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "calling", Qt::ElideRight );
+    
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "" );
+    QVERIFY( text3.text() == "" );
+    
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+        
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "" );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_held()
+{
+    // held
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::OnHold );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "on hold", Qt::ElideRight );
+    header.setTimerCost( "00:00" );
+    
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+    
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "on hold" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "" );
+    
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+        
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "on hold" );
+    QVERIFY( text3.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts3Lines_alerttodisconnected()
+{
+    // incoming call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    HbTextItem text3;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Incoming );
+    header.setCallState( BubbleManager::AlertToDisconnected );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "disconnected", Qt::ElideRight );
+
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "disconnected" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+    QVERIFY( text3.text() == "" );
+
+    // add secondary cli
+    header.setSecondaryCli( "12345", Qt::ElideLeft );
+    BubbleUtils::setCallHeaderTexts3Lines(header, text1, text2, text3, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "12345" );
+    QVERIFY( text2.elideMode() == Qt::ElideLeft );
+    QVERIFY( text3.text() == "disconnected" );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts2Lines_waiting()
+{
+    // waiting call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Waiting );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "waiting", Qt::ElideRight );
+
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "waiting" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+
+    // add secondary cli
+    header.setSecondaryCli("12345",Qt::ElideLeft);
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "waiting" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts2Lines_alerttodisconnected()
+{
+    // waiting call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::AlertToDisconnected );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "disconnected", Qt::ElideRight );
+
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "disconnected" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+
+    // add secondary cli
+    header.setSecondaryCli("12345",Qt::ElideLeft);
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "disconnected" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts2Lines_active()
+{
+    // active call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Active );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "", Qt::ElideRight );
+
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "" );
+
+    // add timer
+    header.setTimerCost( "00:00" );
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "00:00" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts2Lines_held()
+{
+    // held
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::OnHold );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "on hold", Qt::ElideRight );
+    header.setTimerCost( "00:00" );
+
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "on hold" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts2Lines_disconnected()
+{
+    // disconnected call
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState( BubbleManager::Disconnected );
+    header.setCli( "john", Qt::ElideRight );
+    header.setText( "discon", Qt::ElideRight );
+    header.setTimerCost( "00:00" );
+
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+    QVERIFY( text1.text() == "john" );
+    QVERIFY( text1.elideMode() == Qt::ElideRight );
+    QVERIFY( text2.text() == "discon" );
+    QVERIFY( text2.elideMode() == Qt::ElideRight );
+}
+
+void ut_BubbleUtils::test_setCallHeaderTexts2Lines_outgoing()
+{
+    // outgoing
+    BubbleHeader header;
+    HbTextItem text1;
+    HbTextItem text2;
+    int cliLine;
+    int timerLine;
+
+    header.setCallState(BubbleManager::Outgoing);
+    header.setCli("john", Qt::ElideRight);
+    header.setText("calling", Qt::ElideRight);
+    header.setTimerCost("00:00");
+
+    BubbleUtils::setCallHeaderTexts2Lines(header, text1, text2, cliLine, timerLine);
+    QCOMPARE(text1.text(), QString("calling"));
+    QCOMPARE(text1.elideMode(), Qt::ElideRight);
+    QCOMPARE(text2.text(), QString("john"));
+    QCOMPARE(text2.elideMode(), Qt::ElideRight);
+}
+
+void ut_BubbleUtils::test_compareHeaders()
+{
+    BubbleHeader header1;
+    BubbleHeader header2;
+    BubbleConferenceHeader headerC;
+
+    header1.setCallState(BubbleManagerIF::Active);
+    header2.setCallState(BubbleManagerIF::Waiting);
+    QVERIFY( BubbleUtils::compareHeaders(&header1,&header2) == false );
+
+    header1.setCallState(BubbleManagerIF::Active);
+    header2.setCallState(BubbleManagerIF::OnHold);
+    QVERIFY( BubbleUtils::compareHeaders(&header1,&header2) == true );
+
+    headerC.setCallState(BubbleManagerIF::Active);
+    header1.setCallState(BubbleManagerIF::OnHold);
+
+    QVERIFY( BubbleUtils::compareHeaders(&headerC,&header1) == false );
+}
+
+void ut_BubbleUtils::test_setButtonStyleForAction()
+{
+    BubbleButton button;
+    HbAction action;
+
+    action.setSoftKeyRole(QAction::NoSoftKey);
+    BubbleUtils::setButtonStyleForAction(button,action);
+    QVERIFY(button.buttonType()==BubbleButton::DefaultButton);
+
+    action.setSoftKeyRole(QAction::PositiveSoftKey);
+    BubbleUtils::setButtonStyleForAction(button,action);
+    QVERIFY(button.buttonType()==BubbleButton::GreenButton);
+
+    action.setSoftKeyRole(QAction::NegativeSoftKey);
+    BubbleUtils::setButtonStyleForAction(button,action);
+    QVERIFY(button.buttonType()==BubbleButton::RedButton);
+}
+
+void ut_BubbleUtils::test_voiceCallStatusIcon()
+{
+    HbIconItem icon;
+    icon.hide();
+
+    // test different voice call states
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Incoming, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="voice_call_waiting_anim");
+    QVERIFY(icon.isVisible()==true);
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Waiting, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="voice_call_waiting_anim");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Alerting, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="voice_call_waiting_anim");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Active, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="qtg_large_active_call");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Outgoing, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="qtg_large_active_call");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::OnHold, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="qtg_large_waiting_call");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Disconnected, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="qtg_large_end_call");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::AlertToDisconnected, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="qtg_large_end_call");
+
+    icon.hide();
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::None, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="");
+    QVERIFY(icon.isVisible()==false);
+}
+
+void ut_BubbleUtils::test_videoCallStatusIcon()
+{
+    HbIconItem icon;
+    icon.hide();
+
+    // test different voice call states
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Incoming, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="video_call_waiting_anim");
+    QVERIFY(icon.isVisible()==true);
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Waiting, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="video_call_waiting_anim");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Alerting, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="video_call_waiting_anim");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Active, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="qtg_large_video_call_active");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Outgoing, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="qtg_large_video_call_active");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::OnHold, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="qtg_large_video_call_waiting");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Disconnected, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="qtg_large_end_call");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::AlertToDisconnected, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="qtg_large_end_call");
+
+    icon.hide();
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::None, BubbleManagerIF::Video, icon);
+    QVERIFY(icon.iconName()=="");
+    QVERIFY(icon.isVisible()==false);
+}
+
+void ut_BubbleUtils::test_voipCallStatusIcon()
+{
+    HbIconItem icon;
+    icon.hide();
+
+    // test different voice call states
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Incoming, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="voip_call_waiting_anim");
+    QVERIFY(icon.isVisible()==true);
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Waiting, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="voip_call_waiting_anim");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Alerting, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="voip_call_waiting_anim");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Active, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="qtg_large_voip_call_active");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Outgoing, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="qtg_large_voip_call_active");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::OnHold, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="qtg_large_voip_call_waiting");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::Disconnected, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="qtg_large_end_call");
+
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::AlertToDisconnected, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="qtg_large_end_call");
+
+    icon.hide();
+    BubbleUtils::setCallStatusIcon(
+        BubbleManagerIF::None, BubbleManagerIF::VoIPCall, icon);
+    QVERIFY(icon.iconName()=="");
+    QVERIFY(icon.isVisible()==false);
+}
+
+void ut_BubbleUtils::test_numberTypeIcon()
+{
+    HbIconItem icon;
+    icon.hide();
+
+    BubbleUtils::setNumberTypeIcon(
+        BubbleManagerIF::Incoming, BubbleManagerIF::Diverted, icon);
+    QVERIFY(icon.iconName()==":/qtg_mono_call_diverted.svg");
+    QVERIFY(icon.isVisible()==true);
+
+    BubbleUtils::setNumberTypeIcon(
+        BubbleManagerIF::Waiting, BubbleManagerIF::Diverted, icon);
+    QVERIFY(icon.iconName()==":/qtg_mono_call_diverted.svg");
+    QVERIFY(icon.isVisible()==true);
+
+    BubbleUtils::setNumberTypeIcon(
+        BubbleManagerIF::Incoming, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="");
+    QVERIFY(icon.isVisible()==false);
+}
+
+void ut_BubbleUtils::test_cipheringIcon()
+{
+    HbIconItem icon;
+    icon.hide();
+
+    BubbleUtils::setCipheringIcon(
+        BubbleManagerIF::Incoming, BubbleManagerIF::NoCiphering, icon);
+    QVERIFY(icon.iconName()=="qtg_mono_ciphering_off");
+    QVERIFY(icon.isVisible()==true);
+
+    BubbleUtils::setCipheringIcon(
+        BubbleManagerIF::Incoming, BubbleManagerIF::Normal, icon);
+    QVERIFY(icon.iconName()=="");
+    QVERIFY(icon.isVisible()==false);
+}
+
+BUBBLE_TEST_MAIN(ut_BubbleUtils)
+#include "ut_bubbleutils.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/bubblemanager2/tsrc/unit/ut_bubbleutils/ut_bubbleutils.pro	Fri Jun 04 10:19:18 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:
+#
+#
+
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += . ../../../bubblecore/src
+INCLUDEPATH += . ../../../bubblecore/src ../../../inc ../shared
+CONFIG += hb qtestlib
+
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+} else:win32 {
+    DESTDIR = ./
+}
+
+HEADERS += ../../../bubblecore/src/bubblebutton.h
+
+SOURCES += ut_bubbleutils.cpp \
+           ../../../bubblecore/src/bubbleheader.cpp \
+           ../../../bubblecore/src/bubbleconferenceheader.cpp \
+           ../../../bubblecore/src/bubbleutils.cpp \
+           ../../../bubblecore/src/bubblebutton.cpp
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/group/bld.inf	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,20 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Build phoneuis.
+*              
+*/ 
+
+#include "../telephonydevicemode/group/bld.inf"
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/inc/tflogger.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2002-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 __TFLOGGER_H__
+#define __TFLOGGER_H__
+
+#include <flogger.h>
+#include <e32svr.h>
+
+_LIT(KTfLogFolder, "ussd");
+_LIT(KTfLogFile, "ussdeditor.txt");
+
+/**
+* ------------------------------------------------------------------------------
+*
+*  Remove #define LOGGING_ENABLED from comments to enable logging
+*
+* ------------------------------------------------------------------------------
+*/
+
+#ifdef _DEBUG 
+#define LOGGING_ENABLED
+#endif
+
+/**
+* ------------------------------------------------------------------------------
+*
+*  LOGGING MACROs
+*
+*  USE THESE MACROS IN YOUR CODE
+*
+*  Example: TFLOGTEXT(own_desc)
+*  Example: TFLOGSTRING("Test")
+*  Example: TFLOGSTRING("Test %i", aValue)
+*  Example: TFLOGSTRING("Test %i %i", aValue1, aValue2)
+*
+* ------------------------------------------------------------------------------
+*/
+
+#ifdef LOGGING_ENABLED
+
+    #define TFLOGTEXT(TEXT) \
+        {  \
+        RFileLogger::Write(KTfLogFolder,KTfLogFile, \
+            EFileLoggingModeAppend, TEXT); \
+        RDebug::Print(TEXT); \
+        }
+
+    #define TFLOGSTRING(TEXT) \
+        { \
+        _LIT(tempLogDes, TEXT); \
+        RFileLogger::Write(\
+            KTfLogFolder, \
+            KTfLogFile, \
+            EFileLoggingModeAppend, \
+            tempLogDes()); \
+        RDebug::Print(_L(TEXT)); \
+        }
+
+    #define TFLOGSTRING2(TEXT, VAR1) \
+        { \
+        _LIT(tempLogDes, TEXT); \
+        RFileLogger::WriteFormat(\
+            KTfLogFolder, \
+            KTfLogFile, \
+            EFileLoggingModeAppend, \
+            TRefByValue<const TDesC>(tempLogDes()), VAR1); \
+        RDebug::Print(_L(TEXT), VAR1); \
+        }
+
+    #define TFLOGSTRING3(TEXT, VAR1, VAR2) \
+        { \
+        _LIT(tempLogDes, TEXT); \
+        RFileLogger::WriteFormat(\
+            KTfLogFolder, \
+            KTfLogFile, \
+            EFileLoggingModeAppend, \
+            TRefByValue<const TDesC>(tempLogDes()), VAR1, VAR2); \
+        RDebug::Print(_L(TEXT), VAR1, VAR2); \
+        }
+
+#else
+
+    #define TFLOGTEXT(TEXT)
+    #define TFLOGSTRING(TEXT)
+    #define TFLOGSTRING2(TEXT, VAR1)
+    #define TFLOGSTRING3(TEXT, VAR1, VAR2)
+
+#endif // LOGGING_ENABLED
+
+#endif // __TFLOGGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/inc/ussdcomms.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* 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 USSDCOMMS_H
+#define USSDCOMMS_H
+
+#include <QObject>
+
+class CPhCltUssdInt;
+
+class CUssdComms: public QObject
+{
+    Q_OBJECT
+
+public:
+    CUssdComms(QObject* parent);
+    ~CUssdComms();
+
+public slots:
+    void appStarting();
+    void appTerminating();
+    void appToBackground();
+    void appToForeground();
+    void informExitReason(int aExitReason);
+
+public:
+    int send( const QString& message );
+    void cancel();
+    int errorCode();
+
+private: // Data
+
+    /** USSD server client api */
+    CPhCltUssdInt *mUssd;
+
+    /** error code */
+    int mErrorCode;
+};
+
+#endif // USSDCOMMS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/inc/ussdeditorquery.h	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* 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 USSDEDITORQUERY_H
+#define USSDEDITORQUERY_H
+
+// INCLUDES
+#include <hbinputdialog.h>
+
+class CUssdComms;
+
+class UssdEditorQuery: public HbInputDialog
+{
+    Q_OBJECT
+
+public:
+    UssdEditorQuery( CUssdComms &ussd, QGraphicsItem *parent = 0);
+    ~UssdEditorQuery();
+
+private slots:
+    void sendUssdString();
+    void cancelUssdString();
+    void updateButtonVisible( const QString &text );
+private:
+    // From main.cpp
+    CUssdComms &mComms;
+};
+
+#endif // USSDEDITORQUERY_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/rom/ussdeditor.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,26 @@
+;
+; 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: IBY file for satapp application
+;
+;
+
+#ifndef __USSDEDITOR_IBY__
+#define __USSDEDITOR_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\ussdeditor.exe                  SHARED_LIB_DIR\ussdeditor.exe
+data=ZSYSTEM\install\ussdeditor_stub.sis               system\install\ussdeditor_stub.sis
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/rom/ussdeditor.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,34 @@
+;
+; 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: For packing sat application update.
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"ussdeditor"},(0x10005955),10,1,0, TYPE=PU 
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/ussdeditor.exe"    - "!:\sys\bin\ussdeditor.exe"
+"/epoc32/data/z/resource/apps/ussdeditor.rsc"    - "!:\resource\apps\ussdeditor.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/ussdeditor_reg.rsc"    - "!:\private\10003a3f\import\apps\ussdeditor_reg.rsc"
+
+; Manual PKG post-rules from PRO files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/rom/ussdeditor_stub.pkg	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,31 @@
+;
+; Copyright (c) 2009-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: For packing sat application stub.
+;
+; Languages
+&EN
+
+; Header
+#{"ussdeditor"}, (0x10005955), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Files
+""-"z:\sys\bin\ussdeditor.exe"
+""-"z:\resource\apps\ussdeditor.rsc"
+""-"z:\private\10003a3f\import\apps\ussdeditor_reg.rsc"
Binary file phoneuis/ussdeditor/rom/ussdeditor_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/rom/ussdeditorresources.iby	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* 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:  Ussdeditor Resources iby file
+*
+*/
+
+
+#ifndef __USSDEDITOR_RESOURCES_IBY__
+#define __USSDEDITOR_RESOURCES_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\RESOURCE_FILES_DIR\ussdeditor.rsc RESOURCE_FILES_DIR\ussdeditor.rsc
+data=ZPRIVATE\10003a3f\import\apps\ussdeditor_reg.rsc  private\10003a3f\import\apps\ussdeditor_reg.rsc
+
+//data=DATAZ_\QT_TRANSLATIONS_DIR\phcltsrvussd.qm QT_TRANSLATIONS_DIR\phcltsrvussd.qm
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/src/main.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* 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 FILES
+#include <hbapplication.h>
+#include <hbmainwindow.h> 
+#include <hbview.h>
+
+#include "ussdeditorquery.h"
+#include "ussdcomms.h"
+#include "tflogger.h"
+
+// ---------------------------------------------------------
+// main()
+// Entry point function
+// Returns: 0: success
+// ---------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+    TFLOGSTRING("USSDEDITOR: main IN")
+
+    // Create application instance
+    HbApplication application(argc, argv);
+    TFLOGSTRING("USSDEDITOR: main app")
+    
+    // Create main widow
+    HbMainWindow window;
+    window.show();
+    TFLOGSTRING("USSDEDITOR: main window")
+   
+    // Add a virtual view and hidden it
+    HbView *view = new HbView();
+    // TODO: Still show
+    view->setViewFlags(HbView::ViewStatusBarHidden);
+    view->setViewFlags(HbView::ViewTitleBarHidden);
+    window.addView(view);
+    TFLOGSTRING("USSDEDITOR: main addView")
+
+    // Create CUssdComms - ussd client
+    CUssdComms *ussdComms = new CUssdComms(view);
+    TFLOGSTRING("USSDEDITOR: main ussdComms")
+    
+    // Create HbInputDialog
+    UssdEditorQuery *query = new UssdEditorQuery(*ussdComms);
+    query->show();
+    TFLOGSTRING("USSDEDITOR: main query")
+   
+    // Execute application loop
+    int result = application.exec();
+    TFLOGSTRING2("USSDEDITOR: main application OUT %d", result)
+    delete query;
+    query = 0;
+    return result;
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/src/ussdcomms.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,154 @@
+/*
+* 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 FILES
+#include <e32base.h>
+#include <cphcltussdint.h>
+
+#include "ussdcomms.h"
+#include "tflogger.h"
+
+// The maximum length of editor lines.
+const TInt KUssdEditorMaxLength = 182;
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CUssdComms::CUssdComms
+// Constructor.
+// -----------------------------------------------------------------------------
+//
+CUssdComms::CUssdComms(QObject *parent)
+    : QObject(parent),
+      mUssd(NULL), 
+      mErrorCode(static_cast<int>(EPhCltExitReasonUnknown))
+{
+    // Default value - ETrue
+    TRAP_IGNORE(mUssd = CPhCltUssdInt::NewL());
+    TFLOGSTRING("USSDEDITOR: CUssdComms::CUssdComms")
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::~CUssdComms
+// ~CUssdComms.
+// -----------------------------------------------------------------------------
+//
+CUssdComms::~CUssdComms()
+{
+    if (mUssd){
+        mErrorCode = mUssd->AppTerminating(
+            static_cast<TPhCltUssdAppExitReason>(mErrorCode));
+        delete mUssd;
+        mUssd = NULL;
+        TFLOGSTRING2("USSDEDITOR: CUssdComms::~CUssdComms %d", mErrorCode)
+    }
+    TFLOGSTRING("USSDEDITOR: CUssdComms::~CUssdComms")
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::appStarting
+// appStarting.
+// -----------------------------------------------------------------------------
+//
+void CUssdComms::appStarting()
+{
+    mErrorCode = mUssd->AppStarting();
+    TFLOGSTRING("USSDEDITOR: CUssdComms::appStarting")
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::appTerminating
+// appTerminating.
+// -----------------------------------------------------------------------------
+//
+void CUssdComms::appTerminating()
+{
+    mErrorCode = mUssd->AppTerminating(EPhCltUserExit);
+    TFLOGSTRING("USSDEDITOR: CUssdComms::appTerminating")
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::appToBackground
+// appToBackground.
+// -----------------------------------------------------------------------------
+//
+void CUssdComms::appToBackground()
+{
+    mErrorCode = mUssd->AppToBackground();
+    TFLOGSTRING("USSDEDITOR: CUssdComms::appToBackground")
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::appToForeground
+// appToForeground.
+// -----------------------------------------------------------------------------
+//
+void CUssdComms::appToForeground()
+{
+    mErrorCode = mUssd->AppToForeground();
+    TFLOGSTRING("USSDEDITOR: CUssdComms::appToForeground")
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::send
+// send.
+// -----------------------------------------------------------------------------
+//
+int CUssdComms::send( const QString& message )
+{
+    TBuf<KUssdEditorMaxLength> buf16;
+    buf16.Copy((const TUint16*)message.constData(), message.length());
+    mErrorCode = mUssd->SendUssd(buf16);
+    TFLOGSTRING("USSDEDITOR: CUssdComms::send")
+    return mErrorCode;
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::cancel
+// cancel.
+// -----------------------------------------------------------------------------
+//
+void CUssdComms::cancel()
+{
+    mUssd->SendUssdCancel();
+    TFLOGSTRING("USSDEDITOR: CUssdComms::cancel")
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::errorCode
+// errorCode.
+// -----------------------------------------------------------------------------
+//
+int CUssdComms::errorCode()
+{
+    TFLOGSTRING("USSDEDITOR: CUssdComms::send")
+    return mErrorCode;
+}
+
+// -----------------------------------------------------------------------------
+// CUssdComms::informExitReason
+// informExitReason.
+// -----------------------------------------------------------------------------
+//
+void CUssdComms::informExitReason(int aExitReason)
+{
+    TFLOGSTRING2("USSDEDITOR: CUssdComms::informExitReason \
+        %d", aExitReason) 
+    mErrorCode = aExitReason;
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/src/ussdeditorquery.cpp	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,144 @@
+/*
+* 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 FILES
+#include <hbinputeditorinterface.h>
+#include <hbaction.h>
+#include <hbinputstandardfilters.h>
+#include <hbinputfilter.h> 
+#include <hbinputstate.h> 
+#include <hbinputvkbhost.h>
+#include <hbapplication.h>
+#include <cphcltussdint.h>
+
+#include "tflogger.h"
+#include "ussdcomms.h"
+#include "ussdeditorquery.h"
+
+// CONSTANTS
+// The maximum number of editor lines method NumberOfEditorLines can return.
+const TInt KUssdMaxNumberOfEditorLines = 16;
+// The maximum length of editor lines.
+const TInt KUssdEditorMaxLength = 182;
+
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// UssdEditorQuery::UssdEditorQuery
+// Constructor.
+// -----------------------------------------------------------------------------
+//
+UssdEditorQuery::UssdEditorQuery(CUssdComms &ussd, QGraphicsItem *parent)
+    :HbInputDialog(parent), mComms(ussd)
+{
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::UssdEditorQuery IN")
+    setPromptText(hbTrId("Reply"));
+
+    if (lineEdit()){
+        // Set max length and rows
+        lineEdit()->setMaxLength(KUssdEditorMaxLength);
+        lineEdit()->setMaxRows(KUssdMaxNumberOfEditorLines);
+        lineEdit()->setText(QString());
+
+        // 0-9, *, +, #
+        HbEditorInterface interface(lineEdit());
+        interface.setFilter(HbPhoneNumberFilter::instance());
+        // TODO: cannot open keypad
+        interface.vkbHost()->openKeypad();
+
+        mComms.appStarting();
+        // Disable Ok key by default
+        primaryAction()->setEnabled(false);
+
+        bool ret(false);
+        ret = connect(primaryAction(), SIGNAL(triggered(bool)),
+                      this, SLOT(sendUssdString()));
+        TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::UssdEditorQuery \
+            connect send %d", ret);  
+        
+        ret = connect(lineEdit(), SIGNAL(textChanged(QString)),
+                      this, SLOT(updateButtonVisible(QString)));
+        TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::UssdEditorQuery \
+            connect ok button %d", ret);
+        
+        // Connect cancel
+        ret = connect(secondaryAction(), SIGNAL(triggered(bool)),
+                      this, SLOT(cancelUssdString()));
+        TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::UssdEditorQuery \
+            connect send %d", ret);
+    }
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::UssdEditorQuery OUT")
+}
+
+// -----------------------------------------------------------------------------
+// UssdEditorQuery::~UssdEditorQuery
+// ~UssdEditorQuery.
+// -----------------------------------------------------------------------------
+//
+UssdEditorQuery::~UssdEditorQuery()
+{
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::~UssdEditorQuery IN-OUT")
+}
+
+// -----------------------------------------------------------------------------
+// UssdEditorQuery::sendUssdString
+// sendUssdString.
+// -----------------------------------------------------------------------------
+//
+void UssdEditorQuery::sendUssdString()
+{
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::sendUssdString IN"); 
+    if (lineEdit() && 
+        0 < lineEdit()->text().length() &&
+        KUssdEditorMaxLength >= lineEdit()->text().length()) {
+        int ret = mComms.send(lineEdit()->text());
+        TFLOGSTRING2("USSDEDITOR: UssdEditorQuery::sendUssdString %d", ret);
+        mComms.informExitReason(static_cast<int>(EPhCltSendCompleted));
+    }
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::sendUssdString OUT");
+    HbApplication::quit();
+}
+
+// -----------------------------------------------------------------------------
+// UssdEditorQuery::cancelUssdString
+// cancelUssdString.
+// -----------------------------------------------------------------------------
+//
+void UssdEditorQuery::cancelUssdString()
+{
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::cancelUssdString IN-OUT"); 
+    mComms.informExitReason((EPhCltUserExit));
+    HbApplication::quit();
+}
+
+// -----------------------------------------------------------------------------
+// UssdEditorQuery::updateButtonVisible
+// updateButtonVisible.
+// -----------------------------------------------------------------------------
+//
+void UssdEditorQuery::updateButtonVisible( const QString &text )
+{
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::updateButtonVisible IN"); 
+    if (text.length() > 0) {
+        primaryAction()->setEnabled(true);
+    } else {
+        primaryAction()->setEnabled(false);
+    }
+    TFLOGSTRING("USSDEDITOR: UssdEditorQuery::updateOkButton OUT");
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/ussdeditor/ussdeditor.pro	Fri Jun 04 10:19:18 2010 +0100
@@ -0,0 +1,57 @@
+#
+# 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
+#the application will be "invisible"
+CONFIG += no_icon
+
+TARGET = ussdeditor
+DEPENDPATH += .
+HEADERS += $$PUBLIC_HEADERS
+MOC_DIR = moc
+
+CONFIG += hb
+
+symbian: {
+
+TARGET.CAPABILITY = CAP_GENERAL_DLL
+TARGET.UID3 = 0x10005955
+
+INCLUDEPATH += . 
+INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE 
+INCLUDEPATH += MOC_DIR
+
+LIBS += -lphoneclient
+LIBS += -lflogger
+
+SOURCES += src\main.cpp
+SOURCES += src\ussdeditorquery.cpp
+SOURCES += src\ussdcomms.cpp 
+
+HEADERS += inc\ussdeditorquery.h 
+HEADERS += inc\ussdcomms.h
+HEADERS += inc\tflogger.h
+
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+                             "rom/ussdeditor.iby CORE_APP_LAYER_IBY_EXPORT_PATH(ussdeditor.iby)" \
+                             "rom/ussdeditorresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(ussdeditorresources.iby)" \
+                             "rom/ussdeditor_stub.sis /epoc32/data/z/system/install/ussdeditor_stub.sis"
+
+#The next line will be opened when the official translations already
+#TRANSLATIONS = phcltsrvussd.ts
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd	Fri Jun 04 10:19:18 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>